nfapi_interface.h 118 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
 * Copyright 2017 Cisco Systems, Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


#ifndef _NFAPI_INTERFACE_H_
#define _NFAPI_INTERFACE_H_

#include "stddef.h"

// Constants - update based on implementation
#define NFAPI_MAX_PHY_RF_INSTANCES 2
#define NFAPI_PNF_PARAM_GENERAL_LOCATION_LENGTH 16
#define NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH 3
#define NFAPI_MAX_NUM_RF_BANDS 16

// The following definition control the size of arrays used in the interface.
// These may be changed if desired. They are used in the encoder to make sure 
// that the user has not specified a 'count' larger than the max array, and also
// used by the decoder when decode an array. If the 'count' received is larger
// than the array it is to be stored in the decode fails. 
#define NFAPI_MAX_NUM_ANTENNAS 8
#define NFAPI_MAX_NUM_SUBBANDS 13
#define NFAPI_MAX_BF_VECTORS 8
#define NFAPI_MAX_CC 2
#define NFAPI_MAX_NUM_PHYSICAL_ANTENNAS 8
#define NFAPI_MAX_RSSI 8
#define NFAPI_MAX_PSC_LIST 32
#define NFAPI_MAX_PCI_LIST 32
#define NFAPI_MAX_CARRIER_LIST 32
#define NFAPI_MAX_ARFCN_LIST 128
#define NFAPI_MAX_LTE_CELLS_FOUND 8
#define NFAPI_MAX_UTRAN_CELLS_FOUND 8
#define NFAPI_MAX_GSM_CELLS_FOUND 8
#define NFAPI_MAX_NB_IOT_CELLS_FOUND 8
#define NFAPI_MAX_SI_PERIODICITY 8
#define NFAPI_MAX_SI_INDEX 8
#define NFAPI_MAX_MIB_LENGTH 32
#define NFAPI_MAX_SIB_LENGTH 256
#define NFAPI_MAX_SI_LENGTH 256
#define NFAPI_MAX_OPAQUE_DATA 64
#define NFAPI_MAX_NUM_SCHEDULED_UES 8 // Used in the TPM structure
#define NFAPI_MAX_PNF_PHY 5
#define NFAPI_MAX_PNF_PHY_RF_CONFIG 5
#define NFAPI_MAX_PNF_RF  5
#define NFAPI_MAX_NMM_FREQUENCY_BANDS 32
#define NFAPI_MAX_RECEIVED_INTERFERENCE_POWER_RESULTS 100
#define NFAPI_MAX_UL_DL_CONFIGURATIONS 5
#define NFAPI_MAX_CSI_RS_RESOURCE_CONFIG 4
#define NFAPI_MAX_ANTENNA_PORT_COUNT 8
#define NFAPI_MAX_EPDCCH_PRB 8
#define NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS 8
#define NFAPI_MAX_NUMBER_ACK_NACK_TDD 8
#define NFAPI_MAX_RO_DL 8

#define NFAPI_HEADER_LENGTH 8
#define NFAPI_P7_HEADER_LENGTH 16

#define NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE 0xF000
#define NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE 0xFFFF

#define NFAPI_VERSION_3_0_11	0x000
#define NFAPI_VERSION_3_0_12    0x001

// The IANA agreed port definition of the P5 SCTP VNF enpoint 
// http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=7701
#define NFAPI_P5_SCTP_PORT		7701

typedef unsigned int	uint32_t;
typedef unsigned short	uint16_t;
typedef unsigned char	uint8_t;
typedef signed int		int32_t;
typedef signed short	int16_t;
typedef signed char		int8_t;

typedef struct {
	uint16_t phy_id;
	uint16_t message_id;
	uint16_t message_length;
	uint16_t spare;
} nfapi_p4_p5_message_header_t;

typedef struct {
	uint16_t phy_id;
	uint16_t message_id;
	uint16_t message_length;
	uint16_t m_segment_sequence; /* This consists of 3 fields - namely, M, Segement & Sequence number*/
	uint32_t checksum;
	uint32_t transmit_timestamp;
} nfapi_p7_message_header_t;

#define NFAPI_PHY_ID_NA 0

//#define NFAPI_P7_GET_MORE(_mss) ( ((_mss) & 0x80) >> 7 )
//#define NFAPI_P7_GET_SEGMENT(_mss) ( ((_mss) & 0x70) >> 4 )
#define NFAPI_P7_GET_MORE(_mss) ( ((_mss) & 0x8000) >> 15 )
#define NFAPI_P7_GET_SEGMENT(_mss) ( ((_mss) & 0x7F00) >> 8 )
#define NFAPI_P7_GET_SEQUENCE(_mss) ( (_mss) & 0x00FF )
#define NFAPI_P7_SET_MSS(_more, _segm, _sequ) ( (((_more) & 0x1) << 7) | (((_segm) & 0x7) << 4) | ((_sequ) & 0xF) )

typedef struct {
	uint16_t tag;
	uint16_t length;
} nfapi_tl_t;
#define NFAPI_TAG_LENGTH_PACKED_LEN 4

// Convenience methods to convert between SFN/SFN formats
#define NFAPI_SFNSF2DEC(_sfnsf) ((((_sfnsf) >> 4) * 10) + ((_sfnsf) & 0xF))
#define NFAPI_SFNSFDEC2SFNSF(_sfnsf_dec) ((((_sfnsf_dec) / 10) << 4) | (((_sfnsf_dec) - (((_sfnsf_dec) / 10) * 10)) & 0xF))

#define NFAPI_SFNSF2SFN(_sfnsf) ((_sfnsf) >> 4)
#define NFAPI_SFNSF2SF(_sfnsf) ((_sfnsf) & 0xF)

#define NFAPI_MAX_SFNSFDEC 10240

typedef nfapi_tl_t* nfapi_vendor_extension_tlv_t;


