summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>2003-09-22 15:19:21 +0000
committerHarald Welte <laforge@gnumonks.org>2003-09-22 15:19:21 +0000
commitaeba2406d2657fff3c00578f96b7dd8358b38d2e (patch)
tree9608aa3d10f9c7476fe68abb8c88f36283ba5abf
parentc08e405cc23ca5097164f3f7023649124509f8c2 (diff)
further updates to the 'osf' module (Evgeniy Polyakov). now supports reading fingerprint data at runtime via /proc.
-rw-r--r--extensions/libipt_osf.c30
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;
}