From 3ba4717ef537a8fcef51b0af6c5d57d711b63394 Mon Sep 17 00:00:00 2001 From: sven-ola Date: Wed, 13 Oct 2010 12:12:03 +0000 Subject: small fix git-svn-id: https://map66.svn.sourceforge.net/svnroot/map66@21 3484d885-4da6-438d-b19d-107d078dd756 --- ip6t_MAP66.c | 6 +++--- ip6t_MAP66.h | 4 ++-- libip6t_MAP66.c | 42 +++++++++++++++++++++--------------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ip6t_MAP66.c b/ip6t_MAP66.c index ffe4afa..5f94f81 100644 --- a/ip6t_MAP66.c +++ b/ip6t_MAP66.c @@ -167,21 +167,21 @@ static bool MAP66_tg6_check( if (0 == ((IP6T_MAP66_OPT_DST_TO | IP6T_MAP66_OPT_SRC_TO) & info->mapflags)) { - printk("MAP66: No " IP6T_MAP66_DST_TO " nor " IP6T_MAP66_SRC_TO "\n"); + printk("MAP66: No --" IP6T_MAP66_DST_TO " nor --" IP6T_MAP66_SRC_TO "\n"); return false; } if (0 != (IP6T_MAP66_OPT_DST_TO & info->mapflags) && (0 >= info->pfix_dst_len || 8 <= info->pfix_dst_len)) { - printk("MAP66: Unsupported dst-to prefix length /%d\n", 16 * info->pfix_dst_len); + printk("MAP66: Unsupported --" IP6T_MAP66_DST_TO " prefix length /%d\n", 16 * info->pfix_dst_len); return false; } if (0 != (IP6T_MAP66_OPT_SRC_TO & info->mapflags) && (0 >= info->pfix_src_len || 8 <= info->pfix_src_len)) { - printk("MAP66: Unsupported src-to prefix length /%d\n", 16 * info->pfix_src_len); + printk("MAP66: Unsupported --" IP6T_MAP66_SRC_TO " prefix length /%d\n", 16 * info->pfix_src_len); return false; } return true; diff --git a/ip6t_MAP66.h b/ip6t_MAP66.h index 70fd5fc..291956d 100644 --- a/ip6t_MAP66.h +++ b/ip6t_MAP66.h @@ -7,8 +7,8 @@ #ifndef _IP6T_MAP66_H #define _IP6T_MAP66_H -#define IP6T_MAP66_DST_TO "--dst-to" -#define IP6T_MAP66_SRC_TO "--src-to" +#define IP6T_MAP66_DST_TO "dst-to" +#define IP6T_MAP66_SRC_TO "src-to" #define IP6T_MAP66_OPT_DST_TO 0x01 #define IP6T_MAP66_OPT_SRC_TO 0x02 diff --git a/libip6t_MAP66.c b/libip6t_MAP66.c index a3705b6..219252d 100644 --- a/libip6t_MAP66.c +++ b/libip6t_MAP66.c @@ -59,8 +59,8 @@ static void MAP66_help(void) { printf( "MAP66 target options\n" -" " IP6T_MAP66_DST_TO " ipv6addr/prefixlength (Prefix to map IPv6 destination address to)\n" -" " IP6T_MAP66_SRC_TO " ipv6addr/prefixlength (Prefix to map IPv6 source address to)\n" +" --" IP6T_MAP66_DST_TO " ipv6addr/prefixlength (Prefix to map IPv6 destination address to)\n" +" --" IP6T_MAP66_SRC_TO " ipv6addr/prefixlength (Prefix to map IPv6 source address to)\n" " --nocheck (Disables the do-not-map-to-my-addr check)\n" "\n" "Note: you need two ip6tables rules to map an internal network\n" @@ -68,8 +68,8 @@ static void MAP66_help(void) "\n" "Example:\n" "\n" -"ip6tables -t mangle -I PREROUTING -i eth0 -d 2001:0DB8:0001::/48 -j MAP66 " IP6T_MAP66_DST_TO " FD01:0203:0405::/48\n" -"ip6tables -t mangle -I POSTROUTING -o eth0 -s FD01:0203:0405::/48 -j MAP66 " IP6T_MAP66_SRC_TO " 2001:0DB8:0001::/48\n"); +"ip6tables -t mangle -I PREROUTING -i eth0 -d 2001:0DB8:0001::/48 -j MAP66 --" IP6T_MAP66_DST_TO " FD01:0203:0405::/48\n" +"ip6tables -t mangle -I POSTROUTING -o eth0 -s FD01:0203:0405::/48 -j MAP66 --" IP6T_MAP66_SRC_TO " 2001:0DB8:0001::/48\n"); } static int MAP66_parse( @@ -87,29 +87,29 @@ static int MAP66_parse( switch(c) { case '1': if (!optarg) { - xtables_error(PARAMETER_PROBLEM, IP6T_MAP66_DST_TO ": You must specify a value"); + xtables_error(PARAMETER_PROBLEM, "--" IP6T_MAP66_DST_TO ": You must specify a value"); } if (xtables_check_inverse(optarg, &invert, NULL, 0 #if IPTABLES_VERSION_CODE >= IPTABLES_VERSION_CMP(1,4,6) ,argv #endif )) { - xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after " IP6T_MAP66_DST_TO); + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --" IP6T_MAP66_DST_TO); } if (0 != (IP6T_MAP66_OPT_DST_TO & *flags)) { - xtables_error(PARAMETER_PROBLEM, "Multiple " IP6T_MAP66_DST_TO " not supported"); + xtables_error(PARAMETER_PROBLEM, "Multiple --" IP6T_MAP66_DST_TO " not supported"); } *flags |= IP6T_MAP66_OPT_DST_TO; if (NULL == (p = strchr(optarg, '/'))) { - xtables_error(PARAMETER_PROBLEM, "Missing '/' character in " IP6T_MAP66_DST_TO ": \"%s\"", optarg); + xtables_error(PARAMETER_PROBLEM, "Missing '/' character in --" IP6T_MAP66_DST_TO ": \"%s\"", optarg); } *p = '\0'; if (1 != inet_pton(AF_INET6, optarg, &info->pfix_dst_to)) { - xtables_error(PARAMETER_PROBLEM, "Invalid IPv6 address in " IP6T_MAP66_DST_TO ": \"%s\"", optarg); + xtables_error(PARAMETER_PROBLEM, "Invalid IPv6 address in --" IP6T_MAP66_DST_TO ": \"%s\"", optarg); } i = atoi(p + 1); if (0 >= i || 128 <= i || 0 != i % 16) { - xtables_error(PARAMETER_PROBLEM, "Invalid prefix length in " IP6T_MAP66_DST_TO ": \"%s\" (use /112, /96 .. /16)", p + 1); + xtables_error(PARAMETER_PROBLEM, "Invalid prefix length in --" IP6T_MAP66_DST_TO ": \"%s\" (use /112, /96 .. /16)", p + 1); } info->pfix_dst_len = i / 16; info->pfix_dst_csum = ~csum16((const u_int16_t *)&info->pfix_dst_to, info->pfix_dst_len); @@ -117,29 +117,29 @@ static int MAP66_parse( break; case '2': if (!optarg) { - xtables_error(PARAMETER_PROBLEM, IP6T_MAP66_SRC_TO ": You must specify a value"); + xtables_error(PARAMETER_PROBLEM, "--" IP6T_MAP66_SRC_TO ": You must specify a value"); } if (xtables_check_inverse(optarg, &invert, NULL, 0 #if IPTABLES_VERSION_CODE >= IPTABLES_VERSION_CMP(1,4,6) ,argv #endif )) { - xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after " IP6T_MAP66_SRC_TO); + xtables_error(PARAMETER_PROBLEM, "Unexpected `!' after --" IP6T_MAP66_SRC_TO); } if (0 != (IP6T_MAP66_OPT_SRC_TO & *flags)) { - xtables_error(PARAMETER_PROBLEM, "Multiple " IP6T_MAP66_SRC_TO " not supported"); + xtables_error(PARAMETER_PROBLEM, "Multiple --" IP6T_MAP66_SRC_TO " not supported"); } *flags |= IP6T_MAP66_OPT_SRC_TO; if (NULL == (p = strchr(optarg, '/'))) { - xtables_error(PARAMETER_PROBLEM, "Missing '/' character in " IP6T_MAP66_SRC_TO ": \"%s\"", optarg); + xtables_error(PARAMETER_PROBLEM, "Missing '/' character in --" IP6T_MAP66_SRC_TO ": \"%s\"", optarg); } *p = '\0'; if (1 != inet_pton(AF_INET6, optarg, &info->pfix_src_to)) { - xtables_error(PARAMETER_PROBLEM, "Invalid IPv6 address in " IP6T_MAP66_SRC_TO ": \"%s\"", optarg); + xtables_error(PARAMETER_PROBLEM, "Invalid IPv6 address in --" IP6T_MAP66_SRC_TO ": \"%s\"", optarg); } i = atoi(p + 1); if (0 >= i || 128 <= i || 0 != i % 16) { - xtables_error(PARAMETER_PROBLEM, "Invalid prefix length in " IP6T_MAP66_SRC_TO ": \"%s\" (use /112, /96 .. /16)", p + 1); + xtables_error(PARAMETER_PROBLEM, "Invalid prefix length in --" IP6T_MAP66_SRC_TO ": \"%s\" (use /112, /96 .. /16)", p + 1); } info->pfix_src_len = i / 16; info->pfix_src_csum = ~csum16((const u_int16_t *)&info->pfix_src_to, info->pfix_src_len); @@ -160,7 +160,7 @@ static int MAP66_parse( static void MAP66_check(unsigned int flags) { if (0 == ((IP6T_MAP66_OPT_DST_TO | IP6T_MAP66_OPT_SRC_TO) & flags)) { - xtables_error(PARAMETER_PROBLEM, "You must specify " IP6T_MAP66_DST_TO " or " IP6T_MAP66_SRC_TO); + xtables_error(PARAMETER_PROBLEM, "You must specify --" IP6T_MAP66_DST_TO " or --" IP6T_MAP66_SRC_TO); } } @@ -171,10 +171,10 @@ static void MAP66_save( char s[50+1]; const struct ip6t_MAP66_info* info = (struct ip6t_MAP66_info*)target->data; if (0 != (IP6T_MAP66_OPT_DST_TO & info->mapflags)) { - printf(IP6T_MAP66_DST_TO " %s/%d ", inet_ntop(AF_INET6, &info->pfix_dst_to, s, sizeof(s)), 16 * info->pfix_dst_len); + printf("--" IP6T_MAP66_DST_TO " %s/%d ", inet_ntop(AF_INET6, &info->pfix_dst_to, s, sizeof(s)), 16 * info->pfix_dst_len); } if (0 != (IP6T_MAP66_OPT_SRC_TO & info->mapflags)) { - printf(IP6T_MAP66_SRC_TO " %s/%d ", inet_ntop(AF_INET6, &info->pfix_src_to, s, sizeof(s)), 16 * info->pfix_src_len); + printf("--" IP6T_MAP66_SRC_TO " %s/%d ", inet_ntop(AF_INET6, &info->pfix_src_to, s, sizeof(s)), 16 * info->pfix_src_len); } if (0 != (IP6T_MAP66_OPT_NOCHECK & info->mapflags)) { printf("--nocheck "); @@ -182,8 +182,8 @@ static void MAP66_save( } static struct option MAP66_opts[] = { - { .name = "dst-to", .has_arg = 1, .flag = NULL, .val = '1' }, - { .name = "src-to", .has_arg = 1, .flag = NULL, .val = '2' }, + { .name = IP6T_MAP66_DST_TO, .has_arg = 1, .flag = NULL, .val = '1' }, + { .name = IP6T_MAP66_SRC_TO, .has_arg = 1, .flag = NULL, .val = '2' }, { .name = "nocheck", .has_arg = 0, .flag = NULL, .val = '3' }, { .name = NULL } }; -- cgit v1.2.3