pktloc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #
  2. # Location definitions for packet matching
  3. #
  4. # name alignment offset mask shift
  5. ip.version u8 net+0 0xF0 4
  6. ip.hdrlen u8 net+0 0x0F
  7. ip.diffserv u8 net+1
  8. ip.length u16 net+2
  9. ip.id u16 net+4
  10. ip.flag.res u8 net+6 0xff 7
  11. ip.df u8 net+6 0x40 6
  12. ip.mf u8 net+6 0x20 5
  13. ip.offset u16 net+6 0x1FFF
  14. ip.ttl u8 net+8
  15. ip.proto u8 net+9
  16. ip.chksum u16 net+10
  17. ip.src u32 net+12
  18. ip.dst u32 net+16
  19. # if ip.ihl > 5
  20. ip.opts u32 net+20
  21. #
  22. # IP version 6
  23. #
  24. # name alignment offset mask shift
  25. ip6.version u8 net+0 0xF0 4
  26. ip6.tc u16 net+0 0xFF0 4
  27. ip6.flowlabel u32 net+0 0xFFFFF
  28. ip6.length u16 net+4
  29. ip6.nexthdr u8 net+6
  30. ip6.hoplimit u8 net+7
  31. ip6.src 16 net+8
  32. ip6.dst 16 net+24
  33. #
  34. # Transmission Control Protocol (TCP)
  35. #
  36. # name alignment offset mask shift
  37. tcp.sport u16 tcp+0
  38. tcp.dport u16 tcp+2
  39. tcp.seq u32 tcp+4
  40. tcp.ack u32 tcp+8
  41. # Data offset (4 bits)
  42. tcp.off u8 tcp+12 0xF0 4
  43. # Reserved [0 0 0] (3 bits)
  44. tcp.reserved u8 tcp+12 0x04 1
  45. # ECN [N C E] (3 bits)
  46. tcp.ecn u16 tcp+12 0x01C00 6
  47. # Individual TCP flags (0|1) (6 bits in total)
  48. tcp.flag.urg u8 tcp+13 0x20 5
  49. tcp.flag.ack u8 tcp+13 0x10 4
  50. tcp.flag.psh u8 tcp+13 0x08 3
  51. tcp.flag.rst u8 tcp+13 0x04 2
  52. tcp.flag.syn u8 tcp+13 0x02 1
  53. tcp.flag.fin u8 tcp+13 0x01
  54. tcp.win u16 tcp+14
  55. tcp.csum u16 tcp+16
  56. tcp.urg u16 tcp+18
  57. tcp.opts u32 tcp+20
  58. #
  59. # User Datagram Protocol (UDP)
  60. #
  61. # name alignment offset mask shift
  62. udp.sport u16 tcp+0
  63. udp.dport u16 tcp+2
  64. udp.length u16 tcp+4
  65. udp.csum u16 tcp+6