Exemplo n.º 1
0
void
set_input(const char *name)
{
	static int set = 0;
	module_conf_t *ml, *m;
	
	if (set)
		return;
	set = 1;

	if (NULL == name || !strcasecmp(name, "list")) {
		list_input();
		exit(0);
	}
	
	ml = parse_module_param(name);

	for (m = ml; m; m = m->next) {
		preferred = get_input_module(ml->name);

		if (NULL == preferred)
			continue;

		if (preferred->im_set_opts)
			preferred->im_set_opts(ml->attrs);

		if (preferred->im_probe)
			if (preferred->im_probe())
				return;
	}

	quit("No (working) input module found\n");
}
Exemplo n.º 2
0
void
set_sec_input(const char *name)
{
	static int set = 0;
	module_conf_t *ml, *m;

	if (set)
		return;
	set = 1;

	if (NULL == name || !strcasecmp(name, "list")) {
		list_sec_input();
		exit(0);
	}
	
	ml = parse_module_param(name);

	for (m = ml; m; m = m->next) {
		struct input_module *i = get_sec_input_module(m->name);

		if (NULL == i)
			continue;

		if (i->im_set_opts)
			i->im_set_opts(ml->attrs);

		if (i->im_probe) {
			if (i->im_probe() == 1)
				i->im_enable = 1;
		}
	}
}
Exemplo n.º 3
0
void
set_sec_output(const char *name)
{
	module_conf_t *ml, *m;

	if (NULL == name || !strcasecmp(name, "list")) {
		list_sec_output();
		exit(0);
	}
	
	ml = parse_module_param(name);

	for (m = ml; m; m = m->next) {
		struct output_module *o = get_sec_output_module(m->name);

		if (NULL == o)
			continue;

		if (o->om_set_opts)
			o->om_set_opts(ml->attrs);

		if (o->om_probe) {
			if (o->om_probe() == 1)
				o->om_enable = 1;
		}
	}
}