INET Framework for OMNeT++/OMNEST
pimSplitter Class Reference

#include <pimSplitter.h>

List of all members.

Protected Member Functions

virtual int numInitStages () const
virtual void handleMessage (cMessage *msg)
virtual void initialize (int stage)

Private Attributes

IRoutingTablert
IInterfaceTableift

Detailed Description

Definition at line 21 of file pimSplitter.h.


Member Function Documentation

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

Definition at line 14 of file pimSplitter.cc.

{
        EV << "PIM::handleMessage" << endl;

        // vlastni zprava, tj. nektery z casovacu
   if (msg->isSelfMessage())
   {
           PIMTimer *timer = check_and_cast <PIMTimer *> (msg);
   }
   else if (dynamic_cast<PIMPacket *>(msg))
   {
           PIMPacket *pkt = check_and_cast<PIMPacket *>(msg);
           EV << "Verze: " << pkt->getVersion() << ", typ: " << pkt->getType() << endl;
   }
   else
           EV << "PIM: spatna zprava" << endl;
}
void pimSplitter::initialize ( int  stage) [protected, virtual]

Definition at line 32 of file pimSplitter.cc.

{
        // v stage 2 se registruji interfacy
        if (stage == 3)
        {
                EV << "PIM::sendPacket" << endl;

                rt = RoutingTableAccess().get();
                ift = InterfaceTableAccess().get();

                EV << "Posilam zpravu na adresu: 224.0.0.13" << endl;

                PIMPacket *msg = new PIMPacket();
                msg->setVersion(2);
                msg->setType(Hello);
                msg->setName("PIMmessage");

                int intID;
                IInterfaceTable *ift;
                ift = InterfaceTableAccess().get();
                for (int i = 0; i < ift->getNumInterfaces(); i++)
                {
                        if (!ift->getInterface(i)->isLoopback())
                        {
                                intID = ift->getInterface(i)->getInterfaceId();
                                break;
                        }
                }

                IPControlInfo *ctrl = new IPControlInfo();
                IPAddress ga1("224.0.0.13");
                ctrl->setDestAddr(ga1);
                ctrl->setProtocol(IP_PROT_PIM);
                ctrl->setTimeToLive(1);
                ctrl->setInterfaceId(intID);
                msg->setControlInfo(ctrl);

                send(msg, "transportOut");
        }
}
virtual int pimSplitter::numInitStages ( ) const [inline, protected, virtual]

Definition at line 27 of file pimSplitter.h.

{return 5;}

Member Data Documentation

Odkaz na tabulku rozhrani.

Definition at line 25 of file pimSplitter.h.

Odkaz na smerovaci tabulku.

Definition at line 24 of file pimSplitter.h.


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