}
}
-static int DNAT_xlate(const struct xt_entry_target *target,
+static int DNAT_xlate(const void *ip, const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct nf_nat_range *range = (const void *)target->data;
{"warn", LOG_WARNING }
};
-static int LOG_xlate(const struct xt_entry_target *target,
+static int LOG_xlate(const void *ip, const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
unsigned int i = 0;
}
static int
-MASQUERADE_xlate(const struct xt_entry_target *target,
+MASQUERADE_xlate(const void *ip, const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct nf_nat_range *r = (const void *)target->data;
}
}
-static int REDIRECT_xlate(const struct xt_entry_target *target,
+static int REDIRECT_xlate(const void *ip, const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct nf_nat_range *range = (const void *)target->data;
{"reject-route", IP6T_ICMP6_REJECT_ROUTE}
};
-static int REJECT_xlate(const struct xt_entry_target *target,
+static int REJECT_xlate(const void *ip, const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct ip6t_reject_info *reject =
}
}
-static int SNAT_xlate(const struct xt_entry_target *target,
+static int SNAT_xlate(const void *ip, const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct nf_nat_range *range = (const void *)target->data;
printf(" --ahres");
}
-static int ah_xlate(const struct xt_entry_match *match,
+static int ah_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct ip6t_ah *ahinfo = (struct ip6t_ah *)match->data;
printf(" %s %u", op[info->mode], info->hop_limit);
}
-static int hl_xlate(const struct xt_entry_match *match,
+static int hl_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
static const char *const op[] = {
return 1;
}
-static int icmp6_xlate(const struct xt_entry_match *match, struct xt_xlate *xl,
- int numeric)
+static int icmp6_xlate(const void *ip, const struct xt_entry_match *match,
+ struct xt_xlate *xl, int numeric)
{
const struct ip6t_icmp *info = (struct ip6t_icmp *)match->data;
printf(" --mh-type %u", mhinfo->types[0]);
}
-static int mh_xlate(const struct xt_entry_match *match,
+static int mh_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct ip6t_mh *mhinfo = (struct ip6t_mh *)match->data;
}
-static int rt_xlate(const struct xt_entry_match *match, struct xt_xlate *xl,
- int numeric)
+static int rt_xlate(const void *ip, const struct xt_entry_match *match,
+ struct xt_xlate *xl, int numeric)
{
const struct ip6t_rt *rtinfo = (struct ip6t_rt *)match->data;
}
}
-static int DNAT_xlate(const struct xt_entry_target *target,
+static int DNAT_xlate(const void *ip, const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct ipt_natinfo *info = (const void *)target;
{"warn", LOG_WARNING }
};
-static int LOG_xlate(const struct xt_entry_target *target,
+static int LOG_xlate(const void *ip, const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
unsigned int i = 0;
}
static int
-MASQUERADE_xlate(const struct xt_entry_target *target,
+MASQUERADE_xlate(const void *ip, const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct nf_nat_ipv4_multi_range_compat *mr =
}
}
-static int REDIRECT_xlate(const struct xt_entry_target *target,
+static int REDIRECT_xlate(const void *ip, const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct nf_nat_ipv4_multi_range_compat *mr =
{"admin-prohibited", IPT_ICMP_ADMIN_PROHIBITED}
};
-static int REJECT_xlate(const struct xt_entry_target *target,
+static int REJECT_xlate(const void *ip, const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct ipt_reject_info *reject =
}
}
-static int SNAT_xlate(const struct xt_entry_target *target,
+static int SNAT_xlate(const void *ip, const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct ipt_natinfo *info = (const void *)target;
}
-static int ah_xlate(const struct xt_entry_match *match,
+static int ah_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct ipt_ah *ahinfo = (struct ipt_ah *)match->data;
}
}
-static int realm_xlate(const struct xt_entry_match *match,
+static int realm_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_realm_info *ri = (const void *)match->data;
printf(" %u", info->ttl);
}
-static int ttl_xlate(const struct xt_entry_match *match,
+static int ttl_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct ipt_ttl_info *info =
xt_xlate_add(xl, "group %u ", info->group);
}
-static int NFLOG_xlate(const struct xt_entry_target *target,
+static int NFLOG_xlate(const void *ip, const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct xt_nflog_info *info = (struct xt_nflog_info *)target->data;
tinfo->queues_total = 1;
}
-static int NFQUEUE_xlate(const struct xt_entry_target *target,
+static int NFQUEUE_xlate(const void *ip, const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct xt_NFQ_info *tinfo =
return 1;
}
-static int NFQUEUE_xlate_v1(const struct xt_entry_target *target,
+static int NFQUEUE_xlate_v1(const void *ip,
+ const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct xt_NFQ_info_v1 *tinfo = (const void *)target->data;
return 1;
}
-static int NFQUEUE_xlate_v2(const struct xt_entry_target *target,
+static int NFQUEUE_xlate_v2(const void *ip,
+ const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct xt_NFQ_info_v2 *info = (void *) target->data;
- NFQUEUE_xlate_v1(target, xl, numeric);
+ NFQUEUE_xlate_v1(ip, target, xl, numeric);
if (info->bypass & NFQ_FLAG_BYPASS)
xt_xlate_add(xl, "bypass");
return 1;
}
-static int NFQUEUE_xlate_v3(const struct xt_entry_target *target,
+static int NFQUEUE_xlate_v3(const void *ip,
+ const struct xt_entry_target *target,
struct xt_xlate *xl, int numeric)
{
const struct xt_NFQ_info_v3 *info = (void *)target->data;
- NFQUEUE_xlate_v2(target, xl, numeric);
+ NFQUEUE_xlate_v2(ip, target, xl, numeric);
if (info->flags & NFQ_FLAG_CPU_FANOUT)
xt_xlate_add(xl, "%sfanout ", info->flags & NFQ_FLAG_BYPASS ? "," : "");
}
static int
-comment_xlate(const struct xt_entry_match *match,
+comment_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
struct xt_comment_info *commentinfo = (void *)match->data;
op == XT_OP_EQ ? "" : "!= ", mark);
}
-static int connmark_xlate(const struct xt_entry_match *match,
+static int connmark_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_connmark_info *info = (const void *)match->data;
}
static int
-connmark_mt_xlate(const struct xt_entry_match *match,
- struct xt_xlate *xl, int numeric)
+connmark_mt_xlate(const void *ip, const struct xt_entry_match *match,
+ struct xt_xlate *xl, int numeric)
{
const struct xt_connmark_mtinfo1 *info = (const void *)match->data;
enum xt_op op = XT_OP_EQ;
}
}
-static int state_xlate(const struct xt_entry_match *match, struct xt_xlate *xl,
- int numeric)
+static int state_xlate(const void *ip, const struct xt_entry_match *match,
+ struct xt_xlate *xl, int numeric)
{
const struct xt_conntrack_mtinfo3 *sinfo = (const void *)match->data;
printf("%s --cpu %u", info->invert ? " !" : "", info->cpu);
}
-static int cpu_xlate(const struct xt_entry_match *match,
+static int cpu_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_cpu_info *info = (void *)match->data;
return 1;
}
-static int dccp_xlate(const struct xt_entry_match *match,
+static int dccp_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_dccp_info *einfo =
}
}
-static int devgroup_xlate(const struct xt_entry_match *match,
+static int devgroup_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_devgroup_info *info = (const void *)match->data;
}
-static int esp_xlate(const struct xt_entry_match *match,
+static int esp_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_esp *espinfo = (struct xt_esp *)match->data;
xtables_save_string(info->name);
}
-static int helper_xlate(const struct xt_entry_match *match,
+static int helper_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_helper_info *info = (const void *)match->data;
byte_max[0], byte_max[1], byte_max[2], byte_max[3]);
}
-static int iprange_xlate(const struct xt_entry_match *match,
+static int iprange_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct ipt_iprange_info *info = (const void *)match->data;
return 1;
}
-static int iprange_mt4_xlate(const struct xt_entry_match *match,
+static int iprange_mt4_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_iprange_mtinfo *info = (const void *)match->data;
return 1;
}
-static int iprange_mt6_xlate(const struct xt_entry_match *match,
+static int iprange_mt6_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_iprange_mtinfo *info = (const void *)match->data;
printf("%u:%u", info->min, info->max);
}
-static int length_xlate(const struct xt_entry_match *match,
+static int length_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_length_info *info = (void *)match->data;
rates_xlate[i - 1].name);
}
-static int limit_xlate(const struct xt_entry_match *match,
+static int limit_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_rateinfo *r = (const void *)match->data;
xt_xlate_add(xl, " ");
}
-static int mac_xlate(const struct xt_entry_match *match,
+static int mac_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_mac_info *info = (void *)match->data;
}
static int
-mark_mt_xlate(const struct xt_entry_match *match,
+mark_mt_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_mark_mtinfo1 *info = (const void *)match->data;
}
static int
-mark_xlate(const struct xt_entry_match *match,
+mark_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_mark_info *info = (const void *)match->data;
return 1;
}
-static int owner_mt_xlate(const struct xt_entry_match *match,
+static int owner_mt_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_owner_match_info *info = (void *)match->data;
xt_xlate_add(xl, "%d", info->pkttype);
}
-static int pkttype_xlate(const struct xt_entry_match *match,
- struct xt_xlate *xl, int numeric)
+static int pkttype_xlate(const void *ip, const struct xt_entry_match *match,
+ struct xt_xlate *xl, int numeric)
{
const struct xt_pkttype_info *info = (const void *)match->data;
}
}
-static int sctp_xlate(const struct xt_entry_match *match,
+static int sctp_xlate(const void *ip, const struct xt_entry_match *match,
struct xt_xlate *xl, int numeric)
{
const struct xt_sctp_info *einfo =
xt_xlate_add(xl, "none");
}
-static int tcp_xlate(const struct xt_entry_match *match, struct xt_xlate *xl,
- int numeric)
+static int tcp_xlate(const void *ip, const struct xt_entry_match *match,
+ struct xt_xlate *xl, int numeric)
{
const struct xt_tcp *tcpinfo = (const struct xt_tcp *)match->data;
}
}
-static int udp_xlate(const struct xt_entry_match *match, struct xt_xlate *xl,
- int numeric)
+static int udp_xlate(const void *ip, const struct xt_entry_match *match,
+ struct xt_xlate *xl, int numeric)
{
const struct xt_udp *udpinfo = (struct xt_udp *)match->data;
const struct xt_option_entry *x6_options;
/* Translate iptables to nft */
- int (*xlate)(const struct xt_entry_match *match, struct xt_xlate *xl,
- int numeric);
+ int (*xlate)(const void *ip, const struct xt_entry_match *match,
+ struct xt_xlate *xl, int numeric);
/* Size of per-extension instance extra "global" scratch space */
size_t udata_size;
const struct xt_option_entry *x6_options;
/* Translate iptables to nft */
- int (*xlate)(const struct xt_entry_target *target, struct xt_xlate *xl,
- int numeric);
+ int (*xlate)(const void *ip, const struct xt_entry_target *target,
+ struct xt_xlate *xl, int numeric);
size_t udata_size;
else if (strcmp(cs->jumpto, XTC_LABEL_RETURN) == 0)
xt_xlate_add(xl, "return");
else if (cs->target->xlate)
- ret = cs->target->xlate(cs->target->t, xl, numeric);
+ ret = cs->target->xlate((const void *)&cs->fw,
+ cs->target->t, xl, numeric);
else
return 0;
} else if (strlen(cs->jumpto) > 0) {
if (!matchp->match->xlate)
return 0;
- ret = matchp->match->xlate(matchp->match->m, xl, numeric);
+ ret = matchp->match->xlate((const void *)&cs->fw,
+ matchp->match->m, xl, numeric);
if (!ret)
break;
}