UDP Class Reference

#include <UDP.h>

List of all members.


Detailed Description

Implements the UDP protocol: encapsulates/decapsulates user data into/from UDP.

More info in the NED file.

Public Types

typedef std::list< SockDesc * > SockDescList
typedef std::map< int, SockDesc * > SocketsByIdMap
typedef std::map< int,
SockDescList
SocketsByPortMap

Public Member Functions

 UDP ()
virtual ~UDP ()

Protected Member Functions

virtual void updateDisplayString ()
virtual void bind (int gateIndex, UDPControlInfo *ctrl)
virtual void connect (int sockId, IPvXAddress addr, int port)
virtual void unbind (int sockId)
virtual short getEphemeralPort ()
virtual bool matchesSocket (SockDesc *sd, UDPPacket *udp, IPControlInfo *ctrl)
virtual bool matchesSocket (SockDesc *sd, UDPPacket *udp, IPv6ControlInfo *ctrl)
virtual bool matchesSocket (SockDesc *sd, const IPvXAddress &localAddr, const IPvXAddress &remoteAddr, short remotePort)
virtual void sendUp (cPacket *payload, UDPPacket *udpHeader, IPControlInfo *ctrl, SockDesc *sd)
virtual void sendUp (cPacket *payload, UDPPacket *udpHeader, IPv6ControlInfo *ctrl, SockDesc *sd)
virtual void processUndeliverablePacket (UDPPacket *udpPacket, cPolymorphic *ctrl)
virtual void sendUpErrorNotification (SockDesc *sd, int msgkind, const IPvXAddress &localAddr, const IPvXAddress &remoteAddr, short remotePort)
virtual void processICMPError (cPacket *icmpErrorMsg)
virtual void processUDPPacket (UDPPacket *udpPacket)
virtual void processMsgFromApp (cPacket *appData)
virtual void processCommandFromApp (cMessage *msg)
virtual UDPPacket * createUDPPacket (const char *name)
virtual void initialize ()
virtual void handleMessage (cMessage *msg)

Protected Attributes

SocketsByIdMap socketsByIdMap
SocketsByPortMap socketsByPortMap
short lastEphemeralPort
ICMPicmp
ICMPv6icmpv6
int numSent
int numPassedUp
int numDroppedWrongPort
int numDroppedBadChecksum

Classes

struct  SockDesc


Member Typedef Documentation

typedef std::list<SockDesc *> UDP::SockDescList

typedef std::map<int,SockDesc *> UDP::SocketsByIdMap

typedef std::map<int,SockDescList> UDP::SocketsByPortMap


Constructor & Destructor Documentation

UDP::UDP (  )  [inline]

00122 {}

UDP::~UDP (  )  [virtual]

00076 {
00077     for (SocketsByIdMap::iterator i=socketsByIdMap.begin(); i!=socketsByIdMap.end(); ++i)
00078         delete i->second;
00079 }


Member Function Documentation

void UDP::updateDisplayString (  )  [protected, virtual]

Referenced by handleMessage().

00219 {
00220     char buf[80];
00221     sprintf(buf, "passed up: %d pks\nsent: %d pks", numPassedUp, numSent);
00222     if (numDroppedWrongPort>0)
00223     {
00224         sprintf(buf+strlen(buf), "\ndropped (no app): %d pks", numDroppedWrongPort);
00225         getDisplayString().setTagArg("i",1,"red");
00226     }
00227     getDisplayString().setTagArg("t",0,buf);
00228 }

void UDP::bind ( int  gateIndex,
UDPControlInfo *  ctrl 
) [protected, virtual]

Referenced by processCommandFromApp().

00101 {
00102     // XXX checks could be added, of when the bind should be allowed to proceed
00103 
00104     // create and fill in SockDesc
00105     SockDesc *sd = new SockDesc();
00106     sd->sockId = ctrl->getSockId();
00107     sd->userId = ctrl->getUserId();
00108     sd->appGateIndex = gateIndex;
00109     sd->localAddr = ctrl->getSrcAddr();
00110     sd->remoteAddr = ctrl->getDestAddr();
00111     sd->localPort = ctrl->getSrcPort();
00112     sd->remotePort = ctrl->getDestPort();
00113     sd->interfaceId = ctrl->getInterfaceId();
00114 
00115     if (sd->sockId==-1)
00116         error("sockId in BIND message not filled in");
00117     if (sd->localPort==0)
00118         sd->localPort = getEphemeralPort();
00119 
00120     sd->onlyLocalPortIsSet = sd->localAddr.isUnspecified() &&
00121                              sd->remoteAddr.isUnspecified() &&
00122                              sd->remotePort==0 &&
00123                              sd->interfaceId==-1;
00124 
00125     EV << "Binding socket: " << *sd << "\n";
00126 
00127     // add to socketsByIdMap
00128     ASSERT(socketsByIdMap.find(sd->sockId)==socketsByIdMap.end());
00129     socketsByIdMap[sd->sockId] = sd;
00130 
00131     // add to socketsByPortMap
00132     SockDescList& list = socketsByPortMap[sd->localPort]; // create if doesn't exist
00133     list.push_back(sd);
00134 }

