From: Ben Pfaff Date: Mon, 14 Jul 2008 20:54:22 +0000 (-0700) Subject: packets: New IP header macros. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6231bb85af6a199bb7aa082e8bd23f658a22b5b9;p=openvswitch packets: New IP header macros. --- diff --git a/include/packets.h b/include/packets.h index cd782952..fac8f414 100644 --- a/include/packets.h +++ b/include/packets.h @@ -164,10 +164,13 @@ BUILD_ASSERT_DECL(VLAN_ETH_HEADER_LEN == sizeof(struct vlan_eth_header)); #define IP_VER(ip_ihl_ver) ((ip_ihl_ver) >> 4) #define IP_IHL(ip_ihl_ver) ((ip_ihl_ver) & 15) +#define IP_IHL_VER(ihl, ver) (((ver) << 4) | (ihl)) #define IP_TYPE_TCP 6 #define IP_TYPE_UDP 17 +#define IP_VERSION 4 + #define IP_HEADER_LEN 20 struct ip_header { uint8_t ip_ihl_ver;