// nFAPI Message IDs
typedef enum {
	NFAPI_DL_CONFIG_REQUEST = 0x0080,
	NFAPI_UL_CONFIG_REQUEST,
	NFAPI_SUBFRAME_INDICATION,
	NFAPI_HI_DCI0_REQUEST,
	NFAPI_TX_REQUEST,
	NFAPI_HARQ_INDICATION,
	NFAPI_CRC_INDICATION,
	NFAPI_RX_ULSCH_INDICATION,
	NFAPI_RACH_INDICATION,
	NFAPI_SRS_INDICATION,
	NFAPI_RX_SR_INDICATION,
	NFAPI_RX_CQI_INDICATION,
	NFAPI_LBT_DL_CONFIG_REQUEST,
	NFAPI_LBT_DL_INDICATION,
	NFAPI_NB_HARQ_INDICATION,
	NFAPI_NRACH_INDICATION,

	NFAPI_PNF_PARAM_REQUEST = 0x0100,
	NFAPI_PNF_PARAM_RESPONSE,
	NFAPI_PNF_CONFIG_REQUEST,
	NFAPI_PNF_CONFIG_RESPONSE,
	NFAPI_PNF_START_REQUEST,
	NFAPI_PNF_START_RESPONSE,
	NFAPI_PNF_STOP_REQUEST,
	NFAPI_PNF_STOP_RESPONSE,
	NFAPI_PARAM_REQUEST,
	NFAPI_PARAM_RESPONSE,
	NFAPI_CONFIG_REQUEST,
	NFAPI_CONFIG_RESPONSE,
	NFAPI_START_REQUEST,
	NFAPI_START_RESPONSE,
	NFAPI_STOP_REQUEST,
	NFAPI_STOP_RESPONSE,
	NFAPI_MEASUREMENT_REQUEST,
	NFAPI_MEASUREMENT_RESPONSE,

	NFAPI_UL_NODE_SYNC = 0x0180,
	NFAPI_DL_NODE_SYNC,
	NFAPI_TIMING_INFO,


	NFAPI_RSSI_REQUEST = 0x0200,
	NFAPI_RSSI_RESPONSE,
	NFAPI_RSSI_INDICATION,
	NFAPI_CELL_SEARCH_REQUEST,
	NFAPI_CELL_SEARCH_RESPONSE,
	NFAPI_CELL_SEARCH_INDICATION,
	NFAPI_BROADCAST_DETECT_REQUEST,
	NFAPI_BROADCAST_DETECT_RESPONSE,
	NFAPI_BROADCAST_DETECT_INDICATION,
	NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST,
	NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE,
	NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION,
	NFAPI_SYSTEM_INFORMATION_REQUEST,
	NFAPI_SYSTEM_INFORMATION_RESPONSE,
	NFAPI_SYSTEM_INFORMATION_INDICATION,
	NFAPI_NMM_STOP_REQUEST,
	NFAPI_NMM_STOP_RESPONSE,

	NFAPI_VENDOR_EXT_MSG_MIN = 0x0300,
	NFAPI_VENDOR_EXT_MSG_MAX = 0x03FF,


	NFAPI_MAX_MESSAGE_ID,
} nfapi_message_id_e;

// nFAPI Error Codes
typedef enum {
	NFAPI_MSG_OK = 0,
	NFAPI_MSG_INVALID_STATE,
	NFAPI_MSG_INVALID_CONFIG,
	NFAPI_SFN_OUT_OF_SYNC,
	NFAPI_MSG_SUBFRAME_ERR,
	NFAPI_MSG_BCH_MISSING,
	NFAPI_MSG_INVALID_SFN,
	NFAPI_MSG_HI_ERR,
	NFAPI_MSG_TX_ERR,
	
	NFAPI_LBT_NO_PDU_IN_DL_REQ,
	NFAPI_LBT_NO_VALID_CONFIG_REQ_RECEIVED,
	NFAPI_FAPI_E_LBT_SF_SFN_PASSED_END_SF_SFN,
	NFAPI_FAPI_E_LBT_OVERLAP,
	NFAPI_MSG_BCH_PRESENT,
	
	NFAPI_NBIOT_UNEXPECTED_REQ,

	// This is special return code that indicates that a response has
	// been send via P9
	NFAPI_MSG_P9_RESPONSE = 0xAA
} nfapi_error_code_e;


typedef enum {
	NFAPI_P4_MSG_OK = 100,
	NFAPI_P4_MSG_INVALID_STATE = 101,
	NFAPI_P4_MSG_INVALID_CONFIG = 102,
	NFAPI_P4_MSG_RAT_NOT_SUPPORTED = 103,
	NFAPI_P4_MSG_NMM_STOP_OK = 200,
	NFAPI_P4_MSG_NMM_STOP_IGNOREDED = 201,
	NFAPI_P4_MSG_NMM_STOP_INVALID_STATE = 202,
	NFAPI_P4_MSG_PROCEDURE_COMPLETE = 300,
	NFAPI_P4_MSG_PROCEDURE_STOPPED = 301,
	NFAPI_P4_MSG_PARTIAL_RESULTS = 302,
	NFAPI_P4_MSG_TIMEOUT = 303
} nfapi_p4_error_code_e;

// nFAPI enums
typedef enum {
	NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE = 0,
	NFAPI_DL_CONFIG_BCH_PDU_TYPE,
	NFAPI_DL_CONFIG_MCH_PDU_TYPE,
	NFAPI_DL_CONFIG_DLSCH_PDU_TYPE,
	NFAPI_DL_CONFIG_PCH_PDU_TYPE,
	NFAPI_DL_CONFIG_PRS_PDU_TYPE,
	NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE,
	NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE,
	NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE,
	NFAPI_DL_CONFIG_NBCH_PDU_TYPE,
	NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE,
	NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE
} nfapi_dl_config_pdu_type_e;

typedef enum {
	NFAPI_DL_DCI_FORMAT_1 = 0,
	NFAPI_DL_DCI_FORMAT_1A,
	NFAPI_DL_DCI_FORMAT_1B,
	NFAPI_DL_DCI_FORMAT_1C,
	NFAPI_DL_DCI_FORMAT_1D,
	NFAPI_DL_DCI_FORMAT_2,
	NFAPI_DL_DCI_FORMAT_2A,
	NFAPI_DL_DCI_FORMAT_2B,
	NFAPI_DL_DCI_FORMAT_2C
} nfapi_dl_dci_format_e;

typedef enum {
	NFAPI_UL_DCI_FORMAT_0 = 0,
	NFAPI_UL_DCI_FORMAT_3,
	NFAPI_UL_DCI_FORMAT_3A,
	NFAPI_UL_DCI_FORMAT_4
} nfapi_ul_dci_format_e;

typedef enum {
	NFAPI_UL_CONFIG_ULSCH_PDU_TYPE = 0,
	NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE,
	NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE,
	NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE,
	NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE,
	NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE,
	NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE,
	NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE,
	NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE,
	NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE,
	NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE,
	NFAPI_UL_CONFIG_SRS_PDU_TYPE,
	NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE,
	NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE,
	NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE,
	NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE,
	NFAPI_UL_CONFIG_NULSCH_PDU_TYPE,
	NFAPI_UL_CONFIG_NRACH_PDU_TYPE,
} nfapi_ul_config_pdu_type_e;

typedef enum {
	NFAPI_HI_DCI0_HI_PDU_TYPE = 0,
	NFAPI_HI_DCI0_DCI_PDU_TYPE,
	NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE,
	NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE,
	NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE,
} nfapi_hi_dci0_pdu_type_e;

typedef enum {
	NFAPI_HARQ_ACK = 1,
	NFAPI_HARQ_NACK,
	NFAPI_HARQ_ACK_OR_NACK,
	NFAPI_HARQ_DTX,
	NFAPI_HARQ_ACK_OR_DTX,
	NFAPI_HARQ_NACK_OR_DTX,
	NFAPI_HARQ_ACK_OR_NACK_OR_DTX
} nfapi_harq_type_e;

typedef enum {
	NFAPI_CSI_REPORT_TYPE_PERIODIC = 0,
	NFAPI_CSI_REPORT_TYPE_APERIODIC
} nfapi_csi_report_type_e;

typedef enum {
	NFAPI_DL_BW_SUPPORTED_6 = 1,
	NFAPI_DL_BW_SUPPORTED_15 = 2,
	NFAPI_DL_BW_SUPPORTED_25 = 4,
	NFAPI_DL_BW_SUPPORTED_50 = 8,
	NFAPI_DL_BW_SUPPORTED_75 = 16,
	NFAPI_DL_BW_SUPPORTED_100 = 32
} nfapi_dl_bandwith_supported_e;

typedef enum {
	NFAPI_UL_BW_SUPPORTED_6 = 1,
	NFAPI_UL_BW_SUPPORTED_15 = 2,
	NFAPI_UL_BW_SUPPORTED_25 = 4,
	NFAPI_UL_BW_SUPPORTED_50 = 8,
	NFAPI_UL_BW_SUPPORTED_75 = 16,
	NFAPI_UL_BW_SUPPORTED_100 = 32
} nfapi_ul_bandwith_supported_e;

typedef enum {
	NFAPI_3GPP_REL_SUPPORTED_8 = 0,
	NFAPI_3GPP_REL_SUPPORTED_9 = 1,
	NFAPI_3GPP_REL_SUPPORTED_10 = 2,
	NFAPI_3GPP_REL_SUPPORTED_11 = 4,
	NFAPI_3GPP_REL_SUPPORTED_12 = 8
} nfapi_3gpp_release_supported_e;


typedef enum {
	NFAPI_DUPLEXING_MODE_TDD = 0,
	NFAPI_DUPLEXING_MODE_FDD = 1,
	NFAPI_DUPLEXING_MODE_HD_FDD = 2,
} nfapi_duplexing_mode_e;

typedef enum {
	NFAPI_CP_NORMAL = 0,
	NFAPI_CP_EXTENDED = 1
} nfapi_cyclic_prefix_type_e;

typedef enum {
	NFAPI_RAT_TYPE_LTE = 0,
	NFAPI_RAT_TYPE_UTRAN = 1,
	NFAPI_RAT_TYPE_GERAN = 2,
	NFAPI_RAT_TYPE_NB_IOT = 3
} nfapi_rat_type_e;

typedef enum {
	NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING,
	NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING,
	NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING,
	NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION,
	NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3,
	NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_4,
	NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_5
} nfapi_harq_indication_tdd_ack_nackformat_e;


typedef enum {
	NFAPI_LBT_DL_CONFIG_REQUEST_PDSCH_PDU_TYPE = 0,
	NFAPI_LBT_DL_CONFIG_REQUEST_DRS_PDU_TYPE
} nfapi_lbt_dl_config_pdu_type_e;

typedef enum {
	NFAPI_LBT_DL_RSP_PDSCH_PDU_TYPE = 0,
	NFAPI_LBT_DL_RSP_DRS_PDU_TYPE
} nfapi_lbt_dl_rsp_pdu_type_e;

typedef struct {
	nfapi_tl_t tl;
	uint32_t length;
	uint8_t value[NFAPI_MAX_OPAQUE_DATA];
} nfapi_opaqaue_data_t;

// Utility functions to turn enums into char*
const char* nfapi_error_code_to_str(nfapi_error_code_e value);