void UDP::connect ( int  sockId,
IPvXAddress  addr,
int  port 
) [protected, virtual]

Referenced by processCommandFromApp().

00137 {
00138     SocketsByIdMap::iterator it = socketsByIdMap.find(sockId);
00139     if (it==socketsByIdMap.end())
00140         error("socket id=%d doesn't exist (already closed?)", sockId);
00141     if (addr.isUnspecified())
00142         opp_error("connect: unspecified remote address");
00143     if (port<=0 || port>65535)
00144         opp_error("connect: invalid remote port number %d", port);
00145 
00146     SockDesc *sd = it->second;
00147     sd->remoteAddr = addr;
00148     sd->remotePort = port;
00149 
00150     sd->onlyLocalPortIsSet = false;
00151 
00152     EV << "Connecting socket: " << *sd << "\n";
00153 }

void UDP::unbind ( int  sockId  )  [protected, virtual]

Referenced by processCommandFromApp().

00156 {
00157     // remove from socketsByIdMap
00158     SocketsByIdMap::iterator it = socketsByIdMap.find(sockId);
00159     if (it==socketsByIdMap.end())
00160         error("socket id=%d doesn't exist (already closed?)", sockId);
00161     SockDesc *sd = it->second;
00162     socketsByIdMap.erase(it);
00163 
00164     EV << "Unbinding socket: " << *sd << "\n";
00165 
00166     // remove from socketsByPortMap
00167     SockDescList& list = socketsByPortMap[sd->localPort];
00168     for (SockDescList::iterator it=list.begin(); it!=list.end(); ++it)
00169         if (*it == sd)
00170             {list.erase(it); break;}
00171     if (list.empty())
00172         socketsByPortMap.erase(sd->localPort);
00173     delete sd;
00174 }

short UDP::getEphemeralPort (  )  [protected, virtual]

Referenced by bind().

00177 {
00178     // start at the last allocated port number + 1, and search for an unused one
00179     short searchUntil = lastEphemeralPort++;
00180     if (lastEphemeralPort == EPHEMERAL_PORTRANGE_END) // wrap
00181         lastEphemeralPort = EPHEMERAL_PORTRANGE_START;
00182 
00183     while (socketsByPortMap.find(lastEphemeralPort)!=socketsByPortMap.end())
00184     {
00185         if (lastEphemeralPort == searchUntil) // got back to starting point?
00186             error("Ephemeral port range %d..%d exhausted, all ports occupied", EPHEMERAL_PORTRANGE_START, EPHEMERAL_PORTRANGE_END);
00187         lastEphemeralPort++;
00188         if (lastEphemeralPort == EPHEMERAL_PORTRANGE_END) // wrap
00189             lastEphemeralPort = EPHEMERAL_PORTRANGE_START;
00190     }
00191 
00192     // found a free one, return it
00193     return lastEphemeralPort;
00194 }

bool UDP::matchesSocket ( SockDesc sd,
UDPPacket *  udp,
IPControlInfo ctrl 
) [protected, virtual]

Referenced by processICMPError(), and processUDPPacket().

00231 {
00232     // IPv4 version
00233     if (sd->remotePort!=0 && sd->remotePort!=udp->getSourcePort())
00234         return false;
00235     if (!sd->localAddr.isUnspecified() && sd->localAddr.get4()!=ipCtrl->getDestAddr())
00236         return false;
00237     if (!sd->remoteAddr.isUnspecified() && sd->remoteAddr.get4()!=ipCtrl->getSrcAddr())
00238         return false;
00239     if (sd->interfaceId!=-1 && sd->interfaceId!=ipCtrl->getInterfaceId())
00240         return false;
00241     return true;
00242 }

bool UDP::matchesSocket ( SockDesc sd,
UDPPacket *  udp,
IPv6ControlInfo ctrl 
) [protected, virtual]

