flowtop: Add option for flow refresh interval
[netsniff-ng.git] / trafgen_conf.h
blobd2df1f4b30db448819a4556e5ac569392cdd34d7
1 #ifndef TRAFGEN_CONF
2 #define TRAFGEN_CONF
4 #include <stdint.h>
5 #include <stdio.h>
6 #include <sys/types.h>
8 #define TYPE_INC 0
9 #define TYPE_DEC 1
11 enum csum {
12 CSUM_IP,
13 CSUM_UDP,
14 CSUM_TCP,
15 CSUM_UDP6,
16 CSUM_TCP6,
19 struct counter {
20 int type;
21 uint8_t min, max, inc, val;
22 off_t off;
25 struct randomizer {
26 off_t off;
29 struct csum16 {
30 off_t off, from, to;
31 enum csum which;
34 struct packet {
35 uint8_t *payload;
36 size_t len;
39 struct packet_dyn {
40 struct counter *cnt;
41 size_t clen;
42 struct randomizer *rnd;
43 size_t rlen;
44 struct csum16 *csum;
45 size_t slen;
48 static inline bool packet_dyn_has_elems(struct packet_dyn *p)
50 return (p->rlen || p->slen || p->clen);
53 extern void compile_packets(char *file, bool verbose, unsigned int cpu, bool invoke_cpp);
54 extern void cleanup_packets(void);
56 #endif /* TRAFGEN_CONF */