summaryrefslogtreecommitdiffstats
path: root/include/libnfnetlink/linux_nfnetlink.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libnfnetlink/linux_nfnetlink.h')
-rw-r--r--include/libnfnetlink/linux_nfnetlink.h29
1 files changed, 8 insertions, 21 deletions
diff --git a/include/libnfnetlink/linux_nfnetlink.h b/include/libnfnetlink/linux_nfnetlink.h
index c025902..0f9311d 100644
--- a/include/libnfnetlink/linux_nfnetlink.h
+++ b/include/libnfnetlink/linux_nfnetlink.h
@@ -43,7 +43,7 @@ struct nfattr
u_int16_t nfa_len;
u_int16_t nfa_type; /* we use 15 bits for the type, and the highest
* bit to indicate whether the payload is nested */
-} __attribute__ ((packed));
+};
/* FIXME: Apart from NFNL_NFA_NESTED shamelessly copy and pasted from
* rtnetlink.h, it's time to put this in a generic file */
@@ -62,11 +62,11 @@ struct nfattr
#define NFA_DATA(nfa) ((void *)(((char *)(nfa)) + NFA_LENGTH(0)))
#define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0))
#define NFA_NEST(skb, type) \
-({ struct nfattr *__start = (struct nfattr *) (skb)->tail; \
+({ struct nfattr *__start = (struct nfattr *)skb_tail_pointer(skb); \
NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); \
__start; })
#define NFA_NEST_END(skb, start) \
-({ (start)->nfa_len = ((skb)->tail - (unsigned char *) (start)); \
+({ (start)->nfa_len = skb_tail_pointer(skb) - (unsigned char *)(start); \
(skb)->len; })
#define NFA_NEST_CANCEL(skb, start) \
({ if (start) \
@@ -78,8 +78,8 @@ struct nfattr
struct nfgenmsg {
u_int8_t nfgen_family; /* AF_xxx */
u_int8_t version; /* nfnetlink version */
- u_int16_t res_id; /* resource id */
-} __attribute__ ((packed));
+ __be16 res_id; /* resource id */
+};
#define NFNETLINK_V0 0
@@ -101,8 +101,7 @@ struct nfgenmsg {
#define NFNL_SUBSYS_CTNETLINK_EXP 2
#define NFNL_SUBSYS_QUEUE 3
#define NFNL_SUBSYS_ULOG 4
-#define NFNL_SUBSYS_CTHELPER 5
-#define NFNL_SUBSYS_COUNT 6
+#define NFNL_SUBSYS_COUNT 5
#ifdef __KERNEL__
@@ -112,7 +111,7 @@ struct nfgenmsg {
struct nfnl_callback
{
int (*call)(struct sock *nl, struct sk_buff *skb,
- struct nlmsghdr *nlh, struct nfattr *cda[], int *errp);
+ struct nlmsghdr *nlh, struct nfattr *cda[]);
u_int16_t attr_count; /* number of nfattr's */
};
@@ -130,19 +129,6 @@ extern void __nfa_fill(struct sk_buff *skb, int attrtype,
({ if (skb_tailroom(skb) < (int)NFA_SPACE(attrlen)) goto nfattr_failure; \
__nfa_fill(skb, attrtype, attrlen, data); })
-extern struct semaphore nfnl_sem;
-
-#define nfnl_shlock() down(&nfnl_sem)
-#define nfnl_shlock_nowait() down_trylock(&nfnl_sem)
-
-#define nfnl_shunlock() do { up(&nfnl_sem); \
- if(nfnl && nfnl->sk_receive_queue.qlen) \
- nfnl->sk_data_ready(nfnl, 0); \
- } while(0)
-
-extern void nfnl_lock(void);
-extern void nfnl_unlock(void);
-
extern int nfnetlink_subsys_register(struct nfnetlink_subsystem *n);
extern int nfnetlink_subsys_unregister(struct nfnetlink_subsystem *n);
@@ -165,6 +151,7 @@ extern void nfattr_parse(struct nfattr *tb[], int maxattr,
__res; \
})
+extern int nfnetlink_has_listeners(unsigned int group);
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);