Adding initial code jy.oak@samsung.com
[ric-app/kpimon.git] / asn1c_defs / all-defs / ANY.h
diff --git a/asn1c_defs/all-defs/ANY.h b/asn1c_defs/all-defs/ANY.h
new file mode 100755 (executable)
index 0000000..31658a2
--- /dev/null
@@ -0,0 +1,65 @@
+/*-\r
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.\r
+ * Redistribution and modifications are permitted subject to BSD license.\r
+ */\r
+#ifndef ASN_TYPE_ANY_H\r
+#define ASN_TYPE_ANY_H\r
+\r
+#include <OCTET_STRING.h>      /* Implemented via OCTET STRING type */\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+typedef struct ANY {\r
+       uint8_t *buf;   /* BER-encoded ANY contents */\r
+       int size;       /* Size of the above buffer */\r
+\r
+       asn_struct_ctx_t _asn_ctx;      /* Parsing across buffer boundaries */\r
+} ANY_t;\r
+\r
+extern asn_TYPE_descriptor_t asn_DEF_ANY;\r
+extern asn_TYPE_operation_t asn_OP_ANY;\r
+extern asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs;\r
+\r
+asn_struct_free_f ANY_free;\r
+asn_struct_print_f ANY_print;\r
+ber_type_decoder_f ANY_decode_ber;\r
+der_type_encoder_f ANY_encode_der;\r
+xer_type_encoder_f ANY_encode_xer;\r
+per_type_decoder_f ANY_decode_uper;\r
+per_type_encoder_f ANY_encode_uper;\r
+per_type_decoder_f ANY_decode_aper;\r
+per_type_encoder_f ANY_encode_aper;\r
+\r
+#define ANY_free         OCTET_STRING_free\r
+#define ANY_print        OCTET_STRING_print\r
+#define ANY_compare      OCTET_STRING_compare\r
+#define ANY_constraint   asn_generic_no_constraint\r
+#define ANY_decode_ber   OCTET_STRING_decode_ber\r
+#define ANY_encode_der   OCTET_STRING_encode_der\r
+#define ANY_decode_xer   OCTET_STRING_decode_xer_hex\r
+\r
+/******************************\r
+ * Handy conversion routines. *\r
+ ******************************/\r
+\r
+/* Convert another ASN.1 type into the ANY. This implies DER encoding. */\r
+int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr);\r
+int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr);\r
+ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr);\r
+ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr);\r
+\r
+/* Convert the contents of the ANY type into the specified type. */\r
+int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);\r
+int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);\r
+\r
+#define        ANY_fromBuf(s, buf, size)       OCTET_STRING_fromBuf((s), (buf), (size))\r
+#define        ANY_new_fromBuf(buf, size)      OCTET_STRING_new_fromBuf(       \\r
+                                               &asn_DEF_ANY, (buf), (size))\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* ASN_TYPE_ANY_H */\r