IA5String.c
Go to the documentation of this file.
1 /*-
2  * Copyright (c) 2003 Lev Walkin <vlm@lionet.info>. All rights reserved.
3  * Redistribution and modifications are permitted subject to BSD license.
4  */
7 
8 /*
9  * IA5String basic type description.
10  */
12  (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), /* [UNIVERSAL 22] IMPLICIT ...*/
13  (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
14 };
15 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
17  { APC_CONSTRAINED, 7, 7, 0, 0x7f }, /* Value */
18  { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */
19  0, 0
20 };
21 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
24 #if !defined(ASN_DISABLE_PRINT_SUPPORT)
25  OCTET_STRING_print_utf8, /* ASCII subset */
26 #else
27  0,
28 #endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
31 #if !defined(ASN_DISABLE_BER_SUPPORT)
32  OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */
34 #else
35  0,
36  0,
37 #endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
38 #if !defined(ASN_DISABLE_XER_SUPPORT)
41 #else
42  0,
43  0,
44 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
45 #if !defined(ASN_DISABLE_JER_SUPPORT)
48 #else
49  0,
50  0,
51 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
52 #if !defined(ASN_DISABLE_OER_SUPPORT)
55 #else
56  0,
57  0,
58 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
59 #if !defined(ASN_DISABLE_UPER_SUPPORT)
62 #else
63  0,
64  0,
65 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
66 #if !defined(ASN_DISABLE_APER_SUPPORT)
69 #else
70  0,
71  0,
72 #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
73 #if !defined(ASN_DISABLE_RFILL_SUPPORT)
75 #else
76  0,
77 #endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
78  0 /* Use generic outmost tag fetcher */
79 };
81  "IA5String",
82  "IA5String",
86  / sizeof(asn_DEF_IA5String_tags[0]) - 1,
89  / sizeof(asn_DEF_IA5String_tags[0]),
90  {
91 #if !defined(ASN_DISABLE_OER_SUPPORT)
92  0,
93 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
94 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
96 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
97 #if !defined(ASN_DISABLE_JER_SUPPORT)
98  0,
99 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
101  },
102  0, 0, /* No members */
103  0 /* No specifics */
104 };
105 
106 int
107 IA5String_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
108  asn_app_constraint_failed_f *ctfailcb, void *app_key) {
109  const IA5String_t *st = (const IA5String_t *)sptr;
110 
111  if(st && st->buf) {
112  uint8_t *buf = st->buf;
113  uint8_t *end = buf + st->size;
114  /*
115  * IA5String is generally equivalent to 7bit ASCII.
116  * ISO/ITU-T T.50, 1963.
117  */
118  for(; buf < end; buf++) {
119  if(*buf > 0x7F) {
120  ASN__CTFAIL(app_key, td, sptr,
121  "%s: value byte %ld out of range: "
122  "%d > 127 (%s:%d)",
123  td->name,
124  (long)((buf - st->buf) + 1),
125  *buf,
126  __FILE__, __LINE__);
127  return -1;
128  }
129  }
130  } else {
131  ASN__CTFAIL(app_key, td, sptr,
132  "%s: value not given (%s:%d)",
133  td->name, __FILE__, __LINE__);
134  return -1;
135  }
136 
137  return 0;
138 }
139 
IA5String_constraint
int IA5String_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key)
Definition: IA5String.c:107
asn_TYPE_operation_s
Definition: constr_TYPE.h:184
OCTET_STRING_free
asn_struct_free_f OCTET_STRING_free
Definition: OCTET_STRING.h:24
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_OP_IA5String
asn_TYPE_operation_t asn_OP_IA5String
Definition: IA5String.c:22
OCTET_STRING_encode_der
der_type_encoder_f OCTET_STRING_encode_der
Definition: OCTET_STRING.h:38
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
IA5String.h
OCTET_STRING_decode_oer
oer_type_decoder_f OCTET_STRING_decode_oer
Definition: OCTET_STRING.h:57
asn_DEF_IA5String_tags
static const ber_tlv_tag_t asn_DEF_IA5String_tags[]
Definition: IA5String.c:11
OCTET_STRING::buf
uint8_t * buf
Definition: OCTET_STRING.h:15
OCTET_STRING_encode_aper
per_type_encoder_f OCTET_STRING_encode_aper
Definition: OCTET_STRING.h:67
asn_TYPE_descriptor_s
Definition: constr_TYPE.h:224
OCTET_STRING_decode_aper
per_type_decoder_f OCTET_STRING_decode_aper
Definition: OCTET_STRING.h:66
OCTET_STRING_encode_xer_utf8
xer_type_encoder_f OCTET_STRING_encode_xer_utf8
Definition: OCTET_STRING.h:46
asn_DEF_IA5String
asn_TYPE_descriptor_t asn_DEF_IA5String
Definition: IA5String.c:80
OCTET_STRING_print_utf8
asn_struct_print_f OCTET_STRING_print_utf8
Definition: OCTET_STRING.h:28
OCTET_STRING_random_fill
asn_random_fill_f OCTET_STRING_random_fill
Definition: OCTET_STRING.h:71
OCTET_STRING
Definition: OCTET_STRING.h:14
OCTET_STRING_encode_oer
oer_type_encoder_f OCTET_STRING_encode_oer
Definition: OCTET_STRING.h:58
asn_internal.h
ASN__CTFAIL
#define ASN__CTFAIL
Definition: constraints.h:57
OCTET_STRING_decode_ber
ber_type_decoder_f OCTET_STRING_decode_ber
Definition: OCTET_STRING.h:37
OCTET_STRING_decode_uper
per_type_decoder_f OCTET_STRING_decode_uper
Definition: OCTET_STRING.h:62
OCTET_STRING_copy
asn_struct_copy_f OCTET_STRING_copy
Definition: OCTET_STRING.h:32
OCTET_STRING_decode_xer_utf8
xer_type_decoder_f OCTET_STRING_decode_xer_utf8
Definition: OCTET_STRING.h:44
OCTET_STRING_decode_jer_utf8
jer_type_decoder_f OCTET_STRING_decode_jer_utf8
Definition: OCTET_STRING.h:51
asn_per_constraints_s
Definition: per_support.h:30
OCTET_STRING_encode_uper
per_type_encoder_f OCTET_STRING_encode_uper
Definition: OCTET_STRING.h:63
OCTET_STRING_encode_jer_utf8
jer_type_encoder_f OCTET_STRING_encode_jer_utf8
Definition: OCTET_STRING.h:53
OCTET_STRING_compare
asn_struct_compare_f OCTET_STRING_compare
Definition: OCTET_STRING.h:31
OCTET_STRING::size
size_t size
Definition: OCTET_STRING.h:16
asn_DEF_IA5String_per_constraints
static asn_per_constraints_t asn_DEF_IA5String_per_constraints
Definition: IA5String.c:16


etsi_its_spatem_ts_coding
Author(s): Jean-Pierre Busch , Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:29:28