diff options
| author | Stephen Worley <sworley@cumulusnetworks.com> | 2019-02-15 13:18:48 -0500 | 
|---|---|---|
| committer | Stephen Worley <sworley@cumulusnetworks.com> | 2019-10-25 11:13:36 -0400 | 
| commit | a95b8020ca4383dd4a43c18588c004b5683a8566 (patch) | |
| tree | 4e1ad20aac2a9041994f16eb1b9a8c54721ae14f /zebra/zebra_router.c | |
| parent | d2bec88a36effcff8d91375b325a944dad36b5e4 (diff) | |
zebra: Add a second table for indexing by ID
The messages we get from the kernel come with ids only
for groups, so lets index with those as well. Also adding
a helper function for lookup and get with the two different
tables.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_router.c')
| -rw-r--r-- | zebra/zebra_router.c | 6 | 
1 files changed, 6 insertions, 0 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c index ffffa8c001..100d17ecde 100644 --- a/zebra/zebra_router.c +++ b/zebra/zebra_router.c @@ -254,7 +254,13 @@ void zebra_router_init(void)  						zebra_pbr_iptable_hash_equal,  						"IPtable Hash Entry"); +	/* Index via hash and IDs so we can +	 * easily communicate to/from the kernel +	 */  	zrouter.nhgs =  		hash_create_size(8, zebra_nhg_hash_key, zebra_nhg_hash_equal,  				 "Zebra Router Nexthop Groups"); +	zrouter.nhgs_id = +		hash_create_size(8, zebra_nhg_id_key, zebra_nhg_id_equal, +				 "Zebra Router Nexthop Groups ID index");  }  | 
