Add version 0.5.0
[ric-plt/submgr.git] / e2ap / lib / EnhancedRNTP.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "X2AP-IEs"
4  *      found in "Spec/e2ap-v031ex.asn"
5  *      `asn1c -fcompound-names -fno-include-deps -findirect-choice -gen-PER`
6  */
7
8 #include "EnhancedRNTP.h"
9
10 #include "EnhancedRNTPStartTime.h"
11 #include "ProtocolExtensionContainer.h"
12 static int
13 memb_enhancedRNTPBitmap_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
14                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
15         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
16         size_t size;
17         
18         if(!sptr) {
19                 ASN__CTFAIL(app_key, td, sptr,
20                         "%s: value not given (%s:%d)",
21                         td->name, __FILE__, __LINE__);
22                 return -1;
23         }
24         
25         if(st->size > 0) {
26                 /* Size in bits */
27                 size = 8 * st->size - (st->bits_unused & 0x07);
28         } else {
29                 size = 0;
30         }
31         
32         if((size >= 12 && size <= 8800)) {
33                 /* Constraint check succeeded */
34                 return 0;
35         } else {
36                 ASN__CTFAIL(app_key, td, sptr,
37                         "%s: constraint failed (%s:%d)",
38                         td->name, __FILE__, __LINE__);
39                 return -1;
40         }
41 }
42
43 static asn_oer_constraints_t asn_OER_memb_enhancedRNTPBitmap_constr_2 CC_NOTUSED = {
44         { 0, 0 },
45         -1      /* (SIZE(0..MAX)) */};
46 static asn_per_constraints_t asn_PER_memb_enhancedRNTPBitmap_constr_2 CC_NOTUSED = {
47         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
48         { APC_CONSTRAINED | APC_EXTENSIBLE,  14,  14,  12,  8800 }      /* (SIZE(12..8800,...)) */,
49         0, 0    /* No PER value map */
50 };
51 static asn_TYPE_member_t asn_MBR_EnhancedRNTP_1[] = {
52         { ATF_NOFLAGS, 0, offsetof(struct EnhancedRNTP, enhancedRNTPBitmap),
53                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
54                 -1,     /* IMPLICIT tag at current level */
55                 &asn_DEF_BIT_STRING,
56                 0,
57                 { &asn_OER_memb_enhancedRNTPBitmap_constr_2, &asn_PER_memb_enhancedRNTPBitmap_constr_2,  memb_enhancedRNTPBitmap_constraint_1 },
58                 0, 0, /* No default value */
59                 "enhancedRNTPBitmap"
60                 },
61         { ATF_NOFLAGS, 0, offsetof(struct EnhancedRNTP, rNTP_High_Power_Threshold),
62                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
63                 -1,     /* IMPLICIT tag at current level */
64                 &asn_DEF_RNTP_Threshold,
65                 0,
66                 { 0, 0, 0 },
67                 0, 0, /* No default value */
68                 "rNTP-High-Power-Threshold"
69                 },
70         { ATF_POINTER, 2, offsetof(struct EnhancedRNTP, enhancedRNTPStartTime),
71                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
72                 -1,     /* IMPLICIT tag at current level */
73                 &asn_DEF_EnhancedRNTPStartTime,
74                 0,
75                 { 0, 0, 0 },
76                 0, 0, /* No default value */
77                 "enhancedRNTPStartTime"
78                 },
79         { ATF_POINTER, 1, offsetof(struct EnhancedRNTP, iE_Extensions),
80                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
81                 -1,     /* IMPLICIT tag at current level */
82                 &asn_DEF_ProtocolExtensionContainer_9566P135,
83                 0,
84                 { 0, 0, 0 },
85                 0, 0, /* No default value */
86                 "iE-Extensions"
87                 },
88 };
89 static const int asn_MAP_EnhancedRNTP_oms_1[] = { 2, 3 };
90 static const ber_tlv_tag_t asn_DEF_EnhancedRNTP_tags_1[] = {
91         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
92 };
93 static const asn_TYPE_tag2member_t asn_MAP_EnhancedRNTP_tag2el_1[] = {
94     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* enhancedRNTPBitmap */
95     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* rNTP-High-Power-Threshold */
96     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* enhancedRNTPStartTime */
97     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* iE-Extensions */
98 };
99 static asn_SEQUENCE_specifics_t asn_SPC_EnhancedRNTP_specs_1 = {
100         sizeof(struct EnhancedRNTP),
101         offsetof(struct EnhancedRNTP, _asn_ctx),
102         asn_MAP_EnhancedRNTP_tag2el_1,
103         4,      /* Count of tags in the map */
104         asn_MAP_EnhancedRNTP_oms_1,     /* Optional members */
105         2, 0,   /* Root/Additions */
106         4,      /* First extension addition */
107 };
108 asn_TYPE_descriptor_t asn_DEF_EnhancedRNTP = {
109         "EnhancedRNTP",
110         "EnhancedRNTP",
111         &asn_OP_SEQUENCE,
112         asn_DEF_EnhancedRNTP_tags_1,
113         sizeof(asn_DEF_EnhancedRNTP_tags_1)
114                 /sizeof(asn_DEF_EnhancedRNTP_tags_1[0]), /* 1 */
115         asn_DEF_EnhancedRNTP_tags_1,    /* Same as above */
116         sizeof(asn_DEF_EnhancedRNTP_tags_1)
117                 /sizeof(asn_DEF_EnhancedRNTP_tags_1[0]), /* 1 */
118         { 0, 0, SEQUENCE_constraint },
119         asn_MBR_EnhancedRNTP_1,
120         4,      /* Elements count */
121         &asn_SPC_EnhancedRNTP_specs_1   /* Additional specs */
122 };
123