SIB1 optional parameters, Cell start request, stop request and slot indication
[o-du/l2.git] / src / cm / legtp.h
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18  
19 /* Defines API exchanged between DU_APP and EGTP */
20 #ifndef __LEGTP_H___
21 #define __LEGTP_H___
22
23 #include "gen.h"
24
25 #include "gen.x"
26
27 #define EGTP_TNL_MGMT_ADD 1
28 #define EGTP_TNL_MGMT_MOD 2
29 #define EGTP_TNL_MGMT_DEL 3
30
31 typedef enum egtpMsgType
32 {
33    EGTP_MSG_INVALID,         
34    EGTPU_MSG_ECHO_REQ,          
35    EGTPU_MSG_ECHO_RSP, 
36    EGTPU_MSG_ERROR_IND          = 26,
37    EGTPU_MSG_SUPP_EXT_HDR_NTF   = 31,
38    EGTPU_MSG_END_MARKER         = 254,
39    EGTPU_MSG_GPDU,
40    EGTP_MSG_MAX
41 }EgtpMsgType;
42
43 typedef struct egtpIpAddr
44 {
45    Bool ipV4Pres;
46    U32  ipV4Addr;
47 }EgtpIpAddr;
48
49 typedef struct egtpConfig
50 {
51    EgtpIpAddr  localIp;
52    U16         localPort;
53    EgtpIpAddr  destIp;
54    U16         destPort;
55    U32       minTunnelId;
56    U32       maxTunnelId;
57 }EgtpConfig;
58
59 typedef struct egtpTnlEvt
60 {
61    U8        action;
62    U32       lclTeid;
63    U32       remTeid;
64    CmStatus  cfmStatus;
65 }EgtpTnlEvt;
66
67 /*Extension Header */
68 typedef struct egtpExtHdr
69 {
70    TknU16   udpPort;                       /**< UDP Port */
71    TknU16   pdcpNmb;                       /**< PDCP Number */
72 }EgtpExtHdr;
73
74 /*Structure for MsgHdr */
75 typedef struct egtpMsgHdr
76 {
77    TknU8      nPdu;                      /**< N-PDU Number */
78    TknU32     seqNum;                    /**< Sequence Number */
79    EgtpExtHdr extHdr;                       /**< Extension headers present flag */
80    U32        teId;                         /**< Tunnel Endpoint Id */
81    U8         msgType;                      /**< eGTP-U Message Type */
82 }EgtpMsgHdr;
83
84 typedef struct egtpMsg
85 {
86    EgtpMsgHdr msgHdr;
87    Buffer     *msg;
88 }EgtpMsg;
89
90 typedef S16 (*EgtpCfgReq) ARGS((Pst *pst, EgtpConfig egtpCfg));
91 typedef S16 (*EgtpCfgCfm) ARGS((CmStatus cfm));
92 typedef S16 (*EgtpInitReq) ARGS((Buffer *mBuf));
93 typedef S16 (*EgtpSrvOpenReq) ARGS(());
94 typedef S16 (*EgtpSrvOpenCfm) ARGS((CmStatus cfm));
95 typedef S16 (*EgtpTnlMgmtReq) ARGS((Pst *pst, EgtpTnlEvt tnlEvt));
96 typedef S16 (*EgtpTnlMgmtCfm) ARGS((EgtpTnlEvt tnlEvt));
97 typedef S16 (*EgtpSlotInd) ARGS(());
98   
99 S16 packEgtpCfgReq(Pst *pst, EgtpConfig  egtpCfg);
100 S16 unpackEgtpCfgReq(EgtpCfgReq func , Pst *pst, Buffer *mBuf);
101 S16 packEgtpCfgCfm(Pst *pst, CmStatus cfm);
102 S16 unpackEgtpCfgCfm(EgtpCfgCfm func, Buffer *mBuf);
103 S16 packEgtpSrvOpenReq(Pst *pst);
104 S16 unpackkEgtpSrvOpenReq(EgtpSrvOpenReq func, Pst *pst, Buffer *mBuf);
105 S16 packEgtpSrvOpenCfm(Pst *pst, CmStatus cfm);
106 S16 unpackEgtpSrvOpenCfm(EgtpSrvOpenCfm func, Buffer *mBuf);
107 S16 packEgtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt);
108 S16 unpackEgtpTnlMgmtReq(EgtpTnlMgmtReq func, Pst *pst, Buffer *mBuf);
109 S16 packEgtpTnlMgmtCfm(Pst *pst, EgtpTnlEvt tnlEvt);
110 S16 unpackEgtpTnlMgmtCfm(EgtpTnlMgmtCfm func, Buffer *mBuf);
111 S16 packEgtpSlotInd(Pst *pst);
112 S16 unpackEgtpSlotInd(EgtpSlotInd func, Pst *pst, Buffer *mBuf);
113
114 #endif