diff --git a/src/util-device.c b/src/util-device.c index 4850733f1a..c0c9300fa9 100644 --- a/src/util-device.c +++ b/src/util-device.c @@ -84,3 +84,31 @@ char *LiveGetDevice(int number) { return NULL; } + + + +int LiveBuildIfaceList(char * runmode) +{ + ConfNode *base = ConfGetNode(runmode); + ConfNode *child; + int i = 0; + + if (base == NULL) + return 0; + + TAILQ_FOREACH(child, &base->head, next) { + if (!strncmp(child->val, "interface", sizeof(child->val))) { + ConfNode *subchild; + TAILQ_FOREACH(subchild, &child->head, next) { + if ((!strcmp(subchild->name, "interface"))) { + SCLogInfo("Adding interface %s from config file", + subchild->val); + LiveRegisterDevice(subchild->val); + i++; + } + } + } + } + + return i; +} diff --git a/src/util-device.h b/src/util-device.h index 66be217d12..4eaa40c266 100644 --- a/src/util-device.h +++ b/src/util-device.h @@ -30,5 +30,6 @@ typedef struct LiveDevice_ { int LiveRegisterDevice(char *dev); int LiveGetDeviceCount(void); char *LiveGetDevice(int number); +int LiveBuildIfaceList(char * base); #endif /* __UTIL_DEVICE_H__ */