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

ID Struct Reference

#include <path.h>

Collaboration diagram for ID:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ID ()
 ID (unsigned long name, ID_Type t)
 ID (const struct sr_addr &a)
void fillSRAddr (struct sr_addr &a)
nsaddr_t getNSAddr_t () const
bool operator== (const ID &id2) const
bool operator!= (const ID &id2) const
int size () const
void unparse (FILE *out) const
char * dump () const

Public Attributes

unsigned long addr
ID_Type type
Time t
Link_Type link_type
Log_Status log_stat

Friends

class Path

Constructor & Destructor Documentation

ID::ID  )  [inline]
 

Definition at line 55 of file path.h.

References link_type, log_stat, LS_NONE, LT_NONE, NONE, t, and type.

00055 : type(NONE), t(-1), link_type(LT_NONE), log_stat(LS_NONE) {}

ID::ID unsigned long  name,
ID_Type  t
[inline]
 

Definition at line 61 of file path.h.

References addr, IP, link_type, log_stat, LS_NONE, LT_NONE, MAC, NONE, t, and type.

00061                                    :addr(name), type(t), t(-1), 
00062     link_type(LT_NONE),log_stat(LS_NONE)
00063         {
00064                 assert(type == NONE || type == MAC || type == IP);
00065         }

ID::ID const struct sr_addr a  )  [inline]
 

Definition at line 66 of file path.h.

References addr, ID_Type, IP, link_type, log_stat, LS_NONE, LT_NONE, MAC, NONE, t, and type.

00066                                     : addr(a.addr), 
00067     type((enum ID_Type) a.addr_type), t(-1), link_type(LT_NONE),
00068           log_stat(LS_NONE)
00069         {
00070                 assert(type == NONE || type == MAC || type == IP);
00071         }


Member Function Documentation

char * ID::dump  )  const
 

Definition at line 61 of file path.cc.

References addr, IP, MAC, MAX_SR_LEN, NONE, and type.

Referenced by DSRAgent::acceptRouteReply(), Cache::addRoute(), DSRAgent::dropSendBuff(), MobiCache::findRoute(), DSRAgent::getRouteForPacket(), DSRAgent::handleFlowForwarding(), SRForwarder::handlePktWithoutSR(), DSRAgent::handlePktWithoutSR(), DSRAgent::handleRouteRequest(), Cache::noticeDeadLink(), MobiCache::noticeDeadLink(), Cache::pickVictim(), RouteCache::pre_addRoute(), DSRAgent::processBrokenRouteError(), DSRAgent::processUnknownFlowError(), DSRAgent::recv(), DSRAgent::replyFromRouteCache(), DSRAgent::returnSrcRouteToRequestor(), DSRAgent::sendBufferCheck(), DSRAgent::sendOutPacketWithRoute(), DSRAgent::sendOutRtReq(), DSRAgent::sendRouteShortening(), DSRAgent::sendUnknownFlow(), DSRAgent::stickPacketInSendBuffer(), DSRAgent::tap(), DSRAgent::undeliverablePkt(), and DSRAgent::xmitFailed().

00062 {
00063   static char buf[MAX_SR_LEN+1][50];
00064   static int which = 0;
00065   char *ptr = buf[which];
00066   which = (which + 1) % (MAX_SR_LEN+1);
00067 
00068   assert(type == ::NONE || type == ::MAC || type == ::IP);
00069 
00070   if (type == ::IP)
00071     sprintf(ptr,"%d",(int) addr);
00072   else if (type == ::NONE)
00073     sprintf(ptr,"NONE");
00074   else
00075     sprintf(ptr,"0x%x",(int) addr);
00076   return ptr;
00077 }

void ID::fillSRAddr struct sr_addr a  )  [inline]
 

Definition at line 72 of file path.h.

References addr, sr_addr::addr, sr_addr::addr_type, and type.

Referenced by Path::fillSR().

00072                                             {
00073           a.addr_type = (int) type;
00074           a.addr = addr;
00075   }    

nsaddr_t ID::getNSAddr_t  )  const [inline]
 

Definition at line 76 of file path.h.

References addr, IP, nsaddr_t, and type.

Referenced by DSRAgent::getRouteForPacket(), DSRAgent::processBrokenRouteError(), DSRAgent::processUnknownFlowError(), DSRAgent::returnSrcRouteToRequestor(), DSRAgent::sendOutRtReq(), DSRAgent::sendRouteShortening(), DSRAgent::sendUnknownFlow(), and DSRAgent::xmitFailed().

00076                                       {
00077           assert(type == IP); return addr;
00078   }

bool ID::operator!= const ID id2  )  const [inline]
 

Definition at line 82 of file path.h.

References operator==().

00082 {return !operator==(id2);}

Here is the call graph for this function:

bool ID::operator== const ID id2  )  const [inline]
 

Definition at line 79 of file path.h.

References addr, and type.

Referenced by operator!=().

00079                                                 {
00080           return (type == id2.type) && (addr == id2.addr);
00081   }

int ID::size  )  const [inline]
 

Definition at line 83 of file path.h.

References IP, and type.

00083 {return (type == IP ? 4 : 6);} 

void ID::unparse FILE *  out  )  const
 

Definition at line 55 of file path.cc.

References addr.

Referenced by Path::unparse().

00056 {
00057   fprintf(out,"%d",(int) addr);
00058 }


Friends And Related Function Documentation

friend class Path [friend]
 

Definition at line 54 of file path.h.


Member Data Documentation

unsigned long ID::addr
 

Definition at line 87 of file path.h.

Referenced by DSRAgent::command(), DSRAgent::diff_subnet(), dump(), fillSRAddr(), getNSAddr_t(), DSRAgent::handleDefaultForwarding(), DSRAgent::handleFlowForwarding(), ID(), operator==(), DSRAgent::processUnknownFlowError(), DSRAgent::replyFromRouteCache(), DSRAgent::sendOutPacketWithRoute(), DSRAgent::sendUnknownFlow(), unparse(), DSRAgent::xmitFailed(), and DSRAgent::xmitFlowFailed().

Link_Type ID::link_type
 

Definition at line 91 of file path.h.

Referenced by ID().

Log_Status ID::log_stat
 

Definition at line 92 of file path.h.

Referenced by ID().

Time ID::t
 

Definition at line 90 of file path.h.

Referenced by ID().

ID_Type ID::type
 

Definition at line 88 of file path.h.

Referenced by dump(), fillSRAddr(), getNSAddr_t(), ID(), operator==(), and size().


The documentation for this struct was generated from the following files:
Generated on Tue Apr 20 12:52:21 2004 for NS2.26SourcesOriginal by doxygen 1.3.3