Skip to contentSkip to conversation

Hardware header parsing in NFLOG and ULOG

PATCH In review Eric Leblond 1 participant 2 messages Jul 23, 2008 netfilter

lore
Share & tools
lore
#0 lore raw

cover Hardware header parsing in NFLOG and ULOG

Hello,

This patchset is aiming at:
* solving the conflict between ULOG and NFLOG
* using the latest NFLOG capability relatively to hardware header

First patch modifies the NFLOG plugin to add raw.mac and raw.type (hardware type) to output keys.
Second patch introduces a new plugin which has to be used to parse the packet hardware header and extract source and destination hardware address.
Third patch updates the MAC2STR plugin to convert to string the hardware related fields.
Finally, last patch adds support for this new fields in mysql and pgsql.

Patchset statistics:

 configure.in                      |    4 +-
 doc/mysql-ulogd2.sql              |   68 +++++++++---
 doc/pgsql-ulogd2.sql              |   49 ++++++++-
 filter/Makefile.am                |    6 +-
 filter/ulogd_filter_MAC2STR.c     |   92 +++++++++++++----
 filter/ulogd_filter_RAWMAC.c      |  214
 +++++++++++++++++++++++++++++++++++++
 input/packet/ulogd_inppkt_NFLOG.c |   43 +++++++-
 7 files changed, 427 insertions(+), 49 deletions(-)

PS: I run git-send-email without --compose and send the patchset before the introduction mail. Sorry for that.

BR,

Signature · 3 lines
Eric Leblond
INL: http://www.inl.fr/
NuFW: http://www.nufw.org/
#1 lore raw

PATCH 1/1 Add RAWMAC plugin information to configuration file.

This patch modifies the stacks to use the RAWMAC plugin where it is necessary.

---
 ulogd.conf.in |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
ulogd.conf.in +3 -2
index a32234d..dc9cdf2 100644
@@ -39,6 +39,7 @@ plugin="@libdir@/ulogd/ulogd_filter_IFINDEX.so"
 plugin="@libdir@/ulogd/ulogd_filter_IP2STR.so"
 plugin="@libdir@/ulogd/ulogd_filter_IP2BIN.so"
 plugin="@libdir@/ulogd/ulogd_filter_PRINTPKT.so"
+plugin="@libdir@/ulogd/ulogd_filter_RAWMAC.so"
 plugin="@libdir@/ulogd/ulogd_filter_MAC2STR.so"
 plugin="@libdir@/ulogd/ulogd_filter_PRINTFLOW.so"
 #plugin="@libdir@/ulogd/ulogd_filter_MARK.so"
@@ -76,10 +77,10 @@ plugin="@libdir@/ulogd/ulogd_raw2packet_BASE.so"
 #stack=log1:NFLOG,base1:BASE,pcap1:PCAP
 
 # this is a stack for logging packet to MySQL
-#stack=log1:NFLOG,base1:BASE,ifi1:IFINDEX,ip2bin1:IP2BIN,mac2str1:MAC2STR,mysql1:MYSQL
+#stack=log1:NFLOG,base1:BASE,ifi1:IFINDEX,ip2bin1:IP2BIN,rawmac1:RAWMAC,mac2str1:MAC2STR,mysql1:MYSQL
 
 # this is a stack for logging IPv6 packet to PGsql after a collect via NFLOG
-#stack=log2:NFLOG,base1:BASE,ifi1:IFINDEX,ip2str1:IP2STR,mac2str1:MAC2STR,pgsql1:PGSQL
+#stack=log2:NFLOG,base1:BASE,ifi1:IFINDEX,ip2str1:IP2STR,rawmac1:RAWMAC,mac2str1:MAC2STR,pgsql1:PGSQL
 
 # this is a stack for logging ebtables packets to syslog after a collect via NFLOG
 #stack=log3:NFLOG,base1:BASE,ifi1:IFINDEX,ip2str1:IP2STR,print1:PRINTPKT,sys1:SYSLOG
Signature · 1 line
1.5.4.3