/**
 * Frees all memory. Call this when the application terminates
 */
void destroyConcentrator() {
	int i;

	if (ipfixReceiver) {
		debug("stopping collector");
		stopRcvIpfix(ipfixReceiver);
		rcvIpfixClose(ipfixReceiver);
		deinitializeRcvIpfix();
		ipfixReceiver = 0;
		}
	
	if (rules) {
		debug("stopping aggregator");
		for (i = 0; i < rules->count; i++) {
			destroyHashtable(rules->rule[i]->hashtable);
			}
		destroyRules(rules);
		rules = 0;
		}

	if (ipfixSender) {
		debug("stopping exporter");
		stopSndIpfix(ipfixSender);
		sndIpfixClose(ipfixSender);
		deinitializeSndIpfix();	
		ipfixSender = 0;
		}
	}
示例#2
0
/**
 * Frees memory used by an Aggregator.
 * Make sure the Aggregator is not being used before calling this method.
 * @param ipfixAggregator handle of Aggregator
 */
void destroyAggregator(IpfixAggregator* ipfixAggregator)
{
	Rules* rules = ((IpfixAggregator*)ipfixAggregator)->rules;

	int i;
	for (i = 0; i < rules->count; i++) {
		destroyHashtable(rules->rule[i]->hashtable);

	pthread_mutex_unlock(&((IpfixAggregator*)ipfixAggregator)->mutex);
	pthread_mutex_destroy(&((IpfixAggregator*)ipfixAggregator)->mutex);

	free(ipfixAggregator);
	}

	destroyRules(rules);
}
示例#3
0
IEGoal::~IEGoal ()
{
    destroyRules();
}