00245 {
00246     // IPv6 version
00247     if (sd->remotePort!=0 && sd->remotePort!=udp->getSourcePort())
00248         return false;
00249     if (!sd->localAddr.isUnspecified() && sd->localAddr.get6()!=ipCtrl->getDestAddr())
00250         return false;
00251     if (!sd->remoteAddr.isUnspecified() && sd->remoteAddr.get6()!=ipCtrl->getSrcAddr())
00252         return false;
00253     if (sd->interfaceId!=-1 && sd->interfaceId!=ipCtrl->getInterfaceId())
00254         return false;
00255     return true;
00256 }

bool UDP::matchesSocket ( SockDesc sd,
const IPvXAddress localAddr,
const IPvXAddress remoteAddr,
short  remotePort 
) [protected, virtual]

00259 {
00260     return (sd->remotePort==0 || sd->remotePort!=remotePort) &&
00261            (sd->localAddr.isUnspecified() || sd->localAddr==localAddr) &&
00262            (sd->remoteAddr.isUnspecified() || sd->remoteAddr==remoteAddr);
00263 }

void UDP::sendUp ( cPacket *  payload,
UDPPacket *  udpHeader,
IPControlInfo ctrl,
SockDesc sd 
) [protected, virtual]

Referenced by processUDPPacket().

00266 {
00267     // send payload with UDPControlInfo up to the application -- IPv4 version
00268     UDPControlInfo *udpCtrl = new UDPControlInfo();
00269     udpCtrl->setSockId(sd->sockId);
00270     udpCtrl->setUserId(sd->userId);
00271     udpCtrl->setSrcAddr(ipCtrl->getSrcAddr());
00272     udpCtrl->setDestAddr(ipCtrl->getDestAddr());
00273     udpCtrl->setSrcPort(udpHeader->getSourcePort());
00274     udpCtrl->setDestPort(udpHeader->getDestinationPort());
00275     udpCtrl->setInterfaceId(ipCtrl->getInterfaceId());
00276     payload->setControlInfo(udpCtrl);
00277 
00278     send(payload, "appOut", sd->appGateIndex);
00279     numPassedUp++;
00280 }

void UDP::sendUp ( cPacket *  payload,
UDPPacket *  udpHeader,
IPv6ControlInfo ctrl,
SockDesc sd 
) [protected, virtual]

00283 {
00284     // send payload with UDPControlInfo up to the application -- IPv6 version
00285     UDPControlInfo *udpCtrl = new UDPControlInfo();
00286     udpCtrl->setSockId(sd->sockId);
00287     udpCtrl->setUserId(sd->userId);
00288     udpCtrl->setSrcAddr(ipCtrl->getSrcAddr());
00289     udpCtrl->setDestAddr(ipCtrl->getDestAddr());
00290     udpCtrl->setSrcPort(udpHeader->getSourcePort());
00291     udpCtrl->setDestPort(udpHeader->getDestinationPort());
00292     udpCtrl->setInterfaceId(ipCtrl->getInterfaceId());
00293     payload->setControlInfo(udpCtrl);
00294 
00295     send(payload, "appOut", sd->appGateIndex);
00296     numPassedUp++;
00297 }

void UDP::processUndeliverablePacket ( UDPPacket *  udpPacket,
cPolymorphic *  ctrl 
) [protected, virtual]

Referenced by processUDPPacket().

00300 {
00301     numDroppedWrongPort++;
00302 
00303     // send back ICMP PORT_UNREACHABLE
00304     if (dynamic_cast<IPControlInfo *>(ctrl)!=NULL)
00305     {
00306         if (!icmp)
00307             icmp = ICMPAccess().get();
00308         IPControlInfo *ctrl4 = (IPControlInfo *)ctrl;
00309         if (!ctrl4->getDestAddr().isMulticast())
00310             icmp->sendErrorMessage(udpPacket, ctrl4, ICMP_DESTINATION_UNREACHABLE, ICMP_DU_PORT_UNREACHABLE);
00311     }
00312     else if (dynamic_cast<IPv6ControlInfo *>(udpPacket->getControlInfo())!=NULL)
00313     {
00314         if (!icmpv6)
00315             icmpv6 = ICMPv6Access().get();
00316         IPv6ControlInfo *ctrl6 = (IPv6ControlInfo *)ctrl;
00317         if (!ctrl6->getDestAddr().isMulticast())
00318             icmpv6->sendErrorMessage(udpPacket, ctrl6, ICMPv6_DESTINATION_UNREACHABLE, PORT_UNREACHABLE);
00319     }
00320     else
00321     {
00322         error("(%s)%s arrived from lower layer without control info", udpPacket->getClassName(), udpPacket->getName());
00323     }
00324 }

