X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fpackets.h;h=e727cc9a5da5a0263c155677553190d4bddc68f6;hb=0e70cdcb8ddeb20417e682fd63769f9d16601b07;hp=cb126380921d4295383987689dd033ec21168b01;hpb=d9065a90b6b955aa38586c952e8804ca7a22547e;p=openvswitch diff --git a/lib/packets.h b/lib/packets.h index cb126380..e727cc9a 100644 --- a/lib/packets.h +++ b/lib/packets.h @@ -291,6 +291,8 @@ ip_is_cidr(ovs_be32 netmask) uint32_t x = ~ntohl(netmask); return !(x & (x + 1)); } +int ip_count_cidr_bits(ovs_be32 netmask); +void ip_format_masked(ovs_be32 ip, ovs_be32 mask, struct ds *); #define IP_VER(ip_ihl_ver) ((ip_ihl_ver) >> 4) #define IP_IHL(ip_ihl_ver) ((ip_ihl_ver) & 15) @@ -423,6 +425,8 @@ static inline bool ipv6_mask_is_exact(const struct in6_addr *mask) { void format_ipv6_addr(char *addr_str, const struct in6_addr *addr); void print_ipv6_addr(struct ds *string, const struct in6_addr *addr); +void print_ipv6_masked(struct ds *string, const struct in6_addr *addr, + const struct in6_addr *mask); struct in6_addr ipv6_addr_bitand(const struct in6_addr *src, const struct in6_addr *mask); struct in6_addr ipv6_create_mask(int mask);