diff options
author | Evgeniy Polyakov <johnpol@2ka.mipt.ru> | 2003-09-22 15:19:21 +0000 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2003-09-22 15:19:21 +0000 |
commit | aeba2406d2657fff3c00578f96b7dd8358b38d2e (patch) | |
tree | 9608aa3d10f9c7476fe68abb8c88f36283ba5abf | |
parent | c08e405cc23ca5097164f3f7023649124509f8c2 (diff) |
further updates to the 'osf' module (Evgeniy Polyakov). now supports reading fingerprint data at runtime via /proc.
-rw-r--r-- | extensions/libipt_osf.c | 30 |
1 files 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; } |