Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __SCTPCLIENT_H_
00020 #define __SCTPCLIENT_H_
00021
00022 #include <omnetpp.h>
00023 #include "SCTPSocket.h"
00024 #include "SCTPAssociation.h"
00025
00032 class SCTPAssociation;
00033
00034 class INET_API SCTPClient : public cSimpleModule, public SCTPSocket::CallbackInterface
00035 {
00036 protected:
00037 SCTPSocket socket;
00038 SCTPAssociation* assoc;
00039
00040 int32 numSessions;
00041 int32 numBroken;
00042 uint64 packetsSent;
00043 uint64 packetsRcvd;
00044 uint64 bytesSent;
00045 uint64 echoedBytesSent;
00046 uint64 bytesRcvd;
00047 uint64 numRequestsToSend;
00048 uint64 numPacketsToReceive;
00049 uint32 numBytes;
00050 int64 bufferSize;
00051 int32 echoFactor;
00052 int32 queueSize;
00053 uint32 inStreams;
00054 uint32 outStreams;
00055 bool ordered;
00056 bool sendAllowed;
00057 bool timer;
00058 bool finishEndsSimulation;
00059 cMessage* timeMsg;
00060 cMessage* stopTimer;
00061 cMessage* primaryChangeTimer;
00063 void sendRequest(bool last=true);
00064 public:
00065
00066 struct pathStatus {
00067 bool active;
00068 bool primaryPath;
00069 IPvXAddress pid;
00070 };
00071 typedef std::map<IPvXAddress,pathStatus> SCTPPathStatus;
00072 SCTPPathStatus sctpPathStatus;
00076 void initialize();
00077
00082 void handleMessage(cMessage *msg);
00083
00089 void finish();
00093 void connect();
00095 void close();
00097
00099 void setStatusString(const char *s);
00101
00102 void handleTimer(cMessage *msg);
00106 void socketEstablished(int32 connId, void *yourPtr, uint64 buffer);
00111 void socketDataArrived(int32 connId, void *yourPtr, cPacket *msg, bool urgent);
00112 void socketDataNotificationArrived(int32 connId, void *yourPtr, cPacket *msg);
00114 void socketPeerClosed(int32 connId, void *yourPtr);
00116 void socketClosed(int32 connId, void *yourPtr);
00118 void socketFailure(int32 connId, void *yourPtr, int32 code);
00120 void socketStatusArrived(int32 connId, void *yourPtr, SCTPStatusInfo *status);
00122 void setAssociation(SCTPAssociation *_assoc) {assoc = _assoc;};
00123 void setPrimaryPath (const char* addr);
00124 void sendRequestArrived();
00125 void sendQueueRequest();
00126 void shutdownReceivedArrived(int32 connId);
00127 void sendqueueFullArrived(int32 connId);
00128 void sendqueueAbatedArrived(int32 connId, uint64 buffer);
00129 void addressAddedArrived(int32 assocId, IPvXAddress remoteAddr);
00130 };
00131
00132 #endif
00133
00134