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

MultihopMac Class Reference

#include <mac-multihop.h>

Inheritance diagram for MultihopMac:

Inheritance graph
[legend]
Collaboration diagram for MultihopMac:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MultihopMac ()
void send (Packet *)
void recv (Packet *, Handler *)
void poll (Packet *)
int checkInterfaces (int)
void schedulePoll (MultihopMac *)
int mode ()
int mode (int m)
MultihopMacpeer ()
MultihopMacpeer (MultihopMac *p)
double tx_rx ()
double rx_tx ()
double rx_rx ()
double backoffBase ()
double backoffTime ()
double backoffTime (double bt)
PollEventpendingPE ()
PollEventpendingPE (PollEvent *pe)
Packetpkt ()
PollHandlerph ()
PollAckHandlerpah ()
PollNackHandlerpnh ()
PollTimeoutHandlerpth ()
BackoffHandlerbh ()
double pollTxtime (int s)
virtual void recv (Packet *p, const char *s)
virtual void sendDown (Packet *p)
virtual void sendUp (Packet *p)
virtual void resume (Packet *p=0)
virtual void installTap (Tap *t)
double txtime (int bytes)
double txtime (Packet *p)
double bandwidth () const
int addr ()
MacState state ()
MacState state (int m)
virtual int hdr_dst (char *hdr, int dst=-2)
virtual int hdr_src (char *hdr, int src=-2)
virtual int hdr_type (char *hdr, u_int16_t type=0)
NsObjectuptarget ()
NsObjectdowntarget ()
virtual void drop (Packet *p)
virtual void recvOnly (Packet *)
virtual void delay_bind_init_all ()
virtual int delay_bind_dispatch (const char *varName, const char *localName, TclObject *tracer)
int isdebug () const
virtual void debug (const char *fmt,...)

Protected Member Functions

virtual void sendDown (Packet *p, Handler *h)
virtual void sendUp (Packet *p, Handler *h)
int command (int argc, const char *const *argv)
virtual int initialized ()
virtual void drop (Packet *p, const char *s)
virtual void reset ()
void handle (Event *)

Protected Attributes

int mode_
MultihopMacpeer_
double tx_rx_
double rx_tx_
double rx_rx_
double backoffTime_
double backoffBase_
PollEventpendingPollEvent_
Packetpkt_
PollHandler ph_
PollAckHandler pah_
PollNackHandler pnh_
PollTimeoutHandler pth_
BackoffHandler bh_
int index_
double bandwidth_
double delay_
int abstract_
Phynetif_
Taptap_
LLll_
Channelchannel_
Handlercallback_
MacHandlerResume hRes_
MacHandlerSend hSend_
Event intr_
MacState state_
PacketpktRx_
PacketpktTx_
NsObjectuptarget_
NsObjectdowntarget_
NsObjectdrop_
int debug_

Constructor & Destructor Documentation

MultihopMac::MultihopMac  ) 
 

Definition at line 61 of file mac-multihop.cc.

References backoffBase_, backoffTime_, MAC_IDLE, rx_rx_, rx_tx_, and tx_rx_.

00061                          : mode_(MAC_IDLE), peer_(0),
00062         pendingPollEvent_(0), pkt_(0),
00063         ph_(this), pah_(this), pnh_(this), pth_(this), bh_(this)
00064 {
00065         /* Bind a bunch of variables to access from Tcl */
00066         bind_time("tx_rx_", &tx_rx_);
00067         bind_time("rx_tx_", &rx_tx_);
00068         bind_time("rx_rx_", &rx_rx_);
00069         bind_time("backoffBase_", &backoffBase_);
00070         backoffTime_ = backoffBase_;
00071 }


Member Function Documentation

int Mac::addr  )  [inline, inherited]
 

Definition at line 190 of file mac.h.

References Mac::index_.

Referenced by Mac::command(), MacClassifier::recv(), SatLL::sendDown(), and LL::sendDown().

00190 { return index_; }

double MultihopMac::backoffBase  )  [inline]
 

Definition at line 152 of file mac-multihop.h.

References backoffBase_.

Referenced by BackoffHandler::handle(), and PollAckHandler::handle().

00152 { return backoffBase_; }

double MultihopMac::backoffTime double  bt  )  [inline]
 

Definition at line 154 of file mac-multihop.h.

References backoffTime_.

00154 { return backoffTime_ = bt; }

double MultihopMac::backoffTime  )  [inline]
 

