9 #include "trafgen_proto.h"
11 #define PROTO_MAX_LAYERS 16
27 uint8_t min
, max
, val
;
44 struct proto_hdr
*headers
[PROTO_MAX_LAYERS
];
46 struct timespec tstamp
;
53 struct randomizer
*rnd
;
57 struct proto_field
**fields
;
61 static inline bool packet_dyn_has_elems(struct packet_dyn
*p
)
63 return (p
->clen
|| p
->rlen
|| p
->slen
);
66 static inline bool packet_dyn_has_only_csums(struct packet_dyn
*p
)
68 return (p
->clen
== 0 && p
->rlen
== 0 && p
->slen
);
71 static inline bool packet_dyn_has_fields(struct packet_dyn
*p
)
76 extern void compile_packets_str(char *str
, bool verbose
, unsigned int cpu
);
77 extern void compile_packets(char *file
, bool verbose
, unsigned int cpu
,
78 bool invoke_cpp
, char *const cpp_argv
[]);
79 extern void cleanup_packets(void);
81 extern void set_fill(uint8_t val
, size_t len
);
83 extern struct packet
*current_packet(void);
84 extern uint32_t current_packet_id(void);
85 extern struct packet
*packet_get(uint32_t id
);
86 extern struct packet
*realloc_packet(void);
88 #endif /* TRAFGEN_CONF */