Skip to contentSkip to conversation

Add include for nflog and nfacct

PATCH New Eric Leblond 2 participants 4 messages Nov 4, 2012 netfilter

lore
Share & tools
lore
#0 lore raw

cover Add include for nflog and nfacct

Hi,

The libnetfilter_log and libnetfilter_acct include can't be put directly on top of a source file because some integer types are not defined. Following this mail are two patches to fix this problem.

BR,
--
Eric

#1 lore raw

PATCH 1/1 Add include needed for integer type definition.

---
 include/libnetfilter_log/libnetfilter_log.h |    1 +
 1 file changed, 1 insertion(+)
include/libnetfilter_log/libnetfilter_log.h +1 -0
index 6b0d3b0..a1331de 100644
@@ -9,6 +9,7 @@
 #ifndef __LIBNETFILTER_LOG_H
 #define __LIBNETFILTER_LOG_H
 
+#include <sys/types.h>
 #include <libnetfilter_log/linux_nfnetlink_log.h>
 
 struct nflog_handle;
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 1/1 Add include needed for integer types definition.

---
 include/libnetfilter_acct/libnetfilter_acct.h |    1 +
 1 file changed, 1 insertion(+)
include/libnetfilter_acct/libnetfilter_acct.h +1 -0
index a326c3c..48fe8f4 100644
@@ -2,6 +2,7 @@
 #define _LIBNETFILTER_ACCT_H_
 
 #include <sys/types.h>
+#include <inttypes.h>
 #include <linux/netfilter/nfnetlink_acct.h>
 
 struct nfacct;
Signature · 1 line
1.7.10.4
#3 lore raw

Re: [libnfacct PATCH] Add include needed for integer types definition.

Quoted 9 lines · Eric Leblond

---
include/libnetfilter_acct/libnetfilter_acct.h | 1 +

1 file changed, 1 insertion(+)
include/libnetfilter_acct/libnetfilter_acct.h +0 -0
index a326c3c..48fe8f4 100644

include/libnetfilter_acct/libnetfilter_acct.h line 6

Quoted 5 lines
include/libnetfilter_acct/libnetfilter_acct.h +1 -0
@@ -2,6 +2,7 @@
 #define _LIBNETFILTER_ACCT_H_
 
 #include <sys/types.h>
+#include <inttypes.h>
 #include <linux/netfilter/nfnetlink_acct.h>

The intXX_t pieces are standardized in <stdint.h>
(Or, to cater for C++,

#if defined(__cplusplus) && \
    (__cplusplus >= 201100L || defined(__GXX_EXPERIMENTAL_CXX0X__))

# include <cstdint>
#else
# include <stdint.h>
#endif