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

Commit 6823645d authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[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: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 53aba597
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -84,7 +84,7 @@ print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple,
	    struct nf_conntrack_l4proto *proto);
	    struct nf_conntrack_l4proto *proto);


extern struct hlist_head *nf_conntrack_hash;
extern struct hlist_head *nf_conntrack_hash;
extern struct list_head nf_conntrack_expect_list;
extern struct list_head nf_ct_expect_list;
extern rwlock_t nf_conntrack_lock ;
extern rwlock_t nf_conntrack_lock ;
extern struct hlist_head unconfirmed;
extern struct hlist_head unconfirmed;


+8 −9
Original line number Original line Diff line number Diff line
@@ -49,15 +49,15 @@ static inline void nf_conntrack_event(enum ip_conntrack_events event,
		atomic_notifier_call_chain(&nf_conntrack_chain, event, ct);
		atomic_notifier_call_chain(&nf_conntrack_chain, event, ct);
}
}


extern struct atomic_notifier_head nf_conntrack_expect_chain;
extern struct atomic_notifier_head nf_ct_expect_chain;
extern int nf_conntrack_expect_register_notifier(struct notifier_block *nb);
extern int nf_ct_expect_register_notifier(struct notifier_block *nb);
extern int nf_conntrack_expect_unregister_notifier(struct notifier_block *nb);
extern int nf_ct_expect_unregister_notifier(struct notifier_block *nb);


static inline void
static inline void
nf_conntrack_expect_event(enum ip_conntrack_expect_events event,
nf_ct_expect_event(enum ip_conntrack_expect_events event,
		   struct nf_conntrack_expect *exp)
		   struct nf_conntrack_expect *exp)
{
{
	atomic_notifier_call_chain(&nf_conntrack_expect_chain, event, exp);
	atomic_notifier_call_chain(&nf_ct_expect_chain, event, exp);
}
}


#else /* CONFIG_NF_CONNTRACK_EVENTS */
#else /* CONFIG_NF_CONNTRACK_EVENTS */
@@ -67,8 +67,7 @@ static inline void nf_conntrack_event_cache(enum ip_conntrack_events event,
static inline void nf_conntrack_event(enum ip_conntrack_events event,
static inline void nf_conntrack_event(enum ip_conntrack_events event,
				      struct nf_conn *ct) {}
				      struct nf_conn *ct) {}
static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {}
static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {}
static inline void
static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event,
nf_conntrack_expect_event(enum ip_conntrack_expect_events event,
				      struct nf_conntrack_expect *exp) {}
				      struct nf_conntrack_expect *exp) {}
static inline void nf_ct_event_cache_flush(void) {}
static inline void nf_ct_event_cache_flush(void) {}
#endif /* CONFIG_NF_CONNTRACK_EVENTS */
#endif /* CONFIG_NF_CONNTRACK_EVENTS */
+14 −14
Original line number Original line Diff line number Diff line
@@ -6,8 +6,8 @@
#define _NF_CONNTRACK_EXPECT_H
#define _NF_CONNTRACK_EXPECT_H
#include <net/netfilter/nf_conntrack.h>
#include <net/netfilter/nf_conntrack.h>


extern struct list_head nf_conntrack_expect_list;
extern struct list_head nf_ct_expect_list;
extern struct kmem_cache *nf_conntrack_expect_cachep;
extern struct kmem_cache *nf_ct_expect_cachep;
extern const struct file_operations exp_file_ops;
extern const struct file_operations exp_file_ops;


struct nf_conntrack_expect
struct nf_conntrack_expect
@@ -54,27 +54,27 @@ struct nf_conntrack_expect




struct nf_conntrack_expect *
struct nf_conntrack_expect *
__nf_conntrack_expect_find(const struct nf_conntrack_tuple *tuple);
__nf_ct_expect_find(const struct nf_conntrack_tuple *tuple);


struct nf_conntrack_expect *
struct nf_conntrack_expect *
nf_conntrack_expect_find_get(const struct nf_conntrack_tuple *tuple);
nf_ct_expect_find_get(const struct nf_conntrack_tuple *tuple);


