[NETFILTER]: nf_conntrack_expect: function naming unification
Currently there is a wild mix of nf_conntrack_expect_, nf_ct_exp_, expect_, exp_, ... Consistently use nf_ct_ as prefix for exported functions. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
53aba5979e
commit
6823645d60
@@ -209,7 +209,7 @@ static const struct file_operations ct_file_ops = {
|
||||
/* expects */
|
||||
static void *exp_seq_start(struct seq_file *s, loff_t *pos)
|
||||
{
|
||||
struct list_head *e = &nf_conntrack_expect_list;
|
||||
struct list_head *e = &nf_ct_expect_list;
|
||||
loff_t i;
|
||||
|
||||
/* strange seq_file api calls stop even if we fail,
|
||||
@@ -221,7 +221,7 @@ static void *exp_seq_start(struct seq_file *s, loff_t *pos)
|
||||
|
||||
for (i = 0; i <= *pos; i++) {
|
||||
e = e->next;
|
||||
if (e == &nf_conntrack_expect_list)
|
||||
if (e == &nf_ct_expect_list)
|
||||
return NULL;
|
||||
}
|
||||
return e;
|
||||
@@ -234,7 +234,7 @@ static void *exp_seq_next(struct seq_file *s, void *v, loff_t *pos)
|
||||
++*pos;
|
||||
e = e->next;
|
||||
|
||||
if (e == &nf_conntrack_expect_list)
|
||||
if (e == &nf_ct_expect_list)
|
||||
return NULL;
|
||||
|
||||
return e;
|
||||
|
@@ -45,7 +45,7 @@ static unsigned int help(struct sk_buff **pskb,
|
||||
/* Try to get same port: if not, try to change it. */
|
||||
for (port = ntohs(exp->saved_proto.tcp.port); port != 0; port++) {
|
||||
exp->tuple.dst.u.tcp.port = htons(port);
|
||||
if (nf_conntrack_expect_related(exp) == 0)
|
||||
if (nf_ct_expect_related(exp) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ static unsigned int help(struct sk_buff **pskb,
|
||||
matchoff, matchlen,
|
||||
buffer, strlen(buffer));
|
||||
if (ret != NF_ACCEPT)
|
||||
nf_conntrack_unexpect_related(exp);
|
||||
nf_ct_unexpect_related(exp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -131,7 +131,7 @@ static unsigned int nf_nat_ftp(struct sk_buff **pskb,
|
||||
/* Try to get same port: if not, try to change it. */
|
||||
for (port = ntohs(exp->saved_proto.tcp.port); port != 0; port++) {
|
||||
exp->tuple.dst.u.tcp.port = htons(port);
|
||||
if (nf_conntrack_expect_related(exp) == 0)
|
||||
if (nf_ct_expect_related(exp) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ static unsigned int nf_nat_ftp(struct sk_buff **pskb,
|
||||
return NF_DROP;
|
||||
|
||||
if (!mangle[type](pskb, newip, port, matchoff, matchlen, ct, ctinfo)) {
|
||||
nf_conntrack_unexpect_related(exp);
|
||||
nf_ct_unexpect_related(exp);
|
||||
return NF_DROP;
|
||||
}
|
||||
return NF_ACCEPT;
|
||||
|
@@ -237,12 +237,12 @@ static int nat_rtp_rtcp(struct sk_buff **pskb, struct nf_conn *ct,
|
||||
for (nated_port = ntohs(rtp_exp->tuple.dst.u.udp.port);
|
||||
nated_port != 0; nated_port += 2) {
|
||||
rtp_exp->tuple.dst.u.udp.port = htons(nated_port);
|
||||
if (nf_conntrack_expect_related(rtp_exp) == 0) {
|
||||
if (nf_ct_expect_related(rtp_exp) == 0) {
|
||||
rtcp_exp->tuple.dst.u.udp.port =
|
||||
htons(nated_port + 1);
|
||||
if (nf_conntrack_expect_related(rtcp_exp) == 0)
|
||||
if (nf_ct_expect_related(rtcp_exp) == 0)
|
||||
break;
|
||||
nf_conntrack_unexpect_related(rtp_exp);
|
||||
nf_ct_unexpect_related(rtp_exp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,8 +261,8 @@ static int nat_rtp_rtcp(struct sk_buff **pskb, struct nf_conn *ct,
|
||||
info->rtp_port[i][dir] = rtp_port;
|
||||
info->rtp_port[i][!dir] = htons(nated_port);
|
||||
} else {
|
||||
nf_conntrack_unexpect_related(rtp_exp);
|
||||
nf_conntrack_unexpect_related(rtcp_exp);
|
||||
nf_ct_unexpect_related(rtp_exp);
|
||||
nf_ct_unexpect_related(rtcp_exp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ static int nat_t120(struct sk_buff **pskb, struct nf_conn *ct,
|
||||
/* Try to get same port: if not, try to change it. */
|
||||
for (; nated_port != 0; nated_port++) {
|
||||
exp->tuple.dst.u.tcp.port = htons(nated_port);
|
||||
if (nf_conntrack_expect_related(exp) == 0)
|
||||
if (nf_ct_expect_related(exp) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ static int nat_t120(struct sk_buff **pskb, struct nf_conn *ct,
|
||||
if (set_h245_addr(pskb, data, dataoff, taddr,
|
||||
&ct->tuplehash[!dir].tuple.dst.u3,
|
||||
htons(nated_port)) < 0) {
|
||||
nf_conntrack_unexpect_related(exp);
|
||||
nf_ct_unexpect_related(exp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ static int nat_h245(struct sk_buff **pskb, struct nf_conn *ct,
|
||||
/* Try to get same port: if not, try to change it. */
|
||||
for (; nated_port != 0; nated_port++) {
|
||||
exp->tuple.dst.u.tcp.port = htons(nated_port);
|
||||
if (nf_conntrack_expect_related(exp) == 0)
|
||||
if (nf_ct_expect_related(exp) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ static int nat_h245(struct sk_buff **pskb, struct nf_conn *ct,
|
||||
info->sig_port[dir] = port;
|
||||
info->sig_port[!dir] = htons(nated_port);
|
||||
} else {
|
||||
nf_conntrack_unexpect_related(exp);
|
||||
nf_ct_unexpect_related(exp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ static int nat_q931(struct sk_buff **pskb, struct nf_conn *ct,
|
||||
/* Try to get same port: if not, try to change it. */
|
||||
for (; nated_port != 0; nated_port++) {
|
||||
exp->tuple.dst.u.tcp.port = htons(nated_port);
|
||||
if (nf_conntrack_expect_related(exp) == 0)
|
||||
if (nf_ct_expect_related(exp) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ static int nat_q931(struct sk_buff **pskb, struct nf_conn *ct,
|
||||
info->sig_port[!dir]);
|
||||
}
|
||||
} else {
|
||||
nf_conntrack_unexpect_related(exp);
|
||||
nf_ct_unexpect_related(exp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@ static int nat_callforwarding(struct sk_buff **pskb, struct nf_conn *ct,
|
||||
/* Try to get same port: if not, try to change it. */
|
||||
for (nated_port = ntohs(port); nated_port != 0; nated_port++) {
|
||||
exp->tuple.dst.u.tcp.port = htons(nated_port);
|
||||
if (nf_conntrack_expect_related(exp) == 0)
|
||||
if (nf_ct_expect_related(exp) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -531,7 +531,7 @@ static int nat_callforwarding(struct sk_buff **pskb, struct nf_conn *ct,
|
||||
if (!set_h225_addr(pskb, data, dataoff, taddr,
|
||||
&ct->tuplehash[!dir].tuple.dst.u3,
|
||||
htons(nated_port)) == 0) {
|
||||
nf_conntrack_unexpect_related(exp);
|
||||
nf_ct_unexpect_related(exp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@@ -55,7 +55,7 @@ static unsigned int help(struct sk_buff **pskb,
|
||||
/* Try to get same port: if not, try to change it. */
|
||||
for (port = ntohs(exp->saved_proto.tcp.port); port != 0; port++) {
|
||||
exp->tuple.dst.u.tcp.port = htons(port);
|
||||
if (nf_conntrack_expect_related(exp) == 0)
|
||||
if (nf_ct_expect_related(exp) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ static unsigned int help(struct sk_buff **pskb,
|
||||
matchoff, matchlen, buffer,
|
||||
strlen(buffer));
|
||||
if (ret != NF_ACCEPT)
|
||||
nf_conntrack_unexpect_related(exp);
|
||||
nf_ct_unexpect_related(exp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -81,10 +81,10 @@ static void pptp_nat_expected(struct nf_conn *ct,
|
||||
|
||||
DEBUGP("trying to unexpect other dir: ");
|
||||
NF_CT_DUMP_TUPLE(&t);
|
||||
other_exp = nf_conntrack_expect_find_get(&t);
|
||||
other_exp = nf_ct_expect_find_get(&t);
|
||||
if (other_exp) {
|
||||
nf_conntrack_unexpect_related(other_exp);
|
||||
nf_conntrack_expect_put(other_exp);
|
||||
nf_ct_unexpect_related(other_exp);
|
||||
nf_ct_expect_put(other_exp);
|
||||
DEBUGP("success\n");
|
||||
} else {
|
||||
DEBUGP("not found!\n");
|
||||
|
@@ -278,7 +278,7 @@ static unsigned int ip_nat_sdp(struct sk_buff **pskb,
|
||||
/* Try to get same port: if not, try to change it. */
|
||||
for (port = ntohs(exp->saved_proto.udp.port); port != 0; port++) {
|
||||
exp->tuple.dst.u.udp.port = htons(port);
|
||||
if (nf_conntrack_expect_related(exp) == 0)
|
||||
if (nf_ct_expect_related(exp) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ static unsigned int ip_nat_sdp(struct sk_buff **pskb,
|
||||
return NF_DROP;
|
||||
|
||||
if (!mangle_sdp(pskb, ctinfo, ct, newip, port, dptr)) {
|
||||
nf_conntrack_unexpect_related(exp);
|
||||
nf_ct_unexpect_related(exp);
|
||||
return NF_DROP;
|
||||
}
|
||||
return NF_ACCEPT;
|
||||
|
@@ -30,7 +30,7 @@ static unsigned int help(struct sk_buff **pskb,
|
||||
= ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u.udp.port;
|
||||
exp->dir = IP_CT_DIR_REPLY;
|
||||
exp->expectfn = nf_nat_follow_master;
|
||||
if (nf_conntrack_expect_related(exp) != 0)
|
||||
if (nf_ct_expect_related(exp) != 0)
|
||||
return NF_DROP;
|
||||
return NF_ACCEPT;
|
||||
}
|
||||
|
Reference in New Issue
Block a user