]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: Cleanup api
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 16 Feb 2018 01:11:12 +0000 (20:11 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 9 Mar 2018 16:07:41 +0000 (11:07 -0500)
Allow the add/delete to go through a intermediary function in
zebra_pbr.c instead of directly to the underlying os call.  This
will allow future refinements to track the data a bit better
so that on shutdown we can delete the rules.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zebra_pbr.c
zebra/zebra_pbr.h
zebra/zserv.c

index 827005b3a14006eca75741248bf7f5a302ef5f7f..8a7e693bbfe6b526518a68aae3d57dbbf79eb183 100644 (file)
 /* Private functions */
 
 /* Public functions */
+void zebra_pbr_add_rule(struct zebra_pbr_rule *rule, struct interface *ifp)
+{
+       kernel_add_pbr_rule(rule, ifp);
+}
+
+void zebra_pbr_del_rule(struct zebra_pbr_rule *rule, struct interface *ifp)
+{
+       kernel_del_pbr_rule(rule, ifp);
+}
+
 /*
  * Handle success or failure of rule (un)install in the kernel.
  */
index b87388afc5a9e9ded728a1088cb52e1521e78322..6a97ef55ed64ecb0f547faf4627c9cb18e639a5c 100644 (file)
@@ -90,6 +90,8 @@ struct zebra_pbr_rule {
        struct zebra_pbr_action action;
 };
 
+void zebra_pbr_add_rule(struct zebra_pbr_rule *rule, struct interface *ifp);
+void zebra_pbr_del_rule(struct zebra_pbr_rule *rule, struct interface *ifp);
 
 /*
  * Install specified rule for a specific interface.
index 007a02cedf84a019518e00a60fe7641c484a609d..7ec8525f49552c5f739f62e9a1604711292ffe39 100644 (file)
@@ -2636,7 +2636,7 @@ static inline void zread_rule(uint16_t command, struct zserv *client,
                if (zpr.filter.dst_port)
                        zpr.filter.filter_bm |= PBR_FILTER_DST_PORT;
 
-               kernel_add_pbr_rule(&zpr, ifp);
+               zebra_pbr_add_rule(&zpr, ifp);
        }
 
 stream_failure: