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