Definition at line 153 of file mac-multihop.h.

References backoffTime_.

Referenced by BackoffHandler::handle(), and PollAckHandler::handle().

00153 { return backoffTime_; }

double Mac::bandwidth  )  const [inline, inherited]
 

Definition at line 188 of file mac.h.

References Mac::bandwidth_.

Referenced by pollTxtime().

00188 { return bandwidth_; }

BackoffHandler* MultihopMac::bh  )  [inline]
 

Definition at line 162 of file mac-multihop.h.

References bh_.

00162 { return &bh_; }

int MultihopMac::checkInterfaces int   ) 
 

Definition at line 77 of file mac-multihop.cc.

References MAC_IDLE, mode(), and mode_.

Referenced by PollAckHandler::handle(), PollHandler::handle(), and poll().

00078 {
00079         MultihopMac *p;
00080         
00081         if (!(mode_ & state))
00082                 return 0;
00083         else if (macList_ == 0)
00084                 return 1;
00085         for (p = (MultihopMac *)macList_; p != this && p != NULL; 
00086              p = (MultihopMac *)(p->macList())) {
00087                 if (p->mode() != MAC_IDLE) {
00088                         return 0;
00089                 }
00090         }
00091         return 1;
00092 }

Here is the call graph for this function:

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

Reimplemented from BiConnector.

Reimplemented in Mac802_11, MacTdma, SMAC, and SatMac.

Definition at line 97 of file mac.cc.

References Mac::addr(), Mac::channel_, BiConnector::command(), Mac::logtarget_, and Mac::netif_.

Referenced by SMAC::command(), SatMac::command(), MacTdma::command(), and Mac802_11::command().

00098 {
00099         if(argc == 2) {
00100                 Tcl& tcl = Tcl::instance();
00101                 
00102                 if(strcmp(argv[1], "id") == 0) {
00103                         tcl.resultf("%d", addr());
00104                         return TCL_OK;
00105                 } else if (strcmp(argv[1], "channel") == 0) {
00106                         tcl.resultf("%s", channel_->name());
00107                         return (TCL_OK);
00108                 }
00109                 
00110         } else if (argc == 3) {
00111                 TclObject *obj;
00112                 if( (obj = TclObject::lookup(argv[2])) == 0) {
00113                         fprintf(stderr, "%s lookup failed\n", argv[1]);
00114                         return TCL_ERROR;
00115                 }
00116                 else if (strcmp(argv[1], "netif") == 0) {
00117                         netif_ = (Phy*) obj;
00118                         return TCL_OK;
00119                 }
00120                 else if (strcmp(argv[1], "log-target") == 0) {
00121                         logtarget_ = (NsObject*) obj;
00122                         if(logtarget_ == 0)
00123                                 return TCL_ERROR;
00124                         return TCL_OK;
00125                 }
00126         }
00127         
00128         return BiConnector::command(argc, argv);
00129 }

Here is the call graph for this function:

void NsObject::debug const char *  fmt,
... 
[virtual, inherited]
 

Definition at line 102 of file object.cc.

References NsObject::debug_.

00103 {
00104         if (!debug_)
00105                 return;
00106         va_list ap;
00107         va_start(ap, fmt);
00108         vprintf(fmt, ap);
00109 }

int NsObject::delay_bind_dispatch const char *  varName,
const char *  localName,
TclObject tracer
[virtual, inherited]
 

Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, and VegasTcpAgent.

Definition at line 63 of file object.cc.

References NsObject::debug_.

Referenced by MPLSAddressClassifier::delay_bind_dispatch(), and Agent::delay_bind_dispatch().

00064 {
00065         if (delay_bind_bool(varName, localName, "debug_", &debug_, tracer)) 
00066                 return TCL_OK;
00067         return TclObject::delay_bind_dispatch(varName, localName, tracer);
00068 }

void NsObject::delay_bind_init_all  )  [virtual, inherited]
 

Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, and VegasTcpAgent.

Definition at line 57 of file object.cc.

Referenced by MPLSAddressClassifier::delay_bind_init_all(), and Agent::delay_bind_init_all().

00058 {
00059         delay_bind_init_one("debug_");
00060 }

NsObject* BiConnector::downtarget  )  [inline, inherited]
 

Definition at line 49 of file bi-connector.h.

References BiConnector::downtarget_.

Referenced by SatLL::channel().

00049 { return downtarget_; }

void BiConnector::drop Packet p,
const char *  s
[protected, virtual, inherited]
 

