diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-11-10 07:53:52 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-11-10 07:53:52 +0100 |
commit | a95082117ad4813141f5733e5c3dda8efc5dec16 (patch) | |
tree | 61edab08d7390e0179fc6c2900234c040168500a /libip6t_DNPTV6.c | |
parent | c25768e4311eaf9e9d9166e42fe74e9c597c466d (diff) | |
download | NPTv6-a95082117ad4813141f5733e5c3dda8efc5dec16.tar NPTv6-a95082117ad4813141f5733e5c3dda8efc5dec16.zip |
Make this work again.
Diffstat (limited to 'libip6t_DNPTV6.c')
-rw-r--r-- | libip6t_DNPTV6.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/libip6t_DNPTV6.c b/libip6t_DNPTV6.c new file mode 100644 index 0000000..ad937ae --- /dev/null +++ b/libip6t_DNPTV6.c @@ -0,0 +1,46 @@ +/* + * NATv6: IPv6-to-IPv6 Network Prefix Translation as + * proposed in RFC 6296. + * Based on MAP66 (c) 2010 sven-ola()gmx.de + * (c) 2011 mschiffer()universe-factory.net "I'm the one to blame for any problems with this version ;P" + */ + +#include "libip6t_NPTV6.h" + + +static void DNPTV6_help(void) +{ + printf( +"DNPTV6 target options\n" +" --to-destination ipv6addr/prefixlength (Prefix to map IPv6 destination address to)\n"); + NPTV6_help_note(); +} + +static void DNPTV6_save(const void *ip, const struct xt_entry_target *target) +{ + const struct ip6t_nptv6_info* info = (struct ip6t_nptv6_info*)target->data; + printf(" --to-destination %s/%d ", xtables_ip6addr_to_numeric(&info->nptv6_prefix), info->nptv6_prefix_len); +} + +static const struct xt_option_entry DNPTV6_opts[] = { + {.name = "to-destination", .id = 0, .type = XTTYPE_STRING, .flags = XTOPT_MAND}, + XTOPT_TABLEEND, +}; + +static struct xtables_target DNPTV6_tg6_reg = { + .name = "DNPTV6", + .version = XTABLES_VERSION, + .family = NFPROTO_IPV6, + .size = XT_ALIGN(sizeof(struct ip6t_nptv6_info)), + .userspacesize = XT_ALIGN(sizeof(struct ip6t_nptv6_info)), + .help = DNPTV6_help, + .x6_parse = NPTV6_parse, + .print = NPTV6_print, + .save = DNPTV6_save, + .x6_options = DNPTV6_opts, +}; + +void _init(void) +{ + xtables_register_target(&DNPTV6_tg6_reg); +} |