6d5e7669dcd80df652e13fb1aca9355f2a855206
[o-du/l2.git] / src / codec_utils / RRC / NAICS-Capability-Entry.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "NR-RRC-Definitions"
4  *      found in "/home/labadmin/hlal/rrc_15.3_asn.asn1"
5  *      `asn1c -D ./15_3_rrc/ -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
6  */
7
8 #include "NAICS-Capability-Entry.h"
9
10 /*
11  * This type is implemented using NativeEnumerated,
12  * so here we adjust the DEF accordingly.
13  */
14 static int
15 memb_numberOfNAICS_CapableCC_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
16                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
17         long value;
18         
19         if(!sptr) {
20                 ASN__CTFAIL(app_key, td, sptr,
21                         "%s: value not given (%s:%d)",
22                         td->name, __FILE__, __LINE__);
23                 return -1;
24         }
25         
26         value = *(const long *)sptr;
27         
28         if((value >= 1 && value <= 5)) {
29                 /* Constraint check succeeded */
30                 return 0;
31         } else {
32                 ASN__CTFAIL(app_key, td, sptr,
33                         "%s: constraint failed (%s:%d)",
34                         td->name, __FILE__, __LINE__);
35                 return -1;
36         }
37 }
38
39 static asn_oer_constraints_t asn_OER_type_numberOfAggregatedPRB_constr_3 CC_NOTUSED = {
40         { 0, 0 },
41         -1};
42 static asn_per_constraints_t asn_PER_type_numberOfAggregatedPRB_constr_3 CC_NOTUSED = {
43         { APC_CONSTRAINED,       4,  4,  0,  15 }       /* (0..15) */,
44         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
45         0, 0    /* No PER value map */
46 };
47 static asn_oer_constraints_t asn_OER_memb_numberOfNAICS_CapableCC_constr_2 CC_NOTUSED = {
48         { 1, 1 }        /* (1..5) */,
49         -1};
50 static asn_per_constraints_t asn_PER_memb_numberOfNAICS_CapableCC_constr_2 CC_NOTUSED = {
51         { APC_CONSTRAINED,       3,  3,  1,  5 }        /* (1..5) */,
52         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
53         0, 0    /* No PER value map */
54 };
55 static const asn_INTEGER_enum_map_t asn_MAP_numberOfAggregatedPRB_value2enum_3[] = {
56         { 0,    3,      "n50" },
57         { 1,    3,      "n75" },
58         { 2,    4,      "n100" },
59         { 3,    4,      "n125" },
60         { 4,    4,      "n150" },
61         { 5,    4,      "n175" },
62         { 6,    4,      "n200" },
63         { 7,    4,      "n225" },
64         { 8,    4,      "n250" },
65         { 9,    4,      "n275" },
66         { 10,   4,      "n300" },
67         { 11,   4,      "n350" },
68         { 12,   4,      "n400" },
69         { 13,   4,      "n450" },
70         { 14,   4,      "n500" },
71         { 15,   5,      "spare" }
72 };
73 static const unsigned int asn_MAP_numberOfAggregatedPRB_enum2value_3[] = {
74         2,      /* n100(2) */
75         3,      /* n125(3) */
76         4,      /* n150(4) */
77         5,      /* n175(5) */
78         6,      /* n200(6) */
79         7,      /* n225(7) */
80         8,      /* n250(8) */
81         9,      /* n275(9) */
82         10,     /* n300(10) */
83         11,     /* n350(11) */
84         12,     /* n400(12) */
85         13,     /* n450(13) */
86         0,      /* n50(0) */
87         14,     /* n500(14) */
88         1,      /* n75(1) */
89         15      /* spare(15) */
90 };
91 static const asn_INTEGER_specifics_t asn_SPC_numberOfAggregatedPRB_specs_3 = {
92         asn_MAP_numberOfAggregatedPRB_value2enum_3,     /* "tag" => N; sorted by tag */
93         asn_MAP_numberOfAggregatedPRB_enum2value_3,     /* N => "tag"; sorted by N */
94         16,     /* Number of elements in the maps */
95         0,      /* Enumeration is not extensible */
96         1,      /* Strict enumeration */
97         0,      /* Native long size */
98         0
99 };
100 static const ber_tlv_tag_t asn_DEF_numberOfAggregatedPRB_tags_3[] = {
101         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
102         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
103 };
104 static /* Use -fall-defs-global to expose */
105 asn_TYPE_descriptor_t asn_DEF_numberOfAggregatedPRB_3 = {
106         "numberOfAggregatedPRB",
107         "numberOfAggregatedPRB",
108         &asn_OP_NativeEnumerated,
109         asn_DEF_numberOfAggregatedPRB_tags_3,
110         sizeof(asn_DEF_numberOfAggregatedPRB_tags_3)
111                 /sizeof(asn_DEF_numberOfAggregatedPRB_tags_3[0]) - 1, /* 1 */
112         asn_DEF_numberOfAggregatedPRB_tags_3,   /* Same as above */
113         sizeof(asn_DEF_numberOfAggregatedPRB_tags_3)
114                 /sizeof(asn_DEF_numberOfAggregatedPRB_tags_3[0]), /* 2 */
115         { &asn_OER_type_numberOfAggregatedPRB_constr_3, &asn_PER_type_numberOfAggregatedPRB_constr_3, NativeEnumerated_constraint },
116         0, 0,   /* Defined elsewhere */
117         &asn_SPC_numberOfAggregatedPRB_specs_3  /* Additional specs */
118 };
119
120 asn_TYPE_member_t asn_MBR_NAICS_Capability_Entry_1[] = {
121         { ATF_NOFLAGS, 0, offsetof(struct NAICS_Capability_Entry, numberOfNAICS_CapableCC),
122                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
123                 -1,     /* IMPLICIT tag at current level */
124                 &asn_DEF_NativeInteger,
125                 0,
126                 { &asn_OER_memb_numberOfNAICS_CapableCC_constr_2, &asn_PER_memb_numberOfNAICS_CapableCC_constr_2,  memb_numberOfNAICS_CapableCC_constraint_1 },
127                 0, 0, /* No default value */
128                 "numberOfNAICS-CapableCC"
129                 },
130         { ATF_NOFLAGS, 0, offsetof(struct NAICS_Capability_Entry, numberOfAggregatedPRB),
131                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
132                 -1,     /* IMPLICIT tag at current level */
133                 &asn_DEF_numberOfAggregatedPRB_3,
134                 0,
135                 { 0, 0, 0 },
136                 0, 0, /* No default value */
137                 "numberOfAggregatedPRB"
138                 },
139 };
140 static const ber_tlv_tag_t asn_DEF_NAICS_Capability_Entry_tags_1[] = {
141         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
142 };
143 static const asn_TYPE_tag2member_t asn_MAP_NAICS_Capability_Entry_tag2el_1[] = {
144     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* numberOfNAICS-CapableCC */
145     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* numberOfAggregatedPRB */
146 };
147 asn_SEQUENCE_specifics_t asn_SPC_NAICS_Capability_Entry_specs_1 = {
148         sizeof(struct NAICS_Capability_Entry),
149         offsetof(struct NAICS_Capability_Entry, _asn_ctx),
150         asn_MAP_NAICS_Capability_Entry_tag2el_1,
151         2,      /* Count of tags in the map */
152         0, 0, 0,        /* Optional elements (not needed) */
153         2,      /* First extension addition */
154 };
155 asn_TYPE_descriptor_t asn_DEF_NAICS_Capability_Entry = {
156         "NAICS-Capability-Entry",
157         "NAICS-Capability-Entry",
158         &asn_OP_SEQUENCE,
159         asn_DEF_NAICS_Capability_Entry_tags_1,
160         sizeof(asn_DEF_NAICS_Capability_Entry_tags_1)
161                 /sizeof(asn_DEF_NAICS_Capability_Entry_tags_1[0]), /* 1 */
162         asn_DEF_NAICS_Capability_Entry_tags_1,  /* Same as above */
163         sizeof(asn_DEF_NAICS_Capability_Entry_tags_1)
164                 /sizeof(asn_DEF_NAICS_Capability_Entry_tags_1[0]), /* 1 */
165         { 0, 0, SEQUENCE_constraint },
166         asn_MBR_NAICS_Capability_Entry_1,
167         2,      /* Elements count */
168         &asn_SPC_NAICS_Capability_Entry_specs_1 /* Additional specs */
169 };
170