Definition at line 144 of file bi-connector.cc.

References BiConnector::drop_, Packet::free(), and NsObject::recv().

00145 {
00146         if (drop_ != 0)
00147                 drop_->recv(p, s);
00148         else
00149                 Packet::free(p);
00150 }

Here is the call graph for this function:

void BiConnector::drop Packet p  )  [virtual, inherited]
 

Definition at line 135 of file bi-connector.cc.

References BiConnector::drop_, Packet::free(), and NsObject::recv().

Referenced by Mac802_3::collision(), Mac802_11::discard(), SMAC::drop_CTS(), SMAC::drop_DATA(), SMAC::drop_RTS(), SMAC::drop_SYNC(), UnslottedAlohaMac::end_of_contention(), MacTdma::recvHandler(), Mac::resume(), MacCsma::resume(), UnslottedAlohaMac::sendUp(), SatMac::sendUp(), Mac::sendUp(), MacTdma::TX_Time(), and Mac802_11::txtime().

00136 {
00137         if (drop_ != 0)
00138                 drop_->recv(p);
00139         else
00140                 Packet::free(p);
00141 }

Here is the call graph for this function:

void NsObject::handle Event  )  [protected, virtual, inherited]
 

Implements Handler.

Reimplemented in LinkDelay, LL, AckRecons, and Snoop.

Definition at line 91 of file object.cc.

References NsObject::recv().

00092 {
00093         recv((Packet*)e);
00094 }

Here is the call graph for this function:

virtual int Mac::hdr_dst char *  hdr,
int  dst = -2
[inline, virtual, inherited]
 

Reimplemented in Mac802_11, MacTdma, and SMAC.

Definition at line 196 of file mac.h.

References dh.

Referenced by ARPTable::arpinput(), ARPTable::arprequest(), ARPTable::arpresolve(), UnslottedAlohaMac::end_of_contention(), SatLL::sendDown(), LL::sendDown(), UnslottedAlohaMac::sendUp(), SatMac::sendUp(), and Mac::sendUp().

00196                                                             {
00197                 struct hdr_mac *dh = (struct hdr_mac*) hdr;
00198                 if(dst > -2)
00199                         dh->macDA_ = dst;
00200                 return dh->macDA();
00201         }

virtual int Mac::hdr_src char *  hdr,
int  src = -2
[inline, virtual, inherited]
 

Reimplemented in Mac802_11, MacTdma, and SMAC.

Definition at line 202 of file mac.h.

References dh.

Referenced by ARPTable::arpinput(), ARPTable::arprequest(), UnslottedAlohaMac::end_of_contention(), DSRAgent::handleRouteRequest(), SatLL::sendDown(), and LL::sendDown().

00202                                                             {
00203                 struct hdr_mac *dh = (struct hdr_mac*) hdr;
00204                 if(src > -2)
00205                         dh->macSA_ = src;
00206                 return dh->macSA();
00207         }

virtual int Mac::hdr_type char *  hdr,
u_int16_t  type = 0
[inline, virtual, inherited]
 

Reimplemented in Mac802_11, MacTdma, and SMAC.

Definition at line 208 of file mac.h.

References dh.

Referenced by ARPTable::arpinput(), ARPTable::arprequest(), SatLL::sendDown(), and LL::sendDown().

00208                                                                    {
00209                 struct hdr_mac *dh = (struct hdr_mac*) hdr;
00210                 if (type)
00211                         dh->hdr_type_ = type;
00212                 return dh->hdr_type();
00213         }

virtual int Mac::initialized  )  [inline, protected, virtual, inherited]
 

Reimplemented in Mac802_11, and SMAC.

Definition at line 223 of file mac.h.

References BiConnector::downtarget_, Mac::netif_, and BiConnector::uptarget_.

Referenced by Mac802_11::initialized(), and Mac802_3::sendDown().

00223                                   { 
00224                 return (netif_ && uptarget_ && downtarget_); 
00225         }

virtual void Mac::installTap Tap t  )  [inline, virtual, inherited]
 

Definition at line 179 of file mac.h.

References Mac::tap_.

Referenced by DSRAgent::command().

00179 { tap_ = t; }

int NsObject::isdebug  )  const [inline, inherited]
 

Definition at line 61 of file object.h.

References NsObject::debug_.

00061 { return debug_; }

int MultihopMac::mode int  m  )  [inline]
 

Definition at line 146 of file mac-multihop.h.

References mode_.

00146 { return mode_ = m; }

