/src/open5gs/lib/asn1c/ngap/NGAP_AMFNameVisibleString.c
Line | Count | Source |
1 | | /* |
2 | | * Generated by asn1c-v1.4-43-gb7926896-2026-05-03 (https://github.com/mouse07410/asn1c) |
3 | | * From ASN.1 module "NGAP-IEs" |
4 | | * found in "../support/ngap-r19.2.0/38413-j20.asn" |
5 | | * `asn1c -pdu=all -fprefix=NGAP_ -fcompound-names -findirect-choice -fno-include-deps -no-gen-BER -no-gen-XER -no-gen-JER -no-gen-CBOR -no-gen-OER -no-gen-UPER` |
6 | | */ |
7 | | |
8 | | #include "NGAP_AMFNameVisibleString.h" |
9 | | |
10 | 0 | static int check_permitted_alphabet_1(const void *sptr) { |
11 | | /* The underlying type is VisibleString */ |
12 | 0 | const VisibleString_t *st = (const VisibleString_t *)sptr; |
13 | 0 | const uint8_t *ch = st->buf; |
14 | 0 | const uint8_t *end = ch + st->size; |
15 | | |
16 | 0 | for(; ch < end; ch++) { |
17 | 0 | uint8_t cv = *ch; |
18 | 0 | if(!(cv >= 32UL && cv <= 126UL)) return -1; |
19 | 0 | } |
20 | 0 | return 0; |
21 | 0 | } |
22 | | |
23 | | int |
24 | | NGAP_AMFNameVisibleString_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, |
25 | 0 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
26 | 0 | const VisibleString_t *st = (const VisibleString_t *)sptr; |
27 | 0 | size_t size; |
28 | | |
29 | 0 | if(!sptr) { |
30 | 0 | ASN__CTFAIL(app_key, td, sptr, |
31 | 0 | "%s: value not given (%s:%d)", |
32 | 0 | td->name, __FILE__, __LINE__); |
33 | 0 | return -1; |
34 | 0 | } |
35 | | |
36 | 0 | size = st->size; |
37 | | |
38 | 0 | if((size >= 1UL && size <= 150UL) |
39 | 0 | && !check_permitted_alphabet_1(st)) { |
40 | | /* Constraint check succeeded */ |
41 | 0 | return 0; |
42 | 0 | } else { |
43 | 0 | ASN__CTFAIL(app_key, td, sptr, |
44 | 0 | "%s: constraint failed (%s:%d)", |
45 | 0 | td->name, __FILE__, __LINE__); |
46 | 0 | return -1; |
47 | 0 | } |
48 | 0 | } |
49 | | |
50 | | /* |
51 | | * This type is implemented using VisibleString, |
52 | | * so here we adjust the DEF accordingly. |
53 | | */ |
54 | | #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) |
55 | | asn_per_constraints_t asn_PER_type_NGAP_AMFNameVisibleString_constr_1 CC_NOTUSED = { |
56 | | { APC_CONSTRAINED, 7, 7, 32, 126 } /* (32..126) */, |
57 | | { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 150 } /* (SIZE(1..150,...)) */, |
58 | | 0, 0 /* No PER character map necessary */ |
59 | | }; |
60 | | #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ |
61 | | static const ber_tlv_tag_t asn_DEF_NGAP_AMFNameVisibleString_tags_1[] = { |
62 | | (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)) |
63 | | }; |
64 | | asn_TYPE_descriptor_t asn_DEF_NGAP_AMFNameVisibleString = { |
65 | | "AMFNameVisibleString", |
66 | | "AMFNameVisibleString", |
67 | | &asn_OP_VisibleString, |
68 | | asn_DEF_NGAP_AMFNameVisibleString_tags_1, |
69 | | sizeof(asn_DEF_NGAP_AMFNameVisibleString_tags_1) |
70 | | /sizeof(asn_DEF_NGAP_AMFNameVisibleString_tags_1[0]), /* 1 */ |
71 | | asn_DEF_NGAP_AMFNameVisibleString_tags_1, /* Same as above */ |
72 | | sizeof(asn_DEF_NGAP_AMFNameVisibleString_tags_1) |
73 | | /sizeof(asn_DEF_NGAP_AMFNameVisibleString_tags_1[0]), /* 1 */ |
74 | | { |
75 | | #if !defined(ASN_DISABLE_OER_SUPPORT) |
76 | | 0, |
77 | | #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ |
78 | | #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) |
79 | | &asn_PER_type_NGAP_AMFNameVisibleString_constr_1, |
80 | | #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ |
81 | | #if !defined(ASN_DISABLE_JER_SUPPORT) |
82 | | 0, |
83 | | #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ |
84 | | NGAP_AMFNameVisibleString_constraint |
85 | | }, |
86 | | 0, 0, /* No members */ |
87 | | 0 /* No specifics */ |
88 | | }; |
89 | | |