INET Framework for OMNeT++/OMNEST
inet::PacketDrillApp Class Reference

Implements the packetdrill application simple module. More...

#include <PacketDrillApp.h>

Inheritance diagram for inet::PacketDrillApp:
inet::TCPSessionApp inet::ILifecycle inet::TCPAppBase inet::TCPSocket::CallbackInterface

Public Member Functions

 PacketDrillApp ()
 
virtual ~PacketDrillApp ()
 
virtual bool handleOperationStage (LifecycleOperation *operation, int stage, IDoneCallback *doneCallback) override
 
const int getLocalPort ()
 
const int getRemotePort ()
 
const uint32 getIdInbound ()
 
const uint32 getIdOutbound ()
 
uint32 getPeerTS ()
 
void increaseIdInbound ()
 
void increaseIdOutbound ()
 
const L3Address getLocalAddress ()
 
const L3Address getRemoteAddress ()
 
uint32 getPeerVTag ()
 
uint32 getLocalVTag ()
 
uint32 getPeerCumTsn ()
 
uint32 getInitPeerTsn ()
 
simtime_t getPeerHeartbeatTime ()
 
void setSeqNumMap (uint32 ownNum, uint32 liveNum)
 
uint32 getSeqNumMap (uint32 ownNum)
 
bool findSeqNumMap (uint32 num)
 
- Public Member Functions inherited from inet::TCPSessionApp
 TCPSessionApp ()
 
virtual ~TCPSessionApp ()
 
- Public Member Functions inherited from inet::TCPSocket::CallbackInterface
virtual ~CallbackInterface ()
 
virtual void socketDeleted (int connId, void *yourPtr)
 
- Public Member Functions inherited from inet::ILifecycle
virtual ~ILifecycle ()
 

Protected Member Functions

virtual int numInitStages () const override
 
void initialize (int stage) override
 
void handleMessage (cMessage *msg) override
 
void finish () override
 
void handleTimer (cMessage *msg) override
 
- Protected Member Functions inherited from inet::TCPSessionApp
virtual bool isNodeUp ()
 
virtual void refreshDisplay () const override
 
virtual void parseScript (const char *script)
 
virtual cPacket * createDataPacket (long sendBytes)
 
virtual void sendData ()
 
virtual void socketEstablished (int connId, void *yourPtr) override
 
virtual void socketDataArrived (int connId, void *yourPtr, cPacket *msg, bool urgent) override
 
virtual void socketClosed (int connId, void *yourPtr) override
 
virtual void socketFailure (int connId, void *yourPtr, int code) override
 
- Protected Member Functions inherited from inet::TCPAppBase
virtual void connect ()
 
virtual void close ()
 
virtual void sendPacket (cPacket *pkt)
 
virtual void socketPeerClosed (int connId, void *yourPtr) override
 
virtual void socketStatusArrived (int connId, void *yourPtr, TCPStatusInfo *status) override
 

Private Member Functions

void scheduleEvent ()
 
void runEvent (PacketDrillEvent *event)
 
void runSystemCallEvent (PacketDrillEvent *event, struct syscall_spec *syscall)
 
void closeAllSockets ()
 
int syscallSocket (struct syscall_spec *syscall, cQueue *args, char **error)
 
int syscallBind (struct syscall_spec *syscall, cQueue *args, char **error)
 
int syscallListen (struct syscall_spec *syscall, cQueue *args, char **error)
 
int syscallConnect (struct syscall_spec *syscall, cQueue *args, char **error)
 
int syscallWrite (struct syscall_spec *syscall, cQueue *args, char **error)
 
int syscallAccept (struct syscall_spec *syscall, cQueue *args, char **error)
 
int syscallSetsockopt (struct syscall_spec *syscall, cQueue *args, char **error)
 
int syscallGetsockopt (struct syscall_spec *syscall, cQueue *args, char **error)
 
int syscallSendTo (struct syscall_spec *syscall, cQueue *args, char **error)
 
int syscallRead (PacketDrillEvent *event, struct syscall_spec *syscall, cQueue *args, char **error)
 
int syscallRecvFrom (PacketDrillEvent *event, struct syscall_spec *syscall, cQueue *args, char **error)
 
int syscallClose (struct syscall_spec *syscall, cQueue *args, char **error)
 
int syscallShutdown (struct syscall_spec *syscall, cQueue *args, char **error)
 
int syscallSctpSendmsg (struct syscall_spec *syscall, cQueue *args, char **error)
 
int syscallSctpSend (struct syscall_spec *syscall, cQueue *args, char **error)
 
bool compareDatagram (IPv4Datagram *storedDatagram, IPv4Datagram *liveDatagram)
 
bool compareUdpPacket (UDPPacket *storedUdp, UDPPacket *liveUdp)
 
bool compareTcpPacket (tcp::TCPSegment *storedTcp, tcp::TCPSegment *liveTcp)
 
bool compareSctpPacket (SCTPMessage *storedSctp, SCTPMessage *liveSctp)
 
bool compareInitPacket (SCTPInitChunk *storedInitChunk, SCTPInitChunk *liveInitChunk)
 
bool compareDataPacket (SCTPDataChunk *storedDataChunk, SCTPDataChunk *liveDataChunk)
 
bool compareSackPacket (SCTPSackChunk *storedSackChunk, SCTPSackChunk *liveSackChunk)
 
bool compareInitAckPacket (SCTPInitAckChunk *storedInitAckChunk, SCTPInitAckChunk *liveInitAckChunk)
 
bool compareReconfigPacket (SCTPStreamResetChunk *storedReconfigChunk, SCTPStreamResetChunk *liveReconfigChunk)
 
int verifyTime (enum eventTime_t timeType, simtime_t script_usecs, simtime_t script_usecs_end, simtime_t offset, simtime_t liveTime, const char *description)
 
void adjustTimes (PacketDrillEvent *event)
 

Private Attributes

PacketDrillScriptscript
 
PacketDrillConfigconfig
 
L3Address localAddress
 
L3Address remoteAddress
 
int localPort
 
int remotePort
 
int protocol
 
int tcpConnId
 
int sctpAssocId
 
UDPSocket udpSocket
 
TCPSocket tcpSocket
 
SCTPSocket sctpSocket
 
PacketDrillpd
 
bool msgArrived
 
bool recvFromSet
 
bool listenSet
 
bool acceptSet
 
bool establishedPending
 
bool abortSent
 
bool socketOptionsArrived
 
cPacketQueue * receivedPackets
 
cPacketQueue * outboundPackets
 
simtime_t simStartTime
 
simtime_t simRelTime
 
uint32 expectedMessageSize
 
uint32 relSequenceIn
 
uint32 relSequenceOut
 
uint32 peerTS
 
uint16 peerWindow
 
uint16 peerInStreams
 
uint16 peerOutStreams
 
SCTPCookiepeerCookie
 
uint16 peerCookieLength
 
uint32 initPeerTsn
 
uint32 initLocalTsn
 
uint32 localDiffTsn
 
uint32 peerCumTsn
 
uint32 localCumTsn
 
uint32 eventCounter
 
uint32 numEvents
 
uint32 idInbound
 
uint32 idOutbound
 
uint32 localVTag
 
uint32 peerVTag
 
std::map< uint32, uint32seqNumMap
 
simtime_t peerHeartbeatTime
 
cMessage * eventTimer
 

Additional Inherited Members

- Protected Types inherited from inet::TCPSessionApp
typedef std::vector< CommandCommandVector
 
- Protected Attributes inherited from inet::TCPSessionApp
CommandVector commands
 
bool activeOpen = false
 
simtime_t tOpen
 
simtime_t tSend
 
simtime_t tClose
 
int sendBytes = 0
 
int commandIndex = -1
 
cMessage * timeoutMsg = nullptr
 
NodeStatusnodeStatus = nullptr
 
- Protected Attributes inherited from inet::TCPAppBase
TCPSocket socket
 
int numSessions
 
int numBroken
 
int packetsSent
 
int packetsRcvd
 
int bytesSent
 
int bytesRcvd
 
- Static Protected Attributes inherited from inet::TCPAppBase
static simsignal_t connectSignal = registerSignal("connect")
 
static simsignal_t rcvdPkSignal = registerSignal("rcvdPk")
 
static simsignal_t sentPkSignal = registerSignal("sentPk")
 

Detailed Description

Implements the packetdrill application simple module.

See the NED file for more info.

Constructor & Destructor Documentation

inet::PacketDrillApp::PacketDrillApp ( )
43 {
44  script = nullptr;
45  config = nullptr;
46  localPort = 1000;
47  remotePort = 2000;
48  protocol = 0;
49  tcpConnId = -1;
50  sctpAssocId = -1;
51  pd = nullptr;
52  msgArrived = false;
53  recvFromSet = false;
54  listenSet = false;
55  acceptSet = false;
56  establishedPending = false;
57  abortSent = false;
58  socketOptionsArrived = false;
59  receivedPackets = nullptr;
60  outboundPackets = nullptr;
62  relSequenceIn = 0;
63  relSequenceOut = 0;
64  peerTS = 0;
65  peerWindow = 0;
66  peerInStreams = 0;
67  peerOutStreams = 0;
68  peerCookie = nullptr;
69  peerCookieLength = 0;
70  initPeerTsn = 0;
71  initLocalTsn = 0;
72  localDiffTsn = 0;
73  peerCumTsn = 0;
74  localCumTsn = 0;
75  eventCounter = 0;
76  numEvents = 0;
77  idInbound = 0;
78  idOutbound = 0;
79  localVTag = 0;
80  peerVTag = 0;
81  eventTimer = nullptr;
82 
83  localAddress = L3Address("127.0.0.1");
84  remoteAddress = L3Address("127.0.0.1");
85 }
uint32 localCumTsn
Definition: PacketDrillApp.h:116
uint32 peerTS
Definition: PacketDrillApp.h:106
uint32 relSequenceOut
Definition: PacketDrillApp.h:105
uint32 localVTag
Definition: PacketDrillApp.h:121
uint32 eventCounter
Definition: PacketDrillApp.h:117
PacketDrill * pd
Definition: PacketDrillApp.h:91
bool msgArrived
Definition: PacketDrillApp.h:92
uint32 initLocalTsn
Definition: PacketDrillApp.h:113
int localPort
Definition: PacketDrillApp.h:83
uint16 peerCookieLength
Definition: PacketDrillApp.h:111
int tcpConnId
Definition: PacketDrillApp.h:86
bool listenSet
Definition: PacketDrillApp.h:94
cMessage * eventTimer
Definition: PacketDrillApp.h:125
uint32 idOutbound
Definition: PacketDrillApp.h:120
uint32 relSequenceIn
Definition: PacketDrillApp.h:104
bool abortSent
Definition: PacketDrillApp.h:97
uint32 expectedMessageSize
Definition: PacketDrillApp.h:103
bool recvFromSet
Definition: PacketDrillApp.h:93
uint16 peerOutStreams
Definition: PacketDrillApp.h:109
PacketDrillConfig * config
Definition: PacketDrillApp.h:80
bool acceptSet
Definition: PacketDrillApp.h:95
This class provides the generic interface for network addresses.
Definition: L3Address.h:41
uint32 numEvents
Definition: PacketDrillApp.h:118
int protocol
Definition: PacketDrillApp.h:85
uint32 initPeerTsn
Definition: PacketDrillApp.h:112
int remotePort
Definition: PacketDrillApp.h:84
uint32 peerCumTsn
Definition: PacketDrillApp.h:115
bool socketOptionsArrived
Definition: PacketDrillApp.h:98
uint32 idInbound
Definition: PacketDrillApp.h:119
int sctpAssocId
Definition: PacketDrillApp.h:87
cPacketQueue * receivedPackets
Definition: PacketDrillApp.h:99
SCTPCookie * peerCookie
Definition: PacketDrillApp.h:110
cPacketQueue * outboundPackets
Definition: PacketDrillApp.h:100
L3Address localAddress
Definition: PacketDrillApp.h:81
uint32 peerVTag
Definition: PacketDrillApp.h:122
PacketDrillScript * script
Definition: PacketDrillApp.h:79
uint16 peerWindow
Definition: PacketDrillApp.h:107
L3Address remoteAddress
Definition: PacketDrillApp.h:82
bool establishedPending
Definition: PacketDrillApp.h:96
uint16 peerInStreams
Definition: PacketDrillApp.h:108
uint32 localDiffTsn
Definition: PacketDrillApp.h:114
inet::PacketDrillApp::~PacketDrillApp ( )
virtual
1490 {
1491  if (eventTimer->isScheduled()) {
1492  cancelEvent(eventTimer);
1493  }
1494  delete eventTimer;
1495  delete pd;
1496  delete receivedPackets;
1497  delete outboundPackets;
1498  delete config;
1499  delete script;
1500 }
PacketDrill * pd
Definition: PacketDrillApp.h:91
cMessage * eventTimer
Definition: PacketDrillApp.h:125
PacketDrillConfig * config
Definition: PacketDrillApp.h:80
cPacketQueue * receivedPackets
Definition: PacketDrillApp.h:99
cPacketQueue * outboundPackets
Definition: PacketDrillApp.h:100
PacketDrillScript * script
Definition: PacketDrillApp.h:79

Member Function Documentation

