]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Declare a wrapper to parse group option for nflog
authorGiuseppe Longo <giuseppelng@gmail.com>
Sat, 1 Feb 2014 10:32:12 +0000 (11:32 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 23 May 2014 10:42:52 +0000 (12:42 +0200)
src/util-device.c
src/util-device.h

index 6359973bfa55d341ad6183acb39b03dbe68a1cff..4e4081f707397f75143236138d272faa8acd0d24 100644 (file)
@@ -134,6 +134,11 @@ LiveDevice *LiveGetDevice(char *name) {
 
 
 int LiveBuildDeviceList(char * runmode)
+{
+    return LiveBuildDeviceListCustom(runmode, "interface");
+}
+
+int LiveBuildDeviceListCustom(char * runmode, char * itemname)
 {
     ConfNode *base = ConfGetNode(runmode);
     ConfNode *child;
@@ -143,14 +148,14 @@ int LiveBuildDeviceList(char * runmode)
         return 0;
 
     TAILQ_FOREACH(child, &base->head, next) {
-        if (!strcmp(child->val, "interface")) {
+        if (!strcmp(child->val, itemname)) {
             ConfNode *subchild;
             TAILQ_FOREACH(subchild, &child->head, next) {
-                if ((!strcmp(subchild->name, "interface"))) {
+                if ((!strcmp(subchild->name, itemname))) {
                     if (!strcmp(subchild->val, "default"))
                         break;
-                    SCLogInfo("Adding interface %s from config file",
-                              subchild->val);
+                    SCLogInfo("Adding %s %s from config file",
+                              itemname, subchild->val);
                     LiveRegisterDevice(subchild->val);
                     i++;
                 }
index 6744d923e4b3ae7846cccd822dc0489e046d5649..fd6a82131333acd5c0b12af41cdc0534de1ff382 100644 (file)
@@ -39,6 +39,7 @@ LiveDevice *LiveGetDevice(char *dev);
 int LiveBuildDeviceList(char * base);
 void LiveDeviceHasNoStats(void);
 int LiveDeviceListClean(void);
+int LiveBuildDeviceListCustom(char * base, char * itemname);
 
 #ifdef BUILD_UNIX_SOCKET
 TmEcode LiveDeviceIfaceStat(json_t *cmd, json_t *server_msg, void *data);