Declare a wrapper to parse group option for nflog

pull/976/merge
Giuseppe Longo 12 years ago committed by Victor Julien
parent c35432b265
commit 0368d5e4a4

@ -134,6 +134,11 @@ LiveDevice *LiveGetDevice(char *name) {
int LiveBuildDeviceList(char * runmode) int LiveBuildDeviceList(char * runmode)
{
return LiveBuildDeviceListCustom(runmode, "interface");
}
int LiveBuildDeviceListCustom(char * runmode, char * itemname)
{ {
ConfNode *base = ConfGetNode(runmode); ConfNode *base = ConfGetNode(runmode);
ConfNode *child; ConfNode *child;
@ -143,14 +148,14 @@ int LiveBuildDeviceList(char * runmode)
return 0; return 0;
TAILQ_FOREACH(child, &base->head, next) { TAILQ_FOREACH(child, &base->head, next) {
if (!strcmp(child->val, "interface")) { if (!strcmp(child->val, itemname)) {
ConfNode *subchild; ConfNode *subchild;
TAILQ_FOREACH(subchild, &child->head, next) { TAILQ_FOREACH(subchild, &child->head, next) {
if ((!strcmp(subchild->name, "interface"))) { if ((!strcmp(subchild->name, itemname))) {
if (!strcmp(subchild->val, "default")) if (!strcmp(subchild->val, "default"))
break; break;
SCLogInfo("Adding interface %s from config file", SCLogInfo("Adding %s %s from config file",
subchild->val); itemname, subchild->val);
LiveRegisterDevice(subchild->val); LiveRegisterDevice(subchild->val);
i++; i++;
} }

@ -39,6 +39,7 @@ LiveDevice *LiveGetDevice(char *dev);
int LiveBuildDeviceList(char * base); int LiveBuildDeviceList(char * base);
void LiveDeviceHasNoStats(void); void LiveDeviceHasNoStats(void);
int LiveDeviceListClean(void); int LiveDeviceListClean(void);
int LiveBuildDeviceListCustom(char * base, char * itemname);
#ifdef BUILD_UNIX_SOCKET #ifdef BUILD_UNIX_SOCKET
TmEcode LiveDeviceIfaceStat(json_t *cmd, json_t *server_msg, void *data); TmEcode LiveDeviceIfaceStat(json_t *cmd, json_t *server_msg, void *data);

Loading…
Cancel
Save