blob: af18b3b13f4a08e6e6b6b6771fa91e93928faf08 [file] [log] [blame]
Marc Bouchere6869a82000-03-20 06:03:29 +00001/* Shared library add-on to iptables for standard target support. */
2#include <stdio.h>
3#include <netdb.h>
4#include <string.h>
5#include <stdlib.h>
6#include <limits.h>
7#include <getopt.h>
Yasuyuki KOZAKAIe72f60e2007-07-24 07:00:40 +00008#include <xtables.h>
Marc Bouchere6869a82000-03-20 06:03:29 +00009
10/* Function which prints out usage message. */
11static void
12help(void)
13{
14 printf(
15"Standard v%s options:\n"
Harald Welte80fe35d2002-05-29 13:08:15 +000016"(If target is DROP, ACCEPT, RETURN or nothing)\n", IPTABLES_VERSION);
Marc Bouchere6869a82000-03-20 06:03:29 +000017}
18
Marc Bouchere6869a82000-03-20 06:03:29 +000019/* Function which parses command options; returns true if it
20 ate an option */
21static int
22parse(int c, char **argv, int invert, unsigned int *flags,
Yasuyuki KOZAKAIc0a9ab92007-07-24 06:02:05 +000023 const void *entry,
Yasuyuki KOZAKAI193df8e2007-07-24 05:57:28 +000024 struct xt_entry_target **target)
Marc Bouchere6869a82000-03-20 06:03:29 +000025{
26 return 0;
27}
28
Harald Welte3efb6ea2001-08-06 18:50:21 +000029static
Yasuyuki KOZAKAIe72f60e2007-07-24 07:00:40 +000030struct xtables_target standard = {
Yasuyuki KOZAKAIe72f60e2007-07-24 07:00:40 +000031 .family = AF_INET,
Pablo Neira8caee8b2004-12-28 13:11:59 +000032 .name = "standard",
33 .version = IPTABLES_VERSION,
Yasuyuki KOZAKAIe72f60e2007-07-24 07:00:40 +000034 .size = XT_ALIGN(sizeof(int)),
35 .userspacesize = XT_ALIGN(sizeof(int)),
36 .help = &help,
Yasuyuki KOZAKAIe72f60e2007-07-24 07:00:40 +000037 .parse = &parse,
Yasuyuki KOZAKAIe72f60e2007-07-24 07:00:40 +000038};
39
40static
41struct xtables_target standard6 = {
Yasuyuki KOZAKAIe72f60e2007-07-24 07:00:40 +000042 .family = AF_INET6,
43 .name = "standard",
44 .version = IPTABLES_VERSION,
45 .size = XT_ALIGN(sizeof(int)),
46 .userspacesize = XT_ALIGN(sizeof(int)),
Pablo Neira8caee8b2004-12-28 13:11:59 +000047 .help = &help,
Pablo Neira8caee8b2004-12-28 13:11:59 +000048 .parse = &parse,
Marc Bouchere6869a82000-03-20 06:03:29 +000049};
50
51void _init(void)
52{
Yasuyuki KOZAKAIe72f60e2007-07-24 07:00:40 +000053 xtables_register_target(&standard);
54 xtables_register_target(&standard6);
Marc Bouchere6869a82000-03-20 06:03:29 +000055}