struct nf_conntrack_expect *
struct nf_conntrack_expect *
find_expectation(const struct nf_conntrack_tuple *tuple);
nf_ct_find_expectation(const struct nf_conntrack_tuple *tuple);


void nf_ct_unlink_expect(struct nf_conntrack_expect *exp);
void nf_ct_unlink_expect(struct nf_conntrack_expect *exp);
void nf_ct_remove_expectations(struct nf_conn *ct);
void nf_ct_remove_expectations(struct nf_conn *ct);
void nf_conntrack_unexpect_related(struct nf_conntrack_expect *exp);
void nf_ct_unexpect_related(struct nf_conntrack_expect *exp);


/* Allocate space for an expectation: this is mandatory before calling
/* Allocate space for an expectation: this is mandatory before calling
   nf_conntrack_expect_related.  You will have to call put afterwards. */
   nf_ct_expect_related.  You will have to call put afterwards. */
struct nf_conntrack_expect *nf_conntrack_expect_alloc(struct nf_conn *me);
struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me);
void nf_conntrack_expect_init(struct nf_conntrack_expect *, int,
void nf_ct_expect_init(struct nf_conntrack_expect *, int,
		       union nf_conntrack_address *,
		       union nf_conntrack_address *,
		       union nf_conntrack_address *,
		       union nf_conntrack_address *,
		       u_int8_t, __be16 *, __be16 *);
		       u_int8_t, __be16 *, __be16 *);
void nf_conntrack_expect_put(struct nf_conntrack_expect *exp);
void nf_ct_expect_put(struct nf_conntrack_expect *exp);
int nf_conntrack_expect_related(struct nf_conntrack_expect *expect);
int nf_ct_expect_related(struct nf_conntrack_expect *expect);


#endif /*_NF_CONNTRACK_EXPECT_H*/
#endif /*_NF_CONNTRACK_EXPECT_H*/
+3 −3
Original line number Original line Diff line number Diff line
@@ -209,7 +209,7 @@ static const struct file_operations ct_file_ops = {
/* expects */
/* expects */
static void *exp_seq_start(struct seq_file *s, loff_t *pos)
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;
	loff_t i;


	/* strange seq_file api calls stop even if we fail,
	/* 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++) {
	for (i = 0; i <= *pos; i++) {
		e = e->next;
		e = e->next;
		if (e == &nf_conntrack_expect_list)
		if (e == &nf_ct_expect_list)
			return NULL;
			return NULL;
	}
	}
	return e;
	return e;
@@ -234,7 +234,7 @@ static void *exp_seq_next(struct seq_file *s, void *v, loff_t *pos)
	++*pos;
	++*pos;
	e = e->next;
	e = e->next;


	if (e == &nf_conntrack_expect_list)
	if (e == &nf_ct_expect_list)
		return NULL;
		return NULL;


	return e;
	return e;
+2 −2
Original line number Original line Diff line number Diff line
@@ -45,7 +45,7 @@ static unsigned int help(struct sk_buff **pskb,
	/* Try to get same port: if not, try to change it. */
	/* Try to get same port: if not, try to change it. */
	for (port = ntohs(exp->saved_proto.tcp.port); port != 0; port++) {
	for (port = ntohs(exp->saved_proto.tcp.port); port != 0; port++) {
		exp->tuple.dst.u.tcp.port = htons(port);
		exp->tuple.dst.u.tcp.port = htons(port);
		if (nf_conntrack_expect_related(exp) == 0)
		if (nf_ct_expect_related(exp) == 0)
			break;
			break;
	}
	}


@@ -57,7 +57,7 @@ static unsigned int help(struct sk_buff **pskb,
				       matchoff, matchlen,
				       matchoff, matchlen,
				       buffer, strlen(buffer));
				       buffer, strlen(buffer));
	if (ret != NF_ACCEPT)
	if (ret != NF_ACCEPT)
		nf_conntrack_unexpect_related(exp);
		nf_ct_unexpect_related(exp);
	return ret;
	return ret;
}
}


Loading