void inet::PacketDrillApp::adjustTimes ( PacketDrillEvent event)
private
333 {
334  simtime_t offset, offsetLastEvent;
335  if (event->getTimeType() == ANY_TIME ||
336  event->getTimeType() == RELATIVE_TIME ||
337  event->getTimeType() == RELATIVE_RANGE_TIME) {
338  offset = getSimulation()->getSimTime() - simStartTime;
339  offsetLastEvent = ((PacketDrillEvent *)(script->getEventList()->get(eventCounter - 1)))->getEventTime() - simStartTime;
340  offset = (offset.dbl() > offsetLastEvent.dbl()) ? offset : offsetLastEvent;
341  event->setEventOffset(offset);
342  event->setEventTime(event->getEventTime() + offset + simStartTime);
343  if (event->getTimeType() == RELATIVE_RANGE_TIME) {
344  event->setEventTimeEnd(event->getEventTimeEnd() + offset + simStartTime);
345  }
346  } else if (event->getTimeType() == ABSOLUTE_TIME) {
347  event->setEventTime(event->getEventTime() + simStartTime);
348  } else
349  throw cRuntimeError("Unknown time type");
350 }
uint32 eventCounter
Definition: PacketDrillApp.h:117
Definition: PacketDrillUtils.h:239
Definition: PacketDrillUtils.h:235
enum eventTime_t getTimeType() const
Definition: PacketDrillUtils.h:517
simtime_t getEventTime() const
Definition: PacketDrillUtils.h:509
simtime_t simStartTime
Definition: PacketDrillApp.h:101
Definition: PacketDrillUtils.h:482
cQueue * getEventList()
Definition: PacketDrillUtils.h:621
simtime_t getEventTimeEnd() const
Definition: PacketDrillUtils.h:512
Definition: PacketDrillUtils.h:236
PacketDrillScript * script
Definition: PacketDrillApp.h:79
Definition: PacketDrillUtils.h:237
void inet::PacketDrillApp::closeAllSockets ( )
private
572 {
573  SCTPAbortChunk *abortChunk = new SCTPAbortChunk("Abort");
574  abortChunk->setChunkType(ABORT);
575  abortChunk->setT_Bit(1);
576  abortChunk->setByteLength(SCTP_ABORT_CHUNK_LENGTH);
577  SCTPMessage *sctpmsg = new SCTPMessage();
578  sctpmsg->setByteLength(SCTP_COMMON_HEADER);
579  sctpmsg->setSrcPort(remotePort);
580  sctpmsg->setDestPort(localPort);
581  sctpmsg->setTag(peerVTag);
582  sctpmsg->setName("SCTPCleanUp");
583  sctpmsg->setChecksumOk(true);
584  sctpmsg->addChunk(abortChunk);
585  IPv4Datagram *datagram = new IPv4Datagram("IPCleanup");
586  datagram->setSrcAddress(remoteAddress.toIPv4());
587  datagram->setDestAddress(localAddress.toIPv4());
588  datagram->setIdentification(0);
589  datagram->setVersion(4);
590  datagram->setHeaderLength(20);
592  datagram->setTimeToLive(32);
593  datagram->setMoreFragments(0);
594  datagram->setDontFragment(0);
595  datagram->setFragmentOffset(0);
596  datagram->setTypeOfService(0);
597  datagram->setByteLength(20);
598  datagram->encapsulate(sctpmsg);
599  EV_DETAIL << "Send Abort to cleanup association." << endl;
600  send(datagram, "tunOut");
601 }
virtual void addChunk(cPacket *msg)
Adds a message object to the SCTP packet.
Definition: SCTPMessage.cc:93
int localPort
Definition: PacketDrillApp.h:83
virtual void setMoreFragments(bool moreFragments)
virtual void setDontFragment(bool dontFragment)
virtual void setHeaderLength(short headerLength)
virtual void setTag(uint32_t tag)
virtual void setT_Bit(bool T_Bit)
virtual void setChunkType(uint8_t chunkType)
#define SCTP_COMMON_HEADER
Definition: SCTPAssociation.h:212
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:202 by nedtool.
Definition: SCTPMessage_m.h:920
int remotePort
Definition: PacketDrillApp.h:84
Represents an IPv4 datagram.
Definition: IPv4Datagram.h:31
virtual void setTransportProtocol(int protocol) override
Definition: IPv4Datagram.h:106
virtual void setDestPort(uint16_t destPort)
virtual void setTimeToLive(short timeToLive)
#define IPPROTO_SCTP
Definition: PacketDrillUtils.h:45
virtual void setVersion(short version)
virtual void setIdentification(int identification)
Definition: SCTPAssociation.h:117
L3Address localAddress
Definition: PacketDrillApp.h:81
uint32 peerVTag
Definition: PacketDrillApp.h:122
Represents a SCTP Message.
Definition: SCTPMessage.h:35
virtual void setSrcAddress(const IPv4Address &srcAddress)
virtual void setDestAddress(const IPv4Address &destAddress)
L3Address remoteAddress
Definition: PacketDrillApp.h:82
virtual void setTypeOfService(unsigned char typeOfService)
virtual void setChecksumOk(bool checksumOk)
#define SCTP_ABORT_CHUNK_LENGTH
Definition: SCTPAssociation.h:218
IPv4Address toIPv4() const
Definition: L3Address.h:76
virtual void setFragmentOffset(int fragmentOffset)
virtual void setSrcPort(uint16_t srcPort)
bool inet::PacketDrillApp::compareDatagram ( IPv4Datagram storedDatagram,
IPv4Datagram liveDatagram 
)
private
1542 {
1543  if (!(storedDatagram->getSrcAddress() == liveDatagram->getSrcAddress())) {
1544  return false;
1545  }
1546  if (!(storedDatagram->getDestAddress() == liveDatagram->getDestAddress())) {
1547  return false;
1548  }
1549  if (!(storedDatagram->getTransportProtocol() == liveDatagram->getTransportProtocol())) {
1550  return false;
1551  }
1552  if (!(storedDatagram->getTimeToLive() == liveDatagram->getTimeToLive())) {
1553  return false;
1554  }
1555  if (!(storedDatagram->getIdentification() == liveDatagram->getIdentification())){
1556  return false;
1557  }
1558  if (!(storedDatagram->getMoreFragments() == liveDatagram->getMoreFragments())) {
1559  return false;
1560  }
1561  if (!(storedDatagram->getDontFragment() == liveDatagram->getDontFragment())) {
1562  return false;
1563  }
1564  if (!(storedDatagram->getFragmentOffset() == liveDatagram->getFragmentOffset())) {
1565  return false;
1566  }
1567  if (!(storedDatagram->getTypeOfService() == liveDatagram->getTypeOfService())) {
1568  return false;
1569  }
1570  if (!(storedDatagram->getHeaderLength() == liveDatagram->getHeaderLength())) {
1571  return false;
1572  }
1573  switch (storedDatagram->getTransportProtocol()) {
1574  case IP_PROT_UDP: {
1575  UDPPacket *storedUdp = check_and_cast<UDPPacket *>(storedDatagram->getEncapsulatedPacket());
1576  UDPPacket *liveUdp = check_and_cast<UDPPacket *>(liveDatagram->getEncapsulatedPacket());
1577  if (!(compareUdpPacket(storedUdp, liveUdp))) {
1578  return false;
1579  }
1580  break;
1581  }
1582 
1583  case IP_PROT_TCP: {
1584  TCPSegment *storedTcp = check_and_cast<TCPSegment *>(storedDatagram->getEncapsulatedPacket());
1585  TCPSegment *liveTcp = check_and_cast<TCPSegment *>(liveDatagram->getEncapsulatedPacket());
1586  if (storedTcp->getSynBit()) { // SYN was sent. Store the sequence number for comparisons
1587  relSequenceOut = liveTcp->getSequenceNo();
1588  }
1589  if (storedTcp->getSynBit() && storedTcp->getAckBit()) {
1590  peerWindow = liveTcp->getWindow();
1591  }
1592  if (!(compareTcpPacket(storedTcp, liveTcp))) {
1593  return false;
1594  }
1595  break;
1596  }
1597  case IP_PROT_SCTP: {
1598  SCTPMessage *storedSctp = check_and_cast<SCTPMessage *>(storedDatagram->decapsulate());
1599  SCTPMessage *liveSctp = check_and_cast<SCTPMessage *>(liveDatagram->decapsulate());
1600  if (!(compareSctpPacket(storedSctp, liveSctp))) {
1601  EV_DETAIL << "SCTP packets are not the same" << endl;
1602  return false;
1603  }
1604  delete storedSctp;
1605  delete liveSctp;
1606  break;
1607  }
1608  default: EV_INFO << "Transport protocol %d is not supported yet" << storedDatagram->getTransportProtocol();
1609  }
1610  return true;
1611 }
uint32 relSequenceOut
Definition: PacketDrillApp.h:105
virtual IPv4Address & getSrcAddress()
virtual bool getDontFragment() const
bool compareUdpPacket(UDPPacket *storedUdp, UDPPacket *liveUdp)
Definition: PacketDrillApp.cc:1613
virtual IPv4Address & getDestAddress()
Definition: UDPPacket.h:26
virtual bool getAckBit() const
virtual int getFragmentOffset() const
virtual short getHeaderLength() const
virtual bool getSynBit() const
virtual int getTransportProtocol() const override
Definition: IPv4Datagram.h:105
virtual unsigned char getTypeOfService() const
bool compareTcpPacket(tcp::TCPSegment *storedTcp, tcp::TCPSegment *liveTcp)
Definition: PacketDrillApp.cc:1619
bool compareSctpPacket(SCTPMessage *storedSctp, SCTPMessage *liveSctp)
Definition: PacketDrillApp.cc:1709
Definition: IPProtocolId_m.h:80
virtual int getIdentification() const
Represents a TCP segment.
Definition: TCPSegment.h:60
Definition: IPProtocolId_m.h:83
Represents a SCTP Message.
Definition: SCTPMessage.h:35
uint16 peerWindow
Definition: PacketDrillApp.h:107
virtual short getTimeToLive() const
virtual bool getMoreFragments() const
Definition: IPProtocolId_m.h:91
bool inet::PacketDrillApp::compareDataPacket ( SCTPDataChunk storedDataChunk,
SCTPDataChunk liveDataChunk 
)
private
1903 {
1904  uint32 flags = storedDataChunk->getFlags();
1905  if (!(flags & FLAG_CHUNK_LENGTH_NOCHECK))
1906  if (storedDataChunk->getByteLength() != liveDataChunk->getByteLength())
1907  return false;
1908 
1909  if (!(flags & FLAG_CHUNK_FLAGS_NOCHECK)) {
1910  if (!(storedDataChunk->getBBit() == liveDataChunk->getBBit()))
1911  return false;
1912  if (!(storedDataChunk->getEBit() == liveDataChunk->getEBit()))
1913  return false;
1914  }
1915  if (!(flags & FLAG_DATA_CHUNK_TSN_NOCHECK))
1916  if (!(storedDataChunk->getTsn() + localDiffTsn == liveDataChunk->getTsn()))
1917  return false;
1918  if (!(flags & FLAG_DATA_CHUNK_SID_NOCHECK))
1919  if (!(storedDataChunk->getSid() == liveDataChunk->getSid()))
1920  return false;
1921  if (!(flags & FLAG_DATA_CHUNK_SSN_NOCHECK))
1922  if (!(storedDataChunk->getSsn() == liveDataChunk->getSsn()))
1923  return false;
1924  if (!(flags & FLAG_DATA_CHUNK_PPID_NOCHECK))
1925  if ( !(storedDataChunk->getPpid() == liveDataChunk->getPpid()))
1926  return false;
1927 
1928  return true;
1929 }
#define FLAG_CHUNK_FLAGS_NOCHECK
Definition: PacketDrillUtils.h:97
#define FLAG_DATA_CHUNK_SSN_NOCHECK
Definition: PacketDrillUtils.h:120
virtual uint32_t getTsn() const
#define FLAG_DATA_CHUNK_SID_NOCHECK
Definition: PacketDrillUtils.h:119
#define FLAG_CHUNK_LENGTH_NOCHECK
Definition: PacketDrillUtils.h:98
virtual bool getEBit() const
virtual uint32_t getPpid() const
virtual uint16_t getSid() const
uint32_t uint32
Definition: Compat.h:30
#define FLAG_DATA_CHUNK_PPID_NOCHECK
Definition: PacketDrillUtils.h:121
virtual uint32_t getFlags() const
#define FLAG_DATA_CHUNK_TSN_NOCHECK
Definition: PacketDrillUtils.h:118
virtual bool getBBit() const
virtual uint16_t getSsn() const
uint32 localDiffTsn
Definition: PacketDrillApp.h:114
bool inet::PacketDrillApp::compareInitAckPacket ( SCTPInitAckChunk storedInitAckChunk,
SCTPInitAckChunk liveInitAckChunk 
)
private
1959 {
1960  uint32 flags = storedInitAckChunk->getFlags();
1961  peerVTag = liveInitAckChunk->getInitTag();
1962  localDiffTsn = liveInitAckChunk->getInitTSN() - initLocalTsn;
1963  initPeerTsn = liveInitAckChunk->getInitTSN();
1964  localCumTsn = initPeerTsn - 1;
1965  peerCumTsn = initLocalTsn - 1;
1966  if (!(flags & FLAG_INIT_ACK_CHUNK_A_RWND_NOCHECK))
1967  if (!(storedInitAckChunk->getA_rwnd() == liveInitAckChunk->getA_rwnd()))
1968  return false;
1969  if (!(flags & FLAG_INIT_ACK_CHUNK_OS_NOCHECK))
1970  if (!(min(storedInitAckChunk->getNoOutStreams(), peerInStreams) == liveInitAckChunk->getNoOutStreams()))
1971  return false;
1972  if (!(flags & FLAG_INIT_ACK_CHUNK_IS_NOCHECK))
1973  if (!(min(storedInitAckChunk->getNoInStreams(), peerOutStreams) == liveInitAckChunk->getNoInStreams()))
1974  return false;
1975  if (!(flags & FLAG_INIT_ACK_CHUNK_TSN_NOCHECK))
1976  if (!(storedInitAckChunk->getInitTSN() + localDiffTsn == liveInitAckChunk->getInitTSN()))
1977  return false;
1978  peerCookie = check_and_cast<SCTPCookie*>(liveInitAckChunk->getStateCookie());
1979  peerCookieLength = peerCookie->getByteLength();
1980  return true;
1981 }
#define FLAG_INIT_ACK_CHUNK_TSN_NOCHECK
Definition: PacketDrillUtils.h:113
uint32 localCumTsn
Definition: PacketDrillApp.h:116
virtual uint32_t getInitTSN() const
uint32 initLocalTsn
Definition: PacketDrillApp.h:113
#define FLAG_INIT_ACK_CHUNK_A_RWND_NOCHECK
Definition: PacketDrillUtils.h:110
uint16 peerCookieLength
Definition: PacketDrillApp.h:111
double min(const double a, const double b)
Returns the minimum of a and b.
Definition: SCTPAssociation.h:270
virtual uint32_t getInitTag() const
uint16 peerOutStreams
Definition: PacketDrillApp.h:109
virtual cPacketPtr & getStateCookie()
uint32 initPeerTsn
Definition: PacketDrillApp.h:112
uint32 peerCumTsn
Definition: PacketDrillApp.h:115
#define FLAG_INIT_ACK_CHUNK_IS_NOCHECK
Definition: PacketDrillUtils.h:112
SCTPCookie * peerCookie
Definition: PacketDrillApp.h:110
uint32_t uint32
Definition: Compat.h:30
virtual uint16_t getNoOutStreams() const
virtual uint32_t getA_rwnd() const
virtual uint32_t getFlags() const
virtual uint16_t getNoInStreams() const
uint32 peerVTag
Definition: PacketDrillApp.h:122
uint16 peerInStreams
Definition: PacketDrillApp.h:108
uint32 localDiffTsn
Definition: PacketDrillApp.h:114
#define FLAG_INIT_ACK_CHUNK_OS_NOCHECK
Definition: PacketDrillUtils.h:111
bool inet::PacketDrillApp::compareInitPacket ( SCTPInitChunk storedInitChunk,
SCTPInitChunk liveInitChunk 
)
private
1932 {
1933  uint32 flags = storedInitChunk->getFlags();
1934  peerVTag = liveInitChunk->getInitTag();
1935  localDiffTsn = liveInitChunk->getInitTSN() - initLocalTsn;
1936  initPeerTsn = liveInitChunk->getInitTSN();
1937  localCumTsn = initPeerTsn - 1;
1938  peerCumTsn = initLocalTsn - 1;
1939 
1940  if (!(flags & FLAG_INIT_CHUNK_TSN_NOCHECK))
1941  if (!(storedInitChunk->getInitTSN() + localDiffTsn == liveInitChunk->getInitTSN()))
1942  return false;
1943  if (!(flags & FLAG_INIT_CHUNK_A_RWND_NOCHECK))
1944  if (!(storedInitChunk->getA_rwnd() == liveInitChunk->getA_rwnd()))
1945  return false;
1946  peerInStreams = liveInitChunk->getNoInStreams();
1947  peerOutStreams = liveInitChunk->getNoOutStreams();
1948  if (!(flags & FLAG_INIT_CHUNK_OS_NOCHECK))
1949  if (!(storedInitChunk->getNoOutStreams() == liveInitChunk->getNoOutStreams()))
1950  return false;
1951  if (!(flags & FLAG_INIT_CHUNK_IS_NOCHECK))
1952  if (!(storedInitChunk->getNoInStreams() == liveInitChunk->getNoInStreams()))
1953  return false;
1954 
1955  return true;
1956 }
virtual uint16_t getNoOutStreams() const
uint32 localCumTsn
Definition: PacketDrillApp.h:116
uint32 initLocalTsn
Definition: PacketDrillApp.h:113
uint16 peerOutStreams
Definition: PacketDrillApp.h:109
uint32 initPeerTsn
Definition: PacketDrillApp.h:112
virtual uint16_t getNoInStreams() const
virtual uint32_t getA_rwnd() const
virtual uint32_t getInitTSN() const
uint32 peerCumTsn
Definition: PacketDrillApp.h:115
#define FLAG_INIT_CHUNK_IS_NOCHECK
Definition: PacketDrillUtils.h:104
uint32_t uint32
Definition: Compat.h:30
virtual uint32_t getInitTag() const
#define FLAG_INIT_CHUNK_OS_NOCHECK
Definition: PacketDrillUtils.h:103
#define FLAG_INIT_CHUNK_TSN_NOCHECK
Definition: PacketDrillUtils.h:105
virtual uint32_t getFlags() const
uint32 peerVTag
Definition: PacketDrillApp.h:122
#define FLAG_INIT_CHUNK_A_RWND_NOCHECK
Definition: PacketDrillUtils.h:102
uint16 peerInStreams
Definition: PacketDrillApp.h:108
uint32 localDiffTsn
Definition: PacketDrillApp.h:114
bool inet::PacketDrillApp::compareReconfigPacket ( SCTPStreamResetChunk storedReconfigChunk,
SCTPStreamResetChunk liveReconfigChunk 
)
private
1984 {
1985  bool found = false;
1986 
1987  uint32 flags = storedReconfigChunk->getFlags();
1988  if (!(storedReconfigChunk->getParametersArraySize() == liveReconfigChunk->getParametersArraySize())) {
1989  return false;
1990  }
1991  for (unsigned int i = 0; i < storedReconfigChunk->getParametersArraySize(); i++) {
1992  SCTPParameter *storedParameter = check_and_cast<SCTPParameter *>(storedReconfigChunk->getParameters(i));
1993  SCTPParameter *liveParameter = nullptr;
1994  found = false;
1995  switch (storedParameter->getParameterType()) {
1997  SCTPOutgoingSSNResetRequestParameter *storedoutparam = check_and_cast<SCTPOutgoingSSNResetRequestParameter *>(storedParameter);
1998  for (unsigned int j = 0; j < liveReconfigChunk->getParametersArraySize(); j++) {
1999  liveParameter = check_and_cast<SCTPParameter *>(liveReconfigChunk->getParameters(j));
2000  if (liveParameter->getParameterType() != OUTGOING_RESET_REQUEST_PARAMETER)
2001  continue;
2002  else {
2003  found = true;
2004  break;
2005  }
2006  }
2007  if (!found)
2008  return false;
2009  SCTPOutgoingSSNResetRequestParameter *liveoutparam = check_and_cast<SCTPOutgoingSSNResetRequestParameter *>(liveParameter);
2010  if (seqNumMap[storedoutparam->getSrReqSn()] == 0) {
2011  seqNumMap[storedoutparam->getSrReqSn()] = liveoutparam->getSrReqSn();
2012  } else if (!(flags & FLAG_RECONFIG_REQ_SN_NOCHECK))
2013  if (!(seqNumMap[storedoutparam->getSrReqSn()] == liveoutparam->getSrReqSn())) {
2014  return false;
2015  }
2016  if (seqNumMap[storedoutparam->getSrResSn()] == 0) {
2017  seqNumMap[storedoutparam->getSrResSn()] = liveoutparam->getSrResSn();
2018  }
2019  if (!(flags & FLAG_RECONFIG_LAST_TSN_NOCHECK))
2020  if (!(storedoutparam->getLastTsn() + localDiffTsn == liveoutparam->getLastTsn()))
2021  return false;
2022  if (!(storedoutparam->getStreamNumbersArraySize() == liveoutparam->getStreamNumbersArraySize()))
2023  return false;
2024  if (storedoutparam->getStreamNumbersArraySize() > 0) {
2025  for (uint16 i = 0; i < storedoutparam->getStreamNumbersArraySize(); i++) {
2026  if (!(storedoutparam->getStreamNumbers(i) == liveoutparam->getStreamNumbers(i)))
2027  return false;
2028  }
2029  }
2030  break;
2031  }
2033  found = false;
2034  SCTPIncomingSSNResetRequestParameter *storedinparam = check_and_cast<SCTPIncomingSSNResetRequestParameter *>(storedParameter);
2035  for (unsigned int j = 0; j < liveReconfigChunk->getParametersArraySize(); j++) {
2036  liveParameter = check_and_cast<SCTPParameter *>(liveReconfigChunk->getParameters(j));
2037  if (liveParameter->getParameterType() != INCOMING_RESET_REQUEST_PARAMETER)
2038  continue;
2039  else {
2040  found = true;
2041  break;
2042  }
2043  }
2044  if (!found)
2045  return false;
2046  SCTPIncomingSSNResetRequestParameter *liveinparam = check_and_cast<SCTPIncomingSSNResetRequestParameter *>(liveParameter);
2047  if (seqNumMap[storedinparam->getSrReqSn()] == 0) {
2048  seqNumMap[storedinparam->getSrReqSn()] = liveinparam->getSrReqSn();
2049  } else if (!(seqNumMap[storedinparam->getSrReqSn()] == liveinparam->getSrReqSn())) {
2050  return false;
2051  }
2052  if (!(storedinparam->getStreamNumbersArraySize() == liveinparam->getStreamNumbersArraySize()))
2053  return false;
2054  if (storedinparam->getStreamNumbersArraySize() > 0) {
2055  for (uint16 i = 0; i < storedinparam->getStreamNumbersArraySize(); i++) {
2056  if (!(storedinparam->getStreamNumbers(i) == liveinparam->getStreamNumbers(i)))
2057  return false;
2058  }
2059  }
2060  break;
2061  }
2063  SCTPStreamResetResponseParameter *storedresparam = check_and_cast<SCTPStreamResetResponseParameter *>(storedParameter);
2064  liveParameter = check_and_cast<SCTPParameter *>(liveReconfigChunk->getParameters(i));
2065  if (liveParameter->getParameterType() != STREAM_RESET_RESPONSE_PARAMETER) {
2066  break;
2067  }
2068  SCTPStreamResetResponseParameter *liveresparam = check_and_cast<SCTPStreamResetResponseParameter *>(liveParameter);
2069  if (!(storedresparam->getSrResSn() == liveresparam->getSrResSn())) {
2070  return false;
2071  }
2072  if (!(flags & FLAG_RECONFIG_RESULT_NOCHECK))
2073  if (!(storedresparam->getResult() == liveresparam->getResult()))
2074  return false;
2075  if (storedresparam->getSendersNextTsn() != 0 && storedresparam->getResult() == PERFORMED) {
2077  if (!(storedresparam->getSendersNextTsn() + localDiffTsn == liveresparam->getSendersNextTsn()))
2078  return false;
2080  if (!(storedresparam->getReceiversNextTsn() == liveresparam->getReceiversNextTsn()))
2081  return false;
2082  }
2083  break;
2084  }
2086  found = false;
2087  SCTPSSNTSNResetRequestParameter *storedinparam = check_and_cast<SCTPSSNTSNResetRequestParameter *>(storedParameter);
2088  for (unsigned int j = 0; j < liveReconfigChunk->getParametersArraySize(); j++) {
2089  liveParameter = check_and_cast<SCTPParameter *>(liveReconfigChunk->getParameters(j));
2090  if (liveParameter->getParameterType() != SSN_TSN_RESET_REQUEST_PARAMETER)
2091  continue;
2092  else {
2093  found = true;
2094  break;
2095  }
2096  }
2097  if (!found)
2098  return false;
2099  SCTPSSNTSNResetRequestParameter *liveinparam = check_and_cast<SCTPSSNTSNResetRequestParameter *>(liveParameter);
2100  if (seqNumMap[storedinparam->getSrReqSn()] == 0) {
2101  seqNumMap[storedinparam->getSrReqSn()] = liveinparam->getSrReqSn();
2102  } else if (!(seqNumMap[storedinparam->getSrReqSn()] == liveinparam->getSrReqSn())) {
2103  return false;
2104  }
2105  break;
2106  }
2108  found = false;
2109  SCTPAddStreamsRequestParameter *storedaddparam = check_and_cast<SCTPAddStreamsRequestParameter *>(storedParameter);
2110  for (unsigned int j = 0; j < liveReconfigChunk->getParametersArraySize(); j++) {
2111  liveParameter = check_and_cast<SCTPParameter *>(liveReconfigChunk->getParameters(j));
2112  if (liveParameter->getParameterType() != ADD_INCOMING_STREAMS_REQUEST_PARAMETER)
2113  continue;
2114  else {
2115  found = true;
2116  break;
2117  }
2118  }
2119  if (!found)
2120  return false;
2121  SCTPAddStreamsRequestParameter *liveaddparam = check_and_cast<SCTPAddStreamsRequestParameter *>(liveParameter);
2122  if (seqNumMap[storedaddparam->getSrReqSn()] == 0) {
2123  seqNumMap[storedaddparam->getSrReqSn()] = liveaddparam->getSrReqSn();
2124  } else if (!(seqNumMap[storedaddparam->getSrReqSn()] == liveaddparam->getSrReqSn())) {
2125  return false;
2126  }
2127  if (!(storedaddparam->getNumberOfStreams() == liveaddparam->getNumberOfStreams()))
2128  return false;
2129  break;
2130  }
2132  found = false;
2133  SCTPAddStreamsRequestParameter *storedaddparam = check_and_cast<SCTPAddStreamsRequestParameter *>(storedParameter);
2134  for (unsigned int j = 0; j < liveReconfigChunk->getParametersArraySize(); j++) {
2135  liveParameter = check_and_cast<SCTPParameter *>(liveReconfigChunk->getParameters(j));
2136  if (liveParameter->getParameterType() != ADD_OUTGOING_STREAMS_REQUEST_PARAMETER)
2137  continue;
2138  else {
2139  found = true;
2140  break;
2141  }
2142  }
2143  if (!found)
2144  return false;
2145  SCTPAddStreamsRequestParameter *liveaddparam = check_and_cast<SCTPAddStreamsRequestParameter *>(liveParameter);
2146  if (seqNumMap[storedaddparam->getSrReqSn()] == 0) {
2147  seqNumMap[storedaddparam->getSrReqSn()] = liveaddparam->getSrReqSn();
2148  } else if (!(seqNumMap[storedaddparam->getSrReqSn()] == liveaddparam->getSrReqSn())) {
2149  return false;
2150  }
2151  if (!(storedaddparam->getNumberOfStreams() == liveaddparam->getNumberOfStreams()))
2152  return false;
2153  break;
2154  }
2155  default: printf("Reconfig Parameter %d not implemented\n", storedParameter->getParameterType());
2156  }
2157  }
2158  return true;
2159 }
virtual uint16_t getParameterType() const
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:286 by nedtool.
Definition: SCTPMessage_m.h:1567
virtual uint16_t getNumberOfStreams() const
#define FLAG_RECONFIG_LAST_TSN_NOCHECK
Definition: PacketDrillUtils.h:134
virtual uint32_t getSrReqSn() const
virtual uint16_t getStreamNumbers(unsigned int k) const
Definition: SCTPAssociation.h:159
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:281 by nedtool.
Definition: SCTPMessage_m.h:1526
virtual uint32_t getReceiversNextTsn() const
Definition: SCTPAssociation.h:156
virtual uint32 getParametersArraySize() const override
Definition: SCTPMessage.cc:249
virtual cPacketPtr & getParameters(uint32 k) override
Returns the kth parameter in this SCTP Reset Chunk.
Definition: SCTPMessage.cc:254
virtual uint32_t getSendersNextTsn() const
#define FLAG_RECONFIG_RESULT_NOCHECK
Definition: PacketDrillUtils.h:129
Definition: SCTPAssociation.h:157
std::map< uint32, uint32 > seqNumMap
Definition: PacketDrillApp.h:123
virtual unsigned int getStreamNumbersArraySize() const
uint32_t uint32
Definition: Compat.h:30
#define FLAG_RECONFIG_RECEIVER_NEXT_TSN_NOCHECK
Definition: PacketDrillUtils.h:131
Definition: SCTPAssociation.h:158
virtual uint32_t getFlags() const
uint16_t uint16
Definition: Compat.h:32
virtual uint16_t getStreamNumbers(unsigned int k) const
#define FLAG_RECONFIG_REQ_SN_NOCHECK
Definition: PacketDrillUtils.h:132
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:244 by nedtool.
Definition: SCTPMessage_m.h:1240
Definition: SCTPAssociation.h:144
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:294 by nedtool.
Definition: SCTPMessage_m.h:1616
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:266 by nedtool.
Definition: SCTPMessage_m.h:1407
#define FLAG_RECONFIG_SENDER_NEXT_TSN_NOCHECK
Definition: PacketDrillUtils.h:130
virtual unsigned int getStreamNumbersArraySize() const
uint32 localDiffTsn
Definition: PacketDrillApp.h:114
bool inet::PacketDrillApp::compareSackPacket ( SCTPSackChunk storedSackChunk,
SCTPSackChunk liveSackChunk 
)
private
2162 {
2163  uint32 flags = storedSackChunk->getFlags();
2164  if (!(flags & FLAG_SACK_CHUNK_CUM_TSN_NOCHECK))
2165  if (!(storedSackChunk->getCumTsnAck() == liveSackChunk->getCumTsnAck()))
2166  return false;
2167 
2168  peerCumTsn = liveSackChunk->getCumTsnAck();
2169  if (!(flags & FLAG_SACK_CHUNK_A_RWND_NOCHECK))
2170  if (!(storedSackChunk->getA_rwnd() == liveSackChunk->getA_rwnd()))
2171  return false;
2172 
2173  if (!(flags & FLAG_SACK_CHUNK_GAP_BLOCKS_NOCHECK))
2174  if (!(storedSackChunk->getNumGaps() == liveSackChunk->getNumGaps()))
2175  return false;
2176 
2177  if (storedSackChunk->getNumGaps() > 0) {
2178  for (int i = 0; i < storedSackChunk->getNumGaps(); i++)
2179  {
2180  if (!(storedSackChunk->getGapStart(i) == (liveSackChunk->getGapStart(i) - peerCumTsn))
2181  || !(storedSackChunk->getGapStop(i) == (liveSackChunk->getGapStop(i) - peerCumTsn))) {
2182  return false;
2183  }
2184  }
2185  }
2186 
2187  if (!(flags & FLAG_SACK_CHUNK_DUP_TSNS_NOCHECK))
2188  if (!(storedSackChunk->getNumDupTsns() == liveSackChunk->getNumDupTsns()))
2189  return false;
2190 
2191  if (storedSackChunk->getNumDupTsns() > 0) {
2192  for (int i = 0; i < storedSackChunk->getNumDupTsns(); i++) {
2193  if (!(storedSackChunk->getDupTsns(i) == liveSackChunk->getDupTsns(i))) {
2194  return false;
2195  }
2196  }
2197  }
2198 
2199  return true;
2200 }
virtual uint32_t getCumTsnAck() const
virtual uint16_t getNumGaps() const
#define FLAG_SACK_CHUNK_A_RWND_NOCHECK
Definition: PacketDrillUtils.h:125
#define FLAG_SACK_CHUNK_DUP_TSNS_NOCHECK
Definition: PacketDrillUtils.h:127
virtual uint16_t getNumDupTsns() const
#define FLAG_SACK_CHUNK_CUM_TSN_NOCHECK
Definition: PacketDrillUtils.h:124
uint32 peerCumTsn
Definition: PacketDrillApp.h:115
virtual uint32_t getA_rwnd() const
virtual uint32_t getGapStop(unsigned int k) const
uint32_t uint32
Definition: Compat.h:30
virtual uint32_t getFlags() const
virtual uint32_t getDupTsns(unsigned int k) const
#define FLAG_SACK_CHUNK_GAP_BLOCKS_NOCHECK
Definition: PacketDrillUtils.h:126
virtual uint32_t getGapStart(unsigned int k) const
bool inet::PacketDrillApp::compareSctpPacket ( SCTPMessage storedSctp,
SCTPMessage liveSctp 
)
private
1710 {
1711  if (!(storedSctp->getSrcPort() == liveSctp->getSrcPort())) {
1712  return false;
1713  }
1714  if (!(storedSctp->getDestPort() == liveSctp->getDestPort())) {
1715  return false;
1716  }
1717  if (!(storedSctp->getChunksArraySize() == liveSctp->getChunksArraySize())) {
1718  return false;
1719  }
1720 
1721  const uint32 numberOfChunks = storedSctp->getChunksArraySize();
1722  for (uint32 i = 0; i < numberOfChunks; i++) {
1723  SCTPChunk* storedHeader = (SCTPChunk*) (storedSctp->removeChunk());
1724  SCTPChunk* liveHeader = (SCTPChunk*) (liveSctp->removeChunk());
1725  if (!(storedHeader->getChunkType() == liveHeader->getChunkType())) {
1726  return false;
1727  }
1728  const uint8 type = storedHeader->getChunkType();
1729 
1730  if ((type != INIT && type != INIT_ACK) && type != ABORT && (liveSctp->getTag() != localVTag)) {
1731  EV_DETAIL << " VTag " << liveSctp->getTag() << " incorrect. Should be " << localVTag << " peerVTag="
1732  << peerVTag << endl;
1733  return false;
1734  }
1735 
1736  switch (type) {
1737  case DATA: {
1738  SCTPDataChunk* storedDataChunk = check_and_cast<SCTPDataChunk*>(storedHeader);
1739  SCTPDataChunk* liveDataChunk = check_and_cast<SCTPDataChunk*>(liveHeader);
1740  if (!(compareDataPacket(storedDataChunk, liveDataChunk))) {
1741  delete storedDataChunk;
1742  delete liveDataChunk;
1743  EV_DETAIL << "DATA chunks are not the same" << endl;
1744  return false;
1745  }
1746  delete storedDataChunk;
1747  delete liveDataChunk;
1748  break;
1749  }
1750  case INIT: {
1751  SCTPInitChunk* storedInitChunk = check_and_cast<SCTPInitChunk*>(storedHeader);
1752  SCTPInitChunk* liveInitChunk = check_and_cast<SCTPInitChunk*>(liveHeader);
1753  if (!(compareInitPacket(storedInitChunk, liveInitChunk))) {
1754  delete storedInitChunk;
1755  delete liveInitChunk;
1756  EV_DETAIL << "INIT chunks are not the same" << endl;
1757  return false;
1758  }
1759  delete storedInitChunk;
1760  delete liveInitChunk;
1761  break;
1762  }
1763  case INIT_ACK: {
1764  SCTPInitAckChunk* storedInitAckChunk = check_and_cast<SCTPInitAckChunk*>(storedHeader);
1765  SCTPInitAckChunk* liveInitAckChunk = check_and_cast<SCTPInitAckChunk*>(liveHeader);
1766  if (!(compareInitAckPacket(storedInitAckChunk, liveInitAckChunk))) {
1767  delete storedInitAckChunk;
1768  delete liveInitAckChunk;
1769  EV_DETAIL << "INIT-ACK chunks are not the same" << endl;
1770  return false;
1771  }
1772  delete storedInitAckChunk;
1773  delete liveInitAckChunk;
1774  break;
1775  }
1776  case SACK: {
1777  SCTPSackChunk* storedSackChunk = check_and_cast<SCTPSackChunk*>(storedHeader);
1778  SCTPSackChunk* liveSackChunk = check_and_cast<SCTPSackChunk*>(liveHeader);
1779  if (!(compareSackPacket(storedSackChunk, liveSackChunk))) {
1780  delete storedSackChunk;
1781  delete liveSackChunk;
1782  EV_DETAIL << "SACK chunks are not the same" << endl;
1783  return false;
1784  }
1785  delete storedSackChunk;
1786  delete liveSackChunk;
1787  break;
1788  }
1789  case COOKIE_ECHO: {
1790  SCTPCookieEchoChunk* storedCookieEchoChunk = check_and_cast<SCTPCookieEchoChunk*>(storedHeader);
1791  if (!(storedCookieEchoChunk->getFlags() & FLAG_CHUNK_VALUE_NOCHECK))
1792  printf("COOKIE_ECHO chunks should be compared\n");
1793  else
1794  printf("Do not check cookie echo chunks\n");
1795  delete storedCookieEchoChunk;
1796  if (numberOfChunks == 1)
1797  delete liveHeader;
1798  break;
1799  }
1800  case SHUTDOWN: {
1801  SCTPShutdownChunk* storedShutdownChunk = check_and_cast<SCTPShutdownChunk*>(storedHeader);
1802  SCTPShutdownChunk* liveShutdownChunk = check_and_cast<SCTPShutdownChunk*>(liveHeader);
1803  if (!(storedShutdownChunk->getFlags() & FLAG_SHUTDOWN_CHUNK_CUM_TSN_NOCHECK)) {
1804  if (!(storedShutdownChunk->getCumTsnAck() == liveShutdownChunk->getCumTsnAck())) {
1805  delete storedShutdownChunk;
1806  delete liveShutdownChunk;
1807  EV_DETAIL << "SHUTDOWN chunks are not the same" << endl;
1808  return false;
1809  }
1810  }
1811  delete storedShutdownChunk;
1812  delete liveShutdownChunk;
1813  break;
1814  }
1815  case SHUTDOWN_COMPLETE: {
1816  SCTPShutdownCompleteChunk* storedShutdownCompleteChunk = check_and_cast<SCTPShutdownCompleteChunk*>(
1817  storedHeader);
1818  SCTPShutdownCompleteChunk* liveShutdownCompleteChunk = check_and_cast<SCTPShutdownCompleteChunk*>(
1819  liveHeader);
1820  if (!(storedShutdownCompleteChunk->getFlags() & FLAG_CHUNK_FLAGS_NOCHECK))
1821  if (!(storedShutdownCompleteChunk->getTBit() == liveShutdownCompleteChunk->getTBit())) {
1822  delete storedShutdownCompleteChunk;
1823  delete liveShutdownCompleteChunk;
1824  EV_DETAIL << "SHUTDOWN-COMPLETE chunks are not the same" << endl;
1825  return false;
1826  }
1827  delete storedShutdownCompleteChunk;
1828  delete liveShutdownCompleteChunk;
1829  break;
1830  }
1831  case ABORT: {
1832  SCTPAbortChunk* storedAbortChunk = check_and_cast<SCTPAbortChunk*>(storedHeader);
1833  SCTPAbortChunk* liveAbortChunk = check_and_cast<SCTPAbortChunk*>(liveHeader);
1834  if (!(storedAbortChunk->getFlags() & FLAG_CHUNK_FLAGS_NOCHECK))
1835  if (!(storedAbortChunk->getT_Bit() == liveAbortChunk->getT_Bit())) {
1836  delete storedAbortChunk;
1837  delete liveAbortChunk;
1838  EV_DETAIL << "ABORT chunks are not the same" << endl;
1839  return false;
1840  }
1841  delete storedAbortChunk;
1842  delete liveAbortChunk;
1843  break;
1844  }
1845  case ERRORTYPE: {
1846  SCTPErrorChunk* storedErrorChunk = check_and_cast<SCTPErrorChunk*>(storedHeader);
1847  SCTPErrorChunk* liveErrorChunk = check_and_cast<SCTPErrorChunk*>(liveHeader);
1848  if (!(storedErrorChunk->getParametersArraySize() == liveErrorChunk->getParametersArraySize())) {
1849  delete storedErrorChunk;
1850  delete liveErrorChunk;
1851  return false;
1852  }
1853  if (storedErrorChunk->getParametersArraySize() > 0) {
1854  // Only Cause implemented so far.
1855  SCTPSimpleErrorCauseParameter *storedcause = check_and_cast<SCTPSimpleErrorCauseParameter *>(storedErrorChunk->getParameters(0));
1856  SCTPSimpleErrorCauseParameter *livecause = check_and_cast<SCTPSimpleErrorCauseParameter *>(liveErrorChunk->getParameters(0));
1857  if (!(storedcause->getValue() == livecause->getValue())) {
1858  delete storedcause;
1859  delete livecause;
1860  delete storedErrorChunk;
1861  delete liveErrorChunk;
1862  return false;
1863  }
1864  }
1865  delete storedErrorChunk;
1866  delete liveErrorChunk;
1867  break;
1868  }
1869  case HEARTBEAT: {
1870  SCTPHeartbeatChunk* heartbeatChunk = check_and_cast<SCTPHeartbeatChunk*>(liveHeader);
1871  peerHeartbeatTime = heartbeatChunk->getTimeField();
1872  delete heartbeatChunk;
1873  break;
1874  }
1875  case COOKIE_ACK:
1876  case SHUTDOWN_ACK:
1877  case HEARTBEAT_ACK:
1878  delete storedHeader;
1879  delete liveHeader;
1880  break;
1881  case RE_CONFIG: {
1882  SCTPStreamResetChunk* liveReconfigChunk = check_and_cast<SCTPStreamResetChunk*>(liveHeader);
1883  liveReconfigChunk->setName("livereconfig");
1884  SCTPStreamResetChunk* storedReconfigChunk = check_and_cast<SCTPStreamResetChunk*>(storedHeader);
1885  if (!(compareReconfigPacket(storedReconfigChunk, liveReconfigChunk))) {
1886  delete storedReconfigChunk;
1887  delete liveReconfigChunk;
1888  EV_DETAIL << "RECONFIG chunks are not the same" << endl;
1889  return false;
1890  }
1891  delete storedReconfigChunk;
1892  delete liveReconfigChunk;
1893  break;
1894  }
1895  default:
1896  printf("type %d not implemented\n", type);
1897  }
1898  }
1899  return true;
1900 }
uint8_t uint8
Definition: Compat.h:34
#define FLAG_CHUNK_FLAGS_NOCHECK
Definition: PacketDrillUtils.h:97
virtual uint16_t getDestPort() const
virtual cPacket * removeChunk()
Removes and returns the first message object in this SCTP packet.
Definition: SCTPMessage.cc:105
uint32 localVTag
Definition: PacketDrillApp.h:121
Definition: SCTPAssociation.h:111
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:177 by nedtool.
Definition: SCTPMessage_m.h:824
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:208 by nedtool.
Definition: SCTPMessage_m.h:960
virtual cPacketPtr & getParameters(uint32 k) override
Returns the kth parameter in this SCTP Reset Chunk.
Definition: SCTPMessage.cc:178
Definition: SCTPAssociation.h:118
Definition: SCTPAssociation.h:119
Definition: SCTPAssociation.h:121
virtual uint32 getParametersArraySize() const override
Definition: SCTPMessage.cc:173
#define FLAG_CHUNK_VALUE_NOCHECK
Definition: PacketDrillUtils.h:99
bool compareInitAckPacket(SCTPInitAckChunk *storedInitAckChunk, SCTPInitAckChunk *liveInitAckChunk)
Definition: PacketDrillApp.cc:1958
Definition: SCTPAssociation.h:122
virtual uint16_t getSrcPort() const
simtime_t peerHeartbeatTime
Definition: PacketDrillApp.h:124
Definition: SCTPAssociation.h:115
Definition: SCTPAssociation.h:116
bool compareInitPacket(SCTPInitChunk *storedInitChunk, SCTPInitChunk *liveInitChunk)
Definition: PacketDrillApp.cc:1931
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:151 by nedtool.
Definition: SCTPMessage_m.h:687
virtual ::omnetpp::simtime_t getTimeField() const
virtual uint32_t getCumTsnAck() const
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:202 by nedtool.
Definition: SCTPMessage_m.h:920
Definition: SCTPMessage.h:83
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:58 by nedtool.
Definition: SCTPMessage_m.h:197
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:362 by nedtool.
Definition: SCTPMessage_m.h:2120
bool compareDataPacket(SCTPDataChunk *storedDataChunk, SCTPDataChunk *liveDataChunk)
Definition: PacketDrillApp.cc:1902
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:222 by nedtool.
Definition: SCTPMessage_m.h:1058
Definition: SCTPAssociation.h:128
bool compareReconfigPacket(SCTPStreamResetChunk *storedReconfigChunk, SCTPStreamResetChunk *liveReconfigChunk)
Definition: PacketDrillApp.cc:1983
Definition: SCTPAssociation.h:112
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:50 by nedtool.
Definition: SCTPMessage_m.h:137
uint32_t uint32
Definition: Compat.h:30
Definition: SCTPAssociation.h:114
virtual bool getT_Bit() const
virtual uint32 getChunksArraySize() const override
Returns the number of chunks in this SCTP packet.
Definition: SCTPMessage.cc:73
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:231 by nedtool.
Definition: SCTPMessage_m.h:1130
Definition: SCTPMessage.h:120
Definition: SCTPAssociation.h:120
virtual uint32_t getFlags() const
Definition: SCTPAssociation.h:117
bool compareSackPacket(SCTPSackChunk *storedSackChunk, SCTPSackChunk *liveSackChunk)
Definition: PacketDrillApp.cc:2161
uint32 peerVTag
Definition: PacketDrillApp.h:122
virtual uint16_t getValue() const
virtual uint32_t getTag() const
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:82 by nedtool.
Definition: SCTPMessage_m.h:317
Definition: SCTPAssociation.h:113
virtual uint8_t getChunkType() const
#define FLAG_SHUTDOWN_CHUNK_CUM_TSN_NOCHECK
Definition: PacketDrillUtils.h:116
Definition: SCTPAssociation.h:123
bool inet::PacketDrillApp::compareTcpPacket ( tcp::TCPSegment storedTcp,
tcp::TCPSegment liveTcp 
)
private
1620 {
1621  if (!(storedTcp->getSrcPort() == liveTcp->getSrcPort())) {
1622  return false;
1623  }
1624  if (!(storedTcp->getDestPort() == liveTcp->getDestPort())) {
1625  return false;
1626  }
1627  if (!(storedTcp->getSequenceNo() + relSequenceOut == liveTcp->getSequenceNo())) {
1628  return false;
1629  }
1630  if (!(storedTcp->getAckNo() == liveTcp->getAckNo())) {
1631  return false;
1632  }
1633  if (!(storedTcp->getUrgBit() == liveTcp->getUrgBit()) || !(storedTcp->getAckBit() == liveTcp->getAckBit()) ||
1634  !(storedTcp->getPshBit() == liveTcp->getPshBit()) || !(storedTcp->getRstBit() == liveTcp->getRstBit()) ||
1635  !(storedTcp->getSynBit() == liveTcp->getSynBit()) || !(storedTcp->getFinBit() == liveTcp->getFinBit())) {
1636  return false;
1637  }
1638  if (!(storedTcp->getUrgentPointer() == liveTcp->getUrgentPointer())) {
1639  return false;
1640  }
1641 
1642  if (storedTcp->getHeaderOptionArraySize() > 0 || liveTcp->getHeaderOptionArraySize()) {
1643  EV_DETAIL << "Options present";
1644  if (storedTcp->getHeaderOptionArraySize() == 0) {
1645  return true;
1646  }
1647  if (storedTcp->getHeaderOptionArraySize() != liveTcp->getHeaderOptionArraySize()) {
1648  TCPOption *liveOption;
1649  for (unsigned int i = 0; i < liveTcp->getHeaderOptionArraySize(); i++) {
1650  liveOption = liveTcp->getHeaderOption(i);
1651  }
1652  return false;
1653  } else {
1654  TCPOption *storedOption, *liveOption;
1655  for (unsigned int i = 0; i < storedTcp->getHeaderOptionArraySize(); i++) {
1656  storedOption = storedTcp->getHeaderOption(i);
1657  liveOption = liveTcp->getHeaderOption(i);
1658  if (storedOption->getKind() == liveOption->getKind()) {
1659  switch (storedOption->getKind()) {
1660  case TCPOPT_EOL:
1661  case TCPOPT_NOP:
1662  if (!(storedOption->getLength() == liveOption->getLength())) {
1663  return false;
1664  }
1665  break;
1666  case TCPOPT_SACK_PERMITTED:
1667  if (!(storedOption->getLength() == liveOption->getLength() &&
1668  storedOption->getLength() == 2)) {
1669  return false;
1670  }
1671  break;
1672  case TCPOPT_WINDOW:
1673  if (!(storedOption->getLength() == liveOption->getLength() &&
1674  storedOption->getLength() == 3 &&
1675  check_and_cast<TCPOptionWindowScale *>(storedOption)->getWindowScale()
1676  == check_and_cast<TCPOptionWindowScale *>(liveOption)->getWindowScale())) {
1677  return false;
1678  }
1679  break;
1680  case TCPOPT_SACK:
1681  if (!(storedOption->getLength() == liveOption->getLength() &&
1682  storedOption->getLength() > 2 && (storedOption->getLength() % 8) == 2 &&
1683  check_and_cast<TCPOptionSack *>(storedOption)->getSackItemArraySize()
1684  == check_and_cast<TCPOptionSack *>(liveOption)->getSackItemArraySize())) {
1685  return false;
1686  }
1687  break;
1688  case TCPOPT_TIMESTAMP:
1689  if (!(storedOption->getLength() == liveOption->getLength() &&
1690  storedOption->getLength() == 10 &&
1691  check_and_cast<TCPOptionTimestamp *>(storedOption)->getSenderTimestamp()
1692  == check_and_cast<TCPOptionTimestamp *>(liveOption)->getSenderTimestamp())) {
1693  return false;
1694  }
1695  break;
1696  default: EV_INFO << "Option not supported";
1697  }
1698  } else {
1699  EV_INFO << "Wrong sequence or option kind not present";
1700  return false;
1701  }
1702  }
1703  }
1704 
1705  }
1706  return true;
1707 }
uint32 relSequenceOut
Definition: PacketDrillApp.h:105
virtual unsigned short getUrgentPointer() const
#define TCPOPT_NOP
Definition: PacketDrillUtils.h:58
Class generated from inet/transportlayer/tcp_common/TCPSegment.msg:154 by nedtool.
Definition: TCPSegment_m.h:389
virtual bool getPshBit() const
Class generated from inet/transportlayer/tcp_common/TCPSegment.msg:167 by nedtool.
Definition: TCPSegment_m.h:465
#define TCPOPT_EOL
Definition: PacketDrillUtils.h:57
virtual unsigned short getSrcPort() const
virtual bool getUrgBit() const
#define TCPOPT_SACK_PERMITTED
Definition: PacketDrillUtils.h:63
virtual bool getAckBit() const
virtual unsigned int getAckNo() const
virtual bool getSynBit() const
virtual unsigned short getLength() const
virtual TCPOptionPtr & getHeaderOption(unsigned int k) override
Returns the kth TCP options in this TCP segment.
Definition: TCPSegment.cc:250
virtual unsigned int getSequenceNo() const
virtual unsigned int getHeaderOptionArraySize() const override
Returns the number of TCP options in this TCP segment.
Definition: TCPSegment.cc:245
virtual bool getFinBit() const
virtual bool getRstBit() const
Class generated from inet/transportlayer/tcp_common/TCPSegment.msg:129 by nedtool.
Definition: TCPSegment_m.h:234
#define TCPOPT_WINDOW
Definition: PacketDrillUtils.h:61
#define TCPOPT_SACK
Definition: PacketDrillUtils.h:65
Class generated from inet/transportlayer/tcp_common/TCPSegment.msg:174 by nedtool.
Definition: TCPSegment_m.h:510
virtual unsigned short getDestPort() const
#define TCPOPT_TIMESTAMP
Definition: PacketDrillUtils.h:66
virtual unsigned short getKind() const
bool inet::PacketDrillApp::compareUdpPacket ( UDPPacket storedUdp,
UDPPacket liveUdp 
)
private
1614 {
1615  return (storedUdp->getSourcePort() == liveUdp->getSourcePort()) &&
1616  (storedUdp->getDestinationPort() == liveUdp->getDestinationPort());
1617 }
virtual unsigned int getSourcePort() const override
Definition: UDPPacket.h:44
virtual unsigned int getDestinationPort() const override
Definition: UDPPacket.h:46
bool inet::PacketDrillApp::findSeqNumMap ( uint32  num)
604 {
605  std::map<uint32, uint32>::iterator it;
606 
607  it = seqNumMap.find(num);
608  if (it != seqNumMap.end())
609  return true;
610  return false;
611 }
std::map< uint32, uint32 > seqNumMap
Definition: PacketDrillApp.h:123
void inet::PacketDrillApp::finish ( )
overrideprotectedvirtual

