SIM-115: update simulator to use latest E2SM KPM version 3
[sim/e2-interface.git] / e2sim / asn1c / TNLinformation.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "E2AP-IEs"
4  *      found in "e2ap-ied-v03.01.asn"
5  *      `asn1c -pdu=auto -fincludes-quoted -fcompound-names -findirect-choice -fno-include-deps -no-gen-example -no-gen-OER -D /tmp/workspace/oransim-gerrit/e2sim/asn1c/`
6  */
7
8 #include "TNLinformation.h"
9
10 static int
11 memb_tnlAddress_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 >= 1UL && size <= 160UL)) {
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_tnlPort_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
43                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
44         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
45         size_t size;
46         
47         if(!sptr) {
48                 ASN__CTFAIL(app_key, td, sptr,
49                         "%s: value not given (%s:%d)",
50                         td->name, __FILE__, __LINE__);
51                 return -1;
52         }
53         
54         if(st->size > 0) {
55                 /* Size in bits */
56                 size = 8 * st->size - (st->bits_unused & 0x07);
57         } else {
58                 size = 0;
59         }
60         
61         if((size == 16UL)) {
62                 /* Constraint check succeeded */
63                 return 0;
64         } else {
65                 ASN__CTFAIL(app_key, td, sptr,
66                         "%s: constraint failed (%s:%d)",
67                         td->name, __FILE__, __LINE__);
68                 return -1;
69         }
70 }
71
72 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
73 static asn_per_constraints_t asn_PER_memb_tnlAddress_constr_2 CC_NOTUSED = {
74         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
75         { APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  1,  160 }  /* (SIZE(1..160,...)) */,
76         0, 0    /* No PER value map */
77 };
78 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
79 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
80 static asn_per_constraints_t asn_PER_memb_tnlPort_constr_3 CC_NOTUSED = {
81         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
82         { APC_CONSTRAINED,       0,  0,  16,  16 }      /* (SIZE(16..16)) */,
83         0, 0    /* No PER value map */
84 };
85 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
86 asn_TYPE_member_t asn_MBR_TNLinformation_1[] = {
87         { ATF_NOFLAGS, 0, offsetof(struct TNLinformation, tnlAddress),
88                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
89                 -1,     /* IMPLICIT tag at current level */
90                 &asn_DEF_BIT_STRING,
91                 0,
92                 {
93 #if !defined(ASN_DISABLE_OER_SUPPORT)
94                         0,
95 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
96 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
97                         &asn_PER_memb_tnlAddress_constr_2,
98 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
99                         memb_tnlAddress_constraint_1
100                 },
101                 0, 0, /* No default value */
102                 "tnlAddress"
103                 },
104         { ATF_POINTER, 1, offsetof(struct TNLinformation, tnlPort),
105                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
106                 -1,     /* IMPLICIT tag at current level */
107                 &asn_DEF_BIT_STRING,
108                 0,
109                 {
110 #if !defined(ASN_DISABLE_OER_SUPPORT)
111                         0,
112 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
113 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
114                         &asn_PER_memb_tnlPort_constr_3,
115 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
116                         memb_tnlPort_constraint_1
117                 },
118                 0, 0, /* No default value */
119                 "tnlPort"
120                 },
121 };
122 static const int asn_MAP_TNLinformation_oms_1[] = { 1 };
123 static const ber_tlv_tag_t asn_DEF_TNLinformation_tags_1[] = {
124         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
125 };
126 static const asn_TYPE_tag2member_t asn_MAP_TNLinformation_tag2el_1[] = {
127     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* tnlAddress */
128     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* tnlPort */
129 };
130 asn_SEQUENCE_specifics_t asn_SPC_TNLinformation_specs_1 = {
131         sizeof(struct TNLinformation),
132         offsetof(struct TNLinformation, _asn_ctx),
133         asn_MAP_TNLinformation_tag2el_1,
134         2,      /* Count of tags in the map */
135         asn_MAP_TNLinformation_oms_1,   /* Optional members */
136         1, 0,   /* Root/Additions */
137         2,      /* First extension addition */
138 };
139 asn_TYPE_descriptor_t asn_DEF_TNLinformation = {
140         "TNLinformation",
141         "TNLinformation",
142         &asn_OP_SEQUENCE,
143         asn_DEF_TNLinformation_tags_1,
144         sizeof(asn_DEF_TNLinformation_tags_1)
145                 /sizeof(asn_DEF_TNLinformation_tags_1[0]), /* 1 */
146         asn_DEF_TNLinformation_tags_1,  /* Same as above */
147         sizeof(asn_DEF_TNLinformation_tags_1)
148                 /sizeof(asn_DEF_TNLinformation_tags_1[0]), /* 1 */
149         {
150 #if !defined(ASN_DISABLE_OER_SUPPORT)
151                 0,
152 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
153 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
154                 0,
155 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
156                 SEQUENCE_constraint
157         },
158         asn_MBR_TNLinformation_1,
159         2,      /* Elements count */
160         &asn_SPC_TNLinformation_specs_1 /* Additional specs */
161 };
162