78910865598f5e8e42b9fcc5553c9793d3a0ab15
[o-du/l2.git] / src / ric_stub / ric_e2ap_msg_hdl.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 /* This file contains all E2AP message handler related functionality */
20 #include<stdio.h>
21 #include<sys/types.h>
22 #include<string.h>
23 #include<ProtocolIE-FieldE2.h>
24 #include "E2AP-PDU.h"
25
26 #include "envopt.h"        /* Environment options */
27 #include "envdep.h"        /* Environment dependent */
28 #include "envind.h"        /* Environment independent */
29 #include "gen.h"           /* General */
30 #include "ssi.h"           /* System services */
31 #include "ss_queue.h"
32 #include "ss_task.h"
33 #include "ss_msg.h"
34
35 #include "gen.x"           /* General */
36 #include "ssi.x"   /* System services */
37 #include "ss_queue.x"
38 #include "ss_task.x"
39 #include "ss_msg.x"
40
41 #include "du_log.h"
42
43 #define ENCODE_FAIL -1
44 #define TRANS_ID 1
45 #define RRC_SIZE 1
46 #define ENC_BUF_MAX_LEN 100
47 #define SUL_BAND_COUNT 0
48 #define UL_SRBID        1
49 #define DL_SRBID        0
50 #define DU_ID           1
51 #define RIC_ID           1
52 #define CRNTI           17017
53 #define CELL_INDEX      0
54
55
56 /* allocate and zero out a static buffer */
57 #define RIC_ALLOC(_datPtr, _size)                                \
58 {                                                               \
59    S16 _ret;                                                    \
60    _ret = SGetSBuf(RIC_APP_MEM_REG, RIC_POOL,                  \
61                     (Data **)&_datPtr, _size);                  \
62    if(_ret == ROK)                                              \
63       cmMemset((U8*)_datPtr, 0, _size);                         \
64    else                                                         \
65       _datPtr = NULLP;                                          \
66 }
67
68 /* free a static buffer */
69 #define RIC_FREE(_datPtr, _size)                                 \
70    if(_datPtr)                                                  \
71       SPutSBuf(RIC_APP_MEM_REG, RIC_POOL,                      \
72          (Data *)_datPtr, _size);
73
74
75
76 extern char encBuf[ENC_BUF_MAX_LEN];
77 int  encBufSize;
78
79 void E2APMsgHdlr(Buffer *mBuf);
80 S16 BuildAndSendE2SetupReq();
81
82 /**********************************************************************
83          End of file
84 **********************************************************************/