ErrorHandling Class Reference

#include <ErrorHandling.h>

List of all members.


Detailed Description

Error Handling: print out received error

Protected Member Functions

virtual void initialize ()
virtual void handleMessage (cMessage *msg)

Protected Attributes

long numReceived

Member Function Documentation

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

00032 {
00033     numReceived = 0;
00034     WATCH(numReceived);
00035 }

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

00038 {
00039     numReceived++;
00040 
00041     ICMPMessage *icmpMsg = check_and_cast<ICMPMessage *>(msg);
00042     IPDatagram *d = check_and_cast<IPDatagram *>(icmpMsg->getEncapsulatedMsg());
00043 
00044     EV << "Error Handler: ICMP message received:\n";
00045     EV << " Type: " << (int)icmpMsg->getType()
00046        << " Code: " << (int)icmpMsg->getCode()
00047        << " Bytelength: " << d->getByteLength()
00048        << " Src: " << d->getSrcAddress()
00049        << " Dest: " << d->getDestAddress()
00050        << " Time: " << simTime()
00051        << "\n";
00052 
00053     delete icmpMsg;
00054 
00055     if (ev.isGUI())
00056     {
00057         char buf[80];
00058         sprintf(buf, "errors: %ld", numReceived);
00059         getDisplayString().setTagArg("t",0,buf);
00060     }
00061 }


Member Data Documentation

long ErrorHandling::numReceived [protected]

Referenced by handleMessage(), and initialize().


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

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