diff options
Diffstat (limited to 'bgpd/bgp_clist.c')
-rw-r--r-- | bgpd/bgp_clist.c | 48 |
1 files changed, 2 insertions, 46 deletions
diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c index 2e03f48d..0b6a2e8c 100644 --- a/bgpd/bgp_clist.c +++ b/bgpd/bgp_clist.c @@ -269,7 +269,7 @@ community_list_delete (struct community_list *list) community_list_free (list); } -int +int community_list_empty_p (struct community_list *list) { return (list->head == NULL && list->tail == NULL) ? 1 : 0; @@ -364,26 +364,6 @@ community_regexp_match (struct community *com, regex_t *reg) return 0; } -static int -ecommunity_regexp_match (struct ecommunity *ecom, regex_t *reg) -{ - char *str; - - /* When there is no communities attribute it is treated as empty - string. */ - if (ecom == NULL || ecom->size == 0) - str = ""; - else - str = ecommunity_str (ecom); - - /* Regular expression match. */ - if (regexec (reg, str, 0, NULL, 0) == 0) - return 1; - - /* No match. */ - return 0; -} - /* Delete community attribute using regular expression match. Return modified communites attribute. */ static struct community * @@ -461,30 +441,6 @@ community_list_match (struct community *com, struct community_list *list) return 0; } -int -ecommunity_list_match (struct ecommunity *ecom, struct community_list *list) -{ - struct community_entry *entry; - - for (entry = list->head; entry; entry = entry->next) - { - if (entry->any) - return entry->direct == COMMUNITY_PERMIT ? 1 : 0; - - if (entry->style == EXTCOMMUNITY_LIST_STANDARD) - { - if (ecommunity_match (ecom, entry->u.ecom)) - return entry->direct == COMMUNITY_PERMIT ? 1 : 0; - } - else if (entry->style == EXTCOMMUNITY_LIST_EXPANDED) - { - if (ecommunity_regexp_match (ecom, entry->reg)) - return entry->direct == COMMUNITY_PERMIT ? 1 : 0; - } - } - return 0; -} - /* Perform exact matching. In case of expanded community-list, do same thing as community_list_match(). */ int @@ -514,7 +470,7 @@ community_list_exact_match (struct community *com, struct community_list *list) return 0; } -/* Delete all permitted communities in the list from com. */ +/* Delete all permitted communities in the list from com1 */ struct community * community_list_match_delete (struct community *com, struct community_list *list) |