Modify licenses
[scp/ocu/5gnr.git] / Include / cuCommon.h
1 /******************************************************************************
2 *
3 *   Copyright (c) 2020 ICT/CAS.
4 *
5 *   Licensed under the O-RAN Software License, Version 1.0 (the "Software 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 *       https://www.o-ran.org/software
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 #ifndef _CU_COMMON_H_
20 #define _CU_COMMON_H_
21
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 #include <netinet/in.h>
27 #include "gnbCommon.h"
28
29 #define MAX_CU_NAME_LEN   256
30 #define MAX_CUCP_NAME_LEN 256
31 #define MAX_CUUP_NAME_LEN 256
32
33 #define MAX_OM_MSG_BUF_LEN      64
34
35 /****************************************oam active message code****************************************/
36 #define         OAM_CU_ACTIVE_BASE                                      0x7000
37 #define         OAM_CUUP_NET_ELEMENT_ACTIVE_REQ                 OAM_CU_ACTIVE_BASE + 1
38 #define         OAM_CUCP_NET_ELEMENT_ACTIVE_REQ         OAM_CU_ACTIVE_BASE + 2
39 #define         CUCP_OAM_CELL_ACTIVE_RSP                        OAM_CU_ACTIVE_BASE + 3
40 #define         CUUP_OAM_CELL_ACTIVE_RSP                        OAM_CU_ACTIVE_BASE + 3
41
42 typedef enum
43 {
44     MODULE_OM,
45     MODULE_CUCP_E1,
46     MODULE_CUUP_E1  ,
47     MODULE_NG,
48     MODULE_Xn,
49     MODULE_F1_C,
50     MODULE_CUC,
51     MODULE_RRC,
52     MODULE_PDCP_C,
53     MODULE_UPC,
54     MODULE_NG_U,
55     MODULE_NG_GTPU,
56     MODULE_SDAP,
57     MODULE_F1_U,
58     MODULE_F1_GTPU,
59
60 }CuModule_e;
61
62
63
64 typedef enum CuCpVosTask
65 {
66     CUCP_OMADP_VOS_TASK,
67     CUC_VOS_TASK,
68     CUCP_NG_C_VOS_TASK,
69     CUCP_F1_C_VOS_TASK,
70     CUCP_E1_VOS_TASK,
71 #ifdef AMF_TEST
72     AMF_VOS_TASK,
73 #endif
74         CP_MAX_VOS_TASK
75 }CuCpVosTask_e;
76
77 typedef enum CuUpVosTask
78 {
79     UP_OMADP_VOS_TASK,
80         UP_DL_VOS_TASK,
81         UP_UL_VOS_TASK,
82         UP_GTPU_VOS_TASK,
83         UP_MAX_VOS_TASK
84 }CuUpVosTask_e;
85
86 typedef enum
87 {
88     CUCP_HOST_TASK,
89     CUUP_HOST_TASK,
90     CUUP_DATA_HOST_TASK
91 }CuHostTask_e;
92
93 typedef enum
94 {
95 #if 0
96     CUC_USER_TASK,
97     CUCP_NG_C_USER_TASK,
98     CUCP_F1_C_USER_TASK,
99     CUCP_E1_USER_TASK,
100 #endif
101     /*注意:请新增任务定义在注释中间*/
102
103
104
105
106     /*注意:请新增任务定义在注释中间*/
107     CUCP_END_USER_TASK = 100
108 }CucpUserTask_e;
109
110 typedef enum
111 {
112     CUUP_BEGIN_USER_TASK=200,
113     CUUP_UPC_USER_TASK,
114     CUUP_E1_USER_TASK,
115     CUUP_NGGTPU_DL_TASK,
116     CUUP_NGU_DL_TASK,
117     CUUP_SDAP_DL_TASK,
118     CUUP_PDCPU_DL_TASK,
119     CUUP_F1U_DL_TASK,
120     CUUP_F1GTPU_DL_TASK,
121
122     CUUP_NGGTPU_UL_TASK,
123     CUUP_NGU_UL_TASK,
124     CUUP_SDAP_UL_TASK,
125     CUUP_PDCPU_UL_TASK,
126     CUUP_F1U_UL_TASK,
127     CUUP_F1GTPU_UL_TASK,
128     /*注意:请新增任务定义在注释中间*/
129     CUUP_GTPU_USER_TASK,
130     CUUP_PDCPU_USER_TASK,
131     CUUP_SDAP_USER_TASK,
132
133
134     /*注意:请新增任务定义在注释中间*/
135     CUUP_END_USER_TASK=400,
136 }CuupUserTask_e;
137
138
139 typedef struct
140 {
141     UINT8 cuName[MAX_CU_NAME_LEN];  /* CU Name */
142     UINT32 nodeID;
143     IpAddress_t cuIpAddr;
144     IpAddress_t omIpAddr;
145
146     IpAddress_t amfIpAddr;
147     IpAddress_t umfIpAddr;
148
149     IpAddress_t cucpF1SctpIpAddr;
150     IpAddress_t cuupF1GtpuIpAddr;
151
152     IpAddress_t duF1SctpIpAddr;
153     IpAddress_t duF1GtpuIpAddr;
154
155     IpAddress_t cucpE1SctpIpAddr;
156     IpAddress_t cuupE1SctpIpAddr;
157
158     IpAddress_t cucpNgSctpIpAddr;
159     IpAddress_t cuupNgGtpuIpAddr;
160
161     IpAddress_t cuXnSctpIpAddr;
162 }CuCommCfg_t;
163
164 typedef struct
165 {
166     UINT8   NodeBName[MAX_CU_NAME_LEN];
167     UINT32 procId;
168     UserTaskInfo_t  userTaskInfo[MAX_TASK_NUM];
169     CuCommCfg_t commCfg;
170     UINT8  cuStackState;
171     UINT8  omState;
172
173     UINT8  printDebug;
174     UINT8  printLevel;
175     UINT8  interLogFlag;
176
177 } CuCtrlBlock_t;
178
179 typedef struct
180 {
181         PlmnId_t        plmnId;
182         NrCellId_t  CellId[MAX_CELL_NUM];
183 }CellIdList_t;
184
185 typedef struct oamCuUpNetElementActReq
186 {
187         UINT8           actCellNum;
188         CellIdList_t    cellIdList;
189 } OamCuUpNetElementActReq_t;
190
191 typedef struct oamCuUpCellActRsp
192 {
193         UINT8           successCellNum;
194         UINT8           failCellNum;
195         NrCellId_t      failCellId[MAX_CELL_NUM];
196 } OamCuUpCellActRsp_t;
197
198 typedef struct oamCuCpNetElementActReq
199 {
200         UINT8           cuCpNetElementAct[MAX_CELL_NUM];
201 } OamCuCpNetElementActReq_t;
202
203 typedef struct oamCuCpCellActRsp
204 {
205         UINT8           cuCpCellActFlag[MAX_CELL_NUM];
206 } OamCuCpCellActRsp_t;
207
208 typedef enum
209 {
210         SRB0 =0 ,
211         SRB1 = 1,
212         SRB2 = 2,
213         SRB3 = 3,
214
215 }SRB_e;
216
217
218
219
220
221 #ifdef __cplusplus
222 }
223 #endif
224
225 #endif  /* _CU_COMMON_H_*/