diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-05-13 13:53:27 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-05-13 15:10:16 +0200 |
commit | d0009856814c13d13770db5aadd7b2fabf947776 (patch) | |
tree | 6d18a94439f27f3c2685f05c57435116673f40cc /staging/cli_tools.c | |
parent | 2b100f7515dbd01032967c2d1b81d2f8d63bf9b5 (diff) |
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 <dborkman@redhat.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'staging/cli_tools.c')
-rw-r--r-- | staging/cli_tools.c | 40 |
1 files changed, 40 insertions, 0 deletions
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; +} + + |