/
output_modules.c
54 lines (43 loc) · 1.2 KB
/
output_modules.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* ZMap Copyright 2013 Regents of the University of Michigan
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*/
#include <stdio.h>
#include <string.h>
#include "output_modules.h"
extern output_module_t module_simple_file;
extern output_module_t module_extended_file;
// ADD YOUR MODULE HERE
#ifdef REDIS
extern output_module_t module_redis;
extern output_module_t module_ssldbfeed;
#endif
output_module_t* output_modules[] = {
&module_simple_file,
&module_extended_file,
#ifdef REDIS
&module_redis,
&module_ssldbfeed,
#endif
// ADD YOUR MODULE HERE
};
output_module_t* get_output_module_by_name(const char* name)
{
int num_modules = (int) (sizeof(output_modules)/sizeof(output_modules[0]));
for (int i=0; i < num_modules; i++) {
if (!strcmp(output_modules[i]->name, name)) {
return output_modules[i];
}
}
return NULL;
}
void print_output_modules(void)
{
int num_modules = (int) (sizeof(output_modules)/sizeof(output_modules[0]));
for (int i=0; i < num_modules; i++) {
printf("%s\n", output_modules[i]->name);
}
}