summaryrefslogtreecommitdiff
path: root/lib/distribute.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/distribute.c')
-rw-r--r--lib/distribute.c654
1 files changed, 82 insertions, 572 deletions
diff --git a/lib/distribute.c b/lib/distribute.c
index 498410c22d..8726e993c5 100644
--- a/lib/distribute.c
+++ b/lib/distribute.c
@@ -161,8 +161,8 @@ distribute_cmp (const struct distribute *dist1, const struct distribute *dist2)
}
/* Set access-list name to the distribute list. */
-static struct distribute *
-distribute_list_set (const char *ifname, enum distribute_type type,
+static void
+distribute_list_set (const char *ifname, enum distribute_type type,
const char *alist_name)
{
struct distribute *dist;
@@ -175,14 +175,12 @@ distribute_list_set (const char *ifname, enum distribute_type type,
/* Apply this distribute-list to the interface. */
(*distribute_add_hook) (dist);
-
- return dist;
}
/* Unset distribute-list. If matched distribute-list exist then
return 1. */
static int
-distribute_list_unset (const char *ifname, enum distribute_type type,
+distribute_list_unset (const char *ifname, enum distribute_type type,
const char *alist_name)
{
struct distribute *dist;
@@ -192,9 +190,9 @@ distribute_list_unset (const char *ifname, enum distribute_type type,
return 0;
if (!dist->list[type])
- return 0;
+ return 0;
if (strcmp (dist->list[type], alist_name) != 0)
- return 0;
+ return 0;
XFREE(MTYPE_DISTRIBUTE_NAME, dist->list[type]);
dist->list[type] = NULL;
@@ -208,7 +206,7 @@ distribute_list_unset (const char *ifname, enum distribute_type type,
}
/* Set access-list name to the distribute list. */
-static struct distribute *
+static void
distribute_list_prefix_set (const char *ifname, enum distribute_type type,
const char *plist_name)
{
@@ -222,8 +220,6 @@ distribute_list_prefix_set (const char *ifname, enum distribute_type type,
/* Apply this distribute-list to the interface. */
(*distribute_add_hook) (dist);
-
- return dist;
}
/* Unset distribute-list. If matched distribute-list exist then
@@ -239,9 +235,9 @@ distribute_list_prefix_unset (const char *ifname, enum distribute_type type,
return 0;
if (!dist->prefix[type])
- return 0;
+ return 0;
if (strcmp (dist->prefix[type], plist_name) != 0)
- return 0;
+ return 0;
XFREE(MTYPE_DISTRIBUTE_NAME, dist->prefix[type]);
dist->prefix[type] = NULL;
@@ -254,212 +250,70 @@ distribute_list_prefix_unset (const char *ifname, enum distribute_type type,
return 1;
}
-DEFUN (distribute_list_all,
- distribute_list_all_cmd,
- "distribute-list WORD (in|out)",
- "Filter networks in routing updates\n"
- "Access-list name\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n")
-{
- enum distribute_type type;
-
- /* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V4_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V4_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- /* Get interface name corresponding distribute list. */
- distribute_list_set (NULL, type, argv[0]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ipv6_distribute_list_all,
- ipv6_distribute_list_all_cmd,
- "ipv6 distribute-list WORD (in|out)",
- "Filter networks in routing updates\n"
- "Access-list name\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n")
-{
- enum distribute_type type;
-
- /* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V6_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V6_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- /* Get interface name corresponding distribute list. */
- distribute_list_set (NULL, type, argv[0]);
-
- return CMD_SUCCESS;
-}
-
-ALIAS (ipv6_distribute_list_all,
- ipv6_as_v4_distribute_list_all_cmd,
- "distribute-list WORD (in|out)",
- "Filter networks in routing updates\n"
- "Access-list name\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n")
-
-DEFUN (no_distribute_list_all,
- no_distribute_list_all_cmd,
- "no distribute-list WORD (in|out)",
- NO_STR
- "Filter networks in routing updates\n"
- "Access-list name\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n")
-{
- int ret;
- enum distribute_type type;
-
- /* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V4_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V4_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- ret = distribute_list_unset (NULL, type, argv[0]);
- if (! ret)
- {
- vty_out (vty, "distribute list doesn't exist%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- return CMD_SUCCESS;
-}
-
-DEFUN (no_ipv6_distribute_list_all,
- no_ipv6_distribute_list_all_cmd,
- "no ipv6 distribute-list WORD (in|out)",
- NO_STR
- "Filter networks in routing updates\n"
- "Access-list name\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n")
-{
- int ret;
- enum distribute_type type;
-
- /* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V6_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V6_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- ret = distribute_list_unset (NULL, type, argv[0]);
- if (! ret)
- {
- vty_out (vty, "distribute list doesn't exist%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- return CMD_SUCCESS;
-}
-
-ALIAS (no_ipv6_distribute_list_all,
- no_ipv6_as_v4_distribute_list_all_cmd,
- "no distribute-list WORD (in|out)",
- NO_STR
- "Filter networks in routing updates\n"
- "Access-list name\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n")
-
DEFUN (distribute_list,
distribute_list_cmd,
- "distribute-list WORD (in|out) WORD",
+ "distribute-list [prefix] WORD <in|out> [WORD]",
"Filter networks in routing updates\n"
"Access-list name\n"
"Filter incoming routing updates\n"
"Filter outgoing routing updates\n"
"Interface name\n")
{
- enum distribute_type type;
+ int prefix = (argv[1]->type == WORD_TKN) ? 1 : 0;
/* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V4_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V4_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
+ enum distribute_type type = argv[2 + prefix]->arg[0] == 'i' ?
+ DISTRIBUTE_V4_IN : DISTRIBUTE_V4_OUT;
+
+ /* Set appropriate function call */
+ void (*distfn)(const char *, enum distribute_type, const char *) = prefix ?
+ &distribute_list_prefix_set : &distribute_list_set;
+
+ /* if interface is present, get name */
+ const char *ifname = NULL;
+ if (argv[argc - 1]->type == VARIABLE_TKN)
+ ifname = argv[argc - 1]->arg;
/* Get interface name corresponding distribute list. */
- distribute_list_set (argv[2], type, argv[0]);
+ distfn (ifname, type, argv[1 + prefix]->arg);
return CMD_SUCCESS;
}
DEFUN (ipv6_distribute_list,
ipv6_distribute_list_cmd,
- "ipv6 distribute-list WORD (in|out) WORD",
+ "ipv6 distribute-list [prefix] WORD <in|out> [WORD]",
+ "IPv6\n"
"Filter networks in routing updates\n"
"Access-list name\n"
"Filter incoming routing updates\n"
"Filter outgoing routing updates\n"
"Interface name\n")
{
- enum distribute_type type;
+ int prefix = (argv[2]->type == WORD_TKN) ? 1 : 0;
/* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V6_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V6_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
+ enum distribute_type type = argv[3 + prefix]->arg[0] == 'i' ?
+ DISTRIBUTE_V6_IN : DISTRIBUTE_V6_OUT;
+
+ /* Set appropriate function call */
+ void (*distfn)(const char *, enum distribute_type, const char *) = prefix ?
+ &distribute_list_prefix_set : &distribute_list_set;
+
+ /* if interface is present, get name */
+ const char *ifname = NULL;
+ if (argv[argc - 1]->type == VARIABLE_TKN)
+ ifname = argv[argc - 1]->arg;
/* Get interface name corresponding distribute list. */
- distribute_list_set (argv[2], type, argv[0]);
+ distfn (ifname, type, argv[1 + prefix]->arg);
return CMD_SUCCESS;
}
-
-ALIAS (ipv6_distribute_list,
- ipv6_as_v4_distribute_list_cmd,
- "distribute-list WORD (in|out) WORD",
- "Filter networks in routing updates\n"
- "Access-list name\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n"
- "Interface name\n")
-
-DEFUN (no_distribute_list, no_distribute_list_cmd,
- "no distribute-list WORD (in|out) WORD",
+
+DEFUN (no_distribute_list,
+ no_distribute_list_cmd,
+ "no [ipv6] distribute-list [prefix] WORD <in|out> [WORD]",
NO_STR
"Filter networks in routing updates\n"
"Access-list name\n"
@@ -467,312 +321,29 @@ DEFUN (no_distribute_list, no_distribute_list_cmd,
"Filter outgoing routing updates\n"
"Interface name\n")
{
- int ret;
- enum distribute_type type;
-
- /* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V4_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V4_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- ret = distribute_list_unset (argv[2], type, argv[0]);
- if (! ret)
- {
- vty_out (vty, "distribute list doesn't exist%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- return CMD_SUCCESS;
-}
+ int ipv6 = strmatch(argv[1]->text, "ipv6");
+ int prefix = (argv[2 + ipv6]->type == WORD_TKN) ? 1 : 0;
-DEFUN (no_ipv6_distribute_list,
- no_ipv6_distribute_list_cmd,
- "no ipv6 distribute-list WORD (in|out) WORD",
- NO_STR
- "Filter networks in routing updates\n"
- "Access-list name\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n"
- "Interface name\n")
-{
- int ret;
- enum distribute_type type;
+ int idx_alname = 2 + ipv6 + prefix;
+ int idx_disttype = idx_alname + 1;
/* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V6_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V6_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
+ enum distribute_type distin = (ipv6) ? DISTRIBUTE_V6_IN : DISTRIBUTE_V4_IN;
+ enum distribute_type distout = (ipv6) ? DISTRIBUTE_V6_OUT : DISTRIBUTE_V4_OUT;
- ret = distribute_list_unset (argv[2], type, argv[0]);
- if (! ret)
- {
- vty_out (vty, "distribute list doesn't exist%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- return CMD_SUCCESS;
-}
-
-ALIAS (no_ipv6_distribute_list,
- no_ipv6_as_v4_distribute_list_cmd,
- "no distribute-list WORD (in|out) WORD",
- NO_STR
- "Filter networks in routing updates\n"
- "Access-list name\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n"
- "Interface name\n")
-
-DEFUN (distribute_list_prefix_all,
- distribute_list_prefix_all_cmd,
- "distribute-list prefix WORD (in|out)",
- "Filter networks in routing updates\n"
- "Filter prefixes in routing updates\n"
- "Name of an IP prefix-list\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n")
-{
- enum distribute_type type;
-
- /* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V4_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V4_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- /* Get interface name corresponding distribute list. */
- distribute_list_prefix_set (NULL, type, argv[0]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ipv6_distribute_list_prefix_all,
- ipv6_distribute_list_prefix_all_cmd,
- "ipv6 distribute-list prefix WORD (in|out)",
- "Filter networks in routing updates\n"
- "Filter prefixes in routing updates\n"
- "Name of an IP prefix-list\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n")
-{
- enum distribute_type type;
-
- /* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V6_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V6_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- /* Get interface name corresponding distribute list. */
- distribute_list_prefix_set (NULL, type, argv[0]);
-
- return CMD_SUCCESS;
-}
-
-ALIAS (ipv6_distribute_list_prefix_all,
- ipv6_as_v4_distribute_list_prefix_all_cmd,
- "distribute-list prefix WORD (in|out)",
- "Filter networks in routing updates\n"
- "Filter prefixes in routing updates\n"
- "Name of an IP prefix-list\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n")
-
-DEFUN (no_distribute_list_prefix_all,
- no_distribute_list_prefix_all_cmd,
- "no distribute-list prefix WORD (in|out)",
- NO_STR
- "Filter networks in routing updates\n"
- "Filter prefixes in routing updates\n"
- "Name of an IP prefix-list\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n")
-{
- int ret;
- enum distribute_type type;
-
- /* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V4_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V4_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- ret = distribute_list_prefix_unset (NULL, type, argv[0]);
- if (! ret)
- {
- vty_out (vty, "distribute list doesn't exist%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- return CMD_SUCCESS;
-}
-
-DEFUN (no_ipv6_distribute_list_prefix_all,
- no_ipv6_distribute_list_prefix_all_cmd,
- "no ipv6 distribute-list prefix WORD (in|out)",
- NO_STR
- "Filter networks in routing updates\n"
- "Filter prefixes in routing updates\n"
- "Name of an IP prefix-list\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n")
-{
- int ret;
- enum distribute_type type;
-
- /* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V6_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V6_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- ret = distribute_list_prefix_unset (NULL, type, argv[0]);
- if (! ret)
- {
- vty_out (vty, "distribute list doesn't exist%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- return CMD_SUCCESS;
-}
-
-ALIAS (no_ipv6_distribute_list_prefix_all,
- no_ipv6_as_v4_distribute_list_prefix_all_cmd,
- "no distribute-list prefix WORD (in|out)",
- NO_STR
- "Filter networks in routing updates\n"
- "Filter prefixes in routing updates\n"
- "Name of an IP prefix-list\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n")
-
-DEFUN (distribute_list_prefix, distribute_list_prefix_cmd,
- "distribute-list prefix WORD (in|out) WORD",
- "Filter networks in routing updates\n"
- "Filter prefixes in routing updates\n"
- "Name of an IP prefix-list\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n"
- "Interface name\n")
-{
- enum distribute_type type;
-
- /* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V4_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V4_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- /* Get interface name corresponding distribute list. */
- distribute_list_prefix_set (argv[2], type, argv[0]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ipv6_distribute_list_prefix,
- ipv6_distribute_list_prefix_cmd,
- "ipv6 distribute-list prefix WORD (in|out) WORD",
- "Filter networks in routing updates\n"
- "Filter prefixes in routing updates\n"
- "Name of an IP prefix-list\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n"
- "Interface name\n")
-{
- enum distribute_type type;
-
- /* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V6_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V6_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
+ enum distribute_type type = argv[idx_disttype]->arg[0] == 'i' ? distin : distout;
+ /* Set appropriate function call */
+ int (*distfn)(const char *, enum distribute_type, const char *) = prefix ?
+ &distribute_list_prefix_unset : &distribute_list_unset;
+
+ /* if interface is present, get name */
+ const char *ifname = NULL;
+ if (argv[argc - 1]->type == VARIABLE_TKN)
+ ifname = argv[argc - 1]->arg;
/* Get interface name corresponding distribute list. */
- distribute_list_prefix_set (argv[2], type, argv[0]);
-
- return CMD_SUCCESS;
-}
-
-ALIAS (ipv6_distribute_list_prefix,
- ipv6_as_v4_distribute_list_prefix_cmd,
- "distribute-list prefix WORD (in|out) WORD",
- "Filter networks in routing updates\n"
- "Filter prefixes in routing updates\n"
- "Name of an IP prefix-list\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n"
- "Interface name\n")
-
-DEFUN (no_distribute_list_prefix, no_distribute_list_prefix_cmd,
- "no distribute-list prefix WORD (in|out) WORD",
- NO_STR
- "Filter networks in routing updates\n"
- "Filter prefixes in routing updates\n"
- "Name of an IP prefix-list\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n"
- "Interface name\n")
-{
- int ret;
- enum distribute_type type;
+ int ret = distfn (ifname, type, argv[2 + prefix]->arg);
- /* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V4_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V4_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- ret = distribute_list_prefix_unset (argv[2], type, argv[0]);
if (! ret)
{
vty_out (vty, "distribute list doesn't exist%s", VTY_NEWLINE);
@@ -781,52 +352,6 @@ DEFUN (no_distribute_list_prefix, no_distribute_list_prefix_cmd,
return CMD_SUCCESS;
}
-DEFUN (no_ipv6_distribute_list_prefix,
- no_ipv6_distribute_list_prefix_cmd,
- "no ipv6 distribute-list prefix WORD (in|out) WORD",
- NO_STR
- "Filter networks in routing updates\n"
- "Filter prefixes in routing updates\n"
- "Name of an IP prefix-list\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n"
- "Interface name\n")
-{
- int ret;
- enum distribute_type type;
-
- /* Check of distribute list type. */
- if (strncmp (argv[1], "i", 1) == 0)
- type = DISTRIBUTE_V6_IN;
- else if (strncmp (argv[1], "o", 1) == 0)
- type = DISTRIBUTE_V6_OUT;
- else
- {
- vty_out (vty, "distribute list direction must be [in|out]%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- ret = distribute_list_prefix_unset (argv[2], type, argv[0]);
- if (! ret)
- {
- vty_out (vty, "distribute list doesn't exist%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- return CMD_SUCCESS;
-}
-
-ALIAS (no_ipv6_distribute_list_prefix,
- no_ipv6_as_v4_distribute_list_prefix_cmd,
- "no distribute-list prefix WORD (in|out) WORD",
- NO_STR
- "Filter networks in routing updates\n"
- "Filter prefixes in routing updates\n"
- "Name of an IP prefix-list\n"
- "Filter incoming routing updates\n"
- "Filter outgoing routing updates\n"
- "Interface name\n")
-
static int
distribute_print (struct vty *vty, char *tab[], int is_prefix,
enum distribute_type type, int has_print)
@@ -851,7 +376,7 @@ config_show_distribute (struct vty *vty)
/* Output filter configuration. */
dist = distribute_lookup (NULL);
- vty_out(vty, " Outgoing update filter list for all interface is");
+ vty_out (vty, " Outgoing update filter list for all interface is");
has_print = 0;
if (dist)
{
@@ -874,8 +399,8 @@ config_show_distribute (struct vty *vty)
{
dist = mp->data;
if (dist->ifname)
- {
- vty_out (vty, " %s filtered by", dist->ifname);
+ {
+ vty_out (vty, " %s filtered by", dist->ifname);
has_print = 0;
has_print = distribute_print(vty, dist->list, 0,
DISTRIBUTE_V4_OUT, has_print);
@@ -886,16 +411,16 @@ config_show_distribute (struct vty *vty)
has_print = distribute_print(vty, dist->prefix, 1,
DISTRIBUTE_V6_OUT, has_print);
if (has_print)
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTY_NEWLINE);
else
vty_out(vty, " nothing%s", VTY_NEWLINE);
- }
+ }
}
/* Input filter configuration. */
dist = distribute_lookup (NULL);
- vty_out(vty, " Incoming update filter list for all interface is");
+ vty_out (vty, " Incoming update filter list for all interface is");
has_print = 0;
if (dist)
{
@@ -917,9 +442,9 @@ config_show_distribute (struct vty *vty)
for (mp = disthash->index[i]; mp; mp = mp->next)
{
dist = mp->data;
- if (dist->ifname)
- {
- vty_out (vty, " %s filtered by", dist->ifname);
+ if (dist->ifname)
+ {
+ vty_out (vty, " %s filtered by", dist->ifname);
has_print = 0;
has_print = distribute_print(vty, dist->list, 0,
DISTRIBUTE_V4_IN, has_print);
@@ -930,10 +455,10 @@ config_show_distribute (struct vty *vty)
has_print = distribute_print(vty, dist->prefix, 1,
DISTRIBUTE_V6_IN, has_print);
if (has_print)
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTY_NEWLINE);
else
vty_out(vty, " nothing%s", VTY_NEWLINE);
- }
+ }
}
return 0;
}
@@ -997,39 +522,24 @@ distribute_list_init (int node)
{
disthash = hash_create (distribute_hash_make,
(int (*) (const void *, const void *)) distribute_cmp);
- /* install v4 */
- if (node == RIP_NODE) {
- install_element (node, &distribute_list_all_cmd);
- install_element (node, &no_distribute_list_all_cmd);
- install_element (node, &distribute_list_cmd);
- install_element (node, &no_distribute_list_cmd);
- install_element (node, &distribute_list_prefix_all_cmd);
- install_element (node, &no_distribute_list_prefix_all_cmd);
- install_element (node, &distribute_list_prefix_cmd);
- install_element (node, &no_distribute_list_prefix_cmd);
- }
+
+ install_element (node, &distribute_list_cmd);
+ install_element (node, &no_distribute_list_cmd);
/* install v6 */
if (node == RIPNG_NODE) {
- install_element (node, &ipv6_distribute_list_all_cmd);
- install_element (node, &no_ipv6_distribute_list_all_cmd);
install_element (node, &ipv6_distribute_list_cmd);
- install_element (node, &no_ipv6_distribute_list_cmd);
- install_element (node, &ipv6_distribute_list_prefix_all_cmd);
- install_element (node, &no_ipv6_distribute_list_prefix_all_cmd);
- install_element (node, &ipv6_distribute_list_prefix_cmd);
- install_element (node, &no_ipv6_distribute_list_prefix_cmd);
}
- /* install v4 syntax command for v6 only protocols. */
- if (node == RIPNG_NODE) {
- install_element (node, &ipv6_as_v4_distribute_list_all_cmd);
- install_element (node, &no_ipv6_as_v4_distribute_list_all_cmd);
- install_element (node, &ipv6_as_v4_distribute_list_cmd);
- install_element (node, &no_ipv6_as_v4_distribute_list_cmd);
- install_element (node, &ipv6_as_v4_distribute_list_prefix_all_cmd);
- install_element (node, &no_ipv6_as_v4_distribute_list_prefix_all_cmd);
- install_element (node, &ipv6_as_v4_distribute_list_prefix_cmd);
- install_element (node, &no_ipv6_as_v4_distribute_list_prefix_cmd);
- }
+ /* TODO: install v4 syntax command for v6 only protocols. */
+ /* if (node == RIPNG_NODE) {
+ * install_element (node, &ipv6_as_v4_distribute_list_all_cmd);
+ * install_element (node, &no_ipv6_as_v4_distribute_list_all_cmd);
+ * install_element (node, &ipv6_as_v4_distribute_list_cmd);
+ * install_element (node, &no_ipv6_as_v4_distribute_list_cmd);
+ * install_element (node, &ipv6_as_v4_distribute_list_prefix_all_cmd);
+ * install_element (node, &no_ipv6_as_v4_distribute_list_prefix_all_cmd);
+ * install_element (node, &ipv6_as_v4_distribute_list_prefix_cmd);
+ * install_element (node, &no_ipv6_as_v4_distribute_list_prefix_cmd);
+ }*/
}