]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
further updates to the 'osf' module (Evgeniy Polyakov). now supports reading fingerpr...
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Mon, 22 Sep 2003 15:19:21 +0000 (15:19 +0000)
committerHarald Welte <laforge@gnumonks.org>
Mon, 22 Sep 2003 15:19:21 +0000 (15:19 +0000)
extensions/libipt_osf.c

index 1bef9de46ac9f8f73fef0491b381151ad166e129..205f071e641f6fc65d40ce698c45b846bc587ec8 100644 (file)
@@ -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;
 }