Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

NoDupChannel Class Reference

Inheritance diagram for NoDupChannel:

Inheritance graph
[legend]
Collaboration diagram for NoDupChannel:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void recv (Packet *p, Handler *)
void handle (Event *)
virtual int command (int argc, const char *const *argv)
double maxdelay ()
int index ()

Public Attributes

if_head ifhead_
TclObjectgridkeeper_

Protected Member Functions

virtual double get_pdelay (Node *tnode, Node *rnode)

Protected Attributes

int phy_counter_
int index_
double delay_
Tracetrace_

Private Member Functions

void sendUp (Packet *p, Phy *txif)

Member Function Documentation

int Channel::command int  argc,
const char *const *  argv
[virtual, inherited]
 

Definition at line 97 of file channel.cc.

References Channel::ifhead_, Channel::index_, and Channel::trace_.

00098 {
00099         
00100         if (argc == 3) {
00101                 TclObject *obj;
00102 
00103                 if( (obj = TclObject::lookup(argv[2])) == 0) {
00104                         fprintf(stderr, "%s lookup failed\n", argv[1]);
00105                         return TCL_ERROR;
00106                 }
00107                 if (strcmp(argv[1], "trace-target") == 0) {
00108                         trace_ = (Trace*) obj;
00109                         return (TCL_OK);
00110                 }
00111                 else if(strcmp(argv[1], "addif") == 0) {
00112                         ((Phy*) obj)->insertchnl(&ifhead_);
00113                         ((Phy*) obj)->setchnl(this);
00114                         return TCL_OK;
00115                 }
00116                 // add interface for grid_keeper_
00117                 /*else if(strncasecmp(argv[1], "grid_keeper", 5) == 0) {
00118                         grid_keeper_ = (GridKeeper*)obj;
00119                         return TCL_OK;
00120                         }*/
00121         } else if (argc == 2) {
00122                 Tcl& tcl = Tcl::instance();
00123                 if (strcmp(argv[1], "trace-target") == 0) {
00124                         tcl.resultf("%s", trace_->name());
00125                         return (TCL_OK);
00126                 }
00127                 else if(strcmp(argv[1], "id") == 0) {
00128                         tcl.resultf("%d", index_);
00129                         return TCL_OK;
00130                 }
00131         }
00132         return TclObject::command(argc, argv);
00133 }

double Channel::get_pdelay Node tnode,
Node rnode
[protected, virtual, inherited]
 

Reimplemented in WirelessChannel, and SatChannel.

Definition at line 212 of file channel.cc.

References Channel::delay_.

Referenced by Channel::sendUp().

00213 {
00214         // Dummy function
00215         return delay_;
00216 }

void NoDupChannel::handle Event  )  [virtual]
 

Implements Handler.

Definition at line 274 of file channel.cc.

References ChannelDelayEvent::p_, sendUp(), and ChannelDelayEvent::txphy_.

00274                                   {
00275         ChannelDelayEvent *cde = (ChannelDelayEvent *)e;
00276         sendUp(cde->p_, cde->txphy_);
00277         delete cde;
00278 }

Here is the call graph for this function:

int Channel::index  )  [inline, inherited]
 

Definition at line 67 of file channel.h.

References Channel::index_.

00067 {return index_;}

double Channel::maxdelay  )  [inline, inherited]
 

Definition at line 66 of file channel.h.

References Channel::delay_.

Referenced by Mac802_3::sendDown().

00066 { return delay_; };

void NoDupChannel::recv Packet p,
Handler
[virtual]
 

Reimplemented from Channel.

Definition at line 267 of file channel.cc.

References hdr_cmn::access(), Channel::delay_, hdr_cmn::DOWN, Scheduler::instance(), and Scheduler::schedule().

00267                                              {
00268         assert(hdr_cmn::access(p)->direction() == hdr_cmn::DOWN);
00269         // Delay this packet
00270         Scheduler &s = Scheduler::instance();
00271         ChannelDelayEvent *de = new ChannelDelayEvent(p, (Phy *)h);
00272         s.schedule(this, de, delay_);
00273 }

Here is the call graph for this function:

void NoDupChannel::sendUp Packet p,
Phy txif
[private, virtual]
 

Reimplemented from Channel.

Definition at line 280 of file channel.cc.

References Packet::free(), HDR_CMN, Channel::ifhead_, Phy::nextchnl(), Phy::recv(), Packet::refcopy(), and hdr_cmn::UP.

Referenced by handle().

00280                                               {
00281         struct hdr_cmn *hdr = HDR_CMN(p);
00282         hdr->direction() = hdr_cmn::UP;
00283 
00284         for(Phy *rifp = ifhead_.lh_first; rifp; rifp = rifp->nextchnl()) {
00285                 if(rifp == txif)
00286                         continue;
00287                 rifp->recv(p->refcopy(), 0);
00288         }
00289         Packet::free(p);
00290 }

Here is the call graph for this function:


Member Data Documentation

double Channel::delay_ [protected, inherited]
 

Definition at line 80 of file channel.h.

Referenced by Channel::Channel(), Channel::get_pdelay(), Channel::maxdelay(), and recv().

TclObject* Channel::gridkeeper_ [inherited]
 

Definition at line 65 of file channel.h.

struct if_head Channel::ifhead_ [inherited]
 

Definition at line 64 of file channel.h.

Referenced by SatChannel::add_interface(), Channel::Channel(), Channel::command(), SatRouteObject::compute_topology(), Channel::dump(), SatChannel::find_peer_mac_addr(), LinkHandoffMgr::get_peer(), LinkHandoffMgr::get_peer_linkhead(), SatLinkHandoffMgr::handoff(), TermLinkHandoffMgr::handoff(), sendUp(), and Channel::sendUp().

int Channel::index_ [protected, inherited]
 

Definition at line 79 of file channel.h.

Referenced by Channel::Channel(), Channel::command(), SatChannel::getId(), and Channel::index().

int NoDupChannel::phy_counter_ [protected]
 

Definition at line 261 of file channel.cc.

Trace* Channel::trace_ [protected, inherited]
 

Definition at line 85 of file channel.h.

Referenced by Channel::command().


The documentation for this class was generated from the following file:
Generated on Tue Apr 20 13:05:48 2004 for NS2.26SourcesOriginal by doxygen 1.3.3