Reimplemented from inet::TCPSessionApp.

1485 {
1486  EV_INFO << "PacketDrillApp finished\n";
1487 }
const uint32 inet::PacketDrillApp::getIdInbound ( )
inline
54 { return idInbound;};
uint32 idInbound
Definition: PacketDrillApp.h:119
const uint32 inet::PacketDrillApp::getIdOutbound ( )
inline
55 { return idOutbound;};
uint32 idOutbound
Definition: PacketDrillApp.h:120
uint32 inet::PacketDrillApp::getInitPeerTsn ( )
inline
64 { return initPeerTsn; };
uint32 initPeerTsn
Definition: PacketDrillApp.h:112
const L3Address inet::PacketDrillApp::getLocalAddress ( )
inline

Referenced by PacketDrill::buildSCTPPacket(), PacketDrill::buildTCPPacket(), and PacketDrill::buildUDPPacket().

59 { return localAddress; };
L3Address localAddress
Definition: PacketDrillApp.h:81
const int inet::PacketDrillApp::getLocalPort ( )
inline

Referenced by PacketDrill::buildSCTPPacket(), PacketDrill::buildTCPPacket(), and PacketDrill::buildUDPPacket().

52 { return localPort;};
int localPort
Definition: PacketDrillApp.h:83
uint32 inet::PacketDrillApp::getLocalVTag ( )
inline

