]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: Allow the collection of sg stats on more platforms.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 18 Jan 2017 03:01:36 +0000 (22:01 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 18 Jan 2017 03:01:36 +0000 (22:01 -0500)
The code to collect the sg stats was written for linux.
Abstract the call to allow it to work on all platforms.
I have not implemented the call for non-linux systems.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/kernel_null.c
zebra/rt.h
zebra/rt_netlink.c
zebra/rt_netlink.h
zebra/rt_socket.c
zebra/zebra_mroute.c

index a20597882cf8c2d2173d13afcc518dfb30215294..896ca96b487f8038e3b9839ae0c6920578b08707 100644 (file)
@@ -60,3 +60,5 @@ int kernel_neigh_update (int a, int b, uint32_t c, char *d, int e)
 void kernel_init (struct zebra_ns *zns) { return; }
 void kernel_terminate (struct zebra_ns *zns) { return; }
 void route_read (struct zebra_ns *zns) { return; }
+
+int kernel_get_ipmr_sg_stats (void *m) { return 0; }
index e56e3b8fe3a68af4c11c2ece97c482e79cbda680..40beb6a45fb61ada3e61f42de3f6528a7171cf5a 100644 (file)
@@ -40,4 +40,5 @@ extern int kernel_upd_lsp (zebra_lsp_t *);
 extern int kernel_del_lsp (zebra_lsp_t *);
 extern int mpls_kernel_init (void);
 
+extern int kernel_get_ipmr_sg_stats (void *mroute);
 #endif /* _ZEBRA_RT_H */
index 2dfe43f5df7756280bf0e131eeaef10392e16995..d2781f4c4e60a709eace23d364007b999ceae51c 100644 (file)
@@ -1526,7 +1526,7 @@ skip:
 }
 
 int
-netlink_get_ipmr_sg_stats (void *in)
+kernel_get_ipmr_sg_stats (void *in)
 {
   int suc = 0;
   struct mcast_route_data *mr = (struct mcast_route_data *)in;
index 6774b7dd3d0669d3e94a1cc0b3f8223b5c04015e..7183525fba6ec8c48052afb6893f78833233cdbb 100644 (file)
@@ -37,7 +37,6 @@ extern int netlink_route_change (struct sockaddr_nl *snl, struct nlmsghdr *h,
                                  ns_id_t ns_id);
 extern int netlink_route_read (struct zebra_ns *zns);
 
-extern int netlink_get_ipmr_sg_stats (void *mroute);
 #endif /* HAVE_NETLINK */
 
 #endif /* _ZEBRA_RT_NETLINK_H */
index b2c99d98136f91a98080726f0e3c67087e95a602..404bdef57d85828272b43765096716bec33797ec 100644 (file)
@@ -416,3 +416,9 @@ kernel_neigh_update (int add, int ifindex, uint32_t addr, char *lla, int llalen)
   /* TODO */
   return 0;
 }
+
+extern void
+kernel_get_ipmr_sg_stats (void *mroute)
+{
+  return;
+}
index d05c90670423039d003fe4d197c2da408d396ce5..86356104bdab0bc4ddfd76c12f53d423a180078e 100644 (file)
@@ -30,7 +30,7 @@
 #include "zebra/zserv.h"
 #include "zebra/zebra_vrf.h"
 #include "zebra/zebra_mroute.h"
-#include "zebra/rt_netlink.h"
+#include "zebra/rt.h"
 
 int
 zebra_ipmr_route_stats (struct zserv *client, int fd, u_short length, struct zebra_vrf *zvrf)
@@ -50,7 +50,7 @@ zebra_ipmr_route_stats (struct zserv *client, int fd, u_short length, struct zeb
   strcpy (sbuf, inet_ntoa (mroute.sg.src));
   strcpy (gbuf, inet_ntoa (mroute.sg.grp));
 
-  suc = netlink_get_ipmr_sg_stats (&mroute);
+  suc = kernel_get_ipmr_sg_stats (&mroute);
 
   s = client->obuf;