#include <ErrorHandling.h>
Protected Member Functions | |
virtual void | initialize () |
virtual void | handleMessage (cMessage *msg) |
Protected Attributes | |
long | numReceived |
void ErrorHandling::initialize | ( | ) | [protected, virtual] |
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 }
long ErrorHandling::numReceived [protected] |
Referenced by handleMessage(), and initialize().