// P5 Sub Structures
typedef struct {
	nfapi_tl_t tl;
	uint8_t nfapi_sync_mode;
	uint8_t location_mode;
	uint16_t location_coordinates_length;
	uint8_t location_coordinates[NFAPI_PNF_PARAM_GENERAL_LOCATION_LENGTH];
	uint32_t dl_config_timing;
	uint32_t tx_timing;
	uint32_t ul_config_timing;
	uint32_t hi_dci0_timing;
	uint16_t maximum_number_phys;
	uint16_t maximum_total_bandwidth;
	uint8_t maximum_total_number_dl_layers;
	uint8_t maximum_total_number_ul_layers;
	uint8_t shared_bands;
	uint8_t shared_pa;
	int16_t maximum_total_power;
	uint8_t oui[NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH];
} nfapi_pnf_param_general_t;
#define NFAPI_PNF_PARAM_GENERAL_TAG 0x1000





typedef struct {
	uint16_t rf_config_index;
} nfapi_rf_config_info_t;

typedef struct {
	uint16_t phy_config_index;
	uint16_t number_of_rfs;
	nfapi_rf_config_info_t rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG];
	uint16_t number_of_rf_exclusions;
	nfapi_rf_config_info_t excluded_rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG];
	uint16_t downlink_channel_bandwidth_supported;
	uint16_t uplink_channel_bandwidth_supported;
	uint8_t number_of_dl_layers_supported;
	uint8_t number_of_ul_layers_supported;
	uint16_t maximum_3gpp_release_supported;
	uint8_t nmm_modes_supported;
} nfapi_pnf_phy_info_t;


typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_phys;
	nfapi_pnf_phy_info_t phy[NFAPI_MAX_PNF_PHY];
} nfapi_pnf_phy_t;
#define NFAPI_PNF_PHY_TAG 0x1001

typedef struct {
	uint16_t phy_config_index;
	uint16_t transmission_mode_7_supported;
	uint16_t transmission_mode_8_supported;
	uint16_t two_antenna_ports_for_pucch;
	uint16_t transmission_mode_9_supported;
	uint16_t simultaneous_pucch_pusch;
	uint16_t four_layer_tx_with_tm3_and_tm4;
} nfapi_pnf_phy_rel10_info_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_phys;
	nfapi_pnf_phy_rel10_info_t phy[NFAPI_MAX_PNF_PHY];
} nfapi_pnf_phy_rel10_t;
#define NFAPI_PNF_PHY_REL10_TAG 0x100A

typedef struct {
	uint16_t phy_config_index;
	uint16_t edpcch_supported;
	uint16_t multi_ack_csi_reporting;
	uint16_t pucch_tx_diversity;
	uint16_t ul_comp_supported;
	uint16_t transmission_mode_5_supported;
} nfapi_pnf_phy_rel11_info_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_phys;
	nfapi_pnf_phy_rel11_info_t phy[NFAPI_MAX_PNF_PHY];
} nfapi_pnf_phy_rel11_t;
#define NFAPI_PNF_PHY_REL11_TAG 0x100B


typedef struct {
	uint16_t phy_config_index;
	uint16_t csi_subframe_set;
	uint16_t enhanced_4tx_codebook;
	uint16_t drs_supported;
	uint16_t ul_64qam_supported;
	uint16_t transmission_mode_10_supported;
	uint16_t alternative_bts_indices;
} nfapi_pnf_phy_rel12_info_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_phys;
	nfapi_pnf_phy_rel12_info_t phy[NFAPI_MAX_PNF_PHY];
} nfapi_pnf_phy_rel12_t;
#define NFAPI_PNF_PHY_REL12_TAG 0x100C

typedef struct {
	uint16_t phy_config_index;
	uint16_t pucch_format4_supported;
	uint16_t pucch_format5_supported;
	uint16_t more_than_5_ca_support;
	uint16_t laa_supported;
	uint16_t laa_ending_in_dwpts_supported;
	uint16_t laa_starting_in_second_slot_supported;
	uint16_t beamforming_supported;
	uint16_t csi_rs_enhancement_supported;
	uint16_t drms_enhancement_supported;
	uint16_t srs_enhancement_supported;
} nfapi_pnf_phy_rel13_info_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_phys;
	nfapi_pnf_phy_rel13_info_t phy[NFAPI_MAX_PNF_PHY];
} nfapi_pnf_phy_rel13_t;
#define NFAPI_PNF_PHY_REL13_TAG 0x100D

typedef struct {
	uint16_t phy_config_index;
	uint16_t number_of_rfs;
	nfapi_rf_config_info_t rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG];
	uint16_t number_of_rf_exclusions;
	nfapi_rf_config_info_t excluded_rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG];
	uint8_t number_of_dl_layers_supported;
	uint8_t number_of_ul_layers_supported;
	uint16_t maximum_3gpp_release_supported;
	uint8_t nmm_modes_supported;
} nfapi_pnf_phy_rel13_nb_iot_info_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_phys;
	nfapi_pnf_phy_rel13_nb_iot_info_t phy[NFAPI_MAX_PNF_PHY];
} nfapi_pnf_phy_rel13_nb_iot_t;
#define NFAPI_PNF_PHY_REL13_NB_IOT_TAG 0x100E



typedef struct {
	uint16_t rf_config_index;
	uint16_t band;
	int16_t maximum_transmit_power; 
	int16_t minimum_transmit_power;
	uint8_t number_of_antennas_suppported;
	uint32_t minimum_downlink_frequency;
	uint32_t maximum_downlink_frequency;
	uint32_t minimum_uplink_frequency;
	uint32_t maximum_uplink_frequency;
} nfapi_pnf_rf_info_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_rfs;
	nfapi_pnf_rf_info_t rf[NFAPI_MAX_PNF_RF];
} nfapi_pnf_rf_t;
#define NFAPI_PNF_RF_TAG 0x1002

