OverSim
|
Basic template class for I3 applications. More...
#include <I3BaseApp.h>
Classes | |
struct | I3CachedServer |
Public Member Functions | |
I3BaseApp () | |
Constructor. | |
~I3BaseApp () | |
Destructor. |
Protected Types | |
enum | I3MobilityStage { I3_MOBILITY_BEFORE_UPDATE, I3_MOBILITY_UPDATED } |
Protected Member Functions | |
int | numInitStages () const |
Returns number of init stages required. | |
void | initialize (int stage) |
Basic initialization. | |
virtual void | initializeApp (int stage) |
App initialization - should be overwritten by application. | |
void | bootstrapI3 () |
Internal I3 bootstrap - connects to I3, inserts sampling triggers and initializes timers. | |
virtual void | initializeI3 () |
Application I3 initialize - should be overwritten by application. | |
virtual void | handleTimerEvent (cMessage *msg) |
Handles timers - should be overwritten by application. | |
virtual void | handleUDPMessage (cMessage *msg) |
Handles messages incoming from UDP gate. | |
void | handleMessage (cMessage *msg) |
Handles incoming messages. | |
virtual void | deliver (I3Trigger &trigger, I3IdentifierStack &stack, cPacket *msg) |
Delivers packets coming from I3 - should be overwritten by application. | |
void | sendToI3 (I3Message *msg) |
Sends a message to I3. | |
void | sendThroughUDP (cMessage *msg, const I3IPAddress &ip) |
Sends a message through UDP. | |
void | refreshTriggers () |
Refreshes (reinserts) stored triggers. | |
void | refreshSamples () |
Refreshes sampling triggers and selects fastest server as gateway. | |
I3Identifier | retrieveClosestIdentifier () |
void | sendPacket (const I3Identifier &id, cPacket *msg, bool useHint=false) |
Routes a packet through I3, passing an identifier stack composed of a single identifier. | |
void | sendPacket (const I3IdentifierStack &stack, cPacket *msg, bool useHint=false) |
Routes a packet through I3. | |
void | insertTrigger (const I3Identifier &identifier, bool store=true) |
Inserts a trigger into I3, composed by the given identifier and an identifier stack containing only this node's IP address. | |
void | insertTrigger (const I3Identifier &identifier, const I3IdentifierStack &stack, bool store=true) |
Inserts a trigger into I3 with the given identifier and identifier stack. | |
void | insertTrigger (const I3Trigger &t, bool store=true) |
Inserts the given trigger into I3. | |
void | removeTrigger (const I3Identifier &identifier) |
Removes all triggers from the list of inserted triggers whose identifiers equal the one given. | |
void | removeTrigger (const I3Trigger &trigger) |
Removes a trigger from I3. | |
std::set< I3Trigger > & | getInsertedTriggers () |
Returns the list of inserted triggers. | |
void | receiveChangeNotification (int category, const cPolymorphic *details) |
virtual void | doMobilityEvent (I3MobilityStage stage) |
Protected Attributes | |
int | numSent |
Number of sent messages. | |
int | sentBytes |
int | numReceived |
Number of received messages. | |
int | receivedBytes |
int | numIsolations |
Number of times this node has been isolated - i.e. | |
IPvXAddress | nodeIPAddress |
Cached IP address of this node. | |
std::set< I3Trigger > | insertedTriggers |
Stored I3 triggers sent from this node, to be refreshed automatically. | |
std::map< I3Identifier, I3CachedServer > | samplingCache |
std::map< I3Identifier, I3CachedServer > | identifierCache |
I3CachedServer | gateway |
cMessage * | refreshTriggersTimer |
int | refreshTriggersTime |
cMessage * | refreshSamplesTimer |
int | refreshSamplesTime |
cMessage * | initializeTimer |
cMessage * | bootstrapTimer |
Private Attributes | |
bool | mobilityInStages |
Basic template class for I3 applications.
Definition at line 41 of file I3BaseApp.h.
|
protected |
Definition at line 62 of file I3BaseApp.h.
I3BaseApp::I3BaseApp | ( | ) |
I3BaseApp::~I3BaseApp | ( | ) |
|
protected |
Internal I3 bootstrap - connects to I3, inserts sampling triggers and initializes timers.
Definition at line 121 of file I3BaseApp.cc.
Referenced by handleMessage().
|
protectedvirtual |
Delivers packets coming from I3 - should be overwritten by application.
trigger | Application trigger to which the packet was sent |
stack | Identifier stack passed from I3 |
msg | Arriving message |
Reimplemented in I3SessionClient, I3Triggers, I3Composite, I3SessionServer, I3Anycast, and I3Multicast.
Definition at line 189 of file I3BaseApp.cc.
Referenced by handleUDPMessage().
|
protectedvirtual |
Definition at line 547 of file I3BaseApp.cc.
|
protected |
Returns the list of inserted triggers.
Definition at line 472 of file I3BaseApp.cc.
|
protected |
Handles incoming messages.
msg | Incoming message |
Definition at line 160 of file I3BaseApp.cc.
|
protectedvirtual |
Handles timers - should be overwritten by application.
msg | Timer to be handled |
Reimplemented in I3SessionClient, I3Triggers, I3Composite, I3Anycast, and I3Multicast.
Definition at line 194 of file I3BaseApp.cc.
Referenced by handleMessage().
|
protectedvirtual |
Handles messages incoming from UDP gate.
msg | Message sent |
Definition at line 199 of file I3BaseApp.cc.
Referenced by handleMessage(), I3HostMobility::handleUDPMessage(), and I3LatencyStretch::handleUDPMessage().
|
protected |
Basic initialization.
Definition at line 71 of file I3BaseApp.cc.
|
protectedvirtual |
App initialization - should be overwritten by application.
I3 related commands should go in initializeI3.
stage | Initialization stage passed from initialize() |
Reimplemented in I3SessionClient, I3Triggers, I3Composite, I3Anycast, and I3Multicast.
Definition at line 117 of file I3BaseApp.cc.
Referenced by initialize(), I3HostMobility::initializeApp(), and I3LatencyStretch::initializeApp().
|
protectedvirtual |
Application I3 initialize - should be overwritten by application.
Reimplemented in I3SessionClientStarter, I3SessionClient, I3Triggers, I3Composite, I3SessionServer, I3Anycast, and I3Multicast.
Definition at line 155 of file I3BaseApp.cc.
Referenced by handleMessage().
|
protected |
Inserts a trigger into I3, composed by the given identifier and an identifier stack containing only this node's IP address.
identifier | Trigger's identifier |
store | Sets whether to store the trigger for auto-refresh |
Definition at line 412 of file I3BaseApp.cc.
Referenced by bootstrapI3(), insertTrigger(), refreshSamples(), refreshTriggers(), and retrieveClosestIdentifier().
|
protected |
Inserts a trigger into I3 with the given identifier and identifier stack.
identifier | Trigger's identifier |
stack | Trigger's identifier stack |
store | Sets whether to store the trigger for auto-refresh |
Definition at line 422 of file I3BaseApp.cc.
|
protected |
Inserts the given trigger into I3.
t | Trigger to be inserted |
store | Sets whether to store the trigger for auto-refresh |
Definition at line 431 of file I3BaseApp.cc.
|
protected |
Returns number of init stages required.
Definition at line 66 of file I3BaseApp.cc.
|
protected |
Definition at line 477 of file I3BaseApp.cc.
|
protected |
Refreshes sampling triggers and selects fastest server as gateway.
Definition at line 332 of file I3BaseApp.cc.
Referenced by handleMessage().
|
protected |
Refreshes (reinserts) stored triggers.
Definition at line 264 of file I3BaseApp.cc.
Referenced by handleMessage().
|
protected |
Removes all triggers from the list of inserted triggers whose identifiers equal the one given.
identifier | Identifier to be compared against |
Definition at line 449 of file I3BaseApp.cc.
|
protected |
Removes a trigger from I3.
trigger | Trigger to be removed |
Definition at line 462 of file I3BaseApp.cc.
|
protected |
Definition at line 344 of file I3BaseApp.cc.
|
protected |
Routes a packet through I3, passing an identifier stack composed of a single identifier.
id | Destination identifier |
msg | Message to be sent |
useHint | Use address in server cache if existant |
Definition at line 373 of file I3BaseApp.cc.
|
protected |
Routes a packet through I3.
stack | Destination identifier stack |
msg | Message to be sent |
useHint | Use address in server cache if existant |
Definition at line 381 of file I3BaseApp.cc.
|
protected |
Sends a message through UDP.
msg | Message to be sent |
ip | IP of destination |
Definition at line 248 of file I3BaseApp.cc.
Referenced by insertTrigger(), removeTrigger(), sendPacket(), and sendToI3().
|
protected |
Sends a message to I3.
msg | Message to be sent |
Definition at line 243 of file I3BaseApp.cc.
|
protected |
Definition at line 102 of file I3BaseApp.h.
Referenced by handleMessage(), and initialize().
|
protected |
Definition at line 90 of file I3BaseApp.h.
Referenced by bootstrapI3(), initialize(), insertTrigger(), refreshTriggers(), removeTrigger(), sendPacket(), and sendToI3().
|
protected |
Definition at line 88 of file I3BaseApp.h.
Referenced by handleUDPMessage(), initialize(), refreshTriggers(), and sendPacket().
|
protected |
Definition at line 100 of file I3BaseApp.h.
Referenced by handleMessage(), and initialize().
|
protected |
Stored I3 triggers sent from this node, to be refreshed automatically.
Definition at line 84 of file I3BaseApp.h.
Referenced by getInsertedTriggers(), initialize(), insertTrigger(), refreshTriggers(), and removeTrigger().
|
private |
Definition at line 216 of file I3BaseApp.h.
Referenced by initialize().
|
protected |
Cached IP address of this node.
Definition at line 81 of file I3BaseApp.h.
Referenced by bootstrapI3(), initialize(), insertTrigger(), refreshTriggers(), retrieveClosestIdentifier(), sendPacket(), and sendThroughUDP().
|
protected |
Number of times this node has been isolated - i.e.
without any I3 servers known
Definition at line 78 of file I3BaseApp.h.
Referenced by initialize(), and refreshTriggers().
|
protected |
Number of received messages.
Definition at line 73 of file I3BaseApp.h.
Referenced by handleUDPMessage(), and initialize().
|
protected |
Number of sent messages.
Definition at line 68 of file I3BaseApp.h.
Referenced by initialize(), and sendPacket().
|
protected |
Definition at line 75 of file I3BaseApp.h.
Referenced by handleUDPMessage(), and initialize().
|
protected |
Definition at line 98 of file I3BaseApp.h.
Referenced by bootstrapI3(), and handleMessage().
|
protected |
Definition at line 96 of file I3BaseApp.h.
Referenced by bootstrapI3(), and handleMessage().
|
protected |
Definition at line 94 of file I3BaseApp.h.
Referenced by bootstrapI3(), and handleMessage().
|
protected |
Definition at line 92 of file I3BaseApp.h.
Referenced by bootstrapI3(), and handleMessage().
|
protected |
Definition at line 86 of file I3BaseApp.h.
Referenced by bootstrapI3(), handleUDPMessage(), initialize(), refreshSamples(), refreshTriggers(), and retrieveClosestIdentifier().
|
protected |
Definition at line 70 of file I3BaseApp.h.
Referenced by initialize(), and sendPacket().