]> git.puffer.fish Git - mirror/frr.git/commitdiff
Sync with changes in lib. Make more strings const.
authorhasso <hasso>
Mon, 11 Oct 2004 12:57:57 +0000 (12:57 +0000)
committerhasso <hasso>
Mon, 11 Oct 2004 12:57:57 +0000 (12:57 +0000)
12 files changed:
ripd/ChangeLog
ripd/rip_interface.c
ripd/rip_offset.c
ripd/rip_routemap.c
ripd/rip_zebra.c
ripd/ripd.c
ripngd/ChangeLog
ripngd/ripng_interface.c
ripngd/ripng_offset.c
ripngd/ripng_routemap.c
ripngd/ripng_zebra.c
ripngd/ripngd.c

index 18b3c65e32fb0e0778e748ebb3e61bd4c9190df1..8327abf87d29bb18e885204f20241b2031a59ced 100644 (file)
@@ -1,3 +1,7 @@
+2004-10-11 Hasso Tepper <hasso at quagga.net>
+
+       * *.c: Make more strings const.
+
 2004-10-08 Hasso Tepper <hasso at quagga.net>
 
        * *.c: Fix compiler warnings: make strings const, signed -> unsigned
index cbb4d3e2495494d6e5b8fa1148131d1ba70dc0f6..509d5ed5d0085a92dd6eba2c3643d9f669db296d 100644 (file)
@@ -44,7 +44,7 @@
 void rip_enable_apply (struct interface *);
 void rip_passive_interface_apply (struct interface *);
 int rip_if_down(struct interface *ifp);
-int rip_enable_if_lookup (char *ifname);
+int rip_enable_if_lookup (const char *ifname);
 int rip_enable_network_lookup2 (struct connected *connected);
 void rip_enable_apply_all ();
 
@@ -986,7 +986,7 @@ rip_enable_network_delete (struct prefix *p)
 
 /* Check interface is enabled by ifname statement. */
 int
