[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-441]: Update name of Paging RRC Codec
[o-du/l2.git] / src / codec_utils / RRC / CellIdentity-EUTRA-5GC.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "NR-RRC-Definitions"
4  *      found in "./22April22_Paging/rrc_15.3_asn.asn1"
5  *      `asn1c -D ./22April22_Paging -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
6  */
7
8 #include "CellIdentity-EUTRA-5GC.h"
9
10 static int
11 memb_cellIdentity_EUTRA_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
12                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
14         size_t size;
15         
16         if(!sptr) {
17                 ASN__CTFAIL(app_key, td, sptr,
18                         "%s: value not given (%s:%d)",
19                         td->name, __FILE__, __LINE__);
20                 return -1;
21         }
22         
23         if(st->size > 0) {
24                 /* Size in bits */
25                 size = 8 * st->size - (st->bits_unused & 0x07);
26         } else {
27                 size = 0;
28         }
29         
30         if((size == 28)) {
31                 /* Constraint check succeeded */
32                 return 0;
33         } else {
34                 ASN__CTFAIL(app_key, td, sptr,
35                         "%s: constraint failed (%s:%d)",
36                         td->name, __FILE__, __LINE__);
37                 return -1;
38         }
39 }
40
41 static int
42 memb_cellId_index_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
43                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
44         long value;
45         
46         if(!sptr) {
47                 ASN__CTFAIL(app_key, td, sptr,
48                         "%s: value not given (%s:%d)",
49                         td->name, __FILE__, __LINE__);
50                 return -1;
51         }
52         
53         value = *(const long *)sptr;
54         
55         if((value >= 1 && value <= 12)) {
56                 /* Constraint check succeeded */
57                 return 0;
58         } else {
59                 ASN__CTFAIL(app_key, td, sptr,
60                         "%s: constraint failed (%s:%d)",
61                         td->name, __FILE__, __LINE__);
62                 return -1;
63         }
64 }
65
66 static asn_oer_constraints_t asn_OER_memb_cellIdentity_EUTRA_constr_2 CC_NOTUSED = {
67         { 0, 0 },
68         28      /* (SIZE(28..28)) */};
69 static asn_per_constraints_t asn_PER_memb_cellIdentity_EUTRA_constr_2 CC_NOTUSED = {
70         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
71         { APC_CONSTRAINED,       0,  0,  28,  28 }      /* (SIZE(28..28)) */,
72         0, 0    /* No PER value map */
73 };
74 static asn_oer_constraints_t asn_OER_memb_cellId_index_constr_3 CC_NOTUSED = {
75         { 1, 1 }        /* (1..12) */,
76         -1};
77 static asn_per_constraints_t asn_PER_memb_cellId_index_constr_3 CC_NOTUSED = {
78         { APC_CONSTRAINED,       4,  4,  1,  12 }       /* (1..12) */,
79         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
80         0, 0    /* No PER value map */
81 };
82 static asn_oer_constraints_t asn_OER_type_CellIdentity_EUTRA_5GC_constr_1 CC_NOTUSED = {
83         { 0, 0 },
84         -1};
85 asn_per_constraints_t asn_PER_type_CellIdentity_EUTRA_5GC_constr_1 CC_NOTUSED = {
86         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
87         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
88         0, 0    /* No PER value map */
89 };
90 asn_TYPE_member_t asn_MBR_CellIdentity_EUTRA_5GC_1[] = {
91         { ATF_NOFLAGS, 0, offsetof(struct CellIdentity_EUTRA_5GC, choice.cellIdentity_EUTRA),
92                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
93                 -1,     /* IMPLICIT tag at current level */
94                 &asn_DEF_BIT_STRING,
95                 0,
96                 { &asn_OER_memb_cellIdentity_EUTRA_constr_2, &asn_PER_memb_cellIdentity_EUTRA_constr_2,  memb_cellIdentity_EUTRA_constraint_1 },
97                 0, 0, /* No default value */
98                 "cellIdentity-EUTRA"
99                 },
100         { ATF_NOFLAGS, 0, offsetof(struct CellIdentity_EUTRA_5GC, choice.cellId_index),
101                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
102                 -1,     /* IMPLICIT tag at current level */
103                 &asn_DEF_NativeInteger,
104                 0,
105                 { &asn_OER_memb_cellId_index_constr_3, &asn_PER_memb_cellId_index_constr_3,  memb_cellId_index_constraint_1 },
106                 0, 0, /* No default value */
107                 "cellId-index"
108                 },
109 };
110 static const asn_TYPE_tag2member_t asn_MAP_CellIdentity_EUTRA_5GC_tag2el_1[] = {
111     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* cellIdentity-EUTRA */
112     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* cellId-index */
113 };
114 asn_CHOICE_specifics_t asn_SPC_CellIdentity_EUTRA_5GC_specs_1 = {
115         sizeof(struct CellIdentity_EUTRA_5GC),
116         offsetof(struct CellIdentity_EUTRA_5GC, _asn_ctx),
117         offsetof(struct CellIdentity_EUTRA_5GC, present),
118         sizeof(((struct CellIdentity_EUTRA_5GC *)0)->present),
119         asn_MAP_CellIdentity_EUTRA_5GC_tag2el_1,
120         2,      /* Count of tags in the map */
121         0, 0,
122         -1      /* Extensions start */
123 };
124 asn_TYPE_descriptor_t asn_DEF_CellIdentity_EUTRA_5GC = {
125         "CellIdentity-EUTRA-5GC",
126         "CellIdentity-EUTRA-5GC",
127         &asn_OP_CHOICE,
128         0,      /* No effective tags (pointer) */
129         0,      /* No effective tags (count) */
130         0,      /* No tags (pointer) */
131         0,      /* No tags (count) */
132         { &asn_OER_type_CellIdentity_EUTRA_5GC_constr_1, &asn_PER_type_CellIdentity_EUTRA_5GC_constr_1, CHOICE_constraint },
133         asn_MBR_CellIdentity_EUTRA_5GC_1,
134         2,      /* Elements count */
135         &asn_SPC_CellIdentity_EUTRA_5GC_specs_1 /* Additional specs */
136 };
137