parent
71752ddd2b
commit
769ab7d04a
@ -0,0 +1,48 @@ |
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "RSPRO" |
||||
* found in "../../asn1/RSPRO.asn" |
||||
*/ |
||||
|
||||
#ifndef _ErrorCode_H_ |
||||
#define _ErrorCode_H_ |
||||
|
||||
|
||||
#include <asn_application.h> |
||||
|
||||
/* Including external dependencies */ |
||||
#include <NativeEnumerated.h> |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
/* Dependencies */ |
||||
typedef enum ErrorCode { |
||||
ErrorCode_unknownClientConnected = 1, |
||||
ErrorCode_unexpectedDisconnect = 2, |
||||
ErrorCode_unexpectedProtocolVersion = 3 |
||||
/*
|
||||
* Enumeration is extensible |
||||
*/ |
||||
} e_ErrorCode; |
||||
|
||||
/* ErrorCode */ |
||||
typedef long ErrorCode_t; |
||||
|
||||
/* Implementation */ |
||||
extern asn_TYPE_descriptor_t asn_DEF_ErrorCode; |
||||
asn_struct_free_f ErrorCode_free; |
||||
asn_struct_print_f ErrorCode_print; |
||||
asn_constr_check_f ErrorCode_constraint; |
||||
ber_type_decoder_f ErrorCode_decode_ber; |
||||
der_type_encoder_f ErrorCode_encode_der; |
||||
xer_type_decoder_f ErrorCode_decode_xer; |
||||
xer_type_encoder_f ErrorCode_encode_xer; |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* _ErrorCode_H_ */ |
||||
#include <asn_internal.h> |
@ -0,0 +1,57 @@ |
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "RSPRO" |
||||
* found in "../../asn1/RSPRO.asn" |
||||
*/ |
||||
|
||||
#ifndef _ErrorInd_H_ |
||||
#define _ErrorInd_H_ |
||||
|
||||
|
||||
#include <asn_application.h> |
||||
|
||||
/* Including external dependencies */ |
||||
#include <osmocom/rspro/ComponentType.h> |
||||
#include "ErrorSeverity.h" |
||||
#include "ErrorCode.h" |
||||
#include "ErrorString.h" |
||||
#include <constr_SEQUENCE.h> |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
/* Forward declarations */ |
||||
struct BankSlot; |
||||
struct ClientSlot; |
||||
|
||||
/* ErrorInd */ |
||||
typedef struct ErrorInd { |
||||
ComponentType_t sender; |
||||
ErrorSeverity_t severity; |
||||
ErrorCode_t code; |
||||
struct BankSlot *bankSlot /* OPTIONAL */; |
||||
struct ClientSlot *clientSlot /* OPTIONAL */; |
||||
ErrorString_t *errorString /* OPTIONAL */; |
||||
/*
|
||||
* This type is extensible, |
||||
* possible extensions are below. |
||||
*/ |
||||
|
||||
/* Context for parsing across buffer boundaries */ |
||||
asn_struct_ctx_t _asn_ctx; |
||||
} ErrorInd_t; |
||||
|
||||
/* Implementation */ |
||||
extern asn_TYPE_descriptor_t asn_DEF_ErrorInd; |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
/* Referred external types */ |
||||
#include <osmocom/rspro/BankSlot.h> |
||||
#include <osmocom/rspro/ClientSlot.h> |
||||
|
||||
#endif /* _ErrorInd_H_ */ |
||||
#include <asn_internal.h> |
@ -0,0 +1,48 @@ |
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "RSPRO" |
||||
* found in "../../asn1/RSPRO.asn" |
||||
*/ |
||||
|
||||
#ifndef _ErrorSeverity_H_ |
||||
#define _ErrorSeverity_H_ |
||||
|
||||
|
||||
#include <asn_application.h> |
||||
|
||||
/* Including external dependencies */ |
||||
#include <NativeEnumerated.h> |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
/* Dependencies */ |
||||
typedef enum ErrorSeverity { |
||||
ErrorSeverity_minor = 1, |
||||
ErrorSeverity_major = 2, |
||||
ErrorSeverity_fatal = 3 |
||||
/*
|
||||
* Enumeration is extensible |
||||
*/ |
||||
} e_ErrorSeverity; |
||||
|
||||
/* ErrorSeverity */ |
||||
typedef long ErrorSeverity_t; |
||||
|
||||
/* Implementation */ |
||||
extern asn_TYPE_descriptor_t asn_DEF_ErrorSeverity; |
||||
asn_struct_free_f ErrorSeverity_free; |
||||
asn_struct_print_f ErrorSeverity_print; |
||||
asn_constr_check_f ErrorSeverity_constraint; |
||||
ber_type_decoder_f ErrorSeverity_decode_ber; |
||||
der_type_encoder_f ErrorSeverity_encode_der; |
||||
xer_type_decoder_f ErrorSeverity_decode_xer; |
||||
xer_type_encoder_f ErrorSeverity_encode_xer; |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* _ErrorSeverity_H_ */ |
||||
#include <asn_internal.h> |
@ -0,0 +1,38 @@ |
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "RSPRO" |
||||
* found in "../../asn1/RSPRO.asn" |
||||
*/ |
||||
|
||||
#ifndef _ErrorString_H_ |
||||
#define _ErrorString_H_ |
||||
|
||||
|
||||
#include <asn_application.h> |
||||
|
||||
/* Including external dependencies */ |
||||
#include <IA5String.h> |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
/* ErrorString */ |
||||
typedef IA5String_t ErrorString_t; |
||||
|
||||
/* Implementation */ |
||||
extern asn_TYPE_descriptor_t asn_DEF_ErrorString; |
||||
asn_struct_free_f ErrorString_free; |
||||
asn_struct_print_f ErrorString_print; |
||||
asn_constr_check_f ErrorString_constraint; |
||||
ber_type_decoder_f ErrorString_decode_ber; |
||||
der_type_encoder_f ErrorString_encode_der; |
||||
xer_type_decoder_f ErrorString_decode_xer; |
||||
xer_type_encoder_f ErrorString_encode_xer; |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* _ErrorString_H_ */ |
||||
#include <asn_internal.h> |
@ -0,0 +1,132 @@ |
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "RSPRO" |
||||
* found in "../../asn1/RSPRO.asn" |
||||
*/ |
||||
|
||||
#include "ErrorCode.h" |
||||
|
||||
int |
||||
ErrorCode_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
||||
/* Replace with underlying type checker */ |
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; |
||||
return td->check_constraints(td, sptr, ctfailcb, app_key); |
||||
} |
||||
|
||||
/*
|
||||
* This type is implemented using NativeEnumerated, |
||||
* so here we adjust the DEF accordingly. |
||||
*/ |
||||
static void |
||||
ErrorCode_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
||||
td->free_struct = asn_DEF_NativeEnumerated.free_struct; |
||||
td->print_struct = asn_DEF_NativeEnumerated.print_struct; |
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; |
||||
td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder; |
||||
td->der_encoder = asn_DEF_NativeEnumerated.der_encoder; |
||||
td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder; |
||||
td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder; |
||||
td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder; |
||||
td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder; |
||||
td->aper_decoder = asn_DEF_NativeEnumerated.aper_decoder; |
||||
td->aper_encoder = asn_DEF_NativeEnumerated.aper_encoder; |
||||
if(!td->per_constraints) |
||||
td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; |
||||
td->elements = asn_DEF_NativeEnumerated.elements; |
||||
td->elements_count = asn_DEF_NativeEnumerated.elements_count; |
||||
/* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ |
||||
} |
||||
|
||||
void |
||||
ErrorCode_free(asn_TYPE_descriptor_t *td, |
||||
void *struct_ptr, int contents_only) { |
||||
ErrorCode_1_inherit_TYPE_descriptor(td); |
||||
td->free_struct(td, struct_ptr, contents_only); |
||||
} |
||||
|
||||
int |
||||
ErrorCode_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
||||
ErrorCode_1_inherit_TYPE_descriptor(td); |
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
||||
} |
||||
|
||||
asn_dec_rval_t |
||||
ErrorCode_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
||||
void **structure, const void *bufptr, size_t size, int tag_mode) { |
||||
ErrorCode_1_inherit_TYPE_descriptor(td); |
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
||||
} |
||||
|
||||
asn_enc_rval_t |
||||
ErrorCode_encode_der(asn_TYPE_descriptor_t *td, |
||||
void *structure, int tag_mode, ber_tlv_tag_t tag, |
||||
asn_app_consume_bytes_f *cb, void *app_key) { |
||||
ErrorCode_1_inherit_TYPE_descriptor(td); |
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
||||
} |
||||
|
||||
asn_dec_rval_t |
||||
ErrorCode_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
||||
ErrorCode_1_inherit_TYPE_descriptor(td); |
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
||||
} |
||||
|
||||
asn_enc_rval_t |
||||
ErrorCode_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
||||
int ilevel, enum xer_encoder_flags_e flags, |
||||
asn_app_consume_bytes_f *cb, void *app_key) { |
||||
ErrorCode_1_inherit_TYPE_descriptor(td); |
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
||||
} |
||||
|
||||
static const asn_INTEGER_enum_map_t asn_MAP_ErrorCode_value2enum_1[] = { |
||||
{ 1, 22, "unknownClientConnected" }, |
||||
{ 2, 20, "unexpectedDisconnect" }, |
||||
{ 3, 25, "unexpectedProtocolVersion" } |
||||
/* This list is extensible */ |
||||
}; |
||||
static const unsigned int asn_MAP_ErrorCode_enum2value_1[] = { |
||||
1, /* unexpectedDisconnect(2) */ |
||||
2, /* unexpectedProtocolVersion(3) */ |
||||
0 /* unknownClientConnected(1) */ |
||||
/* This list is extensible */ |
||||
}; |
||||
static const asn_INTEGER_specifics_t asn_SPC_ErrorCode_specs_1 = { |
||||
asn_MAP_ErrorCode_value2enum_1, /* "tag" => N; sorted by tag */ |
||||
asn_MAP_ErrorCode_enum2value_1, /* N => "tag"; sorted by N */ |
||||
3, /* Number of elements in the maps */ |
||||
4, /* Extensions before this member */ |
||||
1, /* Strict enumeration */ |
||||
0, /* Native long size */ |
||||
0 |
||||
}; |
||||
static const ber_tlv_tag_t asn_DEF_ErrorCode_tags_1[] = { |
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
||||
}; |
||||
asn_TYPE_descriptor_t asn_DEF_ErrorCode = { |
||||
"ErrorCode", |
||||
"ErrorCode", |
||||
ErrorCode_free, |
||||
ErrorCode_print, |
||||
ErrorCode_constraint, |
||||
ErrorCode_decode_ber, |
||||
ErrorCode_encode_der, |
||||
ErrorCode_decode_xer, |
||||
ErrorCode_encode_xer, |
||||
0, 0, /* No UPER support, use "-gen-PER" to enable */ |
||||
0, 0, /* No APER support, use "-gen-PER" to enable */ |
||||
0, /* Use generic outmost tag fetcher */ |
||||
asn_DEF_ErrorCode_tags_1, |
||||
sizeof(asn_DEF_ErrorCode_tags_1) |
||||
/sizeof(asn_DEF_ErrorCode_tags_1[0]), /* 1 */ |
||||
asn_DEF_ErrorCode_tags_1, /* Same as above */ |
||||
sizeof(asn_DEF_ErrorCode_tags_1) |
||||
/sizeof(asn_DEF_ErrorCode_tags_1[0]), /* 1 */ |
||||
0, /* No PER visible constraints */ |
||||
0, 0, /* Defined elsewhere */ |
||||
&asn_SPC_ErrorCode_specs_1 /* Additional specs */ |
||||
}; |
||||
|
@ -0,0 +1,109 @@ |
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "RSPRO" |
||||
* found in "../../asn1/RSPRO.asn" |
||||
*/ |
||||
|
||||
#include "ErrorInd.h" |
||||
|
||||
static asn_TYPE_member_t asn_MBR_ErrorInd_1[] = { |
||||
{ ATF_NOFLAGS, 0, offsetof(struct ErrorInd, sender), |
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), |
||||
0, |
||||
&asn_DEF_ComponentType, |
||||
0, /* Defer constraints checking to the member type */ |
||||
0, /* PER is not compiled, use -gen-PER */ |
||||
0, |
||||
"sender" |
||||
}, |
||||
{ ATF_NOFLAGS, 0, offsetof(struct ErrorInd, severity), |
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), |
||||
0, |
||||
&asn_DEF_ErrorSeverity, |
||||
0, /* Defer constraints checking to the member type */ |
||||
0, /* PER is not compiled, use -gen-PER */ |
||||
0, |
||||
"severity" |
||||
}, |
||||
{ ATF_NOFLAGS, 0, offsetof(struct ErrorInd, code), |
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), |
||||
0, |
||||
&asn_DEF_ErrorCode, |
||||
0, /* Defer constraints checking to the member type */ |
||||
0, /* PER is not compiled, use -gen-PER */ |
||||
0, |
||||
"code" |
||||
}, |
||||
{ ATF_POINTER, 3, offsetof(struct ErrorInd, bankSlot), |
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
||||
-1, /* IMPLICIT tag at current level */ |
||||
&asn_DEF_BankSlot, |
||||
0, /* Defer constraints checking to the member type */ |
||||
0, /* PER is not compiled, use -gen-PER */ |
||||
0, |
||||
"bankSlot" |
||||
}, |
||||
{ ATF_POINTER, 2, offsetof(struct ErrorInd, clientSlot), |
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
||||
-1, /* IMPLICIT tag at current level */ |
||||
&asn_DEF_ClientSlot, |
||||
0, /* Defer constraints checking to the member type */ |
||||
0, /* PER is not compiled, use -gen-PER */ |
||||
0, |
||||
"clientSlot" |
||||
}, |
||||
{ ATF_POINTER, 1, offsetof(struct ErrorInd, errorString), |
||||
(ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
||||
-1, /* IMPLICIT tag at current level */ |
||||
&asn_DEF_ErrorString, |
||||
0, /* Defer constraints checking to the member type */ |
||||
0, /* PER is not compiled, use -gen-PER */ |
||||
0, |
||||
"errorString" |
||||
}, |
||||
}; |
||||
static const ber_tlv_tag_t asn_DEF_ErrorInd_tags_1[] = { |
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
||||
}; |
||||
static const asn_TYPE_tag2member_t asn_MAP_ErrorInd_tag2el_1[] = { |
||||
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 2 }, /* sender */ |
||||
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, -1, 1 }, /* severity */ |
||||
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, -2, 0 }, /* code */ |
||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 3, 0, 0 }, /* bankSlot */ |
||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 4, 0, 0 }, /* clientSlot */ |
||||
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 5, 0, 0 } /* errorString */ |
||||
}; |
||||
static asn_SEQUENCE_specifics_t asn_SPC_ErrorInd_specs_1 = { |
||||
sizeof(struct ErrorInd), |
||||
offsetof(struct ErrorInd, _asn_ctx), |
||||
asn_MAP_ErrorInd_tag2el_1, |
||||
6, /* Count of tags in the map */ |
||||
0, 0, 0, /* Optional elements (not needed) */ |
||||
5, /* Start extensions */ |
||||
7 /* Stop extensions */ |
||||
}; |
||||
asn_TYPE_descriptor_t asn_DEF_ErrorInd = { |
||||
"ErrorInd", |
||||
"ErrorInd", |
||||
SEQUENCE_free, |
||||
SEQUENCE_print, |
||||
SEQUENCE_constraint, |
||||
SEQUENCE_decode_ber, |
||||
SEQUENCE_encode_der, |
||||
SEQUENCE_decode_xer, |
||||
SEQUENCE_encode_xer, |
||||
0, 0, /* No UPER support, use "-gen-PER" to enable */ |
||||
0, 0, /* No APER support, use "-gen-PER" to enable */ |
||||
0, /* Use generic outmost tag fetcher */ |
||||
asn_DEF_ErrorInd_tags_1, |
||||
sizeof(asn_DEF_ErrorInd_tags_1) |
||||
/sizeof(asn_DEF_ErrorInd_tags_1[0]), /* 1 */ |
||||
asn_DEF_ErrorInd_tags_1, /* Same as above */ |
||||
sizeof(asn_DEF_ErrorInd_tags_1) |
||||
/sizeof(asn_DEF_ErrorInd_tags_1[0]), /* 1 */ |
||||
0, /* No PER visible constraints */ |
||||
asn_MBR_ErrorInd_1, |
||||
6, /* Elements count */ |
||||
&asn_SPC_ErrorInd_specs_1 /* Additional specs */ |
||||
}; |
||||
|
@ -0,0 +1,132 @@ |
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "RSPRO" |
||||
* found in "../../asn1/RSPRO.asn" |
||||
*/ |
||||
|
||||
#include "ErrorSeverity.h" |
||||
|
||||
int |
||||
ErrorSeverity_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
||||
/* Replace with underlying type checker */ |
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; |
||||
return td->check_constraints(td, sptr, ctfailcb, app_key); |
||||
} |
||||
|
||||
/*
|
||||
* This type is implemented using NativeEnumerated, |
||||
* so here we adjust the DEF accordingly. |
||||
*/ |
||||
static void |
||||
ErrorSeverity_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
||||
td->free_struct = asn_DEF_NativeEnumerated.free_struct; |
||||
td->print_struct = asn_DEF_NativeEnumerated.print_struct; |
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; |
||||
td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder; |
||||
td->der_encoder = asn_DEF_NativeEnumerated.der_encoder; |
||||
td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder; |
||||
td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder; |
||||
td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder; |
||||
td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder; |
||||
td->aper_decoder = asn_DEF_NativeEnumerated.aper_decoder; |
||||
td->aper_encoder = asn_DEF_NativeEnumerated.aper_encoder; |
||||
if(!td->per_constraints) |
||||
td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; |
||||
td->elements = asn_DEF_NativeEnumerated.elements; |
||||
td->elements_count = asn_DEF_NativeEnumerated.elements_count; |
||||
/* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ |
||||
} |
||||
|
||||
void |
||||
ErrorSeverity_free(asn_TYPE_descriptor_t *td, |
||||
void *struct_ptr, int contents_only) { |
||||
ErrorSeverity_1_inherit_TYPE_descriptor(td); |
||||
td->free_struct(td, struct_ptr, contents_only); |
||||
} |
||||
|
||||
int |
||||
ErrorSeverity_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
||||
ErrorSeverity_1_inherit_TYPE_descriptor(td); |
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
||||
} |
||||
|
||||
asn_dec_rval_t |
||||
ErrorSeverity_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
||||
void **structure, const void *bufptr, size_t size, int tag_mode) { |
||||
ErrorSeverity_1_inherit_TYPE_descriptor(td); |
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
||||
} |
||||
|
||||
asn_enc_rval_t |
||||
ErrorSeverity_encode_der(asn_TYPE_descriptor_t *td, |
||||
void *structure, int tag_mode, ber_tlv_tag_t tag, |
||||
asn_app_consume_bytes_f *cb, void *app_key) { |
||||
ErrorSeverity_1_inherit_TYPE_descriptor(td); |
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
||||
} |
||||
|
||||
asn_dec_rval_t |
||||
ErrorSeverity_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
||||
ErrorSeverity_1_inherit_TYPE_descriptor(td); |
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
||||
} |
||||
|
||||
asn_enc_rval_t |
||||
ErrorSeverity_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
||||
int ilevel, enum xer_encoder_flags_e flags, |
||||
asn_app_consume_bytes_f *cb, void *app_key) { |
||||
ErrorSeverity_1_inherit_TYPE_descriptor(td); |
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
||||
} |
||||
|
||||
static const asn_INTEGER_enum_map_t asn_MAP_ErrorSeverity_value2enum_1[] = { |
||||
{ 1, 5, "minor" }, |
||||
{ 2, 5, "major" }, |
||||
{ 3, 5, "fatal" } |
||||
/* This list is extensible */ |
||||
}; |
||||
static const unsigned int asn_MAP_ErrorSeverity_enum2value_1[] = { |
||||
2, /* fatal(3) */ |
||||
1, /* major(2) */ |
||||
0 /* minor(1) */ |
||||
/* This list is extensible */ |
||||
}; |
||||
static const asn_INTEGER_specifics_t asn_SPC_ErrorSeverity_specs_1 = { |
||||
asn_MAP_ErrorSeverity_value2enum_1, /* "tag" => N; sorted by tag */ |
||||
asn_MAP_ErrorSeverity_enum2value_1, /* N => "tag"; sorted by N */ |
||||
3, /* Number of elements in the maps */ |
||||
4, /* Extensions before this member */ |
||||
1, /* Strict enumeration */ |
||||
0, /* Native long size */ |
||||
0 |
||||
}; |
||||
static const ber_tlv_tag_t asn_DEF_ErrorSeverity_tags_1[] = { |
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
||||
}; |
||||
asn_TYPE_descriptor_t asn_DEF_ErrorSeverity = { |
||||
"ErrorSeverity", |
||||
"ErrorSeverity", |
||||
ErrorSeverity_free, |
||||
ErrorSeverity_print, |
||||
ErrorSeverity_constraint, |
||||
ErrorSeverity_decode_ber, |
||||
ErrorSeverity_encode_der, |
||||
ErrorSeverity_decode_xer, |
||||
ErrorSeverity_encode_xer, |
||||
0, 0, /* No UPER support, use "-gen-PER" to enable */ |
||||
0, 0, /* No APER support, use "-gen-PER" to enable */ |
||||
0, /* Use generic outmost tag fetcher */ |
||||
asn_DEF_ErrorSeverity_tags_1, |
||||
sizeof(asn_DEF_ErrorSeverity_tags_1) |
||||
/sizeof(asn_DEF_ErrorSeverity_tags_1[0]), /* 1 */ |
||||
asn_DEF_ErrorSeverity_tags_1, /* Same as above */ |
||||
sizeof(asn_DEF_ErrorSeverity_tags_1) |
||||
/sizeof(asn_DEF_ErrorSeverity_tags_1[0]), /* 1 */ |
||||
0, /* No PER visible constraints */ |
||||
0, 0, /* Defined elsewhere */ |
||||
&asn_SPC_ErrorSeverity_specs_1 /* Additional specs */ |
||||
}; |
||||
|
@ -0,0 +1,143 @@ |
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "RSPRO" |
||||
* found in "../../asn1/RSPRO.asn" |
||||
*/ |
||||
|
||||
#include "ErrorString.h" |
||||
|
||||
static int check_permitted_alphabet_1(const void *sptr) { |
||||
/* The underlying type is IA5String */ |
||||
const IA5String_t *st = (const IA5String_t *)sptr; |
||||
const uint8_t *ch = st->buf; |
||||
const uint8_t *end = ch + st->size; |
||||
|
||||
for(; ch < end; ch++) { |
||||
uint8_t cv = *ch; |
||||
if(!(cv <= 127l)) return -1; |
||||
} |
||||
return 0; |
||||
} |
||||
|
||||
int |
||||
ErrorString_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
||||
const IA5String_t *st = (const IA5String_t *)sptr; |
||||
size_t size; |
||||
|
||||
if(!sptr) { |
||||
_ASN_CTFAIL(app_key, td, sptr, |
||||
"%s: value not given (%s:%d)", |
||||
td->name, __FILE__, __LINE__); |
||||
return -1; |
||||
} |
||||
|
||||
size = st->size; |
||||
|
||||
if((size >= 1l && size <= 255l) |
||||
&& !check_permitted_alphabet_1(st)) { |
||||
/* Constraint check succeeded */ |
||||
return 0; |
||||
} else { |
||||
_ASN_CTFAIL(app_key, td, sptr, |
||||
"%s: constraint failed (%s:%d)", |
||||
td->name, __FILE__, __LINE__); |
||||
return -1; |
||||
} |
||||
} |
||||
|
||||
/*
|
||||
* This type is implemented using IA5String, |
||||
* so here we adjust the DEF accordingly. |
||||
*/ |
||||
static void |
||||
ErrorString_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
||||
td->free_struct = asn_DEF_IA5String.free_struct; |
||||
td->print_struct = asn_DEF_IA5String.print_struct; |
||||
td->check_constraints = asn_DEF_IA5String.check_constraints; |
||||
td->ber_decoder = asn_DEF_IA5String.ber_decoder; |
||||
td->der_encoder = asn_DEF_IA5String.der_encoder; |
||||
td->xer_decoder = asn_DEF_IA5String.xer_decoder; |
||||
td->xer_encoder = asn_DEF_IA5String.xer_encoder; |
||||
td->uper_decoder = asn_DEF_IA5String.uper_decoder; |
||||
td->uper_encoder = asn_DEF_IA5String.uper_encoder; |
||||
td->aper_decoder = asn_DEF_IA5String.aper_decoder; |
||||
td->aper_encoder = asn_DEF_IA5String.aper_encoder; |
||||
if(!td->per_constraints) |
||||
td->per_constraints = asn_DEF_IA5String.per_constraints; |
||||
td->elements = asn_DEF_IA5String.elements; |
||||
td->elements_count = asn_DEF_IA5String.elements_count; |
||||
td->specifics = asn_DEF_IA5String.specifics; |
||||
} |
||||
|
||||
void |
||||
ErrorString_free(asn_TYPE_descriptor_t *td, |
||||
void *struct_ptr, int contents_only) { |
||||
ErrorString_1_inherit_TYPE_descriptor(td); |
||||
td->free_struct(td, struct_ptr, contents_only); |
||||
} |
||||
|
||||
int |
||||
ErrorString_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
||||
ErrorString_1_inherit_TYPE_descriptor(td); |
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
||||
} |
||||
|
||||
asn_dec_rval_t |
||||
ErrorString_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
||||
void **structure, const void *bufptr, size_t size, int tag_mode) { |
||||
ErrorString_1_inherit_TYPE_descriptor(td); |
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
||||
} |
||||
|
||||
asn_enc_rval_t |
||||
ErrorString_encode_der(asn_TYPE_descriptor_t *td, |
||||
void *structure, int tag_mode, ber_tlv_tag_t tag, |
||||
asn_app_consume_bytes_f *cb, void *app_key) { |
||||
ErrorString_1_inherit_TYPE_descriptor(td); |
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
||||
} |
||||
|
||||
asn_dec_rval_t |
||||
ErrorString_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
||||
ErrorString_1_inherit_TYPE_descriptor(td); |
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
||||
} |
||||
|
||||
asn_enc_rval_t |
||||
ErrorString_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
||||
int ilevel, enum xer_encoder_flags_e flags, |
||||
asn_app_consume_bytes_f *cb, void *app_key) { |
||||
ErrorString_1_inherit_TYPE_descriptor(td); |
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
||||
} |
||||
|
||||
static const ber_tlv_tag_t asn_DEF_ErrorString_tags_1[] = { |
||||
(ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
||||
}; |
||||
asn_TYPE_descriptor_t asn_DEF_ErrorString = { |
||||
"ErrorString", |
||||
"ErrorString", |
||||
ErrorString_free, |
||||
ErrorString_print, |
||||
ErrorString_constraint, |
||||
ErrorString_decode_ber, |
||||
ErrorString_encode_der, |
||||
ErrorString_decode_xer, |
||||
ErrorString_encode_xer, |
||||
0, 0, /* No UPER support, use "-gen-PER" to enable */ |
||||
0, 0, /* No APER support, use "-gen-PER" to enable */ |
||||
0, /* Use generic outmost tag fetcher */ |
||||
asn_DEF_ErrorString_tags_1, |
||||
sizeof(asn_DEF_ErrorString_tags_1) |
||||
/sizeof(asn_DEF_ErrorString_tags_1[0]), /* 1 */ |
||||
asn_DEF_ErrorString_tags_1, /* Same as above */ |
||||
sizeof(asn_DEF_ErrorString_tags_1) |
||||
/sizeof(asn_DEF_ErrorString_tags_1[0]), /* 1 */ |
||||
0, /* No PER visible constraints */ |
||||
0, 0, /* No members */ |
||||
0 /* No specifics */ |
||||
}; |
||||
|
Loading…
Reference in new issue