projects
/
openvswitch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7470a21
)
packets: New macros for detecting IP fragments.
author
Ben Pfaff
<blp@nicira.com>
Mon, 14 Jul 2008 20:54:45 +0000
(13:54 -0700)
committer
Ben Pfaff
<blp@nicira.com>
Fri, 18 Jul 2008 20:42:38 +0000
(13:42 -0700)
include/packets.h
patch
|
blob
|
history
diff --git
a/include/packets.h
b/include/packets.h
index 5d4eb5607a8faaf8356bad2f37d2d69da459ac5f..177bc30f4befecc3ff407b913de7e10fa6c655cd 100644
(file)
--- a/
include/packets.h
+++ b/
include/packets.h
@@
-173,6
+173,12
@@
BUILD_ASSERT_DECL(VLAN_ETH_HEADER_LEN == sizeof(struct vlan_eth_header));
#define IP_VERSION 4
+#define IP_DONT_FRAGMENT 0x4000 /* Don't fragment. */
+#define IP_MORE_FRAGMENTS 0x2000 /* More fragments. */
+#define IP_FRAG_OFF_MASK 0x1fff /* Fragment offset. */
+#define IP_IS_FRAGMENT(ip_frag_off) \
+ (ntohs(ip_frag_off) & (IP_MORE_FRAGMENTS | IP_FRAG_OFF_MASK))
+
#define IP_HEADER_LEN 20
struct ip_header {
uint8_t ip_ihl_ver;