libxt_standard.c revision 278654a9aa89311eb624dc5b79b5b37d99248129
1/* 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> 8#include <xtables.h> 9 10/* Function which prints out usage message. */ 11static void 12help(void) 13{ 14 printf( 15"Standard v%s options:\n" 16"(If target is DROP, ACCEPT, RETURN or nothing)\n", IPTABLES_VERSION); 17} 18 19/* 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, 23 const void *entry, 24 struct xt_entry_target **target) 25{ 26 return 0; 27} 28 29static 30struct xtables_target standard = { 31 .family = AF_INET, 32 .name = "standard", 33 .version = IPTABLES_VERSION, 34 .size = XT_ALIGN(sizeof(int)), 35 .userspacesize = XT_ALIGN(sizeof(int)), 36 .help = &help, 37 .parse = &parse, 38}; 39 40static 41struct xtables_target standard6 = { 42 .family = AF_INET6, 43 .name = "standard", 44 .version = IPTABLES_VERSION, 45 .size = XT_ALIGN(sizeof(int)), 46 .userspacesize = XT_ALIGN(sizeof(int)), 47 .help = &help, 48 .parse = &parse, 49}; 50 51void _init(void) 52{ 53 xtables_register_target(&standard); 54 xtables_register_target(&standard6); 55} 56