typedef struct {
	uint16_t phy_id;
	uint16_t phy_config_index;
	uint16_t rf_config_index;
} nfapi_phy_rf_config_info_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_phy_rf_config_info;
	nfapi_phy_rf_config_info_t phy_rf_config[NFAPI_MAX_PHY_RF_INSTANCES];
} nfapi_pnf_phy_rf_config_t;
#define NFAPI_PNF_PHY_RF_TAG 0x1003

// Generic strucutre for single tlv value.
typedef struct {
	nfapi_tl_t tl;
	uint16_t value;
} nfapi_uint16_tlv_t;

typedef struct {
	nfapi_tl_t tl;
	int16_t value;
} nfapi_int16_tlv_t;

typedef struct {
	nfapi_tl_t tl;
	uint8_t value;
} nfapi_uint8_tlv_t;

typedef struct {
	nfapi_uint16_tlv_t phy_state;
} nfapi_l1_status;

#define NFAPI_L1_STATUS_PHY_STATE_TAG 0x00FA

typedef struct {
	nfapi_uint16_tlv_t dl_bandwidth_support;
	nfapi_uint16_tlv_t ul_bandwidth_support;
	nfapi_uint16_tlv_t dl_modulation_support;
	nfapi_uint16_tlv_t ul_modulation_support;
	nfapi_uint16_tlv_t phy_antenna_capability;
	nfapi_uint16_tlv_t release_capability;
	nfapi_uint16_tlv_t mbsfn_capability;
} nfapi_phy_capabilities_t;

#define NFAPI_PHY_CAPABILITIES_DL_BANDWIDTH_SUPPORT_TAG 0x00C8
#define NFAPI_PHY_CAPABILITIES_UL_BANDWIDTH_SUPPORT_TAG 0x00C9
#define NFAPI_PHY_CAPABILITIES_DL_MODULATION_SUPPORT_TAG 0x00CA
#define NFAPI_PHY_CAPABILITIES_UL_MODULATION_SUPPORT_TAG 0x00CB
#define NFAPI_PHY_CAPABILITIES_PHY_ANTENNA_CAPABILITY_TAG 0x00CC
#define NFAPI_PHY_CAPABILITIES_RELEASE_CAPABILITY_TAG 0x00CD
#define NFAPI_PHY_CAPABILITIES_MBSFN_CAPABILITY_TAG 0x00CE


typedef struct {
	nfapi_uint16_tlv_t data_report_mode;
	nfapi_uint16_tlv_t sfnsf;
} nfapi_l23_config_t;


#define NFAPI_L23_CONFIG_DATA_REPORT_MODE_TAG 0x00F0
#define NFAPI_L23_CONFIG_SFNSF_TAG 0x00F1

typedef struct {
	nfapi_uint16_tlv_t duplex_mode;
	nfapi_uint16_tlv_t pcfich_power_offset;
	nfapi_uint16_tlv_t pb;
	nfapi_uint16_tlv_t dl_cyclic_prefix_type;
	nfapi_uint16_tlv_t ul_cyclic_prefix_type;
} nfapi_subframe_config_t;

#define NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG 0x0001
#define NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG 0x0002
#define NFAPI_SUBFRAME_CONFIG_PB_TAG 0x0003
#define NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG 0x0004
#define NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG 0x0005

typedef struct {
	nfapi_uint16_tlv_t dl_channel_bandwidth;
	nfapi_uint16_tlv_t ul_channel_bandwidth;
	nfapi_uint16_tlv_t reference_signal_power;
	nfapi_uint16_tlv_t tx_antenna_ports;
	nfapi_uint16_tlv_t rx_antenna_ports;
} nfapi_rf_config_t;

#define NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG 0x000A
#define NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG 0x000B
#define NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG 0x000C
#define NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG 0x000D
#define NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG 0x000E

typedef struct {
	nfapi_uint16_tlv_t phich_resource;
	nfapi_uint16_tlv_t phich_duration;
	nfapi_uint16_tlv_t phich_power_offset;
} nfapi_phich_config_t;

#define NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG 0x0014
#define NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG 0x0015
#define NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG 0x0016

typedef struct {
	nfapi_uint16_tlv_t primary_synchronization_signal_epre_eprers;
	nfapi_uint16_tlv_t secondary_synchronization_signal_epre_eprers;
	nfapi_uint16_tlv_t physical_cell_id;
} nfapi_sch_config_t;

#define NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG 0x001E
#define NFAPI_SCH_CONFIG_SECONDARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG 0x001F
#define NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG 0x0020

typedef struct {
	nfapi_uint16_tlv_t configuration_index;
	nfapi_uint16_tlv_t root_sequence_index;
	nfapi_uint16_tlv_t zero_correlation_zone_configuration;
	nfapi_uint16_tlv_t high_speed_flag;
	nfapi_uint16_tlv_t frequency_offset;
} nfapi_prach_config_t;

#define NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG 0x0028
#define NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG 0x0029
#define NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG 0x002A
#define NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG 0x002B
#define NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG 0x002C

typedef struct {
	nfapi_uint16_tlv_t hopping_mode;
	nfapi_uint16_tlv_t hopping_offset;
	nfapi_uint16_tlv_t number_of_subbands;
} nfapi_pusch_config_t;

#define NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG 0x0032
#define NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG 0x0033
#define NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG 0x0034

typedef struct {
	nfapi_uint16_tlv_t delta_pucch_shift;
	nfapi_uint16_tlv_t n_cqi_rb;
	nfapi_uint16_tlv_t n_an_cs;
	nfapi_uint16_tlv_t n1_pucch_an;
} nfapi_pucch_config_t;

#define NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG 0x003C
#define NFAPI_PUCCH_CONFIG_N_CQI_RB_TAG 0x003D
#define NFAPI_PUCCH_CONFIG_N_AN_CS_TAG 0x003E
#define NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG 0x003F