Referenced by PacketDrill::buildSCTPPacket().

62 { return localVTag; };
uint32 localVTag
Definition: PacketDrillApp.h:121
uint32 inet::PacketDrillApp::getPeerCumTsn ( )
inline
63 { return peerCumTsn; };
uint32 peerCumTsn
Definition: PacketDrillApp.h:115
simtime_t inet::PacketDrillApp::getPeerHeartbeatTime ( )
inline
65 { return peerHeartbeatTime; };
simtime_t peerHeartbeatTime
Definition: PacketDrillApp.h:124
uint32 inet::PacketDrillApp::getPeerTS ( )
inline
56 { return peerTS; };
uint32 peerTS
Definition: PacketDrillApp.h:106
uint32 inet::PacketDrillApp::getPeerVTag ( )
inline

Referenced by PacketDrill::buildSCTPPacket().

61 { return peerVTag; };
uint32 peerVTag
Definition: PacketDrillApp.h:122
const L3Address inet::PacketDrillApp::getRemoteAddress ( )
inline

Referenced by PacketDrill::buildSCTPPacket(), PacketDrill::buildTCPPacket(), and PacketDrill::buildUDPPacket().

60 { return remoteAddress; };
L3Address remoteAddress
Definition: PacketDrillApp.h:82
const int inet::PacketDrillApp::getRemotePort ( )
inline

Referenced by PacketDrill::buildSCTPPacket(), PacketDrill::buildTCPPacket(), and PacketDrill::buildUDPPacket().

53 { return remotePort;};
int remotePort
Definition: PacketDrillApp.h:84
uint32 inet::PacketDrillApp::getSeqNumMap ( uint32  ownNum)
inline
67 { return seqNumMap[ownNum]; };
std::map< uint32, uint32 > seqNumMap
Definition: PacketDrillApp.h:123
void inet::PacketDrillApp::handleMessage ( cMessage *  msg)
overrideprotectedvirtual

Reimplemented from inet::TCPAppBase.

131 {
132  if (msg->isSelfMessage()) {
133  handleTimer(msg);
134  } else {
135  if (msg->getArrivalGate()->isName("tunIn")) {
136  if (outboundPackets->getLength() == 0) {
137  cEvent *nextMsg = getSimulation()->getScheduler()->guessNextEvent();
138  if (nextMsg) {
139  if ((simTime() + par("latency")) < nextMsg->getArrivalTime()) {
140  delete (PacketDrillInfo *)msg->getContextPointer();
141  delete msg;
142  throw cTerminationException("Packetdrill error: Packet arrived at the wrong time");
143  } else {
144  PacketDrillInfo *info = new PacketDrillInfo();
145  info->setLiveTime(getSimulation()->getSimTime());
146  msg->setContextPointer(info);
147  receivedPackets->insert(PK(msg));
148  }
149  }
150  } else {
151  IPv4Datagram *datagram = check_and_cast<IPv4Datagram *>(outboundPackets->pop());
152  IPv4Datagram *live = check_and_cast<IPv4Datagram*>(msg);
153  PacketDrillInfo *info = (PacketDrillInfo *)datagram->getContextPointer();
154  if (verifyTime((enum eventTime_t) info->getTimeType(), info->getScriptTime(),
155  info->getScriptTimeEnd(), info->getOffset(), getSimulation()->getSimTime(), "outbound packet")
156  == STATUS_ERR) {
157  delete info;
158  delete msg;
159  throw cTerminationException("Packetdrill error: Packet arrived at the wrong time");
160  }
161  if (!compareDatagram(datagram, live)) {
162  delete (PacketDrillInfo *)msg->getContextPointer();
163  delete msg;
164  throw cTerminationException("Packetdrill error: Datagrams are not the same");
165  }
166  delete info;
167  if (!eventTimer->isScheduled() && eventCounter < numEvents - 1) {
168  eventCounter++;
169  scheduleEvent();
170  }
171  delete (PacketDrillInfo *)msg->getContextPointer();
172  delete msg;
173  delete datagram;
174  }
175  } else if (msg->getArrivalGate()->isName("udpIn")) {
177  if (verifyTime((enum eventTime_t) event->getTimeType(), event->getEventTime(), event->getEventTimeEnd(),
178  event->getEventOffset(), getSimulation()->getSimTime(), "inbound packet") == STATUS_ERR) {
179  delete msg;
180  throw cTerminationException("Packetdrill error: Packet arrived at the wrong time");
181  }
182  if (recvFromSet) {
183  recvFromSet = false;
184  msgArrived = false;
185  if (!(PK(msg)->getByteLength() == expectedMessageSize)) {
186  delete msg;
187  throw cTerminationException("Packetdrill error: Received data has unexpected size");
188  }
189  if (!eventTimer->isScheduled() && eventCounter < numEvents - 1) {
190  eventCounter++;
191  scheduleEvent();
192  }
193  delete msg;
194  } else {
195  PacketDrillInfo* info = new PacketDrillInfo();
196  info->setLiveTime(getSimulation()->getSimTime());
197  msg->setContextPointer(info);
198  receivedPackets->insert(PK(msg));
199  msgArrived = true;
200  if (!eventTimer->isScheduled() && eventCounter < numEvents - 1) {
201  eventCounter++;
202  scheduleEvent();
203  }
204  }
205  } else if (msg->getArrivalGate()->isName("tcpIn")) {
206  switch (msg->getKind()) {
207  case TCP_I_ESTABLISHED:
208  if (listenSet) {
209  if (acceptSet) {
211  tcpConnId = check_and_cast<TCPCommand *>(msg->getControlInfo())->getConnId();
212  listenSet = false;
213  acceptSet = false;
214  } else {
215  tcpConnId = check_and_cast<TCPCommand *>(msg->getControlInfo())->getConnId();
216  establishedPending = true;
217  }
218  } else {
220  tcpConnId = check_and_cast<TCPCommand *>(msg->getControlInfo())->getConnId();
221  }
222  delete msg;
223  break;
224  case TCP_I_CLOSED:
225  delete msg;
226  break;
228  if (recvFromSet)
229  {
230  cMessage *msg = new cMessage("data request");
231  msg->setKind(TCP_C_READ);
232  TCPCommand *cmd = new TCPCommand();
233  cmd->setConnId(tcpConnId);
234  msg->setControlInfo(cmd);
235  send(msg, "tcpOut");
236  recvFromSet = false;
237  // send a receive request to TCP
238  }
239  msgArrived = true;
240  delete msg;
241  break;
242  default: EV_INFO << "Message kind not supported (yet)";
243  }
244  } else if (msg->getArrivalGate()->isName("sctpIn")) {
245  switch (msg->getKind()) {
247  sctpSocket.setUserOptions((void*) (msg->getContextPointer()));
248  socketOptionsArrived = true;
249  if (!eventTimer->isScheduled() && eventCounter < numEvents - 1) {
250  eventCounter++;
251  scheduleEvent();
252  }
253  delete msg;
254  return;
255  }
256  case SCTP_I_ESTABLISHED: {
257  if (listenSet) {
258  if (acceptSet) {
260  sctpAssocId = check_and_cast<SCTPCommand *>(msg->getControlInfo())->getAssocId();
261  listenSet = false;
262  acceptSet = false;
263  } else {
264  sctpAssocId = check_and_cast<SCTPCommand *>(msg->getControlInfo())->getAssocId();
265  establishedPending = true;
266  }
267  } else {
269  SCTPConnectInfo *connectInfo = check_and_cast<SCTPConnectInfo *>(msg->removeControlInfo());
270  sctpAssocId = connectInfo->getAssocId();
273  delete connectInfo;
274  }
275  break;
276  }
278  if (recvFromSet) {
279  cPacket* cmsg = new cPacket("ReceiveRequest", SCTP_C_RECEIVE);
280  SCTPSendInfo *cmd = new SCTPSendInfo("Send2");
281  cmd->setAssocId(sctpAssocId);
282  cmd->setSid(0);
283  cmsg->setControlInfo(cmd);
284  send(cmsg, "sctpOut");
285  recvFromSet = false;
286  }
288  sctpSocket.abort();
289  abortSent = true;
290  }
291  if (!abortSent)
292  msgArrived = true;
293  break;
294  }
295  case SCTP_I_DATA: {
297  if (verifyTime((enum eventTime_t) event->getTimeType(), event->getEventTime(), event->getEventTimeEnd(),
298  event->getEventOffset(), getSimulation()->getSimTime(), "inbound packet") == STATUS_ERR)
299  {
300  delete msg;
301  throw cTerminationException("Packetdrill error: Packet arrived at the wrong time");
302  }
303  if (!(PK(msg)->getByteLength() == expectedMessageSize)) {
304  throw cTerminationException("Packetdrill error: Delivered message has wrong size");
305  }
306  msgArrived = false;
307  recvFromSet = false;
308  if (!eventTimer->isScheduled() && eventCounter < numEvents - 1) {
309  eventCounter++;
310  scheduleEvent();
311  }
312  break;
313  }
314  case SCTP_I_CLOSED:
315  case SCTP_I_ABORT:
318  case SCTP_I_PEER_CLOSED: {
319  break;
320  }
321  default: printf("Msg kind %d not implemented\n", msg->getKind());
322  }
323  delete msg;
324  return;
325  } else {
326  delete msg;
327  throw cRuntimeError("Unknown gate");
328  }
329  }
330 }
Definition: SCTPCommand.h:80
Definition: SCTPCommand.h:83
uint32 eventCounter
Definition: PacketDrillApp.h:117
Definition: SCTPSocket.h:87
Class generated from inet/applications/packetdrill/PacketDrillInfo.msg:20 by nedtool.
Definition: PacketDrillInfo_m.h:45
Definition: PacketDrillUtils.h:288
Definition: TCPCommand_m.h:102
Class generated from inet/transportlayer/contract/sctp/SCTPCommand.msg:132 by nedtool.
Definition: SCTPCommand_m.h:327
bool msgArrived
Definition: PacketDrillApp.h:92
void setState(enum State state)
Definition: TCPSocket.h:211
int tcpConnId
Definition: PacketDrillApp.h:86
bool listenSet
Definition: PacketDrillApp.h:94
Definition: SCTPCommand.h:67
cMessage * eventTimer
Definition: PacketDrillApp.h:125
Definition: TCPCommand_m.h:100
void setState(int state)
Definition: SCTPSocket.h:366
virtual void setLiveTime(::omnetpp::simtime_t liveTime)
Definition: TCPSocket.h:148
Class generated from inet/transportlayer/contract/sctp/SCTPCommand.msg:59 by nedtool.
Definition: SCTPCommand_m.h:91
Definition: TCPCommand_m.h:108
eventTime_t
Definition: PacketDrillUtils.h:234
bool abortSent
Definition: PacketDrillApp.h:97
Class generated from inet/transportlayer/contract/sctp/SCTPCommand.msg:172 by nedtool.
Definition: SCTPCommand_m.h:488
uint32 expectedMessageSize
Definition: PacketDrillApp.h:103
bool recvFromSet
Definition: PacketDrillApp.h:93
Definition: SCTPCommand.h:79
bool acceptSet
Definition: PacketDrillApp.h:95
void scheduleEvent()
Definition: PacketDrillApp.cc:352
virtual void setConnId(int connId)
Definition: SCTPCommand.h:63
void abort()
Aborts the association.
Definition: SCTPSocket.cc:439
uint32 numEvents
Definition: PacketDrillApp.h:118
Definition: SCTPCommand.h:37
Definition: PacketDrillUtils.h:482
void handleTimer(cMessage *msg) override
Definition: PacketDrillApp.cc:536
virtual int getAssocId() const
bool socketOptionsArrived
Definition: PacketDrillApp.h:98
Represents an IPv4 datagram.
Definition: IPv4Datagram.h:31
int getState()
Returns the socket state, one of NOT_BOUND, CLOSED, LISTENING, CONNECTING, CONNECTED, etc.
Definition: SCTPSocket.h:154
virtual int getOutboundStreams() const
Definition: SCTPCommand.h:65
cQueue * getEventList()
Definition: PacketDrillUtils.h:621
int sctpAssocId
Definition: PacketDrillApp.h:87
SCTPSocket sctpSocket
Definition: PacketDrillApp.h:90
cPacketQueue * receivedPackets
Definition: PacketDrillApp.h:99
Definition: TCPCommand_m.h:68
Class generated from inet/transportlayer/contract/tcp/TCPCommand.msg:91 by nedtool.
Definition: TCPCommand_m.h:150
TCPSocket tcpSocket
Definition: PacketDrillApp.h:89
Definition: SCTPCommand.h:66
int verifyTime(enum eventTime_t timeType, simtime_t script_usecs, simtime_t script_usecs_end, simtime_t offset, simtime_t liveTime, const char *description)
Definition: PacketDrillApp.cc:1504
Definition: SCTPCommand.h:64
cPacketQueue * outboundPackets
Definition: PacketDrillApp.h:100
virtual int getInboundStreams() const
Definition: SCTPCommand.h:72
#define PK(msg)
Definition: INETDefs.h:92
void setInboundStreams(int streams)
Definition: SCTPSocket.h:183
virtual void setAssocId(int assocId)
void setUserOptions(void *msg)
Definition: SCTPSocket.h:203
void setOutboundStreams(int streams)
Setter and getter methods for socket and API Parameters.
Definition: SCTPSocket.h:182
PacketDrillScript * script
Definition: PacketDrillApp.h:79
bool compareDatagram(IPv4Datagram *storedDatagram, IPv4Datagram *liveDatagram)
Definition: PacketDrillApp.cc:1541
bool establishedPending
Definition: PacketDrillApp.h:96
virtual void setSid(int sid)
Definition: SCTPSocket.h:87
virtual bool inet::PacketDrillApp::handleOperationStage ( LifecycleOperation operation,
int  stage,
IDoneCallback doneCallback 
)
inlineoverridevirtual

Reimplemented from inet::TCPSessionApp.

50  { Enter_Method_Silent(); throw cRuntimeError("Unsupported lifecycle operation '%s'", operation->getClassName()); return true; }
void inet::PacketDrillApp::handleTimer ( cMessage *  msg)
overrideprotectedvirtual

Reimplemented from inet::TCPSessionApp.

537 {
538  switch (msg->getKind()) {
539  case MSGKIND_START: {
540  simStartTime = getSimulation()->getSimTime();
542  if (script->parseScriptAndSetConfig(config, NULL)) {
543  delete msg;
544  throw cRuntimeError("Error parsing the script");
545  }
546  numEvents = script->getEventList()->getLength();
547  scheduleEvent();
548  delete msg;
549  break;
550  }
551 
552  case MSGKIND_EVENT: {
553  PacketDrillEvent *event = (PacketDrillEvent *)msg->getContextPointer();
554  runEvent(event);
555  if ((socketOptionsArrived && !recvFromSet && outboundPackets->getLength() == 0) &&
556  (!eventTimer->isScheduled() && eventCounter < numEvents - 1)) {
557  eventCounter++;
558  scheduleEvent();
559  }
560  if (eventCounter >= numEvents - 1 && outboundPackets->getLength() == 0) {
561  closeAllSockets();
562  }
563  break;
564  }
565 
566  default:
567  throw cRuntimeError("Unknown message kind");
568  }
569 }
uint32 eventCounter
Definition: PacketDrillApp.h:117
void closeAllSockets()
Definition: PacketDrillApp.cc:571
cMessage * eventTimer
Definition: PacketDrillApp.h:125
bool recvFromSet
Definition: PacketDrillApp.h:93
PacketDrillConfig * config
Definition: PacketDrillApp.h:80
void scheduleEvent()
Definition: PacketDrillApp.cc:352
int parseScriptAndSetConfig(PacketDrillConfig *config, const char *script_buffer)
Definition: PacketDrillUtils.cc:337
uint32 numEvents
Definition: PacketDrillApp.h:118
simtime_t simStartTime
Definition: PacketDrillApp.h:101
simtime_t simRelTime
Definition: PacketDrillApp.h:102
Definition: PacketDrillUtils.h:482
bool socketOptionsArrived
Definition: PacketDrillApp.h:98
#define MSGKIND_START
Definition: PacketDrillApp.cc:39
cQueue * getEventList()
Definition: PacketDrillUtils.h:621
cPacketQueue * outboundPackets
Definition: PacketDrillApp.h:100
void runEvent(PacketDrillEvent *event)
Definition: PacketDrillApp.cc:362
PacketDrillScript * script
Definition: PacketDrillApp.h:79
#define MSGKIND_EVENT
Definition: PacketDrillApp.cc:40
void inet::PacketDrillApp::increaseIdInbound ( )
inline
57 { idInbound++;};
uint32 idInbound
Definition: PacketDrillApp.h:119
void inet::PacketDrillApp::increaseIdOutbound ( )
inline
58 { idOutbound++;};
uint32 idOutbound
Definition: PacketDrillApp.h:120
void inet::PacketDrillApp::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::TCPSessionApp.

