summaryrefslogtreecommitdiff
path: root/staging/mausezahn.c
diff options
context:
space:
mode:
Diffstat (limited to 'staging/mausezahn.c')
-rw-r--r--staging/mausezahn.c64
1 files changed, 53 insertions, 11 deletions
diff --git a/staging/mausezahn.c b/staging/mausezahn.c
index 6c36166..7599b74 100644
--- a/staging/mausezahn.c
+++ b/staging/mausezahn.c
@@ -23,7 +23,8 @@
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <stdarg.h>
-
+#include <getopt.h>
+
#include "mz.h"
#include "cli.h"
#include "mops.h"
@@ -32,8 +33,54 @@
#include "die.h"
#include "dev.h"
+enum operating_modes mode;
+
+int ipv6_mode;
+int quiet; // don't even print 'important standard short messages'
+int verbose; // report character
+int simulate; // if 1 then don't really send frames
+
+char path[256];
+char filename[256];
+FILE *fp, *fp2; // global multipurpose file pointer
+
+long double total_d;
+clock_t mz_start, mz_stop;
+
+int mz_rand;
+int bwidth;
+
+int32_t
+ jitter[TIME_COUNT_MAX];
+
+int
+ rtp_log,
+ time0_flag, // If set then time0 has valid data
+ sqnr0_flag;
+
+u_int8_t
+ mz_ssrc[4]; // holds RTP stream identifier for rcv_rtp()
+
+u_int16_t
+ sqnr_cur,
+ sqnr_last,
+ sqnr_next;
+
+u_int32_t
+ gind, // a global index to run through deltaRX, deltaTX, and jitter
+ gind_max; // the amount of entries used in the (ugly oversized) arrays; per default set to TIME_COUNT
+
+struct tx_struct tx; // NOTE: tx elements are considered as default values for MOPS
+
+struct device_struct device_list[MZ_MAX_DEVICES];
+
+int device_list_entries;
+
int verbose_level = 0;
+char mz_default_config_path[256];
+char mz_default_log_path[256];
+
static const char *short_options = "46hqvVSxra:A:b:B:c:d:E:f:F:l:p:P:R:t:T:M:Q:X:";
static void signal_handler(int number)
@@ -177,7 +224,7 @@ static void version(void)
printf("\nmausezahn %s, Git id: %s\n", VERSION_LONG, GITVERSION);
puts("a fast versatile traffic generator\n"
"http://www.netsniff-ng.org\n\n"
- "Please report bugs to <bugs@netsniff-ng.org>\n"
+ "Please report bugs at https://github.com/netsniff-ng/netsniff-ng/issues\n"
"Copyright (C) 2008-2010 Herbert Haas <herbert@perihel.at>,\n"
"Copyright (C) 2011 Daniel Borkmann <dborkma@tik.ee.ethz.ch>,\n"
"Swiss federal institute of technology (ETH Zurich)\n"
@@ -192,9 +239,6 @@ int reset(void)
int i;
time_t t;
- // Determine platform type sizes:
- MZ_SIZE_LONG_INT = sizeof(long int);
-
mz_default_config_path[0] = 0x00;
mz_default_log_path[0] = 0x00;
@@ -404,9 +448,7 @@ int getopts (int argc, char *argv[])
char unit;
opterr = 1; // let getopt print error message if necessary
-
-
- while ((c = getopt(argc, argv, short_options)) != -1)
+ while ((c = getopt_long(argc, argv, short_options, NULL, NULL)) != -1) {
switch (c) {
case '4':
tx.eth_type = 0x0800;
@@ -603,7 +645,7 @@ int getopts (int argc, char *argv[])
fprintf (stderr," mz/getopts: Could not handle arguments properly!\n");
return 1;
}
-
+ }
// ********************************************
// Handle additional arguments
// ********************************************
@@ -617,8 +659,8 @@ int getopts (int argc, char *argv[])
"-- Verbose mode --\n"
"\n");
}
-
- if (argc<2) {
+
+ if (optind+2 < argc) {
help();
}