E2AP review changes part1
[o-du/l2.git] / src / du_app / du_cfg.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 #ifndef __DU_CONFIG_H_
20 #define __DU_CONFIG_H__
21
22 #include "du_mgr.h"
23 #include "du_app_mac_inf.h"
24 #include "du_log.h"
25 #include "BIT_STRING.h"
26
27 /* MACROS */
28 #define DU_INST 0
29 #define DU_ID 1
30 #define DU_IP_V4_ADDR "10.0.2.20"
31 #define CU_IP_V4_ADDR "10.0.2.25"
32 #define RIC_IP_V4_ADDR "10.0.2.30"
33 #define DU_PORT 38472
34 #define CU_PORT 38472
35 #define RIC_PORT 38482
36 #define DU_EGTP_PORT  39001
37 #define CU_EGTP_PORT  39002
38 #define NR_PCI 1
39 #define NR_CELL_ID 1
40 #define DU_NAME "ORAN_OAM_DU"
41 #define CELL_TYPE SMALL
42 #define DUPLEX_MODE DUP_MODE_TDD
43 #define DU_TAC 1
44 #define PLMN_MCC0 3
45 #define PLMN_MCC1 1
46 #define PLMN_MCC2 1
47 #define PLMN_MNC0 4
48 #define PLMN_MNC1 8
49 #define PLMN_MNC2 0
50 #define NR_ARFCN  2079427
51 #define SUL_ARFCN 100
52 #define NR_FREQ_BAND 257
53 #define SUL_BAND 2
54 #define TIME_CFG 0
55 #define CARRIER_IDX 1
56 #define NUM_TX_ANT 2
57 #define NUM_RX_ANT 2
58 #define FREQ_SHIFT_7P5KHZ FALSE
59 #define SSB_PBCH_PWR 0
60 #define BCH_PAYLOAD MAC_GEN_FULL_PBCH_PAYLD
61 #define SUBCARRIER_SPACING 3
62 #define PRB_OFFSET 0
63 #define BETA_PSS BETA_PSS_0DB
64 #define SSB_PERIODICITTY SSB_PRDCTY_MS_20
65 #define SSB_SUBCARRIER_OFFSET 0
66 #define SSB_MULT_CARRIER_BAND FALSE
67 #define MULT_CELL_CARRIER FALSE
68
69 #define PRACH_SEQ_LEN SHORT_SEQUENCE
70 #define PRACH_SUBCARRIER_SPACING 3
71 #define PRACH_RESTRICTED_SET_CFG UNRESTRICTED
72 #define NUM_PRACH_FDM 1
73 #define ROOT_SEQ_IDX 0
74 #define NUM_ROOT_SEQ 1
75 #define ZERO_CORRELATION_ZONE_CFG 2
76 #define NUM_UNUSED_ROOT_SEQ 1
77 #define UNUSED_ROOT_SEQ 1
78 #define SSB_PER_RACH 3
79 #define PRACH_MULT_CARRIER_BAND FALSE
80 #define TDD_PERIODICITY TX_PRDCTY_MS_2P5
81 #define RSS_MEASUREMENT_UNIT DONT_REPORT_RSSI
82
83 #define DU_PROC  0
84 #define DU_INST 0
85 #define DU_POOL  1
86 #define MAX_DU_PORT 2
87 #define F1_INTERFACE 0
88 #define E2_INTERFACE 1
89
90 #define SCTP_INST 0
91 #define EGTP_INST 0
92
93 /* Events */
94 #define EVTCFG 0
95
96 /* Selector */
97 #define DU_SELECTOR_LC   0
98 #define DU_SELECTOR_TC   1
99 #define DU_SELECTOR_LWLC 2
100
101 #ifdef EGTP_TEST
102 /* Macro definitions for EGTP procedures */
103 #define EGTP_LCL_TEID 1     /* EGTP local tunnel id */
104 #define EGTP_REM_TEID 10    /* EGTP remote tinnel id */
105 #endif
106
107
108 /* Macro definitions for F1 procedures */
109 #define CU_DU_NAME_LEN_MAX 30      /* Max length of CU/DU name string */
110 #define MAX_F1_CONNECTIONS 65536    /* Max num of F1 connections */
111 #define DU_MAX_CELLS       512      /* Max num of cells served by gNB-DU */
112 #define MAX_PLMN           6        /* Max num of broadcast PLMN ids */
113 #define MAXNRARFCN         3279165  /* Maximum values of NRAFCN */
114 #define MAXNRCELLBANDS     2       /* Maximum number of frequency bands */
115 #define MAXNUMOFSLICEITEMS 1024     /* Maximum number of signalled slice support items */
116 #define MAXBPLMNNRMINUS1   1       /* Maximum number of PLMN Ids broadcast in an NR cell minus 1 */
117 #define MAXNUMOFSIBTYPES   32       /* Maximum number of SIB types */
118 #define MAX_UEID           512      /* Maximum number of UE Ids */
119 #define MAX_TNL_ASSOC      32       /* Max num of TNL Assoc between CU and DU */
120 #define MAXCELLINENB       256      /* Max num of cells served by eNB */
121 #define MAXNUMOFUEID       65536    /* Max num of UEs served by DU */
122 #define MAXNUMOFUACPLMN    12       /* Maximum number of PLMN ids*/
123 #define MAXNUMOFUACPERPLMN 64       /* Maximum number of signalled categories per PLMN */
124 #define DEFAULT_CELLS      1        /* Max num of broadcast PLMN ids */
125
126
127 /* Macro definitions for MIB/SIB1 */
128 #define SYS_FRAME_NUM 0
129 #define SPARE 0
130 #define SSB_SC_OFFSET 8
131 #define CORESET_ZERO 1
132 #define SEARCH_SPACE_ZERO 8
133 #define DU_RANAC 1
134 #define CELL_IDENTITY 1
135
136
137 typedef enum
138 {
139    GNBDU,
140    GNBCU 
141 }F1Entity;
142
143 typedef enum
144 {
145    UNSPECIFIED,
146    RL_FAILURE_RLC,
147    INVALID_CU_UE_F1AP_ID,
148    INVALID_DU_UE_F1AP_ID,
149    INTERACTION_WITH_OTHER_PROC,
150    INVALID_QCI_VALUE,
151    RADIO_RELATED_REASON,
152    INSUFFICIENT_RADIO_RESOURCE,
153    PROCEDURE_CANCELLED,
154    NORMAL_RELEASE,
155    UNAVAILABLE_CELL,
156    RL_FAILURE_OTHERS,
157    UE_ACCESS_REJECTED,
158    SLICE_RESOURCE_UNAVAILABLE,
159    AMF_ABNORMAL_RELEASE,
160    INVALID_PLMN
161 }RadioNwCause;
162
163 typedef enum
164 {
165    TRANS_CAUSE_UNSPECIFIED,
166    TRANSPORT_RESOURCE_UNAVAIL
167 }TransLayerCause;
168
169 typedef enum
170 {
171    TRANSFER_SYNTAX_ERR,
172    ABSTRACT_SYNTAX_ERR_REJECT,
173    ABSTRACT_SYNTAX_ERR_NOTIFY,
174    INCOMPATIBLE_MESSAGE,
175    SEMANTIC_ERROR,
176    ABSTRACT_SYNTAX_ERR_MSG_CONSTRUCT,
177    PROTOCOL_CAUSE_UNSPECIFIED
178 }ProtocolCause;
179
180 typedef enum
181 {
182    CONTROL_PROC_OVERLOAD,
183    INSUFF_USER_PLANE_RESOURCE,
184    HARDWARE_FAILURE,
185    O_AND_M_INTERVENTION,
186    MISC_CAUSE_UNSPECIFIED
187 }MiscCause;
188
189 typedef enum
190 {
191   ALL
192 }F1ResetAll;
193
194 typedef enum 
195 {
196   IN_SERVICE,
197   OUT_OF_SERVICE
198 }SrvState;
199
200 typedef enum
201 {
202    INITIATING_MSG,
203    SUCCESSFUL_OUTCOME,
204    UNSUCCESSFUL_OUTCOME
205 }F1TriggMsgVal;
206
207 typedef enum
208 {
209    CRIT_REJECT,
210    CRIT_IGNORE,
211    CRIT_NOTIFY
212 }F1ProcCritVal;
213
214 typedef enum
215 {
216    NOT_UNDERSTOOD,
217    MISSING_IE
218 }F1ErrorType;
219
220 typedef enum
221 {
222    SCS_15,
223    SCS_30,
224    SCS_60,
225    SCS_120
226 }F1NrScs;
227
228 typedef enum
229 {
230    NRB_11,
231    NRB_18,
232    NRB_24,
233    NRB_25,
234    NRB_31,
235    NRB_32,
236    NRB_38,
237    NRB_51,
238    NRB_52,
239    NRB_65,
240    NRB_66,
241    NRB_78,
242    NRB_79,
243    NRB_93,
244    NRB_106,
245    NRB_107,
246    NRB_121,
247    NRB_132,
248    NRB_133,
249    NRB_135,
250    NRB_160,
251    NRB_162,
252    NRB_189,
253    NRB_216,
254    NRB_217,
255    NRB_245,
256    NRB_264,
257    NRB_270,
258    NRB_273
259 }F1Nrb;
260
261 typedef enum
262 {
263    VERY_SMALL,
264    SMALL,
265    MEDIUM,
266    LARGE
267 }F1CellType;
268
269 typedef enum
270 {
271    DL,
272    UL,
273    DL_UL
274 }F1CellDir;
275
276 typedef enum
277 {
278    UE_USAGE,
279    NON_UE_USAGE,
280    BOTH
281 }F1AssocUsage;
282
283 typedef enum
284 {
285    BARRED,
286    NOT_BARRED
287 }CellBarred;
288
289 typedef enum
290 {
291    OFFER,
292    EXECUTION
293 }F1ReqType;
294
295 typedef enum
296 {
297    IGNORE_YES,
298    IGNORE_NO
299 }F1IgnoreReq;
300
301 typedef enum
302 {
303    OVERLOADED,
304    NOT_OVERLOADED
305 }F1GnbDuOvrloadInfo;
306
307 typedef enum
308 {
309    REJECT_RRC_CONN_NON_EMERG_MODT,
310    REJECT_RRC_CONN_SIGNALLING,
311    PERMIT_EMERG_SESSION_AND_MOBILE_TERM_SERVICE,
312    PERMIT_HIGH_PRIOR_SESSION_AND_MOBILE_TERM_SERVICE
313 }F1UacStandardAction;
314
315 typedef struct f1RrcVersion
316 {
317    char    rrcVer[30];     /* Latest RRC Version */
318    U32   extRrcVer;  /* Latest RRC version extended */
319 }F1RrcVersion;
320
321 typedef struct f1FailCause
322 {
323    union
324    {
325       RadioNwCause      radioNwCause;     /* Radio Network Layer Cause */
326       TransLayerCause   transLayerCause;  /* Transport Layer Cause */
327       ProtocolCause     protCause;        /* Protocol Cause */
328       MiscCause         miscCause;        /* Miscellaneous Cause */
329    }cause;
330 }F1FailCause;
331
332 typedef struct f1ProcCode
333 {
334    Bool   pres;
335    U8     value;
336 }F1ProcCode;
337
338 typedef struct f1TriggMsg
339 {
340    Bool   pres;
341    F1TriggMsgVal   value;
342 }F1TriggMsg;
343
344 typedef struct f1ProcCrit
345 {
346    Bool   pres;
347    F1ProcCritVal   value;
348 }F1ProcCrit;
349
350 typedef struct f1CritDignosIE
351 {
352    F1ProcCritVal   ieCritVal;
353    U16             ieId;
354    F1ErrorType       type;
355 }F1CritDignosIE;
356
357 typedef struct f1CritDiagnostic
358 {
359    Bool         pres;
360    F1ProcCode   procCode;      /* Procedure Code */
361    F1TriggMsg   triggeringMsg; /* Triggering Message */
362    F1ProcCrit   procCrit;      /* Criticality of Triggering msg/proc */
363    U32          transId;
364    F1CritDignosIE diagnosIE;
365 }F1CritDiagnostic;
366
367 typedef struct f1FailureIE
368 {
369    U32                transId;        /* Uniquely identify transaction */
370    F1FailCause        cause;          /* Failure cause */
371    U8                 timeToWait;     /* Seconds to be waited before retry */
372    F1CritDiagnostic   critDiagnostic; /* Critical diagnostics */
373 }F1FailureIE;
374
375 typedef struct f1LogicalConnUeAssoc
376 {
377    U32   gnbCuUeF1apId;
378    U32   gnbDuUeF1apId;
379 }F1LogicalConnUeAssoc;
380
381 typedef struct f1ResetType
382 {
383    union
384    {
385       F1ResetAll             resetAll; /* Reset All */
386       F1LogicalConnUeAssoc   ueAssocLogicalConn[MAX_F1_CONNECTIONS]; /* In case of Partial Reset : UE associated logical F1 conn list*/
387    }type;
388 }F1ResetType;
389
390 typedef struct f1PLMN
391 {
392   U8 mcc[3];
393   U8 mnc[3];
394 }PlmnId;
395
396 typedef struct nrEcgi
397 {
398   PlmnId  plmn;
399   U16     cellId;
400 }NrEcgi;
401
402 typedef struct f1SibType
403 {
404    U8   sibType;
405    U8   sibMsg;
406    U8   value;
407 }F1SibType;
408
409 typedef struct f1TxBw
410 {
411    F1NrScs   nrScs; /* NR subcarrier spacing */
412    F1Nrb     nrb;   /* Transmission bandwidth expressed in units of RBs */
413 }F1TxBw;
414
415 typedef struct f1SulInfo
416 {
417    U32      sulArfcn; /* SUL ARFCN */
418    F1TxBw   sulTxBw;  /* SUL transmission bandwidth */ 
419 }F1SulInfo;
420
421 typedef struct f1FreqBand
422 {
423   U16   nrFreqBand;
424   U16   sulBand[MAXNRCELLBANDS];
425 }F1FreqBand;
426
427 typedef struct f1NrFreqInfo
428 {
429    U32        nrArfcn;
430    F1SulInfo  sulInfo;
431    F1FreqBand freqBand[MAXNRCELLBANDS];
432 }F1NrFreqInfo;
433
434 typedef struct f1NrFddInfo
435 {
436    F1NrFreqInfo   ulNrFreqInfo;  /* UL NR Frequency Info */
437    F1NrFreqInfo   dlNrFreqInfo;  /* DL NR Frequency Info */
438    F1TxBw         ulTxBw;        /* UL Transmission bandwidth */
439    F1TxBw         dlTxBw;        /* DL Transmission bandwidth */
440 }F1NrFddInfo;
441
442 typedef struct f1NrTddInfo
443 {
444    F1NrFreqInfo   nrFreqInfo;   /* NR Frequency Info */
445    F1TxBw       nrTxBw;       /* NR Transmission Bandwidth */
446 }F1NrTddInfo;
447
448 typedef struct f1NrModeInfo
449 {
450    union
451    {
452       F1NrFddInfo  fdd;
453       F1NrTddInfo  tdd;
454    }mode;
455 }NrModeInfo;
456
457 typedef struct f1EutraFddInfo
458 {
459    U16   ulOffset;   /* UL offset to Point A */
460    U16   dlOffset;   /* DL offset to Point A */
461 }F1EutraFDDInfo;
462
463 typedef struct f1EutraTddInfo
464 {
465    U16   tddOffset;  /* Offset to Point A */
466 }F1EutraTDDInfo;
467
468 typedef struct f1EutraModeInfo
469 {
470    union
471    {
472       F1EutraFDDInfo  fdd;
473       F1EutraTDDInfo  tdd;
474    }mode;
475 }F1EutraModeInfo;
476
477 typedef struct f1Snsaai
478 {
479    U8   sst;
480    U32  sd;
481 }F1Snsaai;
482
483 typedef struct epIpAddr
484 {
485    char transportAddr[20]; /* Transport Layer Address */
486 }EpIpAddr;
487
488 typedef struct epIpAddrPort
489 {
490     EpIpAddr epIpAddr;
491     char   port[2];
492 }EpIpAddrPort;
493
494 typedef struct f1TaiSliceSuppLst
495 {
496    Bool       pres;
497    F1Snsaai   snssai[MAXNUMOFSLICEITEMS];   
498 }F1TaiSliceSuppLst;
499
500 typedef struct f1SrvdPlmn
501 {
502    PlmnId              plmn;
503    F1TaiSliceSuppLst   taiSliceSuppLst;
504 }F1SrvdPlmn;
505
506 typedef struct f1BrdcstPlmnInfo
507 {
508    PlmnId   plmn[MAX_PLMN];     /* PLMN id list */
509    PlmnId   extPlmn[MAX_PLMN];   /* Extended PLMN id list */
510    U16      tac;                     /* 5GS-TAC */
511    U32      nrCellId;                /* NR Cell id */
512    U8       ranac;                   /* RAN Area code */
513 }F1BrdcstPlmnInfo;
514
515 typedef struct f1CellInfo
516 {
517    NrEcgi   nrCgi;                   /* Cell global Identity */
518    U32      nrPci;                   /* Physical Cell Identity */
519    PlmnId   plmn[MAX_PLMN];     /* Available PLMN list */
520    PlmnId   extPlmn[MAX_PLMN];  /* Extended available PLMN list */
521 }F1CellInfo;
522
523 typedef struct f1DuCellInfo
524 {
525    F1CellInfo         cellInfo;     /* cell info */
526    U16                tac;          /* tracking area code */
527    U16                epsTac;       /* Configured EPS TAC */
528    NrModeInfo         f1Mode;       /* NR mode info : FDD/TDD */
529    U8                 measTimeCfg;  /* Measurement timing configuration */
530    F1CellDir          cellDir;      /* Cell Direction */
531    F1CellType         cellType;     /* Cell Type */
532    F1BrdcstPlmnInfo   brdcstPlmnInfo[MAXBPLMNNRMINUS1]; /* Broadcast PLMN Identity Info List */
533 }F1DuCellInfo;
534
535 typedef struct f1DuSysInfo
536 {
537    U8   *mibMsg;   /* MIB message */
538    U8   *sib1Msg;  /* SIB1 message */
539 }F1DuSysInfo;
540
541 typedef struct f1CuSysInfo
542 {
543    F1SibType   sibTypeToUpd[MAXNUMOFSIBTYPES];   /* SIB types to be updated */
544 }F1CuSysInfo;
545
546 typedef struct f1DuSrvdCellInfo
547 {
548    F1DuCellInfo   duCellInfo;   /* gNB-DU served cell info */
549    F1DuSysInfo    duSysInfo;    /* gNB-DU System Information */
550 }F1DuSrvdCellInfo;
551
552 typedef struct f1DuSrvdCellToDel
553 {
554    NrEcgi             oldNrCgi;     /* Old NR CGI */
555    F1DuSrvdCellInfo   srvdCellInfo; /* Info of served cell to be deleted */ 
556 }F1DuSrvdCellToDel;
557
558 typedef struct f1CuActCellInfo
559 {
560    F1CellInfo    cuCellInfo;   /* gNB-CU available cell info */
561    F1CuSysInfo   cuSysInfo;    /* gNB-CU System Information */
562 }F1CuActCellInfo;
563
564 typedef struct f1ActCellFail
565 {
566    NrEcgi        nrCgi;
567    F1FailCause   cause;
568 }F1ActCellFail;
569
570 typedef struct srvStatus
571 {
572   SrvState    state;
573   Bool        switchOffOngoing;
574 }SrvStatus;
575
576 typedef struct f1CellStatus
577 {
578    NrEcgi      nrEcgi;
579    SrvStatus   status;   /* Service status */
580 }F1CellStatus;
581
582 typedef struct f1DedSIDelUE
583 {
584    U32      gnbCuUeF1apId;
585    NrEcgi   nrEcgi;
586 }F1DedSIDelUE;
587
588 typedef struct tnlAssocInfo
589 {
590    Bool           pres;
591    EpIpAddr       epIpAddr;      /* Endpoint-IP Address */
592    EpIpAddrPort   epIpAddrport;  /* Endpoint-IP Address and Port */
593 }F1TnlAssocAddr;
594
595 typedef struct f1TnlAssocUsage
596 {
597     Bool           pres;
598     F1AssocUsage   usage;
599 }F1TnlAssocUsage;
600
601 typedef struct f1TnlAssoc
602 {
603    F1TnlAssocAddr   assocInfo;    /* TNL Assoc Transport Layer Info */
604    F1TnlAssocUsage  assocUsage;   /* TNL Assoc usage */
605 }F1TnlAssoc;
606
607 typedef struct f1TnlAssocToRmv
608 {
609    F1TnlAssocAddr   assocInfoCu;   /* TNL Assoc Transport Layer Info of CU */
610    F1TnlAssocAddr   assocInfoDu;   /* TNL Assoc Transport Layer Info of DU */
611 }F1TnlAssocToRmv;
612
613 typedef struct f1TnlAssocSetupFail
614 {
615    F1TnlAssocAddr   assocInfo;
616    F1FailCause      cause;
617 }F1TnlAssocSetupFail;
618
619
620 typedef struct f1CellBarred
621 {
622    NrEcgi       nrcgi;
623    CellBarred   cellBarred;
624 }F1CellBarred;
625
626 typedef struct f1EutraCell
627 {
628    U32                eutraCellId; /* EUTRA cell id */
629    F1EutraModeInfo    mode;        /* EUTRA mode info : FDD/TDD */
630    U8                 rsrcInd;     /* Protected EUTRA resource Indication */
631 }F1EutraCell;
632
633 typedef struct f1ProtectEUTRARsrc
634 {
635    U32           specShareGrpId;               /* Spectrum sharing group id */
636    F1EutraCell   eutraCellList[MAXCELLINENB];  /* EUTRA cells list */
637 }F1ProtectEUTRARsrc;
638
639 typedef struct f1UacOperatorDefined
640 {
641    U8   accessCategory;
642    U8   accessId; 
643 }F1UacOperatorDefined;
644
645 typedef struct f1UacCategoryType
646 {
647    union
648    {
649       F1UacStandardAction    action;      /* UAC standardized action */
650       F1UacOperatorDefined   operatorDef; /* UAC operator defined */
651    }type;
652 }F1UacCategoryType;
653
654 typedef struct f1UacType
655 {
656    U8                  uacReducInd;     /* Value 0 means no access rate reduction. Value 100 means full access rate reduction */
657    F1UacCategoryType   uacCategoryType; /* UAC Category type */
658 }F1UacType;
659
660 /* Unified Access Class Assistance Information */
661 typedef struct f1UacAssistInfo
662 {
663    PlmnId      plmn[MAXNUMOFUACPLMN];        /* UAC PLMN list */
664    F1UacType   uacType[MAXNUMOFUACPERPLMN];  /* UAC Type list */
665 }F1UacAssistInfo;
666
667 /* F1 setup related structures */
668
669 typedef struct f1SetupReq
670 {
671   U32                transId;                       /* Uniquely identify transaction */
672   U32                duId;                          /* DU ID */ 
673   char               duName[CU_DU_NAME_LEN_MAX];    /* DU name */
674   F1DuSrvdCellInfo   srvdCellLst[DU_MAX_CELLS];   /* Serving cell list */
675   F1RrcVersion       rrcVersion;                    /* RRC version */
676 }F1SetupReq;
677
678 typedef struct f1setupRsp
679 {
680   U32               transId;                      /* Uniquely identify transaction */
681   char              cuName[CU_DU_NAME_LEN_MAX];   /* CU Name */
682   F1CuActCellInfo   actCellInfo;                  /* cells to be activated */
683   F1RrcVersion      rrcVersion;                   /* RRC version */
684 }F1SetupRsp;
685
686 typedef struct f1SetupFail
687 {
688    F1FailureIE   setupFail;
689 }F1SetupFail;
690
691 /* At reception of the RESET message the gNB-DU shall release all allocated resources on F1 
692  * and radio resources related to the UE association(s) indicated explicitly or implicitly in 
693  * the RESET message and remove the indicated UE contexts including F1AP ID. */
694 typedef struct f1Reset
695 {
696   U32              transId;   /* Uniquely identify transaction */
697   F1FailCause      cause;     /* Failure cause */
698   F1ResetType      resetType; /* type of reset */
699 }F1Reset;
700
701 /* After the gNB-CU has released all assigned F1 resources and the UE F1AP IDs for all indicated
702  * UE associations which can be used for new UE-associated logical F1-connections over the F1 interface,
703  *  the gNB-CU shall respond with the RESET ACKNOWLEDGE message. */
704 typedef struct f1ResetAck
705 {
706   U32                    transId;         /* Uniquely identify transaction */
707   F1LogicalConnUeAssoc   ueAssocLogicalConn[MAX_F1_CONNECTIONS]; /* UE associated logical F1-connection list */
708   F1CritDiagnostic       critDiagnostic;  /* Critical diagnostics */
709 }F1ResetAck;
710
711 typedef struct f1ErrorInd
712 {
713   U32                transId;         /* Uniquely identify transaction */
714   F1Entity           errorOrigin;     /* Specifies if error is originated at DU or CU */
715   F1FailCause        cause;           /* Failure cause */
716 /* If failure is due to Ue related message. */
717   U32                gnbCuUeF1apId;   /* gNB-CU UE F1AP Id */
718   U32                gnbDuUeF1apId;   /* gNB-DU UE F1AP Id */
719   F1CritDiagnostic   critDiagnostic;  /* Critical diagnostics */
720 }F1ErrorInd;
721
722 typedef struct f1GnbDuCfgUpd
723 {
724   U32                 transId;                             /* Uniquely identify transaction */
725   F1DuSrvdCellInfo    srvdCellLstAdd[DU_MAX_CELLS];      /* Served cell list to be added */
726   F1DuSrvdCellToDel   srvdCellLstMod[DU_MAX_CELLS];      /* Served cell list to be modified */
727   NrEcgi              srvdCellLstDel[DU_MAX_CELLS];      /* Served cell list to be deleted */
728   F1CellStatus        cellStatus[DU_MAX_CELLS];          /* Cell status */
729   F1DedSIDelUE        ueLst[MAX_UEID];                     /* Ue list that requires dedicated SI delivery */
730   U32                 gnbDuId;
731   F1TnlAssocToRmv     gnbDuTnlAssocRmv[MAX_TNL_ASSOC];  /* TNL Assoc list to remove */ 
732 }F1GnbDuCfgUpd;
733
734 typedef struct f1GnbDuCfgUpdAck
735 {
736    U32                transId;                      /* Uniquely identify transaction */
737    F1CuActCellInfo    cellLstAct[DU_MAX_CELLS];    /* List of cells to be activated */   
738    F1CritDiagnostic   critDiagnostic;               /* Critical diagnostics */
739    NrEcgi             cellLstDeact[DU_MAX_CELLS]; /* List of cells to be deactivated */
740 }F1GnbDuCfgUpdAck;
741
742 typedef struct f1GnbDuCfgUpdFail
743 {
744    F1FailureIE   gnbDuCfgUpdFail;
745 }F1GnbDuCfgUpdFail;
746
747 /* Sent by the gNB-CU to transfer updated information associated to an F1-C interface instance */
748 typedef struct f1GnbCuCfgUpd
749 {
750     U32                 transId;                            /* Uniquely identifies transaction */
751     F1CuActCellInfo     cellLstAct[DU_MAX_CELLS];         /* List of cells to be activated */
752     NrEcgi              cellLstDeact[DU_MAX_CELLS];       /* List of cells to be deactivated */
753     F1TnlAssoc          assocLstAdd[MAX_TNL_ASSOC];     /* List of TNL assocs to be added */
754     F1TnlAssoc          assocLstUpd[MAX_TNL_ASSOC];     /* List of TNL assocs to be updated */
755     F1TnlAssocToRmv     assocLstRmv[MAX_TNL_ASSOC];     /* List of TNL assocs to be removed */
756     F1CellBarred        cellToBarList[DU_MAX_CELLS];      /* List of Cells to be barred */
757     F1ProtectEUTRARsrc  protectEutraRsrcList[MAXCELLINENB]; /* List of Protected EUTRA resources */
758 }F1GnbCuCfgUpd;
759
760 /* Sent by a gNB-DU to a gNB-CU to acknowledge update of information
761  * associated to an F1-C interface instance */
762 typedef struct f1GnbCuCfgUpdAck
763 {
764     U32                   transId;                              /* Uniquely identify transaction */
765     F1ActCellFail         actCellFailList[DU_MAX_CELLS];      /* Cells failed to be activated list */
766     F1CritDiagnostic      critDiagnostic;                       /* Critical diagnostics */
767     F1TnlAssocAddr        assocSetupList[MAX_TNL_ASSOC];     /* TNL Assoc Setup list */
768     F1TnlAssocSetupFail   assocSetupFailList[MAX_TNL_ASSOC]; /* TNL Assoc Setup fail list */
769     F1DedSIDelUE          dedSiDelUelist[MAXNUMOFUEID];          /* Dedicated SI delivery needed UE list */
770 }F1GnbCuCfgUpdAck;
771
772 typedef struct f1GnbCuCfgUpdFail
773 {
774     F1FailureIE   gnbCuCfgUpdFail;
775 }F1GnbCuCfgUpdFail;
776
777 /* This procedure enables coordination of radio resource allocation between a gNB-CU and
778  * a gNB-DU. Coordination request is sent by CU to DU */
779 typedef struct f1GnbDuRsrcCoordReq
780 {
781    U32           transId;              /* Uniquely identifies transaction */
782    F1ReqType     reqType;              /* Request type */
783    U8            cellResCoordReqCont;  /* Container for X2AP E-UTRA - NR cell resource coordination request */
784    F1IgnoreReq   ignoreReq;            /* Ignore coordination request */
785 }F1GnbDuRsrcCoordReq;
786
787 /* This message is sent by a gNB-DU to a gNB-CU, to express the desired resource allocation
788  * for data traffic, as a response to the GNB-DU RESOURCE COORDINATION REQUEST. */
789 typedef struct f1GnbDuRsrcCoordRsp
790 {
791     U32   transId;               /* Uniquely identifies transaction */
792     U8    cellResCoordRspCont;   /* Container for X2AP E-UTRA - NR cell resource coordination response */
793 }F1GnbDuRsrcCoordRsp;
794
795 /* This message is sent by the gNB-DU to indicate to the gNB-CU its status of overload */
796 typedef struct f1GnbDuStatusInd
797 {
798    U32                  transId;      /* Uniquely identifies transaction */
799    F1GnbDuOvrloadInfo   ovrloadInfo;  /* gNB-DU overloaded information */
800 }F1GnbDuStatusInd;
801
802 /* This message is sent by either the gNB-DU or the gNB-CU to intiate the removal
803  * of the interface instance and the related resources */
804 typedef struct f1RmvReq
805 {
806    U32   transId; /* Uniquely identifies transaction */
807 }F1RmvReq;
808
809 /* This message acknowledges the initiation of removal of the interface
810  * instance and the related resources */
811 typedef struct f1RmvRsp
812 {
813    U32                transId;     /* Uniquely identifies transaction */
814    F1CritDiagnostic   critDiagnos; /* Crititcality diagnostics */
815 }F1RmvRsp;
816
817 /* This message indicates that removing the interface instance and the related
818  * resources cannot be accepted */
819 typedef struct f1RmvFail
820 {
821    U32                transId;         /* Uniquely identifies transaction */
822    F1FailCause        cause;          /* Failure cause */
823    F1CritDiagnostic   critDiagnostic; /* Criticality diagnostics */
824 }F1RmvFail;
825
826 /* This message is sent by the gNB-CU to indicate to the gNB-DU a need to reduce
827  * the rate at which UEs access the network. */
828 typedef struct f1NwkAccessRateRed
829 {
830    U32               transId;        /* Uniquely identifies transaction */
831    F1UacAssistInfo   uacAssistInfo;  /* UAC Assistance Information */
832 }F1NwkAccessRateRed;
833
834 typedef struct f1Ipaddr
835 {
836  Bool ipV4Pres;
837  U32  ipV4Addr; 
838 }F1IpAddr;
839
840 typedef struct sctpParams
841 {
842    F1IpAddr  duIpAddr;
843    U16       duPort[MAX_DU_PORT];
844    F1IpAddr  cuIpAddr;
845    U16       cuPort;
846    F1IpAddr  ricIpAddr;
847    U16       ricPort;
848 }SctpParams;
849
850 typedef struct f1EgtpParams
851 {
852    F1IpAddr  localIp;      /* Ip address of local node */
853    U16       localPort;    /* Sender Port at local node */
854    F1IpAddr  destIp;       /* Ip address of peer node */
855    U16       destPort;     /* Sender port at peer node */
856    U32       minTunnelId;
857    U32       maxTunnelId;
858 }F1EgtpParams;
859
860 typedef struct cellCfgParams
861 {
862    NrEcgi      nrEcgi;         /* ECGI */
863    U16         nrPci;          /* PCI */
864    U16         fiveGsTac;         /* 5gSTac */
865    PlmnId      plmn[MAX_PLMN]; /* List of serving PLMN IDs */
866    U8          ranac;          /* RAN Area Code */
867    U32         maxUe;          /* max UE per slot */
868 }CellCfgParams;
869
870 typedef struct schedulerCfg
871 {
872    U8         numTxAntPorts;    /*!< Number of Tx antenna ports */
873    U8         ulSchdType;     /*!< Indicates which UL scheduler to use, range
874                                * is 0..(number of schedulers - 1) */
875    U8         dlSchdType;     /*!< Indicates which DL scheduler to use, range
876                                * is 0..(number of schedulers - 1) */
877    U8         numCells;       /*!< Max number of cells */
878    U8         maxUlUePerTti;  /*!< Max number of UE in UL per TTI */
879    U8         maxDlUePerTti;  /*!< Max number of UE in DL per TTI */
880 }SchedulerCfg;
881
882 typedef struct mibParams
883 {
884         uint8_t sysFrmNum;
885         long    subCarrierSpacingCommon;
886         long    ssb_SubcarrierOffset;
887         long    dmrs_TypeA_Position;
888         long    controlResourceSetZero;
889         long    searchSpaceZero;
890         long    cellBarred;
891         long    intraFreqReselection;
892 }MibParams;
893
894 typedef struct sib1Params
895 {
896         PlmnId    plmn;
897         uint8_t   tac;
898         long      ranac;
899         U8        cellIdentity;
900         long      cellResvdForOpUse;
901 }Sib1Params;
902
903 typedef struct duCfgParams
904 {
905    SctpParams         sctpParams;                    /* SCTP Params */
906    F1EgtpParams       egtpParams;                    /* EGTP Params */
907    U32                maxUe;
908    U32                duId;
909    U8                 duName[CU_DU_NAME_LEN_MAX];
910    SchedulerCfg       schedCfg;
911    CellCfgParams      cellCfg[DU_MAX_CELLS];  /* Cell info config*/
912    F1DuSrvdCellInfo   srvdCellLst[DU_MAX_CELLS];   /* Serving cell list *///TODO: this must be removed eventually
913    F1RrcVersion       rrcVersion;                    /* RRC version */
914
915    MacCellCfg         macCellCfg;       /* MAC cell configuration */
916    MibParams          mibParams;                     /* MIB Params */
917         Sib1Params         sib1Params;                    /* SIB1 Params */
918 }DuCfgParams;
919
920 typedef struct duCellCb
921 {
922    U32            cellId;      /* Internal cell Id */
923    CellCfgParams  cellInfo;    /* Cell info */
924    CellStatus     cellStatus;  /*Cell status */
925 }DuCellCb;
926
927 /*function declarations */
928 void FillSlotConfig();
929 S16 readClCfg();
930 S16 readCfg();
931 S16 duReadCfg(); 
932 S16 bitStringToInt(BIT_STRING_t *bitString, U16 *val);
933
934 #endif /* __DU_CONFIG_H__ */
935
936 /**********************************************************************
937          End of file
938 **********************************************************************/