X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fpackets.h;h=e727cc9a5da5a0263c155677553190d4bddc68f6;hb=0e70cdcb8ddeb20417e682fd63769f9d16601b07;hp=a389e6af74ff500a21612c6c98f47ddecc5bc1a8;hpb=3bffc610fa3ae08fa837f6bd0bf7a2deebdd0970;p=openvswitch diff --git a/lib/packets.h b/lib/packets.h index a389e6af..e727cc9a 100644 --- a/lib/packets.h +++ b/lib/packets.h @@ -131,7 +131,7 @@ void compose_benign_packet(struct ofpbuf *, const char *tag, uint16_t snap_type, const uint8_t eth_src[ETH_ADDR_LEN]); -void eth_set_vlan_tci(struct ofpbuf *, ovs_be16 tci); +void eth_push_vlan(struct ofpbuf *, ovs_be16 tci); /* Example: * @@ -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);