ns-allinone-2.35/olsr/OLSR_printer.cc
void
OLSR_printer::print_linkset(Trace* out, linkset_t& linkset) {
	sprintf(out->pt_->buffer(), "P\tlocal\tnb\tsym\t\tasym\t\tlost\t\ttime");
	printf("P\tlocal\tnb\tsym\t\tasym\t\tlost\t\ttime\n");
	out->pt_->dump();
	for (linkset_t::iterator it = linkset.begin(); it != linkset.end(); it++) {
		OLSR_link_tuple* tuple = *it;
		sprintf(out->pt_->buffer(), "P\t%d\t%d\t%f\t%f\t%f\t%f",
			OLSR::node_id(tuple->local_iface_addr()),
			OLSR::node_id(tuple->nb_iface_addr()),
			tuple->sym_time(),
			tuple->asym_time(),
			tuple->lost_time(),
			tuple->time());
		printf("P\t%d\t%d\t%f\t%f\t%f\t%f\n",
			OLSR::node_id(tuple->local_iface_addr()),
			OLSR::node_id(tuple->nb_iface_addr()),
			tuple->sym_time(),
			tuple->asym_time(),
			tuple->lost_time(),
			tuple->time());
		out->pt_->dump();
	}
}
///
/// \brief Prints a given Link Set into a given trace file.
///
/// \param out		Trace where the Link Set is going to be written.
/// \param linkset	Link Set to be written.
///
\brief Prints a given Link Set into a given trace file.
\param out             Trace where the Link Set is going to be written.
\param linkset Link Set to be written.
\ brief Prints a given Link Set into a given trace file . \ param out Trace where the Link Set is going to be written . \ param linkset Link Set to be written .
void
OLSR_printer::print_linkset(Trace* out, linkset_t& linkset) {
	sprintf(out->pt_->buffer(), "P\tlocal\tnb\tsym\t\tasym\t\tlost\t\ttime");
	printf("P\tlocal\tnb\tsym\t\tasym\t\tlost\t\ttime\n");
	out->pt_->dump();
	for (linkset_t::iterator it = linkset.begin(); it != linkset.end(); it++) {
		OLSR_link_tuple* tuple = *it;
		sprintf(out->pt_->buffer(), "P\t%d\t%d\t%f\t%f\t%f\t%f",
			OLSR::node_id(tuple->local_iface_addr()),
			OLSR::node_id(tuple->nb_iface_addr()),
			tuple->sym_time(),
			tuple->asym_time(),
			tuple->lost_time(),
			tuple->time());
		printf("P\t%d\t%d\t%f\t%f\t%f\t%f\n",
			OLSR::node_id(tuple->local_iface_addr()),
			OLSR::node_id(tuple->nb_iface_addr()),
			tuple->sym_time(),
			tuple->asym_time(),
			tuple->lost_time(),
			tuple->time());
		out->pt_->dump();
	}
}
void OLSR_printer :: print_linkset ( Trace * out , linkset_t & linkset ) { sprintf ( out -> pt_ -> buffer ( ) , " \t \t \t \t \t \t \t \t \t " ) ; printf ( " \t \t \t \t \t \t \t \t \t \n " ) ; out -> pt_ -> dump ( ) ; for ( linkset_t :: iterator it = linkset . begin ( ) ; it != linkset . end ( ) ; it ++ ) { OLSR_link_tuple * tuple = * it ; sprintf ( out -> pt_ -> buffer ( ) , " \t \t \t \t \t \t " , OLSR :: node_id ( tuple -> local_iface_addr ( ) ) , OLSR :: node_id ( tuple -> nb_iface_addr ( ) ) , tuple -> sym_time ( ) , tuple -> asym_time ( ) , tuple -> lost_time ( ) , tuple -> time ( ) ) ; printf ( " \t \t \t \t \t \t \n " , OLSR :: node_id ( tuple -> local_iface_addr ( ) ) , OLSR :: node_id ( tuple -> nb_iface_addr ( ) ) , tuple -> sym_time ( ) , tuple -> asym_time ( ) , tuple -> lost_time ( ) , tuple -> time ( ) ) ; out -> pt_ -> dump ( ) ; } }
\brief Prints a given Link Set into a given trace file.
\ brief Prints a given Link Set into a given trace file .