]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Add Monitor Support For Neigh Table
authorVarun Chandramohan <varunc@linux.vnet.ibm.com>
Thu, 12 Mar 2009 08:12:07 +0000 (13:42 +0530)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Fri, 27 Mar 2009 18:09:04 +0000 (11:09 -0700)
This patch adds exclusive support to enable monitoring
neighbour table entries in ip command.

Signed-off-by: Varun Chandramohan <varunc@linux.vnet.ibm.com>
ip/ipmonitor.c

index df0fd91701bddb3cf55607d70ca76b5a9f65c814..a74730e49277510ef1c37556029ff1ec2fe8cd23 100644 (file)
@@ -102,6 +102,7 @@ int do_ipmonitor(int argc, char **argv)
        int laddr=0;
        int lroute=0;
        int lprefix=0;
+       int lneigh=0;
 
        rtnl_close(&rth);
        ipaddr_reset_filter(1);
@@ -124,6 +125,9 @@ int do_ipmonitor(int argc, char **argv)
                } else if (matches(*argv, "prefix") == 0) {
                        lprefix=1;
                        groups = 0;
+               } else if (matches(*argv, "neigh") == 0) {
+                       lneigh=1;
+                       groups = 0;             
                } else if (strcmp(*argv, "all") == 0) {
                        groups = ~RTMGRP_TC;
                } else if (matches(*argv, "help") == 0) {
@@ -153,7 +157,9 @@ int do_ipmonitor(int argc, char **argv)
                if (!preferred_family || preferred_family == AF_INET6)
                        groups |= nl_mgrp(RTNLGRP_IPV6_PREFIX);
        }
-
+       if (lneigh) {
+               groups |= nl_mgrp(RTNLGRP_NEIGH);
+       }
        if (file) {
                FILE *fp;
                fp = fopen(file, "r");