int MultihopMac::mode  )  [inline]
 

Definition at line 145 of file mac-multihop.h.

References mode_.

Referenced by checkInterfaces(), BackoffHandler::handle(), PollAckHandler::handle(), and PollHandler::handle().

00145 { return mode_; }

PollAckHandler* MultihopMac::pah  )  [inline]
 

Definition at line 159 of file mac-multihop.h.

References pah_.

Referenced by PollHandler::handle().

00159 { return &pah_; }

MultihopMac* MultihopMac::peer MultihopMac p  )  [inline]
 

Definition at line 148 of file mac-multihop.h.

References peer_.

00148 { return peer_ = p; }

MultihopMac* MultihopMac::peer  )  [inline]
 

Definition at line 147 of file mac-multihop.h.

References peer_.

Referenced by PollAckHandler::handle(), and PollHandler::handle().

00147 { return peer_; }

PollEvent* MultihopMac::pendingPE PollEvent pe  )  [inline]
 

Definition at line 156 of file mac-multihop.h.

References pendingPollEvent_.

00156 { return pendingPollEvent_ = pe; }

PollEvent* MultihopMac::pendingPE  )  [inline]
 

Definition at line 155 of file mac-multihop.h.

References pendingPollEvent_.

Referenced by BackoffHandler::handle(), and PollAckHandler::handle().

00155 { return pendingPollEvent_; }

PollHandler* MultihopMac::ph  )  [inline]
 

Definition at line 158 of file mac-multihop.h.

References ph_.

00158 { return &ph_; } /* access poll handler */

Packet* MultihopMac::pkt  )  [inline]
 

Definition at line 157 of file mac-multihop.h.

References pkt_.

Referenced by PollTimeoutHandler::handle(), and PollAckHandler::handle().

00157 { return pkt_; }

PollNackHandler* MultihopMac::pnh  )  [inline]
 

Definition at line 160 of file mac-multihop.h.

References pnh_.

00160 { return &pnh_; }

void MultihopMac::poll Packet  ) 
 

Definition at line 99 of file mac-multihop.cc.

References bh_, checkInterfaces(), Packet::copy(), Scheduler::instance(), MAC_IDLE, MAC_POLLING, MAC_POLLSIZE, max, mode_, peer_, pendingPollEvent_, pkt_, pollTxtime(), rx_tx(), Scheduler::schedule(), and tx_rx_.

Referenced by PollTimeoutHandler::handle(), and recv().

00100 {
00101         Scheduler& s = Scheduler::instance();
00102         MultihopMac *pm = (MultihopMac*) getPeerMac(p);
00103         PollEvent *pe = new PollEvent(pm, this);
00104 
00105         pendingPollEvent_ = new PollEvent(pm, this);
00106         pkt_ = p->copy();       /* local copy for poll retries */
00107         double timeout = max(pm->rx_tx(), tx_rx_) + 4*pollTxtime(MAC_POLLSIZE);
00108         s.schedule(&bh_, pendingPollEvent_, timeout);
00109 
00110         /*  If the other interfaces are idle, then go ahead, else not. */
00111         if (checkInterfaces(MAC_IDLE)) { 
00112                 mode_ = MAC_POLLING;
00113                 peer_ = pm;
00114                 s.schedule(pm->ph(), (Event *)pe, pollTxtime(MAC_POLLSIZE));
00115         }
00116 }

Here is the call graph for this function:

double MultihopMac::pollTxtime int  s  )  [inline]
 

Definition at line 164 of file mac-multihop.h.

References Mac::bandwidth().

Referenced by PollHandler::handle(), and poll().

00164 { return (double) s*8.0/bandwidth(); }

Here is the call graph for this function:

PollTimeoutHandler* MultihopMac::pth  )  [inline]
 

Definition at line 161 of file mac-multihop.h.

References pth_.

Referenced by BackoffHandler::handle().

00161 { return &pth_; }

void NsObject::recv Packet p,
const char *  s
[virtual, inherited]
 

Reimplemented in CMUTrace.

Definition at line 96 of file object.cc.

References Packet::free().

00097 {
00098         Packet::free(p);
00099 }

Here is the call graph for this function:

void MultihopMac::recv Packet ,
Handler
[virtual]
 

Reimplemented from Mac.

Definition at line 211 of file mac-multihop.cc.

