extensions: replace AF/PF with NFPROTO

Needs one update of netfilter.h to something recent, too.
This commit is contained in:
Jan Engelhardt
2010-03-17 02:20:39 +01:00
parent 749e0b788a
commit 414e95ffb1
26 changed files with 39 additions and 27 deletions

View File

@@ -142,7 +142,7 @@ account_tg_save(const void *ip, const struct xt_entry_target *target)
static struct xtables_target account_tg_reg = { static struct xtables_target account_tg_reg = {
.name = "ACCOUNT", .name = "ACCOUNT",
.revision = 1, .revision = 1,
.family = AF_INET, .family = NFPROTO_IPV4,
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct ipt_acc_info)), .size = XT_ALIGN(sizeof(struct ipt_acc_info)),
.userspacesize = offsetof(struct ipt_acc_info, table_nr), .userspacesize = offsetof(struct ipt_acc_info, table_nr),

View File

@@ -95,7 +95,7 @@ static void chaos_tg_save(const void *ip, const struct xt_entry_target *target)
static struct xtables_target chaos_tg_reg = { static struct xtables_target chaos_tg_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "CHAOS", .name = "CHAOS",
.family = AF_INET, .family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct xt_chaos_tginfo)), .size = XT_ALIGN(sizeof(struct xt_chaos_tginfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_chaos_tginfo)), .userspacesize = XT_ALIGN(sizeof(struct xt_chaos_tginfo)),
.help = chaos_tg_help, .help = chaos_tg_help,

View File

@@ -33,7 +33,7 @@ static struct xtables_target delude_tg_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "DELUDE", .name = "DELUDE",
.revision = 0, .revision = 0,
.family = AF_INET, .family = NFPROTO_IPV4,
.help = delude_tg_help, .help = delude_tg_help,
.parse = delude_tg_parse, .parse = delude_tg_parse,
.final_check = delude_tg_check, .final_check = delude_tg_check,

View File

@@ -84,7 +84,7 @@ static struct xtables_target dhcpmac_tg_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "DHCPMAC", .name = "DHCPMAC",
.revision = 0, .revision = 0,
.family = PF_INET, .family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct dhcpmac_info)), .size = XT_ALIGN(sizeof(struct dhcpmac_info)),
.userspacesize = XT_ALIGN(sizeof(struct dhcpmac_info)), .userspacesize = XT_ALIGN(sizeof(struct dhcpmac_info)),
.help = dhcpmac_tg_help, .help = dhcpmac_tg_help,

View File

@@ -29,7 +29,7 @@ static void echo_tg_check(unsigned int flags)
static struct xtables_target echo_tg_reg = { static struct xtables_target echo_tg_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "ECHO", .name = "ECHO",
.family = AF_UNSPEC, .family = NFPROTO_UNSPEC,
.help = echo_tg_help, .help = echo_tg_help,
.parse = echo_tg_parse, .parse = echo_tg_parse,
.final_check = echo_tg_check, .final_check = echo_tg_check,

View File

@@ -151,7 +151,7 @@ ipmark_tg_save(const void *entry, const struct xt_entry_target *target)
static struct xtables_target ipmark_tg_reg = { static struct xtables_target ipmark_tg_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "IPMARK", .name = "IPMARK",
.family = PF_UNSPEC, .family = NFPROTO_UNSPEC,
.revision = 1, .revision = 1,
.size = XT_ALIGN(sizeof(struct xt_ipmark_tginfo)), .size = XT_ALIGN(sizeof(struct xt_ipmark_tginfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_ipmark_tginfo)), .userspacesize = XT_ALIGN(sizeof(struct xt_ipmark_tginfo)),

View File

@@ -100,7 +100,7 @@ static struct xtables_target logmark_tg_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "LOGMARK", .name = "LOGMARK",
.revision = 0, .revision = 0,
.family = AF_UNSPEC, .family = NFPROTO_UNSPEC,
.size = XT_ALIGN(sizeof(struct xt_logmark_tginfo)), .size = XT_ALIGN(sizeof(struct xt_logmark_tginfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_logmark_tginfo)), .userspacesize = XT_ALIGN(sizeof(struct xt_logmark_tginfo)),
.help = logmark_tg_help, .help = logmark_tg_help,

View File

@@ -154,7 +154,7 @@ static struct xtables_target rawdnat_tg4_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "RAWDNAT", .name = "RAWDNAT",
.revision = 0, .revision = 0,
.family = PF_INET, .family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)), .size = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)), .userspacesize = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)),
.help = rawdnat_tg_help, .help = rawdnat_tg_help,
@@ -169,7 +169,7 @@ static struct xtables_target rawdnat_tg6_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "RAWDNAT", .name = "RAWDNAT",
.revision = 0, .revision = 0,
.family = PF_INET6, .family = NFPROTO_IPV6,
.size = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)), .size = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)), .userspacesize = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)),
.help = rawdnat_tg_help, .help = rawdnat_tg_help,

