Enhanced SIM for E2AP v1 for TS UC
[sim/e2-interface.git] / e2sim / e2apv1sim / ASN1c / SNSSAI.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "E2SM-KPM-IEs"
4  *      found in "/home/rshacham/e2sm_kpm_approved.asn"
5  *      `asn1c -fcompound-names`
6  */
7
8 #include "SNSSAI.h"
9
10 static int
11 memb_sST_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
12                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13         const OCTET_STRING_t *st = (const OCTET_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         size = st->size;
24         
25         if((size == 1)) {
26                 /* Constraint check succeeded */
27                 return 0;
28         } else {
29                 ASN__CTFAIL(app_key, td, sptr,
30                         "%s: constraint failed (%s:%d)",
31                         td->name, __FILE__, __LINE__);
32                 return -1;
33         }
34 }
35
36 static int
37 memb_sD_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
38                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
39         const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
40         size_t size;
41         
42         if(!sptr) {
43                 ASN__CTFAIL(app_key, td, sptr,
44                         "%s: value not given (%s:%d)",
45                         td->name, __FILE__, __LINE__);
46                 return -1;
47         }
48         
49         size = st->size;
50         
51         if((size == 3)) {
52                 /* Constraint check succeeded */
53                 return 0;
54         } else {
55                 ASN__CTFAIL(app_key, td, sptr,
56                         "%s: constraint failed (%s:%d)",
57                         td->name, __FILE__, __LINE__);
58                 return -1;
59         }
60 }
61
62 static asn_oer_constraints_t asn_OER_memb_sST_constr_2 CC_NOTUSED = {
63         { 0, 0 },
64         1       /* (SIZE(1..1)) */};
65 static asn_per_constraints_t asn_PER_memb_sST_constr_2 CC_NOTUSED = {
66         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
67         { APC_CONSTRAINED,       0,  0,  1,  1 }        /* (SIZE(1..1)) */,
68         0, 0    /* No PER value map */
69 };
70 static asn_oer_constraints_t asn_OER_memb_sD_constr_3 CC_NOTUSED = {
71         { 0, 0 },
72         3       /* (SIZE(3..3)) */};
73 static asn_per_constraints_t asn_PER_memb_sD_constr_3 CC_NOTUSED = {
74         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
75         { APC_CONSTRAINED,       0,  0,  3,  3 }        /* (SIZE(3..3)) */,
76         0, 0    /* No PER value map */
77 };
78 asn_TYPE_member_t asn_MBR_SNSSAI_1[] = {
79         { ATF_NOFLAGS, 0, offsetof(struct SNSSAI, sST),
80                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
81                 -1,     /* IMPLICIT tag at current level */
82                 &asn_DEF_OCTET_STRING,
83                 0,
84                 { &asn_OER_memb_sST_constr_2, &asn_PER_memb_sST_constr_2,  memb_sST_constraint_1 },
85                 0, 0, /* No default value */
86                 "sST"
87                 },
88         { ATF_POINTER, 1, offsetof(struct SNSSAI, sD),
89                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
90                 -1,     /* IMPLICIT tag at current level */
91                 &asn_DEF_OCTET_STRING,
92                 0,
93                 { &asn_OER_memb_sD_constr_3, &asn_PER_memb_sD_constr_3,  memb_sD_constraint_1 },
94                 0, 0, /* No default value */
95                 "sD"
96                 },
97 };
98 static const int asn_MAP_SNSSAI_oms_1[] = { 1 };
99 static const ber_tlv_tag_t asn_DEF_SNSSAI_tags_1[] = {
100         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
101 };
102 static const asn_TYPE_tag2member_t asn_MAP_SNSSAI_tag2el_1[] = {
103     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* sST */
104     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* sD */
105 };
106 asn_SEQUENCE_specifics_t asn_SPC_SNSSAI_specs_1 = {
107         sizeof(struct SNSSAI),
108         offsetof(struct SNSSAI, _asn_ctx),
109         asn_MAP_SNSSAI_tag2el_1,
110         2,      /* Count of tags in the map */
111         asn_MAP_SNSSAI_oms_1,   /* Optional members */
112         1, 0,   /* Root/Additions */
113         -1,     /* First extension addition */
114 };
115 asn_TYPE_descriptor_t asn_DEF_SNSSAI = {
116         "SNSSAI",
117         "SNSSAI",
118         &asn_OP_SEQUENCE,
119         asn_DEF_SNSSAI_tags_1,
120         sizeof(asn_DEF_SNSSAI_tags_1)
121                 /sizeof(asn_DEF_SNSSAI_tags_1[0]), /* 1 */
122         asn_DEF_SNSSAI_tags_1,  /* Same as above */
123         sizeof(asn_DEF_SNSSAI_tags_1)
124                 /sizeof(asn_DEF_SNSSAI_tags_1[0]), /* 1 */
125         { 0, 0, SEQUENCE_constraint },
126         asn_MBR_SNSSAI_1,
127         2,      /* Elements count */
128         &asn_SPC_SNSSAI_specs_1 /* Additional specs */
129 };
130