blob: a50cffe98e8e8caac97b6d8bd17c11705f65a461 [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. */
Jan Engelhardt181dead2007-10-04 16:27:07 +000011static void standard_help(void)
Marc Bouchere6869a82000-03-20 06:03:29 +000012{
13 printf(
14"Standard v%s options:\n"
Harald Welte80fe35d2002-05-29 13:08:15 +000015"(If target is DROP, ACCEPT, RETURN or nothing)\n", IPTABLES_VERSION);
Marc Bouchere6869a82000-03-20 06:03:29 +000016}
17
Marc Bouchere6869a82000-03-20 06:03:29 +000018/* Function which parses command options; returns true if it
19 ate an option */
Jan Engelhardt181dead2007-10-04 16:27:07 +000020static int standard_parse(int c, char **argv, int invert, unsigned int *flags,
21 const void *entry, struct xt_entry_target **target)
Marc Bouchere6869a82000-03-20 06:03:29 +000022{
23 return 0;
24}
25
Jan Engelhardt181dead2007-10-04 16:27:07 +000026static struct xtables_target standard_target = {
Jan Engelhardt23545c22008-02-14 04:23:04 +010027 .family = AF_UNSPEC,
Yasuyuki KOZAKAIe72f60e2007-07-24 07:00:40 +000028 .name = "standard",
29 .version = IPTABLES_VERSION,
30 .size = XT_ALIGN(sizeof(int)),
31 .userspacesize = XT_ALIGN(sizeof(int)),
Jan Engelhardt181dead2007-10-04 16:27:07 +000032 .help = standard_help,
33 .parse = standard_parse,
Marc Bouchere6869a82000-03-20 06:03:29 +000034};
35
36void _init(void)
37{
Jan Engelhardt181dead2007-10-04 16:27:07 +000038 xtables_register_target(&standard_target);
Marc Bouchere6869a82000-03-20 06:03:29 +000039}