-rip_enable_if_lookup (char *ifname)
+rip_enable_if_lookup (const char *ifname)
 {
   unsigned int i;
   char *str;
@@ -1000,7 +1000,7 @@ rip_enable_if_lookup (char *ifname)
 
 /* Add interface to rip_enable_if. */
 int
-rip_enable_if_add (char *ifname)
+rip_enable_if_add (const char *ifname)
 {
   int ret;
 
@@ -1017,7 +1017,7 @@ rip_enable_if_add (char *ifname)
 
 /* Delete interface from rip_enable_if. */
 int
-rip_enable_if_delete (char *ifname)
+rip_enable_if_delete (const char *ifname)
 {
   int index;
   char *str;
@@ -1268,7 +1268,7 @@ rip_clean_network ()
 \f
 /* Utility function for looking up passive interface settings. */
 int
-rip_passive_nondefault_lookup (char *ifname)
+rip_passive_nondefault_lookup (const char *ifname)
 {
   unsigned int i;
   char *str;
@@ -1309,7 +1309,7 @@ rip_passive_interface_apply_all ()
 
 /* Passive interface. */
 int
-rip_passive_nondefault_set (struct vty *vty, char *ifname)
+rip_passive_nondefault_set (struct vty *vty, const char *ifname)
 {
   if (rip_passive_nondefault_lookup (ifname) >= 0)
     return CMD_WARNING;
@@ -1322,7 +1322,7 @@ rip_passive_nondefault_set (struct vty *vty, char *ifname)
 }
 
 int
-rip_passive_nondefault_unset (struct vty *vty, char *ifname)
+rip_passive_nondefault_unset (struct vty *vty, const char *ifname)
 {
   int i;
   char *str;
@@ -1984,7 +1984,7 @@ DEFUN (rip_passive_interface,
        "Interface name\n"
        "default for all interfaces\n")
 {
-  char *ifname = argv[0];
+  const char *ifname = argv[0];
 
   if (!strcmp(ifname,"default")) {
     passive_default = 1;
@@ -2005,7 +2005,7 @@ DEFUN (no_rip_passive_interface,
        "Interface name\n"
        "default for all interfaces\n")
 {
-  char *ifname = argv[0];
+  const char *ifname = argv[0];
 
   if (!strcmp(ifname,"default")) {
     passive_default = 0;
index 0d473482e7f9877450d36af78baef3cab4de5f2b..6899c4d1742958b8c614390d701dd08a43eac0e0 100644 (file)
@@ -47,7 +47,7 @@ struct rip_offset_list
 static struct list *rip_offset_list_master;
 
 int
-strcmp_safe (char *s1, char *s2)
+strcmp_safe (const char *s1, const char *s2)
 {
   if (s1 == NULL && s2 == NULL)
     return 0;
@@ -75,7 +75,7 @@ rip_offset_list_free (struct rip_offset_list *offset)
 }
 
 struct rip_offset_list *
-rip_offset_list_lookup (char *ifname)
+rip_offset_list_lookup (const char *ifname)
 {
   struct rip_offset_list *offset;
   struct listnode *nn;
@@ -89,7 +89,7 @@ rip_offset_list_lookup (char *ifname)
 }
 
 struct rip_offset_list *
-rip_offset_list_get (char *ifname)
+rip_offset_list_get (const char *ifname)
 {
   struct rip_offset_list *offset;
   
@@ -106,8 +106,8 @@ rip_offset_list_get (char *ifname)
 }
 
 int
-rip_offset_list_set (struct vty *vty, char *alist, char *direct_str,
-                    char *metric_str, char *ifname)
+rip_offset_list_set (struct vty *vty, const char *alist, const char *direct_str,
+                    const char *metric_str, const char *ifname)
 {
   int direct;
   int metric;
@@ -144,8 +144,9 @@ rip_offset_list_set (struct vty *vty, char *alist, char *direct_str,
 }
 
 int
-rip_offset_list_unset (struct vty *vty, char *alist, char *direct_str,
-                      char *metric_str, char *ifname)
+rip_offset_list_unset (struct vty *vty, const char *alist,
+                      const char *direct_str, const char *metric_str,
+                      const char *ifname)
 {
   int direct;
   int metric;
index ffe13170b522e9f5b6a9b388008c518828e16677..e9dae2a308f8eb8f8f1ace008b5b7074b3c14e1b 100644 (file)
@@ -47,7 +47,7 @@ struct rip_metric_modifier
 /* Add rip route map rule. */
 int
 rip_route_match_add (struct vty *vty, struct route_map_index *index,
-                    const char *command, char *arg)
+                    const char *command, const char *arg)
 {
   int ret;
 
@@ -70,7 +70,7 @@ rip_route_match_add (struct vty *vty, struct route_map_index *index,
 /* Delete rip route map rule. */
 int
 rip_route_match_delete (struct vty *vty, struct route_map_index *index,
-                       const char *command, char *arg)
+                       const char *command, const char *arg)
 {
   int ret;
 
@@ -93,7 +93,7 @@ rip_route_match_delete (struct vty *vty, struct route_map_index *index,
 /* Add rip route map rule. */
 int
 rip_route_set_add (struct vty *vty, struct route_map_index *index,
-                  const char *command, char *arg)
+                  const char *command, const char *arg)
 {
   int ret;
 
@@ -116,7 +116,7 @@ rip_route_set_add (struct vty *vty, struct route_map_index *index,
 /* Delete rip route map rule. */
 int
 rip_route_set_delete (struct vty *vty, struct route_map_index *index,
-                     const char *command, char *arg)
+                     const char *command, const char *arg)
 {
   int ret;
 
@@ -139,7 +139,7 @@ rip_route_set_delete (struct vty *vty, struct route_map_index *index,
 /* Hook function for updating route_map assignment. */
 /* ARGSUSED */
 void
-rip_route_map_update (char *notused)
+rip_route_map_update (const char *notused)
 {
   int i;
 
@@ -178,7 +178,7 @@ route_match_metric (void *rule, struct prefix *prefix,
 
 /* Route map `match metric' match statement. `arg' is METRIC value */
 void *
-route_match_metric_compile (char *arg)
+route_match_metric_compile (const char *arg)
 {
   u_int32_t *metric;
 
@@ -239,7 +239,7 @@ route_match_interface (void *rule, struct prefix *prefix,
 /* Route map `match interface' match statement. `arg' is IFNAME value */
 /* XXX I don`t know if I need to check does interface exist? */
 void *
-route_match_interface_compile (char *arg)
+route_match_interface_compile (const char *arg)
 {
   return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
 }
@@ -291,7 +291,7 @@ route_match_ip_next_hop (void *rule, struct prefix *prefix,
 /* Route map `ip next-hop' match statement.  `arg' should be
    access-list name. */
 void *
-route_match_ip_next_hop_compile (char *arg)
+route_match_ip_next_hop_compile (const char *arg)
 {
   return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
 }
@@ -340,7 +340,7 @@ route_match_ip_next_hop_prefix_list (void *rule, struct prefix *prefix,
 }
 
 void *
-route_match_ip_next_hop_prefix_list_compile (char *arg)
+route_match_ip_next_hop_prefix_list_compile (const char *arg)
 {
   return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
 }
@@ -384,7 +384,7 @@ route_match_ip_address (void *rule, struct prefix *prefix,
 /* Route map `ip address' match statement.  `arg' should be
    access-list name. */
 void *
-route_match_ip_address_compile (char *arg)
+route_match_ip_address_compile (const char *arg)
 {
   return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
 }
@@ -426,7 +426,7 @@ route_match_ip_address_prefix_list (void *rule, struct prefix *prefix,
 }
 
 void *
-route_match_ip_address_prefix_list_compile (char *arg)
+route_match_ip_address_prefix_list_compile (const char *arg)
 {
   return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
 }
@@ -470,7 +470,7 @@ route_match_tag (void *rule, struct prefix *prefix,
 
 /* Route map `match tag' match statement. `arg' is TAG value */
 void *
-route_match_tag_compile (char *arg)
+route_match_tag_compile (const char *arg)
 {
   u_short *tag;
 
@@ -530,10 +530,10 @@ route_set_metric (void *rule, struct prefix *prefix,
 
 /* set metric compilation. */
 void *
-route_set_metric_compile (char *arg)
+route_set_metric_compile (const char *arg)
 {
   int len;
-  char *pnt;
+  const char *pnt;
   int type;
   long metric;
   char *endptr = NULL;
@@ -621,7 +621,7 @@ route_set_ip_nexthop (void *rule, struct prefix *prefix,
 /* Route map `ip nexthop' compile function.  Given string is converted
    to struct in_addr structure. */
 void *
-route_set_ip_nexthop_compile (char *arg)
+route_set_ip_nexthop_compile (const char *arg)
 {
   int ret;
   struct in_addr *address;
@@ -681,7 +681,7 @@ route_set_tag (void *rule, struct prefix *prefix,
 /* Route map `tag' compile function.  Given string is converted
    to u_short. */
 void *
-route_set_tag_compile (char *arg)
+route_set_tag_compile (const char *arg)
 {
   u_short *tag;
 
index 229fb33ae00db9c5f8b466b42c70599e3c2a5a12..d66a776223c83e0c6076e30a265f541472bff074 100644 (file)
@@ -154,7 +154,7 @@ rip_zclient_reset ()
 
 /* RIP route-map set for redistribution */
 void
-rip_routemap_set (int type, char *name)
+rip_routemap_set (int type, const char *name)
 {
   if (rip->route_map[type].name)
     free(rip->route_map[type].name);
@@ -184,7 +184,7 @@ rip_metric_unset (int type, unsigned int metric)
 
 /* RIP route-map unset for redistribution */
 int
-rip_routemap_unset (int type,char *name)
+rip_routemap_unset (int type, const char *name)
 {
   if (! rip->route_map[type].name ||
       (name != NULL && strcmp(rip->route_map[type].name,name)))
index a7998860fba7f43b1750a9d5d47ad16a3c026686..2b4e1b2f79e15ba1efa3da43f72b2616b3e9329d 100644 (file)
@@ -3107,8 +3107,8 @@ rip_distance_free (struct rip_distance *rdistance)
 }
 
 int
-rip_distance_set (struct vty *vty, char *distance_str, char *ip_str,
-                 char *access_list_str)
+rip_distance_set (struct vty *vty, const char *distance_str, const char *ip_str,
+                 const char *access_list_str)
 {
   int ret;
   struct prefix_ipv4 p;
@@ -3154,8 +3154,8 @@ rip_distance_set (struct vty *vty, char *distance_str, char *ip_str,
 }
 
 int
-rip_distance_unset (struct vty *vty, char *distance_str, char *ip_str,
-                   char *access_list_str)
+rip_distance_unset (struct vty *vty, const char *distance_str,
+                   const char *ip_str, const char *access_list_str)
 {
   int ret;
   struct prefix_ipv4 p;
@@ -3948,7 +3948,7 @@ rip_routemap_update_redistribute (void)
 
 /* ARGSUSED */
 void
-rip_routemap_update (char *notused)
+rip_routemap_update (const char *notused)
 {
   struct interface *ifp;
   struct listnode *node;
index 8fb577b6c5cdd31ff9af959774c65370620e209b..1375b256500604ded9f1cd9b7f765fdab5da6463 100644 (file)
@@ -1,3 +1,7 @@
+2004-10-11 Hasso Tepper <hasso at quagga.net>
+
+       * *.c: Make more strings const.
+
 2004-10-08 Hasso Tepper <hasso at quagga.net>
 
        * *.[c|h]: Fix compiler warnings: make strings const, signed ->
index eb9005c37a9e13e3de6191af657d1e9b37af1574..f5467f978fbfecfe357fac5321e0d5f657a2f70c 100644 (file)
@@ -52,7 +52,7 @@ extern struct zebra_privs_t ripngd_privs;
 /* Static utility function. */
 static void ripng_enable_apply (struct interface *);
 static void ripng_passive_interface_apply (struct interface *);
-int ripng_enable_if_lookup (char *ifname);
+int ripng_enable_if_lookup (const char *ifname);
 int ripng_enable_network_lookup2 (struct connected *connected);
 void ripng_enable_apply_all ();
 
@@ -155,12 +155,12 @@ ripng_if_ipv6_lladdress_check (struct interface *ifp)
 }
 
 /* Check max mtu size. */
-int
+unsigned int
 ripng_check_max_mtu ()
 {
   struct listnode *node;
   struct interface *ifp;
-  int mtu;
+  unsigned int mtu;
 
   mtu = 0;
   for (node = listhead (iflist); node; nextnode (node))
@@ -636,7 +636,7 @@ ripng_enable_network_delete (struct prefix *p)
 
 /* Lookup function. */
 int
-ripng_enable_if_lookup (char *ifname)
+ripng_enable_if_lookup (const char *ifname)
 {
   unsigned int i;
   char *str;
@@ -650,7 +650,7 @@ ripng_enable_if_lookup (char *ifname)
 
 /* Add interface to ripng_enable_if. */
 int
-ripng_enable_if_add (char *ifname)
+ripng_enable_if_add (const char *ifname)
 {
   int ret;
 
@@ -667,7 +667,7 @@ ripng_enable_if_add (char *ifname)
 
 /* Delete interface from ripng_enable_if. */
 int
-ripng_enable_if_delete (char *ifname)
+ripng_enable_if_delete (const char *ifname)
 {
   int index;
   char *str;
@@ -860,7 +860,7 @@ vector Vripng_passive_interface;
 
 /* Utility function for looking up passive interface settings. */
 int
-ripng_passive_interface_lookup (char *ifname)
+ripng_passive_interface_lookup (const char *ifname)
 {
   unsigned int i;
   char *str;
@@ -902,7 +902,7 @@ ripng_passive_interface_apply_all (void)
 
 /* Passive interface. */
 int
-ripng_passive_interface_set (struct vty *vty, char *ifname)
+ripng_passive_interface_set (struct vty *vty, const char *ifname)
 {
   if (ripng_passive_interface_lookup (ifname) >= 0)
     return CMD_WARNING;
@@ -915,7 +915,7 @@ ripng_passive_interface_set (struct vty *vty, char *ifname)
 }
 
 int
-ripng_passive_interface_unset (struct vty *vty, char *ifname)
+ripng_passive_interface_unset (struct vty *vty, const char *ifname)
 {
   int i;
   char *str;
@@ -954,7 +954,7 @@ int
 ripng_network_write (struct vty *vty, int config_mode)
 {
   unsigned int i;
-  char *ifname;
+  const char *ifname;
   struct route_node *node;
   char buf[BUFSIZ];
 
index ab3c46012a1d9394a173afc40d56291b6fac5a99..46e23f0b61d9cd673afc40e148c0bd542cdeb77b 100644 (file)
@@ -51,7 +51,7 @@ struct ripng_offset_list
 static struct list *ripng_offset_list_master;
 
 int
-strcmp_safe (char *s1, char *s2)
+strcmp_safe (const char *s1, const char *s2)
 {
   if (s1 == NULL && s2 == NULL)
     return 0;
@@ -78,7 +78,7 @@ ripng_offset_list_free (struct ripng_offset_list *offset)
 }
 
 struct ripng_offset_list *
-ripng_offset_list_lookup (char *ifname)
+ripng_offset_list_lookup (const char *ifname)
 {
   struct ripng_offset_list *offset;
   struct listnode *nn;
@@ -92,7 +92,7 @@ ripng_offset_list_lookup (char *ifname)
 }
 
 struct ripng_offset_list *
-ripng_offset_list_get (char *ifname)
+ripng_offset_list_get (const char *ifname)
 {
   struct ripng_offset_list *offset;
   
@@ -109,8 +109,9 @@ ripng_offset_list_get (char *ifname)
 }
 
 int
-ripng_offset_list_set (struct vty *vty, char *alist, char *direct_str,
-                      char *metric_str, char *ifname)
+ripng_offset_list_set (struct vty *vty, const char *alist,
+                      const char *direct_str, const char *metric_str,
+                      const char *ifname)
 {
   int direct;
   int metric;
@@ -147,8 +148,9 @@ ripng_offset_list_set (struct vty *vty, char *alist, char *direct_str,
 }
 
 int
-ripng_offset_list_unset (struct vty *vty, char *alist, char *direct_str,
-                        char *metric_str, char *ifname)
+ripng_offset_list_unset (struct vty *vty, const char *alist,
+                        const char *direct_str, const char *metric_str,
+                        const char *ifname)
 {
   int direct;
   int metric;
index a31830106fa6005f98328628771de52ac1ac2a7a..1c17e6c3c3cd6e4449ebd91a0862b1a6ca28058f 100644 (file)
@@ -45,7 +45,7 @@ struct rip_metric_modifier
 \f
 int
 ripng_route_match_add (struct vty *vty, struct route_map_index *index,
-                      const char *command, char *arg)
+                      const char *command, const char *arg)
 {
   int ret;
 
@@ -69,7 +69,7 @@ ripng_route_match_add (struct vty *vty, struct route_map_index *index,
 
 int
 ripng_route_match_delete (struct vty *vty, struct route_map_index *index,
-                         const char *command, char *arg)
+                         const char *command, const char *arg)
 {
   int ret;
 
@@ -93,7 +93,7 @@ ripng_route_match_delete (struct vty *vty, struct route_map_index *index,
 
 int
 ripng_route_set_add (struct vty *vty, struct route_map_index *index,
-                    const char *command, char *arg)
+                    const char *command, const char *arg)
 {
   int ret;
 
@@ -117,7 +117,7 @@ ripng_route_set_add (struct vty *vty, struct route_map_index *index,
 
 int
 ripng_route_set_delete (struct vty *vty, struct route_map_index *index,
-                       const char *command, char *arg)
+                       const char *command, const char *arg)
 {
   int ret;
 
@@ -163,7 +163,7 @@ route_match_metric (void *rule, struct prefix *prefix,
 
 /* Route map `match metric' match statement. `arg' is METRIC value */
 void *
-route_match_metric_compile (char *arg)
+route_match_metric_compile (const char *arg)
 {
   u_int32_t *metric;
 
@@ -223,7 +223,7 @@ route_match_interface (void *rule, struct prefix *prefix,
 
 /* Route map `match interface' match statement. `arg' is IFNAME value */
 void *
-route_match_interface_compile (char *arg)
+route_match_interface_compile (const char *arg)
 {
   return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
 }
@@ -267,7 +267,7 @@ route_match_tag (void *rule, struct prefix *prefix,
 
 /* Route map `match tag' match statement. `arg' is TAG value */
 void *
-route_match_tag_compile (char *arg)
+route_match_tag_compile (const char *arg)
 {
   u_short *tag;
 
@@ -327,10 +327,10 @@ route_set_metric (void *rule, struct prefix *prefix,
 
 /* set metric compilation. */
 void *
-route_set_metric_compile (char *arg)
+route_set_metric_compile (const char *arg)
 {
   int len;
-  char *pnt;
+  const char *pnt;
   int type;
   long metric;
   char *endptr = NULL;
@@ -419,7 +419,7 @@ route_set_ipv6_nexthop_local (void *rule, struct prefix *prefix,
 /* Route map `ipv6 nexthop local' compile function.  Given string is converted
    to struct in6_addr structure. */
 void *
-route_set_ipv6_nexthop_local_compile (char *arg)
+route_set_ipv6_nexthop_local_compile (const char *arg)
 {
   int ret;
   struct in6_addr *address;
@@ -479,7 +479,7 @@ route_set_tag (void *rule, struct prefix *prefix,
 /* Route map `tag' compile function.  Given string is converted
    to u_short. */
 void *
-route_set_tag_compile (char *arg)
+route_set_tag_compile (const char *arg)
 {
   u_short *tag;
 
index 7aaa3537e11b811b1da8a49bc4ff153eb8bea08d..6e582599113bc90eccb3554cf020f076beefb93e 100644 (file)
@@ -184,7 +184,7 @@ ripng_redistribute_metric_unset (int type)
 }
 
 void
-ripng_redistribute_routemap_set (int type, char *name)
+ripng_redistribute_routemap_set (int type, const char *name)
 {
   if (ripng->route_map[type].name)
     free (ripng->route_map[type].name);
index a7254bc143790dee16fd80d251089e6a140b4c57..edf959fa1440b6f2036966460b8adf28268f085d 100644 (file)
@@ -2992,7 +2992,7 @@ ripng_routemap_update_redistribute (void)
 }
 
 void
-ripng_routemap_update (char *unused)
+ripng_routemap_update (const char *unused)
 {
   struct interface *ifp;
   struct listnode *node;