View File

@@ -154,7 +154,7 @@ static struct xtables_target rawsnat_tg4_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "RAWSNAT", .name = "RAWSNAT",
.revision = 0, .revision = 0,
.family = PF_INET, .family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)), .size = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)), .userspacesize = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)),
.help = rawsnat_tg_help, .help = rawsnat_tg_help,
@@ -169,7 +169,7 @@ static struct xtables_target rawsnat_tg6_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "RAWSNAT", .name = "RAWSNAT",
.revision = 0, .revision = 0,
.family = PF_INET6, .family = NFPROTO_IPV6,
.size = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)), .size = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)), .userspacesize = XT_ALIGN(sizeof(struct xt_rawnat_tginfo)),
.help = rawsnat_tg_help, .help = rawsnat_tg_help,

View File

@@ -19,7 +19,7 @@ static void steal_tg_check(unsigned int flags)
static struct xtables_target steal_tg_reg = { static struct xtables_target steal_tg_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "STEAL", .name = "STEAL",
.family = AF_UNSPEC, .family = NFPROTO_UNSPEC,
.help = steal_tg_help, .help = steal_tg_help,
.parse = steal_tg_parse, .parse = steal_tg_parse,
.final_check = steal_tg_check, .final_check = steal_tg_check,

View File

@@ -25,7 +25,7 @@ static struct xtables_target sysrq_tg_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "SYSRQ", .name = "SYSRQ",
.revision = 1, .revision = 1,
.family = PF_UNSPEC, .family = NFPROTO_UNSPEC,
.help = sysrq_tg_help, .help = sysrq_tg_help,
.parse = sysrq_tg_parse, .parse = sysrq_tg_parse,
.final_check = sysrq_tg_check, .final_check = sysrq_tg_check,

View File

@@ -24,7 +24,7 @@ static void tarpit_tg_check(unsigned int flags)
static struct xtables_target tarpit_tg_reg = { static struct xtables_target tarpit_tg_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "TARPIT", .name = "TARPIT",
.family = AF_INET, .family = NFPROTO_IPV4,
.help = tarpit_tg_help, .help = tarpit_tg_help,
.parse = tarpit_tg_parse, .parse = tarpit_tg_parse,
.final_check = tarpit_tg_check, .final_check = tarpit_tg_check,

View File

@@ -138,7 +138,7 @@ static struct xtables_target tee_tg_reg = {
.name = "TEE", .name = "TEE",
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.revision = 0, .revision = 0,
.family = PF_INET, .family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct xt_tee_tginfo)), .size = XT_ALIGN(sizeof(struct xt_tee_tginfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_tee_tginfo)), .userspacesize = XT_ALIGN(sizeof(struct xt_tee_tginfo)),
.help = tee_tg_help, .help = tee_tg_help,
@@ -153,7 +153,7 @@ static struct xtables_target tee_tg6_reg = {
.name = "TEE", .name = "TEE",
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.revision = 0, .revision = 0,
.family = PF_INET6, .family = NFPROTO_IPV6,
.size = XT_ALIGN(sizeof(struct xt_tee_tginfo)), .size = XT_ALIGN(sizeof(struct xt_tee_tginfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_tee_tginfo)), .userspacesize = XT_ALIGN(sizeof(struct xt_tee_tginfo)),
.help = tee_tg_help, .help = tee_tg_help,

View File

@@ -80,7 +80,7 @@ static void condition_save(const void *ip, const struct xt_entry_match *match)
static struct xtables_match condition_mt_reg = { static struct xtables_match condition_mt_reg = {
.name = "condition", .name = "condition",
.revision = 1, .revision = 1,
.family = PF_UNSPEC, .family = NFPROTO_UNSPEC,
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_condition_mtinfo)), .size = XT_ALIGN(sizeof(struct xt_condition_mtinfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_condition_mtinfo)), .userspacesize = XT_ALIGN(sizeof(struct xt_condition_mtinfo)),

View File

@@ -85,7 +85,7 @@ static struct xtables_match dhcpmac_mt_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "dhcpmac", .name = "dhcpmac",
.revision = 0, .revision = 0,
.family = PF_INET, .family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct dhcpmac_info)), .size = XT_ALIGN(sizeof(struct dhcpmac_info)),
.userspacesize = XT_ALIGN(sizeof(struct dhcpmac_info)), .userspacesize = XT_ALIGN(sizeof(struct dhcpmac_info)),
.help = dhcpmac_mt_help, .help = dhcpmac_mt_help,

