summaryrefslogtreecommitdiffstats
path: root/extensions/libipt_DNAT.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2016-02-01 19:24:38 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2016-02-16 19:30:25 +0100
commit6b60dc5be58a5781cacc4e6f238454d5e8421760 (patch)
treebe23e91f26e5295c12cd69ee5091454345cfaa6b /extensions/libipt_DNAT.c
parentca9a1a6a9f64ee5d94038abb451b27cc9581c81b (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 'extensions/libipt_DNAT.c')
-rw-r--r--extensions/libipt_DNAT.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/extensions/libipt_DNAT.c b/extensions/libipt_DNAT.c
index e5291418..45835a97 100644
--- a/extensions/libipt_DNAT.c
+++ b/extensions/libipt_DNAT.c
@@ -243,27 +243,27 @@ static void DNAT_save(const void *ip, const struct xt_entry_target *target)
}
static void print_range_xlate(const struct nf_nat_ipv4_range *r,
- struct xt_buf *buf)
+ struct xt_xlate *xl)
{
if (r->flags & NF_NAT_RANGE_MAP_IPS) {
struct in_addr a;
a.s_addr = r->min_ip;
- xt_buf_add(buf, "%s", xtables_ipaddr_to_numeric(&a));
+ xt_xlate_add(xl, "%s", xtables_ipaddr_to_numeric(&a));
if (r->max_ip != r->min_ip) {
a.s_addr = r->max_ip;
- xt_buf_add(buf, "-%s", xtables_ipaddr_to_numeric(&a));
+ xt_xlate_add(xl, "-%s", xtables_ipaddr_to_numeric(&a));
}
}
if (r->flags & NF_NAT_RANGE_PROTO_SPECIFIED) {
- xt_buf_add(buf, ":%hu", ntohs(r->min.tcp.port));
+ xt_xlate_add(xl, ":%hu", ntohs(r->min.tcp.port));
if (r->max.tcp.port != r->min.tcp.port)
- xt_buf_add(buf, "-%hu", ntohs(r->max.tcp.port));
+ xt_xlate_add(xl, "-%hu", ntohs(r->max.tcp.port));
}
}
static int DNAT_xlate(const struct xt_entry_target *target,
- struct xt_buf *buf, int numeric)
+ struct xt_xlate *xl, int numeric)
{
const struct ipt_natinfo *info = (const void *)target;
unsigned int i = 0;
@@ -271,16 +271,16 @@ static int DNAT_xlate(const struct xt_entry_target *target,
const char *sep = " ";
for (i = 0; i < info->mr.rangesize; i++) {
- xt_buf_add(buf, "dnat ");
- print_range_xlate(&info->mr.range[i], buf);
+ xt_xlate_add(xl, "dnat ");
+ print_range_xlate(&info->mr.range[i], xl);
if (info->mr.range[i].flags & NF_NAT_RANGE_PROTO_RANDOM) {
- xt_buf_add(buf, " random");
+ xt_xlate_add(xl, " random");
sep_need = true;
}
if (info->mr.range[i].flags & NF_NAT_RANGE_PERSISTENT) {
if (sep_need)
sep = ",";
- xt_buf_add(buf, "%spersistent", sep);
+ xt_xlate_add(xl, "%spersistent", sep);
}
}