From: Daniel Borkmann Date: Sun, 3 Feb 2013 11:18:02 +0000 (+0100) Subject: trafgen: fix spelling and improve help a bit X-Git-Url: https://repo.or.cz/w/netsniff-ng.git/commitdiff_plain/0c295cfb2638bbb89ee51b4b5dfc48f451eb39e3 trafgen: fix spelling and improve help a bit Signed-off-by: Daniel Borkmann --- diff --git a/trafgen.c b/trafgen.c index 67c9b4e3..369556cc 100644 --- a/trafgen.c +++ b/trafgen.c @@ -148,45 +148,40 @@ static void timer_elapsed(int number) setitimer(ITIMER_REAL, &itimer, NULL); } -static void header(void) -{ - printf("%s%s%s\n", colorize_start(bold), "trafgen " VERSION_STRING, colorize_end()); -} - static void help(void) { printf("\ntrafgen %s, multithreaded zero-copy network packet generator\n", VERSION_STRING); puts("http://www.netsniff-ng.org\n\n" "Usage: trafgen [options]\n" "Options:\n" - " -i|-c|--in|--conf Packet configuration file/stdin\n" - " -o|-d|--out|--dev Networking device i.e., eth0\n" - " -p|--cpp Run packet config through C preprocessor\n" - " -J|--jumbo-support Support 64KB super jumbo frames (def: 2048B)\n" - " -R|--rfraw Inject raw 802.11 frames\n" - " -s|--smoke-test Probe if machine survived fuzz-tested packet\n" - " -n|--num Number of packets until exit (def: 0)\n" - " -r|--rand Randomize packet selection (def: round robin)\n" - " -P|--cpus Specify number of forks(<= CPUs) (def: #CPUs)\n" - " -t|--gap Interpacket gap in us (approx)\n" - " -S|--ring-size Manually set mmap size (KiB/MiB/GiB)\n" - " -k|--kernel-pull Kernel batch interval in us (def: 10us)\n" - " -E|--seed Manually set srand(3) seed\n" - " -u|--user Drop privileges and change to userid\n" - " -g|--group Drop privileges and change to groupid\n" - " -V|--verbose Be more verbose\n" - " -v|--version Show version\n" - " -e|--example Show built-in packet config example\n" - " -h|--help Guess what?!\n\n" + " -i|-c|--in|--conf Packet configuration file/stdin\n" + " -o|-d|--out|--dev Networking device i.e., eth0\n" + " -p|--cpp Run packet config through C preprocessor\n" + " -J|--jumbo-support Support 64KB super jumbo frames (def: 2048B)\n" + " -R|--rfraw Inject raw 802.11 frames\n" + " -s|--smoke-test Probe if machine survived fuzz-tested packet\n" + " -n|--num Number of packets until exit (def: 0)\n" + " -r|--rand Randomize packet selection (def: round robin)\n" + " -P|--cpus Specify number of forks(<= CPUs) (def: #CPUs)\n" + " -t|--gap Interpacket gap in us (approx)\n" + " -S|--ring-size Manually set mmap size (KiB/MiB/GiB)\n" + " -k|--kernel-pull Kernel batch interval in us (def: 10us)\n" + " -E|--seed Manually set srand(3) seed\n" + " -u|--user Drop privileges and change to userid\n" + " -g|--group Drop privileges and change to groupid\n" + " -V|--verbose Be more verbose\n" + " -v|--version Show version\n" + " -e|--example Show built-in packet config example\n" + " -h|--help Guess what?!\n\n" "Examples:\n" " See trafgen.txf for configuration file examples.\n" " trafgen --dev eth0 --conf trafgen.cfg\n" " trafgen -e | trafgen -i - -o eth0 --cpp -n 1\n" - " trafgen --dev eth0 --conf trafgen.cfg --smoke-test 10.0.0.1\n" + " trafgen --dev eth0 --conf fuzzing.cfg --smoke-test 10.0.0.1\n" " trafgen --dev wlan0 --rfraw --conf beacon-test.txf -V --cpus 2\n" - " trafgen --dev eth0 --conf trafgen.cfg --rand --gap 1000\n" - " trafgen --dev eth0 --conf trafgen.cfg --rand --num 1400000 -k1000\n" - " trafgen --dev eth0 --conf trafgen.cfg -u `id -u bob` -g `id -g bob`\n\n" + " trafgen --dev eth0 --conf frag_dos.cfg --rand --gap 1000\n" + " trafgen --dev eth0 --conf icmp.cfg --rand --num 1400000 -k1000\n" + " trafgen --dev eth0 --conf tcp_syn.cfg -u `id -u bob` -g `id -g bob`\n\n" "Arbitrary packet config examples (e.g. trafgen -e > trafgen.cfg):\n" " Run packet on all CPUs: { fill(0xff, 64) csum16(0, 64) }\n" " Run packet only on CPU1: cpu(1): { rnd(64), 0b11001100, 0xaa }\n" @@ -198,9 +193,9 @@ static void help(void) " In case you find a ping-of-death, please mention trafgen in your\n" " commit message of the fix!\n\n" " For introducing bit errors, delays with random variation and more,\n" - " make use of tc(8) with its difference disciplines (e.g. netem).\n\n" - " For generating different package distributions, you can use some\n" - " scripting to generate a trafgen config file with packet ratios as:\n\n" + " make use of tc(8) with its different disciplines, i.e. netem.\n\n" + " For generating different package distributions, you can use scripting\n" + " to generate a trafgen config file with packet ratios as:\n\n" " IMIX 64:7, 570:4, 1518:1\n" " Tolly 64:55, 78:5, 576:17, 1518:23\n" " Cisco 64:7, 594:4, 1518:1\n" @@ -1152,8 +1147,6 @@ int main(int argc, char **argv) register_signal(SIGHUP, signal_handler); register_signal_f(SIGALRM, timer_elapsed, SA_SIGINFO); - header(); - set_system_socket_memory(vals, array_size(vals)); xlockme();