From fd79ac918b8feaacebe9719adaac97dffb69137a Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 13 Oct 2004 05:06:08 +0000 Subject: 2004-10-13 Paul Jakma * (global) more const'ification and fixups of types to clean up code. * bgp_mplsvpn.{c,h}: (str2tag) fix abuse. Still not perfect, should use something like the VTY_GET_INTEGER macro, but without the vty_out bits.. * bgp_routemap.c: (set_aggregator_as) use VTY_GET_INTEGER_RANGE (no_set_aggregator_as) ditto. * bgpd.c: (peer_uptime) fix unlikely bug, where no buffer is returned, add comments about troublesome return value. --- bgpd/bgp_community.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'bgpd/bgp_community.c') diff --git a/bgpd/bgp_community.c b/bgpd/bgp_community.c index 54679710..1a6514bc 100644 --- a/bgpd/bgp_community.c +++ b/bgpd/bgp_community.c @@ -401,7 +401,7 @@ community_hash_make (struct community *com) } int -community_match (struct community *com1, struct community *com2) +community_match (const struct community *com1, const struct community *com2) { int i = 0; int j = 0; @@ -432,7 +432,7 @@ community_match (struct community *com1, struct community *com2) /* If two aspath have same value then return 1 else return 0. This function is used by hash package. */ int -community_cmp (struct community *com1, struct community *com2) +community_cmp (const struct community *com1, const struct community *com2) { if (com1 == NULL && com2 == NULL) return 1; @@ -472,10 +472,11 @@ enum community_token }; /* Get next community token from string. */ -char * -community_gettoken (char *buf, enum community_token *token, u_int32_t *val) +const char * +community_gettoken (const char *buf, enum community_token *token, + u_int32_t *val) { - char *p = buf; + const char *p = buf; /* Skip white space. */ while (isspace ((int) *p)) @@ -570,7 +571,7 @@ community_gettoken (char *buf, enum community_token *token, u_int32_t *val) /* convert string to community structure */ struct community * -community_str2com (char *str) +community_str2com (const char *str) { struct community *com = NULL; struct community *com_sort = NULL; -- cgit v1.2.1