Move ctx struct to trafgen.h to be used from other modules. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen.c | 16 +--------------- trafgen.h | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 trafgen.h
diff --git a/trafgen.c b/trafgen.c index 53320fe..f7402d6 100644 --- a/trafgen.c +++ b/trafgen.c @@ -9,7 +9,6 @@ #include <string.h> #include <getopt.h> #include <ctype.h> -#include <stdbool.h> #include <sched.h> #include <sys/socket.h> #include <sys/types.h> @@ -24,10 +23,7 @@ #include <netinet/ip.h> #include <linux/icmp.h> #include <linux/if.h> -#include <arpa/inet.h> #include <signal.h> -#include <stdint.h> -#include <stdlib.h> #include <fcntl.h> #include <time.h> #include <poll.h> @@ -54,17 +50,7 @@ #include "timer.h" #include "ring_tx.h" #include "csum.h" - -struct ctx { - bool rand, rfraw, jumbo_support, verbose, smoke_test, enforce, qdisc_path; - size_t reserve_size; - unsigned long num; - unsigned int cpus; - uid_t uid; gid_t gid; - char *device, *device_trans, *rhost; - struct timespec gap; - struct sockaddr_in dest; -}; +#include "trafgen.h" struct cpu_stats { unsigned long tv_sec, tv_usec; diff --git a/trafgen.h b/trafgen.h new file mode 100644 index 0000000..04ed9cb --- /dev/null +++ b/trafgen.h @@ -0,0 +1,21 @@ +#ifndef TRAFGEN_I_H +#define TRAFGEN_I_H + +#include <stdint.h> +#include <stdlib.h> +#include <arpa/inet.h> +#include <stdbool.h> + +struct ctx { + bool rand, rfraw, jumbo_support, verbose, smoke_test, enforce; + bool qdisc_path; + size_t reserve_size; + unsigned long num; + unsigned int cpus; + uid_t uid; gid_t gid; + char *device, *device_trans, *rhost; + struct timespec gap; + struct sockaddr_in dest; +}; + +#endif -- 2.4.2 -- You received this message because you are subscribed to the Google Groups "netsniff-ng" group. To unsubscribe from this group and stop receiving emails from it, send an email to netsniff-ng+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.