ns-allinone-2.35/olsr/OLSR_rtable.cc
OLSR_rt_entry*
OLSR_rtable::add_entry(nsaddr_t dest, nsaddr_t next, nsaddr_t iface, u_int32_t dist) {
	// Creates a new rt entry with specified values
	OLSR_rt_entry* entry = new OLSR_rt_entry();
	entry->dest_addr()	= dest;
	entry->next_addr()	= next;
	entry->iface_addr()	= iface;
	entry->dist()		= dist;
	
	// Inserts the new entry
	rtable_t::iterator it = rt_.find(dest);
	if (it != rt_.end())
		delete (*it).second;
	rt_[dest] = entry;
	
	// Returns the new rt entry
	return entry;
}
///
/// \brief Adds a new entry into the routing table.
///
/// If an entry for the given destination existed, it is deleted and freed.
///
/// \param dest		address of the destination node.
/// \param next		address of the next hop node.
/// \param iface	address of the local interface.
/// \param dist		distance to the destination node.
/// \return		the routing table entry which has been added.
///
\brief Adds a new entry into the routing table.
If an entry for the given destination existed, it is deleted and freed.

\param dest            address of the destination node.
\param next            address of the next hop node.
\param iface   address of the local interface.
\param dist            distance to the destination node.
\return                the routing table entry which has been added.
\ brief Adds a new entry into the routing table . If an entry for the given destination existed it is deleted and freed . \ param dest address of the destination node . \ param next address of the next hop node . \ param iface address of the local interface . \ param dist distance to the destination node . \ return the routing table entry which has been added .
OLSR_rt_entry*
OLSR_rtable::add_entry(nsaddr_t dest, nsaddr_t next, nsaddr_t iface, u_int32_t dist) {
	OLSR_rt_entry* entry = new OLSR_rt_entry();
	entry->dest_addr()	= dest;
	entry->next_addr()	= next;
	entry->iface_addr()	= iface;
	entry->dist()		= dist;
	rtable_t::iterator it = rt_.find(dest);
	if (it != rt_.end())
		delete (*it).second;
	rt_[dest] = entry;
	return entry;
}
OLSR_rt_entry * OLSR_rtable :: add_entry ( nsaddr_t dest , nsaddr_t next , nsaddr_t iface , u_int32_t dist ) { OLSR_rt_entry * entry = new OLSR_rt_entry ( ) ; entry -> dest_addr ( ) = dest ; entry -> next_addr ( ) = next ; entry -> iface_addr ( ) = iface ; entry -> dist ( ) = dist ; rtable_t :: iterator it = rt_ . find ( dest ) ; if ( it != rt_ . end ( ) ) delete ( * it ) . second ; rt_ [ dest ] = entry ; return entry ; }
\brief Adds a new entry into the routing table.
\ brief Adds a new entry into the routing table .
// Creates a new rt entry with specified values // Inserts the new entry // Returns the new rt entry