mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 13:44:26 -04:00
[NETFILTER]: Core changes required by upcoming nfnetlink_queue code
- split netfiler verdict in 16bit verdict and 16bit queue number - add 'queuenum' argument to nf_queue_outfn_t and its users ip[6]_queue - move NFNL_SUBSYS_ definitions from enum to #define - introduce autoloading for nfnetlink subsystem modules - add MODULE_ALIAS_NFNL_SUBSYS macro - add nf_unregister_queue_handlers() to register all handlers for a given nf_queue_outfn_t - add more verbose DEBUGP macro definition to nfnetlink.c - make nfnetlink_subsys_register fail if subsys already exists - add some more comments and debug statements to nfnetlink.c Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2cc7d57309
commit
0ab43f8499
6 changed files with 83 additions and 25 deletions
|
|
@ -21,6 +21,16 @@
|
|||
#define NF_STOP 5
|
||||
#define NF_MAX_VERDICT NF_STOP
|
||||
|
||||
/* we overload the higher bits for encoding auxiliary data such as the queue
|
||||
* number. Not nice, but better than additional function arguments. */
|
||||
#define NF_VERDICT_MASK 0x0000ffff
|
||||
#define NF_VERDICT_BITS 16
|
||||
|
||||
#define NF_VERDICT_QMASK 0xffff0000
|
||||
#define NF_VERDICT_QBITS 16
|
||||
|
||||
#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK || NF_QUEUE)
|
||||
|
||||
/* only for userspace compatibility */
|
||||
#ifndef __KERNEL__
|
||||
/* Generic cache responses from hook functions.
|
||||
|
|
@ -179,10 +189,12 @@ int nf_getsockopt(struct sock *sk, int pf, int optval, char __user *opt,
|
|||
|
||||
/* Packet queuing */
|
||||
typedef int (*nf_queue_outfn_t)(struct sk_buff *skb,
|
||||
struct nf_info *info, void *data);
|
||||
struct nf_info *info,
|
||||
unsigned int queuenum, void *data);
|
||||
extern int nf_register_queue_handler(int pf,
|
||||
nf_queue_outfn_t outfn, void *data);
|
||||
extern int nf_unregister_queue_handler(int pf);
|
||||
extern void nf_unregister_queue_handlers(nf_queue_outfn_t outfn);
|
||||
extern void nf_reinject(struct sk_buff *skb,
|
||||
struct nf_info *info,
|
||||
unsigned int verdict);
|
||||
|
|
|
|||
|
|
@ -69,15 +69,14 @@ struct nfgenmsg {
|
|||
#define NFNL_SUBSYS_ID(x) ((x & 0xff00) >> 8)
|
||||
#define NFNL_MSG_TYPE(x) (x & 0x00ff)
|
||||
|
||||
enum nfnl_subsys_id {
|
||||
NFNL_SUBSYS_NONE = 0,
|
||||
NFNL_SUBSYS_CTNETLINK,
|
||||
NFNL_SUBSYS_CTNETLINK_EXP,
|
||||
NFNL_SUBSYS_IPTNETLINK,
|
||||
NFNL_SUBSYS_QUEUE,
|
||||
NFNL_SUBSYS_ULOG,
|
||||
NFNL_SUBSYS_COUNT,
|
||||
};
|
||||
/* No enum here, otherwise __stringify() trick of MODULE_ALIAS_NFNL_SUBSYS()
|
||||
* won't work anymore */
|
||||
#define NFNL_SUBSYS_NONE 0
|
||||
#define NFNL_SUBSYS_CTNETLINK 1
|
||||
#define NFNL_SUBSYS_CTNETLINK_EXP 2
|
||||
#define NFNL_SUBSYS_QUEUE 3
|
||||
#define NFNL_SUBSYS_ULOG 4
|
||||
#define NFNL_SUBSYS_COUNT 5
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
|
|
@ -142,5 +141,8 @@ extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group,
|
|||
int echo);
|
||||
extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags);
|
||||
|
||||
#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
|
||||
MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _NFNETLINK_H */
|
||||
|
|
|
|||
Loading…
Reference in a new issue