Skip to content

Commit 2df1975

Browse files
Pavel ŠiškaPavel Siska
authored andcommitted
ipfixprobe - add option -L PATH to specify plugins path
1 parent 7dea033 commit 2df1975

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/core/ipfixprobe.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ int run(int argc, char* argv[])
637637
goto EXIT;
638638
}
639639

640-
conf.pluginManager.loadPlugins("/usr/local/lib64/ipfixprobe/", loadPluginsRecursive);
640+
conf.pluginManager.loadPlugins(parser.m_plugins_path, loadPluginsRecursive);
641641

642642
printPlugins();
643643

src/core/ipfixprobe.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class IpfixprobeOptParser : public OptionsParser {
9191
std::string m_help_str;
9292
bool m_version;
9393
std::vector<int> m_cpu_mask;
94+
std::string m_plugins_path;
9495

9596
IpfixprobeOptParser()
9697
: OptionsParser("ipfixprobe", "flow exporter supporting various custom IPFIX elements")
@@ -105,6 +106,7 @@ class IpfixprobeOptParser : public OptionsParser {
105106
, m_help(false)
106107
, m_help_str("")
107108
, m_version(false)
109+
, m_plugins_path("/usr/lib64/ipfixprobe/")
108110
{
109111
m_delim = ' ';
110112

@@ -238,6 +240,16 @@ class IpfixprobeOptParser : public OptionsParser {
238240
return m_pid != "";
239241
},
240242
OptionFlags::RequiredArgument);
243+
register_option(
244+
"-L",
245+
"--plugins-path",
246+
"PATH",
247+
"Path to the directory with plugins",
248+
[this](const char* arg) {
249+
m_plugins_path = arg;
250+
return m_plugins_path != "";
251+
},
252+
OptionFlags::RequiredArgument);
241253
register_option(
242254
"-d",
243255
"--daemon",

0 commit comments

Comments
 (0)