

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_ |
| TclObject * | gridkeeper_ |
Protected Member Functions | |
| virtual double | get_pdelay (Node *tnode, Node *rnode) |
Protected Attributes | |
| int | phy_counter_ |
| int | index_ |
| double | delay_ |
| Trace * | trace_ |
Private Member Functions | |
| void | sendUp (Packet *p, Phy *txif) |
|
||||||||||||
|
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 }
|
|
||||||||||||
|
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 }
|
|
|
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:

|
|
Definition at line 67 of file channel.h. References Channel::index_.
00067 {return index_;}
|
|
|
Definition at line 66 of file channel.h. References Channel::delay_. Referenced by Mac802_3::sendDown().
00066 { return delay_; };
|
|
||||||||||||
|
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:

|
||||||||||||
|
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:

|
|
Definition at line 80 of file channel.h. Referenced by Channel::Channel(), Channel::get_pdelay(), Channel::maxdelay(), and recv(). |
|
|
|
|
|
|
Definition at line 79 of file channel.h. Referenced by Channel::Channel(), Channel::command(), SatChannel::getId(), and Channel::index(). |
|
|
Definition at line 261 of file channel.cc. |
|
|
Definition at line 85 of file channel.h. Referenced by Channel::command(). |
1.3.3