RINASim  October 2016
Documentation of framework for OMNeT++
PDU_m.h File Reference
#include <omnetpp.h>
#include "Address.h"
#include "APN.h"
#include "ConnectionId.h"

Go to the source code of this file.

Classes

class  PDU_Base
 

Macros

#define MSGC_VERSION   0x0500
 
#define PDU_HEADER_LEN   10
 

Enumerations

enum  PDUType {
  MANAGEMENT_PDU = 0x40, DATA_TRANSFER_PDU = 0x80, CONTROL_ACK_PDU = 0xC0, ACK_ONLY_PDU = 0xC1,
  NACK_ONLY_PDU = 0xC2, FLOW_ONLY_PDU = 0xC4, ACK_FLOW_PDU = 0xC5, NACK_FLOW_PDU = 0xC6,
  SELECT_ACK_PDU = 0xC9, SELECT_NACK_PDU = 0xCA, SELECT_ACK_FLOW_PDU = 0xCD, SELECT_NACK_FLOW_PDU = 0xCE,
  RENDEZVOUS_PDU = 0xE0
}
 
enum  PDUTypeBits { PDU_ACK_BIT = 0x01, PDU_NACK_BIT = 0x02, PDU_FC_BIT = 0x04, PDU_SEL_BIT = 0x08 }
 
enum  FLAGS
 

Macro Definition Documentation

#define MSGC_VERSION   0x0500

Definition at line 11 of file PDU_m.h.

#define PDU_HEADER_LEN   10

Enumeration Type Documentation

enum FLAGS

Enum generated from Common/PDU.msg:76 by nedtool.

//TODO A1
enum FLAGS
{
}

Definition at line 105 of file PDU_m.h.

enum PDUType

Enum generated from Common/PDU.msg:45 by nedtool.

enum PDUType
{

//          EFCP_PDU                                = 0x80;
MANAGEMENT_PDU = 0x40;

DATA_TRANSFER_PDU = 0x80;

CONTROL_ACK_PDU = 0xC0;
ACK_ONLY_PDU = 0xC1;
NACK_ONLY_PDU = 0xC2;
FLOW_ONLY_PDU = 0xC4;
ACK_FLOW_PDU = 0xC5;
NACK_FLOW_PDU = 0xC6;
SELECT_ACK_PDU = 0xC9;
SELECT_NACK_PDU = 0xCA;
SELECT_ACK_FLOW_PDU = 0xCD;
SELECT_NACK_FLOW_PDU = 0xCE;


RENDEZVOUS_PDU = 0xE0;
}

Class generated from Common/PDU.msg:81 by nedtool.

packet PDU
{
    (true);
    string displayString;
    unsigned int version = 1;
    Address srcAddr;
    Address dstAddr;
    APN srcApn;
    APN dstApn;
    ConnectionId connId;
    int type);
    int flags = 0; //8bits
    unsigned int pduLen = PDU_HEADER_LEN;
    unsigned int seqNum;
    unsigned int hopCount = 255;
    byteLength = 10;
    schedulingPriority = -1;
//    cObject userData; //unsigned char []? string?
//    unsigned char userData[];
//    cMessagePtr mUserData;
}
//packet ManagemtPDU extends PDU {
//
//      type = MANAGEMENT_PDU;
//   
//}
//packet DataTransferPDU extends PDU{
//    type = DATA_TRANSFER_PDU;
//    
//}

PDU_Base is only useful if it gets subclassed, and PDU is derived from it. The minimum code to be written for PDU is the following:

class PDU : public PDU_Base
{
  private:
    void copy(const PDU& other) { ... }
  public:
    PDU(const char *name=nullptr, int kind=0) : PDU_Base(name,kind) {}
    PDU(const PDU& other) : PDU_Base(other) {copy(other);}
    PDU& operator=(const PDU& other) {if (this==&other) return *this; PDU_Base::operator=(other); copy(other); return *this;}
    virtual PDU *dup() const {return new PDU(*this);}
    // ADD CODE HERE to redefine and implement pure virtual functions from PDU_Base
};

The following should go into a .cc (.cpp) file:

Register_Class(PDU);
Enumerator
MANAGEMENT_PDU 
DATA_TRANSFER_PDU 
CONTROL_ACK_PDU 
ACK_ONLY_PDU 
NACK_ONLY_PDU 
FLOW_ONLY_PDU 
ACK_FLOW_PDU 
NACK_FLOW_PDU 
SELECT_ACK_PDU 
SELECT_NACK_PDU 
SELECT_ACK_FLOW_PDU 
SELECT_NACK_FLOW_PDU 
RENDEZVOUS_PDU 

Definition at line 59 of file PDU_m.h.

Enum generated from Common/PDU.msg:68 by nedtool.

enum PDUTypeBits
{

PDU_ACK_BIT = 0x01;
PDU_NACK_BIT = 0x02;
PDU_FC_BIT = 0x04;
PDU_SEL_BIT = 0x08;

}

Enumerator
PDU_ACK_BIT 
PDU_NACK_BIT 
PDU_FC_BIT 
PDU_SEL_BIT 

Definition at line 88 of file PDU_m.h.