void UDP::sendUpErrorNotification ( SockDesc sd,
int  msgkind,
const IPvXAddress localAddr,
const IPvXAddress remoteAddr,
short  remotePort 
) [protected, virtual]

Referenced by processICMPError().

00397 {
00398     cPacket *notifyMsg = new cPacket("ERROR", msgkind);
00399     UDPControlInfo *udpCtrl = new UDPControlInfo();
00400     udpCtrl->setSockId(sd->sockId);
00401     udpCtrl->setUserId(sd->userId);
00402     udpCtrl->setSrcAddr(localAddr);
00403     udpCtrl->setDestAddr(remoteAddr);
00404     udpCtrl->setSrcPort(sd->localPort);
00405     udpCtrl->setDestPort(remotePort);
00406     notifyMsg->setControlInfo(udpCtrl);
00407 
00408     send(notifyMsg, "appOut", sd->appGateIndex);
00409 }

void UDP::processICMPError ( cPacket *  icmpErrorMsg  )  [protected, virtual]

Referenced by handleMessage().

00327 {
00328     // extract details from the error message, then try to notify socket that sent bogus packet
00329     int type, code;
00330     IPvXAddress localAddr, remoteAddr;
00331     int localPort, remotePort;
00332 
00333     if (dynamic_cast<ICMPMessage *>(msg))
00334     {
00335         ICMPMessage *icmpMsg = (ICMPMessage *)msg;
00336         type = icmpMsg->getType();
00337         code = icmpMsg->getCode();
00338         icmpMsg->setBitLength(icmpMsg->getEncapsulatedMsg()->getBitLength()); // trick because payload in ICMP is conceptually truncated
00339         IPDatagram *datagram = check_and_cast<IPDatagram *>(icmpMsg->decapsulate());
00340         localAddr = datagram->getSrcAddress();
00341         remoteAddr = datagram->getDestAddress();
00342         UDPPacket *packet = check_and_cast<UDPPacket *>(datagram->decapsulate());
00343         localPort = packet->getSourcePort();
00344         remotePort = packet->getDestinationPort();
00345         delete icmpMsg;
00346         delete datagram;
00347         delete packet;
00348     }
00349     else if (dynamic_cast<ICMPv6Message *>(msg))
00350     {
00351         ICMPv6Message *icmpMsg = (ICMPv6Message *)msg;
00352         type = icmpMsg->getType();
00353         code = -1; // FIXME this is dependent on getType()...
00354         IPv6Datagram *datagram = check_and_cast<IPv6Datagram *>(icmpMsg->decapsulate());
00355         localAddr = datagram->getSrcAddress();
00356         remoteAddr = datagram->getDestAddress();
00357         UDPPacket *packet = check_and_cast<UDPPacket *>(datagram->decapsulate());
00358         localPort = packet->getSourcePort();
00359         remotePort = packet->getDestinationPort();
00360         delete icmpMsg;
00361         delete datagram;
00362         delete packet;
00363     }
00364     EV << "ICMP error received: type=" << type << " code=" << code
00365        << " about packet " << localAddr << ":" << localPort << " > "
00366        << remoteAddr << ":" << remotePort << "\n";
00367 
00368     // identify socket and report error to it
00369     SocketsByPortMap::iterator it = socketsByPortMap.find(localPort);
00370     if (it==socketsByPortMap.end())
00371     {
00372         EV << "No socket on that local port, ignoring ICMP error\n";
00373         return;
00374     }
00375     SockDescList& list = it->second;
00376     SockDesc *srcSocket = NULL;
00377     for (SockDescList::iterator it=list.begin(); it!=list.end(); ++it)
00378     {
00379         SockDesc *sd = *it;
00380         if (sd->onlyLocalPortIsSet || matchesSocket(sd, localAddr, remoteAddr, remotePort))
00381         {
00382             srcSocket = sd; // FIXME what to do if there's more than one matching socket ???
00383         }
00384     }
00385     if (!srcSocket)
00386     {
00387         EV << "No matching socket, ignoring ICMP error\n";
00388         return;
00389     }
00390 
00391     // send UDP_I_ERROR to socket
00392     EV << "Source socket is sockId=" << srcSocket->sockId << ", notifying.\n";
00393     sendUpErrorNotification(srcSocket, UDP_I_ERROR, localAddr, remoteAddr, remotePort);
00394 }

