summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/distribute.c103
-rw-r--r--vtysh/Makefile.am4
-rwxr-xr-xvtysh/extract.pl7
3 files changed, 101 insertions, 13 deletions
diff --git a/lib/distribute.c b/lib/distribute.c
index d5893a5b..59dbc5a4 100644
--- a/lib/distribute.c
+++ b/lib/distribute.c
@@ -327,6 +327,14 @@ DEFUN (distribute_list_all,
return CMD_SUCCESS;
}
+ALIAS (distribute_list_all,
+ ipv6_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)",
@@ -360,6 +368,15 @@ DEFUN (no_distribute_list_all,
return CMD_SUCCESS;
}
+ALIAS (no_distribute_list_all,
+ no_ipv6_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",
@@ -389,6 +406,15 @@ DEFUN (distribute_list,
return CMD_SUCCESS;
}
+ALIAS (distribute_list,
+ ipv6_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_districute_list, no_distribute_list_cmd,
"no distribute-list WORD (in|out) WORD",
NO_STR
@@ -421,6 +447,15 @@ DEFUN (no_districute_list, no_distribute_list_cmd,
return CMD_SUCCESS;
}
+ALIAS (no_districute_list, no_ipv6_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 (districute_list_prefix_all,
distribute_list_prefix_all_cmd,
"distribute-list prefix WORD (in|out)",
@@ -451,6 +486,15 @@ DEFUN (districute_list_prefix_all,
return CMD_SUCCESS;
}
+ALIAS (districute_list_prefix_all,
+ ipv6_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_districute_list_prefix_all,
no_distribute_list_prefix_all_cmd,
"no distribute-list prefix WORD (in|out)",
@@ -485,6 +529,16 @@ DEFUN (no_districute_list_prefix_all,
return CMD_SUCCESS;
}
+ALIAS (no_districute_list_prefix_all,
+ no_ipv6_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 (districute_list_prefix, distribute_list_prefix_cmd,
"distribute-list prefix WORD (in|out) WORD",
"Filter networks in routing updates\n"
@@ -515,6 +569,15 @@ DEFUN (districute_list_prefix, distribute_list_prefix_cmd,
return CMD_SUCCESS;
}
+ALIAS (districute_list_prefix, ipv6_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_districute_list_prefix, no_distribute_list_prefix_cmd,
"no distribute-list prefix WORD (in|out) WORD",
NO_STR
@@ -549,6 +612,16 @@ DEFUN (no_districute_list_prefix, no_distribute_list_prefix_cmd,
return CMD_SUCCESS;
}
+ALIAS (no_districute_list_prefix, no_ipv6_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
config_show_distribute (struct vty *vty)
{
@@ -695,15 +768,23 @@ distribute_list_init (int node)
{
disthash = hash_create (distribute_hash_make, distribute_cmp);
- 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);
+ if(node==RIP_NODE) {
+ install_element (RIP_NODE, &distribute_list_all_cmd);
+ install_element (RIP_NODE, &no_distribute_list_all_cmd);
+ install_element (RIP_NODE, &distribute_list_cmd);
+ install_element (RIP_NODE, &no_distribute_list_cmd);
+ install_element (RIP_NODE, &distribute_list_prefix_all_cmd);
+ install_element (RIP_NODE, &no_distribute_list_prefix_all_cmd);
+ install_element (RIP_NODE, &distribute_list_prefix_cmd);
+ install_element (RIP_NODE, &no_distribute_list_prefix_cmd);
+ } else {
+ install_element (RIPNG_NODE, &ipv6_distribute_list_all_cmd);
+ install_element (RIPNG_NODE, &no_ipv6_distribute_list_all_cmd);
+ install_element (RIPNG_NODE, &ipv6_distribute_list_cmd);
+ install_element (RIPNG_NODE, &no_ipv6_distribute_list_cmd);
+ install_element (RIPNG_NODE, &ipv6_distribute_list_prefix_all_cmd);
+ install_element (RIPNG_NODE, &no_ipv6_distribute_list_prefix_all_cmd);
+ install_element (RIPNG_NODE, &ipv6_distribute_list_prefix_cmd);
+ install_element (RIPNG_NODE, &no_ipv6_distribute_list_prefix_cmd);
+ }
}
diff --git a/vtysh/Makefile.am b/vtysh/Makefile.am
index 2b04e707..e6e92f1a 100644
--- a/vtysh/Makefile.am
+++ b/vtysh/Makefile.am
@@ -16,9 +16,9 @@ sysconf_DATA = vtysh.conf.sample
EXTRA_DIST = extract.pl vtysh.conf.sample
rebuild4:
- ./extract.pl ../zebra/*.c ../ripd/*.c ../ospfd/*.c ../bgpd/*.c ../lib/keychain.c ../lib/routemap.c ../lib/filter.c ../lib/plist.c >vtysh_cmd.c
+ ./extract.pl ../zebra/*.c ../ripd/*.c ../ospfd/*.c ../bgpd/*.c ../lib/keychain.c ../lib/routemap.c ../lib/filter.c ../lib/plist.c ../lib/distribute.c > vtysh_cmd.c
rebuild:
- ./extract.pl ../zebra/*.c ../ripd/*.c ../ripngd/*.c ../ospfd/*.c ../ospf6d/*.c ../bgpd/*.c ../lib/keychain.c ../lib/routemap.c ../lib/filter.c ../lib/plist.c >vtysh_cmd.c
+ ./extract.pl ../zebra/*.c ../ripd/*.c ../ripngd/*.c ../ospfd/*.c ../ospf6d/*.c ../bgpd/*.c ../lib/keychain.c ../lib/routemap.c ../lib/filter.c ../lib/plist.c ../lib/distribute.c > vtysh_cmd.c
vtysh_cmd.c: rebuild
diff --git a/vtysh/extract.pl b/vtysh/extract.pl
index 91c817b4..8f2dcb9d 100755
--- a/vtysh/extract.pl
+++ b/vtysh/extract.pl
@@ -101,6 +101,13 @@ foreach (@ARGV) {
$protocol = "VTYSH_RIPD|VTYSH_BGPD";
}
}
+ if ($file =~ /distribute.c/) {
+ if ($defun_array[1] =~ m/ipv6/) {
+ $protocol = "VTYSH_RIPNGD";
+ } else {
+ $protocol = "VTYSH_RIPD";
+ }
+ }
} else {
($protocol) = ($file =~ /\/([a-z0-9]+)/);
$protocol = "VTYSH_" . uc $protocol;