summaryrefslogtreecommitdiff
path: root/trafgen_proto.h
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2016-02-01 19:01:39 +0200
committerTobias Klauser <tklauser@distanz.ch>2016-02-02 16:54:48 +0100
commita4e17af38e2e2545c32292b7b46102d49e738e1e (patch)
tree454c138b7d28c0d97c6e551fe479b70f112f408f /trafgen_proto.h
parent287e1d8899e2649395022b57230c1a93c125cc2c (diff)
trafgen: l2: Add VLAN header generation
Add generation of VLAN header with supported fields: TPID, DEI/CFI, PCP, VID Changed struct proto_field.offset uint16_t -> int16_t to make TPID offset -2 to point to ether type. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_proto.h')
-rw-r--r--trafgen_proto.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/trafgen_proto.h b/trafgen_proto.h
index 491e079..996c24e 100644
--- a/trafgen_proto.h
+++ b/trafgen_proto.h
@@ -12,6 +12,7 @@ struct proto_ctx {
enum proto_id {
PROTO_NONE,
PROTO_ETH,
+ PROTO_VLAN,
PROTO_ARP,
PROTO_IP4,
PROTO_IP6,
@@ -31,7 +32,8 @@ struct proto_field {
size_t len;
uint32_t shift;
uint32_t mask;
- uint16_t offset;
+ /* might be negative (e.g. VLAN TPID field) */
+ int16_t offset;
bool is_set;
uint16_t pkt_offset;