#ifndef TRAFGEN_CONF #define TRAFGEN_CONF #include #include #include #include #include "trafgen_proto.h" #define PROTO_MAX_LAYERS 16 #define TYPE_INC 0 #define TYPE_DEC 1 enum csum { CSUM_IP, CSUM_UDP, CSUM_TCP, CSUM_UDP6, CSUM_TCP6, CSUM_ICMP6, }; struct counter { int type, inc; uint8_t min, max, val; off_t off; }; struct randomizer { off_t off; }; struct csum16 { off_t off, from, to; enum csum which; }; struct packet { uint32_t id; uint8_t *payload; size_t len; struct proto_hdr *headers[PROTO_MAX_LAYERS]; size_t headers_count; struct timespec tstamp; bool is_created; }; struct packet_dyn { struct counter *cnt; size_t clen; struct randomizer *rnd; size_t rlen; struct csum16 *csum; size_t slen; struct proto_field **fields; size_t flen; }; static inline bool packet_dyn_has_elems(struct packet_dyn *p) { return (p->clen || p->rlen || p->slen); } static inline bool packet_dyn_has_only_csums(struct packet_dyn *p) { return (p->clen == 0 && p->rlen == 0 && p->slen); } static inline bool packet_dyn_has_fields(struct packet_dyn *p) { return p->flen; } extern void compile_packets_str(char *str, bool verbose, unsigned int cpu); extern void compile_packets(char *file, bool verbose, unsigned int cpu, bool invoke_cpp, char *const cpp_argv[]); extern void cleanup_packets(void); extern void set_fill(uint8_t val, size_t len); extern struct packet *current_packet(void); extern uint32_t current_packet_id(void); extern struct packet *packet_get(uint32_t id); extern struct packet *realloc_packet(void); #endif /* TRAFGEN_CONF */ 86e84203a6d117'>refslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2016-08-09 22:43:46 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2016-08-10 23:01:53 +1000
commit164af597ce945751e2dcd53d0a86e84203a6d117 (patch)
treebd8d5b3d11681d5a8859ef20efe4bb31be785eb6
parent97f6e0cc35026a2a09147a6da636d901525e1969 (diff)
powerpc/Makefile: Use cflags-y/aflags-y for setting endian options
When we introduced the little endian support, we added the endian flags to CC directly using override. I don't know the history of why we did that, I suspect no one does. Although this mostly works, it has one bug, which is that CROSS32CC doesn't get -mbig-endian. That means when the compiler is little endian by default and the user is building big endian, vdso32 is incorrectly compiled as little endian and the kernel fails to build. Instead we can add the endian flags to cflags-y/aflags-y, and then append those to KBUILD_CFLAGS/KBUILD_AFLAGS. This has the advantage of being 1) less ugly, 2) the documented way of adding flags in the arch Makefile and 3) it fixes building vdso32 with a LE toolchain. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>