Lev Walkin | c6cac8e | 2016-03-14 02:57:07 -0700 | [diff] [blame] | 1 | #ifndef ASN1FIX_TAGS_H |
| 2 | #define ASN1FIX_TAGS_H |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3 | |
Lev Walkin | c0e03b9 | 2017-08-22 01:48:23 -0700 | [diff] [blame] | 4 | struct asn1_namespace_s; /* Forward declaration */ |
| 5 | |
Lev Walkin | 8945e0e | 2004-09-10 06:07:04 +0000 | [diff] [blame] | 6 | enum 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 Walkin | 188ed2c | 2004-09-13 08:31:01 +0000 | [diff] [blame] | 9 | AFT_FULL_COLLECT = 0x04, /* Collect all tags */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 10 | AFT_CANON_CHOICE = 0x08, /* Fetch the minimal CHOICE root tag */ |
Lev Walkin | 8945e0e | 2004-09-10 06:07:04 +0000 | [diff] [blame] | 11 | }; |
| 12 | |
Lev Walkin | 8945e0e | 2004-09-10 06:07:04 +0000 | [diff] [blame] | 13 | /* |
| 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 Walkin | c0e03b9 | 2017-08-22 01:48:23 -0700 | [diff] [blame] | 20 | int 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 Walkin | 8945e0e | 2004-09-10 06:07:04 +0000 | [diff] [blame] | 24 | |
| 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 Walkin | c0e03b9 | 2017-08-22 01:48:23 -0700 | [diff] [blame] | 32 | int 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 Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 36 | |
Lev Walkin | c6cac8e | 2016-03-14 02:57:07 -0700 | [diff] [blame] | 37 | #endif /* ASN1FIX_TAGS_H */ |