summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorlaforge <laforge>2003-09-22 15:19:21 +0000
committerlaforge <laforge>2003-09-22 15:19:21 +0000
commitad20a9fca06f8cbf5c480ef0ba949af0c2068111 (patch)
tree9608aa3d10f9c7476fe68abb8c88f36283ba5abf /extensions
parent204dcb6fa46aed166dd2b9efd686a3e486a26044 (diff)
further updates to the 'osf' module (Evgeniy Polyakov). now supports reading fingerprint data at runtime via /proc.
Diffstat (limited to 'extensions')
-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 1bef9de..205f071 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;
}