-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zebra: Support output for "show [ipv4|ipv6] interface" #6014
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution to FRR!
Click for style suggestions
To apply these suggestions:
curl -s https://gist.githubusercontent.com/polychaeta/1434ae70218ef8a8ea931f3eca01802b/raw/a5f71253817c6b7da1fbca472519861d3472b52b/cr_6014_1584430386.diff | git apply
diff --git a/zebra/interface.c b/zebra/interface.c
index 36afc7b74..c889dbeac 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1272,7 +1272,7 @@ static const char *zebra_ziftype_2str(zebra_iftype_t zif_type)
}
static void if_status_brief_vty(struct vty *vty, struct interface *ifp,
- struct vrf *vrf, bool first_pfx_printed)
+ struct vrf *vrf, bool first_pfx_printed)
{
if (first_pfx_printed) {
vty_out(vty, "%-16s", "");
@@ -1312,7 +1312,7 @@ static void if_status_brief_vty(struct vty *vty, struct interface *ifp,
}
static void ifs_ip_dump_brief_vty(struct vty *vty, struct interface *ifp,
- struct vrf *vrf, enum ipaddr_type_t ipa_type)
+ struct vrf *vrf, enum ipaddr_type_t ipa_type)
{
struct connected *connected;
struct listnode *node;
@@ -1331,15 +1331,15 @@ static void ifs_ip_dump_brief_vty(struct vty *vty, struct interface *ifp,
if (!rn->info)
continue;
- for (ALL_LIST_ELEMENTS_RO((struct list *)rn->info,
- node, connected)) {
+ for (ALL_LIST_ELEMENTS_RO((struct list *)rn->info, node,
+ connected)) {
if (!CHECK_FLAG(connected->flags,
ZEBRA_IFA_SECONDARY)) {
p = connected->address;
prefix2str(p, buf, sizeof(buf));
if (first_pfx_printed) {
- if_status_brief_vty(vty,
- ifp, vrf,
+ if_status_brief_vty(
+ vty, ifp, vrf,
first_pfx_printed);
vty_out(vty, "%s\n", buf);
@@ -1352,21 +1352,19 @@ static void ifs_ip_dump_brief_vty(struct vty *vty, struct interface *ifp,
}
}
} else if (ipa_type == IPADDR_V6) {
- for (ALL_LIST_ELEMENTS_RO(ifp->connected, node,
- connected)) {
+ for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, connected)) {
if (CHECK_FLAG(connected->conf, ZEBRA_IFC_REAL)
- && !CHECK_FLAG(connected->flags,
- ZEBRA_IFA_SECONDARY)
- && (connected->address->family == AF_INET6)) {
+ && !CHECK_FLAG(connected->flags,
+ ZEBRA_IFA_SECONDARY)
+ && (connected->address->family == AF_INET6)) {
p = connected->address;
/* Don't print link local pfx */
- if (!IN6_IS_ADDR_LINKLOCAL
- (&p->u.prefix6)) {
+ if (!IN6_IS_ADDR_LINKLOCAL(&p->u.prefix6)) {
prefix2str(p, global_pfx,
- PREFIX_STRLEN);
+ PREFIX_STRLEN);
if (first_pfx_printed) {
- if_status_brief_vty(vty,
- ifp, vrf,
+ if_status_brief_vty(
+ vty, ifp, vrf,
first_pfx_printed);
vty_out(vty, "%s\n",
@@ -1386,15 +1384,15 @@ static void ifs_ip_dump_brief_vty(struct vty *vty, struct interface *ifp,
if (!rn->info)
continue;
- for (ALL_LIST_ELEMENTS_RO((struct list *)rn->info,
- node, connected)) {
+ for (ALL_LIST_ELEMENTS_RO((struct list *)rn->info, node,
+ connected)) {
if (!CHECK_FLAG(connected->flags,
ZEBRA_IFA_SECONDARY)) {
p = connected->address;
prefix2str(p, buf, sizeof(buf));
if (first_pfx_printed) {
- if_status_brief_vty(vty,
- ifp, vrf,
+ if_status_brief_vty(
+ vty, ifp, vrf,
first_pfx_printed);
vty_out(vty, "%s\n", buf);
@@ -1424,8 +1422,9 @@ static void ifs_ip_dump_brief_vty(struct vty *vty, struct interface *ifp,
prefix2str(p, global_pfx,
PREFIX_STRLEN);
if (first_pfx_printed) {
- if_status_brief_vty(vty, ifp,
- vrf, first_pfx_printed);
+ if_status_brief_vty(
+ vty, ifp, vrf,
+ first_pfx_printed);
vty_out(vty, "%s\n",
global_pfx);
@@ -1444,7 +1443,8 @@ static void ifs_ip_dump_brief_vty(struct vty *vty, struct interface *ifp,
}
/* Interface's brief information print out to vty interface. */
-static void ifs_dump_brief_vty(struct vty *vty, struct vrf *vrf, enum ipaddr_type_t ipa_type)
+static void ifs_dump_brief_vty(struct vty *vty, struct vrf *vrf,
+ enum ipaddr_type_t ipa_type)
{
struct interface *ifp;
bool print_header = true;
@@ -1468,7 +1468,7 @@ static void ifs_dump_brief_vty(struct vty *vty, struct vrf *vrf, enum ipaddr_typ
/* Interface's information print out to vty interface. */
static void if_dump_vty(struct vty *vty, struct interface *ifp,
- enum ipaddr_type_t ipa_type)
+ enum ipaddr_type_t ipa_type)
{
struct connected *connected;
struct nbr_connected *nbr_connected;
@@ -1543,7 +1543,8 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp,
}
if (ipa_type == IPADDR_V4) {
- for (rn = route_top(zebra_if->ipv4_subnets); rn; rn = route_next(rn)) {
+ for (rn = route_top(zebra_if->ipv4_subnets); rn;
+ rn = route_next(rn)) {
if (!rn->info)
continue;
@@ -1557,7 +1558,8 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp,
&& (connected->address->family == AF_INET6))
connected_dump_vty(vty, connected);
} else if (ipa_type == IPADDR_NONE) {
- for (rn = route_top(zebra_if->ipv4_subnets); rn; rn = route_next(rn)) {
+ for (rn = route_top(zebra_if->ipv4_subnets); rn;
+ rn = route_next(rn)) {
if (!rn->info)
continue;
@@ -1568,7 +1570,7 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp,
for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, connected)) {
if (CHECK_FLAG(connected->conf, ZEBRA_IFC_REAL)
- && (connected->address->family == AF_INET6))
+ && (connected->address->family == AF_INET6))
connected_dump_vty(vty, connected);
}
}
@@ -1798,11 +1800,8 @@ struct cmd_node interface_node = {INTERFACE_NODE, "%s(config-if)# ", 1};
/* Show all interfaces to vty. */
DEFPY(show_interface, show_interface_cmd,
"show [<ipv4|ipv6>$ip_version] interface [vrf NAME$vrf_name] [brief$brief]",
- SHOW_STR
- IP_STR
- IPV6_STR
- "Interface status and configuration\n"
- VRF_CMD_HELP_STR
+ SHOW_STR IP_STR IPV6_STR
+ "Interface status and configuration\n" VRF_CMD_HELP_STR
"Interface status and configuration summary\n")
{
int ipa_type;
@@ -1831,15 +1830,11 @@ DEFPY(show_interface, show_interface_cmd,
/* Show all interfaces to vty. */
-DEFPY (show_interface_vrf_all,
- show_interface_vrf_all_cmd,
- "show [<ipv4|ipv6>$ip_version] interface vrf all [brief$brief]",
- SHOW_STR
- IP_STR
- IPV6_STR
- "Interface status and configuration\n"
- VRF_ALL_CMD_HELP_STR
- "Interface status and configuration summary\n")
+DEFPY(show_interface_vrf_all, show_interface_vrf_all_cmd,
+ "show [<ipv4|ipv6>$ip_version] interface vrf all [brief$brief]",
+ SHOW_STR IP_STR IPV6_STR
+ "Interface status and configuration\n" VRF_ALL_CMD_HELP_STR
+ "Interface status and configuration summary\n")
{
int ipa_type;
struct vrf *vrf;
@@ -1864,15 +1859,11 @@ DEFPY (show_interface_vrf_all,
/* Show specified interface to vty. */
-DEFPY (show_interface_name_vrf,
- show_interface_name_vrf_cmd,
- "show [<ipv4|ipv6>$ip_version] interface [IFNAME$if_name] [vrf NAME$vrf_name]",
- SHOW_STR
- IP_STR
- IPV6_STR
- "Interface status and configuration\n"
- "Interface name\n"
- VRF_CMD_HELP_STR)
+DEFPY(show_interface_name_vrf, show_interface_name_vrf_cmd,
+ "show [<ipv4|ipv6>$ip_version] interface [IFNAME$if_name] [vrf NAME$vrf_name]",
+ SHOW_STR IP_STR IPV6_STR
+ "Interface status and configuration\n"
+ "Interface name\n" VRF_CMD_HELP_STR)
{
int ipa_type;
struct interface *ifp;
@@ -1897,15 +1888,11 @@ DEFPY (show_interface_name_vrf,
}
/* Show specified interface to vty. */
-DEFPY (show_interface_name_vrf_all,
- show_interface_name_vrf_all_cmd,
- "show [<ipv4|ipv6>$ip_version] interface [IFNAME$if_name] vrf all",
- SHOW_STR
- IP_STR
- IPV6_STR
- "Interface status and configuration\n"
- "Interface name\n"
- VRF_ALL_CMD_HELP_STR)
+DEFPY(show_interface_name_vrf_all, show_interface_name_vrf_all_cmd,
+ "show [<ipv4|ipv6>$ip_version] interface [IFNAME$if_name] vrf all",
+ SHOW_STR IP_STR IPV6_STR
+ "Interface status and configuration\n"
+ "Interface name\n" VRF_ALL_CMD_HELP_STR)
{
int ipa_type;
struct vrf *vrf;
If you are a new contributor to FRR, please see our contributing guidelines.
8306a82
to
efe2e97
Compare
Outdated results 💚Basic BGPD CI results: SUCCESS, 0 tests failed
For details, please contact louberger |
Outdated results 💚Basic BGPD CI results: SUCCESS, 0 tests failed
For details, please contact louberger |
Continuous Integration Result: SUCCESSFULContinuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11197/ This is a comment from an automated CI system. Warnings Generated during build:Debian 10 amd64 build: Successful with additional warningsDebian Package lintian failed for Debian 10 amd64 build:
|
Continuous Integration Result: SUCCESSFULContinuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11198/ This is a comment from an automated CI system. Warnings Generated during build:Debian 10 amd64 build: Successful with additional warningsDebian Package lintian failed for Debian 10 amd64 build:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the existing commands are broken with this PR.
Also, this command proposes to add ipv4|ipv6 before the interface.
i.e. show ipv4|ipv6 interface
In my opinion it would be better if it is in the form of show interface ipv4|ipv6.
zebra/interface.c
Outdated
@@ -1664,19 +1778,33 @@ static void interface_update_stats(void) | |||
#endif /* HAVE_NET_RT_IFLIST */ | |||
} | |||
|
|||
static int parse_ipa_type(const char *ip_version) | |||
{ | |||
int ipa_type = IPADDR_NONE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be of type enum ipaddr_type_t;
This comment applies to ipa_type all over this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for review.
Fixed it.
zebra/interface.c
Outdated
@@ -1664,19 +1778,33 @@ static void interface_update_stats(void) | |||
#endif /* HAVE_NET_RT_IFLIST */ | |||
} | |||
|
|||
static int parse_ipa_type(const char *ip_version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return should be of type enum ipaddr_type_t;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it.
zebra/interface.c
Outdated
"Interface status and configuration\n" | ||
"Interface name\n" | ||
VRF_ALL_CMD_HELP_STR) | ||
DEFPY(show_interface_name_vrf_all, show_interface_name_vrf_all_cmd, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your testing and result.
I think it could be solved by changing DEFPY to DEFUN.
efe2e97
to
9d2530e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution to FRR!
Click for style suggestions
To apply these suggestions:
curl -s https://gist.githubusercontent.com/polychaeta/48fea421008534891ef06c6700d86f70/raw/90c5ef8e68d2da56c59d9eca1ce3d1b925b74338/cr_6014_1584780631.diff | git apply
diff --git a/zebra/interface.c b/zebra/interface.c
index 5fbacbd34..8cb01a368 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1859,15 +1859,11 @@ DEFPY(show_interface_vrf_all, show_interface_vrf_all_cmd,
/* Show specified interface to vty. */
-DEFUN (show_interface_name_vrf,
- show_interface_name_vrf_cmd,
- "show [ipv4|ipv6] interface IFNAME vrf NAME",
- SHOW_STR
- IP_STR
- IPV6_STR
- "Interface status and configuration\n"
- "Interface name\n"
- VRF_CMD_HELP_STR)
+DEFUN(show_interface_name_vrf, show_interface_name_vrf_cmd,
+ "show [ipv4|ipv6] interface IFNAME vrf NAME",
+ SHOW_STR IP_STR IPV6_STR
+ "Interface status and configuration\n"
+ "Interface name\n" VRF_CMD_HELP_STR)
{
int idx_ipatype = 1;
int idx_ifname = 3;
@@ -1895,15 +1891,11 @@ DEFUN (show_interface_name_vrf,
}
/* Show specified interface to vty. */
-DEFUN (show_interface_name_vrf_all,
- show_interface_name_vrf_all_cmd,
- "show [ipv4|ipv6] interface IFNAME [vrf all]",
- SHOW_STR
- IP_STR
- IPV6_STR
- "Interface status and configuration\n"
- "Interface name\n"
- VRF_ALL_CMD_HELP_STR)
+DEFUN(show_interface_name_vrf_all, show_interface_name_vrf_all_cmd,
+ "show [ipv4|ipv6] interface IFNAME [vrf all]",
+ SHOW_STR IP_STR IPV6_STR
+ "Interface status and configuration\n"
+ "Interface name\n" VRF_ALL_CMD_HELP_STR)
{
int idx_ipatype = 1;
int idx_ifname = 3;
If you are a new contributor to FRR, please see our contributing guidelines.
9d2530e
to
28f63bd
Compare
Outdated results 💚Basic BGPD CI results: SUCCESS, 0 tests failed
For details, please contact louberger |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDTest incomplete. See below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: IncompleteIPv6 protocols on Ubuntu 14.04: Failed (click for details)IPv6 protocols on Ubuntu 14.04: Failed (click for details)Addresssanitizer topotest: Incomplete(check logs for details)IPv4 protocols on Ubuntu 14.04: Failed (click for details)Successful on other platforms/tests
|
ci:rerun |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedIPv4 protocols on Ubuntu 14.04: Failed (click for details)IPv6 protocols on Ubuntu 14.04: Failed (click for details)Successful on other platforms/tests
|
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedIPv4 protocols on Ubuntu 14.04: Failed (click for details)IPv6 protocols on Ubuntu 14.04: Failed (click for details)Successful on other platforms/tests
Warnings Generated during build:Debian 10 amd64 build: Successful with additional warningsDebian Package lintian failed for Debian 10 amd64 build:
|
ci:rerun |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDTest incomplete. See below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: IncompleteTopology tests on Ubuntu 16.04 amd64: Incomplete(check logs for details)IPv4 protocols on Ubuntu 14.04: Failed (click for details)IPv6 protocols on Ubuntu 14.04: Failed (click for details)Successful on other platforms/tests
|
28f63bd
to
1099785
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution to FRR!
Click for style suggestions
To apply these suggestions:
curl -s https://gist.githubusercontent.com/polychaeta/ab3cb4d283bf0ff94c01aff6e5f3100e/raw/fbc981cb8a9acf0647d73a55c4ccdccb62eb3d0e/cr_6014_1584942206.diff | git apply
diff --git a/zebra/interface.c b/zebra/interface.c
index 4d6b29a42..01e0f0735 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1801,8 +1801,7 @@ struct cmd_node interface_node = {INTERFACE_NODE, "%s(config-if)# ", 1};
DEFPY(show_interface, show_interface_cmd,
"show [<ipv4|ipv6>$ip_version] interface [vrf NAME$vrf_name] [brief$brief]",
SHOW_STR IP_STR IPV6_STR
- "Interface status and configuration\n"
- VRF_CMD_HELP_STR
+ "Interface status and configuration\n" VRF_CMD_HELP_STR
"Interface status and configuration summary\n")
{
enum ipaddr_type_t ipa_type;
@@ -1860,15 +1859,11 @@ DEFPY(show_interface_vrf_all, show_interface_vrf_all_cmd,
/* Show specified interface to vty. */
-DEFUN (show_interface_name_vrf,
- show_interface_name_vrf_cmd,
- "show [<ipv4|ipv6>] interface IFNAME vrf NAME",
- SHOW_STR
- IP_STR
- IPV6_STR
- "Interface status and configuration\n"
- "Interface name\n"
- VRF_CMD_HELP_STR)
+DEFUN(show_interface_name_vrf, show_interface_name_vrf_cmd,
+ "show [<ipv4|ipv6>] interface IFNAME vrf NAME",
+ SHOW_STR IP_STR IPV6_STR
+ "Interface status and configuration\n"
+ "Interface name\n" VRF_CMD_HELP_STR)
{
int idx_ipatype = 1;
int idx_ifname;
@@ -1879,8 +1874,8 @@ DEFUN (show_interface_name_vrf,
interface_update_stats();
- if (argv_find(argv, argc, "ipv4", &idx_ipatype) ||
- argv_find(argv, argc, "ipv6", &idx_ipatype)) {
+ if (argv_find(argv, argc, "ipv4", &idx_ipatype)
+ || argv_find(argv, argc, "ipv6", &idx_ipatype)) {
idx_ifname = 3;
idx_name = 5;
} else {
@@ -1905,15 +1900,11 @@ DEFUN (show_interface_name_vrf,
}
/* Show specified interface to vty. */
-DEFUN (show_interface_name_vrf_all,
- show_interface_name_vrf_all_cmd,
- "show [ipv4|ipv6] interface IFNAME [vrf all]",
- SHOW_STR
- IP_STR
- IPV6_STR
- "Interface status and configuration\n"
- "Interface name\n"
- VRF_ALL_CMD_HELP_STR)
+DEFUN(show_interface_name_vrf_all, show_interface_name_vrf_all_cmd,
+ "show [ipv4|ipv6] interface IFNAME [vrf all]",
+ SHOW_STR IP_STR IPV6_STR
+ "Interface status and configuration\n"
+ "Interface name\n" VRF_ALL_CMD_HELP_STR)
{
int idx_ipatype = 1;
int idx_ifname = 3;
@@ -1924,8 +1915,8 @@ DEFUN (show_interface_name_vrf_all,
interface_update_stats();
- if (argv_find(argv, argc, "ipv4", &idx_ipatype) ||
- argv_find(argv, argc, "ipv6", &idx_ipatype))
+ if (argv_find(argv, argc, "ipv4", &idx_ipatype)
+ || argv_find(argv, argc, "ipv6", &idx_ipatype))
idx_ifname = 3;
else
idx_ifname = 2;
If you are a new contributor to FRR, please see our contributing guidelines.
1099785
to
ce81e45
Compare
Outdated results 💚Basic BGPD CI results: SUCCESS, 0 tests failed
For details, please contact louberger |
Continuous Integration Result: SUCCESSFULContinuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11375/ This is a comment from an automated CI system. Warnings Generated during build:Debian 10 amd64 build: Successful with additional warningsDebian Package lintian failed for Debian 10 amd64 build:
|
Continuous Integration Result: SUCCESSFULContinuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11374/ This is a comment from an automated CI system. |
ce81e45
to
36f7018
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution to FRR!
Click for style suggestions
To apply these suggestions:
curl -s https://gist.githubusercontent.com/polychaeta/bcbf8a71bd66d4409caa417250774853/raw/3da708b2df568370cee023b0d037a17b2f759214/cr_6014_1584956365.diff | git apply
diff --git a/zebra/interface.c b/zebra/interface.c
index 628d27925..f3d711faf 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1801,8 +1801,7 @@ struct cmd_node interface_node = {INTERFACE_NODE, "%s(config-if)# ", 1};
DEFPY(show_interface, show_interface_cmd,
"show [<ipv4|ipv6>$ip_version] interface [vrf NAME$vrf_name] [brief$brief]",
SHOW_STR IP_STR IPV6_STR
- "Interface status and configuration\n"
- VRF_CMD_HELP_STR
+ "Interface status and configuration\n" VRF_CMD_HELP_STR
"Interface status and configuration summary\n")
{
enum ipaddr_type_t ipa_type;
@@ -1860,15 +1859,11 @@ DEFPY(show_interface_vrf_all, show_interface_vrf_all_cmd,
/* Show specified interface to vty. */
-DEFUN (show_interface_name_vrf,
- show_interface_name_vrf_cmd,
- "show [<ipv4|ipv6>] interface IFNAME vrf NAME",
- SHOW_STR
- IP_STR
- IPV6_STR
- "Interface status and configuration\n"
- "Interface name\n"
- VRF_CMD_HELP_STR)
+DEFUN(show_interface_name_vrf, show_interface_name_vrf_cmd,
+ "show [<ipv4|ipv6>] interface IFNAME vrf NAME",
+ SHOW_STR IP_STR IPV6_STR
+ "Interface status and configuration\n"
+ "Interface name\n" VRF_CMD_HELP_STR)
{
int idx_ipatype = 1;
int idx_ifname = 3;
@@ -1879,8 +1874,8 @@ DEFUN (show_interface_name_vrf,
interface_update_stats();
- if (!(argv_find(argv, argc, "ipv4", &idx_ipatype)) &&
- !(argv_find(argv, argc, "ipv6", &idx_ipatype))) {
+ if (!(argv_find(argv, argc, "ipv4", &idx_ipatype))
+ && !(argv_find(argv, argc, "ipv6", &idx_ipatype))) {
idx_ifname = 2;
idx_name = 4;
}
@@ -1904,15 +1899,11 @@ DEFUN (show_interface_name_vrf,
}
/* Show specified interface to vty. */
-DEFUN (show_interface_name_vrf_all,
- show_interface_name_vrf_all_cmd,
- "show [ipv4|ipv6] interface IFNAME [vrf all]",
- SHOW_STR
- IP_STR
- IPV6_STR
- "Interface status and configuration\n"
- "Interface name\n"
- VRF_ALL_CMD_HELP_STR)
+DEFUN(show_interface_name_vrf_all, show_interface_name_vrf_all_cmd,
+ "show [ipv4|ipv6] interface IFNAME [vrf all]",
+ SHOW_STR IP_STR IPV6_STR
+ "Interface status and configuration\n"
+ "Interface name\n" VRF_ALL_CMD_HELP_STR)
{
int idx_ipatype = 1;
int idx_ifname = 3;
@@ -1923,8 +1914,8 @@ DEFUN (show_interface_name_vrf_all,
interface_update_stats();
- if (!(argv_find(argv, argc, "ipv4", &idx_ipatype)) &&
- !(argv_find(argv, argc, "ipv6", &idx_ipatype))) {
+ if (!(argv_find(argv, argc, "ipv4", &idx_ipatype))
+ && !(argv_find(argv, argc, "ipv6", &idx_ipatype))) {
idx_ifname = 2;
}
If you are a new contributor to FRR, please see our contributing guidelines.
Added a filter to show only ipv4, only ipv6, and both ipv4/ipv6 in show interface brief, show interface IFNAME commands, etc. An example of the command is as follows: `show <ipv4 | ipv6> interface brief` Resolves: # 325 Signed-off-by: ak1ra24 <[email protected]>
36f7018
to
981a278
Compare
Outdated results 💚Basic BGPD CI results: SUCCESS, 0 tests failed
For details, please contact louberger |
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDTest incomplete. See below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: IncompleteAddresssanitizer topotest: Incomplete(check logs for details)Successful on other platforms/tests
|
Continuous Integration Result: SUCCESSFULContinuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11379/ This is a comment from an automated CI system. Warnings Generated during build:Debian 10 amd64 build: Successful with additional warningsDebian Package lintian failed for Debian 10 amd64 build:
|
ci:rerun |
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11382/ This is a comment from an automated CI system. |
@polychaeta autoclose in 1 week |
Support filter to show only ipv4, only ipv6, and both ipv4/ipv6
in show interface brief, show interface IFNAME commands, etc.
An example of the command is as follows:
show <ipv4 | ipv6> interface brief
show <ipv4|ipv6> interface IFNAME
Resolves: #325
Signed-off-by: ak1ra24 [email protected]