Move type operations to another structure
Every type has free, print, check_constraints, ber_decoder, der_encoder,
xer_decoder, xer_encoder, uper_decoder, uper_encoder and outmost_tag
operations. We move them out to a separate structure asn_TYPE_operation_t.
Combined with previous logic simplification, these operations are based
on ASN.1 basic types, constructed types and string types. So we can
reduce the space occupied by asn_TYPE_descriptor_t variables.
diff --git a/skeletons/RELATIVE-OID.c b/skeletons/RELATIVE-OID.c
index 9efd90d..cb763a6 100644
--- a/skeletons/RELATIVE-OID.c
+++ b/skeletons/RELATIVE-OID.c
@@ -16,9 +16,7 @@
static const ber_tlv_tag_t asn_DEF_RELATIVE_OID_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (13 << 2))
};
-asn_TYPE_descriptor_t asn_DEF_RELATIVE_OID = {
- "RELATIVE-OID",
- "RELATIVE_OID",
+asn_TYPE_operation_t asn_OP_RELATIVE_OID = {
ASN__PRIMITIVE_TYPE_free,
RELATIVE_OID_print,
OCTET_STRING_compare, /* Implemented in terms of opaque comparison */
@@ -41,7 +39,13 @@
OCTET_STRING_decode_uper,
OCTET_STRING_encode_uper,
#endif /* ASN_DISABLE_PER_SUPPORT */
- 0, /* Use generic outmost tag fetcher */
+ 0 /* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_RELATIVE_OID = {
+ "RELATIVE-OID",
+ "RELATIVE_OID",
+ &asn_OP_RELATIVE_OID,
+ asn_generic_no_constraint,
asn_DEF_RELATIVE_OID_tags,
sizeof(asn_DEF_RELATIVE_OID_tags)
/ sizeof(asn_DEF_RELATIVE_OID_tags[0]),