88 {
89  cSimpleModule::initialize(stage);
90 
91  if (stage == INITSTAGE_LOCAL) {
92  // parameters
93  msgArrived = false;
94  recvFromSet = false;
95  listenSet = false;
96  acceptSet = false;
97  establishedPending = false;
98  socketOptionsArrived = false;
99  abortSent = false;
100  receivedPackets = new cPacketQueue("receiveQueue");
101  outboundPackets = new cPacketQueue("outboundPackets");
103  eventCounter = 0;
104  numEvents = 0;
105  localVTag = 0;
106  eventTimer = new cMessage("event timer");
107  eventTimer->setKind(MSGKIND_EVENT);
108  simStartTime = simTime();
109  simRelTime = simTime();
110  } else if (stage == INITSTAGE_APPLICATION_LAYER) {
111  NodeStatus *nodeStatus = dynamic_cast<NodeStatus *>(findContainingNode(this)->getSubmodule("status"));
112  bool isOperational = (!nodeStatus) || nodeStatus->getState() == NodeStatus::UP;
113  if (!isOperational)
114  throw cRuntimeError("This module doesn't support starting in node DOWN state");
115  pd = new PacketDrill(this);
116  config = new PacketDrillConfig();
117  script = new PacketDrillScript((const char *)(par("scriptFile")));
118  localAddress = L3Address(par("localAddress"));
119  remoteAddress = L3Address(par("remoteAddress"));
120  localPort = par("localPort");
121  remotePort = par("remotePort");
122 
123  cMessage* timeMsg = new cMessage("PacketDrillAppTimer");
124  timeMsg->setKind(MSGKIND_START);
125  scheduleAt((simtime_t)par("startTime"), timeMsg);
126  }
127 }
uint32 localVTag
Definition: PacketDrillApp.h:121
uint32 eventCounter
Definition: PacketDrillApp.h:117
PacketDrill * pd
Definition: PacketDrillApp.h:91
bool msgArrived
Definition: PacketDrillApp.h:92
int localPort
Definition: PacketDrillApp.h:83
bool listenSet
Definition: PacketDrillApp.h:94
cMessage * eventTimer
Definition: PacketDrillApp.h:125
bool abortSent
Definition: PacketDrillApp.h:97
uint32 expectedMessageSize
Definition: PacketDrillApp.h:103
bool recvFromSet
Definition: PacketDrillApp.h:93
PacketDrillConfig * config
Definition: PacketDrillApp.h:80
bool acceptSet
Definition: PacketDrillApp.h:95
Keeps track of the status of network node (up, down, etc.) for other modules, and also displays it as...
Definition: NodeStatus.h:37
This class provides the generic interface for network addresses.
Definition: L3Address.h:41
uint32 numEvents
Definition: PacketDrillApp.h:118
simtime_t simStartTime
Definition: PacketDrillApp.h:101
simtime_t simRelTime
Definition: PacketDrillApp.h:102
int remotePort
Definition: PacketDrillApp.h:84
bool socketOptionsArrived
Definition: PacketDrillApp.h:98
Definition: PacketDrillUtils.h:440
#define MSGKIND_START
Definition: PacketDrillApp.cc:39
cModule * findContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:56
Local initializations.
Definition: InitStages.h:35
cPacketQueue * receivedPackets
Definition: PacketDrillApp.h:99
cPacketQueue * outboundPackets
Definition: PacketDrillApp.h:100
L3Address localAddress
Definition: PacketDrillApp.h:81
PacketDrillScript * script
Definition: PacketDrillApp.h:79
Definition: PacketDrill.h:38
NodeStatus * nodeStatus
Definition: TCPSessionApp.h:54
L3Address remoteAddress
Definition: PacketDrillApp.h:82
Definition: PacketDrillUtils.h:601
#define MSGKIND_EVENT
Definition: PacketDrillApp.cc:40
bool establishedPending
Definition: PacketDrillApp.h:96
Initialization of applications.
Definition: InitStages.h:106
virtual State getState() const
Definition: NodeStatus.h:48
Definition: NodeStatus.h:40
virtual int inet::PacketDrillApp::numInitStages ( ) const
inlineoverrideprotectedvirtual

Reimplemented from inet::TCPSessionApp.

