iptables-1.3.2-20050720
[iptables.git] / extensions / libipt_psd.c
index 8a6198e..3d0034a 100644 (file)
@@ -56,8 +56,6 @@ init(struct ipt_entry_match *m, unsigned int *nfcache)
        psdinfo->delay_threshold = SCAN_DELAY_THRESHOLD;
        psdinfo->lo_ports_weight = PORT_WEIGHT_PRIV;
        psdinfo->hi_ports_weight = PORT_WEIGHT_HIGH;
-       /* Can't cache this */
-       *nfcache |= NFC_UNKNOWN;
 }
 
 
@@ -84,11 +82,6 @@ parse(int c, char **argv, int invert, unsigned int *flags,
        struct ipt_psd_info *psdinfo = (struct ipt_psd_info *)(*match)->data;
        unsigned int num;
        
-       if (!optarg)
-               exit_error(PARAMETER_PROBLEM, "missing optarg");
-
-       /* string_to_number needs a leading space */
-
        switch (c) {
        /* PSD-weight-threshold */
        case '1':
@@ -180,20 +173,19 @@ save(const struct ipt_ip *ip, const struct ipt_entry_match *match)
        printf("--psd-hi-ports-weight %u ", psdinfo->hi_ports_weight);
 }
 
-static
-struct iptables_match psd
-= { NULL,
-    "psd",
-    IPTABLES_VERSION,
-    IPT_ALIGN(sizeof(struct ipt_psd_info)),
-    IPT_ALIGN(sizeof(struct ipt_psd_info)),
-    &help,
-    &init,
-    &parse,
-    &final_check,
-    &print,
-    &save,
-    opts
+static struct iptables_match psd = { 
+       .next           = NULL,
+       .name           = "psd",
+       .version        = IPTABLES_VERSION,
+       .size           = IPT_ALIGN(sizeof(struct ipt_psd_info)),
+       .userspacesize  = IPT_ALIGN(sizeof(struct ipt_psd_info)),
+       .help           = &help,
+       .init           = &init,
+       .parse          = &parse,
+       .final_check    = &final_check,
+       .print          = &print,
+       .save           = &save,
+       .extra_opts     = opts
 };
 
 void _init(void)