@@ -28,3 +28,56 @@ cargo run --example channel-xdp --release --features="camellia" # AF_XDP version
2828cargo install flamegraph
2929cargo flamegraph --root --example channel
3030```
31+
32+ ### Packet Log Spec
33+
34+ ``` text
35+ 0 1 2 3
36+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
37+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
38+ | LH.length | LH.ty.| GPH.length |GPH.ac.|GPH.ty.|
39+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40+ | GP.timestamp |
41+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
42+ | GP.length | PRH.length |PRH.ty.|
43+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
44+ | PRT (custom) |
45+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
46+ ```
47+
48+ Generated with [ protocol] ( https://github.com/luismartingarcia/protocol ) , where:
49+
50+ * ` LH ` is short for log entry header
51+ * ` GPH ` is short for general packet entry header
52+ * ` GP ` is short for general packet entry (the body part)
53+ * ` PRH ` is short for protocol entry header
54+ * ` PRT ` is short for protocol entry (the body part)
55+ * ` ty. ` is short for type
56+ * ` ac. ` is short for action
57+
58+ ``` shell
59+ protocol " LH.length:12,LH.ty.:4,GPH.length:8,GPH.ac.:4,GPH.ty.:4,GP.timestamp:32,GP.length:16,PRH.length:12,PRH.ty.:4,PRT (custom):32"
60+ ```
61+
62+ We currently provide TCP log spec (a variant of the protocol entry body part, i.e. ` PRT (custom) ` ):
63+
64+ ``` text
65+ 0 1 2 3
66+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
67+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
68+ | tcp.flow_id |
69+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
70+ | tcp.seq |
71+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
72+ | tcp.ack |
73+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
74+ | ip.id | ip.frag_offset |
75+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
76+ | ip.checksum | tcp.flags | padding |
77+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
78+
79+ ```
80+
81+ ``` shell
82+ protocol " tcp.flow_id:32,tcp.seq:32,tcp.ack:32,ip.id:16,ip.frag_offset:16,ip.checksum:16,tcp.flags:8,padding:8"
83+ ```
0 commit comments