References hdr_mac::access(), Mac::callback_, Mac::delay_, hdr_mac::ftype(), Scheduler::instance(), MAC_IDLE, MAC_SND, hdr_mac::macSA(), MF_ACK, MF_DATA, mode_, poll(), Scheduler::schedule(), and send().

00212 {
00213         if (h == 0) {           /* from MAC classifier (pass pkt to LL) */
00214                 mode_ = MAC_IDLE;
00215                 Scheduler::instance().schedule(target_, p, delay_);
00216                 return;
00217         }
00218         callback_ = h;
00219         hdr_mac* mh = hdr_mac::access(p);
00220         mh->macSA() = addr_;
00221         if (mh->ftype() == MF_ACK) {
00222                 mode_ = MAC_SND;
00223                 send(p);
00224         } else {
00225                 mh->ftype() = MF_DATA;
00226                 poll(p);                /* poll first */
00227         }
00228 }

Here is the call graph for this function:

virtual void NsObject::recvOnly Packet  )  [inline, virtual, inherited]
 

Reimplemented in Agent, and Trace.

Definition at line 56 of file object.h.

Referenced by Trace::recvOnly().

00056 {};

void NsObject::reset  )  [protected, virtual, inherited]
 

Reimplemented in BayFullTcpAgent, HashClassifier, IvsSource, dsREDQueue, DiffusionRate, SinkAgent, DiffusionAgent, FloodingAgent, OmniMcastAgent, LinkDelay, CBQueue, DropTail, ErrorModel, PIQueue, Queue< T >, RedPDQueue, REDQueue, REMQueue, RIOQueue, Snoop, FackTcpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, Sack1TcpAgent, TcpSink, DelAckSink, TcpAgent, VegasTcpAgent, toraAgent, and Queue< T >.

Definition at line 70 of file object.cc.

Referenced by NsObject::command().

00071 {
00072 }

void Mac::resume Packet p = 0  )  [virtual, inherited]
 

Reimplemented in MacCsma.

Definition at line 173 of file mac.cc.

References Mac::callback_, BiConnector::drop(), Handler::handle(), Mac::intr_, MAC_IDLE, and Mac::state().

Referenced by UnslottedAlohaMac::backoff(), UnslottedAlohaMac::end_of_contention(), and MacHandlerResume::handle().

00174 {
00175         if (p != 0)
00176                 drop(p);
00177         state(MAC_IDLE);
00178         callback_->handle(&intr_);
00179 }

Here is the call graph for this function:

double MultihopMac::rx_rx  )  [inline]
 

Definition at line 151 of file mac-multihop.h.

References rx_rx_.

00151 { return rx_rx_; } /* access rx_rx time */

double MultihopMac::rx_tx  )  [inline]
 

Definition at line 150 of file mac-multihop.h.

References rx_tx_.

Referenced by PollHandler::handle(), and poll().

00150 { return rx_tx_; } /* access rx_tx time */

void MultihopMac::schedulePoll MultihopMac  ) 
 

void MultihopMac::send Packet  ) 
 

Definition at line 195 of file mac-multihop.cc.

References hdr_mac::access(), Mac::callback_, Mac::channel_, Scheduler::instance(), Mac::intr_, MAC_IDLE, MAC_SND, mode_, Scheduler::schedule(), hdr_mac::txtime(), and Mac::txtime().

Referenced by PollAckHandler::handle(), and recv().

00196 {
00197         Scheduler& s = Scheduler::instance();
00198         if (mode_ != MAC_SND)
00199                 return;
00200 
00201         double txt = txtime(p);
00202         hdr_mac::access(p)->txtime() = txt;
00203         channel_->send(p, txt); // target is peer's mac handler
00204         s.schedule(callback_, &intr_, txt); // callback to higher layer (LL)
00205         mode_ = MAC_IDLE;
00206 }

Here is the call graph for this function:

virtual void BiConnector::sendDown Packet p,
Handler h
[inline, protected, virtual, inherited]
 

Reimplemented in Mac802_3.

Definition at line 55 of file bi-connector.h.

References BiConnector::downtarget_, and NsObject::recv().

Referenced by BiConnector::recv().

00056                 { downtarget_->recv(p, h); }

Here is the call graph for this function:

void Mac::sendDown Packet p  )  [virtual, inherited]
 

Reimplemented in MacTdma, SatMac, and UnslottedAlohaMac.

Definition at line 163 of file mac.cc.

References Mac::abstract_, BiConnector::downtarget_, Mac::hRes_, Scheduler::instance(), Mac::intr_, NsObject::recv(), Scheduler::schedule(), and Mac::txtime().

