Wireshark  4.3.0
The Wireshark network protocol analyzer
packet-oer.h
1 /* packet-per.h
2  * Routines for dissection of ASN.1 OER
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10 
11 #ifndef __PACKET_OER_H__
12 #define __PACKET_OER_H__
13 
14 #include "ws_symbol_export.h"
15 
16 typedef int (*oer_type_fn)(tvbuff_t*, int, asn1_ctx_t*, proto_tree*, int);
17 
18 
19 /* value for value and size constraints */
20 #define NO_BOUND -1
21 
22 
23 /* values for extensions */
24 #define ASN1_NO_EXTENSIONS 0
25 #define ASN1_EXTENSION_ROOT ASN1_EXT_ROOT
26 #define ASN1_NOT_EXTENSION_ROOT ASN1_EXT_EXT
27 
28 /* value for optional */
29 #define ASN1_NOT_OPTIONAL 0
30 #define ASN1_OPTIONAL ASN1_OPT
31 
32 typedef struct _oer_choice_t {
33  gint value;
34  const int *p_id;
35  int extension;
36  oer_type_fn func;
37 } oer_choice_t;
38 
39 typedef struct _oer_sequence_t {
40  const int *p_id;
41  int extension;
42  int optional;
43  oer_type_fn func;
45 
46 //WS_DLL_PUBLIC void dissect_oer_not_decoded_yet(proto_tree* tree, packet_info* pinfo, tvbuff_t *tvb, const char* reason);
47 
48 WS_DLL_PUBLIC guint32 dissect_oer_null(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
49 
50 //WS_DLL_PUBLIC guint32 dissect_oer_GeneralString(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
51 
52 WS_DLL_PUBLIC guint32 dissect_oer_sequence_of(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const oer_sequence_t *seq);
53 
54 WS_DLL_PUBLIC guint32 dissect_oer_IA5String(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension);
55 
56 //WS_DLL_PUBLIC guint32 dissect_oer_NumericString(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension);
57 
58 //WS_DLL_PUBLIC guint32 dissect_oer_PrintableString(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension);
59 
60 //WS_DLL_PUBLIC guint32 dissect_oer_VisibleString(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension);
61 
62 //WS_DLL_PUBLIC guint32 dissect_oer_BMPString(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension);
63 
64 extern guint32 dissect_oer_UTF8String(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension);
65 
66 //extern guint32 dissect_oer_object_descriptor(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, tvbuff_t **value_tvb);
67 
68 WS_DLL_PUBLIC guint32 dissect_oer_constrained_sequence_of(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const oer_sequence_t *seq, int min_len, int max_len, gboolean has_extension);
69 
70 //WS_DLL_PUBLIC guint32 dissect_oer_constrained_set_of(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const oer_sequence_t *seq, int min_len, int max_len, gboolean has_extension);
71 
72 //WS_DLL_PUBLIC guint32 dissect_oer_set_of(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const oer_sequence_t *seq);
73 
74 WS_DLL_PUBLIC guint32 dissect_oer_object_identifier(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, tvbuff_t **value_tvb);
75 //WS_DLL_PUBLIC guint32 dissect_oer_object_identifier_str(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, const char **value_stringx);
76 
77 //WS_DLL_PUBLIC guint32 dissect_oer_relative_oid(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, tvbuff_t **value_tvb);
78 //WS_DLL_PUBLIC guint32 dissect_oer_relative_oid_str(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, const char **value_stringx);
79 
80 WS_DLL_PUBLIC guint32 dissect_oer_boolean(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, bool *bool_val);
81 
82 WS_DLL_PUBLIC guint32 dissect_oer_integer(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, gint32 *value);
83 
84 WS_DLL_PUBLIC guint32 dissect_oer_constrained_integer(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, gint64 min, gint64 max, guint32 *value, gboolean has_extension);
85 
86 WS_DLL_PUBLIC guint32 dissect_oer_constrained_integer_64b(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, gint64 min, guint64 max, guint64 *value, gboolean has_extension);
87 WS_DLL_PUBLIC guint32 dissect_oer_constrained_integer_64b_no_ub(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, gint64 min, guint64 max, guint64 *value, gboolean has_extension);
88 
89 //WS_DLL_PUBLIC guint32 dissect_oer_real(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, double *value);
90 
91 WS_DLL_PUBLIC guint32 dissect_oer_choice(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, gint ett_index, const oer_choice_t *choice, gint *value);
92 
93 WS_DLL_PUBLIC guint32 dissect_oer_sequence(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const oer_sequence_t *sequence);
94 //WS_DLL_PUBLIC guint32 dissect_oer_sequence_eag(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, const oer_sequence_t *sequence);
95 
96 WS_DLL_PUBLIC guint32 dissect_oer_octet_string(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension, tvbuff_t **value_tvb);
97 //WS_DLL_PUBLIC guint32 dissect_oer_octet_string_containing_pdu_new(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension, dissector_t type_cb);
98 
99 WS_DLL_PUBLIC guint32
100 dissect_oer_bit_string(tvbuff_t *tvb, guint32 offset _U_, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_, int min_len _U_, int max_len _U_, gboolean has_extension _U_, int * const *named_bits _U_, gint num_named_bits _U_, tvbuff_t **value_tvb _U_, int *len _U_);
101 //WS_DLL_PUBLIC guint32 dissect_oer_bit_string_containing_pdu_new(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension, dissector_t type_cb);
102 
103 //WS_DLL_PUBLIC guint32 dissect_oer_restricted_character_string(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension, const char *alphabet, int alphabet_length, tvbuff_t **value_tvb);
104 
105 WS_DLL_PUBLIC guint32 dissect_oer_enumerated(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, guint32 root_num, guint32 *value, gboolean has_extension, guint32 ext_num, guint32 *value_map);
106 
107 WS_DLL_PUBLIC guint32 dissect_oer_open_type(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, oer_type_fn type_cb);
108 //WS_DLL_PUBLIC guint32 dissect_oer_open_type_pdu_new(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, dissector_t type_cb);
109 
110 //WS_DLL_PUBLIC guint32 dissect_oer_external_type(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, oer_type_fn type_cb);
111 
112 //extern guint32 dissect_oer_size_constrained_type(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, oer_type_fn type_cb, const gchar *name, int min_len, int max_len, gboolean has_extension);
114 
115 //extern guint32 dissect_oer_length_determinant(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index, guint32 *length, bool *is_fragmented);
116 
117 //WS_DLL_PUBLIC int call_oer_oid_callback(const char *oid, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, asn1_ctx_t *actx, int hf_index);
118 //WS_DLL_PUBLIC void register_oer_oid_dissector(const char *oid, dissector_t dissector, int proto, const char *name);
119 
120 #endif /* __PACKET_OER_H__ */
Definition: asn1.h:65
Definition: packet-oer.h:32
Definition: packet-oer.h:39
Definition: proto.h:904
Definition: tvbuff-int.h:35