[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-414] Support at CU and RIC stub for SCTP...
[o-du/l2.git] / src / cu_stub / cu_stub_egtp.h
index 02b11d4..0ca75fc 100644 (file)
 #ifndef __CU_STUB_EGTP_H__
 #define __CU_STUB_EGTP_H__
 
-#include "cu_stub.h"
-#include "cm_inet.h"
-#include "cm_tpt.h"
-#include "cm_inet.x"
-#include "cm_tpt.x"
-
 #define EGTP_DFLT_PORT 2152
 #define EGTP_TNL_MGMT_ADD 1
 #define EGTP_TNL_MGMT_MOD 2
 #define EGTP_MASK_BIT7                   0x40
 #define EGTP_MASK_BIT8                   0x80
 
+/*VALID Tunnel ID*/
+#define MIN_TEID 1   /*[Spec 29.281,Sec 5.1]: All Zero TEIDs are never assigned for setting up GTP-U Tunnel*/
+#define MAX_TEID MAX_NUM_DRB * MAX_NUM_UE /*[Spec 29.281]: Max limit is not mentioned but as per GTP-U Header Format, TEID occupies 4 octets */
+
+#define NUM_TUNNEL_TO_PUMP_DATA 9
+#define NUM_DL_PACKETS 1
+
 uint8_t         sockType;
 uint8_t         protType;
 
@@ -118,11 +118,23 @@ typedef struct egtpDstCb
    CmHashListCp  teIdLst;        /* Tunnel Id list for this destination */
 }EgtpDstCb;
 
+typedef struct egtpParams
+{
+   SctpIpAddr  localIp;
+   uint16_t    localPort;
+   SctpIpAddr  destIp;
+   uint16_t    destPort;
+   uint32_t    currTunnelId;
+   uint32_t    minTunnelId;
+   uint32_t    maxTunnelId;
+}EgtpParams;
+
 typedef struct egtpGlobalCb
 {
    EgtpParams   egtpCfg;         /* EGTP configuration */
    EgtpTptSrvr  recvTptSrvr;     /* Transport server for receiving UDP msg */
    EgtpDstCb    dstCb;           /* Destination endpoint */
+   uint8_t      gCntPdu[MAX_TEID+1]; /* Maintaining PDU count for each bearer */
 }EgtpGlobalCb;
 EgtpGlobalCb egtpCb;   /* EGTP global control block */
 
@@ -135,7 +147,7 @@ S16 cuEgtpTnlMod(EgtpTnlEvt tnlEvt);
 S16 cuEgtpTnlDel(EgtpTnlEvt tnlEvt);
 S16 cuEgtpEncodeHdr(uint8_t *preEncodedHdr, EgtpMsgHdr *preDefHdr, uint8_t *hdrIdx);
 S16 cuEgtpHdlRecvMsg(Buffer *mBuf);
-S16 cuEgtpDatReq();
+uint16_t cuEgtpDatReq(uint8_t teId);
 S16 BuildAppMsg(EgtpMsg  *egtpMsg);
 S16 BuildEgtpMsg(EgtpMsg *egtpMsg);
 S16 cuEgtpSendMsg(Buffer *mBuf);