summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorThomas GraF <tgraf@suug.ch>2010-11-04 20:01:36 +0100
committerThomas GraF <tgraf@suug.ch>2010-11-04 20:01:36 +0100
commit59880cb01e0609f64bf004f8226541646b652cec (patch)
tree68c4d7efd722fdd5b48d56c21eeed08f319ad5fc /etc
parentd283c8e889a64771ff4d42a56c1ce64fa3395ed8 (diff)
downloadlibnl-59880cb01e0609f64bf004f8226541646b652cec.tar.gz
pktloc: support to specify a shift operator for packet locations
no users yet though.
Diffstat (limited to 'etc')
-rw-r--r--etc/pktloc44
1 files changed, 32 insertions, 12 deletions
diff --git a/etc/pktloc b/etc/pktloc
index 96f5a41..505c44e 100644
--- a/etc/pktloc
+++ b/etc/pktloc
@@ -2,14 +2,15 @@
# Location definitions for packet matching
#
-# name alignment offset mask
-ip.version u8 net+0 0xF0
+# name alignment offset mask shift
+ip.version u8 net+0 0xF0 4
ip.hdrlen u8 net+0 0x0F
ip.diffserv u8 net+1
ip.length u16 net+2
ip.id u16 net+4
-ip.df u8 net+6 0x40
-ip.mf u8 net+6 0x20
+ip.flag.res u8 net+6 0xff 7
+ip.df u8 net+6 0x40 6
+ip.mf u8 net+6 0x20 5
ip.offset u16 net+6 0x1FFF
ip.ttl u8 net+8
ip.proto u8 net+9
@@ -17,12 +18,16 @@ ip.chksum u16 net+10
ip.src u32 net+12
ip.dst u32 net+16
+# if ip.ihl > 5
+ip.opts u32 net+20
+
+
#
# IP version 6
#
-# name alignment offset mask
-ip6.version u8 net+0 0xF0
-ip6.tc u16 net+0 0xFF0
+# name alignment offset mask shift
+ip6.version u8 net+0 0xF0 4
+ip6.tc u16 net+0 0xFF0 4
ip6.flowlabel u32 net+0 0xFFFFF
ip6.length u16 net+4
ip6.nexthdr u8 net+6
@@ -33,14 +38,29 @@ ip6.dst 16 net+24
#
# Transmission Control Protocol (TCP)
#
-# name alignment offset mask
+# name alignment offset mask shift
tcp.sport u16 tcp+0
tcp.dport u16 tcp+2
tcp.seq u32 tcp+4
tcp.ack u32 tcp+8
-tcp.off u8 tcp+12 0xF0
-tcp.reserved u8 tcp+12 0x0F
-# FLAGS
+
+# Data offset (4 bits)
+tcp.off u8 tcp+12 0xF0 4
+
+# Reserved [0 0 0] (3 bits)
+tcp.reserved u8 tcp+12 0x04 1
+
+# ECN [N C E] (3 bits)
+tcp.ecn u16 tcp+12 0x01C00 6
+
+# Individual TCP flags (0|1) (6 bits in total)
+tcp.flag.urg u8 tcp+13 0x20 5
+tcp.flag.ack u8 tcp+13 0x10 4
+tcp.flag.psh u8 tcp+13 0x08 3
+tcp.flag.rst u8 tcp+13 0x04 2
+tpc.flag.syn u8 tcp+13 0x02 1
+tcp.flag.fin u8 tcp+13 0x01
+
tcp.win u16 tcp+14
tcp.csum u16 tcp+16
tcp.urg u16 tcp+18
@@ -49,7 +69,7 @@ tcp.opts u32 tcp+20
#
# User Datagram Protocol (UDP)
#
-# name alignment offset mask
+# name alignment offset mask shift
udp.sport u16 tcp+0
udp.dport u16 tcp+2
udp.length u16 tcp+4