X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=extensions%2Flibipt_nth.c;fp=extensions%2Flibipt_nth.c;h=6f483b9f52c8b0e092c27290a4616a8162e2cffa;hb=6afea0b41dfbc3824956d11d960ad80097218feb;hp=ab8f97d64de2ee86e365a96d6c648a2c7345aa8b;hpb=f7b70cf9e00324b89b02de213bcd0dde7044d035;p=iptables.git diff --git a/extensions/libipt_nth.c b/extensions/libipt_nth.c index ab8f97d..6f483b9 100644 --- a/extensions/libipt_nth.c +++ b/extensions/libipt_nth.c @@ -30,10 +30,10 @@ help(void) printf( "nth v%s options:\n" " --every Nth Match every Nth packet\n" -" [--counter] num Use counter 0-%u (default:0)\n" -" [--start] num Initialize the counter at the number 'num'\n" +" [--counter num ] Use counter 0-%u (default:0)\n" +" [--start num ] Initialize the counter at the number 'num'\n" " instead of 0. Must be between 0 and Nth-1\n" -" [--packet] num Match on 'num' packet. Must be between 0\n" +" [--packet num ] Match on 'num' packet. Must be between 0\n" " and Nth-1.\n\n" " If --packet is used for a counter than\n" " there must be Nth number of --packet\n" @@ -50,13 +50,6 @@ static struct option opts[] = { { 0 } }; -/* Initialize the target. */ -static void -init(struct ipt_entry_match *m, unsigned int *nfcache) -{ - *nfcache |= NFC_UNKNOWN; -} - #define IPT_NTH_OPT_EVERY 0x01 #define IPT_NTH_OPT_NOT_EVERY 0x02 #define IPT_NTH_OPT_START 0x04 @@ -217,19 +210,18 @@ save(const struct ipt_ip *ip, const struct ipt_entry_match *match) printf("--packet %u ", nthinfo->packet ); } -struct iptables_match nth -= { NULL, - "nth", - IPTABLES_VERSION, - IPT_ALIGN(sizeof(struct ipt_nth_info)), - IPT_ALIGN(sizeof(struct ipt_nth_info)), - &help, - &init, - &parse, - &final_check, - &print, - &save, - opts +static struct iptables_match nth = { + .next = NULL, + .name = "nth", + .version = IPTABLES_VERSION, + .size = IPT_ALIGN(sizeof(struct ipt_nth_info)), + .userspacesize = IPT_ALIGN(sizeof(struct ipt_nth_info)), + .help = &help, + .parse = &parse, + .final_check = &final_check, + .print = &print, + .save = &save, + .extra_opts = opts }; void _init(void)