void UDP::processUDPPacket ( UDPPacket *  udpPacket  )  [protected, virtual]

Referenced by handleMessage().

00412 {
00413     // simulate checksum: discard packet if it has bit error
00414     EV << "Packet " << udpPacket->getName() << " received from network, dest port " << udpPacket->getDestinationPort() << "\n";
00415     if (udpPacket->hasBitError())
00416     {
00417         EV << "Packet has bit error, discarding\n";
00418         delete udpPacket;
00419         numDroppedBadChecksum++;
00420         return;
00421     }
00422 
00423     int destPort = udpPacket->getDestinationPort();
00424     cPolymorphic *ctrl = udpPacket->removeControlInfo();
00425 
00426     // send back ICMP error if no socket is bound to that port
00427     SocketsByPortMap::iterator it = socketsByPortMap.find(destPort);
00428     if (it==socketsByPortMap.end())
00429     {
00430         EV << "No socket registered on port " << destPort << "\n";
00431         processUndeliverablePacket(udpPacket, ctrl);
00432         return;
00433     }
00434     SockDescList& list = it->second;
00435 
00436     int matches = 0;
00437 
00438     // deliver a copy of the packet to each matching socket
00439     cPacket *payload = udpPacket->getEncapsulatedMsg();
00440     if (dynamic_cast<IPControlInfo *>(ctrl)!=NULL)
00441     {
00442         IPControlInfo *ctrl4 = (IPControlInfo *)ctrl;
00443         for (SockDescList::iterator it=list.begin(); it!=list.end(); ++it)
00444         {
00445             SockDesc *sd = *it;
00446             if (sd->onlyLocalPortIsSet || matchesSocket(sd, udpPacket, ctrl4))
00447             {
00448                 EV << "Socket sockId=" << sd->sockId << " matches, sending up a copy.\n";
00449                 sendUp((cPacket*)payload->dup(), udpPacket, ctrl4, sd);
00450                 matches++;
00451             }
00452         }
00453     }
00454     else if (dynamic_cast<IPv6ControlInfo *>(udpPacket->getControlInfo())!=NULL)
00455     {
00456         IPv6ControlInfo *ctrl6 = (IPv6ControlInfo *)ctrl;
00457         for (SockDescList::iterator it=list.begin(); it!=list.end(); ++it)
00458         {
00459             SockDesc *sd = *it;
00460             if (sd->onlyLocalPortIsSet || matchesSocket(sd, udpPacket, ctrl6))
00461             {
00462                 EV << "Socket sockId=" << sd->sockId << " matches, sending up a copy.\n";
00463                 sendUp((cPacket*)payload->dup(), udpPacket, ctrl6, sd);
00464                 matches++;
00465             }
00466         }
00467     }
00468     else
00469     {
00470         error("(%s)%s arrived from lower layer without control info", udpPacket->getClassName(), udpPacket->getName());
00471     }
00472 
00473     // send back ICMP error if there is no matching socket
00474     if (matches==0)
00475     {
00476         EV << "None of the sockets on port " << destPort << " matches the packet\n";
00477         processUndeliverablePacket(udpPacket, ctrl);
00478         return;
00479     }
00480 
00481     delete udpPacket;
00482     delete ctrl;
00483 }

void UDP::processMsgFromApp ( cPacket *  appData  )  [protected, virtual]

Referenced by handleMessage().

