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

FECModel Class Reference

#include <fec.h>

Inheritance diagram for FECModel:

Inheritance graph
[legend]
Collaboration diagram for FECModel:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FECModel ()
virtual void recv (Packet *, Handler *)
NsObjectuptarget ()
NsObjectdowntarget ()
virtual void drop (Packet *p)
virtual void recv (Packet *p, const char *s)
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 int command (int argc, const char *const *argv)
void addfec (Packet *p)
void subfec (Packet *p)
virtual void drop (Packet *p, const char *s)
virtual void sendDown (Packet *p, Handler *h)
virtual void sendUp (Packet *p, Handler *h)
virtual void reset ()
void handle (Event *)

Protected Attributes

int firstTime_
int FECstrength_
int FECbyte_
int debug_
NsObjectuptarget_
NsObjectdowntarget_
NsObjectdrop_

Constructor & Destructor Documentation

FECModel::FECModel  ) 
 

Definition at line 66 of file fec.cc.

00066                    : firstTime_(1), FECstrength_(1) 
00067 {
00068 }


Member Function Documentation

void FECModel::addfec Packet p  )  [protected]
 

Definition at line 110 of file fec.cc.

References hdr_cmn::access(), FECbyte_, hdr_cmn::fecsize(), FECstrength_, and hdr_cmn::size().

Referenced by recv().

00111 {
00112         int bit = hdr_cmn::access(p)->size() * 8;
00113         FECbyte_ = (int)(log(bit) / log(2));
00114         FECbyte_ *= FECstrength_;
00115         FECbyte_ = (FECbyte_ + 7) / 8;
00116 
00117         //      firstTime_ = 0;
00118 
00119         // printf("FEC Down = %d \n", hdr_cmn::access(p)->size());      
00120 
00121         hdr_cmn::access(p)->size() += FECbyte_;
00122         hdr_cmn::access(p)->fecsize() = FECbyte_;
00123 }

Here is the call graph for this function:

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

Reimplemented from BiConnector.

Definition at line 70 of file fec.cc.

References BiConnector::command(), and FECstrength_.

00071 {
00072         Tcl& tcl = Tcl::instance();
00073         if (argc == 3) {
00074                 if (strcmp(argv[1], "FECstrength") == 0) {
00075                         FECstrength_ = atoi(argv[2]);
00076                         return (TCL_OK);
00077                 }
00078         } else if (argc == 2) {
00079                 if (strcmp(argv[1], "FECstrength") == 0) {
00080                         tcl.resultf("%d", FECstrength_);
00081                         return (TCL_OK);
00082                 } 
00083         }
00084         return BiConnector::command(argc, argv);
00085 }

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:

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

Definition at line 61 of file object.h.

References NsObject::debug_.

00061 { return debug_; }

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

Reimplemented from BiConnector.

Definition at line 88 of file fec.cc.

References hdr_cmn::access(), addfec(), hdr_cmn::direction(), hdr_cmn::DOWN, BiConnector::downtarget_, hdr_cmn::errbitcnt(), hdr_cmn::error(), FECstrength_, fix_, Packet::free(), NsObject::recv(), subfec(), and BiConnector::uptarget_.

00089 {
00090         hdr_cmn* ch = hdr_cmn::access(p);
00091 
00092         if(ch->direction() == hdr_cmn::DOWN) {
00093                 addfec(p);
00094                 downtarget_->recv(p, h);
00095                 return;
00096         } else {
00097                 if(ch->errbitcnt() > FECstrength_) {
00098                         Packet::free(p);
00099                         return;
00100                 } else if (ch->errbitcnt() && (ch->errbitcnt() <= FECstrength_)) {
00101                         ch->errbitcnt() = 0;
00102                         ch->error() = 0;
00103                         printf("FEC: %d fixed\n", fix_++);
00104                 }
00105                 subfec(p);
00106                 uptarget_->recv(p, h);
00107         }
00108 }

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 }

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:

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 FECModel::subfec Packet p  )  [protected]
 

Definition at line 125 of file fec.cc.

References hdr_cmn::access(), FECbyte_, hdr_cmn::fecsize(), and hdr_cmn::size().

Referenced by recv().

00126 {
00127         FECbyte_ = hdr_cmn::access(p)->fecsize();
00128         hdr_cmn::access(p)->size() -= FECbyte_;
00129         // printf("FEC Up = %d \n", hdr_cmn::access(p)->size());        
00130 }

Here is the call graph for this function:

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 FECModel::debug_ [protected]
 

Reimplemented from NsObject.

Definition at line 64 of file fec.h.

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

int FECModel::FECbyte_ [protected]
 

Definition at line 63 of file fec.h.

Referenced by addfec(), and subfec().

int FECModel::FECstrength_ [protected]
 

Definition at line 62 of file fec.h.

Referenced by addfec(), command(), and recv().

int FECModel::firstTime_ [protected]
 

Definition at line 61 of file fec.h.

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(), 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 12:46:54 2004 for NS2.26SourcesOriginal by doxygen 1.3.3