Go to the documentation of this file.
21 #if !defined(ASN_DISABLE_PRINT_SUPPORT)
28 #if !defined(ASN_DISABLE_BER_SUPPORT)
35 #if !defined(ASN_DISABLE_XER_SUPPORT)
42 #if !defined(ASN_DISABLE_JER_SUPPORT)
49 #if !defined(ASN_DISABLE_OER_SUPPORT)
56 #if !defined(ASN_DISABLE_UPER_SUPPORT)
63 #if !defined(ASN_DISABLE_APER_SUPPORT)
70 #if !defined(ASN_DISABLE_RFILL_SUPPORT)
88 #if !defined(ASN_DISABLE_OER_SUPPORT)
91 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
94 #if !defined(ASN_DISABLE_JER_SUPPORT)
112 "%s: at least one numerical value "
114 td->
name, __FILE__, __LINE__);
119 "%s: value not given (%s:%d)",
120 td->
name, __FILE__, __LINE__);
133 if(rd <= 0)
return rd;
138 }
else if(value >= 40) {
152 const uint8_t *b = arcbuf;
153 const uint8_t *arcend = arcbuf + arcbuf_len;
155 if(arcbuf == arcend) {
164 for(accum = 0; b < arcend; b++) {
165 accum = (accum << 7) | (*b & ~0x80);
166 if((*b & 0x80) == 0) {
169 return 1 + (b - arcbuf);
175 if(accum > upper_limit) {
203 ret = snprintf(scratch,
sizeof(scratch),
"%"PRIu32
".%"PRIu32, arc0, arc1);
204 if(ret >= (ssize_t)
sizeof(scratch)) {
208 if(cb(scratch, ret, app_key) < 0)
222 assert(off <= st->size);
223 ret = snprintf(scratch,
sizeof(scratch),
".%" PRIu32, arc);
224 if(ret >= (ssize_t)
sizeof(scratch)) {
228 if(cb(scratch, ret, app_key) < 0)
return -1;
232 if(off != st->
size) {
233 ASN_DEBUG(
"Could not scan to the end of Object Identifier");
249 if(!st || !st->
buf) {
282 if(num_arcs < arc_slots) {
283 arcs[num_arcs] = arc;
289 if(off != st->
size) {
307 uint8_t scratch[((
sizeof(value) * CHAR_BIT + 6) / 7)];
308 uint8_t *scratch_end = &scratch[
sizeof(scratch)-1];
313 for(b = scratch_end, mask = 0; ; mask = 0x80, b--) {
314 *b = mask | (value & 0x7f);
321 result_len = (scratch_end - b) + 1;
323 if(result_len > arcbuf_len) {
327 memcpy(arcbuf, b, result_len);
343 if(!st || !arcs || arc_slots < 2) {
357 }
else if(arc0 == 2) {
362 }
else if(arc0 > 2) {
381 size = ((
sizeof(
asn_oid_arc_t) * CHAR_BIT + 6) / 7) * arc_slots;
382 bp = buf = (uint8_t *)
MALLOC(size + 1);
393 assert((
size_t)wrote <= size);
397 for(i = 2; i < arc_slots; i++) {
403 assert((
size_t)wrote <= size);
423 const char **opt_oid_text_end) {
431 } state = ST_LEADSPACE;
433 if(!oid_text || oid_txt_length < -1 || (arcs_count && !arcs)) {
434 if(opt_oid_text_end) *opt_oid_text_end = oid_text;
439 if(oid_txt_length == -1)
440 oid_txt_length = strlen(oid_text);
442 #define _OID_CAPTURE_ARC(oid_text, oid_end) \
444 const char *endp = oid_end; \
445 unsigned long value; \
446 switch(asn_strtoul_lim(oid_text, &endp, &value)) { \
447 case ASN_STRTOX_EXTRA_DATA: \
448 case ASN_STRTOX_OK: \
449 if(value <= ASN_OID_ARC_MAX) { \
450 if(num_arcs < arcs_count) arcs[num_arcs] = value; \
452 oid_text = endp - 1; \
456 case ASN_STRTOX_ERROR_RANGE: \
457 if(opt_oid_text_end) *opt_oid_text_end = oid_text; \
460 case ASN_STRTOX_ERROR_INVAL: \
461 case ASN_STRTOX_EXPECT_MORE: \
462 if(opt_oid_text_end) *opt_oid_text_end = oid_text; \
468 for(oid_end = oid_text + oid_txt_length; oid_text<oid_end; oid_text++) {
470 case 0x09:
case 0x0a:
case 0x0d:
case 0x20:
476 state = ST_TAILSPACE;
488 *opt_oid_text_end = oid_text;
493 state = ST_WAITDIGITS;
497 case 0x30:
case 0x31:
case 0x32:
case 0x33:
case 0x34:
498 case 0x35:
case 0x36:
case 0x37:
case 0x38:
case 0x39:
503 *opt_oid_text_end = oid_text;
509 state = ST_AFTERVALUE;
515 state = ST_WAITDIGITS;
522 if(opt_oid_text_end) *opt_oid_text_end = oid_text;
static ssize_t OBJECT_IDENTIFIER_get_first_arcs(const uint8_t *arcbuf, size_t arcbuf_len, asn_oid_arc_t *arc0, asn_oid_arc_t *arc1)
jer_type_decoder_f OBJECT_IDENTIFIER_decode_jer
asn_TYPE_descriptor_t asn_DEF_OBJECT_IDENTIFIER
asn_random_fill_f OBJECT_IDENTIFIER_random_fill
ssize_t OBJECT_IDENTIFIER_get_arcs(const OBJECT_IDENTIFIER_t *st, asn_oid_arc_t *arcs, size_t arc_slots)
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
@ ASN_TAG_CLASS_UNIVERSAL
ber_type_decoder_f ber_decode_primitive
ssize_t OBJECT_IDENTIFIER_parse_arcs(const char *oid_text, ssize_t oid_txt_length, asn_oid_arc_t *arcs, size_t arcs_count, const char **opt_oid_text_end)
int OBJECT_IDENTIFIER_set_arcs(OBJECT_IDENTIFIER_t *st, const asn_oid_arc_t *arcs, size_t arc_slots)
per_type_encoder_f OCTET_STRING_encode_aper
asn_TYPE_operation_t asn_OP_OBJECT_IDENTIFIER
asn_struct_print_f OBJECT_IDENTIFIER_print
per_type_decoder_f OCTET_STRING_decode_aper
int OBJECT_IDENTIFIER_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key)
der_type_encoder_f der_encode_primitive
ssize_t OBJECT_IDENTIFIER_set_single_arc(uint8_t *arcbuf, size_t arcbuf_len, asn_oid_arc_t value)
#define OBJECT_IDENTIFIER_encode_oer
xer_type_decoder_f OBJECT_IDENTIFIER_decode_xer
int() asn_app_consume_bytes_f(const void *buffer, size_t size, void *application_specific_key)
static const ber_tlv_tag_t asn_DEF_OBJECT_IDENTIFIER_tags[]
per_type_decoder_f OCTET_STRING_decode_uper
asn_struct_free_f ASN__PRIMITIVE_TYPE_free
ssize_t OBJECT_IDENTIFIER__dump_body(const OBJECT_IDENTIFIER_t *st, asn_app_consume_bytes_f *cb, void *app_key)
asn_struct_copy_f OCTET_STRING_copy
jer_type_encoder_f OBJECT_IDENTIFIER_encode_jer
#define OBJECT_IDENTIFIER_decode_oer
per_type_encoder_f OCTET_STRING_encode_uper
xer_type_encoder_f OBJECT_IDENTIFIER_encode_xer
#define _OID_CAPTURE_ARC(oid_text, oid_end)
ssize_t OBJECT_IDENTIFIER_get_single_arc(const uint8_t *arcbuf, size_t arcbuf_len, asn_oid_arc_t *ret_value)
asn_struct_compare_f OCTET_STRING_compare
etsi_its_cpm_ts_coding
Author(s): Jean-Pierre Busch
, Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:22:38