Commit 4e77be46 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

netfilter: Remove extern from function prototypes

There are a mix of function prototypes with and without extern
in the kernel sources.  Standardize on not using extern for
function prototypes.

Function prototypes don't need to be written with extern.
extern is assumed by the compiler.  Its use is as unnecessary as
using auto to declare automatic/local variables in a block.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0e418f94
...@@ -16,9 +16,9 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4; ...@@ -16,9 +16,9 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4;
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4; extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4;
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp; extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp;
extern int nf_conntrack_ipv4_compat_init(void); int nf_conntrack_ipv4_compat_init(void);
extern void nf_conntrack_ipv4_compat_fini(void); void nf_conntrack_ipv4_compat_fini(void);
extern void need_ipv4_conntrack(void); void need_ipv4_conntrack(void);
#endif /*_NF_CONNTRACK_IPV4_H*/ #endif /*_NF_CONNTRACK_IPV4_H*/
#ifndef _NF_DEFRAG_IPV4_H #ifndef _NF_DEFRAG_IPV4_H
#define _NF_DEFRAG_IPV4_H #define _NF_DEFRAG_IPV4_H
extern void nf_defrag_ipv4_enable(void); void nf_defrag_ipv4_enable(void);
#endif /* _NF_DEFRAG_IPV4_H */ #endif /* _NF_DEFRAG_IPV4_H */
#ifndef _NF_DEFRAG_IPV6_H #ifndef _NF_DEFRAG_IPV6_H
#define _NF_DEFRAG_IPV6_H #define _NF_DEFRAG_IPV6_H
extern void nf_defrag_ipv6_enable(void); void nf_defrag_ipv6_enable(void);
extern int nf_ct_frag6_init(void); int nf_ct_frag6_init(void);
extern void nf_ct_frag6_cleanup(void); void nf_ct_frag6_cleanup(void);
extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user); struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user);
extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb,
struct net_device *in, struct net_device *in, struct net_device *out,
struct net_device *out, int (*okfn)(struct sk_buff *));
int (*okfn)(struct sk_buff *));
struct inet_frags_ctl; struct inet_frags_ctl;
......
...@@ -139,15 +139,13 @@ static inline struct net *nf_ct_net(const struct nf_conn *ct) ...@@ -139,15 +139,13 @@ static inline struct net *nf_ct_net(const struct nf_conn *ct)
} }
/* Alter reply tuple (maybe alter helper). */ /* Alter reply tuple (maybe alter helper). */
extern void void nf_conntrack_alter_reply(struct nf_conn *ct,
nf_conntrack_alter_reply(struct nf_conn *ct, const struct nf_conntrack_tuple *newreply);
const struct nf_conntrack_tuple *newreply);
/* Is this tuple taken? (ignoring any belonging to the given /* Is this tuple taken? (ignoring any belonging to the given
conntrack). */ conntrack). */
extern int int nf_conntrack_tuple_taken(const struct nf_conntrack_tuple *tuple,
nf_conntrack_tuple_taken(const struct nf_conntrack_tuple *tuple, const struct nf_conn *ignored_conntrack);
const struct nf_conn *ignored_conntrack);
/* Return conntrack_info and tuple hash for given skb. */ /* Return conntrack_info and tuple hash for given skb. */
static inline struct nf_conn * static inline struct nf_conn *
...@@ -165,37 +163,34 @@ static inline void nf_ct_put(struct nf_conn *ct) ...@@ -165,37 +163,34 @@ static inline void nf_ct_put(struct nf_conn *ct)
} }
/* Protocol module loading */ /* Protocol module loading */
extern int nf_ct_l3proto_try_module_get(unsigned short l3proto); int nf_ct_l3proto_try_module_get(unsigned short l3proto);
extern void nf_ct_l3proto_module_put(unsigned short l3proto); void nf_ct_l3proto_module_put(unsigned short l3proto);
/* /*
* Allocate a hashtable of hlist_head (if nulls == 0), * Allocate a hashtable of hlist_head (if nulls == 0),
* or hlist_nulls_head (if nulls == 1) * or hlist_nulls_head (if nulls == 1)
*/ */
extern void *nf_ct_alloc_hashtable(unsigned int *sizep, int nulls); void *nf_ct_alloc_hashtable(unsigned int *sizep, int nulls);
extern void nf_ct_free_hashtable(void *hash, unsigned int size); void nf_ct_free_hashtable(void *hash, unsigned int size);
extern struct nf_conntrack_tuple_hash * struct nf_conntrack_tuple_hash *
__nf_conntrack_find(struct net *net, u16 zone, __nf_conntrack_find(struct net *net, u16 zone,
const struct nf_conntrack_tuple *tuple); const struct nf_conntrack_tuple *tuple);
extern int nf_conntrack_hash_check_insert(struct nf_conn *ct); int nf_conntrack_hash_check_insert(struct nf_conn *ct);
bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report); bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report);
extern void nf_conntrack_flush_report(struct net *net, u32 portid, int report); void nf_conntrack_flush_report(struct net *net, u32 portid, int report);
extern bool nf_ct_get_tuplepr(const struct sk_buff *skb, bool nf_ct_get_tuplepr(const struct sk_buff *skb, unsigned int nhoff,
unsigned int nhoff, u_int16_t l3num, u_int16_t l3num, struct nf_conntrack_tuple *tuple);
struct nf_conntrack_tuple *tuple); bool nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse,
extern bool nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse, const struct nf_conntrack_tuple *orig);
const struct nf_conntrack_tuple *orig);
extern void __nf_ct_refresh_acct(struct nf_conn *ct, void __nf_ct_refresh_acct(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
enum ip_conntrack_info ctinfo, const struct sk_buff *skb,
const struct sk_buff *skb, unsigned long extra_jiffies, int do_acct);
unsigned long extra_jiffies,
int do_acct);
/* Refresh conntrack for this many jiffies and do accounting */ /* Refresh conntrack for this many jiffies and do accounting */
static inline void nf_ct_refresh_acct(struct nf_conn *ct, static inline void nf_ct_refresh_acct(struct nf_conn *ct,
...@@ -214,10 +209,8 @@ static inline void nf_ct_refresh(struct nf_conn *ct, ...@@ -214,10 +209,8 @@ static inline void nf_ct_refresh(struct nf_conn *ct,
__nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0); __nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0);
} }
extern bool __nf_ct_kill_acct(struct nf_conn *ct, bool __nf_ct_kill_acct(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
enum ip_conntrack_info ctinfo, const struct sk_buff *skb, int do_acct);
const struct sk_buff *skb,
int do_acct);
/* kill conntrack and do accounting */ /* kill conntrack and do accounting */
static inline bool nf_ct_kill_acct(struct nf_conn *ct, static inline bool nf_ct_kill_acct(struct nf_conn *ct,
...@@ -244,19 +237,17 @@ static inline struct nf_conn *nf_ct_untracked_get(void) ...@@ -244,19 +237,17 @@ static inline struct nf_conn *nf_ct_untracked_get(void)
{ {
return &__raw_get_cpu_var(nf_conntrack_untracked); return &__raw_get_cpu_var(nf_conntrack_untracked);
} }
extern void nf_ct_untracked_status_or(unsigned long bits); void nf_ct_untracked_status_or(unsigned long bits);
/* Iterate over all conntracks: if iter returns true, it's deleted. */ /* Iterate over all conntracks: if iter returns true, it's deleted. */
extern void void nf_ct_iterate_cleanup(struct net *net,
nf_ct_iterate_cleanup(struct net *net, int (*iter)(struct nf_conn *i, void *data),
int (*iter)(struct nf_conn *i, void *data), void *data, u32 portid, int report);
void *data, u32 portid, int report); void nf_conntrack_free(struct nf_conn *ct);
extern void nf_conntrack_free(struct nf_conn *ct); struct nf_conn *nf_conntrack_alloc(struct net *net, u16 zone,
extern struct nf_conn * const struct nf_conntrack_tuple *orig,
nf_conntrack_alloc(struct net *net, u16 zone, const struct nf_conntrack_tuple *repl,
const struct nf_conntrack_tuple *orig, gfp_t gfp);
const struct nf_conntrack_tuple *repl,
gfp_t gfp);
static inline int nf_ct_is_template(const struct nf_conn *ct) static inline int nf_ct_is_template(const struct nf_conn *ct)
{ {
...@@ -287,7 +278,7 @@ static inline bool nf_is_loopback_packet(const struct sk_buff *skb) ...@@ -287,7 +278,7 @@ static inline bool nf_is_loopback_packet(const struct sk_buff *skb)
struct kernel_param; struct kernel_param;
extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp);
extern unsigned int nf_conntrack_htable_size; extern unsigned int nf_conntrack_htable_size;
extern unsigned int nf_conntrack_max; extern unsigned int nf_conntrack_max;
extern unsigned int nf_conntrack_hash_rnd; extern unsigned int nf_conntrack_hash_rnd;
......
...@@ -42,8 +42,8 @@ struct nf_conn_counter *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp) ...@@ -42,8 +42,8 @@ struct nf_conn_counter *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp)
return acct; return acct;
}; };
extern unsigned int unsigned int seq_print_acct(struct seq_file *s, const struct nf_conn *ct,
seq_print_acct(struct seq_file *s, const struct nf_conn *ct, int dir); int dir);
/* Check if connection tracking accounting is enabled */ /* Check if connection tracking accounting is enabled */
static inline bool nf_ct_acct_enabled(struct net *net) static inline bool nf_ct_acct_enabled(struct net *net)
...@@ -57,9 +57,9 @@ static inline void nf_ct_set_acct(struct net *net, bool enable) ...@@ -57,9 +57,9 @@ static inline void nf_ct_set_acct(struct net *net, bool enable)
net->ct.sysctl_acct = enable; net->ct.sysctl_acct = enable;
} }
extern int nf_conntrack_acct_pernet_init(struct net *net); int nf_conntrack_acct_pernet_init(struct net *net);
extern void nf_conntrack_acct_pernet_fini(struct net *net); void nf_conntrack_acct_pernet_fini(struct net *net);
extern int nf_conntrack_acct_init(void); int nf_conntrack_acct_init(void);
extern void nf_conntrack_acct_fini(void); void nf_conntrack_acct_fini(void);
#endif /* _NF_CONNTRACK_ACCT_H */ #endif /* _NF_CONNTRACK_ACCT_H */
...@@ -20,49 +20,42 @@ ...@@ -20,49 +20,42 @@
/* This header is used to share core functionality between the /* This header is used to share core functionality between the
standalone connection tracking module, and the compatibility layer's use standalone connection tracking module, and the compatibility layer's use
of connection tracking. */ of connection tracking. */
extern unsigned int nf_conntrack_in(struct net *net, unsigned int nf_conntrack_in(struct net *net, u_int8_t pf, unsigned int hooknum,
u_int8_t pf, struct sk_buff *skb);
unsigned int hooknum,
struct sk_buff *skb); int nf_conntrack_init_net(struct net *net);
void nf_conntrack_cleanup_net(struct net *net);
extern int nf_conntrack_init_net(struct net *net); void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list);
extern void nf_conntrack_cleanup_net(struct net *net);
extern void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list); int nf_conntrack_proto_pernet_init(struct net *net);
void nf_conntrack_proto_pernet_fini(struct net *net);
extern int nf_conntrack_proto_pernet_init(struct net *net);
extern void nf_conntrack_proto_pernet_fini(struct net *net); int nf_conntrack_proto_init(void);
void nf_conntrack_proto_fini(void);
extern int nf_conntrack_proto_init(void);
extern void nf_conntrack_proto_fini(void); int nf_conntrack_init_start(void);
void nf_conntrack_cleanup_start(void);
extern int nf_conntrack_init_start(void);
extern void nf_conntrack_cleanup_start(void); void nf_conntrack_init_end(void);
void nf_conntrack_cleanup_end(void);
extern void nf_conntrack_init_end(void);
extern void nf_conntrack_cleanup_end(void); bool nf_ct_get_tuple(const struct sk_buff *skb, unsigned int nhoff,
unsigned int dataoff, u_int16_t l3num, u_int8_t protonum,
extern bool struct nf_conntrack_tuple *tuple,
nf_ct_get_tuple(const struct sk_buff *skb, const struct nf_conntrack_l3proto *l3proto,
unsigned int nhoff, const struct nf_conntrack_l4proto *l4proto);
unsigned int dataoff,
u_int16_t l3num, bool nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
u_int8_t protonum, const struct nf_conntrack_tuple *orig,
struct nf_conntrack_tuple *tuple, const struct nf_conntrack_l3proto *l3proto,
const struct nf_conntrack_l3proto *l3proto, const struct nf_conntrack_l4proto *l4proto);
const struct nf_conntrack_l4proto *l4proto);
extern bool
nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
const struct nf_conntrack_tuple *orig,
const struct nf_conntrack_l3proto *l3proto,
const struct nf_conntrack_l4proto *l4proto);
/* Find a connection corresponding to a tuple. */ /* Find a connection corresponding to a tuple. */
extern struct nf_conntrack_tuple_hash * struct nf_conntrack_tuple_hash *
nf_conntrack_find_get(struct net *net, u16 zone, nf_conntrack_find_get(struct net *net, u16 zone,
const struct nf_conntrack_tuple *tuple); const struct nf_conntrack_tuple *tuple);
extern int __nf_conntrack_confirm(struct sk_buff *skb); int __nf_conntrack_confirm(struct sk_buff *skb);
/* Confirm a connection: returns NF_DROP if packet must be dropped. */ /* Confirm a connection: returns NF_DROP if packet must be dropped. */
static inline int nf_conntrack_confirm(struct sk_buff *skb) static inline int nf_conntrack_confirm(struct sk_buff *skb)
......
...@@ -68,10 +68,12 @@ struct nf_ct_event_notifier { ...@@ -68,10 +68,12 @@ struct nf_ct_event_notifier {
int (*fcn)(unsigned int events, struct nf_ct_event *item); int (*fcn)(unsigned int events, struct nf_ct_event *item);
}; };
extern int nf_conntrack_register_notifier(struct net *net, struct nf_ct_event_notifier *nb); int nf_conntrack_register_notifier(struct net *net,
extern void nf_conntrack_unregister_notifier(struct net *net, struct nf_ct_event_notifier *nb); struct nf_ct_event_notifier *nb);
void nf_conntrack_unregister_notifier(struct net *net,
struct nf_ct_event_notifier *nb);
extern void nf_ct_deliver_cached_events(struct nf_conn *ct); void nf_ct_deliver_cached_events(struct nf_conn *ct);
static inline void static inline void
nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct)
...@@ -166,8 +168,10 @@ struct nf_exp_event_notifier { ...@@ -166,8 +168,10 @@ struct nf_exp_event_notifier {
int (*fcn)(unsigned int events, struct nf_exp_event *item); int (*fcn)(unsigned int events, struct nf_exp_event *item);
}; };
extern int nf_ct_expect_register_notifier(struct net *net, struct nf_exp_event_notifier *nb); int nf_ct_expect_register_notifier(struct net *net,
extern void nf_ct_expect_unregister_notifier(struct net *net, struct nf_exp_event_notifier *nb); struct nf_exp_event_notifier *nb);
void nf_ct_expect_unregister_notifier(struct net *net,
struct nf_exp_event_notifier *nb);
static inline void static inline void
nf_ct_expect_event_report(enum ip_conntrack_expect_events event, nf_ct_expect_event_report(enum ip_conntrack_expect_events event,
...@@ -207,11 +211,11 @@ nf_ct_expect_event(enum ip_conntrack_expect_events event, ...@@ -207,11 +211,11 @@ nf_ct_expect_event(enum ip_conntrack_expect_events event,
nf_ct_expect_event_report(event, exp, 0, 0); nf_ct_expect_event_report(event, exp, 0, 0);
} }
extern int nf_conntrack_ecache_pernet_init(struct net *net); int nf_conntrack_ecache_pernet_init(struct net *net);
extern void nf_conntrack_ecache_pernet_fini(struct net *net); void nf_conntrack_ecache_pernet_fini(struct net *net);
extern int nf_conntrack_ecache_init(void); int nf_conntrack_ecache_init(void);
extern void nf_conntrack_ecache_fini(void); void nf_conntrack_ecache_fini(void);
#else /* CONFIG_NF_CONNTRACK_EVENTS */ #else /* CONFIG_NF_CONNTRACK_EVENTS */
static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, static inline void nf_conntrack_event_cache(enum ip_conntrack_events event,
......
...@@ -73,7 +73,7 @@ static inline void *__nf_ct_ext_find(const struct nf_conn *ct, u8 id) ...@@ -73,7 +73,7 @@ static inline void *__nf_ct_ext_find(const struct nf_conn *ct, u8 id)
((id##_TYPE *)__nf_ct_ext_find((ext), (id))) ((id##_TYPE *)__nf_ct_ext_find((ext), (id)))
/* Destroy all relationships */ /* Destroy all relationships */
extern void __nf_ct_ext_destroy(struct nf_conn *ct); void __nf_ct_ext_destroy(struct nf_conn *ct);
static inline void nf_ct_ext_destroy(struct nf_conn *ct) static inline void nf_ct_ext_destroy(struct nf_conn *ct)
{ {
if (ct->ext) if (ct->ext)
......
...@@ -52,21 +52,24 @@ struct nf_conntrack_helper { ...@@ -52,21 +52,24 @@ struct nf_conntrack_helper {
unsigned int queue_num; /* For user-space helpers. */ unsigned int queue_num; /* For user-space helpers. */
}; };
extern struct nf_conntrack_helper * struct nf_conntrack_helper *__nf_conntrack_helper_find(const char *name,
__nf_conntrack_helper_find(const char *name, u16 l3num, u8 protonum); u16 l3num, u8 protonum);
extern struct nf_conntrack_helper * struct nf_conntrack_helper *nf_conntrack_helper_try_module_get(const char *name,
nf_conntrack_helper_try_module_get(const char *name, u16 l3num, u8 protonum); u16 l3num,
u8 protonum);
extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); int nf_conntrack_helper_register(struct nf_conntrack_helper *);
extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); void nf_conntrack_helper_unregister(struct nf_conntrack_helper *);
extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, struct nf_conntrack_helper *helper, gfp_t gfp); struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct,
struct nf_conntrack_helper *helper,
gfp_t gfp);
extern int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl, int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl,
gfp_t flags); gfp_t flags);
extern void nf_ct_helper_destroy(struct nf_conn *ct); void nf_ct_helper_destroy(struct nf_conn *ct);
static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct)
{ {
...@@ -82,17 +85,16 @@ static inline void *nfct_help_data(const struct nf_conn *ct) ...@@ -82,17 +85,16 @@ static inline void *nfct_help_data(const struct nf_conn *ct)
return (void *)help->data; return (void *)help->data;
} }
extern int nf_conntrack_helper_pernet_init(struct net *net); int nf_conntrack_helper_pernet_init(struct net *net);
extern void nf_conntrack_helper_pernet_fini(struct net *net); void nf_conntrack_helper_pernet_fini(struct net *net);
extern int nf_conntrack_helper_init(void); int nf_conntrack_helper_init(void);
extern void nf_conntrack_helper_fini(void); void nf_conntrack_helper_fini(void);
extern int nf_conntrack_broadcast_help(struct sk_buff *skb, int nf_conntrack_broadcast_help(struct sk_buff *skb, unsigned int protoff,
unsigned int protoff, struct nf_conn *ct,
struct nf_conn *ct, enum ip_conntrack_info ctinfo,
enum ip_conntrack_info ctinfo, unsigned int timeout);
unsigned int timeout);
struct nf_ct_helper_expectfn { struct nf_ct_helper_expectfn {
struct list_head head; struct list_head head;
......
...@@ -77,17 +77,17 @@ struct nf_conntrack_l3proto { ...@@ -77,17 +77,17 @@ struct nf_conntrack_l3proto {
extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX]; extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX];
/* Protocol pernet registration. */ /* Protocol pernet registration. */
extern int nf_ct_l3proto_pernet_register(struct net *net, int nf_ct_l3proto_pernet_register(struct net *net,
struct nf_conntrack_l3proto *proto); struct nf_conntrack_l3proto *proto);
extern void nf_ct_l3proto_pernet_unregister(struct net *net, void nf_ct_l3proto_pernet_unregister(struct net *net,
struct nf_conntrack_l3proto *proto); struct nf_conntrack_l3proto *proto);
/* Protocol global registration. */ /* Protocol global registration. */
extern int nf_ct_l3proto_register(struct nf_conntrack_l3proto *proto); int nf_ct_l3proto_register(struct nf_conntrack_l3proto *proto);
extern void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto); void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto);
extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto);
extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p);
/* Existing built-in protocols */ /* Existing built-in protocols */
extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic; extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic;
......
...@@ -114,22 +114,22 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_generic; ...@@ -114,22 +114,22 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_generic;
#define MAX_NF_CT_PROTO 256 #define MAX_NF_CT_PROTO 256
extern struct nf_conntrack_l4proto * struct nf_conntrack_l4proto *__nf_ct_l4proto_find(u_int16_t l3proto,
__nf_ct_l4proto_find(u_int16_t l3proto, u_int8_t l4proto); u_int8_t l4proto);
extern struct nf_conntrack_l4proto * struct nf_conntrack_l4proto *nf_ct_l4proto_find_get(u_int16_t l3proto,
nf_ct_l4proto_find_get(u_int16_t l3proto, u_int8_t l4proto); u_int8_t l4proto);
extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p); void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p);
/* Protocol pernet registration. */ /* Protocol pernet registration. */
extern int nf_ct_l4proto_pernet_register(struct net *net, int nf_ct_l4proto_pernet_register(struct net *net,
struct nf_conntrack_l4proto *proto); struct nf_conntrack_l4proto *proto);
extern void nf_ct_l4proto_pernet_unregister(struct net *net, void nf_ct_l4proto_pernet_unregister(struct net *net,
struct nf_conntrack_l4proto *proto); struct nf_conntrack_l4proto *proto);
/* Protocol global registration. */ /* Protocol global registration. */
extern int nf_ct_l4proto_register(struct nf_conntrack_l4proto *proto); int nf_ct_l4proto_register(struct nf_conntrack_l4proto *proto);
extern void nf_ct_l4proto_unregister(struct nf_conntrack_l4proto *proto); void nf_ct_l4proto_unregister(struct nf_conntrack_l4proto *proto);
static inline void nf_ct_kfree_compat_sysctl_table(struct nf_proto_net *pn) static inline void nf_ct_kfree_compat_sysctl_table(struct nf_proto_net *pn)
{ {
...@@ -140,11 +140,11 @@ static inline void nf_ct_kfree_compat_sysctl_table(struct nf_proto_net *pn) ...@@ -140,11 +140,11 @@ static inline void nf_ct_kfree_compat_sysctl_table(struct nf_proto_net *pn)
} }
/* Generic netlink helpers */ /* Generic netlink helpers */
extern int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb, int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb,
const struct nf_conntrack_tuple *tuple); const struct nf_conntrack_tuple *tuple);
extern int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[], int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[],
struct nf_conntrack_tuple *t); struct nf_conntrack_tuple *t);
extern int nf_ct_port_nlattr_tuple_size(void); int nf_ct_port_nlattr_tuple_size(void);
extern const struct nla_policy nf_ct_port_nla_policy[]; extern const struct nla_policy nf_ct_port_nla_policy[];
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
......
...@@ -30,22 +30,18 @@ static inline struct nf_conn_seqadj *nfct_seqadj_ext_add(struct nf_conn *ct) ...@@ -30,22 +30,18 @@ static inline struct nf_conn_seqadj *nfct_seqadj_ext_add(struct nf_conn *ct)
return nf_ct_ext_add(ct, NF_CT_EXT_SEQADJ, GFP_ATOMIC); return nf_ct_ext_add(ct, NF_CT_EXT_SEQADJ, GFP_ATOMIC);
} }
extern int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo, int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
s32 off); s32 off);
extern int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo, int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
__be32 seq, s32 off); __be32 seq, s32 off);
extern void nf_ct_tcp_seqadj_set(struct sk_buff *skb, void nf_ct_tcp_seqadj_set(struct sk_buff *skb, struct nf_conn *ct,
struct nf_conn *ct, enum ip_conntrack_info ctinfo, s32 off);
enum ip_conntrack_info ctinfo,
s32 off); int nf_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct,
enum ip_conntrack_info ctinfo, unsigned int protoff);
extern int nf_ct_seq_adjust(struct sk_buff *skb, s32 nf_ct_seq_offset(const struct nf_conn *ct, enum ip_conntrack_dir, u32 seq);
struct nf_conn *ct, enum ip_conntrack_info ctinfo,
unsigned int protoff); int nf_conntrack_seqadj_init(void);
extern s32 nf_ct_seq_offset(const struct nf_conn *ct, enum ip_conntrack_dir, void nf_conntrack_seqadj_fini(void);
u32 seq);
extern int nf_conntrack_seqadj_init(void);
extern void nf_conntrack_seqadj_fini(void);
#endif /* _NF_CONNTRACK_SEQADJ_H */ #endif /* _NF_CONNTRACK_SEQADJ_H */
...@@ -56,22 +56,20 @@ struct synproxy_options { ...@@ -56,22 +56,20 @@ struct synproxy_options {
struct tcphdr; struct tcphdr;
struct xt_synproxy_info; struct xt_synproxy_info;
extern void synproxy_parse_options(const struct sk_buff *skb, unsigned int doff, void synproxy_parse_options(const struct sk_buff *skb, unsigned int doff,
const struct tcphdr *th, const struct tcphdr *th,
struct synproxy_options *opts); struct synproxy_options *opts);
extern unsigned int synproxy_options_size(const struct synproxy_options *opts); unsigned int synproxy_options_size(const struct synproxy_options *opts);
extern void synproxy_build_options(struct tcphdr *th, void synproxy_build_options(struct tcphdr *th,
const struct synproxy_options *opts); const struct synproxy_options *opts);
extern void synproxy_init_timestamp_cookie(const struct xt_synproxy_info *info, void synproxy_init_timestamp_cookie(const struct xt_synproxy_info *info,
struct synproxy_options *opts); struct synproxy_options *opts);
extern void synproxy_check_timestamp_cookie(struct synproxy_options *opts); void synproxy_check_timestamp_cookie(struct synproxy_options *opts);
extern unsigned int synproxy_tstamp_adjust(struct sk_buff *skb, unsigned int synproxy_tstamp_adjust(struct sk_buff *skb, unsigned int protoff,
unsigned int protoff, struct tcphdr *th, struct nf_conn *ct,
struct tcphdr *th, enum ip_conntrack_info ctinfo,
struct nf_conn *ct, const struct nf_conn_synproxy *synproxy);
enum ip_conntrack_info ctinfo,
const struct nf_conn_synproxy *synproxy);
#endif /* _NF_CONNTRACK_SYNPROXY_H */ #endif /* _NF_CONNTRACK_SYNPROXY_H */
...@@ -76,8 +76,8 @@ nf_ct_timeout_lookup(struct net *net, struct nf_conn *ct, ...@@ -76,8 +76,8 @@ nf_ct_timeout_lookup(struct net *net, struct nf_conn *ct,
} }
#ifdef CONFIG_NF_CONNTRACK_TIMEOUT #ifdef CONFIG_NF_CONNTRACK_TIMEOUT
extern int nf_conntrack_timeout_init(void); int nf_conntrack_timeout_init(void);
extern void nf_conntrack_timeout_fini(void); void nf_conntrack_timeout_fini(void);
#else #else
static inline int nf_conntrack_timeout_init(void) static inline int nf_conntrack_timeout_init(void)
{ {
......
...@@ -48,11 +48,11 @@ static inline void nf_ct_set_tstamp(struct net *net, bool enable) ...@@ -48,11 +48,11 @@ static inline void nf_ct_set_tstamp(struct net *net, bool enable)
} }
#ifdef CONFIG_NF_CONNTRACK_TIMESTAMP #ifdef CONFIG_NF_CONNTRACK_TIMESTAMP
extern int nf_conntrack_tstamp_pernet_init(struct net *net); int nf_conntrack_tstamp_pernet_init(struct net *net);
extern void nf_conntrack_tstamp_pernet_fini(struct net *net); void nf_conntrack_tstamp_pernet_fini(struct net *net);
extern int nf_conntrack_tstamp_init(void); int nf_conntrack_tstamp_init(void);
extern void nf_conntrack_tstamp_fini(void); void nf_conntrack_tstamp_fini(void);
#else #else
static inline int nf_conntrack_tstamp_pernet_init(struct net *net) static inline int nf_conntrack_tstamp_pernet_init(struct net *net)
{ {
......
...@@ -41,13 +41,13 @@ struct nf_conn_nat { ...@@ -41,13 +41,13 @@ struct nf_conn_nat {
}; };
/* Set up the info structure to map into this range. */ /* Set up the info structure to map into this range. */
extern unsigned int nf_nat_setup_info(struct nf_conn *ct, unsigned int nf_nat_setup_info(struct nf_conn *ct,
const struct nf_nat_range *range, const struct nf_nat_range *range,
enum nf_nat_manip_type maniptype); enum nf_nat_manip_type maniptype);
/* Is this tuple already taken? (not by us)*/ /* Is this tuple already taken? (not by us)*/
extern int nf_nat_used_tuple(const struct nf_conntrack_tuple *tuple, int nf_nat_used_tuple(const struct nf_conntrack_tuple *tuple,
const struct nf_conn *ignored_conntrack); const struct nf_conn *ignored_conntrack);
static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct) static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct)
{ {
......
...@@ -7,12 +7,10 @@ ...@@ -7,12 +7,10 @@
/* This header used to share core functionality between the standalone /* This header used to share core functionality between the standalone
NAT module, and the compatibility layer's use of NAT for masquerading. */ NAT module, and the compatibility layer's use of NAT for masquerading. */
extern unsigned int nf_nat_packet(struct nf_conn *ct, unsigned int nf_nat_packet(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
enum ip_conntrack_info ctinfo, unsigned int hooknum, struct sk_buff *skb);
unsigned int hooknum,
struct sk_buff *skb);
extern int nf_xfrm_me_harder(struct sk_buff *skb, unsigned int family); int nf_xfrm_me_harder(struct sk_buff *skb, unsigned int family);
static inline int nf_nat_initialized(struct nf_conn *ct, static inline int nf_nat_initialized(struct nf_conn *ct,
enum nf_nat_manip_type manip) enum nf_nat_manip_type manip)
......
...@@ -7,14 +7,11 @@ ...@@ -7,14 +7,11 @@
struct sk_buff; struct sk_buff;
/* These return true or false. */ /* These return true or false. */
extern int __nf_nat_mangle_tcp_packet(struct sk_buff *skb, int __nf_nat_mangle_tcp_packet(struct sk_buff *skb, struct nf_conn *ct,
struct nf_conn *ct, enum ip_conntrack_info ctinfo,
enum ip_conntrack_info ctinfo, unsigned int protoff, unsigned int match_offset,
unsigned int protoff, unsigned int match_len, const char *rep_buffer,
unsigned int match_offset, unsigned int rep_len, bool adjust);
unsigned int match_len,
const char *rep_buffer,
unsigned int rep_len, bool adjust);
static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb, static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb,
struct nf_conn *ct, struct nf_conn *ct,
...@@ -30,18 +27,14 @@ static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb, ...@@ -30,18 +27,14 @@ static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb,
rep_buffer, rep_len, true); rep_buffer, rep_len, true);
} }
extern int nf_nat_mangle_udp_packet(struct sk_buff *skb, int nf_nat_mangle_udp_packet(struct sk_buff *skb, struct nf_conn *ct,
struct nf_conn *ct, enum ip_conntrack_info ctinfo,
enum ip_conntrack_info ctinfo, unsigned int protoff, unsigned int match_offset,
unsigned int protoff, unsigned int match_len, const char *rep_buffer,
unsigned int match_offset, unsigned int rep_len);
unsigned int match_len,
const char *rep_buffer,
unsigned int rep_len);
/* Setup NAT on this expected conntrack so it follows master, but goes /* Setup NAT on this expected conntrack so it follows master, but goes
* to port ct->master->saved_proto. */ * to port ct->master->saved_proto. */
extern void nf_nat_follow_master(struct nf_conn *ct, void nf_nat_follow_master(struct nf_conn *ct, struct nf_conntrack_expect *this);
struct nf_conntrack_expect *this);
#endif #endif
...@@ -35,18 +35,15 @@ struct nf_nat_l3proto { ...@@ -35,18 +35,15 @@ struct nf_nat_l3proto {
struct nf_nat_range *range); struct nf_nat_range *range);
}; };
extern int nf_nat_l3proto_register(const struct nf_nat_l3proto *); int nf_nat_l3proto_register(const struct nf_nat_l3proto *);
extern void nf_nat_l3proto_unregister(const struct nf_nat_l3proto *); void nf_nat_l3proto_unregister(const struct nf_nat_l3proto *);
extern const struct nf_nat_l3proto *__nf_nat_l3proto_find(u8 l3proto); const struct nf_nat_l3proto *__nf_nat_l3proto_find(u8 l3proto);
extern int nf_nat_icmp_reply_translation(struct sk_buff *skb, int nf_nat_icmp_reply_translation(struct sk_buff *skb, struct nf_conn *ct,
struct nf_conn *ct, enum ip_conntrack_info ctinfo,
enum ip_conntrack_info ctinfo, unsigned int hooknum);
unsigned int hooknum); int nf_nat_icmpv6_reply_translation(struct sk_buff *skb, struct nf_conn *ct,
extern int nf_nat_icmpv6_reply_translation(struct sk_buff *skb, enum ip_conntrack_info ctinfo,
struct nf_conn *ct, unsigned int hooknum, unsigned int hdrlen);
enum ip_conntrack_info ctinfo,
unsigned int hooknum,
unsigned int hdrlen);
#endif /* _NF_NAT_L3PROTO_H */ #endif /* _NF_NAT_L3PROTO_H */
...@@ -42,10 +42,11 @@ struct nf_nat_l4proto { ...@@ -42,10 +42,11 @@ struct nf_nat_l4proto {
}; };
/* Protocol registration. */ /* Protocol registration. */
extern int nf_nat_l4proto_register(u8 l3proto, const struct nf_nat_l4proto *l4proto); int nf_nat_l4proto_register(u8 l3proto, const struct nf_nat_l4proto *l4proto);
extern void nf_nat_l4proto_unregister(u8 l3proto, const struct nf_nat_l4proto *l4proto); void nf_nat_l4proto_unregister(u8 l3proto,
const struct nf_nat_l4proto *l4proto);
extern const struct nf_nat_l4proto *__nf_nat_l4proto_find(u8 l3proto, u8 l4proto); const struct nf_nat_l4proto *__nf_nat_l4proto_find(u8 l3proto, u8 l4proto);
/* Built-in protocols. */ /* Built-in protocols. */
extern const struct nf_nat_l4proto nf_nat_l4proto_tcp; extern const struct nf_nat_l4proto nf_nat_l4proto_tcp;
...@@ -54,19 +55,18 @@ extern const struct nf_nat_l4proto nf_nat_l4proto_icmp; ...@@ -54,19 +55,18 @@ extern const struct nf_nat_l4proto nf_nat_l4proto_icmp;
extern const struct nf_nat_l4proto nf_nat_l4proto_icmpv6; extern const struct nf_nat_l4proto nf_nat_l4proto_icmpv6;
extern const struct nf_nat_l4proto nf_nat_l4proto_unknown; extern const struct nf_nat_l4proto nf_nat_l4proto_unknown;
extern bool nf_nat_l4proto_in_range(const struct nf_conntrack_tuple *tuple, bool nf_nat_l4proto_in_range(const struct nf_conntrack_tuple *tuple,
enum nf_nat_manip_type maniptype, enum nf_nat_manip_type maniptype,
const union nf_conntrack_man_proto *min, const union nf_conntrack_man_proto *min,
const union nf_conntrack_man_proto *max); const union nf_conntrack_man_proto *max);
extern void nf_nat_l4proto_unique_tuple(const struct nf_nat_l3proto *l3proto, void nf_nat_l4proto_unique_tuple(const struct nf_nat_l3proto *l3proto,
struct nf_conntrack_tuple *tuple, struct nf_conntrack_tuple *tuple,
const struct nf_nat_range *range, const struct nf_nat_range *range,
enum nf_nat_manip_type maniptype, enum nf_nat_manip_type maniptype,
const struct nf_conn *ct, const struct nf_conn *ct, u16 *rover);
u16 *rover);
extern int nf_nat_l4proto_nlattr_to_range(struct nlattr *tb[], int nf_nat_l4proto_nlattr_to_range(struct nlattr *tb[],
struct nf_nat_range *range); struct nf_nat_range *range);
#endif /*_NF_NAT_L4PROTO_H*/ #endif /*_NF_NAT_L4PROTO_H*/
...@@ -28,7 +28,7 @@ struct nf_queue_handler { ...@@ -28,7 +28,7 @@ struct nf_queue_handler {
void nf_register_queue_handler(const struct nf_queue_handler *qh); void nf_register_queue_handler(const struct nf_queue_handler *qh);
void nf_unregister_queue_handler(void); void nf_unregister_queue_handler(void);
extern void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict); void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict);
bool nf_queue_entry_get_refs(struct nf_queue_entry *entry); bool nf_queue_entry_get_refs(struct nf_queue_entry *entry);
void nf_queue_entry_release_refs(struct nf_queue_entry *entry); void nf_queue_entry_release_refs(struct nf_queue_entry *entry);
......
...@@ -16,7 +16,7 @@ struct xt_rateest { ...@@ -16,7 +16,7 @@ struct xt_rateest {
struct rcu_head rcu; struct rcu_head rcu;
}; };
extern struct xt_rateest *xt_rateest_lookup(const char *name); struct xt_rateest *xt_rateest_lookup(const char *name);
extern void xt_rateest_put(struct xt_rateest *est); void xt_rateest_put(struct xt_rateest *est);
#endif /* _XT_RATEEST_H */ #endif /* _XT_RATEEST_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment