Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3c5ee6d authored by Jan Engelhardt's avatar Jan Engelhardt Committed by David S. Miller
Browse files

[NETFILTER]: x_tables: consistent and unique symbol names



Give all Netfilter modules consistent and unique symbol names.

Signed-off-by: default avatarJan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4c610979
Loading
Loading
Loading
Loading
+18 −23
Original line number Diff line number Diff line
@@ -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;
@@ -359,10 +356,8 @@ target(struct sk_buff *skb,
}

static bool
checkentry(const char *tablename,
	   const void *e_void,
	   const struct xt_target *target,
	   void *targinfo,
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;
@@ -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;

@@ -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),
@@ -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;

@@ -742,11 +737,11 @@ 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);
@@ -754,8 +749,8 @@ static void __exit ipt_clusterip_fini(void)
	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);
+15 −20
Original line number Diff line number Diff line
@@ -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;

@@ -99,10 +96,8 @@ target(struct sk_buff *skb,
}

static bool
checkentry(const char *tablename,
	   const void *e_void,
	   const struct xt_target *target,
	   void *targinfo,
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;
@@ -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);
+16 −20
Original line number Diff line number Diff line
@@ -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;
@@ -437,10 +434,9 @@ 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,
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;
@@ -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,
};

@@ -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);
+15 −20
Original line number Diff line number Diff line
@@ -32,10 +32,8 @@ 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,
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;
@@ -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;
@@ -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 */
@@ -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);
+15 −20
Original line number Diff line number Diff line
@@ -23,10 +23,8 @@ MODULE_AUTHOR("Svenning Soerensen <svenning@post5.tele.dk>");
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,
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;
@@ -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;
@@ -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