[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-420] GNB-DU Configuration Query and response
[o-du/l2.git] / src / cu_stub / cu_f1ap_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 F1AP message handler related functionality */
20 #define ENCODE_FAIL -1
21 #define TRANS_ID 1
22 #define RRC_SIZE 1
23 #define SUL_BAND_COUNT 0
24 #define UL_SRBID        1
25 #define DL_SRBID        0
26 #define DU_ID           1
27 #define CU_ID           1
28 #define CRNTI           17017
29 #define CELL_INDEX      0
30 #define SRB0 0
31 #define SRB1 1
32 #define SRB2 2
33 #define DRB1 1
34 #define DRB2 2
35 #define DRB3 3
36 #define QCI  9
37 #define MAX_DRB_SET_UE_CONTEXT_SETUP_REQ 2  /*Number of DRBs to be added using UE CONTEXT SETUP procedure*/
38 #define MAX_DRB_SET_UE_CONTEXT_MOD_REQ 1     /*Number of DRBs to be added/setup via UE CONTEXT MODIFICATION procedure*/
39 #define MAX_DRB_MODIFIED_UE_MOD_REQ 1        /*Currently CU trigger Modification of 2DRBs*/
40 #define DRB_ID_TO_ADD_MOD MAX_DRB_SET_UE_CONTEXT_SETUP_REQ+1 /*The DRB ID: which will be added using Modification Procedure*/
41
42 /*Total num of DRBs added using UE COntext Setup and Modification procedures*/
43 #define MAX_NUM_DRB_ADDED_PER_UE (MAX_DRB_SET_UE_CONTEXT_SETUP_REQ + MAX_DRB_SET_UE_CONTEXT_MOD_REQ)
44
45 #define CU_UE_F1AP_ID 0
46 #define DU_UE_F1AP_ID 1
47 #define SP_CELL_ID     2
48 #define SERV_CELL_IDX 3
49 #define CU_TO_DU_RRC_INF 4
50 #define NUM_QOS_EXT 1
51
52 typedef enum
53 {
54    RRC_SETUP=1,
55    REGISTRATION_ACCEPT,
56    UE_CONTEXT_SETUP_REQ,
57    UE_CONTEXT_SETUP_RSP,
58    SECURITY_MODE_COMPLETE,
59    RRC_RECONFIG,
60    RRC_RECONFIG_COMPLETE,
61    UE_CONTEXT_MOD_REQ
62 }RrcMsgType;
63
64 /* Defines action to be performed via UE Context Modification request */
65 typedef enum
66 {
67    MODIFY_UE,        /* Modify UE configuration at DU */
68    QUERY_CONFIG,     /* Query DU for its configurations */
69    STOP_DATA_TX      /* Stop data transmission from DU to a particular UE */
70 }UeCtxtModAction;
71
72 typedef struct f1apDb
73 {
74    uint8_t dlRrcMsgCount;
75    OCTET_STRING_t duToCuContainer;
76 }F1apMsgDb;
77   
78 void F1APMsgHdlr(uint32_t *destDuId, Buffer *mBuf);
79 uint8_t BuildAndSendUeContextModificationReq(uint32_t duId, void *ueCb, UeCtxtModAction action);
80 uint8_t BuildAndSendUeContextReleaseCommand(uint32_t duId, uint8_t cuUeF1apId, uint8_t duUeF1apId);
81 uint8_t BuildAndSendF1ResetReq();
82 /**********************************************************************
83          End of file
84 **********************************************************************/