}
static const struct option opts[] = {
- { "hl-set", 1, 0, '1' },
- { "hl-dec", 1, 0, '2' },
- { "hl-inc", 1, 0, '3' },
- { 0 }
+ { "hl-set", 1, NULL, '1' },
+ { "hl-dec", 1, NULL, '2' },
+ { "hl-inc", 1, NULL, '3' },
+ { }
};
static
}
static const struct option opts[] = {
- { .name = "log-level", .has_arg = 1, .flag = 0, .val = '!' },
- { .name = "log-prefix", .has_arg = 1, .flag = 0, .val = '#' },
- { .name = "log-tcp-sequence", .has_arg = 0, .flag = 0, .val = '1' },
- { .name = "log-tcp-options", .has_arg = 0, .flag = 0, .val = '2' },
- { .name = "log-ip-options", .has_arg = 0, .flag = 0, .val = '3' },
- { .name = "log-uid", .has_arg = 0, .flag = 0, .val = '4' },
- { .name = 0 }
+ { .name = "log-level", .has_arg = 1, .val = '!' },
+ { .name = "log-prefix", .has_arg = 1, .val = '#' },
+ { .name = "log-tcp-sequence", .has_arg = 0, .val = '1' },
+ { .name = "log-tcp-options", .has_arg = 0, .val = '2' },
+ { .name = "log-ip-options", .has_arg = 0, .val = '3' },
+ { .name = "log-uid", .has_arg = 0, .val = '4' },
+ { }
};
/* Initialize the target. */
};
static void
-print_reject_types()
+print_reject_types(void)
{
unsigned int i;
}
static const struct option opts[] = {
- { "reject-with", 1, 0, '1' },
- { 0 }
+ { "reject-with", 1, NULL, '1' },
+ { }
};
/* Allocate and initialize the target. */
}
static const struct option opts[] = {
- { .name = "ahspi", .has_arg = 1, .flag = 0, .val = '1' },
- { .name = "ahlen", .has_arg = 1, .flag = 0, .val = '2' },
- { .name = "ahres", .has_arg = 0, .flag = 0, .val = '3' },
- { .name = 0 }
+ { .name = "ahspi", .has_arg = 1, .val = '1' },
+ { .name = "ahlen", .has_arg = 1, .val = '2' },
+ { .name = "ahres", .has_arg = 0, .val = '3' },
+ { }
};
static u_int32_t
}
static const struct option opts[] = {
- { .name = LNAME "-len", .has_arg = 1, .flag = 0, .val = '1' },
- { .name = LNAME "-opts", .has_arg = 1, .flag = 0, .val = '2' },
- { .name = LNAME "-not-strict", .has_arg = 1, .flag = 0, .val = '3' },
- { .name = 0 }
+ { .name = LNAME "-len", .has_arg = 1, .val = '1' },
+ { .name = LNAME "-opts", .has_arg = 1, .val = '2' },
+ { .name = LNAME "-not-strict", .has_arg = 1, .val = '3' },
+ { }
};
static u_int32_t
}
static const struct option opts[] = {
- { .name = "fragid", .has_arg = 1, .flag = 0, .val = '1' },
- { .name = "fraglen", .has_arg = 1, .flag = 0, .val = '2' },
- { .name = "fragres", .has_arg = 0, .flag = 0, .val = '3' },
- { .name = "fragfirst", .has_arg = 0, .flag = 0, .val = '4' },
- { .name = "fragmore", .has_arg = 0, .flag = 0, .val = '5' },
- { .name = "fraglast", .has_arg = 0, .flag = 0, .val = '6' },
- { .name = 0 }
+ { .name = "fragid", .has_arg = 1, .val = '1' },
+ { .name = "fraglen", .has_arg = 1, .val = '2' },
+ { .name = "fragres", .has_arg = 0, .val = '3' },
+ { .name = "fragfirst", .has_arg = 0, .val = '4' },
+ { .name = "fragmore", .has_arg = 0, .val = '5' },
+ { .name = "fraglast", .has_arg = 0, .val = '6' },
+ { }
};
static u_int32_t
#if HOPBYHOP
static const struct option opts[] = {
- { "hbh-len", 1, 0, '1' },
- { "hbh-opts", 1, 0, '2' },
- { "hbh-not-strict", 1, 0, '3' },
- {0}
+ { "hbh-len", 1, NULL, '1' },
+ { "hbh-opts", 1, NULL, '2' },
+ { "hbh-not-strict", 1, NULL, '3' },
+ { }
};
#else
static const struct option opts[] = {
- { "dst-len", 1, 0, '1' },
- { "dst-opts", 1, 0, '2' },
- { "dst-not-strict", 1, 0, '3' },
- {0}
+ { "dst-len", 1, NULL, '1' },
+ { "dst-opts", 1, NULL, '2' },
+ { "dst-not-strict", 1, NULL, '3' },
+ { }
};
#endif
}
static const struct option opts[] = {
- { .name = "hl", .has_arg = 1, .flag = 0, .val = '2' },
- { .name = "hl-eq", .has_arg = 1, .flag = 0, .val = '2' },
- { .name = "hl-lt", .has_arg = 1, .flag = 0, .val = '3' },
- { .name = "hl-gt", .has_arg = 1, .flag = 0, .val = '4' },
- { 0 }
+ { .name = "hl", .has_arg = 1, .val = '2' },
+ { .name = "hl-eq", .has_arg = 1, .val = '2' },
+ { .name = "hl-lt", .has_arg = 1, .val = '3' },
+ { .name = "hl-gt", .has_arg = 1, .val = '4' },
+ { }
};
static
};
static void
-print_icmpv6types()
+print_icmpv6types(void)
{
unsigned int i;
printf("Valid ICMPv6 Types:");
}
static const struct option opts[] = {
- { "icmpv6-type", 1, 0, '1' },
- {0}
+ { "icmpv6-type", 1, NULL, '1' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "header", 1, 0, '1' },
- { "soft", 0, 0, '2' },
- { 0 }
+ { "header", 1, NULL, '1' },
+ { "soft", 0, NULL, '2' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "mh-type", 1, 0, '1' },
- {0}
+ { "mh-type", 1, NULL, '1' },
+ { }
};
static struct ip6tables_match mh = {
}
static const struct option opts[] = {
- { "uid-owner", 1, 0, '1' },
- { "gid-owner", 1, 0, '2' },
- { "pid-owner", 1, 0, '3' },
- { "sid-owner", 1, 0, '4' },
+ { "uid-owner", 1, NULL, '1' },
+ { "gid-owner", 1, NULL, '2' },
+ { "pid-owner", 1, NULL, '3' },
+ { "sid-owner", 1, NULL, '4' },
#ifdef IP6T_OWNER_COMM
- { "cmd-owner", 1, 0, '5' },
+ { "cmd-owner", 1, NULL, '5' },
#endif
- {0}
+ { }
};
/* Function which parses command options; returns true if it
}
static const struct option opts[] = {
- { "rt-type", 1, 0, '1' },
- { "rt-segsleft", 1, 0, '2' },
- { "rt-len", 1, 0, '3' },
- { "rt-0-res", 0, 0, '4' },
- { "rt-0-addrs", 1, 0, '5' },
- { "rt-0-not-strict", 0, 0, '6' },
- {0}
+ { "rt-type", 1, NULL, '1' },
+ { "rt-segsleft", 1, NULL, '2' },
+ { "rt-len", 1, NULL, '3' },
+ { "rt-0-res", 0, NULL, '4' },
+ { "rt-0-addrs", 1, NULL, '5' },
+ { "rt-0-not-strict", 0, NULL, '6' },
+ { }
};
static u_int32_t
#define PARAM_HASHINIT 0x0020
static const struct option opts[] = {
- { "new", 0, 0, '1' },
- { "hashmode", 1, 0, '2' },
- { "clustermac", 1, 0, '3' },
- { "total-nodes", 1, 0, '4' },
- { "local-node", 1, 0, '5' },
- { "hash-init", 1, 0, '6' },
- { 0 }
+ { "new", 0, NULL, '1' },
+ { "hashmode", 1, NULL, '2' },
+ { "clustermac", 1, NULL, '3' },
+ { "total-nodes", 1, NULL, '4' },
+ { "local-node", 1, NULL, '5' },
+ { "hash-init", 1, NULL, '6' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "to-destination", 1, 0, '1' },
- { "random", 0, 0, '2' },
- { 0 }
+ { "to-destination", 1, NULL, '1' },
+ { "random", 0, NULL, '2' },
+ { }
};
static struct ipt_natinfo *
static const struct option opts[] = {
- { "ecn-tcp-remove", 0, 0, 'F' },
- { "ecn-tcp-cwr", 1, 0, 'G' },
- { "ecn-tcp-ece", 1, 0, 'H' },
- { "ecn-ip-ect", 1, 0, '9' },
- { 0 }
+ { "ecn-tcp-remove", 0, NULL, 'F' },
+ { "ecn-tcp-cwr", 1, NULL, 'G' },
+ { "ecn-tcp-ece", 1, NULL, 'H' },
+ { "ecn-ip-ect", 1, NULL, '9' },
+ { }
};
static int
}
static const struct option opts[] = {
- { .name = "log-level", .has_arg = 1, .flag = 0, .val = '!' },
- { .name = "log-prefix", .has_arg = 1, .flag = 0, .val = '#' },
- { .name = "log-tcp-sequence", .has_arg = 0, .flag = 0, .val = '1' },
- { .name = "log-tcp-options", .has_arg = 0, .flag = 0, .val = '2' },
- { .name = "log-ip-options", .has_arg = 0, .flag = 0, .val = '3' },
- { .name = "log-uid", .has_arg = 0, .flag = 0, .val = '4' },
- { .name = 0 }
+ { .name = "log-level", .has_arg = 1, .val = '!' },
+ { .name = "log-prefix", .has_arg = 1, .val = '#' },
+ { .name = "log-tcp-sequence", .has_arg = 0, .val = '1' },
+ { .name = "log-tcp-options", .has_arg = 0, .val = '2' },
+ { .name = "log-ip-options", .has_arg = 0, .val = '3' },
+ { .name = "log-uid", .has_arg = 0, .val = '4' },
+ { }
};
/* Initialize the target. */
}
static const struct option opts[] = {
- { "to-ports", 1, 0, '1' },
- { "random", 0, 0, '2' },
- { 0 }
+ { "to-ports", 1, NULL, '1' },
+ { "random", 0, NULL, '2' },
+ { }
};
/* Initialize the target. */
#define MODULENAME "NETMAP"
static const struct option opts[] = {
- { "to", 1, 0, '1' },
- { 0 }
+ { "to", 1, NULL, '1' },
+ { }
};
/* Function which prints out usage message. */
}
static const struct option opts[] = {
- { "to-ports", 1, 0, '1' },
- { "random", 1, 0, '2' },
- { 0 }
+ { "to-ports", 1, NULL, '1' },
+ { "random", 1, NULL, '2' },
+ { }
};
/* Initialize the target. */
};
static void
-print_reject_types()
+print_reject_types(void)
{
unsigned int i;
}
static const struct option opts[] = {
- { "reject-with", 1, 0, '1' },
- { 0 }
+ { "reject-with", 1, NULL, '1' },
+ { }
};
/* Allocate and initialize the target. */
}
static const struct option opts[] = {
- { "to", 1, 0, '1' },
- { "nodst", 0, 0, '2'},
- { "random", 0, 0, '3' },
- { 0 }
+ { "to", 1, NULL, '1' },
+ { "nodst", 0, NULL, '2'},
+ { "random", 0, NULL, '3' },
+ { }
};
/* Initialize the target. */
}
static const struct option opts[] = {
- { "to-source", 1, 0, '1' },
- { "random", 0, 0, '2' },
- { 0 }
+ { "to-source", 1, NULL, '1' },
+ { "random", 0, NULL, '2' },
+ { }
};
static struct ipt_natinfo *
}
static const struct option opts[] = {
- { "set-tos", 1, 0, '1' },
- { 0 }
+ { "set-tos", 1, NULL, '1' },
+ { }
};
/* Initialize the target. */
}
static const struct option opts[] = {
- { "ttl-set", 1, 0, '1' },
- { "ttl-dec", 1, 0, '2' },
- { "ttl-inc", 1, 0, '3' },
- { 0 }
+ { "ttl-set", 1, NULL, '1' },
+ { "ttl-dec", 1, NULL, '2' },
+ { "ttl-inc", 1, NULL, '3' },
+ { }
};
static struct iptables_target TTL = {
}
static const struct option opts[] = {
- {"ulog-nlgroup", 1, 0, '!'},
- {"ulog-prefix", 1, 0, '#'},
- {"ulog-cprange", 1, 0, 'A'},
- {"ulog-qthreshold", 1, 0, 'B'},
- {0}
+ {"ulog-nlgroup", 1, NULL, '!'},
+ {"ulog-prefix", 1, NULL, '#'},
+ {"ulog-cprange", 1, NULL, 'A'},
+ {"ulog-qthreshold", 1, NULL, 'B'},
+ { }
};
/* Initialize the target. */
}
static const struct option opts[] = {
- { "src-type", 1, 0, '1' },
- { "dst-type", 1, 0, '2' },
- { 0 }
+ { "src-type", 1, NULL, '1' },
+ { "dst-type", 1, NULL, '2' },
+ { }
};
static
}
static const struct option opts[] = {
- { "ahspi", 1, 0, '1' },
- {0}
+ { "ahspi", 1, NULL, '1' },
+ { }
};
static u_int32_t
static const struct option opts[] = {
- { "ctstate", 1, 0, '1' },
- { "ctproto", 1, 0, '2' },
- { "ctorigsrc", 1, 0, '3' },
- { "ctorigdst", 1, 0, '4' },
- { "ctreplsrc", 1, 0, '5' },
- { "ctrepldst", 1, 0, '6' },
- { "ctstatus", 1, 0, '7' },
- { "ctexpire", 1, 0, '8' },
- {0}
+ { "ctstate", 1, NULL, '1' },
+ { "ctproto", 1, NULL, '2' },
+ { "ctorigsrc", 1, NULL, '3' },
+ { "ctorigdst", 1, NULL, '4' },
+ { "ctreplsrc", 1, NULL, '5' },
+ { "ctrepldst", 1, NULL, '6' },
+ { "ctstatus", 1, NULL, '7' },
+ { "ctexpire", 1, NULL, '8' },
+ { }
};
static int
}
static const struct option opts[] = {
- { .name = "ecn-tcp-cwr", .has_arg = 0, .flag = 0, .val = 'F' },
- { .name = "ecn-tcp-ece", .has_arg = 0, .flag = 0, .val = 'G' },
- { .name = "ecn-ip-ect", .has_arg = 1, .flag = 0, .val = 'H' },
- { .name = 0 }
+ { .name = "ecn-tcp-cwr", .has_arg = 0, .val = 'F' },
+ { .name = "ecn-tcp-ece", .has_arg = 0, .val = 'G' },
+ { .name = "ecn-ip-ect", .has_arg = 1, .val = 'H' },
+ { }
};
static int
};
static void
-print_icmptypes()
+print_icmptypes(void)
{
unsigned int i;
printf("Valid ICMP Types:");
}
static const struct option opts[] = {
- { "icmp-type", 1, 0, '1' },
- {0}
+ { "icmp-type", 1, NULL, '1' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "src-range", 1, 0, '1' },
- { "dst-range", 1, 0, '2' },
- {0}
+ { "src-range", 1, NULL, '1' },
+ { "dst-range", 1, NULL, '2' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "uid-owner", 1, 0, '1' },
- { "gid-owner", 1, 0, '2' },
- { "pid-owner", 1, 0, '3' },
- { "sid-owner", 1, 0, '4' },
+ { "uid-owner", 1, NULL, '1' },
+ { "gid-owner", 1, NULL, '2' },
+ { "pid-owner", 1, NULL, '3' },
+ { "sid-owner", 1, NULL, '4' },
#ifdef IPT_OWNER_COMM
- { "cmd-owner", 1, 0, '5' },
+ { "cmd-owner", 1, NULL, '5' },
#endif
- {0}
+ { }
};
/* Function which parses command options; returns true if it
}
static const struct option opts[] = {
- { "realm", 1, 0, '1' },
- {0}
+ { "realm", 1, NULL, '1' },
+ { }
};
struct realmname {
static int rdberr = 0;
-void load_realms()
+static void load_realms(void)
{
const char* rfnm = "/etc/iproute2/rt_realms";
char buf[512];
/* Options for this module */
static const struct option opts[] = {
- { .name = "set", .has_arg = 0, .flag = 0, .val = 201 },
- { .name = "rcheck", .has_arg = 0, .flag = 0, .val = 202 },
- { .name = "update", .has_arg = 0, .flag = 0, .val = 203 },
- { .name = "seconds", .has_arg = 1, .flag = 0, .val = 204 },
- { .name = "hitcount", .has_arg = 1, .flag = 0, .val = 205 },
- { .name = "remove", .has_arg = 0, .flag = 0, .val = 206 },
- { .name = "rttl", .has_arg = 0, .flag = 0, .val = 207 },
- { .name = "name", .has_arg = 1, .flag = 0, .val = 208 },
- { .name = "rsource", .has_arg = 0, .flag = 0, .val = 209 },
- { .name = "rdest", .has_arg = 0, .flag = 0, .val = 210 },
- { .name = 0, .has_arg = 0, .flag = 0, .val = 0 }
+ { .name = "set", .has_arg = 0, .val = 201 },
+ { .name = "rcheck", .has_arg = 0, .val = 202 },
+ { .name = "update", .has_arg = 0, .val = 203 },
+ { .name = "seconds", .has_arg = 1, .val = 204 },
+ { .name = "hitcount", .has_arg = 1, .val = 205 },
+ { .name = "remove", .has_arg = 0, .val = 206 },
+ { .name = "rttl", .has_arg = 0, .val = 207 },
+ { .name = "name", .has_arg = 1, .val = 208 },
+ { .name = "rsource", .has_arg = 0, .val = 209 },
+ { .name = "rdest", .has_arg = 0, .val = 210 },
+ { }
};
/* Function which prints out usage message. */
}
static const struct option opts[] = {
- { "tos", 1, 0, '1' },
- {0}
+ { "tos", 1, NULL, '1' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "ttl", 1, 0, '2' },
- { "ttl-eq", 1, 0, '2'},
- { "ttl-lt", 1, 0, '3'},
- { "ttl-gt", 1, 0, '4'},
- { 0 }
+ { "ttl", 1, NULL, '2' },
+ { "ttl-eq", 1, NULL, '2'},
+ { "ttl-lt", 1, NULL, '3'},
+ { "ttl-gt", 1, NULL, '4'},
+ { }
};
static struct iptables_match ttl = {
}
static const struct option opts[] = {
- { "set-class", 1, 0, '1' },
- { 0 }
+ { "set-class", 1, NULL, '1' },
+ { }
};
/* Initialize the target. */
}
static const struct option opts[] = {
- { "set-mark", 1, 0, '1' },
- { "save-mark", 0, 0, '2' },
- { "restore-mark", 0, 0, '3' },
- { "mask", 1, 0, '4' },
- { 0 }
+ { "set-mark", 1, NULL, '1' },
+ { "save-mark", 0, NULL, '2' },
+ { "restore-mark", 0, NULL, '3' },
+ { "mask", 1, NULL, '4' },
+ { }
};
/* Initialize the target. */
}
static const struct option opts[] = {
- { "set-dscp", 1, 0, 'F' },
- { "set-dscp-class", 1, 0, 'G' },
- { 0 }
+ { "set-dscp", 1, NULL, 'F' },
+ { "set-dscp-class", 1, NULL, 'G' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "set-mark", 1, 0, '1' },
- { "and-mark", 1, 0, '2' },
- { "or-mark", 1, 0, '3' },
- { 0 }
+ { "set-mark", 1, NULL, '1' },
+ { "and-mark", 1, NULL, '2' },
+ { "or-mark", 1, NULL, '3' },
+ { }
};
/* Initialize the target. */
};
static const struct option opts[] = {
- { "nflog-group", 1, 0, NFLOG_GROUP },
- { "nflog-prefix", 1, 0, NFLOG_PREFIX },
- { "nflog-range", 1, 0, NFLOG_RANGE },
- { "nflog-threshold", 1, 0, NFLOG_THRESHOLD },
+ { "nflog-group", 1, NULL, NFLOG_GROUP },
+ { "nflog-prefix", 1, NULL, NFLOG_PREFIX },
+ { "nflog-range", 1, NULL, NFLOG_RANGE },
+ { "nflog-threshold", 1, NULL, NFLOG_THRESHOLD },
{NULL},
};
}
static const struct option opts[] = {
- { "queue-num", 1, 0, 'F' },
- { 0 }
+ { "queue-num", 1, NULL, 'F' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "set-mss", 1, 0, '1' },
- { "clamp-mss-to-pmtu", 0, 0, '2' },
- { 0 }
+ { "set-mss", 1, NULL, '1' },
+ { "clamp-mss-to-pmtu", 0, NULL, '2' },
+ { }
};
/* Initialize the target. */
}
static const struct option opts[] = {
- { "comment", 1, 0, '1' },
- {0}
+ { "comment", 1, NULL, '1' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "connbytes", 1, 0, '1' },
- { "connbytes-dir", 1, 0, '2' },
- { "connbytes-mode", 1, 0, '3' },
- {0}
+ { "connbytes", 1, NULL, '1' },
+ { "connbytes-dir", 1, NULL, '2' },
+ { "connbytes-mode", 1, NULL, '3' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "mark", 1, 0, '1' },
- {0}
+ { "mark", 1, NULL, '1' },
+ { }
};
/* Function which parses command options; returns true if it
}
static const struct option opts[] = {
- { .name = "source-port", .has_arg = 1, .flag = 0, .val = '1' },
- { .name = "sport", .has_arg = 1, .flag = 0, .val = '1' },
- { .name = "destination-port", .has_arg = 1, .flag = 0, .val = '2' },
- { .name = "dport", .has_arg = 1, .flag = 0, .val = '2' },
- { .name = "dccp-types", .has_arg = 1, .flag = 0, .val = '3' },
- { .name = "dccp-option", .has_arg = 1, .flag = 0, .val = '4' },
- { .name = 0 }
+ { .name = "source-port", .has_arg = 1, .val = '1' },
+ { .name = "sport", .has_arg = 1, .val = '1' },
+ { .name = "destination-port", .has_arg = 1, .val = '2' },
+ { .name = "dport", .has_arg = 1, .val = '2' },
+ { .name = "dccp-types", .has_arg = 1, .val = '3' },
+ { .name = "dccp-option", .has_arg = 1, .val = '4' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "dscp", 1, 0, 'F' },
- { "dscp-class", 1, 0, 'G' },
- { 0 }
+ { "dscp", 1, NULL, 'F' },
+ { "dscp-class", 1, NULL, 'G' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "espspi", 1, 0, '1' },
- {0}
+ { "espspi", 1, NULL, '1' },
+ { }
};
static u_int32_t
}
static const struct option opts[] = {
- { "hashlimit", 1, 0, '%' },
- { "hashlimit-burst", 1, 0, '$' },
- { "hashlimit-htable-size", 1, 0, '&' },
- { "hashlimit-htable-max", 1, 0, '*' },
- { "hashlimit-htable-gcinterval", 1, 0, '(' },
- { "hashlimit-htable-expire", 1, 0, ')' },
- { "hashlimit-mode", 1, 0, '_' },
- { "hashlimit-name", 1, 0, '"' },
- { 0 }
+ { "hashlimit", 1, NULL, '%' },
+ { "hashlimit-burst", 1, NULL, '$' },
+ { "hashlimit-htable-size", 1, NULL, '&' },
+ { "hashlimit-htable-max", 1, NULL, '*' },
+ { "hashlimit-htable-gcinterval", 1, NULL, '(' },
+ { "hashlimit-htable-expire", 1, NULL, ')' },
+ { "hashlimit-mode", 1, NULL, '_' },
+ { "hashlimit-name", 1, NULL, '"' },
+ { }
};
static
}
static const struct option opts[] = {
- { "helper", 1, 0, '1' },
- {0}
+ { "helper", 1, NULL, '1' },
+ { }
};
/* Function which parses command options; returns true if it
}
static const struct option opts[] = {
- { "length", 1, 0, '1' },
- {0}
+ { "length", 1, NULL, '1' },
+ { }
};
static u_int16_t
}
static const struct option opts[] = {
- { "limit", 1, 0, '%' },
- { "limit-burst", 1, 0, '$' },
- { 0 }
+ { "limit", 1, NULL, '%' },
+ { "limit-burst", 1, NULL, '$' },
+ { }
};
static
}
static const struct option opts[] = {
- { "mac-source", 1, 0, '1' },
- {0}
+ { "mac-source", 1, NULL, '1' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "mark", 1, 0, '1' },
- {0}
+ { "mark", 1, NULL, '1' },
+ { }
};
/* Function which parses command options; returns true if it
}
static const struct option opts[] = {
- { "source-ports", 1, 0, '1' },
- { "sports", 1, 0, '1' }, /* synonym */
- { "destination-ports", 1, 0, '2' },
- { "dports", 1, 0, '2' }, /* synonym */
- { "ports", 1, 0, '3' },
- {0}
+ { "source-ports", 1, NULL, '1' },
+ { "sports", 1, NULL, '1' }, /* synonym */
+ { "destination-ports", 1, NULL, '2' },
+ { "dports", 1, NULL, '2' }, /* synonym */
+ { "ports", 1, NULL, '3' },
+ { }
};
static char *
}
static const struct option opts[] = {
- { "physdev-in", 1, 0, '1' },
- { "physdev-out", 1, 0, '2' },
- { "physdev-is-in", 0, 0, '3' },
- { "physdev-is-out", 0, 0, '4' },
- { "physdev-is-bridged", 0, 0, '5' },
- {0}
+ { "physdev-in", 1, NULL, '1' },
+ { "physdev-out", 1, NULL, '2' },
+ { "physdev-is-in", 0, NULL, '3' },
+ { "physdev-is-out", 0, NULL, '4' },
+ { "physdev-is-bridged", 0, NULL, '5' },
+ { }
};
static void
{"host", PACKET_HOST, 0, NULL}
};
-static void print_types()
+static void print_types(void)
{
unsigned int i;
}
static const struct option opts[] = {
- {"pkt-type", 1, 0, '1'},
- {0}
+ {"pkt-type", 1, NULL, '1'},
+ { }
};
static void parse_pkttype(const char *pkttype, struct xt_pkttype_info *info)
#include <linux/netfilter/xt_quota.h>
static const struct option opts[] = {
- {"quota", 1, 0, '1'},
- {0}
+ {"quota", 1, NULL, '1'},
+ { }
};
/* print usage */
}
static const struct option opts[] = {
- { .name = "source-port", .has_arg = 1, .flag = 0, .val = '1' },
- { .name = "sport", .has_arg = 1, .flag = 0, .val = '1' },
- { .name = "destination-port", .has_arg = 1, .flag = 0, .val = '2' },
- { .name = "dport", .has_arg = 1, .flag = 0, .val = '2' },
- { .name = "chunk-types", .has_arg = 1, .flag = 0, .val = '3' },
- { .name = 0 }
+ { .name = "source-port", .has_arg = 1, .val = '1' },
+ { .name = "sport", .has_arg = 1, .val = '1' },
+ { .name = "destination-port", .has_arg = 1, .val = '2' },
+ { .name = "dport", .has_arg = 1, .val = '2' },
+ { .name = "chunk-types", .has_arg = 1, .val = '3' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "state", 1, 0, '1' },
- {0}
+ { "state", 1, NULL, '1' },
+ { }
};
static int
}
static const struct option opts[] = {
- { "mode", 1, 0, '1' },
- { "probability", 1, 0, '2' },
- { "every", 1, 0, '3' },
- { "packet", 1, 0, '4' },
- { 0 }
+ { "mode", 1, NULL, '1' },
+ { "probability", 1, NULL, '2' },
+ { "every", 1, NULL, '3' },
+ { "packet", 1, NULL, '4' },
+ { }
};
static struct xt_statistic_info *info;
}
static const struct option opts[] = {
- { "from", 1, 0, '1' },
- { "to", 1, 0, '2' },
- { "algo", 1, 0, '3' },
- { "string", 1, 0, '4' },
- { "hex-string", 1, 0, '5' },
- {0}
+ { "from", 1, NULL, '1' },
+ { "to", 1, NULL, '2' },
+ { "algo", 1, NULL, '3' },
+ { "string", 1, NULL, '4' },
+ { "hex-string", 1, NULL, '5' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "source-port", 1, 0, '1' },
- { "sport", 1, 0, '1' }, /* synonym */
- { "destination-port", 1, 0, '2' },
- { "dport", 1, 0, '2' }, /* synonym */
- { "syn", 0, 0, '3' },
- { "tcp-flags", 1, 0, '4' },
- { "tcp-option", 1, 0, '5' },
- {0}
+ { "source-port", 1, NULL, '1' },
+ { "sport", 1, NULL, '1' }, /* synonym */
+ { "destination-port", 1, NULL, '2' },
+ { "dport", 1, NULL, '2' }, /* synonym */
+ { "syn", 0, NULL, '3' },
+ { "tcp-flags", 1, NULL, '4' },
+ { "tcp-option", 1, NULL, '5' },
+ { }
};
static void
}
static const struct option opts[] = {
- { "mss", 1, 0, '1' },
- {0}
+ { "mss", 1, NULL, '1' },
+ { }
};
static u_int16_t
}
static const struct option opts[] = {
- { "source-port", 1, 0, '1' },
- { "sport", 1, 0, '1' }, /* synonym */
- { "destination-port", 1, 0, '2' },
- { "dport", 1, 0, '2' }, /* synonym */
- {0}
+ { "source-port", 1, NULL, '1' },
+ { "sport", 1, NULL, '1' }, /* synonym */
+ { "destination-port", 1, NULL, '2' },
+ { "dport", 1, NULL, '2' }, /* synonym */
+ { }
};
static void