NativeEnumerated.c
Go to the documentation of this file.
1 /*-
2  * Copyright (c) 2004, 2007 Lev Walkin <vlm@lionet.info>. All rights reserved.
3  * Redistribution and modifications are permitted subject to BSD license.
4  */
5 /*
6  * Read the NativeInteger.h for the explanation wrt. differences between
7  * INTEGER and NativeInteger.
8  * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this
9  * implementation deals with the standard (machine-specific) representation
10  * of them instead of using the platform-independent buffer.
11  */
14 
15 /*
16  * NativeEnumerated basic type description.
17  */
19  (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
20 };
23 #if !defined(ASN_DISABLE_PRINT_SUPPORT)
25 #else
26  0,
27 #endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
30 #if !defined(ASN_DISABLE_BER_SUPPORT)
33 #else
34  0,
35  0,
36 #endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
37 #if !defined(ASN_DISABLE_XER_SUPPORT)
40 #else
41  0,
42  0,
43 #endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
44 #if !defined(ASN_DISABLE_JER_SUPPORT)
47 #else
48  0,
49  0,
50 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
51 #if !defined(ASN_DISABLE_OER_SUPPORT)
54 #else
55  0,
56  0,
57 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
58 #if !defined(ASN_DISABLE_UPER_SUPPORT)
61 #else
62  0,
63  0,
64 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
65 #if !defined(ASN_DISABLE_APER_SUPPORT)
68 #else
69  0,
70  0,
71 #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
72 #if !defined(ASN_DISABLE_RFILL_SUPPORT)
74 #else
75  0,
76 #endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
77  0 /* Use generic outmost tag fetcher */
78 };
80  "ENUMERATED", /* The ASN.1 type is still ENUMERATED */
81  "ENUMERATED",
85  asn_DEF_NativeEnumerated_tags, /* Same as above */
87  {
88 #if !defined(ASN_DISABLE_OER_SUPPORT)
89  0,
90 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
91 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
92  0,
93 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
94 #if !defined(ASN_DISABLE_JER_SUPPORT)
95  0,
96 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
98  },
99  0, 0, /* No members */
100  0 /* No specifics */
101 };
102 
103 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
104 int
105 NativeEnumerated__compar_value2enum(const void *ap, const void *bp) {
106  const asn_INTEGER_enum_map_t *a = ap;
107  const asn_INTEGER_enum_map_t *b = bp;
108  if(a->nat_value == b->nat_value)
109  return 0;
110  if(a->nat_value < b->nat_value)
111  return -1;
112  return 1;
113 }
114 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
asn_TYPE_operation_s
Definition: constr_TYPE.h:184
NativeEnumerated_encode_xer
xer_type_encoder_f NativeEnumerated_encode_xer
Definition: NativeEnumerated.h:43
NativeInteger_copy
asn_struct_copy_f NativeInteger_copy
Definition: NativeInteger.h:32
NativeInteger_compare
asn_struct_compare_f NativeInteger_compare
Definition: NativeInteger.h:31
ber_tlv_tag_t
unsigned ber_tlv_tag_t
Definition: ber_tlv_tag.h:18
NativeInteger_decode_ber
ber_type_decoder_f NativeInteger_decode_ber
Definition: NativeInteger.h:37
ASN_TAG_CLASS_UNIVERSAL
@ ASN_TAG_CLASS_UNIVERSAL
Definition: ber_tlv_tag.h:13
NativeEnumerated.h
NativeEnumerated__compar_value2enum
int NativeEnumerated__compar_value2enum(const void *ap, const void *bp)
Definition: NativeEnumerated.c:105
NativeInteger_print
asn_struct_print_f NativeInteger_print
Definition: NativeInteger.h:28
asn_DEF_NativeEnumerated_tags
static const ber_tlv_tag_t asn_DEF_NativeEnumerated_tags[]
Definition: NativeEnumerated.c:18
asn_OP_NativeEnumerated
asn_TYPE_operation_t asn_OP_NativeEnumerated
Definition: NativeEnumerated.c:21
NativeEnumerated_decode_uper
per_type_decoder_f NativeEnumerated_decode_uper
Definition: NativeEnumerated.h:57
NativeEnumerated_decode_aper
per_type_decoder_f NativeEnumerated_decode_aper
Definition: NativeEnumerated.h:61
NativeInteger_free
asn_struct_free_f NativeInteger_free
Definition: NativeInteger.h:25
asn_TYPE_descriptor_s
Definition: constr_TYPE.h:224
NativeEnumerated_encode_oer
oer_type_encoder_f NativeEnumerated_encode_oer
Definition: NativeEnumerated.h:53
asn_generic_no_constraint
asn_constr_check_f asn_generic_no_constraint
Definition: constraints.h:51
asn_INTEGER_enum_map_s::nat_value
long nat_value
Definition: INTEGER.h:22
NativeInteger_decode_xer
xer_type_decoder_f NativeInteger_decode_xer
Definition: NativeInteger.h:42
NativeInteger_encode_der
der_type_encoder_f NativeInteger_encode_der
Definition: NativeInteger.h:38
NativeEnumerated_random_fill
#define NativeEnumerated_random_fill
Definition: NativeEnumerated.h:66
NativeEnumerated_encode_uper
per_type_encoder_f NativeEnumerated_encode_uper
Definition: NativeEnumerated.h:58
asn_DEF_NativeEnumerated
asn_TYPE_descriptor_t asn_DEF_NativeEnumerated
Definition: NativeEnumerated.c:79
asn_internal.h
NativeEnumerated_decode_oer
oer_type_decoder_f NativeEnumerated_decode_oer
Definition: NativeEnumerated.h:52
NativeEnumerated_encode_jer
jer_type_encoder_f NativeEnumerated_encode_jer
Definition: NativeEnumerated.h:48
NativeEnumerated_encode_aper
per_type_encoder_f NativeEnumerated_encode_aper
Definition: NativeEnumerated.h:62
NativeEnumerated_decode_jer
jer_type_decoder_f NativeEnumerated_decode_jer
Definition: NativeEnumerated.h:47
asn_INTEGER_enum_map_s
Definition: INTEGER.h:21


etsi_its_denm_coding
Author(s): Jean-Pierre Busch , Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:23:48