Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

IPv6ErrorHandling Class Reference

#include <IPv6ErrorHandling.h>

List of all members.


Detailed Description

Error Handling: print out received error for IPv6


Protected Member Functions

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

Private Member Functions

void displayType1Msg (int code)
void displayType2Msg ()
void displayType3Msg (int code)
void displayType4Msg (int code)


Member Function Documentation

void IPv6ErrorHandling::displayType1Msg int  code  )  [private]
 

00087 {
00088     EV << "Destination Unreachable: ";
00089     if (code == 0)
00090         EV << "no route to destination\n";
00091     else if (code == 1)
00092         EV << "communication with destination administratively prohibited\n";
00093     else if (code == 3)
00094         EV << "address unreachable\n";
00095     else if (code == 4)
00096         EV << "port unreachable\n";
00097     else
00098         EV << "Unknown Error Code!\n";
00099 }

void IPv6ErrorHandling::displayType2Msg  )  [private]
 

00102 {
00103     EV << "Packet Too Big" << endl;
00104     //Code is always 0 and ignored by the receiver.
00105 }

void IPv6ErrorHandling::displayType3Msg int  code  )  [private]
 

00108 {
00109     EV << "Time Exceeded Message: ";
00110     if (code == 0)
00111         EV << "hop limit exceeded in transit\n";
00112     else if (code == 1)
00113         EV << "fragment reassembly time exceeded\n";
00114     else
00115         EV << "Unknown Error Code!\n";
00116 }

void IPv6ErrorHandling::displayType4Msg int  code  )  [private]
 

00119 {
00120     EV << "Parameter Problem Message: ";
00121     if (code == 0)
00122         EV << "erroneous header field encountered\n";
00123     else if (code == 1)
00124         EV << "unrecognized Next Header type encountered\n";
00125     else if (code == 2)
00126         EV << "unrecognized IPv6 option encountered\n";
00127     else
00128         EV << "Unknown Error Code!\n";
00129 }

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

00037 {
00038     ICMPv6Message *icmpv6Msg = check_and_cast<ICMPv6Message *>(msg);
00039     IPv6Datagram *d = check_and_cast<IPv6Datagram *>(msg->encapsulatedMsg());
00040     int type = (int)icmpv6Msg->type();
00041     int code;
00042     EV << " Type: " << type;
00043     if (dynamic_cast<ICMPv6DestUnreachableMsg *>(icmpv6Msg))
00044     {
00045         ICMPv6DestUnreachableMsg *msg2 = (ICMPv6DestUnreachableMsg *)icmpv6Msg;
00046         code = msg2->code();
00047         EV << " Code: " << code;
00048     }
00049     else if (dynamic_cast<ICMPv6PacketTooBigMsg *>(icmpv6Msg))
00050     {
00051         ICMPv6PacketTooBigMsg *msg2 = (ICMPv6PacketTooBigMsg *)icmpv6Msg;
00052         code = 0;
00053     }
00054     else if (dynamic_cast<ICMPv6TimeExceededMsg *>(icmpv6Msg))
00055     {
00056         ICMPv6TimeExceededMsg *msg2 = (ICMPv6TimeExceededMsg *)icmpv6Msg;
00057         code = msg2->code();
00058         EV << " Code: " << code;
00059     }
00060     else if (dynamic_cast<ICMPv6ParamProblemMsg *>(icmpv6Msg))
00061     {
00062         ICMPv6ParamProblemMsg *msg2 = (ICMPv6ParamProblemMsg *)icmpv6Msg;
00063         code = msg2->code();
00064         EV << " Code: " << code;
00065     }
00066 
00067     EV << " Byte length: " << d->byteLength()
00068        << " Src: " << d->srcAddress()
00069        << " Dest: " << d->destAddress()
00070        << " Time: " << simTime()
00071        << "\n";
00072 
00073     if (type == 1)
00074         displayType1Msg(code);
00075     else if (type == 2)
00076         displayType2Msg();
00077     else if (type == 3)
00078         displayType3Msg(code);
00079     else if (type == 4)
00080         displayType4Msg(code);
00081     else
00082         EV << "Unknown Error Type!" << endl;
00083     delete icmpv6Msg;
00084 }

void IPv6ErrorHandling::initialize  )  [protected, virtual]
 

00033 {
00034 }


The documentation for this class was generated from the following files:
Generated on Sat Apr 1 20:52:22 2006 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.1