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

WirelessChannel Class Reference

#include <channel.h>

Inheritance diagram for WirelessChannel:

Inheritance graph
[legend]
Collaboration diagram for WirelessChannel:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

Public Attributes

if_head ifhead_
TclObjectgridkeeper_

Protected Attributes

int index_
double delay_
Tracetrace_

Private Member Functions

double get_pdelay (Node *tnode, Node *rnode)

Constructor & Destructor Documentation

WirelessChannel::WirelessChannel void   ) 
 

Definition at line 305 of file channel.cc.

00305 : Channel() {}


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 WirelessChannel::get_pdelay Node tnode,
Node rnode
[private, virtual]
 

Reimplemented from Channel.

Definition at line 308 of file channel.cc.

References MobileNode::propdelay().

00309 {
00310         // Scheduler    &s = Scheduler::instance();
00311         MobileNode* tmnode = (MobileNode*)tnode;
00312         MobileNode* rmnode = (MobileNode*)rnode;
00313         double propdelay = 0;
00314         
00315         propdelay = tmnode->propdelay(rmnode);
00316 
00317         assert(propdelay >= 0.0);
00318         if (propdelay == 0.0) {
00319                 /* if the propdelay is 0 b/c two nodes are on top of 
00320                    each other, move them slightly apart -dam 7/28/98 */
00321                 propdelay = 2 * DBL_EPSILON;
00322                 //printf ("propdelay 0: %d->%d at %f\n",
00323                 //      tmnode->address(), rmnode->address(), s.clock());
00324         }
00325         return propdelay;
00326 }

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 Channel::recv Packet p,
Handler
[virtual, inherited]
 

Reimplemented in NoDupChannel.

Definition at line 136 of file channel.cc.

References Channel::sendUp().

Referenced by WirelessPhy::sendDown(), WiredPhy::sendDown(), RepeaterPhy::sendDown(), and SatPhy::sendDown().

00137 {
00138 //      Scheduler& s = Scheduler::instance();
00139 //      hdr_cmn::access(p)->direction() = hdr_cmn::UP;
00140 //      s.schedule(target_, p, txstop_ + delay_ - s.clock());
00141         sendUp(p, (Phy*)h);
00142 }

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 NoDupChannel::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(), NoDupChannel::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().

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 files:
Generated on Tue Apr 20 13:36:02 2004 for NS2.26SourcesOriginal by doxygen 1.3.3