pcap_sg: simplify code by using raw
[netsniff-ng.git] / trafgen_conf.h
blob08745be3874623c7caee571da9eab5d87a176023
1 /*
2 * netsniff-ng - the packet sniffing beast
3 * By Daniel Borkmann <daniel@netsniff-ng.org>
4 * Copyright 2009, 2010 Daniel Borkmann.
5 * Subject to the GPL, version 2.
6 */
8 #ifndef TRAFGEN_CONF
9 #define TRAFGEN_CONF
11 #include <stdint.h>
12 #include <stdio.h>
13 #include <sys/types.h>
15 #define TYPE_INC 0
16 #define TYPE_DEC 1
18 enum csum {
19 CSUM_IP,
20 CSUM_UDP,
21 CSUM_TCP,
24 struct counter {
25 int type;
26 uint8_t min, max, inc, val;
27 off_t off;
30 struct randomizer {
31 off_t off;
34 struct csum16 {
35 off_t off, from, to;
36 enum csum which;
39 struct packet {
40 uint8_t *payload;
41 size_t len;
44 struct packet_dyn {
45 struct counter *cnt;
46 size_t clen;
47 struct randomizer *rnd;
48 size_t rlen;
49 struct csum16 *csum;
50 size_t slen;
53 extern int compile_packets(char *file, int verbose, int cpu, bool invoke_cpp);
54 extern void cleanup_packets(void);
56 #endif /* TRAFGEN_CONF */