Revert "asn1: move metadata tables out of RAM"

This reverts commit ea35ecf3a57cabc36c1c778aae0bf9fd65d6f32d.
This commit is contained in:
CinderSocket
2026-03-27 23:14:43 -07:00
parent 6e64c27ca7
commit 86b6b49cef
21 changed files with 37 additions and 37 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ typedef struct asn_INTEGER_enum_map_s {
} asn_INTEGER_enum_map_t;
/* This type describes an enumeration for INTEGER and ENUMERATED types */
typedef const struct asn_INTEGER_specifics_s {
typedef struct asn_INTEGER_specifics_s {
const asn_INTEGER_enum_map_t *value2enum; /* N -> "tag"; sorted by N */
const unsigned int *enum2value; /* "tag" => N; sorted by tag */
int map_count; /* Elements in either map */
+1 -1
View File
@@ -73,7 +73,7 @@ OCTET_STRING_t *OCTET_STRING_new_fromBuf(const asn_TYPE_descriptor_t *td,
* Internally useful stuff. *
****************************/
typedef const struct asn_OCTET_STRING_specifics_s {
typedef struct asn_OCTET_STRING_specifics_s {
/*
* Target structure description.
*/
+1 -1
View File
@@ -190,7 +190,7 @@ CHOICE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
do {
const asn_TYPE_tag2member_t *t2m;
struct asn_TYPE_tag2member_s key;
asn_TYPE_tag2member_t key;
key.el_tag = tlv_tag;
t2m = (const asn_TYPE_tag2member_t *)bsearch(&key,
+1 -1
View File
@@ -11,7 +11,7 @@
extern "C" {
#endif
typedef const struct asn_CHOICE_specifics_s {
typedef struct asn_CHOICE_specifics_s {
/*
* Target structure description.
*/
+1 -1
View File
@@ -304,7 +304,7 @@ SEQUENCE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
* sorted array of tags.
*/
const asn_TYPE_tag2member_t *t2m;
struct asn_TYPE_tag2member_s key = {0, 0, 0, 0};
asn_TYPE_tag2member_t key = {0, 0, 0, 0};
key.el_tag = tlv_tag;
key.el_no = edx;
t2m = (const asn_TYPE_tag2member_t *)bsearch(&key,
+1 -1
View File
@@ -11,7 +11,7 @@
extern "C" {
#endif
typedef const struct asn_SEQUENCE_specifics_s {
typedef struct asn_SEQUENCE_specifics_s {
/*
* Target structure description.
*/
+7 -7
View File
@@ -141,7 +141,7 @@ typedef asn_type_selector_result_t(asn_type_selector_f)(
* Generalized functions for dealing with the speciic type.
* May be directly invoked by applications.
*/
typedef const struct asn_TYPE_operation_s {
typedef struct asn_TYPE_operation_s {
asn_struct_free_f *free_struct; /* Free the structure */
asn_struct_print_f *print_struct; /* Human readable output */
asn_struct_compare_f *compare_struct; /* Compare two structures */
@@ -169,7 +169,7 @@ typedef struct asn_encoding_constraints_s {
/*
* The definitive description of the destination language's structure.
*/
typedef const struct asn_TYPE_descriptor_s {
typedef struct asn_TYPE_descriptor_s {
const char *name; /* A name of the ASN.1 type. "" in some cases. */
const char *xml_tag; /* Name used in XML tag */
@@ -177,7 +177,7 @@ typedef const struct asn_TYPE_descriptor_s {
* Generalized functions for dealing with the specific type.
* May be directly invoked by applications.
*/
const asn_TYPE_operation_t *op;
asn_TYPE_operation_t *op;
/***********************************************************************
* Internally useful members. Not to be used by applications directly. *
@@ -197,7 +197,7 @@ typedef const struct asn_TYPE_descriptor_s {
/*
* An ASN.1 production type members (members of SEQUENCE, SET, CHOICE).
*/
const struct asn_TYPE_member_s *elements;
struct asn_TYPE_member_s *elements;
unsigned elements_count;
/*
@@ -217,13 +217,13 @@ typedef const struct asn_TYPE_descriptor_s {
ATF_OPEN_TYPE = 0x02, /* Open Type */
ATF_ANY_TYPE = 0x04 /* ANY type (deprecated!) */
};
typedef const struct asn_TYPE_member_s {
typedef struct asn_TYPE_member_s {
enum asn_TYPE_flags_e flags; /* Element's presentation flags */
unsigned optional; /* Following optional members, including current */
unsigned memb_offset; /* Offset of the element */
ber_tlv_tag_t tag; /* Outmost (most immediate) tag */
int tag_mode; /* IMPLICIT/no/EXPLICIT tag at current level */
const asn_TYPE_descriptor_t *type; /* Member type descriptor */
asn_TYPE_descriptor_t *type; /* Member type descriptor */
asn_type_selector_f *type_selector; /* IoS runtime type selector */
asn_encoding_constraints_t encoding_constraints;
int (*default_value_cmp)(const void *sptr); /* Compare DEFAULT <value> */
@@ -234,7 +234,7 @@ typedef const struct asn_TYPE_member_s {
/*
* BER tag to element number mapping.
*/
typedef const struct asn_TYPE_tag2member_s {
typedef struct asn_TYPE_tag2member_s {
ber_tlv_tag_t el_tag; /* Outmost tag of the member */
unsigned el_no; /* Index of the associated member, base 0 */
int toff_first; /* First occurence of the el_tag, relative */
+2 -2
View File
@@ -265,8 +265,8 @@ uper_open_type_get(const asn_codec_ctx_t *ctx, const asn_TYPE_descriptor_t *td,
int
uper_open_type_skip(const asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
struct asn_TYPE_descriptor_s s_td = {0};
struct asn_TYPE_operation_s s_op = {0};
asn_TYPE_descriptor_t s_td;
asn_TYPE_operation_t s_op;
asn_dec_rval_t rv;
s_td.name = "<unknown extension>";
+2 -2
View File
@@ -15,7 +15,7 @@ extern "C" {
/*
* Pre-computed PER constraints.
*/
typedef const struct asn_per_constraint_s {
typedef struct asn_per_constraint_s {
enum asn_per_constraint_flags {
APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */
APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */
@@ -27,7 +27,7 @@ typedef const struct asn_per_constraint_s {
long lower_bound; /* "lb" value */
long upper_bound; /* "ub" value */
} asn_per_constraint_t;
typedef const struct asn_per_constraints_s {
typedef struct asn_per_constraints_s {
asn_per_constraint_t value;
asn_per_constraint_t size;
int (*value2code)(unsigned int value);
+1 -1
View File
@@ -25,7 +25,7 @@ typedef struct asn_INTEGER_enum_map_s {
} asn_INTEGER_enum_map_t;
/* This type describes an enumeration for INTEGER and ENUMERATED types */
typedef const struct asn_INTEGER_specifics_s {
typedef struct asn_INTEGER_specifics_s {
const asn_INTEGER_enum_map_t *value2enum; /* N -> "tag"; sorted by N */
const unsigned int *enum2value; /* "tag" => N; sorted by tag */
int map_count; /* Elements in either map */
+1 -1
View File
@@ -17,7 +17,7 @@
extern "C" {
#endif
typedef const struct asn_NativeReal_specifics_s {
typedef struct asn_NativeReal_specifics_s {
unsigned float_size; /* sizeof(float) or sizeof(double) */
} asn_NativeReal_specifics_t;
+1 -1
View File
@@ -73,7 +73,7 @@ OCTET_STRING_t *OCTET_STRING_new_fromBuf(const asn_TYPE_descriptor_t *td,
* Internally useful stuff. *
****************************/
typedef const struct asn_OCTET_STRING_specifics_s {
typedef struct asn_OCTET_STRING_specifics_s {
/*
* Target structure description.
*/
+1 -1
View File
@@ -190,7 +190,7 @@ CHOICE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
do {
const asn_TYPE_tag2member_t *t2m;
struct asn_TYPE_tag2member_s key;
asn_TYPE_tag2member_t key;
key.el_tag = tlv_tag;
t2m = (const asn_TYPE_tag2member_t *)bsearch(&key,
+1 -1
View File
@@ -11,7 +11,7 @@
extern "C" {
#endif
typedef const struct asn_CHOICE_specifics_s {
typedef struct asn_CHOICE_specifics_s {
/*
* Target structure description.
*/
+1 -1
View File
@@ -304,7 +304,7 @@ SEQUENCE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
* sorted array of tags.
*/
const asn_TYPE_tag2member_t *t2m;
struct asn_TYPE_tag2member_s key = {0, 0, 0, 0};
asn_TYPE_tag2member_t key = {0, 0, 0, 0};
key.el_tag = tlv_tag;
key.el_no = edx;
t2m = (const asn_TYPE_tag2member_t *)bsearch(&key,
+1 -1
View File
@@ -11,7 +11,7 @@
extern "C" {
#endif
typedef const struct asn_SEQUENCE_specifics_s {
typedef struct asn_SEQUENCE_specifics_s {
/*
* Target structure description.
*/
+1 -1
View File
@@ -12,7 +12,7 @@ extern "C" {
#endif
typedef const struct asn_SET_specifics_s {
typedef struct asn_SET_specifics_s {
/*
* Target structure description.
*/
+1 -1
View File
@@ -11,7 +11,7 @@
extern "C" {
#endif
typedef const struct asn_SET_OF_specifics_s {
typedef struct asn_SET_OF_specifics_s {
/*
* Target structure description.
*/
+7 -7
View File
@@ -141,7 +141,7 @@ typedef asn_type_selector_result_t(asn_type_selector_f)(
* Generalized functions for dealing with the speciic type.
* May be directly invoked by applications.
*/
typedef const struct asn_TYPE_operation_s {
typedef struct asn_TYPE_operation_s {
asn_struct_free_f *free_struct; /* Free the structure */
asn_struct_print_f *print_struct; /* Human readable output */
asn_struct_compare_f *compare_struct; /* Compare two structures */
@@ -169,7 +169,7 @@ typedef struct asn_encoding_constraints_s {
/*
* The definitive description of the destination language's structure.
*/
typedef const struct asn_TYPE_descriptor_s {
typedef struct asn_TYPE_descriptor_s {
const char *name; /* A name of the ASN.1 type. "" in some cases. */
const char *xml_tag; /* Name used in XML tag */
@@ -177,7 +177,7 @@ typedef const struct asn_TYPE_descriptor_s {
* Generalized functions for dealing with the specific type.
* May be directly invoked by applications.
*/
const asn_TYPE_operation_t *op;
asn_TYPE_operation_t *op;
/***********************************************************************
* Internally useful members. Not to be used by applications directly. *
@@ -197,7 +197,7 @@ typedef const struct asn_TYPE_descriptor_s {
/*
* An ASN.1 production type members (members of SEQUENCE, SET, CHOICE).
*/
const struct asn_TYPE_member_s *elements;
struct asn_TYPE_member_s *elements;
unsigned elements_count;
/*
@@ -217,13 +217,13 @@ typedef const struct asn_TYPE_descriptor_s {
ATF_OPEN_TYPE = 0x02, /* Open Type */
ATF_ANY_TYPE = 0x04 /* ANY type (deprecated!) */
};
typedef const struct asn_TYPE_member_s {
typedef struct asn_TYPE_member_s {
enum asn_TYPE_flags_e flags; /* Element's presentation flags */
unsigned optional; /* Following optional members, including current */
unsigned memb_offset; /* Offset of the element */
ber_tlv_tag_t tag; /* Outmost (most immediate) tag */
int tag_mode; /* IMPLICIT/no/EXPLICIT tag at current level */
const asn_TYPE_descriptor_t *type; /* Member type descriptor */
asn_TYPE_descriptor_t *type; /* Member type descriptor */
asn_type_selector_f *type_selector; /* IoS runtime type selector */
asn_encoding_constraints_t encoding_constraints;
int (*default_value_cmp)(const void *sptr); /* Compare DEFAULT <value> */
@@ -234,7 +234,7 @@ typedef const struct asn_TYPE_member_s {
/*
* BER tag to element number mapping.
*/
typedef const struct asn_TYPE_tag2member_s {
typedef struct asn_TYPE_tag2member_s {
ber_tlv_tag_t el_tag; /* Outmost tag of the member */
unsigned el_no; /* Index of the associated member, base 0 */
int toff_first; /* First occurence of the el_tag, relative */
+2 -2
View File
@@ -265,8 +265,8 @@ uper_open_type_get(const asn_codec_ctx_t *ctx, const asn_TYPE_descriptor_t *td,
int
uper_open_type_skip(const asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
struct asn_TYPE_descriptor_s s_td = {0};
struct asn_TYPE_operation_s s_op = {0};
asn_TYPE_descriptor_t s_td;
asn_TYPE_operation_t s_op;
asn_dec_rval_t rv;
s_td.name = "<unknown extension>";
+2 -2
View File
@@ -15,7 +15,7 @@ extern "C" {
/*
* Pre-computed PER constraints.
*/
typedef const struct asn_per_constraint_s {
typedef struct asn_per_constraint_s {
enum asn_per_constraint_flags {
APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */
APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */
@@ -27,7 +27,7 @@ typedef const struct asn_per_constraint_s {
long lower_bound; /* "lb" value */
long upper_bound; /* "ub" value */
} asn_per_constraint_t;
typedef const struct asn_per_constraints_s {
typedef struct asn_per_constraints_s {
asn_per_constraint_t value;
asn_per_constraint_t size;
int (*value2code)(unsigned int value);