/src/open5gs/lib/asn1c/ngap/NGAP_AMFName.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_AMFName.h" |
9 | | |
10 | | static const int permitted_alphabet_table_1[256] = { |
11 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
12 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
13 | | 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9, /* . '() +,-./ */ |
14 | | 10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22, /* 0123456789: = ? */ |
15 | | 0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37, /* ABCDEFGHIJKLMNO */ |
16 | | 38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */ |
17 | | 0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, /* abcdefghijklmno */ |
18 | | 64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ |
19 | | }; |
20 | | static const int permitted_alphabet_code2value_1[74] = { |
21 | | 32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54, |
22 | | 55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74, |
23 | | 75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90, |
24 | | 97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112, |
25 | | 113,114,115,116,117,118,119,120,121,122,}; |
26 | | |
27 | | |
28 | 0 | static int check_permitted_alphabet_1(const void *sptr) { |
29 | 0 | const int *table = permitted_alphabet_table_1; |
30 | | /* The underlying type is PrintableString */ |
31 | 0 | const PrintableString_t *st = (const PrintableString_t *)sptr; |
32 | 0 | const uint8_t *ch = st->buf; |
33 | 0 | const uint8_t *end = ch + st->size; |
34 | | |
35 | 0 | for(; ch < end; ch++) { |
36 | 0 | uint8_t cv = *ch; |
37 | 0 | if(!table[cv]) return -1; |
38 | 0 | } |
39 | 0 | return 0; |
40 | 0 | } |
41 | | |
42 | | int |
43 | | NGAP_AMFName_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, |
44 | 0 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
45 | 0 | const PrintableString_t *st = (const PrintableString_t *)sptr; |
46 | 0 | size_t size; |
47 | | |
48 | 0 | if(!sptr) { |
49 | 0 | ASN__CTFAIL(app_key, td, sptr, |
50 | 0 | "%s: value not given (%s:%d)", |
51 | 0 | td->name, __FILE__, __LINE__); |
52 | 0 | return -1; |
53 | 0 | } |
54 | | |
55 | 0 | size = st->size; |
56 | | |
57 | 0 | if((size >= 1UL && size <= 150UL) |
58 | 0 | && !check_permitted_alphabet_1(st)) { |
59 | | /* Constraint check succeeded */ |
60 | 0 | return 0; |
61 | 0 | } else { |
62 | 0 | ASN__CTFAIL(app_key, td, sptr, |
63 | 0 | "%s: constraint failed (%s:%d)", |
64 | 0 | td->name, __FILE__, __LINE__); |
65 | 0 | return -1; |
66 | 0 | } |
67 | 0 | } |
68 | | |
69 | 0 | static int asn_PER_MAP_NGAP_AMFName_1_v2c(unsigned int value) { |
70 | 0 | if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0])) |
71 | 0 | return -1; |
72 | 0 | return permitted_alphabet_table_1[value] - 1; |
73 | 0 | } |
74 | 0 | static int asn_PER_MAP_NGAP_AMFName_1_c2v(unsigned int code) { |
75 | 0 | if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0])) |
76 | 0 | return -1; |
77 | 0 | return permitted_alphabet_code2value_1[code]; |
78 | 0 | } |
79 | | /* |
80 | | * This type is implemented using PrintableString, |
81 | | * so here we adjust the DEF accordingly. |
82 | | */ |
83 | | #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) |
84 | | asn_per_constraints_t asn_PER_type_NGAP_AMFName_constr_1 CC_NOTUSED = { |
85 | | { APC_CONSTRAINED, 7, 7, 32, 122 } /* (32..122) */, |
86 | | { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 150 } /* (SIZE(1..150,...)) */, |
87 | | asn_PER_MAP_NGAP_AMFName_1_v2c, /* Value to PER code map */ |
88 | | asn_PER_MAP_NGAP_AMFName_1_c2v /* PER code to value map */ |
89 | | }; |
90 | | #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ |
91 | | static const ber_tlv_tag_t asn_DEF_NGAP_AMFName_tags_1[] = { |
92 | | (ASN_TAG_CLASS_UNIVERSAL | (19 << 2)) |
93 | | }; |
94 | | asn_TYPE_descriptor_t asn_DEF_NGAP_AMFName = { |
95 | | "AMFName", |
96 | | "AMFName", |
97 | | &asn_OP_PrintableString, |
98 | | asn_DEF_NGAP_AMFName_tags_1, |
99 | | sizeof(asn_DEF_NGAP_AMFName_tags_1) |
100 | | /sizeof(asn_DEF_NGAP_AMFName_tags_1[0]), /* 1 */ |
101 | | asn_DEF_NGAP_AMFName_tags_1, /* Same as above */ |
102 | | sizeof(asn_DEF_NGAP_AMFName_tags_1) |
103 | | /sizeof(asn_DEF_NGAP_AMFName_tags_1[0]), /* 1 */ |
104 | | { |
105 | | #if !defined(ASN_DISABLE_OER_SUPPORT) |
106 | | 0, |
107 | | #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ |
108 | | #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) |
109 | | &asn_PER_type_NGAP_AMFName_constr_1, |
110 | | #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ |
111 | | #if !defined(ASN_DISABLE_JER_SUPPORT) |
112 | | 0, |
113 | | #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ |
114 | | NGAP_AMFName_constraint |
115 | | }, |
116 | | 0, 0, /* No members */ |
117 | | 0 /* No specifics */ |
118 | | }; |
119 | | |