92 lines
2.4 KiB
C
92 lines
2.4 KiB
C
/*
|
|
* Generated by asn1c-0.9.21 (http://lionet.info/asn1c)
|
|
* From ASN.1 module "TCAPMessages"
|
|
* found in "tcap.asn"
|
|
*/
|
|
|
|
#include <asn_internal.h>
|
|
|
|
#include "ErrorCode.h"
|
|
|
|
static int
|
|
memb_nationaler_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
|
|
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
|
long value;
|
|
|
|
if(!sptr) {
|
|
_ASN_CTFAIL(app_key, td, sptr,
|
|
"%s: value not given (%s:%d)",
|
|
td->name, __FILE__, __LINE__);
|
|
return -1;
|
|
}
|
|
|
|
value = *(const long *)sptr;
|
|
|
|
if((value >= -32768 && value <= 32767)) {
|
|
/* Constraint check succeeded */
|
|
return 0;
|
|
} else {
|
|
_ASN_CTFAIL(app_key, td, sptr,
|
|
"%s: constraint failed (%s:%d)",
|
|
td->name, __FILE__, __LINE__);
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
static asn_TYPE_member_t asn_MBR_ErrorCode_1[] = {
|
|
{ ATF_NOFLAGS, 0, offsetof(struct ErrorCode, choice.nationaler),
|
|
(ASN_TAG_CLASS_PRIVATE | (19 << 2)),
|
|
-1, /* IMPLICIT tag at current level */
|
|
&asn_DEF_NativeInteger,
|
|
memb_nationaler_constraint_1,
|
|
0, /* PER is not compiled, use -gen-PER */
|
|
0,
|
|
"nationaler"
|
|
},
|
|
{ ATF_NOFLAGS, 0, offsetof(struct ErrorCode, choice.privateer),
|
|
(ASN_TAG_CLASS_PRIVATE | (20 << 2)),
|
|
-1, /* IMPLICIT tag at current level */
|
|
&asn_DEF_INTEGER,
|
|
0, /* Defer constraints checking to the member type */
|
|
0, /* PER is not compiled, use -gen-PER */
|
|
0,
|
|
"privateer"
|
|
},
|
|
};
|
|
static asn_TYPE_tag2member_t asn_MAP_ErrorCode_tag2el_1[] = {
|
|
{ (ASN_TAG_CLASS_PRIVATE | (19 << 2)), 0, 0, 0 }, /* nationaler at 243 */
|
|
{ (ASN_TAG_CLASS_PRIVATE | (20 << 2)), 1, 0, 0 } /* privateer at 245 */
|
|
};
|
|
static asn_CHOICE_specifics_t asn_SPC_ErrorCode_specs_1 = {
|
|
sizeof(struct ErrorCode),
|
|
offsetof(struct ErrorCode, _asn_ctx),
|
|
offsetof(struct ErrorCode, present),
|
|
sizeof(((struct ErrorCode *)0)->present),
|
|
asn_MAP_ErrorCode_tag2el_1,
|
|
2, /* Count of tags in the map */
|
|
0,
|
|
-1 /* Extensions start */
|
|
};
|
|
asn_TYPE_descriptor_t asn_DEF_ErrorCode = {
|
|
"ErrorCode",
|
|
"ErrorCode",
|
|
CHOICE_free,
|
|
CHOICE_print,
|
|
CHOICE_constraint,
|
|
CHOICE_decode_ber,
|
|
CHOICE_encode_der,
|
|
CHOICE_decode_xer,
|
|
CHOICE_encode_xer,
|
|
0, 0, /* No PER support, use "-gen-PER" to enable */
|
|
CHOICE_outmost_tag,
|
|
0, /* No effective tags (pointer) */
|
|
0, /* No effective tags (count) */
|
|
0, /* No tags (pointer) */
|
|
0, /* No tags (count) */
|
|
0, /* No PER visible constraints */
|
|
asn_MBR_ErrorCode_1,
|
|
2, /* Elements count */
|
|
&asn_SPC_ErrorCode_specs_1 /* Additional specs */
|
|
};
|
|
|