40 #ifdef WITH_PLUGIN_PCAP
41 #include "corsaro_pcap.h"
44 #ifdef WITH_PLUGIN_SIXT
48 #ifdef WITH_PLUGIN_DOS
49 #include "corsaro_dos.h"
61 #define LOG(manager) (manager->logfile)
64 #define PLUGIN_INIT_ADD(plugin) \
66 tail = add_plugin(manager, tail, plugin##_alloc(), \
76 #ifdef ED_PLUGIN_INIT_ALL_ENABLED
81 assert(plugin != NULL);
82 assert(plugin->
name != NULL);
84 assert(plugin->
magic > 0x010101);
98 assert(plugin->
next == NULL);
103 #ifdef ED_PLUGIN_INIT_ALL_ENABLED
112 if(corsaro_plugin_is_enabled(manager, p) == 0)
121 corsaro_log_file(__func__, NULL,
"could not malloc plugin");
129 corsaro_log_file(__func__, LOG(manager),
"%s plugin failed to initialize", name);
134 corsaro_plugin_verify(plugin);
139 assert(tail->
next == NULL);
155 corsaro_log_file(__func__, LOG(manager),
156 "WARNING: No plugins are initialized");
164 corsaro_log_file(__func__, LOG(manager),
165 "could not malloc plugin array");
172 corsaro_log_file(__func__, LOG(manager),
173 "could not malloc plugin state array");
176 for(tmp=plugin_list;tmp!=NULL;tmp=tmp->
next)
193 #ifdef ED_PLUGIN_INIT_ALL_ENABLED
201 corsaro_log_file(__func__, logfile,
"failed to malloc plugin manager");
217 #ifdef ED_PLUGIN_INIT_ALL_ENABLED
218 ED_PLUGIN_INIT_ALL_ENABLED
221 if(populate_plugin_arrays(manager, plugin_cnt, list) != 0)
223 corsaro_plugin_manager_free(manager);
243 while((p = corsaro_plugin_next(manager, p)) != NULL)
296 corsaro_log(__func__, NULL,
"possible double-free of plugin manager");
305 if(manager->
plugins[i] != NULL)
335 assert(manager != NULL);
348 while((p = corsaro_plugin_next(manager, p)) != NULL)
350 if(strlen(name) == strlen(p->
name) &&
351 strncasecmp(name, p->
name, strlen(p->
name)) == 0)
382 assert(manager != NULL);
383 assert(plugin != NULL);
384 assert(state != NULL);
392 assert(manager != NULL);
393 assert(plugin != NULL);
401 assert(fname != NULL);
402 assert(plugin != NULL && plugin->
name != NULL);
404 if(strstr(fname, plugin->
name) != NULL)
415 if((plugin = corsaro_plugin_get_by_id(manager,
id)) == NULL)
446 const char *plugin_name)
451 assert(manager != NULL);
454 if((plugin = corsaro_plugin_get_by_name(manager, plugin_name)) == NULL)
456 corsaro_log_file(__func__, LOG(manager),
457 "No plugin found with the name %s\n", plugin_name);
458 corsaro_log_file(__func__, LOG(manager),
459 "Is corsaro compiled with all necessary plugins?");
478 corsaro_log_file(__func__, LOG(manager),
479 "could not extend the enabled plugins array");