blob: ddcbb393f41c9bfa678035c020b9649b0bcf251e [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001/*-
Lev Walkin59b176e2005-11-26 11:25:14 +00002 * Copyright (c) 2003, 2004, 2005 Lev Walkin <vlm@lionet.info>.
3 * All rights reserved.
Lev Walkinf15320b2004-06-03 03:38:44 +00004 * Redistribution and modifications are permitted subject to BSD license.
5 */
6#ifndef _CONSTR_CHOICE_H_
7#define _CONSTR_CHOICE_H_
8
Lev Walkin11c3e172004-09-24 21:00:50 +00009#include <asn_application.h>
Lev Walkinf15320b2004-06-03 03:38:44 +000010
Lev Walkin21b41ac2005-07-24 09:03:44 +000011#ifdef __cplusplus
12extern "C" {
13#endif
14
Wim Lewisfb6344e2014-07-28 12:16:01 -070015typedef const struct asn_CHOICE_specifics_s {
Lev Walkinf15320b2004-06-03 03:38:44 +000016 /*
17 * Target structure description.
18 */
19 int struct_size; /* Size of the target structure. */
Lev Walkindc06f6b2004-10-20 15:50:55 +000020 int ctx_offset; /* Offset of the asn_codec_ctx_t member */
Lev Walkinf15320b2004-06-03 03:38:44 +000021 int pres_offset; /* Identifier of the present member */
22 int pres_size; /* Size of the identifier (enum) */
23
24 /*
Lev Walkinf15320b2004-06-03 03:38:44 +000025 * Tags to members mapping table.
26 */
Wim Lewisfb6344e2014-07-28 12:16:01 -070027 const asn_TYPE_tag2member_t *tag2el;
Lev Walkinf15320b2004-06-03 03:38:44 +000028 int tag2el_count;
29
Lev Walkin59b176e2005-11-26 11:25:14 +000030 /* Canonical ordering of CHOICE elements, for PER */
31 int *canonical_order;
32
Lev Walkinf15320b2004-06-03 03:38:44 +000033 /*
34 * Extensions-related stuff.
35 */
Lev Walkin59b176e2005-11-26 11:25:14 +000036 int ext_start; /* First member of extensions, or -1 */
Lev Walkin5e033762004-09-29 13:26:15 +000037} asn_CHOICE_specifics_t;
Lev Walkinf15320b2004-06-03 03:38:44 +000038
39/*
40 * A set specialized functions dealing with the CHOICE type.
41 */
Lev Walkina9cc46e2004-09-22 16:06:28 +000042asn_struct_free_f CHOICE_free;
43asn_struct_print_f CHOICE_print;
Lev Walkinf15320b2004-06-03 03:38:44 +000044asn_constr_check_f CHOICE_constraint;
45ber_type_decoder_f CHOICE_decode_ber;
46der_type_encoder_f CHOICE_encode_der;
Lev Walkin8d01b4c2004-10-23 14:57:50 +000047xer_type_decoder_f CHOICE_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +000048xer_type_encoder_f CHOICE_encode_xer;
Lev Walkin59b176e2005-11-26 11:25:14 +000049per_type_decoder_f CHOICE_decode_uper;
Lev Walkin523de9e2006-08-18 01:34:18 +000050per_type_encoder_f CHOICE_encode_uper;
Harald Welte498c9712015-08-30 16:33:07 +020051per_type_decoder_f CHOICE_decode_aper;
52per_type_encoder_f CHOICE_encode_aper;
Lev Walkinf15320b2004-06-03 03:38:44 +000053asn_outmost_tag_f CHOICE_outmost_tag;
Lev Walkinf15320b2004-06-03 03:38:44 +000054
Lev Walkin21b41ac2005-07-24 09:03:44 +000055#ifdef __cplusplus
56}
57#endif
58
Lev Walkinf15320b2004-06-03 03:38:44 +000059#endif /* _CONSTR_CHOICE_H_ */