summaryrefslogtreecommitdiff
path: root/zebra/zebra_rnh.h
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-01-21 12:30:36 -0200
committerRenato Westphal <renato@opensourcerouting.org>2019-01-21 13:26:36 -0200
commit73bf60a06b2d798a06e408fb37ffa2e8e574f611 (patch)
treeec418411179b57f57de88a6c8c59294f904ba361 /zebra/zebra_rnh.h
parent6f95d11a172aca23e7fda492988567c944bd4553 (diff)
zebra: consolidate how we indentify address-families in the NHT code
Favor usage of the afi_t enumeration to identify address-families over using the classic AF_INET[6] constants for that. The choice to use either of the two seems to be mostly arbitrary throughout our code base, which leads to confusion and bugs like the one fixed by commit 6f95d11a1. To address this problem, favor usage of the afi_t enumeration whenever possible, since 1) it's an enumeration (helps the compilers to catch some bugs), 2) has a safi_t sibling and 3) can be used to index static arrays. AF_INET[6] should then be used only when interfacing with the kernel or external libraries like libc. The family2afi() and afi2family() functions can be used to convert between the two different representations back and forth. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/zebra_rnh.h')
-rw-r--r--zebra/zebra_rnh.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/zebra/zebra_rnh.h b/zebra/zebra_rnh.h
index ed1fe9b756..00ee60dc1a 100644
--- a/zebra/zebra_rnh.h
+++ b/zebra/zebra_rnh.h
@@ -78,9 +78,9 @@ extern void zebra_register_rnh_pseudowire(vrf_id_t, struct zebra_pw *);
extern void zebra_deregister_rnh_pseudowire(vrf_id_t, struct zebra_pw *);
extern void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client,
rnh_type_t type);
-extern void zebra_evaluate_rnh(struct zebra_vrf *zvrf, int family, int force,
+extern void zebra_evaluate_rnh(struct zebra_vrf *zvrf, afi_t afi, int force,
rnh_type_t type, struct prefix *p);
-extern void zebra_print_rnh_table(vrf_id_t vrfid, int family, struct vty *vty,
+extern void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, struct vty *vty,
rnh_type_t);
extern char *rnh_str(struct rnh *rnh, char *buf, int size);
#endif /*_ZEBRA_RNH_H */