File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 1313
1414#define IPXP_APP_NAME "ipfixprobe"
1515#define IPXP_APP_VERSION "@VERSION@"
16+
17+ #define IPXP_DEFAULT_PLUGINS_DIR "@INSTALL_DIR_LIB@/ipfixprobe/"
Original file line number Diff line number Diff line change 2828
2929#include " ipfixprobe.hpp"
3030
31- #include " buildConfig.hpp"
32-
3331#include < fstream>
3432#include < future>
3533#include < iomanip>
@@ -637,7 +635,7 @@ int run(int argc, char* argv[])
637635 goto EXIT;
638636 }
639637
640- conf.pluginManager .loadPlugins (" /usr/local/lib64/ipfixprobe/ " , loadPluginsRecursive);
638+ conf.pluginManager .loadPlugins (parser. m_plugins_path , loadPluginsRecursive);
641639
642640 printPlugins ();
643641
Original file line number Diff line number Diff line change 2929#ifndef IPXP_IPFIXPROBE_HPP
3030#define IPXP_IPFIXPROBE_HPP
3131
32+ #include " buildConfig.hpp"
3233#include " pluginManager.hpp"
3334#include " workers.hpp"
3435
@@ -91,6 +92,7 @@ class IpfixprobeOptParser : public OptionsParser {
9192 std::string m_help_str;
9293 bool m_version;
9394 std::vector<int > m_cpu_mask;
95+ std::string m_plugins_path;
9496
9597 IpfixprobeOptParser ()
9698 : OptionsParser(" ipfixprobe" , " flow exporter supporting various custom IPFIX elements" )
@@ -105,6 +107,7 @@ class IpfixprobeOptParser : public OptionsParser {
105107 , m_help(false )
106108 , m_help_str(" " )
107109 , m_version(false )
110+ , m_plugins_path(IPXP_DEFAULT_PLUGINS_DIR)
108111 {
109112 m_delim = ' ' ;
110113
@@ -238,6 +241,16 @@ class IpfixprobeOptParser : public OptionsParser {
238241 return m_pid != " " ;
239242 },
240243 OptionFlags::RequiredArgument);
244+ register_option (
245+ " -L" ,
246+ " --plugins-path" ,
247+ " PATH" ,
248+ " Path to the directory with plugins. Default: " IPXP_DEFAULT_PLUGINS_DIR,
249+ [this ](const char * arg) {
250+ m_plugins_path = arg;
251+ return m_plugins_path != " " ;
252+ },
253+ OptionFlags::RequiredArgument);
241254 register_option (
242255 " -d" ,
243256 " --daemon" ,
You can’t perform that action at this time.
0 commit comments