mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-11 15:18:06 +00:00
zebra: Cleanup api
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>
This commit is contained in:
parent
fd71d73eb3
commit
1fbfe5a572
@ -31,6 +31,16 @@
|
|||||||
/* Private functions */
|
/* Private functions */
|
||||||
|
|
||||||
/* Public 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.
|
* Handle success or failure of rule (un)install in the kernel.
|
||||||
*/
|
*/
|
||||||
|
@ -90,6 +90,8 @@ struct zebra_pbr_rule {
|
|||||||
struct zebra_pbr_action action;
|
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.
|
* Install specified rule for a specific interface.
|
||||||
|
@ -2636,7 +2636,7 @@ static inline void zread_rule(uint16_t command, struct zserv *client,
|
|||||||
if (zpr.filter.dst_port)
|
if (zpr.filter.dst_port)
|
||||||
zpr.filter.filter_bm |= PBR_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:
|
stream_failure:
|
||||||
|
Loading…
Reference in New Issue
Block a user