RICPLT-2801 Implement Subscription Request timer, RICPLT-2801 Implement Subscription...
[ric-plt/submgr.git] / e2ap / lib / ProtectedResourceList-Item.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "X2AP-IEs"
4  *      found in "X2AP-15-4-0.asn1"
5  *      `asn1c -D ./asn1_n1 -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
6  */
7
8 #include "ProtectedResourceList-Item.h"
9
10 #include "ProtocolExtensionContainer.h"
11 static int
12 memb_intraPRBProtectedResourceFootprint_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
13                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
14         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
15         size_t size;
16         
17         if(!sptr) {
18                 ASN__CTFAIL(app_key, td, sptr,
19                         "%s: value not given (%s:%d)",
20                         td->name, __FILE__, __LINE__);
21                 return -1;
22         }
23         
24         if(st->size > 0) {
25                 /* Size in bits */
26                 size = 8 * st->size - (st->bits_unused & 0x07);
27         } else {
28                 size = 0;
29         }
30         
31         if((size == 84)) {
32                 /* Constraint check succeeded */
33                 return 0;
34         } else {
35                 ASN__CTFAIL(app_key, td, sptr,
36                         "%s: constraint failed (%s:%d)",
37                         td->name, __FILE__, __LINE__);
38                 return -1;
39         }
40 }
41
42 static int
43 memb_protectedFootprintFrequencyPattern_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
44                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
45         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
46         size_t size;
47         
48         if(!sptr) {
49                 ASN__CTFAIL(app_key, td, sptr,
50                         "%s: value not given (%s:%d)",
51                         td->name, __FILE__, __LINE__);
52                 return -1;
53         }
54         
55         if(st->size > 0) {
56                 /* Size in bits */
57                 size = 8 * st->size - (st->bits_unused & 0x07);
58         } else {
59                 size = 0;
60         }
61         
62         if((size >= 6 && size <= 110)) {
63                 /* Constraint check succeeded */
64                 return 0;
65         } else {
66                 ASN__CTFAIL(app_key, td, sptr,
67                         "%s: constraint failed (%s:%d)",
68                         td->name, __FILE__, __LINE__);
69                 return -1;
70         }
71 }
72
73 static asn_oer_constraints_t asn_OER_memb_intraPRBProtectedResourceFootprint_constr_3 CC_NOTUSED = {
74         { 0, 0 },
75         -1      /* (SIZE(0..MAX)) */};
76 static asn_per_constraints_t asn_PER_memb_intraPRBProtectedResourceFootprint_constr_3 CC_NOTUSED = {
77         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
78         { APC_CONSTRAINED | APC_EXTENSIBLE,  0,  0,  84,  84 }  /* (SIZE(84..84,...)) */,
79         0, 0    /* No PER value map */
80 };
81 static asn_oer_constraints_t asn_OER_memb_protectedFootprintFrequencyPattern_constr_4 CC_NOTUSED = {
82         { 0, 0 },
83         -1      /* (SIZE(0..MAX)) */};
84 static asn_per_constraints_t asn_PER_memb_protectedFootprintFrequencyPattern_constr_4 CC_NOTUSED = {
85         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
86         { APC_CONSTRAINED | APC_EXTENSIBLE,  7,  7,  6,  110 }  /* (SIZE(6..110,...)) */,
87         0, 0    /* No PER value map */
88 };
89 asn_TYPE_member_t asn_MBR_ProtectedResourceList_Item_1[] = {
90         { ATF_NOFLAGS, 0, offsetof(struct ProtectedResourceList_Item, resourceType),
91                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
92                 -1,     /* IMPLICIT tag at current level */
93                 &asn_DEF_ResourceType,
94                 0,
95                 { 0, 0, 0 },
96                 0, 0, /* No default value */
97                 "resourceType"
98                 },
99         { ATF_NOFLAGS, 0, offsetof(struct ProtectedResourceList_Item, intraPRBProtectedResourceFootprint),
100                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
101                 -1,     /* IMPLICIT tag at current level */
102                 &asn_DEF_BIT_STRING,
103                 0,
104                 { &asn_OER_memb_intraPRBProtectedResourceFootprint_constr_3, &asn_PER_memb_intraPRBProtectedResourceFootprint_constr_3,  memb_intraPRBProtectedResourceFootprint_constraint_1 },
105                 0, 0, /* No default value */
106                 "intraPRBProtectedResourceFootprint"
107                 },
108         { ATF_NOFLAGS, 0, offsetof(struct ProtectedResourceList_Item, protectedFootprintFrequencyPattern),
109                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
110                 -1,     /* IMPLICIT tag at current level */
111                 &asn_DEF_BIT_STRING,
112                 0,
113                 { &asn_OER_memb_protectedFootprintFrequencyPattern_constr_4, &asn_PER_memb_protectedFootprintFrequencyPattern_constr_4,  memb_protectedFootprintFrequencyPattern_constraint_1 },
114                 0, 0, /* No default value */
115                 "protectedFootprintFrequencyPattern"
116                 },
117         { ATF_NOFLAGS, 0, offsetof(struct ProtectedResourceList_Item, protectedFootprintTimePattern),
118                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
119                 -1,     /* IMPLICIT tag at current level */
120                 &asn_DEF_ProtectedFootprintTimePattern,
121                 0,
122                 { 0, 0, 0 },
123                 0, 0, /* No default value */
124                 "protectedFootprintTimePattern"
125                 },
126         { ATF_POINTER, 1, offsetof(struct ProtectedResourceList_Item, iE_Extensions),
127                 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
128                 -1,     /* IMPLICIT tag at current level */
129                 &asn_DEF_ProtocolExtensionContainer_7683P182,
130                 0,
131                 { 0, 0, 0 },
132                 0, 0, /* No default value */
133                 "iE-Extensions"
134                 },
135 };
136 static const int asn_MAP_ProtectedResourceList_Item_oms_1[] = { 4 };
137 static const ber_tlv_tag_t asn_DEF_ProtectedResourceList_Item_tags_1[] = {
138         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
139 };
140 static const asn_TYPE_tag2member_t asn_MAP_ProtectedResourceList_Item_tag2el_1[] = {
141     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* resourceType */
142     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* intraPRBProtectedResourceFootprint */
143     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* protectedFootprintFrequencyPattern */
144     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* protectedFootprintTimePattern */
145     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* iE-Extensions */
146 };
147 asn_SEQUENCE_specifics_t asn_SPC_ProtectedResourceList_Item_specs_1 = {
148         sizeof(struct ProtectedResourceList_Item),
149         offsetof(struct ProtectedResourceList_Item, _asn_ctx),
150         asn_MAP_ProtectedResourceList_Item_tag2el_1,
151         5,      /* Count of tags in the map */
152         asn_MAP_ProtectedResourceList_Item_oms_1,       /* Optional members */
153         1, 0,   /* Root/Additions */
154         5,      /* First extension addition */
155 };
156 asn_TYPE_descriptor_t asn_DEF_ProtectedResourceList_Item = {
157         "ProtectedResourceList-Item",
158         "ProtectedResourceList-Item",
159         &asn_OP_SEQUENCE,
160         asn_DEF_ProtectedResourceList_Item_tags_1,
161         sizeof(asn_DEF_ProtectedResourceList_Item_tags_1)
162                 /sizeof(asn_DEF_ProtectedResourceList_Item_tags_1[0]), /* 1 */
163         asn_DEF_ProtectedResourceList_Item_tags_1,      /* Same as above */
164         sizeof(asn_DEF_ProtectedResourceList_Item_tags_1)
165                 /sizeof(asn_DEF_ProtectedResourceList_Item_tags_1[0]), /* 1 */
166         { 0, 0, SEQUENCE_constraint },
167         asn_MBR_ProtectedResourceList_Item_1,
168         5,      /* Elements count */
169         &asn_SPC_ProtectedResourceList_Item_specs_1     /* Additional specs */
170 };
171