typedef struct {
	nfapi_uint16_tlv_t bandwidth_configuration;
	nfapi_uint16_tlv_t max_up_pts;
	nfapi_uint16_tlv_t srs_subframe_configuration;
	nfapi_uint16_tlv_t srs_acknack_srs_simultaneous_transmission;
} nfapi_srs_config_t;

#define NFAPI_SRS_CONFIG_BANDWIDTH_CONFIGURATION_TAG 0x0046
#define NFAPI_SRS_CONFIG_MAX_UP_PTS_TAG 0x0047
#define NFAPI_SRS_CONFIG_SRS_SUBFRAME_CONFIGURATION_TAG 0x0048
#define NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG 0x0049

typedef struct {
	nfapi_uint16_tlv_t uplink_rs_hopping;
	nfapi_uint16_tlv_t group_assignment;
	nfapi_uint16_tlv_t cyclic_shift_1_for_drms;
} nfapi_uplink_reference_signal_config_t;

#define NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG 0x0050
#define NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG 0x0051
#define NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG 0x0052


typedef struct {
	nfapi_uint16_tlv_t ed_threshold_lbt_pdsch;
	nfapi_uint16_tlv_t ed_threshold_lbt_drs;
	nfapi_uint16_tlv_t pd_threshold;
	nfapi_uint16_tlv_t multi_carrier_type;
	nfapi_uint16_tlv_t multi_carrier_tx;
	nfapi_uint16_tlv_t multi_carrier_freeze;
	nfapi_uint16_tlv_t tx_antenna_ports_drs;
	nfapi_uint16_tlv_t tx_power_drs;
} nfapi_laa_config_t;

#define NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_PDSCH_TAG 0x0064
#define NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_DRS_TAG 0x0065
#define NFAPI_LAA_CONFIG_PD_THRESHOLD_TAG 0x0066
#define NFAPI_LAA_CONFIG_MULTI_CARRIER_TYPE_TAG 0x0067
#define NFAPI_LAA_CONFIG_MULTI_CARRIER_TX_TAG 0x0068
#define NFAPI_LAA_CONFIG_MULTI_CARRIER_FREEZE_TAG 0x0069
#define NFAPI_LAA_CONFIG_TX_ANTENNA_PORTS_FOR_DRS_TAG 0x006A
#define NFAPI_LAA_CONFIG_TRANSMISSION_POWER_FOR_DRS_TAG 0x006B

typedef struct {

	nfapi_uint16_tlv_t pbch_repetitions_enable_r13;
	nfapi_uint16_tlv_t prach_catm_root_sequence_index;
	nfapi_uint16_tlv_t prach_catm_zero_correlation_zone_configuration;
	nfapi_uint16_tlv_t prach_catm_high_speed_flag;
	nfapi_uint16_tlv_t prach_ce_level_0_enable;
	nfapi_uint16_tlv_t prach_ce_level_0_configuration_index;
	nfapi_uint16_tlv_t prach_ce_level_0_frequency_offset;
	nfapi_uint16_tlv_t prach_ce_level_0_number_of_repetitions_per_attempt;
	nfapi_uint16_tlv_t prach_ce_level_0_starting_subframe_periodicity;
	nfapi_uint16_tlv_t prach_ce_level_0_hopping_enable;
	nfapi_uint16_tlv_t prach_ce_level_0_hopping_offset;
	nfapi_uint16_tlv_t prach_ce_level_1_enable;
	nfapi_uint16_tlv_t prach_ce_level_1_configuration_index;
	nfapi_uint16_tlv_t prach_ce_level_1_frequency_offset;
	nfapi_uint16_tlv_t prach_ce_level_1_number_of_repetitions_per_attempt;
	nfapi_uint16_tlv_t prach_ce_level_1_starting_subframe_periodicity;
	nfapi_uint16_tlv_t prach_ce_level_1_hopping_enable;
	nfapi_uint16_tlv_t prach_ce_level_1_hopping_offset;
	nfapi_uint16_tlv_t prach_ce_level_2_enable;
	nfapi_uint16_tlv_t prach_ce_level_2_configuration_index;
	nfapi_uint16_tlv_t prach_ce_level_2_frequency_offset;
	nfapi_uint16_tlv_t prach_ce_level_2_number_of_repetitions_per_attempt;
	nfapi_uint16_tlv_t prach_ce_level_2_starting_subframe_periodicity;
	nfapi_uint16_tlv_t prach_ce_level_2_hopping_enable;
	nfapi_uint16_tlv_t prach_ce_level_2_hopping_offset;
	nfapi_uint16_tlv_t prach_ce_level_3_enable;
	nfapi_uint16_tlv_t prach_ce_level_3_configuration_index;
	nfapi_uint16_tlv_t prach_ce_level_3_frequency_offset;
	nfapi_uint16_tlv_t prach_ce_level_3_number_of_repetitions_per_attempt;
	nfapi_uint16_tlv_t prach_ce_level_3_starting_subframe_periodicity;
	nfapi_uint16_tlv_t prach_ce_level_3_hopping_enable;
	nfapi_uint16_tlv_t prach_ce_level_3_hopping_offset;
	nfapi_uint16_tlv_t pucch_interval_ulhoppingconfigcommonmodea;
	nfapi_uint16_tlv_t pucch_interval_ulhoppingconfigcommonmodeb;
} nfapi_emtc_config_t;

