示例#1
0
rfs::~rfs()
{
	// If filter, need to detach flow only if this is the last attached rule for this specific filter group (i.e. counter == 0)
	if (m_p_rule_filter) {
		rule_filter_map_t::iterator filter_iter = m_p_rule_filter->m_map.find(m_p_rule_filter->m_key);
		if (filter_iter !=  m_p_rule_filter->m_map.end() && (m_b_tmp_is_attached == true)) {
			filter_iter->second.counter = (filter_iter->second.counter > 0 ? ((filter_iter->second.counter) - 1) : 0);
			if (filter_iter->second.counter == 0) {
				destroy_ibv_flow();
				m_p_rule_filter->m_map.erase(m_p_rule_filter->m_key);
			}
		}
	} else {
		if (m_b_tmp_is_attached) {
			destroy_ibv_flow();
		}
	}

	if (m_p_rule_filter) {
		delete m_p_rule_filter;
		m_p_rule_filter = NULL;
	}
	delete[] m_sinks_list;

	while (m_attach_flow_data_vector.size() > 0) {
		delete m_attach_flow_data_vector.back();
		m_attach_flow_data_vector.pop_back();
	}
}
示例#2
0
rfs::~rfs()
{
	// If IB MC flow, need to detach flow only if this is the last attached rule for this specific MC group (i.e. counter == 0)
	if ((m_p_ring->get_transport_type() == VMA_TRANSPORT_IB) && (m_flow_tuple.is_udp_mc())) {
		ib_mc_ip_attach_map_t::iterator ib_mc_iter = m_p_ring->m_ib_mc_ip_attach_map.find(m_flow_tuple.get_dst_ip());
		if (ib_mc_iter != IB_MC_MAP_NULL && (m_b_tmp_is_attached == true)) {
			m_p_ring->m_ib_mc_ip_attach_map[m_flow_tuple.get_dst_ip()].counter = (ib_mc_iter->second.counter > 0 ? ((ib_mc_iter->second.counter) - 1) : 0);
			if (ib_mc_iter->second.counter == 0) {
				destroy_ibv_flow();
				m_p_ring->m_ib_mc_ip_attach_map.erase(m_flow_tuple.get_dst_ip());
			}
		}
	} else {
		if (m_b_tmp_is_attached) {
			destroy_ibv_flow();
		}
	}

	delete[] m_sinks_list;

	while (m_attach_flow_data_vector.size() > 0) {
		delete m_attach_flow_data_vector.back();
		m_attach_flow_data_vector.pop_back();
	}
}