[netfilter-cvslog] r6965 - trunk/libnfnetlink/include/libnfnetlink

pablo at netfilter.org pablo at netfilter.org
Sat Jul 28 16:44:46 CEST 2007


Author: pablo at netfilter.org
Date: 2007-07-28 16:44:46 +0200 (Sat, 28 Jul 2007)
New Revision: 6965

Modified:
   trunk/libnfnetlink/include/libnfnetlink/libnfnetlink.h
   trunk/libnfnetlink/include/libnfnetlink/linux_nfnetlink.h
Log:
- update linux_nfnetlink.h from kernel sources
- remove the nest bit


Modified: trunk/libnfnetlink/include/libnfnetlink/libnfnetlink.h
===================================================================
--- trunk/libnfnetlink/include/libnfnetlink/libnfnetlink.h	2007-07-28 13:56:13 UTC (rev 6964)
+++ trunk/libnfnetlink/include/libnfnetlink/libnfnetlink.h	2007-07-28 14:44:46 UTC (rev 6965)
@@ -162,7 +162,7 @@
 	nfnl_parse_attr((tb), (max), NFA_DATA((nfa)), NFA_PAYLOAD((nfa)))
 #define nfnl_nest(nlh, bufsize, type) 				\
 ({	struct nfattr *__start = NLMSG_TAIL(nlh);		\
-	nfnl_addattr_l(nlh, bufsize, (NFNL_NFA_NEST | type), NULL, 0); 	\
+	nfnl_addattr_l(nlh, bufsize, type, NULL, 0); 	\
 	__start; })
 #define nfnl_nest_end(nlh, tail) 				\
 ({	(tail)->nfa_len = (void *) NLMSG_TAIL(nlh) - (void *) tail; })

Modified: trunk/libnfnetlink/include/libnfnetlink/linux_nfnetlink.h
===================================================================
--- trunk/libnfnetlink/include/libnfnetlink/linux_nfnetlink.h	2007-07-28 13:56:13 UTC (rev 6964)
+++ trunk/libnfnetlink/include/libnfnetlink/linux_nfnetlink.h	2007-07-28 14:44:46 UTC (rev 6965)
@@ -43,7 +43,7 @@
 	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 @@
 #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 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 @@
 #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 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 @@
 ({ 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 @@
  	__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);




More information about the netfilter-cvslog mailing list