71 { return NUM_INIT_STAGES; }
The number of initialization stages.
Definition: InitStages.h:116
void inet::PacketDrillApp::runEvent ( PacketDrillEvent event)
private
363 {
364  char str[128];
365  if (event->getType() == PACKET_EVENT) {
366  IPv4Datagram *ip = check_and_cast<IPv4Datagram *>(event->getPacket()->getInetPacket());
367  if (event->getPacket()->getDirection() == DIRECTION_INBOUND) { // < injected packet, will go through the stack bottom up.
368  if (protocol == IP_PROT_TCP) {
369  TCPSegment* tcp = check_and_cast<TCPSegment*>(ip->decapsulate());
370  tcp->setAckNo(tcp->getAckNo() + relSequenceOut);
371  if (tcp->getHeaderOptionArraySize() > 0) {
372  for (unsigned int i = 0; i < tcp->getHeaderOptionArraySize(); i++) {
373  if (tcp->getHeaderOption(i)->getKind() == TCPOPT_TIMESTAMP) {
374  TCPOptionTimestamp *option = new TCPOptionTimestamp();
375  option->setEchoedTimestamp(peerTS);
376  tcp->setHeaderOption(i, option);
377  }
378  }
379  }
380  ip->encapsulate(tcp);
381  snprintf(str, sizeof(str), "inbound %d", eventCounter);
382  ip->setName(str);
383  }
384  if (protocol == IP_PROT_SCTP) {
385  SCTPMessage* sctp = check_and_cast<SCTPMessage*>(ip->decapsulate());
386  sctp->setTag(peerVTag);
387  int32 noChunks = sctp->getChunksArraySize();
388  for (int32 cc = 0; cc < noChunks; cc++) {
389  SCTPChunk *chunk = const_cast<SCTPChunk *>(check_and_cast<const SCTPChunk *>(((SCTPMessage *)sctp)->getChunks(cc)));
390  unsigned char chunkType = chunk->getChunkType();
391  switch (chunkType) {
392  case INIT: {
393  SCTPInitChunk* init = check_and_cast<SCTPInitChunk*>(chunk);
394  peerInStreams = init->getNoInStreams();
396  initPeerTsn = init->getInitTSN();
397  localVTag = init->getInitTag();
398  peerCumTsn = initPeerTsn - 1;
399  break;
400  }
401  case INIT_ACK: {
402  SCTPInitAckChunk* initack = check_and_cast<SCTPInitAckChunk*>(chunk);
403  localVTag = initack->getInitTag();
404  initPeerTsn = initack->getInitTSN();
405  peerCumTsn = initPeerTsn - 1;
406  break;
407  }
408  case COOKIE_ECHO: {
409  SCTPCookieEchoChunk* cookieEcho = check_and_cast<SCTPCookieEchoChunk*>(chunk);
410  int tempLength = cookieEcho->getByteLength();
411  printf("copy peerCookie %p\n", peerCookie);
412  cookieEcho->setStateCookie(peerCookie->dup());
413  cookieEcho->getStateCookie()->setName("CookieEchoStateCookie");
414  cookieEcho->setByteLength(SCTP_COOKIE_ACK_LENGTH + peerCookieLength);
415  sctp->setByteLength(sctp->getByteLength() - tempLength + cookieEcho->getByteLength());
416  delete peerCookie;
417  peerCookie = nullptr;
418  break;
419  }
420  case SACK: {
421  SCTPSackChunk* sack = check_and_cast<SCTPSackChunk*>(chunk);
422  sack->setCumTsnAck(sack->getCumTsnAck() + localDiffTsn);
423  if (sack->getNumGaps() > 0) {
424  for (int i = 0; i < sack->getNumGaps(); i++) {
425  sack->setGapStart(i, sack->getGapStart(i) + localDiffTsn);
426  sack->setGapStop(i, sack->getGapStop(i) + localDiffTsn);
427  }
428  }
429  if (sack->getNumDupTsns() > 0) {
430  for (int i = 0; i < sack->getNumDupTsns(); i++) {
431  sack->setDupTsns(i, sack->getDupTsns(i) + localDiffTsn);
432  }
433  }
434  sctp->replaceChunk(sack, cc);
435  break;
436  }
437  case RE_CONFIG:{
438  SCTPStreamResetChunk* reconfig = check_and_cast<SCTPStreamResetChunk*>(chunk);
439  for (unsigned int i = 0; i < reconfig->getParametersArraySize(); i++) {
440  SCTPParameter *parameter = check_and_cast<SCTPParameter *>(reconfig->getParameters(i));
441  switch (parameter->getParameterType()) {
443  SCTPStreamResetResponseParameter *param = check_and_cast<SCTPStreamResetResponseParameter *>(parameter);
444  param->setSrResSn(seqNumMap[param->getSrResSn()]);
445  if (param->getReceiversNextTsn() != 0) {
447  }
448  break;
449  }
452  /* for (const auto & elem : seqNumMap) {
453  std::cout << " myNum = " << elem.first << " liveNum = " << elem.second << endl;
454  }*/
455  if (findSeqNumMap(param->getSrResSn())) {
456  param->setSrResSn(seqNumMap[param->getSrResSn()]);
457  }
458  break;
459  }
460  }
461  }
462  sctp->replaceChunk(reconfig, cc);
463  break;
464  }
465  }
466  }
467  sctp->setName("inboundSctp");
468  ip->encapsulate(sctp);
469  }
470  send(ip, "tunOut");
471  } else if (event->getPacket()->getDirection() == DIRECTION_OUTBOUND) { // >
472  if (receivedPackets->getLength() > 0) {
473  IPv4Datagram *live = check_and_cast<IPv4Datagram *>(receivedPackets->pop());
474  if (ip && live) {
475  PacketDrillInfo *liveInfo = (PacketDrillInfo *)live->getContextPointer();
476  if (verifyTime((enum eventTime_t) event->getTimeType(), event->getEventTime(),
477  event->getEventTimeEnd(), event->getEventOffset(), liveInfo->getLiveTime(),
478  "outbound packet") == STATUS_ERR) {
479  delete liveInfo;
480  delete live;
481  delete ip;
482  throw cTerminationException("Packetdrill error: Timing error");
483  }
484  if (!compareDatagram(ip, live)) {
485  delete liveInfo;
486  throw cTerminationException("Packetdrill error: Datagrams are not the same");
487  }
488  delete liveInfo;
489  if (!eventTimer->isScheduled() && eventCounter < numEvents - 1) {
490  eventCounter++;
491  scheduleEvent();
492  }
493  }
494  delete live;
495  delete ip;
496  } else {
497  if (protocol == IP_PROT_SCTP) {
498  SCTPMessage* sctp = check_and_cast<SCTPMessage*>(ip->getEncapsulatedPacket());
499  if (((SCTPChunk*) sctp->peekFirstChunk())->getChunkType() == INIT) {
500  SCTPInitChunk* init = check_and_cast<SCTPInitChunk*>(sctp->getChunks(0));
501  initLocalTsn = init->getInitTSN();
502  peerVTag = init->getInitTag();
503  localCumTsn = initLocalTsn - 1;
506  }
507  if (((SCTPChunk*) sctp->peekFirstChunk())->getChunkType() == INIT_ACK) {
508  SCTPInitAckChunk* initack = check_and_cast<SCTPInitAckChunk*>(sctp->getChunks(0));
509  initLocalTsn = initack->getInitTSN();
510  peerVTag = initack->getInitTag();
511  localCumTsn = initLocalTsn - 1;
512  }
513  }
514  PacketDrillInfo *info = new PacketDrillInfo("outbound");
515  info->setScriptTime(event->getEventTime());
516  info->setScriptTimeEnd(event->getEventTimeEnd());
517  info->setOffset(event->getEventOffset());
518  info->setTimeType(event->getTimeType());
519  ip->setContextPointer(info);
520  snprintf(str, sizeof(str), "outbound %d", eventCounter);
521  ip->setName(str);
522  outboundPackets->insert(ip);
523  }
524  } else
525  throw cRuntimeError("Invalid direction");
526  } else if (event->getType() == SYSCALL_EVENT) {
527  EV_INFO << "syscallEvent: time_type = " << event->getTimeType() << " event time = " << event->getEventTime()
528  << " end event time = " << event->getEventTimeEnd() << endl;
529  runSystemCallEvent(event, event->getSyscall());
530  } else if (event->getType() == COMMAND_EVENT) {
531  eventCounter++;
532  scheduleEvent();
533  }
534 }
#define SCTP_COOKIE_ACK_LENGTH
Definition: SCTPAssociation.h:219
virtual uint16_t getNoOutStreams() const
uint32 localCumTsn
Definition: PacketDrillApp.h:116
virtual uint32_t getInitTSN() const
virtual uint16_t getParameterType() const
virtual uint32_t getCumTsnAck() const
uint32 peerTS
Definition: PacketDrillApp.h:106
uint32 relSequenceOut
Definition: PacketDrillApp.h:105
uint32 localVTag
Definition: PacketDrillApp.h:121
uint32 eventCounter
Definition: PacketDrillApp.h:117
Class generated from inet/applications/packetdrill/PacketDrillInfo.msg:20 by nedtool.
Definition: PacketDrillInfo_m.h:45
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:177 by nedtool.
Definition: SCTPMessage_m.h:824
Definition: PacketDrillUtils.h:288
simtime_t getEventOffset() const
Definition: PacketDrillUtils.h:515
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:286 by nedtool.
Definition: SCTPMessage_m.h:1567
Definition: sctphdr.h:121
uint32 initLocalTsn
Definition: PacketDrillApp.h:113
virtual void setHeaderOption(unsigned int k, const TCPOptionPtr &headerOption) override
Generated but unused method, should not be called.
Definition: TCPSegment.cc:255
enum eventTime_t getTimeType() const
Definition: PacketDrillUtils.h:517
uint16 peerCookieLength
Definition: PacketDrillApp.h:111
Definition: SCTPAssociation.h:121
virtual void setScriptTimeEnd(::omnetpp::simtime_t scriptTimeEnd)
enum event_t getType() const
Definition: PacketDrillUtils.h:519
virtual void setAckNo(unsigned int ackNo)
cMessage * eventTimer
Definition: PacketDrillApp.h:125
virtual void setGapStop(unsigned int k, uint32_t gapStop)
simtime_t getEventTime() const
Definition: PacketDrillUtils.h:509
virtual void setTimeType(uint16_t timeType)
virtual uint32_t getInitTag() const
virtual void setTag(uint32_t tag)
Definition: PacketDrillUtils.h:186
eventTime_t
Definition: PacketDrillUtils.h:234
virtual ::omnetpp::simtime_t getLiveTime() const
virtual uint16_t getNumGaps() const
enum direction_t getDirection() const
Definition: PacketDrillUtils.h:476
uint16 peerOutStreams
Definition: PacketDrillApp.h:109
Definition: SCTPAssociation.h:159
virtual void setSrResSn(uint32_t srResSn)
Definition: PacketDrillUtils.h:227
void scheduleEvent()
Definition: PacketDrillApp.cc:352
uint32 numEvents
Definition: PacketDrillApp.h:118
virtual uint16_t getNumDupTsns() const
int protocol
Definition: PacketDrillApp.h:85
uint32 initPeerTsn
Definition: PacketDrillApp.h:112
virtual uint16_t getNoInStreams() const
virtual void setEchoedTimestamp(uint32_t echoedTimestamp)
virtual uint32_t getInitTSN() const
PacketDrillPacket * getPacket()
Definition: PacketDrillUtils.h:520
virtual void setReceiversNextTsn(uint32_t receiversNextTsn)
virtual void setScriptTime(::omnetpp::simtime_t scriptTime)
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:58 by nedtool.
Definition: SCTPMessage_m.h:197
uint32 peerCumTsn
Definition: PacketDrillApp.h:115
virtual uint32_t getReceiversNextTsn() const
virtual unsigned int getAckNo() const
Represents an IPv4 datagram.
Definition: IPv4Datagram.h:31
Definition: SCTPAssociation.h:156
Definition: SCTPAssociation.h:128
SCTPSocket sctpSocket
Definition: PacketDrillApp.h:90
virtual uint32 getParametersArraySize() const override
Definition: SCTPMessage.cc:249
cPacketQueue * receivedPackets
Definition: PacketDrillApp.h:99
Definition: SCTPAssociation.h:112
SCTPCookie * peerCookie
Definition: PacketDrillApp.h:110
virtual cPacketPtr & getParameters(uint32 k) override
Returns the kth parameter in this SCTP Reset Chunk.
Definition: SCTPMessage.cc:254
virtual void setDupTsns(unsigned int k, uint32_t dupTsns)
struct syscall_spec * getSyscall()
Definition: PacketDrillUtils.h:523
virtual void setCumTsnAck(uint32_t cumTsnAck)
virtual TCPOptionPtr & getHeaderOption(unsigned int k) override
Returns the kth TCP options in this TCP segment.
Definition: TCPSegment.cc:250
int verifyTime(enum eventTime_t timeType, simtime_t script_usecs, simtime_t script_usecs_end, simtime_t offset, simtime_t liveTime, const char *description)
Definition: PacketDrillApp.cc:1504
bool findSeqNumMap(uint32 num)
Definition: PacketDrillApp.cc:603
virtual uint32_t getGapStop(unsigned int k) const
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:50 by nedtool.
Definition: SCTPMessage_m.h:137
simtime_t getEventTimeEnd() const
Definition: PacketDrillUtils.h:512
Definition: PacketDrillUtils.h:185
cPacketQueue * outboundPackets
Definition: PacketDrillApp.h:100
Definition: PacketDrillUtils.h:228
int32_t int32
Definition: Compat.h:31
std::map< uint32, uint32 > seqNumMap
Definition: PacketDrillApp.h:123
Definition: SCTPAssociation.h:114
virtual uint32 getChunksArraySize() const override
Returns the number of chunks in this SCTP packet.
Definition: SCTPMessage.cc:73
virtual uint32_t getInitTag() const
Definition: PacketDrillUtils.h:229
Definition: SCTPMessage.h:120
virtual cPacketPtr & getChunks(uint32 k) override
Returns the kth chunk in this SCTP packet.
Definition: SCTPMessage.cc:78
Definition: IPProtocolId_m.h:80
virtual void setGapStart(unsigned int k, uint32_t gapStart)
virtual cPacket * peekFirstChunk()
Definition: SCTPMessage.cc:129
void setInboundStreams(int streams)
Definition: SCTPSocket.h:183
virtual unsigned int getHeaderOptionArraySize() const override
Returns the number of TCP options in this TCP segment.
Definition: TCPSegment.cc:245
Represents a TCP segment.
Definition: TCPSegment.h:60
uint32 peerVTag
Definition: PacketDrillApp.h:122
void setOutboundStreams(int streams)
Setter and getter methods for socket and API Parameters.
Definition: SCTPSocket.h:182
Represents a SCTP Message.
Definition: SCTPMessage.h:35
virtual void setSrResSn(uint32_t srResSn)
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:244 by nedtool.
Definition: SCTPMessage_m.h:1240
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:82 by nedtool.
Definition: SCTPMessage_m.h:317
Definition: SCTPAssociation.h:113
bool compareDatagram(IPv4Datagram *storedDatagram, IPv4Datagram *liveDatagram)
Definition: PacketDrillApp.cc:1541
Class generated from inet/transportlayer/sctp/SCTPMessage.msg:266 by nedtool.
Definition: SCTPMessage_m.h:1407
Class generated from inet/transportlayer/tcp_common/TCPSegment.msg:174 by nedtool.
Definition: TCPSegment_m.h:510
Definition: ip.h:53
void runSystemCallEvent(PacketDrillEvent *event, struct syscall_spec *syscall)
Definition: PacketDrillApp.cc:613
virtual uint32_t getDupTsns(unsigned int k) const
Definition: IPProtocolId_m.h:91
virtual void replaceChunk(cPacket *msg, uint32 k)
Definition: SCTPMessage.cc:83
#define TCPOPT_TIMESTAMP
Definition: PacketDrillUtils.h:66
virtual void setOffset(::omnetpp::simtime_t offset)
uint16 peerInStreams
Definition: PacketDrillApp.h:108
virtual uint32_t getGapStart(unsigned int k) const
uint32 localDiffTsn
Definition: PacketDrillApp.h:114
virtual unsigned short getKind() const
void inet::PacketDrillApp::runSystemCallEvent ( PacketDrillEvent event,
struct syscall_spec syscall 
)
private
614 {
615  char *error = NULL;
616  const char *name = syscall->name;
617  cQueue *args = new cQueue("systemCallEventQueue");
618  int result = 0;
619 
620  // Evaluate script symbolic expressions to get live numeric args for system calls.
621 
622  if (pd->evaluateExpressionList(syscall->arguments, args, &error)) {
623  args->clear();
624  delete(args);
625  delete(syscall->arguments);
626  free (syscall);
627  free(error);
628  return;
629  }
630 
631  if (!strcmp(name, "socket")) {
632  syscallSocket(syscall, args, &error);
633  } else if (!strcmp(name, "bind")) {
634  syscallBind(syscall, args, &error);
635  } else if (!strcmp(name, "listen")) {
636  syscallListen(syscall, args, &error);
637  } else if (!strcmp(name, "write") || !strcmp(name, "send")) {
638  syscallWrite(syscall, args, &error);
639  } else if (!strcmp(name, "read")) {
640  syscallRead((PacketDrillEvent*) event, syscall, args, &error);
641  } else if (!strcmp(name, "sendto")) {
642  syscallSendTo(syscall, args, &error);
643  } else if (!strcmp(name, "recvfrom")) {
644  syscallRecvFrom((PacketDrillEvent*)event, syscall, args, &error);
645  } else if (!strcmp(name, "close")) {
646  syscallClose(syscall, args, &error);
647  } else if (!strcmp(name, "shutdown")) {
648  syscallShutdown(syscall, args, &error);
649  } else if (!strcmp(name, "connect")) {
650  syscallConnect(syscall, args, &error);
651  } else if (!strcmp(name, "accept")) {
652  syscallAccept(syscall, args, &error);
653  } else if (!strcmp(name, "setsockopt")) {
654  syscallSetsockopt(syscall, args, &error);
655  } else if (!strcmp(name, "getsockopt")) {
656  syscallGetsockopt(syscall, args, &error);
657  } else if (!strcmp(name, "sctp_sendmsg")) {
658  syscallSctpSendmsg(syscall, args, &error);
659  } else if (!strcmp(name, "sctp_send")) {
660  syscallSctpSend(syscall, args, &error);
661  } else {
662  EV_INFO << "System call %s not known (yet)." << name;
663  }
664  args->clear();
665  delete(args);
666  delete(syscall->arguments);
667  free (syscall);
668  if (result == STATUS_ERR) {
669  EV_ERROR << event->getLineNumber() << ": runtime error in " << syscall->name << " call: " << error << endl;
670  closeAllSockets();
671  free(error);
672  }
673  return;
674 }
int syscallGetsockopt(struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:1109
Definition: PacketDrillUtils.h:288
PacketDrill * pd
Definition: PacketDrillApp.h:91
int syscallSctpSend(struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:1260
void closeAllSockets()
Definition: PacketDrillApp.cc:571
int evaluateExpressionList(cQueue *in_list, cQueue *out_list, char **error)
Definition: PacketDrill.cc:1691
int syscallClose(struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:1427
int syscallListen(struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:763
int syscallRead(PacketDrillEvent *event, struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:1313
int syscallAccept(struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:796
Definition: PacketDrillUtils.h:482
int syscallRecvFrom(PacketDrillEvent *event, struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:1377
int syscallWrite(struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:819
int syscallBind(struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:725
int syscallShutdown(struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:1463
cQueue * arguments
Definition: PacketDrillUtils.h:304
void free(void *)
int syscallSendTo(struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:1151
int syscallSocket(struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:676
const char * name
Definition: PacketDrillUtils.h:303
int syscallSetsockopt(struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:910
int syscallSctpSendmsg(struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:1192
int syscallConnect(struct syscall_spec *syscall, cQueue *args, char **error)
Definition: PacketDrillApp.cc:874
void inet::PacketDrillApp::scheduleEvent ( )
private
353 {
356  adjustTimes(event);
357  cancelEvent(eventTimer);
358  eventTimer->setContextPointer(event);
359  scheduleAt(event->getEventTime(), eventTimer);
360 }
void setEventNumber(int number)
Definition: PacketDrillUtils.h:505
uint32 eventCounter
Definition: PacketDrillApp.h:117
cMessage * eventTimer
Definition: PacketDrillApp.h:125
void adjustTimes(PacketDrillEvent *event)
Definition: PacketDrillApp.cc:332
Definition: PacketDrillUtils.h:482
cQueue * getEventList()
Definition: PacketDrillUtils.h:621
PacketDrillScript * script
Definition: PacketDrillApp.h:79
void inet::PacketDrillApp::setSeqNumMap ( uint32  ownNum,
uint32  liveNum 
)
inline
66 { seqNumMap[ownNum] = liveNum; };
std::map< uint32, uint32 > seqNumMap
Definition: PacketDrillApp.h:123
int inet::PacketDrillApp::syscallAccept ( struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
797 {
798  int script_accepted_fd;
799  if (!listenSet)
800  return STATUS_ERR;
801 
803  if (!exp || exp->getS32(&script_accepted_fd, error))
804  return STATUS_ERR;
805  if (establishedPending) {
806  if (protocol == IP_PROT_TCP)
808  else if (protocol == IP_PROT_SCTP)
810  establishedPending = false;
811  sctpSocket.accept(sctpAssocId, script_accepted_fd);
812  } else {
813  acceptSet = true;
814  }
815 
816  return STATUS_OK;
817 }
Definition: PacketDrillUtils.h:529
Definition: PacketDrillUtils.h:288
void setState(enum State state)
Definition: TCPSocket.h:211
bool listenSet
Definition: PacketDrillApp.h:94
void setState(int state)
Definition: SCTPSocket.h:366
Definition: TCPSocket.h:148
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
bool acceptSet
Definition: PacketDrillApp.h:95
int protocol
Definition: PacketDrillApp.h:85
PacketDrillExpression * result
Definition: PacketDrillUtils.h:305
int sctpAssocId
Definition: PacketDrillApp.h:87
SCTPSocket sctpSocket
Definition: PacketDrillApp.h:90
TCPSocket tcpSocket
Definition: PacketDrillApp.h:89
Definition: PacketDrillUtils.h:287
Definition: IPProtocolId_m.h:80
void accept(int32 assocId, int32 fd)
Definition: SCTPSocket.cc:322
bool establishedPending
Definition: PacketDrillApp.h:96
Definition: IPProtocolId_m.h:91
Definition: SCTPSocket.h:87
if(!(yy_init))
Definition: lexer.cc:1644
int inet::PacketDrillApp::syscallBind ( struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
726 {
727  int script_fd;
729 
730  if (args->getLength() != 3)
731  return STATUS_ERR;
732  exp = (PacketDrillExpression *)args->get(0);
733  if (!exp || exp->getS32(&script_fd, error))
734  return STATUS_ERR;
735  exp = (PacketDrillExpression *)args->get(1);
736  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
737  return STATUS_ERR;
738  exp = (PacketDrillExpression *)args->get(2);
739  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
740  return STATUS_ERR;
741 
742  switch (protocol) {
743  case IP_PROT_UDP:
744  break;
745 
746  case IP_PROT_TCP:
749  }
750  break;
751  case IP_PROT_SCTP:
753  {
755  }
756  break;
757  default:
758  throw cRuntimeError("Protocol type not supported for the bind system call");
759  }
760  return STATUS_OK;
761 }
Definition: PacketDrillUtils.h:529
Definition: SCTPSocket.h:87
Definition: PacketDrillUtils.h:288
int localPort
Definition: PacketDrillApp.h:83
Definition: PacketDrillUtils.h:246
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
int protocol
Definition: PacketDrillApp.h:85
void bind(int localPort)
Bind the socket to a local port number.
Definition: SCTPSocket.cc:136
int getState()
Returns the socket state, one of NOT_BOUND, CLOSED, LISTENING, CONNECTING, CONNECTED, etc.
Definition: SCTPSocket.h:154
void bind(int localPort)
Bind the socket to a local port number.
Definition: TCPSocket.cc:101
SCTPSocket sctpSocket
Definition: PacketDrillApp.h:90
Definition: TCPSocket.h:148
TCPSocket tcpSocket
Definition: PacketDrillApp.h:89
int getState() const
Returns the socket state, one of NOT_BOUND, CLOSED, LISTENING, CONNECTING, CONNECTED, etc.
Definition: TCPSocket.h:204
Definition: PacketDrillUtils.h:287
Definition: IPProtocolId_m.h:80
L3Address localAddress
Definition: PacketDrillApp.h:81
Definition: IPProtocolId_m.h:83
enum expression_t getType() const
Definition: PacketDrillUtils.h:558
Definition: IPProtocolId_m.h:91
int inet::PacketDrillApp::syscallClose ( struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
1428 {
1429  int script_fd;
1430 
1431  if (args->getLength() != 1)
1432  return STATUS_ERR;
1433  PacketDrillExpression *exp = (PacketDrillExpression *)args->get(0);
1434  if (!exp || exp->getS32(&script_fd, error))
1435  return STATUS_ERR;
1436 
1437  switch (protocol) {
1438  case IP_PROT_UDP: {
1439  EV_DETAIL << "close UDP socket\n";
1440  udpSocket.close();
1441  break;
1442  }
1443 
1444  case IP_PROT_TCP: {
1445  cMessage *msg = new cMessage("close");
1446  msg->setKind(TCP_C_CLOSE);
1447  TCPCommand *cmd = new TCPCommand();
1448  cmd->setConnId(tcpConnId);
1449  msg->setControlInfo(cmd);
1450  send(msg, "tcpOut");
1451  break;
1452  }
1453  case IP_PROT_SCTP: {
1454  sctpSocket.close(script_fd);
1455  break;
1456  }
1457  default:
1458  EV_INFO << "Protocol " << protocol << " is not supported for this system call\n";
1459  }
1460  return STATUS_OK;
1461 }
Definition: PacketDrillUtils.h:529
Definition: PacketDrillUtils.h:288
int tcpConnId
Definition: PacketDrillApp.h:86
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
void close(int id=-1)
Closes the local end of the connection.
Definition: SCTPSocket.cc:410
virtual void setConnId(int connId)
int protocol
Definition: PacketDrillApp.h:85
void close()
Unbinds the socket.
Definition: UDPSocket.cc:112
SCTPSocket sctpSocket
Definition: PacketDrillApp.h:90
Class generated from inet/transportlayer/contract/tcp/TCPCommand.msg:91 by nedtool.
Definition: TCPCommand_m.h:150
UDPSocket udpSocket
Definition: PacketDrillApp.h:88
Definition: PacketDrillUtils.h:287
Definition: TCPCommand_m.h:64
Definition: IPProtocolId_m.h:80
Definition: IPProtocolId_m.h:83
Definition: IPProtocolId_m.h:91
int inet::PacketDrillApp::syscallConnect ( struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
875 {
876  int script_fd;
878 
879  if (args->getLength() != 3)
880  return STATUS_ERR;
881  exp = (PacketDrillExpression *)args->get(0);
882  if (!exp || exp->getS32(&script_fd, error))
883  return STATUS_ERR;
884  exp = (PacketDrillExpression *)args->get(1);
885  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
886  return STATUS_ERR;
887  exp = (PacketDrillExpression *)args->get(2);
888  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
889  return STATUS_ERR;
890 
891  switch (protocol) {
892  case IP_PROT_UDP:
893  break;
894 
895  case IP_PROT_TCP:
897  break;
898  case IP_PROT_SCTP: {
899  sctpSocket.connect(script_fd, remoteAddress, remotePort, 0, true);
900  break;
901  }
902  default:
903  throw cRuntimeError("Protocol type not supported for the connect system call");
904  }
905 
906  return STATUS_OK;
907 }
Definition: PacketDrillUtils.h:529
Definition: PacketDrillUtils.h:288
void connect(L3Address remoteAddress, int32 remotePort, bool streamReset=false, int32 prMethod=0, uint32 numRequests=0)
Active OPEN to the given remote socket.
Definition: SCTPSocket.cc:237
Definition: PacketDrillUtils.h:246
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
int protocol
Definition: PacketDrillApp.h:85
int remotePort
Definition: PacketDrillApp.h:84
SCTPSocket sctpSocket
Definition: PacketDrillApp.h:90
TCPSocket tcpSocket
Definition: PacketDrillApp.h:89
Definition: PacketDrillUtils.h:287
void connect(L3Address remoteAddr, int remotePort)
Active OPEN to the given remote socket.
Definition: TCPSocket.cc:148
Definition: IPProtocolId_m.h:80
Definition: IPProtocolId_m.h:83
enum expression_t getType() const
Definition: PacketDrillUtils.h:558
L3Address remoteAddress
Definition: PacketDrillApp.h:82
Definition: IPProtocolId_m.h:91
int inet::PacketDrillApp::syscallGetsockopt ( struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
1110 {
1111  int script_fd, level, optname;
1112  PacketDrillExpression *exp;
1113 
1114  assert(protocol == IP_PROT_SCTP);
1115  if (args->getLength() != 5)
1116  return STATUS_ERR;
1117  exp = (PacketDrillExpression *) args->get(0);
1118  if (!exp || exp->getS32(&script_fd, error))
1119  return STATUS_ERR;
1120  exp = (PacketDrillExpression *) args->get(1);
1121  if (!exp || exp->getS32(&level, error))
1122  return STATUS_ERR;
1123  if (level != IPPROTO_SCTP) {
1124  return STATUS_ERR;
1125  }
1126  exp = (PacketDrillExpression *) args->get(2);
1127  if (!exp || exp->getS32(&optname, error))
1128  return STATUS_ERR;
1129 
1130  exp = (PacketDrillExpression *) args->get(3);
1131  switch (exp->getType()) {
1132  case EXPR_SCTP_STATUS: {
1133  struct sctp_status_expr *status = exp->getStatus();
1134  if (status->sstat_instrms->getType() != EXPR_ELLIPSIS)
1135  if (status->sstat_instrms->getNum() != sctpSocket.getInboundStreams()) {
1136  printf("Number of Inbound Streams does not match\n");
1137  return STATUS_ERR;
1138  }
1139  if (status->sstat_outstrms->getType() != EXPR_ELLIPSIS)
1140  if (status->sstat_outstrms->getNum() != sctpSocket.getOutboundStreams()) {
1141  printf("Number of Outbound Streams does not match\n");
1142  return STATUS_ERR;
1143  }
1144  break;
1145  }
1146  default: printf("Getsockopt option is not supported\n");
1147  }
1148  return STATUS_OK;
1149 }
Definition: PacketDrillUtils.h:529
Definition: PacketDrillUtils.h:288
Definition: PacketDrillUtils.h:246
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
int protocol
Definition: PacketDrillApp.h:85
int getInboundStreams()
Definition: SCTPSocket.h:206
int64 getNum() const
Definition: PacketDrillUtils.h:560
Definition: PacketDrillUtils.h:262
int getOutboundStreams()
Definition: SCTPSocket.h:205
SCTPSocket sctpSocket
Definition: PacketDrillApp.h:90
struct sctp_status_expr * getStatus()
Definition: PacketDrillUtils.h:587
#define IPPROTO_SCTP
Definition: PacketDrillUtils.h:45
PacketDrillExpression * sstat_outstrms
Definition: PacketDrillUtils.h:428
Definition: PacketDrillUtils.h:287
PacketDrillExpression * sstat_instrms
Definition: PacketDrillUtils.h:427
enum expression_t getType() const
Definition: PacketDrillUtils.h:558
Definition: PacketDrillUtils.h:421
Definition: IPProtocolId_m.h:91
int inet::PacketDrillApp::syscallListen ( struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
764 {
765  int script_fd, backlog;
767 
768  if (args->getLength() != 2)
769  return STATUS_ERR;
770  exp = (PacketDrillExpression *)args->get(0);
771  if (!exp || exp->getS32(&script_fd, error))
772  return STATUS_ERR;
773  exp = (PacketDrillExpression *)args->get(1);
774  if (!exp || exp->getS32(&backlog, error))
775  return STATUS_ERR;
776 
777  switch (protocol) {
778  case IP_PROT_UDP:
779  break;
780 
781  case IP_PROT_TCP:
782  listenSet = true;
784  break;
785  case IP_PROT_SCTP: {
786  sctpSocket.listen(0, true, 0, true, script_fd);
787  listenSet = true;
788  break;
789  }
790  default:
791  throw cRuntimeError("Protocol type not supported for the listen system call");
792  }
793  return STATUS_OK;
794 }
Definition: PacketDrillUtils.h:529
Definition: PacketDrillUtils.h:288
bool listenSet
Definition: PacketDrillApp.h:94
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
int protocol
Definition: PacketDrillApp.h:85
SCTPSocket sctpSocket
Definition: PacketDrillApp.h:90
TCPSocket tcpSocket
Definition: PacketDrillApp.h:89
void listenOnce()
Initiates passive OPEN to create a non-forking listening connection.
Definition: TCPSocket.h:298
Definition: PacketDrillUtils.h:287
Definition: IPProtocolId_m.h:80
Definition: IPProtocolId_m.h:83
void listen(bool fork=true, bool streamReset=false, uint32 requests=0, uint32 messagesToPush=0)
Initiates passive OPEN.
Definition: SCTPSocket.cc:177
Definition: IPProtocolId_m.h:91
int inet::PacketDrillApp::syscallRead ( PacketDrillEvent event,
struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
1314 {
1315  int script_fd, count;
1316  PacketDrillExpression* exp;
1317 
1318  if (syscall->result->getNum() == -1) {
1319  return STATUS_OK;
1320  }
1321  if (args->getLength() != 3)
1322  return STATUS_ERR;
1323  exp = (PacketDrillExpression *) args->get(0);
1324  if (!exp || exp->getS32(&script_fd, error))
1325  return STATUS_ERR;
1326  exp = (PacketDrillExpression *) args->get(1);
1327  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
1328  return STATUS_ERR;
1329  exp = (PacketDrillExpression *) args->get(2);
1330  if (!exp || exp->getS32(&count, error))
1331  return STATUS_ERR;
1332 
1333  if ((expectedMessageSize = syscall->result->getNum()) > 0) {
1334  if (msgArrived || receivedPackets->getLength() > 0) {
1335  switch (protocol) {
1336  case IP_PROT_TCP: {
1337  cMessage *msg = new cMessage("dataRequest");
1338  msg->setKind(TCP_C_READ);
1339  TCPCommand *tcpcmd = new TCPCommand();
1340  tcpcmd->setConnId(tcpConnId);
1341  msg->setControlInfo(tcpcmd);
1342  send(msg, "tcpOut");
1343  break;
1344  }
1345  case IP_PROT_SCTP: {
1346  cPacket* pkt = new cPacket("dataRequest", SCTP_C_RECEIVE);
1347  SCTPSendInfo *sctpcmd = new SCTPSendInfo();
1348  sctpcmd->setAssocId(sctpAssocId);
1349  sctpcmd->setSid(0);
1350  pkt->setControlInfo(sctpcmd);
1351  send(pkt, "sctpOut");
1352  break;
1353  }
1354  default: EV_INFO << "Protocol not supported for this system call.";
1355  }
1356  msgArrived = false;
1357  expectedMessageSize = syscall->result->getNum();
1358  recvFromSet = true;
1359  // send a receive request to TCP
1360  }
1361  else
1362  {
1363  recvFromSet = true;
1364  }
1365  }
1366  else
1367  {
1368  if (msgArrived)
1369  {
1370  outboundPackets->pop();
1371  msgArrived = false;
1372  }
1373  }
1374  return STATUS_OK;
1375 }
Definition: PacketDrillUtils.h:529
Definition: PacketDrillUtils.h:288
Class generated from inet/transportlayer/contract/sctp/SCTPCommand.msg:132 by nedtool.
Definition: SCTPCommand_m.h:327
bool msgArrived
Definition: PacketDrillApp.h:92
int tcpConnId
Definition: PacketDrillApp.h:86
int count(const std::vector< T > &v, const T &a)
Definition: stlutils.h:58
Definition: PacketDrillUtils.h:246
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
uint32 expectedMessageSize
Definition: PacketDrillApp.h:103
bool recvFromSet
Definition: PacketDrillApp.h:93
virtual void setConnId(int connId)
int protocol
Definition: PacketDrillApp.h:85
int64 getNum() const
Definition: PacketDrillUtils.h:560
PacketDrillExpression * result
Definition: PacketDrillUtils.h:305
Definition: SCTPCommand.h:37
int sctpAssocId
Definition: PacketDrillApp.h:87
cPacketQueue * receivedPackets
Definition: PacketDrillApp.h:99
Definition: TCPCommand_m.h:68
Class generated from inet/transportlayer/contract/tcp/TCPCommand.msg:91 by nedtool.
Definition: TCPCommand_m.h:150
cPacketQueue * outboundPackets
Definition: PacketDrillApp.h:100
Definition: PacketDrillUtils.h:287
Definition: IPProtocolId_m.h:80
virtual void setAssocId(int assocId)
enum expression_t getType() const
Definition: PacketDrillUtils.h:558
Definition: IPProtocolId_m.h:91
virtual void setSid(int sid)
int inet::PacketDrillApp::syscallRecvFrom ( PacketDrillEvent event,
struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
1378 {
1379  int script_fd, count, flags;
1380  PacketDrillExpression *exp;
1381 
1382  if (args->getLength() != 6)
1383  return STATUS_ERR;
1384  exp = (PacketDrillExpression *)args->get(0);
1385  if (!exp || exp->getS32(&script_fd, err))
1386  return STATUS_ERR;
1387  exp = (PacketDrillExpression *)args->get(1);
1388  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
1389  return STATUS_ERR;
1390  exp = (PacketDrillExpression *)args->get(2);
1391  if (!exp || exp->getS32(&count, err))
1392  return STATUS_ERR;
1393  exp = (PacketDrillExpression *)args->get(3);
1394  if (!exp || exp->getS32(&flags, err))
1395  return STATUS_ERR;
1396  exp = (PacketDrillExpression *)args->get(4);
1397  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
1398  return STATUS_ERR;
1399  exp = (PacketDrillExpression *)args->get(5);
1400  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
1401  return STATUS_ERR;
1402 
1403  if (msgArrived) {
1404  cMessage *msg = (cMessage*)(receivedPackets->pop());
1405  msgArrived = false;
1406  recvFromSet = false;
1407  if (!(PK(msg)->getByteLength() == syscall->result->getNum())) {
1408  delete msg;
1409  throw cTerminationException("Packetdrill error: Wrong payload length");
1410  }
1411  PacketDrillInfo *info = (PacketDrillInfo *)msg->getContextPointer();
1412  if (verifyTime((enum eventTime_t) event->getTimeType(), event->getEventTime(), event->getEventTimeEnd(),
1413  event->getEventOffset(), info->getLiveTime(), "inbound packet") == STATUS_ERR) {
1414  delete info;
1415  delete msg;
1416  return false;
1417  }
1418  delete info;
1419  delete msg;
1420  } else {
1421  expectedMessageSize = syscall->result->getNum();
1422  recvFromSet = true;
1423  }
1424  return STATUS_OK;
1425 }
Definition: PacketDrillUtils.h:529
Class generated from inet/applications/packetdrill/PacketDrillInfo.msg:20 by nedtool.
Definition: PacketDrillInfo_m.h:45
Definition: PacketDrillUtils.h:288
bool msgArrived
Definition: PacketDrillApp.h:92
enum eventTime_t getTimeType() const
Definition: PacketDrillUtils.h:517
int count(const std::vector< T > &v, const T &a)
Definition: stlutils.h:58
Definition: PacketDrillUtils.h:246
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
eventTime_t
Definition: PacketDrillUtils.h:234
virtual ::omnetpp::simtime_t getLiveTime() const
uint32 expectedMessageSize
Definition: PacketDrillApp.h:103
bool recvFromSet
Definition: PacketDrillApp.h:93
int64 getNum() const
Definition: PacketDrillUtils.h:560
PacketDrillExpression * result
Definition: PacketDrillUtils.h:305
cPacketQueue * receivedPackets
Definition: PacketDrillApp.h:99
int verifyTime(enum eventTime_t timeType, simtime_t script_usecs, simtime_t script_usecs_end, simtime_t offset, simtime_t liveTime, const char *description)
Definition: PacketDrillApp.cc:1504
Definition: PacketDrillUtils.h:287
#define PK(msg)
Definition: INETDefs.h:92
enum expression_t getType() const
Definition: PacketDrillUtils.h:558
int inet::PacketDrillApp::syscallSctpSend ( struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
1261 {
1262  int script_fd, count;
1263  PacketDrillExpression *exp;
1264  uint16 sid = 0, ssn = 0;
1265  uint32 ppid = 0;
1266 
1267  if (syscall->result->getNum() == -1) {
1268  return STATUS_OK;
1269  }
1270  if (args->getLength() != 5)
1271  return STATUS_ERR;
1272  exp = (PacketDrillExpression *)args->get(0);
1273  if (!exp || exp->getS32(&script_fd, error))
1274  return STATUS_ERR;
1275  exp = (PacketDrillExpression *)args->get(1);
1276  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
1277  return STATUS_ERR;
1278  exp = (PacketDrillExpression *)args->get(2);
1279  if (!exp || exp->getS32(&count, error))
1280  return STATUS_ERR;
1281  exp = (PacketDrillExpression *)args->get(3);
1282  if (exp->getType() == EXPR_SCTP_SNDRCVINFO) {
1283  struct sctp_sndrcvinfo_expr *info = exp->getSndRcvInfo();
1284  ssn = info->sinfo_ssn->getNum();
1285  sid = info->sinfo_stream->getNum();
1286  ppid = info->sinfo_ppid->getNum();
1287  }
1288  cPacket* cmsg = new cPacket("AppData");
1289  SCTPSimpleMessage* msg = new SCTPSimpleMessage("data");
1290  uint32 sendBytes = syscall->result->getNum();
1291  msg->setDataArraySize(sendBytes);
1292  for (uint32 i = 0; i < sendBytes; i++)
1293  msg->setData(i, 'a');
1294 
1295  msg->setDataLen(sendBytes);
1296  msg->setEncaps(false);
1297  msg->setByteLength(sendBytes);
1298  cmsg->encapsulate(msg);
1299 
1300  SCTPSendInfo* sendCommand = new SCTPSendInfo;
1301  sendCommand->setLast(true);
1302  sendCommand->setAssocId(-1);
1303  sendCommand->setSid(sid);
1304  sendCommand->setPpid(ppid);
1305  sendCommand->setSsn(ssn);
1306  sendCommand->setSendUnordered(false);
1307  cmsg->setControlInfo(sendCommand);
1308 
1309  sctpSocket.sendMsg(cmsg);
1310  return STATUS_OK;
1311 }
Definition: PacketDrillUtils.h:529
Definition: PacketDrillUtils.h:288
Class generated from inet/transportlayer/contract/sctp/SCTPCommand.msg:132 by nedtool.
Definition: SCTPCommand_m.h:327
int count(const std::vector< T > &v, const T &a)
Definition: stlutils.h:58
Definition: PacketDrillUtils.h:246
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
Definition: PacketDrillUtils.h:260
Class generated from inet/transportlayer/contract/sctp/SCTPCommand.msg:222 by nedtool.
Definition: SCTPCommand_m.h:780
int sendBytes
Definition: TCPSessionApp.h:49
int64 getNum() const
Definition: PacketDrillUtils.h:560
PacketDrillExpression * result
Definition: PacketDrillUtils.h:305
PacketDrillExpression * sinfo_ppid
Definition: PacketDrillUtils.h:405
virtual void setSendUnordered(unsigned short sendUnordered)
virtual void setEncaps(bool encaps)
virtual void setPpid(unsigned int ppid)
SCTPSocket sctpSocket
Definition: PacketDrillApp.h:90
Definition: PacketDrillUtils.h:401
virtual void setSsn(int ssn)
uint32_t uint32
Definition: Compat.h:30
PacketDrillExpression * sinfo_stream
Definition: PacketDrillUtils.h:402
virtual void setData(unsigned int k, char data)
PacketDrillExpression * sinfo_ssn
Definition: PacketDrillUtils.h:403
struct sctp_sndrcvinfo_expr * getSndRcvInfo()
Definition: PacketDrillUtils.h:582
Definition: PacketDrillUtils.h:287
virtual void setAssocId(int assocId)
void sendMsg(cMessage *cmsg)
Send data message (provided within control message).
Definition: SCTPSocket.cc:369
virtual void setLast(bool last)
uint16_t uint16
Definition: Compat.h:32
enum expression_t getType() const
Definition: PacketDrillUtils.h:558
virtual void setDataArraySize(unsigned int size)
virtual void setSid(int sid)
virtual void setDataLen(uint32_t dataLen)
int inet::PacketDrillApp::syscallSctpSendmsg ( struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
1193 {
1194  int script_fd, count;
1195  PacketDrillExpression *exp;
1196  uint32 flags, ppid, ttl, context;
1197  uint16 stream_no;
1198 
1199  if (args->getLength() != 10)
1200  return STATUS_ERR;
1201  exp = (PacketDrillExpression *)args->get(0);
1202  if (!exp || exp->getS32(&script_fd, error))
1203  return STATUS_ERR;
1204  exp = (PacketDrillExpression *)args->get(1);
1205  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
1206  return STATUS_ERR;
1207  exp = (PacketDrillExpression *)args->get(2);
1208  if (!exp || exp->getS32(&count, error))
1209  return STATUS_ERR;
1210  exp = (PacketDrillExpression *)args->get(3);
1211  /*ToDo: handle address parameter */
1212  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
1213  return STATUS_ERR;
1214  exp = (PacketDrillExpression *)args->get(4);
1215  /*ToDo: handle tolen parameter */
1216  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
1217  return STATUS_ERR;
1218  exp = (PacketDrillExpression *)args->get(5);
1219  if (!exp || exp->getU32(&ppid, error))
1220  return STATUS_ERR;
1221  exp = (PacketDrillExpression *)args->get(6);
1222  if (!exp || exp->getU32(&flags, error))
1223  return STATUS_ERR;
1224  exp = (PacketDrillExpression *)args->get(7);
1225  if (!exp || exp->getU16(&stream_no, error))
1226  return STATUS_ERR;
1227  exp = (PacketDrillExpression *)args->get(8);
1228  if (!exp || exp->getU32(&ttl, error))
1229  return STATUS_ERR;
1230  exp = (PacketDrillExpression *)args->get(9);
1231  if (!exp || exp->getU32(&context, error))
1232  return STATUS_ERR;
1233 
1234  cPacket* cmsg = new cPacket("AppData");
1235  SCTPSimpleMessage* msg = new SCTPSimpleMessage("data");
1236  uint32 sendBytes = syscall->result->getNum();
1237  msg->setDataArraySize(sendBytes);
1238  for (uint32 i = 0; i < sendBytes; i++)
1239  msg->setData(i, 'a');
1240 
1241  msg->setDataLen(sendBytes);
1242  msg->setEncaps(false);
1243  msg->setByteLength(sendBytes);
1244  cmsg->encapsulate(msg);
1245 
1246  SCTPSendInfo* sendCommand = new SCTPSendInfo;
1247  sendCommand->setLast(true);
1248  sendCommand->setAssocId(sctpAssocId);
1249  sendCommand->setSid(stream_no);
1250  sendCommand->setPpid(ppid);
1251  if (flags == SCTP_UNORDERED) {
1252  sendCommand->setSendUnordered(true);
1253  }
1254  cmsg->setControlInfo(sendCommand);
1255 
1256  sctpSocket.sendMsg(cmsg);
1257  return STATUS_OK;
1258 }
Definition: PacketDrillUtils.h:529
Definition: PacketDrillUtils.h:288
Class generated from inet/transportlayer/contract/sctp/SCTPCommand.msg:132 by nedtool.
Definition: SCTPCommand_m.h:327
int count(const std::vector< T > &v, const T &a)
Definition: stlutils.h:58
Definition: PacketDrillUtils.h:246
int getU16(uint16 *value, char **error)
Definition: PacketDrillUtils.cc:221
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
Class generated from inet/transportlayer/contract/sctp/SCTPCommand.msg:222 by nedtool.
Definition: SCTPCommand_m.h:780
#define SCTP_UNORDERED
Definition: PacketDrillUtils.h:150
int sendBytes
Definition: TCPSessionApp.h:49
int64 getNum() const
Definition: PacketDrillUtils.h:560
PacketDrillExpression * result
Definition: PacketDrillUtils.h:305
int getU32(uint32 *value, char **error)
Definition: PacketDrillUtils.cc:209
virtual void setSendUnordered(unsigned short sendUnordered)
virtual void setEncaps(bool encaps)
virtual void setPpid(unsigned int ppid)
int sctpAssocId
Definition: PacketDrillApp.h:87
SCTPSocket sctpSocket
Definition: PacketDrillApp.h:90
uint32_t uint32
Definition: Compat.h:30
virtual void setData(unsigned int k, char data)
Definition: PacketDrillUtils.h:287
virtual void setAssocId(int assocId)
void sendMsg(cMessage *cmsg)
Send data message (provided within control message).
Definition: SCTPSocket.cc:369
virtual void setLast(bool last)
uint16_t uint16
Definition: Compat.h:32
enum expression_t getType() const
Definition: PacketDrillUtils.h:558
virtual void setDataArraySize(unsigned int size)
virtual void setSid(int sid)
uint8_t ttl
Definition: TCP_NSC.cc:87
virtual void setDataLen(uint32_t dataLen)
int inet::PacketDrillApp::syscallSendTo ( struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
1152 {
1153  int script_fd, count, flags;
1154  PacketDrillExpression *exp;
1155 
1156  if (args->getLength() != 6)
1157  return STATUS_ERR;
1158  exp = (PacketDrillExpression *)args->get(0);
1159  if (!exp || exp->getS32(&script_fd, error))
1160  return STATUS_ERR;
1161  exp = (PacketDrillExpression *)args->get(1);
1162  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
1163  return STATUS_ERR;
1164  exp = (PacketDrillExpression *)args->get(2);
1165  if (!exp || exp->getS32(&count, error))
1166  return STATUS_ERR;
1167  exp = (PacketDrillExpression *)args->get(3);
1168  if (!exp || exp->getS32(&flags, error))
1169  return STATUS_ERR;
1170  exp = (PacketDrillExpression *)args->get(4);
1171  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
1172  return STATUS_ERR;
1173  exp = (PacketDrillExpression *)args->get(5);
1174  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
1175  return STATUS_ERR;
1176 
1177  cPacket *payload = new cPacket("SendTo");
1178  payload->setByteLength(count);
1179 
1180  switch (protocol) {
1181  case IP_PROT_UDP:
1183  break;
1184 
1185  default:
1186  throw cRuntimeError("Protocol type not supported for this system call");
1187  }
1188 
1189  return STATUS_OK;
1190 }
Definition: PacketDrillUtils.h:529
Definition: PacketDrillUtils.h:288
void sendTo(cPacket *msg, L3Address destAddr, int destPort, const SendOptions *options=nullptr)
Sends a data packet to the given address and port.
Definition: UDPSocket.cc:88
int count(const std::vector< T > &v, const T &a)
Definition: stlutils.h:58
Definition: PacketDrillUtils.h:246
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
int protocol
Definition: PacketDrillApp.h:85
int remotePort
Definition: PacketDrillApp.h:84
UDPSocket udpSocket
Definition: PacketDrillApp.h:88
Definition: PacketDrillUtils.h:287
Definition: IPProtocolId_m.h:83
enum expression_t getType() const
Definition: PacketDrillUtils.h:558
L3Address remoteAddress
Definition: PacketDrillApp.h:82
int inet::PacketDrillApp::syscallSetsockopt ( struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
911 {
912  int script_fd, level, optname;
914 
915  args->setName("syscallSetsockopt");
916  assert(protocol == IP_PROT_SCTP);
917  if (args->getLength() != 5)
918  return STATUS_ERR;
919  exp = (PacketDrillExpression *) args->get(0);
920  if (!exp || exp->getS32(&script_fd, error))
921  return STATUS_ERR;
922  exp = (PacketDrillExpression *) args->get(1);
923  if (!exp || exp->getS32(&level, error))
924  return STATUS_ERR;
925  if (level != IPPROTO_SCTP) {
926  return STATUS_ERR;
927  }
928  exp = (PacketDrillExpression *) args->get(2);
929  if (!exp || exp->getS32(&optname, error))
930  return STATUS_ERR;
931 
932  exp = (PacketDrillExpression *) args->get(3);
933 
934  if (syscall->result->getNum() == -1) {
935  if (exp->getType() == EXPR_SCTP_RESET_STREAMS) {
936  delete exp->getResetStreams()->srs_stream_list;
937  }
938  return STATUS_OK;
939  }
940  switch (exp->getType()) {
941  case EXPR_SCTP_INITMSG: {
942  struct sctp_initmsg_expr *initmsg = exp->getInitmsg();
947  if (sctpSocket.getInboundStreams() > 0)
949  break;
950  }
951  case EXPR_SCTP_RTOINFO: {
952  struct sctp_rtoinfo_expr *rtoinfo = exp->getRtoinfo();
953  sctpSocket.setRtoInfo(rtoinfo->srto_initial->getNum() * 1.0 / 1000, rtoinfo->srto_max->getNum() * 1.0 / 1000, rtoinfo->srto_min->getNum() * 1.0 / 1000);
954  free (rtoinfo);
955  break;
956  }
957  case EXPR_SCTP_SACKINFO: {
958  struct sctp_sack_info_expr *sackinfo = exp->getSackinfo();
959  sctpSocket.setSackPeriod(sackinfo->sack_delay->getNum() * 1.0 / 1000);
961  break;
962  }
964  struct sctp_paddrparams_expr *expr_params = exp->getPaddrParams();
965  if (expr_params->spp_flags->getNum() & SPP_HB_DISABLE)
967  else if (expr_params->spp_flags->getNum() & SPP_HB_ENABLE)
969  if (expr_params->spp_hbinterval > 0)
971  if (expr_params->spp_pathmaxrxt > 0)
973  break;
974  }
975  case EXPR_SCTP_ASSOCPARAMS: {
976  struct sctp_assocparams_expr *assoc_params = exp->getAssocParams();
978  break;
979  }
981  struct sctp_reset_streams_expr *rs = exp->getResetStreams();
982  cMessage *cmsg = new cMessage("SCTP_C_STREAM_RESET");
983  SCTPResetInfo *rinfo = new SCTPResetInfo();
984  rinfo->setAssocId(-1);
985  rinfo->setFd(rs->srs_assoc_id->getNum());
987  if (rs->srs_number_streams->getNum() > 0 && rs->srs_stream_list != nullptr) {
989  cQueue *qu = rs->srs_stream_list->getList();
990  uint16 i = 0;
991  for (cQueue::Iterator iter(*qu); !iter.end(); iter++, i++) {
992  rinfo->setStreams(i, ((PacketDrillExpression *)(*iter))->getNum());
993  qu->remove((*iter));
994  }
995  qu->clear();
996  }
997  cmsg->setKind(SCTP_C_STREAM_RESET);
1000  } else if (rs->srs_flags->getNum() == SCTP_STREAM_RESET_INCOMING) {
1003  rinfo->setRequestType(RESET_BOTH);
1004  }
1005  cmsg->setControlInfo(rinfo);
1007  delete (rs->srs_assoc_id);
1008  delete (rs->srs_flags);
1009  delete (rs->srs_number_streams);
1010  delete (rs->srs_stream_list);
1011  free (rs);
1012  break;
1013  }
1014  case EXPR_SCTP_ADD_STREAMS: {
1015  struct sctp_add_streams_expr *as = exp->getAddStreams();
1016  cMessage *cmsg = new cMessage("SCTP_C_STREAM_RESET");
1017  SCTPResetInfo *rinfo = new SCTPResetInfo();
1018  rinfo->setAssocId(-1);
1019  rinfo->setFd(as->sas_assoc_id->getNum());
1021  if (as->sas_instrms->getNum() != 0 && as->sas_outstrms->getNum() != 0) {
1022  rinfo->setRequestType(ADD_BOTH);
1023  rinfo->setInstreams(as->sas_instrms->getNum());
1024  rinfo->setOutstreams(as->sas_outstrms->getNum());
1025  } else if (as->sas_instrms->getNum() != 0) {
1026  rinfo->setRequestType(ADD_INCOMING);
1027  rinfo->setInstreams(as->sas_instrms->getNum());
1028  } else if (as->sas_outstrms->getNum() != 0) {
1029  rinfo->setRequestType(ADD_OUTGOING);
1030  rinfo->setOutstreams(as->sas_outstrms->getNum());
1031  }
1032  cmsg->setKind(SCTP_C_ADD_STREAMS);
1033  cmsg->setControlInfo(rinfo);
1035  delete (as->sas_assoc_id);
1036  delete (as->sas_instrms);
1037  delete (as->sas_outstrms);
1038  free (as);
1039  break;
1040  }
1041 
1042  case EXPR_SCTP_ASSOCVAL:
1043  switch (optname) {
1044  case SCTP_MAX_BURST: {
1045  struct sctp_assoc_value_expr *burstvalue = exp->getAssocval();
1046  sctpSocket.setMaxBurst(burstvalue->assoc_value->getNum());
1047  break;
1048  }
1049  case SCTP_MAXSEG: {
1050  struct sctp_assoc_value_expr *assocvalue = exp->getAssocval();
1051  sctpSocket.setFragPoint(assocvalue->assoc_value->getNum());
1052  break;
1053  }
1054  case SCTP_ENABLE_STREAM_RESET: {
1055  struct sctp_assoc_value_expr *assocvalue = exp->getAssocval();
1056  sctpSocket.setStreamReset(assocvalue->assoc_value->getNum());
1057  delete (assocvalue->assoc_id);
1058  delete (assocvalue->assoc_value);
1059  free (assocvalue);
1060  break;
1061  }
1062  default:
1063  printf("Option name %d of type EXPR_SCTP_ASSOCVAL not known\n", optname);
1064  }
1065  break;
1066  case EXPR_LIST: {
1067  int value;
1068 
1069  if (!exp || exp->getType() != EXPR_LIST)
1070  {
1071  return STATUS_ERR;
1072  }
1073  if (exp->getList()->getLength() != 1)
1074  {
1075  printf("Expected [<integer>] but got multiple elements");
1076  return STATUS_ERR;
1077  }
1078 
1079  PacketDrillExpression *exp2 = (PacketDrillExpression*) (exp->getList()->pop());
1080  exp2->getS32(&value, error);
1081  switch (optname)
1082  {
1083  case SCTP_NODELAY:
1084  sctpSocket.setNagle(value? 0 : 1);
1085  break;
1086  case SCTP_RESET_ASSOC: {
1087  cMessage *cmsg = new cMessage("SCTP_C_STREAM_RESET");
1088  SCTPResetInfo *rinfo = new SCTPResetInfo();
1089  rinfo->setAssocId(-1);
1090  rinfo->setFd(value);
1092  rinfo->setRequestType(SSN_TSN);
1093  cmsg->setKind(SCTP_C_RESET_ASSOC);
1094  cmsg->setControlInfo(rinfo);
1096  break;
1097  }
1098  }
1099  break;
1100  }
1101  case EXPR_INTEGER:
1102  break;
1103  default:
1104  printf("Type %d not known\n", exp->getType());
1105  }
1106  return STATUS_OK;
1107 }
PacketDrillExpression * spp_pathmaxrxt
Definition: PacketDrillUtils.h:393
Definition: PacketDrillUtils.h:529
struct sctp_add_streams_expr * getAddStreams()
Definition: PacketDrillUtils.h:589
void setEnableHeartbeats(bool option)
Definition: SCTPSocket.h:198
Definition: PacketDrillUtils.h:413
Definition: SCTPAssociation.h:155
Definition: PacketDrillUtils.h:288
Definition: PacketDrillUtils.h:258
#define SCTP_NODELAY
Definition: PacketDrillUtils.h:140
Definition: PacketDrillUtils.h:357
PacketDrillExpression * sack_freq
Definition: PacketDrillUtils.h:385
void setMaxInitRetrans(int option)
Definition: SCTPSocket.h:187
Definition: PacketDrillUtils.h:349
void setStreamReset(int option)
Definition: SCTPSocket.h:185
Definition: PacketDrillUtils.h:247
cQueue * getList()
Definition: PacketDrillUtils.h:565
PacketDrillExpression * srs_number_streams
Definition: PacketDrillUtils.h:416
struct sctp_rtoinfo_expr * getRtoinfo()
Definition: PacketDrillUtils.h:570
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
struct sctp_assocparams_expr * getAssocParams()
Definition: PacketDrillUtils.h:574
Definition: PacketDrillUtils.h:263
PacketDrillExpression * assoc_id
Definition: PacketDrillUtils.h:367
#define SCTP_MAX_BURST
Definition: PacketDrillUtils.h:143
#define SCTP_STREAM_RESET_OUTGOING
Definition: PacketDrillUtils.h:168
void setMaxInitRetransTimeout(int option)
Definition: SCTPSocket.h:188
struct sctp_initmsg_expr * getInitmsg()
Definition: PacketDrillUtils.h:572
PacketDrillExpression * srs_flags
Definition: PacketDrillUtils.h:415
void setNagle(int option)
Definition: SCTPSocket.h:196
Definition: PacketDrillUtils.h:257
int protocol
Definition: PacketDrillApp.h:85
Definition: PacketDrillUtils.h:259
PacketDrillExpression * srs_stream_list
Definition: PacketDrillUtils.h:417
int getInboundStreams()
Definition: SCTPSocket.h:206
void setHbInterval(double option)
Definition: SCTPSocket.h:199
Definition: SCTPCommand.h:46
int64 getNum() const
Definition: PacketDrillUtils.h:560
Definition: PacketDrillUtils.h:366
Definition: SCTPAssociation.h:150
PacketDrillExpression * result
Definition: PacketDrillUtils.h:305
#define SCTP_RESET_ASSOC
Definition: PacketDrillUtils.h:154
PacketDrillExpression * sas_assoc_id
Definition: PacketDrillUtils.h:435
L3Address getRemoteAddr()
Definition: SCTPSocket.h:167
virtual void setInstreams(uint16_t instreams)
PacketDrillExpression * sas_outstrms
Definition: PacketDrillUtils.h:437
PacketDrillExpression * spp_hbinterval
Definition: PacketDrillUtils.h:392
void setRtoInfo(double initial, double max, double min)
Definition: SCTPSocket.cc:622
struct sctp_reset_streams_expr * getResetStreams()
Definition: PacketDrillUtils.h:584
Class generated from inet/transportlayer/contract/sctp/SCTPCommand.msg:201 by nedtool.
Definition: SCTPCommand_m.h:636
virtual void setFd(int fd)
virtual void setStreams(unsigned int k, uint16_t streams)
Definition: PacketDrillUtils.h:264
PacketDrillExpression * spp_flags
Definition: PacketDrillUtils.h:395
struct sctp_paddrparams_expr * getPaddrParams()
Definition: PacketDrillUtils.h:580
SCTPSocket sctpSocket
Definition: PacketDrillApp.h:90
void setSackFrequency(int option)
Definition: SCTPSocket.h:192
PacketDrillExpression * sinit_max_instreams
Definition: PacketDrillUtils.h:359
Definition: PacketDrillUtils.h:372
#define SCTP_ENABLE_STREAM_RESET
Definition: PacketDrillUtils.h:152
Definition: SCTPAssociation.h:152
Definition: PacketDrillUtils.h:434
virtual void setRequestType(unsigned short requestType)
Definition: SCTPAssociation.h:151
#define SPP_HB_ENABLE
Definition: PacketDrillUtils.h:173
void setMaxBurst(int option)
Definition: SCTPSocket.h:194
void sendNotification(cMessage *msg)
Send notification.
Definition: SCTPSocket.cc:393
Definition: PacketDrillUtils.h:389
#define IPPROTO_SCTP
Definition: PacketDrillUtils.h:45
virtual void setRemoteAddr(const L3Address &remoteAddr)
PacketDrillExpression * srto_max
Definition: PacketDrillUtils.h:352
PacketDrillExpression * sinit_max_init_timeo
Definition: PacketDrillUtils.h:361
PacketDrillExpression * sasoc_asocmaxrxt
Definition: PacketDrillUtils.h:374
Definition: PacketDrillUtils.h:261
struct sctp_sack_info_expr * getSackinfo()
Definition: PacketDrillUtils.h:578
Definition: SCTPAssociation.h:162
Definition: PacketDrillUtils.h:287
void setAssocMaxRtx(int option)
Definition: SCTPSocket.h:201
PacketDrillExpression * sack_delay
Definition: PacketDrillUtils.h:384
Definition: SCTPAssociation.h:153
PacketDrillExpression * srto_min
Definition: PacketDrillUtils.h:353
#define SCTP_STREAM_RESET_INCOMING
Definition: PacketDrillUtils.h:167
void setInboundStreams(int streams)
Definition: SCTPSocket.h:183
void free(void *)
virtual void setAssocId(int assocId)
Definition: PacketDrillUtils.h:382
uint16_t uint16
Definition: Compat.h:32
virtual void setOutstreams(uint16_t outstreams)
PacketDrillExpression * sinit_max_attempts
Definition: PacketDrillUtils.h:360
PacketDrillExpression * sinit_num_ostreams
Definition: PacketDrillUtils.h:358
void setOutboundStreams(int streams)
Setter and getter methods for socket and API Parameters.
Definition: SCTPSocket.h:182
Definition: PacketDrillUtils.h:255
PacketDrillExpression * srs_assoc_id
Definition: PacketDrillUtils.h:414
void setPathMaxRetrans(int option)
Definition: SCTPSocket.h:197
#define SPP_HB_DISABLE
Definition: PacketDrillUtils.h:174
enum expression_t getType() const
Definition: PacketDrillUtils.h:558
Definition: SCTPAssociation.h:154
void setSackPeriod(double option)
Definition: SCTPSocket.h:193
PacketDrillExpression * sas_instrms
Definition: PacketDrillUtils.h:436
#define SCTP_MAXSEG
Definition: PacketDrillUtils.h:141
void setAppLimited(bool option)
Definition: SCTPSocket.h:184
struct sctp_assoc_value_expr * getAssocval()
Definition: PacketDrillUtils.h:576
Definition: PacketDrillUtils.h:254
PacketDrillExpression * srto_initial
Definition: PacketDrillUtils.h:351
PacketDrillExpression * assoc_value
Definition: PacketDrillUtils.h:368
Definition: SCTPCommand.h:47
Definition: IPProtocolId_m.h:91
Definition: SCTPCommand.h:45
virtual void setStreamsArraySize(unsigned int size)
void setFragPoint(int option)
Definition: SCTPSocket.h:195
Definition: PacketDrillUtils.h:256
int inet::PacketDrillApp::syscallShutdown ( struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
1464 {
1465  int script_fd;
1466 printf("syscallShutdown\n");
1467  if (args->getLength() != 2)
1468  return STATUS_ERR;
1469  PacketDrillExpression *exp = (PacketDrillExpression *)args->get(0);
1470  if (!exp || exp->getS32(&script_fd, error))
1471  return STATUS_ERR;
1472 
1473  switch (protocol) {
1474  case IP_PROT_SCTP: {
1475  sctpSocket.shutdown(script_fd);
1476  break;
1477  }
1478  default:
1479  EV_INFO << "Protocol " << protocol << " is not supported for this system call\n";
1480  }
1481  return STATUS_OK;
1482 }
Definition: PacketDrillUtils.h:529
Definition: PacketDrillUtils.h:288
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
void shutdown(int id=-1)
Definition: SCTPSocket.cc:425
int protocol
Definition: PacketDrillApp.h:85
SCTPSocket sctpSocket
Definition: PacketDrillApp.h:90
Definition: PacketDrillUtils.h:287
Definition: IPProtocolId_m.h:91
int inet::PacketDrillApp::syscallSocket ( struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
677 {
678  int type;
680 
681  if (args->getLength() != 3) {
682  return STATUS_ERR;
683  }
684  exp = (PacketDrillExpression *)args->get(0);
685  if (!exp || (exp->getType() != EXPR_ELLIPSIS)) {
686  return STATUS_ERR;
687  }
688  exp = (PacketDrillExpression *)args->get(1);
689  if (!exp || exp->getS32(&type, error)) {
690  return STATUS_ERR;
691  }
692  exp = (PacketDrillExpression *)args->get(2);
693  if (!exp || exp->getS32(&protocol, error)) {
694  return STATUS_ERR;
695  }
696 
697  switch (protocol) {
698  case IP_PROT_UDP:
699  udpSocket.setOutputGate(gate("udpOut"));
701  break;
702 
703  case IP_PROT_TCP:
705  tcpSocket.setOutputGate(gate("tcpOut"));
707  break;
708  case IP_PROT_SCTP:
709  sctpSocket.setOutputGate(gate("sctpOut"));
710  if (sctpSocket.getOutboundStreams() == -1) {
711  sctpSocket.setOutboundStreams((int) par("outboundStreams"));
712  }
713  if (sctpSocket.getInboundStreams() == -1) {
714  sctpSocket.setInboundStreams((int) par("inboundStreams"));
715  }
717  break;
718  default:
719  throw cRuntimeError("Protocol type not supported for the socket system call");
720  }
721 
722  return STATUS_OK;
723 }
Definition: PacketDrillUtils.h:529
Definition: PacketDrillUtils.h:288
int localPort
Definition: PacketDrillApp.h:83
Definition: PacketDrillUtils.h:246
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
int protocol
Definition: PacketDrillApp.h:85
int getInboundStreams()
Definition: SCTPSocket.h:206
void setOutputGate(cGate *toUdp)
Sets the gate on which to send to UDP.
Definition: UDPSocket.h:110
void bind(int localPort)
Bind the socket to a local port number.
Definition: SCTPSocket.cc:136
int getOutboundStreams()
Definition: SCTPSocket.h:205
void bind(int localPort)
Bind the socket to a local port number.
Definition: TCPSocket.cc:101
SCTPSocket sctpSocket
Definition: PacketDrillApp.h:90
TCPSocket tcpSocket
Definition: PacketDrillApp.h:89
UDPSocket udpSocket
Definition: PacketDrillApp.h:88
Definition: PacketDrillUtils.h:287
Definition: IPProtocolId_m.h:80
void setInboundStreams(int streams)
Definition: SCTPSocket.h:183
Definition: IPProtocolId_m.h:83
void setOutputGate(cGate *toTcp)
Sets the gate on which to send to TCP.
Definition: TCPSocket.h:228
void readDataTransferModePar(cComponent &component)
Read "dataTransferMode" parameter from ini/ned, and set dataTransferMode member value.
Definition: TCPSocket.cc:355
void setOutboundStreams(int streams)
Setter and getter methods for socket and API Parameters.
Definition: SCTPSocket.h:182
enum expression_t getType() const
Definition: PacketDrillUtils.h:558
void setOutputGate(cGate *toSctp)
Sets the gate on which to send to SCTP.
Definition: SCTPSocket.h:177
Definition: IPProtocolId_m.h:91
void bind(int localPort)
Bind the socket to a local port number.
Definition: UDPSocket.cc:53
int inet::PacketDrillApp::syscallWrite ( struct syscall_spec syscall,
cQueue *  args,
char **  error 
)
private
820 {
821  int script_fd, count;
823 
824  if (args->getLength() > 4)
825  return STATUS_ERR;
826  exp = (PacketDrillExpression *) args->get(0);
827  if (!exp || exp->getS32(&script_fd, error))
828  return STATUS_ERR;
829  exp = (PacketDrillExpression *) args->get(1);
830  if (!exp || (exp->getType() != EXPR_ELLIPSIS))
831  return STATUS_ERR;
832  exp = (PacketDrillExpression *) args->get(2);
833  if (!exp || exp->getS32(&count, error))
834  return STATUS_ERR;
835 
836  switch (protocol)
837  {
838  case IP_PROT_TCP: {
839  cPacket *payload = new cPacket("Write");
840  payload->setByteLength(syscall->result->getNum());
841  tcpSocket.send(payload);
842  break;
843  }
844  case IP_PROT_SCTP: {
845  cPacket* cmsg = new cPacket("AppData");
846  SCTPSimpleMessage* msg = new SCTPSimpleMessage("data");
847  uint32 sendBytes = syscall->result->getNum();
848  msg->setDataArraySize(sendBytes);
849  for (uint32 i = 0; i < sendBytes; i++)
850  msg->setData(i, 'a');
851 
852  msg->setDataLen(sendBytes);
853  msg->setEncaps(false);
854  msg->setByteLength(sendBytes);
855  cmsg->encapsulate(msg);
856  cmsg->setKind(SCTP_C_SEND_ORDERED);
857 
858  SCTPSendInfo* sendCommand = new SCTPSendInfo;
859  sendCommand->setLast(true);
860  sendCommand->setAssocId(-1);
861  sendCommand->setSendUnordered(false);
862  cmsg->setControlInfo(sendCommand);
863 
864  sctpSocket.sendMsg(cmsg);
865  break;
866  }
867  default: EV_INFO << "Protocol not supported for this socket call";
868  }
869 
870  return STATUS_OK;
871 }
Definition: PacketDrillUtils.h:529
Definition: PacketDrillUtils.h:288
Class generated from inet/transportlayer/contract/sctp/SCTPCommand.msg:132 by nedtool.
Definition: SCTPCommand_m.h:327
int count(const std::vector< T > &v, const T &a)
Definition: stlutils.h:58
Definition: PacketDrillUtils.h:246
int getS32(int32 *value, char **error)
Definition: PacketDrillUtils.cc:197
Class generated from inet/transportlayer/contract/sctp/SCTPCommand.msg:222 by nedtool.
Definition: SCTPCommand_m.h:780
int sendBytes
Definition: TCPSessionApp.h:49
int protocol
Definition: PacketDrillApp.h:85
int64 getNum() const
Definition: PacketDrillUtils.h:560
PacketDrillExpression * result
Definition: PacketDrillUtils.h:305
Definition: SCTPCommand.h:38
virtual void setSendUnordered(unsigned short sendUnordered)
virtual void setEncaps(bool encaps)
SCTPSocket sctpSocket
Definition: PacketDrillApp.h:90
void send(cMessage *msg)
Sends data packet.
Definition: TCPSocket.cc:175
TCPSocket tcpSocket
Definition: PacketDrillApp.h:89
uint32_t uint32
Definition: Compat.h:30
virtual void setData(unsigned int k, char data)
Definition: PacketDrillUtils.h:287
Definition: IPProtocolId_m.h:80
virtual void setAssocId(int assocId)
void sendMsg(cMessage *cmsg)
Send data message (provided within control message).
Definition: SCTPSocket.cc:369
virtual void setLast(bool last)
enum expression_t getType() const
Definition: PacketDrillUtils.h:558
virtual void setDataArraySize(unsigned int size)
Definition: IPProtocolId_m.h:91
virtual void setDataLen(uint32_t dataLen)
int inet::PacketDrillApp::verifyTime ( enum eventTime_t  timeType,
simtime_t  script_usecs,
simtime_t  script_usecs_end,
simtime_t  offset,
simtime_t  liveTime,
const char *  description 
)
private
1506 {
1507  simtime_t expectedTime = scriptTime;
1508  simtime_t expectedTimeEnd = scriptTimeEnd;
1509  simtime_t actualTime = liveTime;
1510  simtime_t tolerance = SimTime(config->getToleranceUsecs(), SIMTIME_US);
1511 
1512  if (timeType == ANY_TIME) {
1513  return STATUS_OK;
1514  }
1515 
1516  if (timeType == ABSOLUTE_RANGE_TIME || timeType == RELATIVE_RANGE_TIME) {
1517  if (actualTime < (expectedTime - tolerance) || actualTime > (expectedTimeEnd + tolerance)) {
1518  if (timeType == ABSOLUTE_RANGE_TIME) {
1519  EV_INFO << "timing error: expected " << description << " in time range " << scriptTime << " ~ "
1520  << scriptTimeEnd << " sec, but happened at " << actualTime << " sec" << endl;
1521  } else if (timeType == RELATIVE_RANGE_TIME) {
1522  EV_INFO << "timing error: expected " << description << " in relative time range +"
1523  << scriptTime - offset << " ~ " << scriptTimeEnd - offset << " sec, but happened at +"
1524  << actualTime - offset << " sec" << endl;
1525  }
1526  return STATUS_ERR;
1527  } else {
1528  return STATUS_OK;
1529  }
1530  }
1531 
1532  if ((actualTime < (expectedTime - tolerance)) || (actualTime > (expectedTime + tolerance))) {
1533  EV_INFO << "timing error: expected " << description << " at " << scriptTime << " sec, but happened at "
1534  << actualTime << " sec" << endl;
1535  return STATUS_ERR;
1536  } else {
1537  return STATUS_OK;
1538  }
1539 }
Definition: PacketDrillUtils.h:239
Definition: PacketDrillUtils.h:288
Definition: PacketDrillUtils.h:238
int getToleranceUsecs() const
Definition: PacketDrillUtils.h:460
PacketDrillConfig * config
Definition: PacketDrillApp.h:80
Definition: PacketDrillUtils.h:287
Definition: PacketDrillUtils.h:237

Member Data Documentation

bool inet::PacketDrillApp::abortSent
private
bool inet::PacketDrillApp::acceptSet
private
PacketDrillConfig* inet::PacketDrillApp::config
private
bool inet::PacketDrillApp::establishedPending
private
uint32 inet::PacketDrillApp::eventCounter
private
cMessage* inet::PacketDrillApp::eventTimer
private
uint32 inet::PacketDrillApp::expectedMessageSize
private
uint32 inet::PacketDrillApp::idInbound
private
uint32 inet::PacketDrillApp::idOutbound
private
uint32 inet::PacketDrillApp::initLocalTsn
private
uint32 inet::PacketDrillApp::initPeerTsn
private
bool inet::PacketDrillApp::listenSet
private
L3Address inet::PacketDrillApp::localAddress
private
uint32 inet::PacketDrillApp::localCumTsn
private
uint32 inet::PacketDrillApp::localDiffTsn
private
int inet::PacketDrillApp::localPort
private
uint32 inet::PacketDrillApp::localVTag
private
bool inet::PacketDrillApp::msgArrived
private
uint32 inet::PacketDrillApp::numEvents
private
cPacketQueue* inet::PacketDrillApp::outboundPackets
private
PacketDrill* inet::PacketDrillApp::pd
private
SCTPCookie* inet::PacketDrillApp::peerCookie
private
uint16 inet::PacketDrillApp::peerCookieLength
private
uint32 inet::PacketDrillApp::peerCumTsn
private
simtime_t inet::PacketDrillApp::peerHeartbeatTime
private
uint16 inet::PacketDrillApp::peerInStreams
private
uint16 inet::PacketDrillApp::peerOutStreams
private
uint32 inet::PacketDrillApp::peerTS
private
uint32 inet::PacketDrillApp::peerVTag
private
uint16 inet::PacketDrillApp::peerWindow
private
int inet::PacketDrillApp::protocol
private
cPacketQueue* inet::PacketDrillApp::receivedPackets
private
bool inet::PacketDrillApp::recvFromSet
private
uint32 inet::PacketDrillApp::relSequenceIn
private
uint32 inet::PacketDrillApp::relSequenceOut
private
L3Address inet::PacketDrillApp::remoteAddress
private
int inet::PacketDrillApp::remotePort
private
PacketDrillScript* inet::PacketDrillApp::script
private
int inet::PacketDrillApp::sctpAssocId
private
SCTPSocket inet::PacketDrillApp::sctpSocket
private
std::map<uint32, uint32> inet::PacketDrillApp::seqNumMap
private
simtime_t inet::PacketDrillApp::simRelTime
private
simtime_t inet::PacketDrillApp::simStartTime
private
bool inet::PacketDrillApp::socketOptionsArrived
private
int inet::PacketDrillApp::tcpConnId
private
TCPSocket inet::PacketDrillApp::tcpSocket
private
UDPSocket inet::PacketDrillApp::udpSocket
private

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