00487 {
00488     UDPControlInfo *udpCtrl = check_and_cast<UDPControlInfo *>(appData->removeControlInfo());
00489 
00490     UDPPacket *udpPacket = createUDPPacket(appData->getName());
00491     udpPacket->setByteLength(UDP_HEADER_BYTES);
00492     udpPacket->encapsulate(appData);
00493 
00494     // set source and destination port
00495     udpPacket->setSourcePort(udpCtrl->getSrcPort());
00496     udpPacket->setDestinationPort(udpCtrl->getDestPort());
00497 
00498     if (!udpCtrl->getDestAddr().isIPv6())
00499     {
00500         // send to IPv4
00501         EV << "Sending app packet " << appData->getName() << " over IPv4.\n";
00502         IPControlInfo *ipControlInfo = new IPControlInfo();
00503         ipControlInfo->setProtocol(IP_PROT_UDP);
00504         ipControlInfo->setSrcAddr(udpCtrl->getSrcAddr().get4());
00505         ipControlInfo->setDestAddr(udpCtrl->getDestAddr().get4());
00506         ipControlInfo->setInterfaceId(udpCtrl->getInterfaceId());
00507         udpPacket->setControlInfo(ipControlInfo);
00508         delete udpCtrl;
00509 
00510         send(udpPacket,"ipOut");
00511     }
00512     else
00513     {
00514         // send to IPv6
00515         EV << "Sending app packet " << appData->getName() << " over IPv6.\n";
00516         IPv6ControlInfo *ipControlInfo = new IPv6ControlInfo();
00517         ipControlInfo->setProtocol(IP_PROT_UDP);
00518         ipControlInfo->setSrcAddr(udpCtrl->getSrcAddr().get6());
00519         ipControlInfo->setDestAddr(udpCtrl->getDestAddr().get6());
00520         // ipControlInfo->setInterfaceId(udpCtrl->InterfaceId()); FIXME extend IPv6 with this!!!
00521         udpPacket->setControlInfo(ipControlInfo);
00522         delete udpCtrl;
00523 
00524         send(udpPacket,"ipv6Out");
00525     }
00526     numSent++;
00527 }

void UDP::processCommandFromApp ( cMessage *  msg  )  [protected, virtual]

Referenced by handleMessage().

00535 {
00536     UDPControlInfo *udpCtrl = check_and_cast<UDPControlInfo *>(msg->removeControlInfo());
00537     switch (msg->getKind())
00538     {
00539         case UDP_C_BIND:
00540             bind(msg->getArrivalGate()->getIndex(), udpCtrl);
00541             break;
00542         case UDP_C_CONNECT:
00543             connect(udpCtrl->getSockId(), udpCtrl->getDestAddr(), udpCtrl->getDestPort());
00544             break;
00545         case UDP_C_UNBIND:
00546             unbind(udpCtrl->getSockId());
00547             break;
00548         default:
00549             error("unknown command code (message kind) %d received from app", msg->getKind());
00550     }
00551 
00552     delete udpCtrl;
00553     delete msg;
00554 }

UDPPacket * UDP::createUDPPacket ( const char *  name  )  [protected, virtual]

Referenced by processMsgFromApp().

00530 {
00531     return new UDPPacket(name);
00532 }

void UDP::initialize (  )  [protected, virtual]

00082 {
00083     WATCH_PTRMAP(socketsByIdMap);
00084     WATCH_MAP(socketsByPortMap);
00085 
00086     lastEphemeralPort = EPHEMERAL_PORTRANGE_START;
00087     icmp = NULL;
00088     icmpv6 = NULL;
00089 
00090     numSent = 0;
00091     numPassedUp = 0;
00092     numDroppedWrongPort = 0;
00093     numDroppedBadChecksum = 0;
00094     WATCH(numSent);
00095     WATCH(numPassedUp);
00096     WATCH(numDroppedWrongPort);
00097     WATCH(numDroppedBadChecksum);
00098 }

void UDP::handleMessage ( cMessage *  msg  )  [protected, virtual]

00197 {
00198     // received from IP layer
00199     if (msg->arrivedOn("ipIn") || msg->arrivedOn("ipv6In"))
00200     {
00201         if (dynamic_cast<ICMPMessage *>(msg) || dynamic_cast<ICMPv6Message *>(msg))
00202             processICMPError(PK(msg));
00203         else
00204             processUDPPacket(check_and_cast<UDPPacket *>(msg));
00205     }
00206     else // received from application layer
00207     {
00208         if (msg->getKind()==UDP_C_DATA)
00209             processMsgFromApp(PK(msg));
00210         else
00211             processCommandFromApp(msg);
00212     }
00213 
00214     if (ev.isGUI())
00215         updateDisplayString();
00216 }


Member Data Documentation

Referenced by bind(), connect(), initialize(), unbind(), and ~UDP().

short UDP::lastEphemeralPort [protected]

Referenced by getEphemeralPort(), and initialize().

ICMP* UDP::icmp [protected]

ICMPv6* UDP::icmpv6 [protected]

int UDP::numSent [protected]

int UDP::numPassedUp [protected]

int UDP::numDroppedWrongPort [protected]

int UDP::numDroppedBadChecksum [protected]

Referenced by initialize(), and processUDPPacket().


The documentation for this class was generated from the following files:

Generated on Fri Mar 20 18:51:22 2009 for INET Framework for OMNeT++/OMNEST by  doxygen 1.5.5