View File

@@ -103,6 +103,7 @@ static struct xtables_match fuzzy_mt_reg = {
.name = "fuzzy", .name = "fuzzy",
.revision = 1, .revision = 1,
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.family = NFPROTO_UNSPEC,
.size = XT_ALIGN(sizeof(struct xt_fuzzy_mtinfo)), .size = XT_ALIGN(sizeof(struct xt_fuzzy_mtinfo)),
.userspacesize = offsetof(struct xt_fuzzy_mtinfo, packets_total), .userspacesize = offsetof(struct xt_fuzzy_mtinfo, packets_total),
.help = fuzzy_mt_help, .help = fuzzy_mt_help,

View File

@@ -259,7 +259,7 @@ geoip_save(const void *ip, const struct xt_entry_match *match)
} }
static struct xtables_match geoip_match = { static struct xtables_match geoip_match = {
.family = AF_INET, .family = NFPROTO_IPV4,
.name = "geoip", .name = "geoip",
.revision = 1, .revision = 1,
.version = XTABLES_VERSION, .version = XTABLES_VERSION,

View File

@@ -200,7 +200,7 @@ static struct xtables_match iface_mt_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "iface", .name = "iface",
.revision = 0, .revision = 0,
.family = AF_UNSPEC, .family = NFPROTO_UNSPEC,
.size = XT_ALIGN(sizeof(struct xt_iface_mtinfo)), .size = XT_ALIGN(sizeof(struct xt_iface_mtinfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_iface_mtinfo)), .userspacesize = XT_ALIGN(sizeof(struct xt_iface_mtinfo)),
.help = iface_mt_help, .help = iface_mt_help,

View File

@@ -229,7 +229,7 @@ static struct xtables_match ipp2p_mt_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "ipp2p", .name = "ipp2p",
.revision = 1, .revision = 1,
.family = AF_INET, .family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct ipt_p2p_info)), .size = XT_ALIGN(sizeof(struct ipt_p2p_info)),
.userspacesize = XT_ALIGN(sizeof(struct ipt_p2p_info)), .userspacesize = XT_ALIGN(sizeof(struct ipt_p2p_info)),
.help = ipp2p_mt_help, .help = ipp2p_mt_help,

View File

