Commit fb063322 authored by Varun Chandramohan's avatar Varun Chandramohan Committed by Stephen Hemminger

Add Monitor Support For Neigh Table

This patch adds exclusive support to enable monitoring
neighbour table entries in ip command.
Signed-off-by: default avatarVarun Chandramohan <varunc@linux.vnet.ibm.com>
parent 52d6a850
...@@ -102,6 +102,7 @@ int do_ipmonitor(int argc, char **argv) ...@@ -102,6 +102,7 @@ int do_ipmonitor(int argc, char **argv)
int laddr=0; int laddr=0;
int lroute=0; int lroute=0;
int lprefix=0; int lprefix=0;
int lneigh=0;
rtnl_close(&rth); rtnl_close(&rth);
ipaddr_reset_filter(1); ipaddr_reset_filter(1);
...@@ -124,6 +125,9 @@ int do_ipmonitor(int argc, char **argv) ...@@ -124,6 +125,9 @@ int do_ipmonitor(int argc, char **argv)
} else if (matches(*argv, "prefix") == 0) { } else if (matches(*argv, "prefix") == 0) {
lprefix=1; lprefix=1;
groups = 0; groups = 0;
} else if (matches(*argv, "neigh") == 0) {
lneigh=1;
groups = 0;
} else if (strcmp(*argv, "all") == 0) { } else if (strcmp(*argv, "all") == 0) {
groups = ~RTMGRP_TC; groups = ~RTMGRP_TC;
} else if (matches(*argv, "help") == 0) { } else if (matches(*argv, "help") == 0) {
...@@ -153,7 +157,9 @@ int do_ipmonitor(int argc, char **argv) ...@@ -153,7 +157,9 @@ int do_ipmonitor(int argc, char **argv)
if (!preferred_family || preferred_family == AF_INET6) if (!preferred_family || preferred_family == AF_INET6)
groups |= nl_mgrp(RTNLGRP_IPV6_PREFIX); groups |= nl_mgrp(RTNLGRP_IPV6_PREFIX);
} }
if (lneigh) {
groups |= nl_mgrp(RTNLGRP_NEIGH);
}
if (file) { if (file) {
FILE *fp; FILE *fp;
fp = fopen(file, "r"); fp = fopen(file, "r");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment