diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2021-02-17 11:43:52 +0100 | 
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2021-03-10 14:57:32 +0100 | 
| commit | ef524230a6baa5dd5dd337d723d47fe984d3e304 (patch) | |
| tree | b5eba1201fad225c2f0c69a7b09bea8d3916e2d3 /zebra/zebra_pbr.h | |
| parent | 5162e00045e1fe5ee4acd34d9e507e54f668e1e0 (diff) | |
zebra: move ipset and ipset_entry to zebra dplane contexts
like it has been done for iptable contexts, a zebra dplane context is
created for each ipset/ipset entry event. The zebra_dplane_ctx job is
then enqueued and processed by separate thread. Like it has been done
for zebra_pbr_iptable context, the ipset and ipset entry contexts are
encapsulated into an union of structures in zebra_dplane_ctx.
There is a specificity in that when storing ipset_entry structure, there
was a backpointer pointer to the ipset structure that is necessary
to get some complementary information before calling the hook. The
proposal is to use an ipset_entry_info structure next to the ipset_entry,
in the zebra_dplane context. That information is used for ipset_entry
processing. The ipset name and the ipset type are the only fields
 necessary.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/zebra_pbr.h')
| -rw-r--r-- | zebra/zebra_pbr.h | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/zebra/zebra_pbr.h b/zebra/zebra_pbr.h index 1e025bab64..ef93033661 100644 --- a/zebra/zebra_pbr.h +++ b/zebra/zebra_pbr.h @@ -64,6 +64,15 @@ struct zebra_pbr_rule {   *   * This is a filter mapped on ipset entries   */ +struct zebra_pbr_ipset_info { +	/* type is encoded as uint32_t +	 * but value is an enum ipset_type +	 */ +	uint32_t type; + +	char ipset_name[ZEBRA_IPSET_NAME_SIZE]; +}; +  struct zebra_pbr_ipset {  	/*  	 * Originating zclient sock fd, so we can know who to send @@ -85,6 +94,7 @@ struct zebra_pbr_ipset {  	char ipset_name[ZEBRA_IPSET_NAME_SIZE];  }; +  /*   * An IPSet Entry Filter   * @@ -178,6 +188,8 @@ void zebra_pbr_del_ipset_entry(struct zebra_pbr_ipset_entry *ipset);  void zebra_pbr_add_iptable(struct zebra_pbr_iptable *iptable);  void zebra_pbr_del_iptable(struct zebra_pbr_iptable *iptable);  void zebra_pbr_process_iptable(struct zebra_dplane_ctx *ctx); +void zebra_pbr_process_ipset(struct zebra_dplane_ctx *ctx); +void zebra_pbr_process_ipset_entry(struct zebra_dplane_ctx *ctx);  /*   * Get to know existing PBR rules in the kernel - typically called at startup.  | 