@@ -161,7 +161,7 @@ static struct xtables_match ipv4options_mt_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "ipv4options", .name = "ipv4options",
.revision = 1, .revision = 1,
.family = PF_INET, .family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct xt_ipv4options_mtinfo1)), .size = XT_ALIGN(sizeof(struct xt_ipv4options_mtinfo1)),
.userspacesize = XT_ALIGN(sizeof(struct xt_ipv4options_mtinfo1)), .userspacesize = XT_ALIGN(sizeof(struct xt_ipv4options_mtinfo1)),
.help = ipv4options_mt_help, .help = ipv4options_mt_help,

View File

@@ -155,7 +155,7 @@ static struct xtables_match length2_mt_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "length2", .name = "length2",
.revision = 2, .revision = 2,
.family = PF_UNSPEC, .family = NFPROTO_UNSPEC,
.size = XT_ALIGN(sizeof(struct xt_length_mtinfo2)), .size = XT_ALIGN(sizeof(struct xt_length_mtinfo2)),
.userspacesize = XT_ALIGN(sizeof(struct xt_length_mtinfo2)), .userspacesize = XT_ALIGN(sizeof(struct xt_length_mtinfo2)),
.init = length_mt_init, .init = length_mt_init,

View File

@@ -105,7 +105,7 @@ static struct xtables_match lscan_mt_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "lscan", .name = "lscan",
.revision = 0, .revision = 0,
.family = AF_INET, .family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct xt_lscan_mtinfo)), .size = XT_ALIGN(sizeof(struct xt_lscan_mtinfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_lscan_mtinfo)), .userspacesize = XT_ALIGN(sizeof(struct xt_lscan_mtinfo)),
.help = lscan_mt_help, .help = lscan_mt_help,

View File

@@ -139,7 +139,7 @@ static struct xtables_match psd_mt_reg = {
.name = "psd", .name = "psd",
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.revision = 1, .revision = 1,
.family = PF_INET, .family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct xt_psd_info)), .size = XT_ALIGN(sizeof(struct xt_psd_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_psd_info)), .userspacesize = XT_ALIGN(sizeof(struct xt_psd_info)),
.help = psd_mt_help, .help = psd_mt_help,

View File

@@ -133,7 +133,7 @@ static void quota_mt2_print(const void *ip, const struct xt_entry_match *match,
} }
static struct xtables_match quota_mt2_reg = { static struct xtables_match quota_mt2_reg = {
.family = AF_UNSPEC, .family = NFPROTO_UNSPEC,
.revision = 3, .revision = 3,
.name = "quota2", .name = "quota2",
.version = XTABLES_VERSION, .version = XTABLES_VERSION,

View File

@@ -326,7 +326,7 @@ static struct xtables_match pknock_mt_reg = {
.name = "pknock", .name = "pknock",
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.revision = 1, .revision = 1,
.family = AF_INET, .family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct xt_pknock_mtinfo)), .size = XT_ALIGN(sizeof(struct xt_pknock_mtinfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_pknock_mtinfo)), .userspacesize = XT_ALIGN(sizeof(struct xt_pknock_mtinfo)),
.help = pknock_mt_help, .help = pknock_mt_help,

View File

@@ -3,6 +3,7 @@
#include <linux/types.h> #include <linux/types.h>
/* Responses from hook functions. */ /* Responses from hook functions. */
#define NF_DROP 0 #define NF_DROP 0
#define NF_ACCEPT 1 #define NF_ACCEPT 1
@@ -37,6 +38,16 @@ enum nf_inet_hooks {
NF_INET_NUMHOOKS NF_INET_NUMHOOKS
}; };
enum {
NFPROTO_UNSPEC = 0,
NFPROTO_IPV4 = 2,
NFPROTO_ARP = 3,
NFPROTO_BRIDGE = 7,
NFPROTO_IPV6 = 10,
NFPROTO_DECNET = 12,
NFPROTO_NUMPROTO,
};
union nf_inet_addr { union nf_inet_addr {
__u32 all[4]; __u32 all[4];
__be32 ip; __be32 ip;