Referenced by MacHandlerSend::handle(), and Mac::recv().

00164 {
00165         Scheduler& s = Scheduler::instance();
00166         double txt = txtime(p);
00167         downtarget_->recv(p, this);
00168         if(!abstract_)
00169                 s.schedule(&hRes_, &intr_, txt);
00170 }

Here is the call graph for this function:

virtual void BiConnector::sendUp Packet p,
Handler h
[inline, protected, virtual, inherited]
 

Reimplemented in Mac802_3.

Definition at line 57 of file bi-connector.h.

References NsObject::recv(), and BiConnector::uptarget_.

Referenced by BiConnector::recv().

00058                 { uptarget_->recv(p, h); }

Here is the call graph for this function:

void Mac::sendUp Packet p  )  [virtual, inherited]
 

Reimplemented in MacTdma, SatMac, and UnslottedAlohaMac.

Definition at line 145 of file mac.cc.

References Mac::abstract_, Packet::access(), Mac::delay_, BiConnector::drop(), Packet::free(), Mac::hdr_dst(), Mac::index_, Scheduler::instance(), MAC_BROADCAST, MAC_IDLE, hdr_mac::offset_, Scheduler::schedule(), Mac::state(), u_int32_t, and BiConnector::uptarget_.

Referenced by Mac::recv().

00146 {
00147         char* mh = (char*)p->access(hdr_mac::offset_);
00148         int dst = this->hdr_dst(mh);
00149 
00150         state(MAC_IDLE);
00151         if (((u_int32_t)dst != MAC_BROADCAST) && (dst != index_)) {
00152                 if(!abstract_){
00153                         drop(p);
00154                 }else {
00155                         //Dont want to creat a trace
00156                         Packet::free(p);
00157                 }
00158                 return;
00159         }
00160         Scheduler::instance().schedule(uptarget_, p, delay_);
00161 }

Here is the call graph for this function:

MacState Mac::state int  m  )  [inline, inherited]
 

Definition at line 192 of file mac.h.

References MacState, and Mac::state_.

00192 { return state_ = (MacState) m; }

MacState Mac::state  )  [inline, inherited]
 

Definition at line 191 of file mac.h.

References MacState, and Mac::state_.

Referenced by Mac::recv(), MacTdma::recv(), Mac::resume(), MacCsma::resume(), and Mac::sendUp().

00191 { return state_; }

double MultihopMac::tx_rx  )  [inline]
 

Definition at line 149 of file mac-multihop.h.

References tx_rx_.

Referenced by PollHandler::handle().

00149 { return tx_rx_; } /* access tx_rx time */

double Mac::txtime Packet p  )  [inline, inherited]
 

Reimplemented in Mac802_11, and SMAC.

Definition at line 184 of file mac.h.

References Mac::bandwidth_, HDR_CMN, and MAC_HDR_LEN.

00184                                         {
00185                 return 8. * (MAC_HDR_LEN + \
00186                              (HDR_CMN(p))->size()) / bandwidth_;
00187         }

double Mac::txtime int  bytes  )  [inline, inherited]
 

Reimplemented in Mac802_11.

Definition at line 181 of file mac.h.

References Mac::bandwidth_.

Referenced by MacCsma::endofContention(), send(), UnslottedAlohaMac::sendDown(), SatMac::sendDown(), Mac::sendDown(), and Mac802_3::transmit().

00181                                         {
00182                 return (8. * bytes / bandwidth_);
00183         }

NsObject* BiConnector::uptarget  )  [inline, inherited]
 

Definition at line 48 of file bi-connector.h.

References BiConnector::uptarget_.

Referenced by SatChannel::find_peer_mac_addr().

00048 { return uptarget_; }


Member Data Documentation

int Mac::abstract_ [protected, inherited]
 

Definition at line 229 of file mac.h.

Referenced by Mac::Mac(), Mac::sendDown(), and Mac::sendUp().

double MultihopMac::backoffBase_ [protected]
 

Definition at line 172 of file mac-multihop.h.

Referenced by backoffBase(), and MultihopMac().

double MultihopMac::backoffTime_ [protected]
 

Definition at line 171 of file mac-multihop.h.

Referenced by backoffTime(), and MultihopMac().

double Mac::bandwidth_ [protected, inherited]
 

Definition at line 227 of file mac.h.

Referenced by Mac::bandwidth(), Mac::Mac(), Mac802_11::Mac802_11(), UnslottedAlohaMac::sendDown(), SatMac::sendDown(), and Mac::txtime().

