libxt_NOTRACK.c revision 8b7c64d6ba156a99008fcd810cba874c73294333
1/* Shared library add-on to iptables to add NOTRACK target support. */ 2#include <stdio.h> 3#include <string.h> 4#include <stdlib.h> 5#include <getopt.h> 6 7#include <xtables.h> 8#include <linux/netfilter/x_tables.h> 9 10/* Function which prints out usage message. */ 11static void NOTRACK_help(void) 12{ 13 printf("NOTRACK target takes no options\n"); 14} 15 16/* Function which parses command options; returns true if it 17 ate an option */ 18static int 19NOTRACK_parse(int c, char **argv, int invert, unsigned int *flags, 20 const void *entry, struct xt_entry_target **target) 21{ 22 return 0; 23} 24 25static struct xtables_target notrack_target = { 26 .family = AF_INET, 27 .name = "NOTRACK", 28 .version = XTABLES_VERSION, 29 .size = XT_ALIGN(0), 30 .userspacesize = XT_ALIGN(0), 31 .help = NOTRACK_help, 32 .parse = NOTRACK_parse, 33}; 34 35static struct xtables_target notrack_target6 = { 36 .family = AF_INET6, 37 .name = "NOTRACK", 38 .version = XTABLES_VERSION, 39 .size = XT_ALIGN(0), 40 .userspacesize = XT_ALIGN(0), 41 .help = NOTRACK_help, 42 .parse = NOTRACK_parse, 43}; 44 45void _init(void) 46{ 47 xtables_register_target(¬rack_target); 48 xtables_register_target(¬rack_target6); 49} 50