Skip to content

Commit

Permalink
[NETFILTER]: x_tables: consistent and unique symbol names
Browse files Browse the repository at this point in the history
Give all Netfilter modules consistent and unique symbol names.

Signed-off-by: Jan Engelhardt <[email protected]>
Signed-off-by: Patrick McHardy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Jan Engelhardt authored and davem330 committed Jan 28, 2008
1 parent 4c61097 commit d3c5ee6
Show file tree
Hide file tree
Showing 70 changed files with 1,262 additions and 1,593 deletions.
41 changes: 18 additions & 23 deletions net/ipv4/netfilter/ipt_CLUSTERIP.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,9 @@ clusterip_responsible(const struct clusterip_config *config, u_int32_t hash)
***********************************************************************/

static unsigned int
target(struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
unsigned int hooknum,
const struct xt_target *target,
const void *targinfo)
clusterip_tg(struct sk_buff *skb, const struct net_device *in,
const struct net_device *out, unsigned int hooknum,
const struct xt_target *target, const void *targinfo)
{
const struct ipt_clusterip_tgt_info *cipinfo = targinfo;
struct nf_conn *ct;
Expand Down Expand Up @@ -359,11 +356,9 @@ target(struct sk_buff *skb,
}

static bool
checkentry(const char *tablename,
const void *e_void,
const struct xt_target *target,
void *targinfo,
unsigned int hook_mask)
clusterip_tg_check(const char *tablename, const void *e_void,
const struct xt_target *target, void *targinfo,
unsigned int hook_mask)
{
struct ipt_clusterip_tgt_info *cipinfo = targinfo;
const struct ipt_entry *e = e_void;
Expand Down Expand Up @@ -427,7 +422,7 @@ checkentry(const char *tablename,
}

/* drop reference count of cluster config when rule is deleted */
static void destroy(const struct xt_target *target, void *targinfo)
static void clusterip_tg_destroy(const struct xt_target *target, void *targinfo)
{
struct ipt_clusterip_tgt_info *cipinfo = targinfo;

Expand All @@ -454,12 +449,12 @@ struct compat_ipt_clusterip_tgt_info
};
#endif /* CONFIG_COMPAT */

static struct xt_target clusterip_tgt __read_mostly = {
static struct xt_target clusterip_tg_reg __read_mostly = {
.name = "CLUSTERIP",
.family = AF_INET,
.target = target,
.checkentry = checkentry,
.destroy = destroy,
.target = clusterip_tg,
.checkentry = clusterip_tg_check,
.destroy = clusterip_tg_destroy,
.targetsize = sizeof(struct ipt_clusterip_tgt_info),
#ifdef CONFIG_COMPAT
.compatsize = sizeof(struct compat_ipt_clusterip_tgt_info),
Expand Down Expand Up @@ -712,11 +707,11 @@ static const struct file_operations clusterip_proc_fops = {

#endif /* CONFIG_PROC_FS */

static int __init ipt_clusterip_init(void)
static int __init clusterip_tg_init(void)
{
int ret;

ret = xt_register_target(&clusterip_tgt);
ret = xt_register_target(&clusterip_tg_reg);
if (ret < 0)
return ret;

Expand All @@ -742,20 +737,20 @@ static int __init ipt_clusterip_init(void)
nf_unregister_hook(&cip_arp_ops);
#endif /* CONFIG_PROC_FS */
cleanup_target:
xt_unregister_target(&clusterip_tgt);
xt_unregister_target(&clusterip_tg_reg);
return ret;
}

static void __exit ipt_clusterip_fini(void)
static void __exit clusterip_tg_exit(void)
{
printk(KERN_NOTICE "ClusterIP Version %s unloading\n",
CLUSTERIP_VERSION);
#ifdef CONFIG_PROC_FS
remove_proc_entry(clusterip_procdir->name, clusterip_procdir->parent);
#endif
nf_unregister_hook(&cip_arp_ops);
xt_unregister_target(&clusterip_tgt);
xt_unregister_target(&clusterip_tg_reg);
}

module_init(ipt_clusterip_init);
module_exit(ipt_clusterip_fini);
module_init(clusterip_tg_init);
module_exit(clusterip_tg_exit);
35 changes: 15 additions & 20 deletions net/ipv4/netfilter/ipt_ECN.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,9 @@ set_ect_tcp(struct sk_buff *skb, const struct ipt_ECN_info *einfo)
}

static unsigned int
target(struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
unsigned int hooknum,
const struct xt_target *target,
const void *targinfo)
ecn_tg(struct sk_buff *skb, const struct net_device *in,
const struct net_device *out, unsigned int hooknum,
const struct xt_target *target, const void *targinfo)
{
const struct ipt_ECN_info *einfo = targinfo;

Expand All @@ -99,11 +96,9 @@ target(struct sk_buff *skb,
}

static bool
checkentry(const char *tablename,
const void *e_void,
const struct xt_target *target,
void *targinfo,
unsigned int hook_mask)
ecn_tg_check(const char *tablename, const void *e_void,
const struct xt_target *target, void *targinfo,
unsigned int hook_mask)
{
const struct ipt_ECN_info *einfo = (struct ipt_ECN_info *)targinfo;
const struct ipt_entry *e = e_void;
Expand All @@ -127,25 +122,25 @@ checkentry(const char *tablename,
return true;
}

static struct xt_target ipt_ecn_reg __read_mostly = {
static struct xt_target ecn_tg_reg __read_mostly = {
.name = "ECN",
.family = AF_INET,
.target = target,
.target = ecn_tg,
.targetsize = sizeof(struct ipt_ECN_info),
.table = "mangle",
.checkentry = checkentry,
.checkentry = ecn_tg_check,
.me = THIS_MODULE,
};

static int __init ipt_ecn_init(void)
static int __init ecn_tg_init(void)
{
return xt_register_target(&ipt_ecn_reg);
return xt_register_target(&ecn_tg_reg);
}

static void __exit ipt_ecn_fini(void)
static void __exit ecn_tg_exit(void)
{
xt_unregister_target(&ipt_ecn_reg);
xt_unregister_target(&ecn_tg_reg);
}

module_init(ipt_ecn_init);
module_exit(ipt_ecn_fini);
module_init(ecn_tg_init);
module_exit(ecn_tg_exit);
36 changes: 16 additions & 20 deletions net/ipv4/netfilter/ipt_LOG.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,9 @@ ipt_log_packet(unsigned int pf,
}

static unsigned int
ipt_log_target(struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
unsigned int hooknum,
const struct xt_target *target,
const void *targinfo)
log_tg(struct sk_buff *skb, const struct net_device *in,
const struct net_device *out, unsigned int hooknum,
const struct xt_target *target, const void *targinfo)
{
const struct ipt_log_info *loginfo = targinfo;
struct nf_loginfo li;
Expand All @@ -437,11 +434,10 @@ ipt_log_target(struct sk_buff *skb,
return XT_CONTINUE;
}

static bool ipt_log_checkentry(const char *tablename,
const void *e,
const struct xt_target *target,
void *targinfo,
unsigned int hook_mask)
static bool
log_tg_check(const char *tablename, const void *e,
const struct xt_target *target, void *targinfo,
unsigned int hook_mask)
{
const struct ipt_log_info *loginfo = targinfo;

Expand All @@ -457,12 +453,12 @@ static bool ipt_log_checkentry(const char *tablename,
return true;
}

static struct xt_target ipt_log_reg __read_mostly = {
static struct xt_target log_tg_reg __read_mostly = {
.name = "LOG",
.family = AF_INET,
.target = ipt_log_target,
.target = log_tg,
.targetsize = sizeof(struct ipt_log_info),
.checkentry = ipt_log_checkentry,
.checkentry = log_tg_check,
.me = THIS_MODULE,
};

Expand All @@ -472,22 +468,22 @@ static struct nf_logger ipt_log_logger ={
.me = THIS_MODULE,
};

static int __init ipt_log_init(void)
static int __init log_tg_init(void)
{
int ret;

ret = xt_register_target(&ipt_log_reg);
ret = xt_register_target(&log_tg_reg);
if (ret < 0)
return ret;
nf_log_register(PF_INET, &ipt_log_logger);
return 0;
}

static void __exit ipt_log_fini(void)
static void __exit log_tg_exit(void)
{
nf_log_unregister(&ipt_log_logger);
xt_unregister_target(&ipt_log_reg);
xt_unregister_target(&log_tg_reg);
}

module_init(ipt_log_init);
module_exit(ipt_log_fini);
module_init(log_tg_init);
module_exit(log_tg_exit);
35 changes: 15 additions & 20 deletions net/ipv4/netfilter/ipt_MASQUERADE.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ static DEFINE_RWLOCK(masq_lock);

/* FIXME: Multiple targets. --RR */
static bool
masquerade_check(const char *tablename,
const void *e,
const struct xt_target *target,
void *targinfo,
unsigned int hook_mask)
masquerade_tg_check(const char *tablename, const void *e,
const struct xt_target *target, void *targinfo,
unsigned int hook_mask)
{
const struct nf_nat_multi_range_compat *mr = targinfo;

Expand All @@ -52,12 +50,9 @@ masquerade_check(const char *tablename,
}

static unsigned int
masquerade_target(struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
unsigned int hooknum,
const struct xt_target *target,
const void *targinfo)
masquerade_tg(struct sk_buff *skb, const struct net_device *in,
const struct net_device *out, unsigned int hooknum,
const struct xt_target *target, const void *targinfo)
{
struct nf_conn *ct;
struct nf_conn_nat *nat;
Expand Down Expand Up @@ -166,22 +161,22 @@ static struct notifier_block masq_inet_notifier = {
.notifier_call = masq_inet_event,
};

static struct xt_target masquerade __read_mostly = {
static struct xt_target masquerade_tg_reg __read_mostly = {
.name = "MASQUERADE",
.family = AF_INET,
.target = masquerade_target,
.target = masquerade_tg,
.targetsize = sizeof(struct nf_nat_multi_range_compat),
.table = "nat",
.hooks = 1 << NF_INET_POST_ROUTING,
.checkentry = masquerade_check,
.checkentry = masquerade_tg_check,
.me = THIS_MODULE,
};

static int __init ipt_masquerade_init(void)
static int __init masquerade_tg_init(void)
{
int ret;

ret = xt_register_target(&masquerade);
ret = xt_register_target(&masquerade_tg_reg);

if (ret == 0) {
/* Register for device down reports */
Expand All @@ -193,12 +188,12 @@ static int __init ipt_masquerade_init(void)
return ret;
}

static void __exit ipt_masquerade_fini(void)
static void __exit masquerade_tg_exit(void)
{
xt_unregister_target(&masquerade);
xt_unregister_target(&masquerade_tg_reg);
unregister_netdevice_notifier(&masq_dev_notifier);
unregister_inetaddr_notifier(&masq_inet_notifier);
}

module_init(ipt_masquerade_init);
module_exit(ipt_masquerade_fini);
module_init(masquerade_tg_init);
module_exit(masquerade_tg_exit);
35 changes: 15 additions & 20 deletions net/ipv4/netfilter/ipt_NETMAP.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ MODULE_AUTHOR("Svenning Soerensen <[email protected]>");
MODULE_DESCRIPTION("iptables 1:1 NAT mapping of IP networks target");

static bool
check(const char *tablename,
const void *e,
const struct xt_target *target,
void *targinfo,
unsigned int hook_mask)
netmap_tg_check(const char *tablename, const void *e,
const struct xt_target *target, void *targinfo,
unsigned int hook_mask)
{
const struct nf_nat_multi_range_compat *mr = targinfo;

Expand All @@ -43,12 +41,9 @@ check(const char *tablename,
}

static unsigned int
target(struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
unsigned int hooknum,
const struct xt_target *target,
const void *targinfo)
netmap_tg(struct sk_buff *skb, const struct net_device *in,
const struct net_device *out, unsigned int hooknum,
const struct xt_target *target, const void *targinfo)
{
struct nf_conn *ct;
enum ip_conntrack_info ctinfo;
Expand Down Expand Up @@ -78,28 +73,28 @@ target(struct sk_buff *skb,
return nf_nat_setup_info(ct, &newrange, hooknum);
}

static struct xt_target target_module __read_mostly = {
static struct xt_target netmap_tg_reg __read_mostly = {
.name = "NETMAP",
.family = AF_INET,
.target = target,
.target = netmap_tg,
.targetsize = sizeof(struct nf_nat_multi_range_compat),
.table = "nat",
.hooks = (1 << NF_INET_PRE_ROUTING) |
(1 << NF_INET_POST_ROUTING) |
(1 << NF_INET_LOCAL_OUT),
.checkentry = check,
.checkentry = netmap_tg_check,
.me = THIS_MODULE
};

static int __init ipt_netmap_init(void)
static int __init netmap_tg_init(void)
{
return xt_register_target(&target_module);
return xt_register_target(&netmap_tg_reg);
}

static void __exit ipt_netmap_fini(void)
static void __exit netmap_tg_exit(void)
{
xt_unregister_target(&target_module);
xt_unregister_target(&netmap_tg_reg);
}

module_init(ipt_netmap_init);
module_exit(ipt_netmap_fini);
module_init(netmap_tg_init);
module_exit(netmap_tg_exit);
Loading

0 comments on commit d3c5ee6

Please sign in to comment.