+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
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 ();
/* 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;
/* Add interface to rip_enable_if. */
int
-rip_enable_if_add (char *ifname)
+rip_enable_if_add (const char *ifname)
{
int ret;
/* Delete interface from rip_enable_if. */
int
-rip_enable_if_delete (char *ifname)
+rip_enable_if_delete (const char *ifname)
{
int index;
char *str;
\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;
/* 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;
}
int
-rip_passive_nondefault_unset (struct vty *vty, char *ifname)
+rip_passive_nondefault_unset (struct vty *vty, const char *ifname)
{
int i;
char *str;
"Interface name\n"
"default for all interfaces\n")
{
- char *ifname = argv[0];
+ const char *ifname = argv[0];
if (!strcmp(ifname,"default")) {
passive_default = 1;
"Interface name\n"
"default for all interfaces\n")
{
- char *ifname = argv[0];
+ const char *ifname = argv[0];
if (!strcmp(ifname,"default")) {
passive_default = 0;
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;
}
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;
}
struct rip_offset_list *
-rip_offset_list_get (char *ifname)
+rip_offset_list_get (const char *ifname)
{
struct rip_offset_list *offset;
}
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;
}
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;
/* 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;
/* 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;
/* 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;
/* 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;
/* Hook function for updating route_map assignment. */
/* ARGSUSED */
void
-rip_route_map_update (char *notused)
+rip_route_map_update (const char *notused)
{
int i;
/* 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;
/* 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);
}
/* 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);
}
}
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);
}
/* 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);
}
}
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);
}
/* 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;
/* 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;
/* 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;
/* 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;
/* 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);
/* 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)))
}
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;
}
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;
/* ARGSUSED */
void
-rip_routemap_update (char *notused)
+rip_routemap_update (const char *notused)
{
struct interface *ifp;
struct listnode *node;
+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 ->
/* 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 ();
}
/* 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))
/* Lookup function. */
int
-ripng_enable_if_lookup (char *ifname)
+ripng_enable_if_lookup (const char *ifname)
{
unsigned int i;
char *str;
/* Add interface to ripng_enable_if. */
int
-ripng_enable_if_add (char *ifname)
+ripng_enable_if_add (const char *ifname)
{
int ret;
/* Delete interface from ripng_enable_if. */
int
-ripng_enable_if_delete (char *ifname)
+ripng_enable_if_delete (const char *ifname)
{
int index;
char *str;
/* 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;
/* 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;
}
int
-ripng_passive_interface_unset (struct vty *vty, char *ifname)
+ripng_passive_interface_unset (struct vty *vty, const char *ifname)
{
int i;
char *str;
ripng_network_write (struct vty *vty, int config_mode)
{
unsigned int i;
- char *ifname;
+ const char *ifname;
struct route_node *node;
char buf[BUFSIZ];
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;
}
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;
}
struct ripng_offset_list *
-ripng_offset_list_get (char *ifname)
+ripng_offset_list_get (const char *ifname)
{
struct ripng_offset_list *offset;
}
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;
}
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;
\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;
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;
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;
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;
/* 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;
/* 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);
}
/* 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;
/* 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;
/* 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;
/* 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;
}
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);
}
void
-ripng_routemap_update (char *unused)
+ripng_routemap_update (const char *unused)
{
struct interface *ifp;
struct listnode *node;