diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-02-01 19:24:38 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-02-16 19:30:25 +0100 |
commit | 6b60dc5be58a5781cacc4e6f238454d5e8421760 (patch) | |
tree | be23e91f26e5295c12cd69ee5091454345cfaa6b /iptables/nft-ipv6.c | |
parent | ca9a1a6a9f64ee5d94038abb451b27cc9581c81b (diff) |
extensions: rename xt_buf to xt_xlate
Use a more generic name for this object to prepare the introduction of
other translation specific fields.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/nft-ipv6.c')
-rw-r--r-- | iptables/nft-ipv6.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/iptables/nft-ipv6.c b/iptables/nft-ipv6.c index 0b6ff97e..77ac5b80 100644 --- a/iptables/nft-ipv6.c +++ b/iptables/nft-ipv6.c @@ -378,7 +378,7 @@ static void nft_ipv6_save_counters(const void *data) } static void xlate_ipv6_addr(const char *selector, const struct in6_addr *addr, - int invert, struct xt_buf *buf) + int invert, struct xt_xlate *xl) { char addr_str[INET6_ADDRSTRLEN]; @@ -386,22 +386,22 @@ static void xlate_ipv6_addr(const char *selector, const struct in6_addr *addr, return; inet_ntop(AF_INET6, addr, addr_str, INET6_ADDRSTRLEN); - xt_buf_add(buf, "%s %s%s ", selector, invert ? "!= " : "", addr_str); + xt_xlate_add(xl, "%s %s%s ", selector, invert ? "!= " : "", addr_str); } -static int nft_ipv6_xlate(const void *data, struct xt_buf *buf) +static int nft_ipv6_xlate(const void *data, struct xt_xlate *xl) { const struct iptables_command_state *cs = data; int ret; if (cs->fw6.ipv6.iniface[0] != '\0') { - xt_buf_add(buf, "iifname %s%s ", + xt_xlate_add(xl, "iifname %s%s ", cs->fw6.ipv6.invflags & IP6T_INV_VIA_IN ? "!= " : "", cs->fw6.ipv6.iniface); } if (cs->fw6.ipv6.outiface[0] != '\0') { - xt_buf_add(buf, "oifname %s%s ", + xt_xlate_add(xl, "oifname %s%s ", cs->fw6.ipv6.invflags & IP6T_INV_VIA_OUT ? "!= " : "", cs->fw6.ipv6.outiface); @@ -416,7 +416,7 @@ static int nft_ipv6_xlate(const void *data, struct xt_buf *buf) snprintf(protonum, sizeof(protonum), "%u", cs->fw6.ipv6.proto); protonum[sizeof(protonum) - 1] = '\0'; - xt_buf_add(buf, "ip6 nexthdr %s%s ", + xt_xlate_add(xl, "ip6 nexthdr %s%s ", cs->fw6.ipv6.invflags & IP6T_INV_PROTO ? "!= " : "", pent ? pent->p_name : protonum); @@ -424,18 +424,18 @@ static int nft_ipv6_xlate(const void *data, struct xt_buf *buf) } xlate_ipv6_addr("ip6 saddr", &cs->fw6.ipv6.src, - cs->fw6.ipv6.invflags & IP6T_INV_SRCIP, buf); + cs->fw6.ipv6.invflags & IP6T_INV_SRCIP, xl); xlate_ipv6_addr("ip6 daddr", &cs->fw6.ipv6.dst, - cs->fw6.ipv6.invflags & IP6T_INV_DSTIP, buf); + cs->fw6.ipv6.invflags & IP6T_INV_DSTIP, xl); - ret = xlate_matches(cs, buf); + ret = xlate_matches(cs, xl); if (!ret) return ret; /* Always add counters per rule, as in iptables */ - xt_buf_add(buf, "counter "); + xt_xlate_add(xl, "counter "); - ret = xlate_action(cs, !!(cs->fw6.ipv6.flags & IP6T_F_GOTO), buf); + ret = xlate_action(cs, !!(cs->fw6.ipv6.flags & IP6T_F_GOTO), xl); return ret; } |