ns-allinone-2.35/olsr/OLSR_printer.cc
void
OLSR_printer::print_nbset(Trace* out, nbset_t& nbset) {
	sprintf(out->pt_->buffer(), "P\tnb\tstatus\twillingness");
	printf("P\tnb\tstatus\twillingness\n");
	out->pt_->dump();
	for (nbset_t::iterator it = nbset.begin(); it != nbset.end(); it++) {
		OLSR_nb_tuple* tuple = *it;
		sprintf(out->pt_->buffer(), "P\t%d\t%d\t%d",
			OLSR::node_id(tuple->nb_main_addr()),
			tuple->status(),
			tuple->willingness());
		printf("P\t%d\t%d\t%d\n",
			OLSR::node_id(tuple->nb_main_addr()),
			tuple->status(),
			tuple->willingness());
		out->pt_->dump();
	}
}
///
/// \brief Prints a given Neighbor Set into a given trace file.
///
/// \param out		Trace where the Neighbor Set is going to be written.
/// \param nbset	Neighbor Set to be written.
///
\brief Prints a given Neighbor Set into a given trace file.
\param out             Trace where the Neighbor Set is going to be written.
\param nbset   Neighbor Set to be written.
\ brief Prints a given Neighbor Set into a given trace file . \ param out Trace where the Neighbor Set is going to be written . \ param nbset Neighbor Set to be written .
void
OLSR_printer::print_nbset(Trace* out, nbset_t& nbset) {
	sprintf(out->pt_->buffer(), "P\tnb\tstatus\twillingness");
	printf("P\tnb\tstatus\twillingness\n");
	out->pt_->dump();
	for (nbset_t::iterator it = nbset.begin(); it != nbset.end(); it++) {
		OLSR_nb_tuple* tuple = *it;
		sprintf(out->pt_->buffer(), "P\t%d\t%d\t%d",
			OLSR::node_id(tuple->nb_main_addr()),
			tuple->status(),
			tuple->willingness());
		printf("P\t%d\t%d\t%d\n",
			OLSR::node_id(tuple->nb_main_addr()),
			tuple->status(),
			tuple->willingness());
		out->pt_->dump();
	}
}
void OLSR_printer :: print_nbset ( Trace * out , nbset_t & nbset ) { sprintf ( out -> pt_ -> buffer ( ) , " \t \t \t " ) ; printf ( " \t \t \t \n " ) ; out -> pt_ -> dump ( ) ; for ( nbset_t :: iterator it = nbset . begin ( ) ; it != nbset . end ( ) ; it ++ ) { OLSR_nb_tuple * tuple = * it ; sprintf ( out -> pt_ -> buffer ( ) , " \t \t \t " , OLSR :: node_id ( tuple -> nb_main_addr ( ) ) , tuple -> status ( ) , tuple -> willingness ( ) ) ; printf ( " \t \t \t \n " , OLSR :: node_id ( tuple -> nb_main_addr ( ) ) , tuple -> status ( ) , tuple -> willingness ( ) ) ; out -> pt_ -> dump ( ) ; } }
\brief Prints a given Neighbor Set into a given trace file.
\ brief Prints a given Neighbor Set into a given trace file .