diff options
author | Gerald Combs <gerald@wireshark.org> | 2023-01-18 15:28:43 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2023-01-19 00:17:08 +0000 |
commit | 24ab9c0aaad4c1c022f735c04322898cb9be693d (patch) | |
tree | 8cd6c8795eefc819c8c049327522c998aad9a711 /plugins | |
parent | de7ca4c64a8aa5a1f1c62d351928bbf870e6bc18 (diff) |
Falco bridge+falcodump: Scan for personal plugins
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/epan/falco_bridge/packet-falco-bridge.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/plugins/epan/falco_bridge/packet-falco-bridge.c b/plugins/epan/falco_bridge/packet-falco-bridge.c index 765433764a..21e7dfcf94 100644 --- a/plugins/epan/falco_bridge/packet-falco-bridge.c +++ b/plugins/epan/falco_bridge/packet-falco-bridge.c @@ -377,7 +377,8 @@ proto_register_falcoplugin(void) WS_DIR *dir; WS_DIRENT *file; char *filename; - char *dname = g_build_filename(get_plugins_dir_with_version(), "falco", NULL); + char *spdname = g_build_filename(get_plugins_dir_with_version(), "falco", NULL); + char *ppdname = g_build_filename(get_plugins_pers_dir_with_version(), "falco", NULL); /* * We scan the plugins directory twice. The first time we count how many @@ -385,7 +386,14 @@ proto_register_falcoplugin(void) * amount of memory. The second time we actually load and configure * each plugin. */ - if ((dir = ws_dir_open(dname, 0, NULL)) != NULL) { + if ((dir = ws_dir_open(spdname, 0, NULL)) != NULL) { + while ((ws_dir_read_name(dir)) != NULL) { + nbridges++; + } + ws_dir_close(dir); + } + + if ((dir = ws_dir_open(ppdname, 0, NULL)) != NULL) { while ((ws_dir_read_name(dir)) != NULL) { nbridges++; } @@ -397,15 +405,26 @@ proto_register_falcoplugin(void) bridges = g_new0(bridge_info, nbridges); nbridges = 0; - if ((dir = ws_dir_open(dname, 0, NULL)) != NULL) { + if ((dir = ws_dir_open(spdname, 0, NULL)) != NULL) { + while ((file = ws_dir_read_name(dir)) != NULL) { + filename = g_build_filename(spdname, ws_dir_get_name(file), NULL); + import_plugin(filename); + g_free(filename); + } + ws_dir_close(dir); + } + + if ((dir = ws_dir_open(ppdname, 0, NULL)) != NULL) { while ((file = ws_dir_read_name(dir)) != NULL) { - filename = g_build_filename(dname, ws_dir_get_name(file), NULL); + filename = g_build_filename(ppdname, ws_dir_get_name(file), NULL); import_plugin(filename); g_free(filename); } ws_dir_close(dir); } - g_free(dname); + + g_free(spdname); + g_free(ppdname); /* * Setup protocol subtree array |