pfring: minor cleanups

pull/3517/head
Victor Julien 7 years ago
parent 4f84672d7c
commit 24b18e47bd

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2010 Open Information Security Foundation /* Copyright (C) 2007-2018 Open Information Security Foundation
* *
* You can copy, redistribute or modify this Program under the terms of * You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free * the GNU General Public License version 2 as published by the Free
@ -375,7 +375,7 @@ static void *ParsePfringConfig(const char *iface)
return pfconf; return pfconf;
} }
static int PfringConfigGeThreadsCount(void *conf) static int PfringConfigGetThreadsCount(void *conf)
{ {
PfringIfaceConfig *pfp = (PfringIfaceConfig *)conf; PfringIfaceConfig *pfp = (PfringIfaceConfig *)conf;
return pfp->threads; return pfp->threads;
@ -383,14 +383,13 @@ static int PfringConfigGeThreadsCount(void *conf)
static int PfringConfLevel(void) static int PfringConfLevel(void)
{ {
const char *def_dev; const char *def_dev = NULL;
/* 1.0 config should return a string */ /* 1.0 config should return a string */
if (ConfGet("pfring.interface", &def_dev) != 1) { if (ConfGet("pfring.interface", &def_dev) != 1) {
return PFRING_CONF_V2; return PFRING_CONF_V2;
} else { } else {
return PFRING_CONF_V1; return PFRING_CONF_V1;
} }
return PFRING_CONF_V2;
} }
static int GetDevAndParser(const char **live_dev, ConfigIfaceParserFunc *parser) static int GetDevAndParser(const char **live_dev, ConfigIfaceParserFunc *parser)
@ -441,7 +440,7 @@ int RunModeIdsPfringAutoFp(void)
} }
ret = RunModeSetLiveCaptureAutoFp(tparser, ret = RunModeSetLiveCaptureAutoFp(tparser,
PfringConfigGeThreadsCount, PfringConfigGetThreadsCount,
"ReceivePfring", "ReceivePfring",
"DecodePfring", thread_name_autofp, "DecodePfring", thread_name_autofp,
live_dev); live_dev);
@ -478,7 +477,7 @@ int RunModeIdsPfringSingle(void)
} }
ret = RunModeSetLiveCaptureSingle(tparser, ret = RunModeSetLiveCaptureSingle(tparser,
PfringConfigGeThreadsCount, PfringConfigGetThreadsCount,
"ReceivePfring", "ReceivePfring",
"DecodePfring", thread_name_single, "DecodePfring", thread_name_single,
live_dev); live_dev);
@ -515,7 +514,7 @@ int RunModeIdsPfringWorkers(void)
} }
ret = RunModeSetLiveCaptureWorkers(tparser, ret = RunModeSetLiveCaptureWorkers(tparser,
PfringConfigGeThreadsCount, PfringConfigGetThreadsCount,
"ReceivePfring", "ReceivePfring",
"DecodePfring", thread_name_workers, "DecodePfring", thread_name_workers,
live_dev); live_dev);

Loading…
Cancel
Save