summaryrefslogtreecommitdiff
path: root/trafgen_proto.c
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2016-01-29 00:06:26 +0200
committerTobias Klauser <tklauser@distanz.ch>2016-01-29 08:59:25 +0100
commitd275f16591ca44d91ee4e56d65553529a429a62d (patch)
tree01b3095e29d9b13c5feceeb1b563f41e3f1f56f4 /trafgen_proto.c
parentbe21df123309c83cd47a1fa5f2c0ee1cf4657810 (diff)
trafgen: l4: Add UDP header generation logic
Add trafgen_l4.c module with generation UDP header fields. UDP protocol generation logic automaticaly sets the protocol field of the lower level protocol to IPPROTO_UDP by default (if it is IPv4). Also checksum & length are calculated and set if it is not given by the user. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_proto.c')
-rw-r--r--trafgen_proto.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/trafgen_proto.c b/trafgen_proto.c
index 75556f9..5fcb5cc 100644
--- a/trafgen_proto.c
+++ b/trafgen_proto.c
@@ -13,6 +13,7 @@
#include "trafgen_conf.h"
#include "trafgen_l2.h"
#include "trafgen_l3.h"
+#include "trafgen_l4.h"
#include "trafgen_proto.h"
#define field_shift_and_mask(f, v) (((v) << (f)->shift) & \
@@ -362,6 +363,7 @@ void protos_init(const char *dev)
protos_l2_init();
protos_l3_init();
+ protos_l4_init();
for (p = registered; p; p = p->next)
p->ctx = &ctx;