53df1ceb06ffa5aa5a7e8886ab86e46e514afc6e
[o-du/l2.git] / src / codec_utils / RRC / PDSCH-TimeDomainResourceAllocation.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 "PDSCH-TimeDomainResourceAllocation.h"
9
10 /*
11  * This type is implemented using NativeEnumerated,
12  * so here we adjust the DEF accordingly.
13  */
14 static int
15 memb_k0_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 >= 0 && value <= 32)) {
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 int
40 memb_startSymbolAndLength_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
41                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
42         long value;
43         
44         if(!sptr) {
45                 ASN__CTFAIL(app_key, td, sptr,
46                         "%s: value not given (%s:%d)",
47                         td->name, __FILE__, __LINE__);
48                 return -1;
49         }
50         
51         value = *(const long *)sptr;
52         
53         if((value >= 0 && value <= 127)) {
54                 /* Constraint check succeeded */
55                 return 0;
56         } else {
57                 ASN__CTFAIL(app_key, td, sptr,
58                         "%s: constraint failed (%s:%d)",
59                         td->name, __FILE__, __LINE__);
60                 return -1;
61         }
62 }
63
64 static asn_oer_constraints_t asn_OER_type_mappingType_constr_3 CC_NOTUSED = {
65         { 0, 0 },
66         -1};
67 static asn_per_constraints_t asn_PER_type_mappingType_constr_3 CC_NOTUSED = {
68         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
69         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
70         0, 0    /* No PER value map */
71 };
72 static asn_oer_constraints_t asn_OER_memb_k0_constr_2 CC_NOTUSED = {
73         { 1, 1 }        /* (0..32) */,
74         -1};
75 static asn_per_constraints_t asn_PER_memb_k0_constr_2 CC_NOTUSED = {
76         { APC_CONSTRAINED,       6,  6,  0,  32 }       /* (0..32) */,
77         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
78         0, 0    /* No PER value map */
79 };
80 static asn_oer_constraints_t asn_OER_memb_startSymbolAndLength_constr_6 CC_NOTUSED = {
81         { 1, 1 }        /* (0..127) */,
82         -1};
83 static asn_per_constraints_t asn_PER_memb_startSymbolAndLength_constr_6 CC_NOTUSED = {
84         { APC_CONSTRAINED,       7,  7,  0,  127 }      /* (0..127) */,
85         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
86         0, 0    /* No PER value map */
87 };
88 static const asn_INTEGER_enum_map_t asn_MAP_mappingType_value2enum_3[] = {
89         { 0,    5,      "typeA" },
90         { 1,    5,      "typeB" }
91 };
92 static const unsigned int asn_MAP_mappingType_enum2value_3[] = {
93         0,      /* typeA(0) */
94         1       /* typeB(1) */
95 };
96 static const asn_INTEGER_specifics_t asn_SPC_mappingType_specs_3 = {
97         asn_MAP_mappingType_value2enum_3,       /* "tag" => N; sorted by tag */
98         asn_MAP_mappingType_enum2value_3,       /* N => "tag"; sorted by N */
99         2,      /* Number of elements in the maps */
100         0,      /* Enumeration is not extensible */
101         1,      /* Strict enumeration */
102         0,      /* Native long size */
103         0
104 };
105 static const ber_tlv_tag_t asn_DEF_mappingType_tags_3[] = {
106         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
107         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
108 };
109 static /* Use -fall-defs-global to expose */
110 asn_TYPE_descriptor_t asn_DEF_mappingType_3 = {
111         "mappingType",
112         "mappingType",
113         &asn_OP_NativeEnumerated,
114         asn_DEF_mappingType_tags_3,
115         sizeof(asn_DEF_mappingType_tags_3)
116                 /sizeof(asn_DEF_mappingType_tags_3[0]) - 1, /* 1 */
117         asn_DEF_mappingType_tags_3,     /* Same as above */
118         sizeof(asn_DEF_mappingType_tags_3)
119                 /sizeof(asn_DEF_mappingType_tags_3[0]), /* 2 */
120         { &asn_OER_type_mappingType_constr_3, &asn_PER_type_mappingType_constr_3, NativeEnumerated_constraint },
121         0, 0,   /* Defined elsewhere */
122         &asn_SPC_mappingType_specs_3    /* Additional specs */
123 };
124
125 asn_TYPE_member_t asn_MBR_PDSCH_TimeDomainResourceAllocation_1[] = {
126         { ATF_POINTER, 1, offsetof(struct PDSCH_TimeDomainResourceAllocation, k0),
127                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
128                 -1,     /* IMPLICIT tag at current level */
129                 &asn_DEF_NativeInteger,
130                 0,
131                 { &asn_OER_memb_k0_constr_2, &asn_PER_memb_k0_constr_2,  memb_k0_constraint_1 },
132                 0, 0, /* No default value */
133                 "k0"
134                 },
135         { ATF_NOFLAGS, 0, offsetof(struct PDSCH_TimeDomainResourceAllocation, mappingType),
136                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
137                 -1,     /* IMPLICIT tag at current level */
138                 &asn_DEF_mappingType_3,
139                 0,
140                 { 0, 0, 0 },
141                 0, 0, /* No default value */
142                 "mappingType"
143                 },
144         { ATF_NOFLAGS, 0, offsetof(struct PDSCH_TimeDomainResourceAllocation, startSymbolAndLength),
145                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
146                 -1,     /* IMPLICIT tag at current level */
147                 &asn_DEF_NativeInteger,
148                 0,
149                 { &asn_OER_memb_startSymbolAndLength_constr_6, &asn_PER_memb_startSymbolAndLength_constr_6,  memb_startSymbolAndLength_constraint_1 },
150                 0, 0, /* No default value */
151                 "startSymbolAndLength"
152                 },
153 };
154 static const int asn_MAP_PDSCH_TimeDomainResourceAllocation_oms_1[] = { 0 };
155 static const ber_tlv_tag_t asn_DEF_PDSCH_TimeDomainResourceAllocation_tags_1[] = {
156         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
157 };
158 static const asn_TYPE_tag2member_t asn_MAP_PDSCH_TimeDomainResourceAllocation_tag2el_1[] = {
159     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* k0 */
160     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* mappingType */
161     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* startSymbolAndLength */
162 };
163 asn_SEQUENCE_specifics_t asn_SPC_PDSCH_TimeDomainResourceAllocation_specs_1 = {
164         sizeof(struct PDSCH_TimeDomainResourceAllocation),
165         offsetof(struct PDSCH_TimeDomainResourceAllocation, _asn_ctx),
166         asn_MAP_PDSCH_TimeDomainResourceAllocation_tag2el_1,
167         3,      /* Count of tags in the map */
168         asn_MAP_PDSCH_TimeDomainResourceAllocation_oms_1,       /* Optional members */
169         1, 0,   /* Root/Additions */
170         -1,     /* First extension addition */
171 };
172 asn_TYPE_descriptor_t asn_DEF_PDSCH_TimeDomainResourceAllocation = {
173         "PDSCH-TimeDomainResourceAllocation",
174         "PDSCH-TimeDomainResourceAllocation",
175         &asn_OP_SEQUENCE,
176         asn_DEF_PDSCH_TimeDomainResourceAllocation_tags_1,
177         sizeof(asn_DEF_PDSCH_TimeDomainResourceAllocation_tags_1)
178                 /sizeof(asn_DEF_PDSCH_TimeDomainResourceAllocation_tags_1[0]), /* 1 */
179         asn_DEF_PDSCH_TimeDomainResourceAllocation_tags_1,      /* Same as above */
180         sizeof(asn_DEF_PDSCH_TimeDomainResourceAllocation_tags_1)
181                 /sizeof(asn_DEF_PDSCH_TimeDomainResourceAllocation_tags_1[0]), /* 1 */
182         { 0, 0, SEQUENCE_constraint },
183         asn_MBR_PDSCH_TimeDomainResourceAllocation_1,
184         3,      /* Elements count */
185         &asn_SPC_PDSCH_TimeDomainResourceAllocation_specs_1     /* Additional specs */
186 };
187