diff options
author | Donald Sharp <sharpd@nvidia.com> | 2023-09-07 21:10:42 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2023-09-08 15:50:21 +0200 |
commit | 36f78525cf86b9a7a7048809f23ef4ff9db2258f (patch) | |
tree | 7aa35e28030bdda3d0e1470067c15e9b15e26241 /lib | |
parent | bgpd: Properly use bgp_path_info_cmp for evpn usage (diff) | |
download | frr-36f78525cf86b9a7a7048809f23ef4ff9db2258f.tar.xz frr-36f78525cf86b9a7a7048809f23ef4ff9db2258f.zip |
lib: fixup prefix.h to our standards
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/prefix.h | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/lib/prefix.h b/lib/prefix.h index 7ca525e76..fc6e32dd5 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -377,9 +377,9 @@ static inline void ipv4_addr_copy(struct in_addr *dst, #endif /*s6_addr32*/ /* Prototypes. */ -extern int str2family(const char *); -extern int afi2family(afi_t); -extern afi_t family2afi(int); +extern int str2family(const char *string); +extern int afi2family(afi_t afi); +extern afi_t family2afi(int family); extern const char *family2str(int family); extern const char *safi2str(safi_t safi); extern const char *afi2str(afi_t afi); @@ -409,14 +409,15 @@ extern void prefix_free(struct prefix **p); extern void prefix_free_lists(void *arg); extern const char *prefix_family_str(union prefixconstptr pu); extern int prefix_blen(union prefixconstptr pu); -extern int str2prefix(const char *, struct prefix *); +extern int str2prefix(const char *string, struct prefix *prefix); #define PREFIX2STR_BUFFER PREFIX_STRLEN extern void prefix_mcast_inet4_dump(const char *onfail, struct in_addr addr, char *buf, int buf_size); extern const char *prefix_sg2str(const struct prefix_sg *sg, char *str); -extern const char *prefix2str(union prefixconstptr, char *, int); +extern const char *prefix2str(union prefixconstptr upfx, char *buffer, + int size); extern int evpn_type5_prefix_match(const struct prefix *evpn_pfx, const struct prefix *match_pfx); extern int prefix_match(union prefixconstptr unet, union prefixconstptr upfx); @@ -437,36 +438,37 @@ extern bool evpn_addr_same(const struct evpn_addr *e1, const struct evpn_addr *e #define prefix_copy(a, b) ({ memset(a, 0, sizeof(*a)); prefix_copy(a, b); }) #endif -extern struct prefix *sockunion2hostprefix(const union sockunion *, +extern struct prefix *sockunion2hostprefix(const union sockunion *su, struct prefix *p); -extern void prefix2sockunion(const struct prefix *, union sockunion *); +extern void prefix2sockunion(const struct prefix *p, union sockunion *su); -extern int str2prefix_eth(const char *, struct prefix_eth *); +extern int str2prefix_eth(const char *string, struct prefix_eth *p); extern struct prefix_ipv4 *prefix_ipv4_new(void); extern void prefix_ipv4_free(struct prefix_ipv4 **p); -extern int str2prefix_ipv4(const char *, struct prefix_ipv4 *); -extern void apply_mask_ipv4(struct prefix_ipv4 *); +extern int str2prefix_ipv4(const char *string, struct prefix_ipv4 *p); +extern void apply_mask_ipv4(struct prefix_ipv4 *p); -extern int prefix_ipv4_any(const struct prefix_ipv4 *); -extern void apply_classful_mask_ipv4(struct prefix_ipv4 *); +extern int prefix_ipv4_any(const struct prefix_ipv4 *p); +extern void apply_classful_mask_ipv4(struct prefix_ipv4 *p); -extern uint8_t ip_masklen(struct in_addr); -extern void masklen2ip(const int, struct in_addr *); +extern uint8_t ip_masklen(struct in_addr addr); +extern void masklen2ip(const int length, struct in_addr *addr); /* given the address of a host on a network and the network mask length, * calculate the broadcast address for that network; * special treatment for /31 according to RFC3021 section 3.3 */ extern in_addr_t ipv4_broadcast_addr(in_addr_t hostaddr, int masklen); -extern int netmask_str2prefix_str(const char *, const char *, char *, size_t); +extern int netmask_str2prefix_str(const char *net_str, const char *mask_str, + char *prefix_str, size_t prefix_str_len); extern struct prefix_ipv6 *prefix_ipv6_new(void); extern void prefix_ipv6_free(struct prefix_ipv6 **p); -extern int str2prefix_ipv6(const char *, struct prefix_ipv6 *); -extern void apply_mask_ipv6(struct prefix_ipv6 *); +extern int str2prefix_ipv6(const char *str, struct prefix_ipv6 *p); +extern void apply_mask_ipv6(struct prefix_ipv6 *p); -extern int ip6_masklen(struct in6_addr); -extern void masklen2ip6(const int, struct in6_addr *); +extern int ip6_masklen(struct in6_addr netmask); +extern void masklen2ip6(const int masklen, struct in6_addr *netmask); extern int is_zero_mac(const struct ethaddr *mac); extern bool is_mcast_mac(const struct ethaddr *mac); |