You can add a variable in the C++ class and
update it in the code. 

Example:

In .h file:
MyClass {
  ...
  int dropCounter;
}

In .cc file:
MyClass::MyClass { //constructor
  ...
  dropCounter = 0; //init variable
}

MyClass::function {
  ...
  drop(p, DROP_REASON); //here a packet is dropped due to DROP_REASON
  dropCounter++;  //incr drop counter
  fprintf(sdterr,"dropCounter=%d",dropCounter);  //for debug
}

Good luck,

 ___________________________________
Helber Wagner da Silva
MSc. Student in Applied Informatics
University of Fortaleza - Ceará - Brazil
URL: http://www.nr2.ufpr.br/~helber





________________________________
De: F A <[email protected]>
Para: [email protected]
Enviadas: Domingo, 17 de Maio de 2009 13:42:10
Assunto: [ns] traffic statistics


Hi all,
Does anybody know how can I use traffic statistics while simulation is
running. To be specific I need to have number of packets being dropped in
each node on the fly.


I would appreciate any suggestions.
Thanks



      Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Reply via email to