Bin Class Reference

#include <bin.h>

Inheritance diagram for Bin:

Inheritance graph
[legend]
Collaboration diagram for Bin:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Bin ()
virtual ~Bin ()
virtual int command (int argc, const char *const *argv)
void drop (Packet *p, int depth, const char *reason="---")
void drop (ClMessage *m, const char *reason="---")
void handle (Event *e)

Protected Attributes

char preamble_ [MAX_PREAMBLE_LENGTH]
int depth_

Detailed Description

The BIN class is a SAP and a ClSAP which is used to drop packets or ClMessages. It has tracing functionality, thus it could trace the packets which pass through.

See also:
ClMessageTracer, ClSAP, ClTracer, Module, NodeCore, PktTracer, Plugin, Tracer, SAP

Definition at line 50 of file bin.h.


Constructor & Destructor Documentation

Bin::Bin (  ) 

Bin constructor

Definition at line 47 of file bin.cc.

References depth_, and preamble_.

Bin::~Bin (  )  [virtual]

Bin destructor

Definition at line 53 of file bin.cc.


Member Function Documentation

int Bin::command ( int  argc,
const char *const *  argv 
) [virtual]

TCL command interpreter. It implements the following OTcl methods:

Note that it inherits all the OTcl method of ConnectTrace (not SAP or ClSAP !!!)

Parameters:
argc number of arguments in argv
argv array of strings which are the comand parameters (Note that argv[0] is the name of the object)
Returns:
TCL_OK or TCL_ERROR whether the command has been dispatched succesfully or no
See also:
Module

Reimplemented from ClSAP.

Definition at line 58 of file bin.cc.

References ConnectorTrace::command(), and preamble_.

Here is the call graph for this function:

void Bin::drop ( Packet *  p,
int  depth,
const char *  reason = "---" 
)

Write the trace for the dropping of a Packet and free the packet

Parameters:
p pointer of the packet which has to be dropped
depth verbosity of the trace. If this param is less or equal to the depth_ class attribute a new line on the trace file will be add
reason reason for the drop

Definition at line 69 of file bin.cc.

References ConnectorTrace::debug_, depth_, ConnectorTrace::dump(), SAP::pktTr_, preamble_, PktTracer::trace(), and ConnectorTrace::writeTrace().

Referenced by PlugIn::drop(), and Module::drop().

Here is the call graph for this function:

void Bin::drop ( ClMessage m,
const char *  reason = "---" 
)

Write the trace for the dropping of a cross-layer command message

Parameters:
m pointer of the ClMessage which has to be dropped
reason reason for the drop

Definition at line 84 of file bin.cc.

References ConnectorTrace::clTr_, ConnectorTrace::dump(), preamble_, ClTracer::trace(), and ConnectorTrace::writeTrace().

Here is the call graph for this function:

void Bin::handle ( Event *  e  )  [virtual]

This method has an empty body; it is here for multi inherits troubles

Reimplemented from ClSAP.

Definition at line 93 of file bin.cc.


Member Data Documentation

char Bin::preamble_[MAX_PREAMBLE_LENGTH] [protected]

String added in the trace of the packet or the CLMessage

Definition at line 103 of file bin.h.

Referenced by Bin(), command(), and drop().

int Bin::depth_ [protected]

Reference verbosity level (binded in Tcl)

Reimplemented from ConnectorTrace.

Definition at line 105 of file bin.h.

Referenced by Bin(), and drop().


The documentation for this class was generated from the following files:
Generated on Wed Nov 26 15:48:26 2008 for NS-MIRACLE library by  doxygen 1.5.2