#define NFAPI_EMTC_CONFIG_PBCH_REPETITIONS_ENABLE_R13_TAG 0x0078
#define NFAPI_EMTC_CONFIG_PRACH_CATM_ROOT_SEQUENCE_INDEX_TAG 0x0079
#define NFAPI_EMTC_CONFIG_PRACH_CATM_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG 0x007A
#define NFAPI_EMTC_CONFIG_PRACH_CATM_HIGH_SPEED_FLAG 0x007B
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_ENABLE_TAG 0x007C
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_CONFIGURATION_INDEX_TAG 0x007D
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_FREQUENCY_OFFSET_TAG 0x007E
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x007F
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_STARTING_SUBFRAME_PERIODICITY_TAG 0x0080
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_ENABLE_TAG 0x0081
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_OFFSET_TAG 0x0082
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_ENABLE_TAG 0x0083
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_CONFIGURATION_INDEX_TAG 0x0084
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_FREQUENCY_OFFSET_TAG 0x0085
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x0086
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_STARTING_SUBFRAME_PERIODICITY_TAG 0x0087
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_ENABLE_TAG 0x0088
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_OFFSET_TAG 0x0089
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_ENABLE_TAG 0x008A
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_CONFIGURATION_INDEX_TAG 0x008B
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_FREQUENCY_OFFSET_TAG 0x008C
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x008D
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_STARTING_SUBFRAME_PERIODICITY_TAG 0x008E
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_ENABLE_TAG 0x008F
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_OFFSET_TAG 0x0090
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_ENABLE_TAG 0x0091
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_CONFIGURATION_INDEX_TAG 0x0092
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_FREQUENCY_OFFSET_TAG 0x0093
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x0094
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_STARTING_SUBFRAME_PERIODICITY_TAG 0x0095
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_ENABLE_TAG 0x0096
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_OFFSET_TAG 0x0097
#define NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEA_TAG 0x0098
#define NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEB_TAG 0x0099

typedef struct {
	nfapi_uint16_tlv_t operating_mode;
	nfapi_uint16_tlv_t anchor;
	nfapi_uint16_tlv_t prb_index;
	nfapi_uint16_tlv_t control_region_size;
	nfapi_uint16_tlv_t assumed_crs_aps;
	nfapi_uint16_tlv_t nprach_config_0_enabled;
	nfapi_uint16_tlv_t nprach_config_0_sf_periodicity;
	nfapi_uint16_tlv_t nprach_config_0_start_time;
	nfapi_uint16_tlv_t nprach_config_0_subcarrier_offset;
	nfapi_uint16_tlv_t nprach_config_0_number_of_subcarriers;
	nfapi_uint16_tlv_t nprach_config_0_cp_length;
	nfapi_uint16_tlv_t nprach_config_0_number_of_repetitions_per_attempt;
	nfapi_uint16_tlv_t nprach_config_1_enabled;
	nfapi_uint16_tlv_t nprach_config_1_sf_periodicity;
	nfapi_uint16_tlv_t nprach_config_1_start_time;
	nfapi_uint16_tlv_t nprach_config_1_subcarrier_offset;
	nfapi_uint16_tlv_t nprach_config_1_number_of_subcarriers;
	nfapi_uint16_tlv_t nprach_config_1_cp_length;
	nfapi_uint16_tlv_t nprach_config_1_number_of_repetitions_per_attempt;
	nfapi_uint16_tlv_t nprach_config_2_enabled;
	nfapi_uint16_tlv_t nprach_config_2_sf_periodicity;
	nfapi_uint16_tlv_t nprach_config_2_start_time;
	nfapi_uint16_tlv_t nprach_config_2_subcarrier_offset;
	nfapi_uint16_tlv_t nprach_config_2_number_of_subcarriers;
	nfapi_uint16_tlv_t nprach_config_2_cp_length;
	nfapi_uint16_tlv_t nprach_config_2_number_of_repetitions_per_attempt;
	nfapi_uint16_tlv_t three_tone_base_sequence;
	nfapi_uint16_tlv_t six_tone_base_sequence;
	nfapi_uint16_tlv_t twelve_tone_base_sequence;
	nfapi_uint16_tlv_t three_tone_cyclic_shift;
	nfapi_uint16_tlv_t six_tone_cyclic_shift;
	nfapi_uint16_tlv_t dl_gap_config_enable;
	nfapi_uint16_tlv_t dl_gap_threshold;
	nfapi_uint16_tlv_t dl_gap_periodicity;
	nfapi_uint16_tlv_t dl_gap_duration_coefficient;
} nfapi_nb_iot_config_t;

#define NFAPI_NB_IOT_CONFIG_OPERATING_MODE_TAG 0x00A5
#define NFAPI_NB_IOT_CONFIG_ANCHOR_TAG 0x00A6
#define NFAPI_NB_IOT_CONFIG_PRB_INDEX_TAG 0x00A7
#define NFAPI_NB_IOT_CONFIG_CONTROL_REGION_SIZE_TAG 0x00A8
#define NFAPI_NB_IOT_CONFIG_ASSUMED_CRS_APS_TAG 0x00A9
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_ENABLED_TAG 0x00AA
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_SF_PERIODICITY_TAG 0x00AB
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_START_TIME_TAG 0x00AC
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_SUBCARRIER_OFFSET_TAG 0x00AD
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_NUMBER_OF_SUBCARRIERS_TAG 0x00AE
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_CP_LENGTH_TAG 0x00AF
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00B0
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_ENABLED_TAG 0x00B1
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_SF_PERIODICITY_TAG 0x00B2
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_START_TIME_TAG 0x00B3
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_SUBCARRIER_OFFSET_TAG 0x00B4
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_NUMBER_OF_SUBCARRIERS_TAG 0x00B5
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_CP_LENGTH_TAG 0x00B6
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00B7
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_ENABLED_TAG 0x00B8
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_SF_PERIODICITY_TAG 0x00B9
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_START_TIME_TAG 0x00BA
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_SUBCARRIER_OFFSET_TAG 0x00BB
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_NUMBER_OF_SUBCARRIERS_TAG 0x00BC
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_CP_LENGTH_TAG 0x00BD
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00BE
#define NFAPI_NB_IOT_CONFIG_THREE_TONE_BASE_SEQUENCE_TAG 0x00BF
#define NFAPI_NB_IOT_CONFIG_SIX_TONE_BASE_SEQUENCE_TAG 0x00C0
#define NFAPI_NB_IOT_CONFIG_TWELVE_TONE_BASE_SEQUENCE_TAG 0x00C1
#define NFAPI_NB_IOT_CONFIG_THREE_TONE_CYCLIC_SHIFT_TAG 0x00C2
#define NFAPI_NB_IOT_CONFIG_SIX_TONE_CYCLIC_SHIFT_TAG 0x00C3
#define NFAPI_NB_IOT_CONFIG_DL_GAP_CONFIG_ENABLE_TAG 0x00C4
#define NFAPI_NB_IOT_CONFIG_DL_GAP_THRESHOLD_TAG 0x00C5
#define NFAPI_NB_IOT_CONFIG_DL_GAP_PERIODICITY_TAG 0x00C6
#define NFAPI_NB_IOT_CONFIG_DL_GAP_DURATION_COEFFICIENT_TAG 0x00C7

