summaryrefslogtreecommitdiff
path: root/trafgen_l2.h
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2016-01-26 22:25:06 +0200
committerTobias Klauser <tklauser@distanz.ch>2016-01-28 16:15:29 +0100
commitfac5a67eb5d4928f7efbf1f0d731a7e93f0f8193 (patch)
tree5c98747f50297c27f81f605715b0d9762d2ac167 /trafgen_l2.h
parentd053535a66ff864d309dec2303927e410b27e5b6 (diff)
trafgen: l2: Add ARP header generation logic
Add ARP protocol header fields generation. By default htype ethernet (1) and ptype IPv4 (0x0800) and the corresponding hlen/plen values will be initialized and the opcode is set to ARP Request (1). Source MAC and IP address are set to the device's addresses if not specified. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> [tk: rephrase and extend commit message] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_l2.h')
-rw-r--r--trafgen_l2.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/trafgen_l2.h b/trafgen_l2.h
index e0d9702..7643bc3 100644
--- a/trafgen_l2.h
+++ b/trafgen_l2.h
@@ -7,6 +7,18 @@ enum eth_field {
ETH_PROTO_ID,
};
+enum arp_field {
+ ARP_HTYPE,
+ ARP_PTYPE,
+ ARP_HLEN,
+ ARP_PLEN,
+ ARP_OPER,
+ ARP_SHA,
+ ARP_SPA,
+ ARP_THA,
+ ARP_TPA,
+};
+
extern void protos_l2_init(void);
#endif /* TRAFGEN_L2_H */