-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: Add vrf_lookup_by_table with hashmap to vrf.c[h]
Lookup uses hashmap with table_id key and vrf_id values. Only for vrf backended by vrf lite. Could do similar implementation with ns_id in future. Hashmap local to vrf.c but must be updated when vrf is added or modified. For updates to vrf_id, call to helper function vrf_ids_by_table_update() is added in the publicly used vrf_update() function. Previously, the table_id was set by directly modifying vrf->data.l.table_id in zclient.c. However, as no functions in vrf.c are notified when change occurs, a helper function, vrf_update_table_id(), is added. This both updates vrf_data.l.table_id, and updates the local hashmap. vrf_delete() function used for removing vrfs. Add call to here to vrf_ids_by_table_delete() helper function to remove entries from hashmap. Signed-off-by: Nathan Duddles <[email protected]>
- Loading branch information
1 parent
3b88af3
commit 1c0ec9c
Showing
3 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters