summaryrefslogtreecommitdiff
path: root/trafgen_l4.h
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2016-02-01 15:56:10 +0100
committerTobias Klauser <tklauser@distanz.ch>2016-02-01 16:22:24 +0100
commitf26175af848bfb3faaedd98b402949e8bd7ab8bc (patch)
tree3901fb68dd629e08abc02b81349ff4cb6b26f213 /trafgen_l4.h
parent0042946ef9e332e32af00a0fe0c6c7b6eec4b0e1 (diff)
trafgen: parser: Add TCP header generation function
Add a function 'tcp()' to generate TCP headers from the trafgen configuration language. Fields supported: sp|sport TCP source port (default 0) dp|dport TCP destination port (default 0) seq Sequence number (default: 0) aseq|ackseq Acknowledgement number (default 0) doff|hlen Header length/data offset (default: 5) cwr Congestion Window Reduced flag (default: 0) ece|ecn ECN-Echo flag (default: 0) urg Urgent flag (default: 0) ack Acknowledgement flag (default: 0) psh Push flag (default: 0) rst Reset flag (default: 0) syn Synchronize flag (default: 0) fin Finish flag (default: 0) win|window Receive window size (default: 0) csum Checksum field (calculated automatically) urgptr Urgent pointer (default: 0) Example (SYN on port 80/http): { tcp(dport=80, syn, window=5840) } Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_l4.h')
-rw-r--r--trafgen_l4.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/trafgen_l4.h b/trafgen_l4.h
index 4651009..da73ebc 100644
--- a/trafgen_l4.h
+++ b/trafgen_l4.h
@@ -8,6 +8,25 @@ enum udp_field {
UDP_CSUM,
};
+enum tcp_field {
+ TCP_SPORT,
+ TCP_DPORT,
+ TCP_SEQ,
+ TCP_ACK_SEQ,
+ TCP_DOFF,
+ TCP_CWR,
+ TCP_ECE,
+ TCP_URG,
+ TCP_ACK,
+ TCP_PSH,
+ TCP_RST,
+ TCP_SYN,
+ TCP_FIN,
+ TCP_WINDOW,
+ TCP_CSUM,
+ TCP_URG_PTR,
+};
+
extern void protos_l4_init(void);
#endif /* TRAFGEN_L4_H */