blob: d59063bd16560656228dc165d1be240753fc3237 [file] [log] [blame]
Lev Walkinc6cac8e2016-03-14 02:57:07 -07001#ifndef ASN1FIX_TAGS_H
2#define ASN1FIX_TAGS_H
Lev Walkinf15320b2004-06-03 03:38:44 +00003
Lev Walkinc0e03b92017-08-22 01:48:23 -07004struct asn1_namespace_s; /* Forward declaration */
5
Lev Walkin8945e0e2004-09-10 06:07:04 +00006enum asn1f_aft_flags_e {
7 AFT_IMAGINARY_ANY = 0x01, /* Treat ANY tag as [IMAGINARY ANY] */
8 AFT_FETCH_OUTMOST = 0x02, /* Fetch only outmost tag */
Lev Walkin188ed2c2004-09-13 08:31:01 +00009 AFT_FULL_COLLECT = 0x04, /* Collect all tags */
Lev Walkin59b176e2005-11-26 11:25:14 +000010 AFT_CANON_CHOICE = 0x08, /* Fetch the minimal CHOICE root tag */
Lev Walkin8945e0e2004-09-10 06:07:04 +000011};
12
Lev Walkin8945e0e2004-09-10 06:07:04 +000013/*
14 * Allocate and return an array of tags for the given type.
15 * Type1 ::= [2] EXPLICIT Type2
16 * Type2 ::= [3] IMPLICIT Type3
17 * Type3 ::= [4] EXPLICIT SEQUENCE { ... }
18 * Will return [2][3][UNIVERSAL 16] for the Type1.
19 */
Lev Walkinc0e03b92017-08-22 01:48:23 -070020int asn1f_fetch_tags(asn1p_t *asn, struct asn1_namespace_s *ns,
21 asn1p_module_t *mod, asn1p_expr_t *expr,
22 struct asn1p_type_tag_s **tags,
23 enum asn1f_aft_flags_e flags);
Lev Walkin8945e0e2004-09-10 06:07:04 +000024
25/*
26 * Fetch the outmost tag of the given type.
27 * Type1 ::= Type2
28 * Type2 ::= [2] Type3
29 * Type3 ::= SEQUENCE { ... }
30 * Will yield [2] for Type1.
31 */
Lev Walkinc0e03b92017-08-22 01:48:23 -070032int asn1f_fetch_outmost_tag(asn1p_t *asn, struct asn1_namespace_s *ns,
33 asn1p_module_t *mod, asn1p_expr_t *expr,
34 struct asn1p_type_tag_s *tag,
35 enum asn1f_aft_flags_e);
Lev Walkinf15320b2004-06-03 03:38:44 +000036
Lev Walkinc6cac8e2016-03-14 02:57:07 -070037#endif /* ASN1FIX_TAGS_H */