From d0009856814c13d13770db5aadd7b2fabf947776 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Mon, 13 May 2013 13:53:27 +0200 Subject: staging: add mausezahn staging directory After some back and forth, we decided that it is easier to maintain mausezahn in a staging directory until it is fully reworked and cleaned up to be ready to be fully integrated. This way, it is better than having it in a separate branch, and we can also accept patches from outside more easily. Also, while at it, fix up some function mismatches with libcli. Signed-off-by: Daniel Borkmann Signed-off-by: Tobias Klauser --- staging/cli_tools.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 staging/cli_tools.c (limited to 'staging/cli_tools.c') diff --git a/staging/cli_tools.c b/staging/cli_tools.c new file mode 100644 index 0000000..20ce50e --- /dev/null +++ b/staging/cli_tools.c @@ -0,0 +1,40 @@ +/* + * Mausezahn - A fast versatile traffic generator + * Copyright (C) 2008-2010 Herbert Haas + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License version 2 as published by the + * Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, see http://www.gnu.org/licenses/gpl-2.0.html + * +*/ + + + + + +#include "mz.h" + + +// Returns a nice string with default and current value of a given variable +// +// EXAMPLE: +// +// char mystring[256]; +// mz_def16 ("20 seconds", pd->max_age, mystring) +// +int mz_def16 (char *def, u_int16_t val, char *str256) +{ + str256[0]=0x00; + sprintf(str256, "The default value is %s. The current value is %u (0x%04x).", def, val, val); + return 0; +} + + -- cgit v1.2.3-54-g00ecf