summaryrefslogtreecommitdiff
path: root/trafgen_conf.h
diff options
context:
space:
mode:
Diffstat (limited to 'trafgen_conf.h')
-rw-r--r--trafgen_conf.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/trafgen_conf.h b/trafgen_conf.h
new file mode 100644
index 0000000..7281b59
--- /dev/null
+++ b/trafgen_conf.h
@@ -0,0 +1,55 @@
+/*
+ * netsniff-ng - the packet sniffing beast
+ * Copyright 2009, 2010 Daniel Borkmann.
+ * Subject to the GPL, version 2.
+ */
+
+#ifndef TRAFGEN_CONF
+#define TRAFGEN_CONF
+
+#include <stdint.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+#define TYPE_INC 0
+#define TYPE_DEC 1
+
+enum csum {
+ CSUM_IP,
+ CSUM_UDP,
+ CSUM_TCP,
+};
+
+struct counter {
+ int type;
+ uint8_t min, max, inc, val;
+ off_t off;
+};
+
+struct randomizer {
+ off_t off;
+};
+
+struct csum16 {
+ off_t off, from, to;
+ enum csum which;
+};
+
+struct packet {
+ uint8_t *payload;
+ size_t len;
+};
+
+struct packet_dyn {
+ struct counter *cnt;
+ size_t clen;
+ struct randomizer *rnd;
+ size_t rlen;
+ struct csum16 *csum;
+ size_t slen;
+};
+
+extern int compile_packets(char *file, int verbose, int cpu, bool invoke_cpp);
+extern void cleanup_packets(void);
+
+#endif /* TRAFGEN_CONF */