Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet-oer.h
1/* packet-oer.h
2 * Routines for dissection of ASN.1 OER
3 *
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <[email protected]>
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#include <epan/asn1.h>
16
17typedef unsigned (*oer_type_fn)(tvbuff_t*, unsigned, asn1_ctx_t*, proto_tree*, int);
18
19
20/* value for value and size constraints */
21#define NO_BOUND -1
22
23
24/* values for extensions */
25#define ASN1_NO_EXTENSIONS 0
26#define ASN1_EXTENSION_ROOT ASN1_EXT_ROOT
27#define ASN1_NOT_EXTENSION_ROOT ASN1_EXT_EXT
28
29/* value for optional */
30#define ASN1_NOT_OPTIONAL 0
31#define ASN1_OPTIONAL ASN1_OPT
32
33typedef struct _oer_choice_t {
34 int value;
35 const int *p_id;
36 int extension;
37 oer_type_fn func;
39
40typedef struct _oer_sequence_t {
41 const int *p_id;
42 int extension;
43 int optional;
44 oer_type_fn func;
46
47//WS_DLL_PUBLIC void dissect_oer_not_decoded_yet(proto_tree* tree, packet_info* pinfo, tvbuff_t *tvb, const char* reason);
48
49WS_DLL_PUBLIC uint32_t dissect_oer_null(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
50
51//WS_DLL_PUBLIC uint32_t dissect_oer_GeneralString(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
52
53WS_DLL_PUBLIC uint32_t dissect_oer_sequence_of(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *parent_tree, int hf_index, int ett_index, const oer_sequence_t *seq);
54
55WS_DLL_PUBLIC uint32_t dissect_oer_IA5String(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, bool has_extension);
56
57//WS_DLL_PUBLIC uint32_t dissect_oer_NumericString(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, bool has_extension);
58
59//WS_DLL_PUBLIC uint32_t dissect_oer_PrintableString(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, bool has_extension);
60
61//WS_DLL_PUBLIC uint32_t dissect_oer_VisibleString(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, bool has_extension);
62
63//WS_DLL_PUBLIC uint32_t dissect_oer_BMPString(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, bool has_extension);
64
65WS_DLL_PUBLIC uint32_t dissect_oer_UTF8String(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, bool has_extension);
66
67//extern uint32_t dissect_oer_object_descriptor(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, tvbuff_t **value_tvb);
68
69WS_DLL_PUBLIC uint32_t dissect_oer_constrained_sequence_of(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *parent_tree, int hf_index, int ett_index, const oer_sequence_t *seq, int min_len, int max_len, bool has_extension);
70
71//WS_DLL_PUBLIC uint32_t dissect_oer_constrained_set_of(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *parent_tree, int hf_index, int ett_index, const oer_sequence_t *seq, int min_len, int max_len, bool has_extension);
72
73//WS_DLL_PUBLIC uint32_t dissect_oer_set_of(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *parent_tree, int hf_index, int ett_index, const oer_sequence_t *seq);
74
75WS_DLL_PUBLIC uint32_t dissect_oer_object_identifier(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, tvbuff_t **value_tvb);
76//WS_DLL_PUBLIC uint32_t dissect_oer_object_identifier_str(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, const char **value_stringx);
77
78//WS_DLL_PUBLIC uint32_t dissect_oer_relative_oid(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, tvbuff_t **value_tvb);
79//WS_DLL_PUBLIC uint32_t dissect_oer_relative_oid_str(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, const char **value_stringx);
80
81WS_DLL_PUBLIC uint32_t dissect_oer_boolean(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, bool *bool_val);
82
83WS_DLL_PUBLIC uint32_t dissect_oer_integer(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int32_t *value);
84
85WS_DLL_PUBLIC uint32_t dissect_oer_integer_64b(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int64_t *value);
86
87WS_DLL_PUBLIC uint32_t dissect_oer_constrained_integer(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int64_t min, int64_t max, uint32_t *value, bool has_extension);
88
89WS_DLL_PUBLIC uint32_t dissect_oer_constrained_integer_64b(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int64_t min, uint64_t max, uint64_t *value, bool has_extension);
90WS_DLL_PUBLIC uint32_t dissect_oer_constrained_integer_64b_no_ub(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int64_t min, uint64_t max, uint64_t *value, bool has_extension);
91
92//WS_DLL_PUBLIC uint32_t dissect_oer_real(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, double *value);
93
94WS_DLL_PUBLIC uint32_t dissect_oer_choice(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int ett_index, const oer_choice_t *choice, int *value);
95
96WS_DLL_PUBLIC uint32_t dissect_oer_sequence(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *parent_tree, int hf_index, int ett_index, const oer_sequence_t *sequence);
97//WS_DLL_PUBLIC uint32_t dissect_oer_sequence_eag(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, const oer_sequence_t *sequence);
98
99WS_DLL_PUBLIC uint32_t dissect_oer_octet_string(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, bool has_extension, tvbuff_t **value_tvb);
100//WS_DLL_PUBLIC uint32_t dissect_oer_octet_string_containing_pdu_new(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, bool has_extension, dissector_t type_cb);
101
102WS_DLL_PUBLIC uint32_t
103dissect_oer_bit_string(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, bool has_extension, int * const *named_bits, int num_named_bits, tvbuff_t **value_tvb, int *len);
104//WS_DLL_PUBLIC uint32_t dissect_oer_bit_string_containing_pdu_new(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, bool has_extension, dissector_t type_cb);
105
106//WS_DLL_PUBLIC uint32_t dissect_oer_restricted_character_string(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, bool has_extension, const char *alphabet, int alphabet_length, tvbuff_t **value_tvb);
107
108WS_DLL_PUBLIC uint32_t dissect_oer_enumerated(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, uint32_t root_num, uint32_t *value, bool has_extension, uint32_t ext_num, const uint32_t *value_map);
109
110WS_DLL_PUBLIC uint32_t dissect_oer_open_type(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, oer_type_fn type_cb);
111//WS_DLL_PUBLIC uint32_t dissect_oer_open_type_pdu_new(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, dissector_t type_cb);
112
113//WS_DLL_PUBLIC uint32_t dissect_oer_external_type(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, oer_type_fn type_cb);
114
115//extern uint32_t dissect_oer_size_constrained_type(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, oer_type_fn type_cb, const char *name, int min_len, int max_len, bool has_extension);
117
118//extern uint32_t dissect_oer_length_determinant(tvbuff_t *tvb, uint32_t offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index, uint32_t *length, bool *is_fragmented);
119
120//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);
121//WS_DLL_PUBLIC void register_oer_oid_dissector(const char *oid, dissector_t dissector, int proto, const char *name);
122
123#endif /* __PACKET_OER_H__ */
Definition asn1.h:66
Definition packet-oer.h:33
Definition packet-oer.h:40
Definition proto.h:907
Definition tvbuff-int.h:36