Esempio n. 1
0
bool dst_entry::resolve_net_dev()
{
	bool ret_val = false;

	cache_entry_subject<route_rule_table_key, route_val*>* p_ces = NULL;
	
	if (ZERONET_N(m_dst_ip.get_in_addr())) {
		dst_logdbg("VMA does not offload zero net IP address");
		return ret_val;
	}

	if (LOOPBACK_N(m_dst_ip.get_in_addr())) {
		dst_logdbg("VMA does not offload local loopback IP address");
		return ret_val;
	}
	
	
	route_rule_table_key rtk(m_dst_ip.get_in_addr(), m_bound_ip ? m_bound_ip : m_so_bindtodevice_ip, m_tos);
	
	if (m_p_rt_entry || g_p_route_table_mgr->register_observer(rtk, this, &p_ces)) {
	
		if (m_p_rt_entry == NULL) {
			// In case this is the first time we trying to resolve route entry,
			// means that register_observer was run
			m_p_rt_entry = dynamic_cast<route_entry*>(p_ces);
		}

		if(update_rt_val()) {
			ret_val = update_net_dev_val();
		}
	}
	return ret_val;
}
Esempio n. 2
0
bool dst_entry::resolve_net_dev()
{
	bool ret_val = false;

	cache_entry_subject<ip_address, route_val*>* p_ces = NULL;
	if (m_p_rt_entry || g_p_route_table_mgr->register_observer(m_dst_ip, this, &p_ces)) {
		if (m_p_rt_entry == NULL) {
			// In case this is the first time we trying to resolve route entry,
			// means that register_observer was run
			m_p_rt_entry = dynamic_cast<route_entry*>(p_ces);
		}
		if (m_p_rt_entry) {
			if(update_rt_val()) {
				ret_val = update_net_dev_val();
			}
		}
		else {
			dst_logdbg("Route entry is not exist");
		}
	}
	return ret_val;
}