diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-03-12 09:23:48 +0100 | 
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-04-16 14:40:43 +0200 | 
| commit | 7abd6c4fa0331bc6a416c69080218457f9efc90f (patch) | |
| tree | d6e0fdfceebd71c106b608fc66d9b24df40c3228 /zebra/zebra_ns.c | |
| parent | 1907e4b80b03dbaea9cb13eb4b52b33d1b9d30d3 (diff) | |
zebra: add IPTABLE_ADD and IPTABLE_DEL commands in zapi
Those messages permit a remote daemon to configure an iptable entry. A
structure is defined that maps to an iptable entry. More specifically,
this structure proposes to associate fwmark, and a table ID.
Adding to the configuration, the initialisation of iptables hash list is
done into zebra netnamespace. Also a hook for notifying the sender that
the iptables has been correctly set is done.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/zebra_ns.c')
| -rw-r--r-- | zebra/zebra_ns.c | 9 | 
1 files changed, 9 insertions, 0 deletions
diff --git a/zebra/zebra_ns.c b/zebra/zebra_ns.c index f2a459cbb5..5c62e366a6 100644 --- a/zebra/zebra_ns.c +++ b/zebra/zebra_ns.c @@ -148,6 +148,12 @@ int zebra_ns_enable(ns_id_t ns_id, void **info)  		hash_create_size(8, zebra_pbr_ipset_entry_hash_key,  				 zebra_pbr_ipset_entry_hash_equal,  				 "IPset Hash Entry"); + +	zns->iptable_hash = +		hash_create_size(8, zebra_pbr_iptable_hash_key, +				 zebra_pbr_iptable_hash_equal, +				 "IPtable Hash Entry"); +  #if defined(HAVE_RTADV)  	rtadv_init(zns);  #endif @@ -261,6 +267,9 @@ int zebra_ns_disable(ns_id_t ns_id, void **info)  	hash_clean(zns->ipset_entry_hash,  		   zebra_pbr_ipset_entry_free),  	hash_free(zns->ipset_entry_hash); +	hash_clean(zns->iptable_hash, +		   zebra_pbr_iptable_free); +	hash_free(zns->iptable_hash);  	while (!RB_EMPTY(zebra_ns_table_head, &zns->ns_tables)) {  		znst = RB_ROOT(zebra_ns_table_head, &zns->ns_tables);  | 
