ns-allinone-2.35/olsr/OLSR_rtable.cc
void
OLSR_rtable::print(Trace* out) {
	sprintf(out->pt_->buffer(), "P\tdest\tnext\tiface\tdist");
	out->pt_->dump();
	for (rtable_t::iterator it = rt_.begin(); it != rt_.end(); it++) {
		OLSR_rt_entry* entry = (*it).second;
		sprintf(out->pt_->buffer(), "P\t%d\t%d\t%d\t%d",
			OLSR::node_id(entry->dest_addr()),
			OLSR::node_id(entry->next_addr()),
			OLSR::node_id(entry->iface_addr()),
			entry->dist());
		printf("\tdest\tnext\tiface\tdist\n");
		printf("\t%d\t%d\t%d\t%d\n",OLSR::node_id(entry->dest_addr()),OLSR::node_id(entry->next_addr()),OLSR::node_id(entry->iface_addr()),entry->dist());
		out->pt_->dump();
	}
}
///
/// \brief Prints out the content of the routing table to a given trace file.
///
/// Content is represented as a table in which each line is preceeded by a 'P'.
/// First line contains the name of every column (dest, next, iface, dist)
/// and the following ones are the values of each entry.
///
/// \param out the Trace where the routing table must be written into.
///
\brief Prints out the content of the routing table to a given trace file.
Content is represented as a table in which each line is preceeded by a 'P'.
First line contains the name of every column (dest, next, iface, dist)
and the following ones are the values of each entry.

\param out the Trace where the routing table must be written into.
\ brief Prints out the content of the routing table to a given trace file . Content is represented as a table in which each line is preceeded by a ' P ' . First line contains the name of every column ( dest next iface dist ) and the following ones are the values of each entry . \ param out the Trace where the routing table must be written into .
void
OLSR_rtable::print(Trace* out) {
	sprintf(out->pt_->buffer(), "P\tdest\tnext\tiface\tdist");
	out->pt_->dump();
	for (rtable_t::iterator it = rt_.begin(); it != rt_.end(); it++) {
		OLSR_rt_entry* entry = (*it).second;
		sprintf(out->pt_->buffer(), "P\t%d\t%d\t%d\t%d",
			OLSR::node_id(entry->dest_addr()),
			OLSR::node_id(entry->next_addr()),
			OLSR::node_id(entry->iface_addr()),
			entry->dist());
		printf("\tdest\tnext\tiface\tdist\n");
		printf("\t%d\t%d\t%d\t%d\n",OLSR::node_id(entry->dest_addr()),OLSR::node_id(entry->next_addr()),OLSR::node_id(entry->iface_addr()),entry->dist());
		out->pt_->dump();
	}
}
void OLSR_rtable :: print ( Trace * out ) { sprintf ( out -> pt_ -> buffer ( ) , " \t \t \t \t " ) ; out -> pt_ -> dump ( ) ; for ( rtable_t :: iterator it = rt_ . begin ( ) ; it != rt_ . end ( ) ; it ++ ) { OLSR_rt_entry * entry = ( * it ) . second ; sprintf ( out -> pt_ -> buffer ( ) , " \t \t \t \t " , OLSR :: node_id ( entry -> dest_addr ( ) ) , OLSR :: node_id ( entry -> next_addr ( ) ) , OLSR :: node_id ( entry -> iface_addr ( ) ) , entry -> dist ( ) ) ; printf ( " \t \t \t \t \n " ) ; printf ( " \t \t \t \t \n " , OLSR :: node_id ( entry -> dest_addr ( ) ) , OLSR :: node_id ( entry -> next_addr ( ) ) , OLSR :: node_id ( entry -> iface_addr ( ) ) , entry -> dist ( ) ) ; out -> pt_ -> dump ( ) ; } }
\brief Prints out the content of the routing table to a given trace file.
\ brief Prints out the content of the routing table to a given trace file .