BackoffHandler MultihopMac::bh_ [protected]
 

Definition at line 179 of file mac-multihop.h.

Referenced by bh(), and poll().

Handler* Mac::callback_ [protected, inherited]
 

Definition at line 236 of file mac.h.

Referenced by MacTdma::dump(), Mac802_11::dump(), UnslottedAlohaMac::end_of_contention(), Mac::recv(), MacTdma::recv(), recv(), Mac::resume(), MacCsma::resume(), Mac802_3::resume(), send(), Mac802_11::send(), Mac802_3::sendDown(), MacTdma::sendHandler(), SMAC::sendMsg(), Mac802_3::transmit(), Mac802_11::tx_resume(), and SMAC::txMsgDone().

Channel* Mac::channel_ [protected, inherited]
 

Definition at line 234 of file mac.h.

Referenced by MacCsma::backoff(), Mac::command(), MacCsmaCd::endofContention(), MacCsma::endofContention(), send(), MacCsmaCa::send(), and MacCsma::send().

int NsObject::debug_ [protected, inherited]
 

Reimplemented in FECModel, FloodAgent, and LandmarkAgent.

Definition at line 66 of file object.h.

Referenced by REDQueue::command(), RedPDQueue::command(), PushbackQueue::command(), NsObject::debug(), NsObject::delay_bind_dispatch(), RedPDQueue::enque(), PushbackQueue::enque(), NsObject::isdebug(), NsObject::NsObject(), TfrcAgent::recv(), PushbackQueue::reportDrop(), and REDQueue::reset().

double Mac::delay_ [protected, inherited]
 

Definition at line 228 of file mac.h.

Referenced by UnslottedAlohaMac::end_of_contention(), Mac::Mac(), recv(), SatMac::sendUp(), and Mac::sendUp().

NsObject* BiConnector::downtarget_ [protected, inherited]
 

Definition at line 63 of file bi-connector.h.

Referenced by Phy::command(), BiConnector::command(), BiConnector::downtarget(), WirelessPhy::initialized(), WiredPhy::initialized(), SMAC::initialized(), Mac::initialized(), FECModel::recv(), MacTdma::send(), UnslottedAlohaMac::sendDown(), SatMac::sendDown(), Mac::sendDown(), BiConnector::sendDown(), SMAC::transmit(), and Mac802_3::transmit().

NsObject* BiConnector::drop_ [protected, inherited]
 

Definition at line 64 of file bi-connector.h.

Referenced by BiConnector::command(), and BiConnector::drop().

MacHandlerResume Mac::hRes_ [protected, inherited]
 

Definition at line 237 of file mac.h.

Referenced by MacCsma::endofContention(), SatMac::sendDown(), and Mac::sendDown().

MacHandlerSend Mac::hSend_ [protected, inherited]
 

Definition at line 238 of file mac.h.

Referenced by MacCsmaCd::endofContention(), MacCsmaCa::send(), and MacCsma::send().

int Mac::index_ [protected, inherited]
 

Definition at line 226 of file mac.h.

Referenced by Mac::addr(), Mac802_11::discard(), SMAC::drop_CTS(), SMAC::drop_DATA(), SMAC::drop_RTS(), MacTdma::dump(), Mac802_11::dump(), UnslottedAlohaMac::end_of_contention(), SMAC::handleACK(), SMAC::handleCTS(), SMAC::handleDATA(), SMAC::handleGeneTimer(), SMAC::handleRTS(), SMAC::handleSYNC(), Mac::Mac(), MacTdma::re_schedule(), SMAC::recv(), Mac::recv(), Mac802_3::recv_complete(), Mac802_11::recv_timer(), MacTdma::recvHandler(), MacTdma::send(), SMAC::sendACK(), SMAC::sendCTS(), SMAC::sendRTS(), Mac802_11::sendRTS(), SMAC::sendSYNC(), UnslottedAlohaMac::sendUp(), SatMac::sendUp(), Mac::sendUp(), MacTdma::sendUp(), SMAC::setMySched(), MacTdma::slotHandler(), MacTdma::trace_pkt(), Mac802_11::trace_pkt(), and Mac802_3::transmit().

Event Mac::intr_ [protected, inherited]
 

Definition at line 239 of file mac.h.

Referenced by MacTdma::MacTdma(), Mac::resume(), MacCsma::resume(), send(), SatMac::sendDown(), and Mac::sendDown().

