Skip to content

Commit d3c5ee6

Browse files
Jan Engelhardtdavem330
authored andcommitted
[NETFILTER]: x_tables: consistent and unique symbol names
Give all Netfilter modules consistent and unique symbol names. Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 4c61097 commit d3c5ee6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1262
-1593
lines changed

net/ipv4/netfilter/ipt_CLUSTERIP.c

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,9 @@ clusterip_responsible(const struct clusterip_config *config, u_int32_t hash)
287287
***********************************************************************/
288288

289289
static unsigned int
290-
target(struct sk_buff *skb,
291-
const struct net_device *in,
292-
const struct net_device *out,
293-
unsigned int hooknum,
294-
const struct xt_target *target,
295-
const void *targinfo)
290+
clusterip_tg(struct sk_buff *skb, const struct net_device *in,
291+
const struct net_device *out, unsigned int hooknum,
292+
const struct xt_target *target, const void *targinfo)
296293
{
297294
const struct ipt_clusterip_tgt_info *cipinfo = targinfo;
298295
struct nf_conn *ct;
@@ -359,11 +356,9 @@ target(struct sk_buff *skb,
359356
}
360357

361358
static bool
362-
checkentry(const char *tablename,
363-
const void *e_void,
364-
const struct xt_target *target,
365-
void *targinfo,
366-
unsigned int hook_mask)
359+
clusterip_tg_check(const char *tablename, const void *e_void,
360+
const struct xt_target *target, void *targinfo,
361+
unsigned int hook_mask)
367362
{
368363
struct ipt_clusterip_tgt_info *cipinfo = targinfo;
369364
const struct ipt_entry *e = e_void;
@@ -427,7 +422,7 @@ checkentry(const char *tablename,
427422
}
428423

429424
/* drop reference count of cluster config when rule is deleted */
430-
static void destroy(const struct xt_target *target, void *targinfo)
425+
static void clusterip_tg_destroy(const struct xt_target *target, void *targinfo)
431426
{
432427
struct ipt_clusterip_tgt_info *cipinfo = targinfo;
433428

@@ -454,12 +449,12 @@ struct compat_ipt_clusterip_tgt_info
454449
};
455450
#endif /* CONFIG_COMPAT */
456451

457-
static struct xt_target clusterip_tgt __read_mostly = {
452+
static struct xt_target clusterip_tg_reg __read_mostly = {
458453
.name = "CLUSTERIP",
459454
.family = AF_INET,
460-
.target = target,
461-
.checkentry = checkentry,
462-
.destroy = destroy,
455+
.target = clusterip_tg,
456+
.checkentry = clusterip_tg_check,
457+
.destroy = clusterip_tg_destroy,
463458
.targetsize = sizeof(struct ipt_clusterip_tgt_info),
464459
#ifdef CONFIG_COMPAT
465460
.compatsize = sizeof(struct compat_ipt_clusterip_tgt_info),
@@ -712,11 +707,11 @@ static const struct file_operations clusterip_proc_fops = {
712707

713708
#endif /* CONFIG_PROC_FS */
714709

715-
static int __init ipt_clusterip_init(void)
710+
static int __init clusterip_tg_init(void)
716711
{
717712
int ret;
718713

719-
ret = xt_register_target(&clusterip_tgt);
714+
ret = xt_register_target(&clusterip_tg_reg);
720715
if (ret < 0)
721716
return ret;
722717

@@ -742,20 +737,20 @@ static int __init ipt_clusterip_init(void)
742737
nf_unregister_hook(&cip_arp_ops);
743738
#endif /* CONFIG_PROC_FS */
744739
cleanup_target:
745-
xt_unregister_target(&clusterip_tgt);
740+
xt_unregister_target(&clusterip_tg_reg);
746741
return ret;
747742
}
748743

749-
static void __exit ipt_clusterip_fini(void)
744+
static void __exit clusterip_tg_exit(void)
750745
{
751746
printk(KERN_NOTICE "ClusterIP Version %s unloading\n",
752747
CLUSTERIP_VERSION);
753748
#ifdef CONFIG_PROC_FS
754749
remove_proc_entry(clusterip_procdir->name, clusterip_procdir->parent);
755750
#endif
756751
nf_unregister_hook(&cip_arp_ops);
757-
xt_unregister_target(&clusterip_tgt);
752+
xt_unregister_target(&clusterip_tg_reg);
758753
}
759754

760-
module_init(ipt_clusterip_init);
761-
module_exit(ipt_clusterip_fini);
755+
module_init(clusterip_tg_init);
756+
module_exit(clusterip_tg_exit);

net/ipv4/netfilter/ipt_ECN.c

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,9 @@ set_ect_tcp(struct sk_buff *skb, const struct ipt_ECN_info *einfo)
7777
}
7878

7979
static unsigned int
80-
target(struct sk_buff *skb,
81-
const struct net_device *in,
82-
const struct net_device *out,
83-
unsigned int hooknum,
84-
const struct xt_target *target,
85-
const void *targinfo)
80+
ecn_tg(struct sk_buff *skb, const struct net_device *in,
81+
const struct net_device *out, unsigned int hooknum,
82+
const struct xt_target *target, const void *targinfo)
8683
{
8784
const struct ipt_ECN_info *einfo = targinfo;
8885

@@ -99,11 +96,9 @@ target(struct sk_buff *skb,
9996
}
10097

10198
static bool
102-
checkentry(const char *tablename,
103-
const void *e_void,
104-
const struct xt_target *target,
105-
void *targinfo,
106-
unsigned int hook_mask)
99+
ecn_tg_check(const char *tablename, const void *e_void,
100+
const struct xt_target *target, void *targinfo,
101+
unsigned int hook_mask)
107102
{
108103
const struct ipt_ECN_info *einfo = (struct ipt_ECN_info *)targinfo;
109104
const struct ipt_entry *e = e_void;
@@ -127,25 +122,25 @@ checkentry(const char *tablename,
127122
return true;
128123
}
129124

130-
static struct xt_target ipt_ecn_reg __read_mostly = {
125+
static struct xt_target ecn_tg_reg __read_mostly = {
131126
.name = "ECN",
132127
.family = AF_INET,
133-
.target = target,
128+
.target = ecn_tg,
134129
.targetsize = sizeof(struct ipt_ECN_info),
135130
.table = "mangle",
136-
.checkentry = checkentry,
131+
.checkentry = ecn_tg_check,
137132
.me = THIS_MODULE,
138133
};
139134

140-
static int __init ipt_ecn_init(void)
135+
static int __init ecn_tg_init(void)
141136
{
142-
return xt_register_target(&ipt_ecn_reg);
137+
return xt_register_target(&ecn_tg_reg);
143138
}
144139

145-
static void __exit ipt_ecn_fini(void)
140+
static void __exit ecn_tg_exit(void)
146141
{
147-
xt_unregister_target(&ipt_ecn_reg);
142+
xt_unregister_target(&ecn_tg_reg);
148143
}
149144

150-
module_init(ipt_ecn_init);
151-
module_exit(ipt_ecn_fini);
145+
module_init(ecn_tg_init);
146+
module_exit(ecn_tg_exit);

net/ipv4/netfilter/ipt_LOG.c

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -418,12 +418,9 @@ ipt_log_packet(unsigned int pf,
418418
}
419419

420420
static unsigned int
421-
ipt_log_target(struct sk_buff *skb,
422-
const struct net_device *in,
423-
const struct net_device *out,
424-
unsigned int hooknum,
425-
const struct xt_target *target,
426-
const void *targinfo)
421+
log_tg(struct sk_buff *skb, const struct net_device *in,
422+
const struct net_device *out, unsigned int hooknum,
423+
const struct xt_target *target, const void *targinfo)
427424
{
428425
const struct ipt_log_info *loginfo = targinfo;
429426
struct nf_loginfo li;
@@ -437,11 +434,10 @@ ipt_log_target(struct sk_buff *skb,
437434
return XT_CONTINUE;
438435
}
439436

440-
static bool ipt_log_checkentry(const char *tablename,
441-
const void *e,
442-
const struct xt_target *target,
443-
void *targinfo,
444-
unsigned int hook_mask)
437+
static bool
438+
log_tg_check(const char *tablename, const void *e,
439+
const struct xt_target *target, void *targinfo,
440+
unsigned int hook_mask)
445441
{
446442
const struct ipt_log_info *loginfo = targinfo;
447443

@@ -457,12 +453,12 @@ static bool ipt_log_checkentry(const char *tablename,
457453
return true;
458454
}
459455

460-
static struct xt_target ipt_log_reg __read_mostly = {
456+
static struct xt_target log_tg_reg __read_mostly = {
461457
.name = "LOG",
462458
.family = AF_INET,
463-
.target = ipt_log_target,
459+
.target = log_tg,
464460
.targetsize = sizeof(struct ipt_log_info),
465-
.checkentry = ipt_log_checkentry,
461+
.checkentry = log_tg_check,
466462
.me = THIS_MODULE,
467463
};
468464

@@ -472,22 +468,22 @@ static struct nf_logger ipt_log_logger ={
472468
.me = THIS_MODULE,
473469
};
474470

475-
static int __init ipt_log_init(void)
471+
static int __init log_tg_init(void)
476472
{
477473
int ret;
478474

479-
ret = xt_register_target(&ipt_log_reg);
475+
ret = xt_register_target(&log_tg_reg);
480476
if (ret < 0)
481477
return ret;
482478
nf_log_register(PF_INET, &ipt_log_logger);
483479
return 0;
484480
}
485481

486-
static void __exit ipt_log_fini(void)
482+
static void __exit log_tg_exit(void)
487483
{
488484
nf_log_unregister(&ipt_log_logger);
489-
xt_unregister_target(&ipt_log_reg);
485+
xt_unregister_target(&log_tg_reg);
490486
}
491487

492-
module_init(ipt_log_init);
493-
module_exit(ipt_log_fini);
488+
module_init(log_tg_init);
489+
module_exit(log_tg_exit);

net/ipv4/netfilter/ipt_MASQUERADE.c

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@ static DEFINE_RWLOCK(masq_lock);
3232

3333
/* FIXME: Multiple targets. --RR */
3434
static bool
35-
masquerade_check(const char *tablename,
36-
const void *e,
37-
const struct xt_target *target,
38-
void *targinfo,
39-
unsigned int hook_mask)
35+
masquerade_tg_check(const char *tablename, const void *e,
36+
const struct xt_target *target, void *targinfo,
37+
unsigned int hook_mask)
4038
{
4139
const struct nf_nat_multi_range_compat *mr = targinfo;
4240

@@ -52,12 +50,9 @@ masquerade_check(const char *tablename,
5250
}
5351

5452
static unsigned int
55-
masquerade_target(struct sk_buff *skb,
56-
const struct net_device *in,
57-
const struct net_device *out,
58-
unsigned int hooknum,
59-
const struct xt_target *target,
60-
const void *targinfo)
53+
masquerade_tg(struct sk_buff *skb, const struct net_device *in,
54+
const struct net_device *out, unsigned int hooknum,
55+
const struct xt_target *target, const void *targinfo)
6156
{
6257
struct nf_conn *ct;
6358
struct nf_conn_nat *nat;
@@ -166,22 +161,22 @@ static struct notifier_block masq_inet_notifier = {
166161
.notifier_call = masq_inet_event,
167162
};
168163

169-
static struct xt_target masquerade __read_mostly = {
164+
static struct xt_target masquerade_tg_reg __read_mostly = {
170165
.name = "MASQUERADE",
171166
.family = AF_INET,
172-
.target = masquerade_target,
167+
.target = masquerade_tg,
173168
.targetsize = sizeof(struct nf_nat_multi_range_compat),
174169
.table = "nat",
175170
.hooks = 1 << NF_INET_POST_ROUTING,
176-
.checkentry = masquerade_check,
171+
.checkentry = masquerade_tg_check,
177172
.me = THIS_MODULE,
178173
};
179174

180-
static int __init ipt_masquerade_init(void)
175+
static int __init masquerade_tg_init(void)
181176
{
182177
int ret;
183178

184-
ret = xt_register_target(&masquerade);
179+
ret = xt_register_target(&masquerade_tg_reg);
185180

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

196-
static void __exit ipt_masquerade_fini(void)
191+
static void __exit masquerade_tg_exit(void)
197192
{
198-
xt_unregister_target(&masquerade);
193+
xt_unregister_target(&masquerade_tg_reg);
199194
unregister_netdevice_notifier(&masq_dev_notifier);
200195
unregister_inetaddr_notifier(&masq_inet_notifier);
201196
}
202197

203-
module_init(ipt_masquerade_init);
204-
module_exit(ipt_masquerade_fini);
198+
module_init(masquerade_tg_init);
199+
module_exit(masquerade_tg_exit);

net/ipv4/netfilter/ipt_NETMAP.c

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ MODULE_AUTHOR("Svenning Soerensen <svenning@post5.tele.dk>");
2323
MODULE_DESCRIPTION("iptables 1:1 NAT mapping of IP networks target");
2424

2525
static bool
26-
check(const char *tablename,
27-
const void *e,
28-
const struct xt_target *target,
29-
void *targinfo,
30-
unsigned int hook_mask)
26+
netmap_tg_check(const char *tablename, const void *e,
27+
const struct xt_target *target, void *targinfo,
28+
unsigned int hook_mask)
3129
{
3230
const struct nf_nat_multi_range_compat *mr = targinfo;
3331

@@ -43,12 +41,9 @@ check(const char *tablename,
4341
}
4442

4543
static unsigned int
46-
target(struct sk_buff *skb,
47-
const struct net_device *in,
48-
const struct net_device *out,
49-
unsigned int hooknum,
50-
const struct xt_target *target,
51-
const void *targinfo)
44+
netmap_tg(struct sk_buff *skb, const struct net_device *in,
45+
const struct net_device *out, unsigned int hooknum,
46+
const struct xt_target *target, const void *targinfo)
5247
{
5348
struct nf_conn *ct;
5449
enum ip_conntrack_info ctinfo;
@@ -78,28 +73,28 @@ target(struct sk_buff *skb,
7873
return nf_nat_setup_info(ct, &newrange, hooknum);
7974
}
8075

81-
static struct xt_target target_module __read_mostly = {
76+
static struct xt_target netmap_tg_reg __read_mostly = {
8277
.name = "NETMAP",
8378
.family = AF_INET,
84-
.target = target,
79+
.target = netmap_tg,
8580
.targetsize = sizeof(struct nf_nat_multi_range_compat),
8681
.table = "nat",
8782
.hooks = (1 << NF_INET_PRE_ROUTING) |
8883
(1 << NF_INET_POST_ROUTING) |
8984
(1 << NF_INET_LOCAL_OUT),
90-
.checkentry = check,
85+
.checkentry = netmap_tg_check,
9186
.me = THIS_MODULE
9287
};
9388

94-
static int __init ipt_netmap_init(void)
89+
static int __init netmap_tg_init(void)
9590
{
96-
return xt_register_target(&target_module);
91+
return xt_register_target(&netmap_tg_reg);
9792
}
9893

99-
static void __exit ipt_netmap_fini(void)
94+
static void __exit netmap_tg_exit(void)
10095
{
101-
xt_unregister_target(&target_module);
96+
xt_unregister_target(&netmap_tg_reg);
10297
}
10398

104-
module_init(ipt_netmap_init);
105-
module_exit(ipt_netmap_fini);
99+
module_init(netmap_tg_init);
100+
module_exit(netmap_tg_exit);

0 commit comments

Comments
 (0)