From 78c13b71e196a107eaa4ec00bb40b062929a6a88 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Wed, 7 Jun 2017 22:24:52 +0300 Subject: trafgen: Allow to generate packets to output pcap file Add trafgen_dev.c module which provides generic way of reading and writing packets to/from networking device or a pcap file. Also allow to handle output pcap file via '-o, --out, --dev' option. It might be useful in future for testing some link protocols which is not easy to capture (e.g. wlan packets) w/o having some special setup. Signed-off-by: Vadim Kochan [tklauser: fix whitespace issues] Signed-off-by: Tobias Klauser --- trafgen_proto.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'trafgen_proto.h') diff --git a/trafgen_proto.h b/trafgen_proto.h index f3d07ba..d3da963 100644 --- a/trafgen_proto.h +++ b/trafgen_proto.h @@ -5,6 +5,8 @@ #include #include +#include "trafgen_dev.h" + enum proto_id { PROTO_NONE = 0, PROTO_ETH, @@ -94,7 +96,7 @@ struct proto_field { struct proto_hdr *hdr; }; -extern void protos_init(const char *dev); +extern void protos_init(struct dev_io *dev); extern void proto_ops_register(const struct proto_ops *ops); extern struct proto_hdr *proto_header_push(enum proto_id pid); @@ -176,6 +178,6 @@ extern void proto_field_set_default_string(struct proto_field *field, const char extern void proto_field_func_add(struct proto_field *field, struct proto_field_func *func); -extern const char *proto_dev_get(void); +extern struct dev_io *proto_dev_get(void); #endif /* TRAFGEN_PROTO_H */ -- cgit v1.2.3-54-g00ecf