示例#1
0
// Placeholder for all the stuff to do when processing starts
static int core_processing_start() {

	core_pause_processing();

	if (*PTYPE_BOOL_GETVAL(core_param_offline_dns) && dns_core_init() != POM_OK) {
		core_resume_processing();
		return POM_ERR;
	}

	if (*PTYPE_BOOL_GETVAL(core_param_reset_perf_on_restart))
		registry_perf_reset_all();

	core_resume_processing();
	return POM_OK;
}
示例#2
0
// Placeholder for all the stuff to do when processing stops
static int core_processing_stop() {

	core_pause_processing();

	if (*PTYPE_BOOL_GETVAL(core_param_offline_dns))
		dns_core_cleanup();

	// Free all the conntracks
	proto_finish();

	// Give the analyzers the chance to clear their state
	analyzer_finish();

	core_resume_processing();

	return POM_OK;
}
示例#3
0
文件: registry.c 项目: k0a1a/pom-ng
int registry_set_param_value(struct registry_param *p, char *value) {

	if (!p || !value)
		return POM_ERR;

	if (p->flags & REGISTRY_PARAM_FLAG_IMMUTABLE)
		return POM_ERR;
	
	if (p->set_pre_callback && p->set_pre_callback(p->callback_priv, value) != POM_OK) {
		return POM_ERR;
	}

	core_pause_processing();

	struct ptype *old_value = ptype_alloc_from(p->value);

	if (ptype_parse_val(p->value, value) != POM_OK) {
		core_resume_processing();
		ptype_cleanup(old_value);
		return POM_ERR;
	}

	if (p->set_post_callback && p->set_post_callback(p->callback_priv, p->value) != POM_OK) {
		// Revert the old value
		ptype_copy(p->value, old_value);
		core_resume_processing();
		ptype_cleanup(old_value);
		return POM_ERR;
	}

	core_resume_processing();

	ptype_cleanup(old_value);
	
	return POM_OK;

}