LL* Mac::ll_ [protected, inherited]
 

Definition at line 233 of file mac.h.

int MultihopMac::mode_ [protected]
 

Definition at line 166 of file mac-multihop.h.

Referenced by checkInterfaces(), mode(), poll(), recv(), and send().

Phy* Mac::netif_ [protected, inherited]
 

Definition at line 231 of file mac.h.

Referenced by Mac802_3::collision(), Mac::command(), Mac8023HandlerSend::handle(), SMAC::initialized(), Mac::initialized(), MacTdma::radioSwitch(), Mac802_3::recv_complete(), Mac802_11::recv_timer(), MacHandlerRetx::schedule(), Mac802_11::send(), Mac802_3::sendDown(), Mac802_3::sendUp(), and Mac802_3::transmit().

PollAckHandler MultihopMac::pah_ [protected]
 

Definition at line 176 of file mac-multihop.h.

Referenced by pah().

MultihopMac* MultihopMac::peer_ [protected]
 

Definition at line 167 of file mac-multihop.h.

Referenced by peer(), and poll().

PollEvent* MultihopMac::pendingPollEvent_ [protected]
 

Definition at line 173 of file mac-multihop.h.

Referenced by pendingPE(), and poll().

PollHandler MultihopMac::ph_ [protected]
 

Definition at line 175 of file mac-multihop.h.

Referenced by ph().

Packet* MultihopMac::pkt_ [protected]
 

Definition at line 174 of file mac-multihop.h.

Referenced by pkt(), and poll().

Packet* Mac::pktRx_ [protected, inherited]
 

Reimplemented in SMAC.

Definition at line 245 of file mac.h.

Referenced by Mac802_11::collision(), MacTdma::dump(), Mac802_11::dump(), Mac802_11::recv(), Mac802_11::recv_timer(), MacTdma::recvHandler(), Mac802_11::rx_resume(), and MacTdma::sendUp().

Packet* Mac::pktTx_ [protected, inherited]
 

Reimplemented in SMAC.

Definition at line 246 of file mac.h.

Referenced by Mac802_11::check_pktTx(), Mac802_11::deferHandler(), MacTdma::dump(), Mac802_11::dump(), MacTdma::makePreamble(), Mac802_11::recvACK(), Mac802_11::recvCTS(), Mac802_11::RetransmitDATA(), Mac802_11::RetransmitRTS(), MacTdma::send(), Mac802_11::sendDATA(), MacTdma::sendDown(), Mac802_11::sendRTS(), and Mac802_11::tx_resume().

PollNackHandler MultihopMac::pnh_ [protected]
 

Definition at line 177 of file mac-multihop.h.

Referenced by pnh().

PollTimeoutHandler MultihopMac::pth_ [protected]
 

Definition at line 178 of file mac-multihop.h.

Referenced by pth().

double MultihopMac::rx_rx_ [protected]
 

Definition at line 170 of file mac-multihop.h.

Referenced by MultihopMac(), and rx_rx().

double MultihopMac::rx_tx_ [protected]
 

Definition at line 169 of file mac-multihop.h.

Referenced by MultihopMac(), and rx_tx().

MacState Mac::state_ [protected, inherited]
 

Reimplemented in SMAC.

Definition at line 244 of file mac.h.

Referenced by Mac802_3::collision(), Mac802_3::resume(), Mac802_3::sendUp(), Mac::state(), and Mac802_3::transmit().

Tap* Mac::tap_ [protected, inherited]
 

Definition at line 232 of file mac.h.

Referenced by Mac::installTap(), and Mac802_11::recv_timer().

double MultihopMac::tx_rx_ [protected]
 

Definition at line 168 of file mac-multihop.h.

Referenced by MultihopMac(), poll(), and tx_rx().

NsObject* BiConnector::uptarget_ [protected, inherited]
 

Definition at line 60 of file bi-connector.h.

Referenced by BiConnector::command(), Phy::dump(), UnslottedAlohaMac::end_of_contention(), WirelessPhy::initialized(), WiredPhy::initialized(), SMAC::initialized(), Mac::initialized(), God::initialized(), RepeaterPhy::recv(), Phy::recv(), FECModel::recv(), Mac802_3::recv_complete(), MacTdma::recvDATA(), Mac802_11::recvDATA(), SMAC::rxMsgDone(), SatMac::sendUp(), Mac::sendUp(), BiConnector::sendUp(), and BiConnector::uptarget().


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