typedef struct {
	nfapi_uint16_tlv_t laa_support;
	nfapi_uint16_tlv_t pd_sensing_lbt_support;
	nfapi_uint16_tlv_t multi_carrier_lbt_support;
	nfapi_uint16_tlv_t partial_sf_support;
} nfapi_laa_capability_t;

#define NFAPI_LAA_CAPABILITY_LAA_SUPPORT_TAG 0x00D1
#define NFAPI_LAA_CAPABILITY_PD_SENSING_LBT_SUPPORT_TAG 0x00D2
#define NFAPI_LAA_CAPABILITY_MULTI_CARRIER_LBT_SUPPORT_TAG 0x00D3
#define NFAPI_LAA_CAPABILITY_PARTIAL_SF_SUPPORT_TAG 0x00D4

typedef struct {
	nfapi_uint16_tlv_t nb_iot_support;
	nfapi_uint16_tlv_t nb_iot_operating_mode_capability;
} nfapi_nb_iot_capability_t;

#define NFAPI_LAA_CAPABILITY_NB_IOT_SUPPORT_TAG 0x00D5
#define NFAPI_LAA_CAPABILITY_NB_IOT_OPERATING_MODE_CAPABILITY_TAG 0x00D6

typedef struct {
	nfapi_uint16_tlv_t subframe_assignment;
	nfapi_uint16_tlv_t special_subframe_patterns;
} nfapi_tdd_frame_structure_t;

#define NFAPI_TDD_FRAME_STRUCTURE_SUBFRAME_ASSIGNMENT_TAG 0x005A
#define NFAPI_TDD_FRAME_STRUCTURE_SPECIAL_SUBFRAME_PATTERNS_TAG 0x005B

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_rf_bands;
	uint16_t rf_band[NFAPI_MAX_NUM_RF_BANDS];
} nfapi_rf_bands_t;
#define NFAPI_PHY_RF_BANDS_TAG 0x0114

#define NFAPI_IPV4_ADDRESS_LENGTH 4
#define NFAPI_IPV6_ADDRESS_LENGTH 16

// Convience enum to allow the ip addres type to be distinguished
typedef enum {
	NFAPI_IP_ADDRESS_IPV4 = 0,
	NFAPI_IP_ADDRESS_IPV6
} nfapi_ip_address_type_e;

// The type could be infered from the length, but it is clearer in 
// code to have a type variable set
typedef struct {
	nfapi_tl_t tl;
	uint8_t type;
	union {
		uint8_t ipv4_address[NFAPI_IPV4_ADDRESS_LENGTH];
		uint8_t ipv6_address[NFAPI_IPV6_ADDRESS_LENGTH];
	} u;
} nfapi_ip_address_t;

typedef struct {
	nfapi_tl_t tl;
	uint8_t address[NFAPI_IPV4_ADDRESS_LENGTH];
} nfapi_ipv4_address_t;

typedef struct {
	nfapi_tl_t tl;
	uint8_t address[NFAPI_IPV6_ADDRESS_LENGTH];
} nfapi_ipv6_address_t;



typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_rf_bands;
	uint16_t bands[NFAPI_MAX_NMM_FREQUENCY_BANDS];
} nfapi_nmm_frequency_bands_t;

//These TLVs are used exclusively by nFAPI
typedef struct
{
	// These TLVs are used to setup the transport connection between VNF and PNF
	nfapi_ipv4_address_t p7_vnf_address_ipv4;
	nfapi_ipv6_address_t p7_vnf_address_ipv6;
	nfapi_uint16_tlv_t p7_vnf_port;

	nfapi_ipv4_address_t p7_pnf_address_ipv4;
	nfapi_ipv6_address_t p7_pnf_address_ipv6;
	nfapi_uint16_tlv_t p7_pnf_port;
	
	// These TLVs are used to setup the transport connection between VNF and PNF
	nfapi_uint8_tlv_t dl_ue_per_sf;
	nfapi_uint8_tlv_t ul_ue_per_sf;

	// These TLVs are used by PNF to report its RF capabilities to the VNF software
	nfapi_rf_bands_t rf_bands;

	// These TLVs are used by the VNF to configure the synchronization with the PNF.
	nfapi_uint8_tlv_t timing_window;
	nfapi_uint8_tlv_t timing_info_mode;
	nfapi_uint8_tlv_t timing_info_period;

	// These TLVs are used by the VNF to configure the RF in the PNF
	nfapi_uint16_tlv_t max_transmit_power;
	nfapi_uint16_tlv_t earfcn;

	nfapi_nmm_frequency_bands_t nmm_gsm_frequency_bands;
	nfapi_nmm_frequency_bands_t nmm_umts_frequency_bands;
	nfapi_nmm_frequency_bands_t nmm_lte_frequency_bands;
	nfapi_uint8_tlv_t nmm_uplink_rssi_supported;

For faster browsing, not all history is shown. View entire blame