if (extra)
{
if (extra->lcommunity)
- MIX(lcommunity_hash_make (extra->lcommunity));
+ MIX(lcommunity_hash_make (extra->lcommunity));
if (extra->ecommunity)
MIX(ecommunity_hash_make (extra->ecommunity));
if (extra->cluster)
if (attr->extra->lcommunity)
lcommunity_unintern (&attr->extra->lcommunity);
UNSET_FLAG(attr->flag, ATTR_FLAG_BIT (BGP_ATTR_LARGE_COMMUNITIES));
-
+
if (attr->extra->cluster)
cluster_unintern (attr->extra->cluster);
UNSET_FLAG(attr->flag, ATTR_FLAG_BIT (BGP_ATTR_CLUSTER_LIST));
if (attre->ecommunity && ! attre->ecommunity->refcnt)
ecommunity_free (&attre->ecommunity);
if (attre->lcommunity && ! attre->lcommunity->refcnt)
- lcommunity_free (&attre->lcommunity);
+ lcommunity_free (&attre->lcommunity);
if (attre->cluster && ! attre->cluster->refcnt)
{
cluster_free (attre->cluster);
[BGP_ATTR_EXT_COMMUNITIES] = BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS,
[BGP_ATTR_AS4_PATH] = BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS,
[BGP_ATTR_AS4_AGGREGATOR] = BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS,
- [BGP_ATTR_LARGE_COMMUNITIES] = BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL
+ [BGP_ATTR_LARGE_COMMUNITIES]= BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS,
};
static const size_t attr_flags_values_max = array_size(attr_flags_values) - 1;
&& (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_LARGE_COMMUNITIES)))
{
if (attr->extra->lcommunity->size * 12 > 255)
- {
- stream_putc (s, BGP_ATTR_FLAG_OPTIONAL|BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_EXTLEN);
- stream_putc (s, BGP_ATTR_LARGE_COMMUNITIES);
- stream_putw (s, attr->extra->lcommunity->size * 12);
- }
+ {
+ stream_putc (s, BGP_ATTR_FLAG_OPTIONAL|BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_EXTLEN);
+ stream_putc (s, BGP_ATTR_LARGE_COMMUNITIES);
+ stream_putw (s, attr->extra->lcommunity->size * 12);
+ }
else
- {
- stream_putc (s, BGP_ATTR_FLAG_OPTIONAL|BGP_ATTR_FLAG_TRANS);
- stream_putc (s, BGP_ATTR_LARGE_COMMUNITIES);
- stream_putc (s, attr->extra->lcommunity->size * 12);
- }
+ {
+ stream_putc (s, BGP_ATTR_FLAG_OPTIONAL|BGP_ATTR_FLAG_TRANS);
+ stream_putc (s, BGP_ATTR_LARGE_COMMUNITIES);
+ stream_putc (s, attr->extra->lcommunity->size * 12);
+ }
stream_put (s, attr->extra->lcommunity->val, attr->extra->lcommunity->size * 12);
}
if (attr->extra && attr->flag & ATTR_FLAG_BIT (BGP_ATTR_LARGE_COMMUNITIES))
{
if (attr->extra->lcommunity->size * 12 > 255)
- {
- stream_putc (s, BGP_ATTR_FLAG_OPTIONAL|BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_EXTLEN);
- stream_putc (s, BGP_ATTR_LARGE_COMMUNITIES);
- stream_putw (s, attr->extra->lcommunity->size * 12);
- }
+ {
+ stream_putc (s, BGP_ATTR_FLAG_OPTIONAL|BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_EXTLEN);
+ stream_putc (s, BGP_ATTR_LARGE_COMMUNITIES);
+ stream_putw (s, attr->extra->lcommunity->size * 12);
+ }
else
- {
- stream_putc (s, BGP_ATTR_FLAG_OPTIONAL|BGP_ATTR_FLAG_TRANS);
- stream_putc (s, BGP_ATTR_LARGE_COMMUNITIES);
- stream_putc (s, attr->extra->lcommunity->size * 12);
- }
+ {
+ stream_putc (s, BGP_ATTR_FLAG_OPTIONAL|BGP_ATTR_FLAG_TRANS);
+ stream_putc (s, BGP_ATTR_LARGE_COMMUNITIES);
+ stream_putc (s, attr->extra->lcommunity->size * 12);
+ }
stream_put (s, attr->extra->lcommunity->val, attr->extra->lcommunity->size * 12);
}
/* Large Communities attribute. */
struct lcommunity *lcommunity;
-
+
/* Route-Reflector Cluster attribute */
struct cluster_list *cluster;
switch (master)
{
case COMMUNITY_LIST_MASTER:
- return &ch->community_list;
+ return &ch->community_list;
case EXTCOMMUNITY_LIST_MASTER:
- return &ch->extcommunity_list;
+ return &ch->extcommunity_list;
case LARGE_COMMUNITY_LIST_MASTER:
- return &ch->lcommunity_list;
+ return &ch->lcommunity_list;
}
return NULL;
}
}
/* Internal function to perform regular expression match for
- * * a single community. */
+ * a single community. */
static int
community_regexp_include (regex_t * reg, struct community *com, int i)
{
char *str;
int rv;
- /* When there is no communities attribute it is treated as empty
- * string. */
+ /* When there is no communities attribute it is treated as empty string. */
if (com == NULL || com->size == 0)
str = XSTRDUP(MTYPE_COMMUNITY_STR, "");
else
}
/* Internal function to perform regular expression match for
- * * a single community. */
+ * a single community. */
static int
lcommunity_regexp_include (regex_t * reg, struct lcommunity *lcom, int i)
{
const char *str;
- /* When there is no communities attribute it is treated as empty
- * string. */
+ /* When there is no communities attribute it is treated as empty string. */
if (lcom == NULL || lcom->size == 0)
str = "";
else
break;
case COMMUNITY_LIST_EXPANDED:
case EXTCOMMUNITY_LIST_EXPANDED:
- case LARGE_COMMUNITY_LIST_EXPANDED:
+ case LARGE_COMMUNITY_LIST_EXPANDED:
if (strcmp (entry->config, new->config) == 0)
return 1;
break;
/* Delete all permitted large communities in the list from com. */
struct lcommunity *
lcommunity_list_match_delete (struct lcommunity *lcom,
- struct community_list *list)
+ struct community_list *list)
{
struct community_entry *entry;
u_int32_t com_index_to_delete[lcom->size];
/* Set lcommunity-list. */
int
lcommunity_list_set (struct community_list_handler *ch,
- const char *name, const char *str, int direct, int style)
+ const char *name, const char *str, int direct, int style)
{
struct community_entry *entry = NULL;
struct community_list *list;
first = list->head;
if (style != first->style)
- {
- return (first->style == COMMUNITY_LIST_STANDARD
- ? COMMUNITY_LIST_ERR_STANDARD_CONFLICT
- : COMMUNITY_LIST_ERR_EXPANDED_CONFLICT);
- }
+ {
+ return (first->style == COMMUNITY_LIST_STANDARD
+ ? COMMUNITY_LIST_ERR_STANDARD_CONFLICT
+ : COMMUNITY_LIST_ERR_EXPANDED_CONFLICT);
+ }
}
if (str)
{
if (style == LARGE_COMMUNITY_LIST_STANDARD)
- lcom = lcommunity_str2com (str);
+ lcom = lcommunity_str2com (str);
else
- regex = bgp_regcomp (str);
+ regex = bgp_regcomp (str);
if (! lcom && ! regex)
- return COMMUNITY_LIST_ERR_MALFORMED_VAL;
+ return COMMUNITY_LIST_ERR_MALFORMED_VAL;
}
entry = community_entry_new ();
community-list entry belongs to the specified name. */
int
lcommunity_list_unset (struct community_list_handler *ch,
- const char *name, const char *str,
- int direct, int style)
+ const char *name, const char *str,
+ int direct, int style)
{
struct community_entry *entry = NULL;
struct community_list *list;
/* BGP Large Communities Attribute
-
-Copyright (C) 2016 Keyur Patel <keyur@arrcus.com>
-
-This file is part of GNU Zebra.
-
-GNU Zebra is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-GNU Zebra is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Zebra; see the file COPYING. If not, write to the Free
-Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+ *
+ * Copyright (C) 2016 Keyur Patel <keyur@arrcus.com>
+ *
+ * This file is part of FreeRangeRouting (FRR).
+ *
+ * FRR is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 2, or (at your option) any later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FRR; see the file COPYING. If not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
#include <zebra.h>
/* BGP Large Communities Attribute.
-
-Copyright (C) 2016 Keyur Patel <keyur@arrcus.com>
-
-This file is part of GNU Zebra.
-
-GNU Zebra is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-GNU Zebra is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Zebra; see the file COPYING. If not, write to the Free
-Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+ *
+ * Copyright (C) 2016 Keyur Patel <keyur@arrcus.com>
+ *
+ * This file is part of FreeRangeRouting (FRR).
+ *
+ * FRR is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 2, or (at your option) any later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FRR; see the file COPYING. If not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
#ifndef _QUAGGA_BGP_LCOMMUNITY_H
#define _QUAGGA_BGP_LCOMMUNITY_H
/* Line 6 display Large community */
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES))
- vty_out (vty, " Large Community: %s%s",
- attr->extra->lcommunity->str, VTY_NEWLINE);
+ vty_out (vty, " Large Community: %s%s",
+ attr->extra->lcommunity->str, VTY_NEWLINE);
/* Line 7 display Originator, Cluster-id */
if ((attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID)) ||
if (! community_list_exact_match (ri->attr->community, list))
continue;
}
- if (type == bgp_show_type_community_all)
- {
- if (! ri->attr->community)
- continue;
- }
- if (type == bgp_show_type_lcommunity)
- {
- struct lcommunity *lcom = output_arg;
+ if (type == bgp_show_type_community_all)
+ {
+ if (! ri->attr->community)
+ continue;
+ }
+ if (type == bgp_show_type_lcommunity)
+ {
+ struct lcommunity *lcom = output_arg;
- if (! ri->attr->extra || ! ri->attr->extra->lcommunity ||
- ! lcommunity_match (ri->attr->extra->lcommunity, lcom))
- continue;
- }
- if (type == bgp_show_type_lcommunity_list)
- {
- struct community_list *list = output_arg;
+ if (! ri->attr->extra || ! ri->attr->extra->lcommunity ||
+ ! lcommunity_match (ri->attr->extra->lcommunity, lcom))
+ continue;
+ }
+ if (type == bgp_show_type_lcommunity_list)
+ {
+ struct community_list *list = output_arg;
- if (! ri->attr->extra ||
- ! lcommunity_list_match (ri->attr->extra->lcommunity, list))
- continue;
- }
- if (type == bgp_show_type_lcommunity_all)
- {
- if (! ri->attr->extra || ! ri->attr->extra->lcommunity)
- continue;
- }
+ if (! ri->attr->extra ||
+ ! lcommunity_list_match (ri->attr->extra->lcommunity, list))
+ continue;
+ }
+ if (type == bgp_show_type_lcommunity_all)
+ {
+ if (! ri->attr->extra || ! ri->attr->extra->lcommunity)
+ continue;
+ }
if (type == bgp_show_type_dampend_paths
|| type == bgp_show_type_damp_neighbor)
{
static int
bgp_show_lcommunity (struct vty *vty, struct bgp *bgp, int argc,
- struct cmd_token **argv, afi_t afi, safi_t safi, u_char uj)
+ struct cmd_token **argv, afi_t afi, safi_t safi, u_char uj)
{
struct lcommunity *lcom;
struct buffer *b;
if (first)
buffer_putc (b, ' ');
else
- {
- if (strmatch (argv[i]->text, "<AA:BB:CC>"))
- {
- first = 1;
- buffer_putstr (b, argv[i]->arg);
- }
- }
+ {
+ if (strmatch (argv[i]->text, "<AA:BB:CC>"))
+ {
+ first = 1;
+ buffer_putstr (b, argv[i]->arg);
+ }
+ }
}
buffer_putc (b, '\0');
static int
bgp_show_lcommunity_list (struct vty *vty, struct bgp *bgp, const char *lcom,
- afi_t afi, safi_t safi, u_char uj)
+ afi_t afi, safi_t safi, u_char uj)
{
struct community_list *list;
if (list == NULL)
{
vty_out (vty, "%% %s is not a valid large-community-list name%s", lcom,
- VTY_NEWLINE);
+ VTY_NEWLINE);
return CMD_WARNING;
}
/* Match function for lcommunity match. */
static route_map_result_t
route_match_lcommunity (void *rule, struct prefix *prefix,
- route_map_object_t type, void *object)
+ route_map_object_t type, void *object)
{
struct community_list *list;
struct bgp_info *bgp_info;
rcom = rule;
list = community_list_lookup (bgp_clist, rcom->name,
- LARGE_COMMUNITY_LIST_MASTER);
+ LARGE_COMMUNITY_LIST_MASTER);
if (! list)
- return RMAP_NOMATCH;
+ return RMAP_NOMATCH;
if (bgp_info->attr->extra &&
- lcommunity_list_match (bgp_info->attr->extra->lcommunity, list))
- return RMAP_MATCH;
+ lcommunity_list_match (bgp_info->attr->extra->lcommunity, list))
+ return RMAP_MATCH;
}
return RMAP_NOMATCH;
/* For lcommunity set mechanism. */
static route_map_result_t
route_set_lcommunity (void *rule, struct prefix *prefix,
- route_map_object_t type, void *object)
+ route_map_object_t type, void *object)
{
struct rmap_lcom_set *rcs;
struct bgp_info *binfo;
/* "none" case. */
if (rcs->none)
- {
- attr->flag &= ~(ATTR_FLAG_BIT (BGP_ATTR_LARGE_COMMUNITIES));
- if (attr->extra) {
- attr->extra->lcommunity = NULL;
- }
- /* See the longer comment down below. */
- if (old && old->refcnt == 0)
- lcommunity_free(&old);
- return RMAP_OKAY;
- }
+ {
+ attr->flag &= ~(ATTR_FLAG_BIT (BGP_ATTR_LARGE_COMMUNITIES));
+ if (attr->extra)
+ attr->extra->lcommunity = NULL;
+
+ /* See the longer comment down below. */
+ if (old && old->refcnt == 0)
+ lcommunity_free(&old);
+ return RMAP_OKAY;
+ }
if (rcs->additive && old)
- {
- merge = lcommunity_merge (lcommunity_dup (old), rcs->lcom);
+ {
+ merge = lcommunity_merge (lcommunity_dup (old), rcs->lcom);
- /* HACK: if the old large-community is not intern'd,
+ /* HACK: if the old large-community is not intern'd,
* we should free it here, or all reference to it may be lost.
* Really need to cleanup attribute caching sometime.
*/
- if (old->refcnt == 0)
- lcommunity_free (&old);
- new = lcommunity_uniq_sort (merge);
- lcommunity_free (&merge);
- }
+ if (old->refcnt == 0)
+ lcommunity_free (&old);
+ new = lcommunity_uniq_sort (merge);
+ lcommunity_free (&merge);
+ }
else
- new = lcommunity_dup (rcs->lcom);
+ new = lcommunity_dup (rcs->lcom);
+
+ /* will be interned by caller if required */
+ if (attr->extra)
+ attr->extra->lcommunity = new;
- /* will be interned by caller if required */
- if (attr->extra) {
- attr->extra->lcommunity = new;
- }
attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_LARGE_COMMUNITIES);
}
sp = strstr (arg, "additive");
if (sp && sp > arg)
- {
- /* "additive" keyworkd is included. */
- additive = 1;
- *(sp - 1) = '\0';
- }
+ {
+ /* "additive" keyworkd is included. */
+ additive = 1;
+ *(sp - 1) = '\0';
+ }
lcom = lcommunity_str2com (arg);
- if (additive)
- *(sp - 1) = ' ';
+ if (additive)
+ *(sp - 1) = ' ';
- if (! lcom)
- return NULL;
+ if (! lcom)
+ return NULL;
}
rcs = XCALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (struct rmap_com_set));
/* For large community set mechanism. */
static route_map_result_t
route_set_lcommunity_delete (void *rule, struct prefix *prefix,
- route_map_object_t type, void *object)
+ route_map_object_t type, void *object)
{
struct community_list *list;
struct lcommunity *merge;
if (type == RMAP_BGP)
{
if (! rule)
- return RMAP_OKAY;
+ return RMAP_OKAY;
binfo = object;
list = community_list_lookup (bgp_clist, rule,
- LARGE_COMMUNITY_LIST_MASTER);
+ LARGE_COMMUNITY_LIST_MASTER);
old = ((binfo->attr->extra) ? binfo->attr->extra->lcommunity : NULL);
if (list && old)
- {
- merge = lcommunity_list_match_delete (lcommunity_dup (old), list);
- new = lcommunity_uniq_sort (merge);
- lcommunity_free (&merge);
+ {
+ merge = lcommunity_list_match_delete (lcommunity_dup (old), list);
+ new = lcommunity_uniq_sort (merge);
+ lcommunity_free (&merge);
- /* HACK: if the old community is not intern'd,
- * we should free it here, or all reference to it may be lost.
- * Really need to cleanup attribute caching sometime.
- */
- if (old->refcnt == 0)
- lcommunity_free (&old);
+ /* HACK: if the old community is not intern'd,
+ * we should free it here, or all reference to it may be lost.
+ * Really need to cleanup attribute caching sometime.
+ */
+ if (old->refcnt == 0)
+ lcommunity_free (&old);
- if (new->size == 0)
- {
- binfo->attr->extra->lcommunity = NULL;
- binfo->attr->flag &= ~ATTR_FLAG_BIT (BGP_ATTR_LARGE_COMMUNITIES);
- lcommunity_free (&new);
- }
- else
- {
- binfo->attr->extra->lcommunity = new;
- binfo->attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_LARGE_COMMUNITIES);
- }
- }
+ if (new->size == 0)
+ {
+ binfo->attr->extra->lcommunity = NULL;
+ binfo->attr->flag &= ~ATTR_FLAG_BIT (BGP_ATTR_LARGE_COMMUNITIES);
+ lcommunity_free (&new);
+ }
+ else
+ {
+ binfo->attr->extra->lcommunity = new;
+ binfo->attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_LARGE_COMMUNITIES);
+ }
+ }
}
return RMAP_OKAY;
"Large Community-list name\n")
{
return bgp_route_match_add (vty, "large-community", argv[2]->arg,
- RMAP_EVENT_LLIST_ADDED);
+ RMAP_EVENT_LLIST_ADDED);
}
DEFUN (no_match_lcommunity,
"Large Community-list name\n")
{
return bgp_route_match_delete (vty, "large-community", NULL,
- RMAP_EVENT_LLIST_DELETED);
+ RMAP_EVENT_LLIST_DELETED);
}
DEFUN (match_ecommunity,
"No large community attribute\n")
{
return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
- "large-community", "none");
+ "large-community", "none");
}
DEFUN (no_set_lcommunity,
"No community attribute\n")
{
return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
- "large-community", NULL);
+ "large-community", NULL);
}
DEFUN (no_set_lcommunity1,
"Large community in AA:BB:CC... format or additive\n")
{
return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
- "large-community", NULL);
+ "large-community", NULL);
}
DEFUN (set_lcommunity_delete,
strcpy (str + strlen (argv[2]->arg), " delete");
generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
- "large-comm-list", str);
+ "large-comm-list", str);
XFREE (MTYPE_TMP, str);
return CMD_SUCCESS;
"Delete matching large communities\n")
{
return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
- "large-comm-list", NULL);
+ "large-comm-list", NULL);
}
DEFUN (set_ecommunity_rt,
VTY_NEWLINE);
if ((count = mtype_stats_alloc (MTYPE_LCOMMUNITY)))
vty_out (vty, "%ld BGP large-community entries, using %s of memory%s",
- count,
+ count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct lcommunity)),
VTY_NEWLINE);
lcom = (struct lcommunity *) backet->data;
vty_out (vty, "[%p] (%ld) %s%s", (void *)backet, lcom->refcnt,
- lcommunity_str (lcom), VTY_NEWLINE);
+ lcommunity_str (lcom), VTY_NEWLINE);
}
/* Show BGP's community internal data. */
vty_out (vty, "Address Refcnt Large-community%s", VTY_NEWLINE);
hash_iterate (lcommunity_hash (),
- (void (*) (struct hash_backet *, void *))
- lcommunity_show_all_iterator,
- vty);
+ (void (*) (struct hash_backet *, void *))
+ lcommunity_show_all_iterator,
+ vty);
return CMD_SUCCESS;
}
*/
static int
lcommunity_list_set_vty (struct vty *vty, int argc, struct cmd_token **argv,
- int style, int reject_all_digit_name)
+ int style, int reject_all_digit_name)
{
int ret;
int direct;
static int
lcommunity_list_unset_vty (struct vty *vty, int argc, struct cmd_token **argv,
- int style)
+ int style)
{
int ret;
int direct = 0;
{
/* Check the list direct. */
if (strncmp (argv[idx]->arg, "p", 1) == 0)
- direct = COMMUNITY_PERMIT;
+ direct = COMMUNITY_PERMIT;
else
- direct = COMMUNITY_DENY;
+ direct = COMMUNITY_DENY;
idx = 0;
argv_find (argv, argc, "LINE", &idx);
for (entry = list->head; entry; entry = entry->next)
{
if (entry == list->head)
- {
- if (all_digit (list->name))
- vty_out (vty, "Large community %s list %s%s",
- entry->style == EXTCOMMUNITY_LIST_STANDARD ?
- "standard" : "(expanded) access",
- list->name, VTY_NEWLINE);
- else
- vty_out (vty, "Named large community %s list %s%s",
- entry->style == EXTCOMMUNITY_LIST_STANDARD ?
- "standard" : "expanded",
- list->name, VTY_NEWLINE);
- }
+ {
+ if (all_digit (list->name))
+ vty_out (vty, "Large community %s list %s%s",
+ entry->style == EXTCOMMUNITY_LIST_STANDARD ?
+ "standard" : "(expanded) access",
+ list->name, VTY_NEWLINE);
+ else
+ vty_out (vty, "Named large community %s list %s%s",
+ entry->style == EXTCOMMUNITY_LIST_STANDARD ?
+ "standard" : "expanded",
+ list->name, VTY_NEWLINE);
+ }
if (entry->any)
- vty_out (vty, " %s%s",
- community_direct_str (entry->direct), VTY_NEWLINE);
+ vty_out (vty, " %s%s",
+ community_direct_str (entry->direct), VTY_NEWLINE);
else
- vty_out (vty, " %s %s%s",
- community_direct_str (entry->direct),
- entry->style == EXTCOMMUNITY_LIST_STANDARD ?
- entry->u.ecom->str : entry->config,
- VTY_NEWLINE);
+ vty_out (vty, " %s %s%s",
+ community_direct_str (entry->direct),
+ entry->style == EXTCOMMUNITY_LIST_STANDARD ?
+ entry->u.ecom->str : entry->config,
+ VTY_NEWLINE);
}
}
for (list = cm->num.head; list; list = list->next)
for (entry = list->head; entry; entry = entry->next)
{
- vty_out (vty, "ip large-community-list %s %s %s%s",
- list->name, community_direct_str (entry->direct),
- community_list_config_str (entry), VTY_NEWLINE);
- write++;
+ vty_out (vty, "ip large-community-list %s %s %s%s",
+ list->name, community_direct_str (entry->direct),
+ community_list_config_str (entry), VTY_NEWLINE);
+ write++;
}
for (list = cm->str.head; list; list = list->next)
for (entry = list->head; entry; entry = entry->next)
{
- vty_out (vty, "ip large-community-list %s %s %s %s%s",
- entry->style == LARGE_COMMUNITY_LIST_STANDARD
- ? "standard" : "expanded",
- list->name, community_direct_str (entry->direct),
- community_list_config_str (entry), VTY_NEWLINE);
- write++;
+ vty_out (vty, "ip large-community-list %s %s %s %s%s",
+ entry->style == LARGE_COMMUNITY_LIST_STANDARD
+ ? "standard" : "expanded",
+ list->name, community_direct_str (entry->direct),
+ community_list_config_str (entry), VTY_NEWLINE);
+ write++;
}
return write;