From aeba2406d2657fff3c00578f96b7dd8358b38d2e Mon Sep 17 00:00:00 2001 From: Evgeniy Polyakov Date: Mon, 22 Sep 2003 15:19:21 +0000 Subject: further updates to the 'osf' module (Evgeniy Polyakov). now supports reading fingerprint data at runtime via /proc. --- extensions/libipt_osf.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/extensions/libipt_osf.c b/extensions/libipt_osf.c index 1bef9de4..205f071e 100644 --- a/extensions/libipt_osf.c +++ b/extensions/libipt_osf.c @@ -36,9 +36,7 @@ static void help(void) { printf("OS fingerprint match v%s options:\n" - " --genre [!] string Match a OS genre bypassive fingerprinting.\n" - " Genres: Linux, FreeBSD, NetBSD, OpenBSD,\n" - " Windows\n", + " --genre [!] string Match a OS genre bypassive fingerprinting.\n", IPTABLES_VERSION); } @@ -70,16 +68,22 @@ static int parse(int c, char **argv, int invert, unsigned int *flags, struct ipt_entry_match **match) { struct ipt_osf_info *info = (struct ipt_osf_info *)(*match)->data; - - if (*flags) - exit_error(PARAMETER_PROBLEM, "Can't specify multiple strings"); - - check_inverse(optarg, &invert, &optind, 0); - parse_string(optarg, info); - if (invert) - info->invert = 1; - info->len=strlen((char *)info->genre); - *flags = 1; + + switch(c) + { + case '1': + if (*flags) + exit_error(PARAMETER_PROBLEM, "Can't specify multiple strings"); + check_inverse(optarg, &invert, &optind, 0); + parse_string(argv[optind-1], info); + if (invert) + info->invert = 1; + info->len=strlen((char *)info->genre); + *flags = 1; + break; + default: + return 0; + } return 1; } -- cgit v1.2.3