vam_ts_PhoneNumber.c
Go to the documentation of this file.
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "ETSI-ITS-CDD"
4  * found in "/input/ETSI-ITS-CDD.asn"
5  * `asn1c -fcompound-names -fprefix=vam_ts_ -no-gen-BER -no-gen-XER -no-gen-OER -no-gen-example -gen-UPER -gen-JER`
6  */
7 
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, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* . */
14  2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
15 };
16 static const int permitted_alphabet_code2value_1[11] = {
17 32,48,49,50,51,52,53,54,55,56,57,};
18 
19 
20 static int check_permitted_alphabet_1(const void *sptr) {
21  const int *table = permitted_alphabet_table_1;
22  /* The underlying type is NumericString */
23  const NumericString_t *st = (const NumericString_t *)sptr;
24  const uint8_t *ch = st->buf;
25  const uint8_t *end = ch + st->size;
26 
27  for(; ch < end; ch++) {
28  uint8_t cv = *ch;
29  if(!table[cv]) return -1;
30  }
31  return 0;
32 }
33 
34 int
36  asn_app_constraint_failed_f *ctfailcb, void *app_key) {
37  const NumericString_t *st = (const NumericString_t *)sptr;
38  size_t size;
39 
40  if(!sptr) {
41  ASN__CTFAIL(app_key, td, sptr,
42  "%s: value not given (%s:%d)",
43  td->name, __FILE__, __LINE__);
44  return -1;
45  }
46 
47  size = st->size;
48 
49  if((size >= 1UL && size <= 16UL)
51  /* Constraint check succeeded */
52  return 0;
53  } else {
54  ASN__CTFAIL(app_key, td, sptr,
55  "%s: constraint failed (%s:%d)",
56  td->name, __FILE__, __LINE__);
57  return -1;
58  }
59 }
60 
61 static int asn_PER_MAP_vam_ts_PhoneNumber_1_v2c(unsigned int value) {
62  if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
63  return -1;
64  return permitted_alphabet_table_1[value] - 1;
65 }
66 static int asn_PER_MAP_vam_ts_PhoneNumber_1_c2v(unsigned int code) {
68  return -1;
70 }
71 /*
72  * This type is implemented using NumericString,
73  * so here we adjust the DEF accordingly.
74  */
75 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
77  { APC_CONSTRAINED, 4, 4, 32, 57 } /* (32..57) */,
78  { APC_CONSTRAINED, 4, 4, 1, 16 } /* (SIZE(1..16)) */,
79  asn_PER_MAP_vam_ts_PhoneNumber_1_v2c, /* Value to PER code map */
80  asn_PER_MAP_vam_ts_PhoneNumber_1_c2v /* PER code to value map */
81 };
82 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
84  (ASN_TAG_CLASS_UNIVERSAL | (18 << 2))
85 };
87  "PhoneNumber",
88  "PhoneNumber",
92  /sizeof(asn_DEF_vam_ts_PhoneNumber_tags_1[0]), /* 1 */
93  asn_DEF_vam_ts_PhoneNumber_tags_1, /* Same as above */
95  /sizeof(asn_DEF_vam_ts_PhoneNumber_tags_1[0]), /* 1 */
96  {
97 #if !defined(ASN_DISABLE_OER_SUPPORT)
98  0,
99 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
100 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
102 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
103 #if !defined(ASN_DISABLE_JER_SUPPORT)
104  0,
105 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
107  },
108  0, 0, /* No members */
109  0 /* No specifics */
110 };
111 
asn_PER_MAP_vam_ts_PhoneNumber_1_v2c
static int asn_PER_MAP_vam_ts_PhoneNumber_1_v2c(unsigned int value)
Definition: vam_ts_PhoneNumber.c:61
asn_app_constraint_failed_f
void() asn_app_constraint_failed_f(void *application_specific_key, const struct asn_TYPE_descriptor_s *type_descriptor_which_failed, const void *structure_which_failed_ptr, const char *error_message_format,...) CC_PRINTFLIKE(4
Definition: asn_application.h:167
ber_tlv_tag_t
unsigned ber_tlv_tag_t
Definition: ber_tlv_tag.h:18
ASN_TAG_CLASS_UNIVERSAL
@ ASN_TAG_CLASS_UNIVERSAL
Definition: ber_tlv_tag.h:13
asn_TYPE_descriptor_s::name
const char * name
Definition: constr_TYPE.h:225
asn_DEF_vam_ts_PhoneNumber_tags_1
static const ber_tlv_tag_t asn_DEF_vam_ts_PhoneNumber_tags_1[]
Definition: vam_ts_PhoneNumber.c:83
vam_ts_PhoneNumber_constraint
int vam_ts_PhoneNumber_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key)
Definition: vam_ts_PhoneNumber.c:35
OCTET_STRING::buf
uint8_t * buf
Definition: OCTET_STRING.h:15
permitted_alphabet_code2value_1
static const int permitted_alphabet_code2value_1[11]
Definition: vam_ts_PhoneNumber.c:16
asn_PER_MAP_vam_ts_PhoneNumber_1_c2v
static int asn_PER_MAP_vam_ts_PhoneNumber_1_c2v(unsigned int code)
Definition: vam_ts_PhoneNumber.c:66
asn_TYPE_descriptor_s
Definition: constr_TYPE.h:224
check_permitted_alphabet_1
static int check_permitted_alphabet_1(const void *sptr)
Definition: vam_ts_PhoneNumber.c:20
OCTET_STRING
Definition: OCTET_STRING.h:14
ASN__CTFAIL
#define ASN__CTFAIL
Definition: constraints.h:57
asn_DEF_vam_ts_PhoneNumber
asn_TYPE_descriptor_t asn_DEF_vam_ts_PhoneNumber
Definition: vam_ts_PhoneNumber.c:86
asn_OP_NumericString
asn_TYPE_operation_t asn_OP_NumericString
Definition: NumericString.c:42
permitted_alphabet_table_1
static const int permitted_alphabet_table_1[256]
Definition: vam_ts_PhoneNumber.c:10
asn_per_constraints_s
Definition: per_support.h:30
asn_PER_type_vam_ts_PhoneNumber_constr_1
asn_per_constraints_t asn_PER_type_vam_ts_PhoneNumber_constr_1
CC_NOTUSED
asn_per_constraints_t asn_PER_type_vam_ts_PhoneNumber_constr_1 CC_NOTUSED
Definition: vam_ts_PhoneNumber.c:76
vam_ts_PhoneNumber.h
OCTET_STRING::size
size_t size
Definition: OCTET_STRING.h:16


etsi_its_vam_ts_coding
Author(s): Jean-Pierre Busch , Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:30:55