Move the tap infrastructure to the epan directory.
[obnox/wireshark/wip.git] / plugins / plugin_api_list.c
1 /* plugin_api_list.c
2  * Used to generate various included files for plugin API
3  *
4  * $Id$
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@ethereal.com>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23  */
24
25 #ifdef HAVE_CONFIG_H
26 # include "config.h"
27 #endif
28
29 #include <epan/packet.h>
30 #include <epan/conversation.h>
31 #include <epan/filesystem.h>
32 #include <epan/report_err.h>
33 #include <epan/except.h>
34 #include <epan/prefs.h>
35 #include "reassemble.h"
36 #include <epan/dissectors/packet-giop.h>
37 #include <epan/dissectors/packet-per.h>
38 #include <epan/dissectors/packet-ber.h>
39 #include <epan/dissectors/packet-tpkt.h>
40 #include <epan/dissectors/packet-tcp.h>
41 #include <epan/dissectors/packet-rpc.h>
42 #include <epan/dissectors/packet-rtp.h>
43 #include <epan/dissectors/packet-rtcp.h>
44 #include <epan/tap.h>
45 #include "asn1.h"
46 #include <epan/xdlc.h>
47 #include <epan/crc16.h>
48
49 gint check_col(column_info*, gint);
50 void col_clear(column_info*, gint);
51 void col_add_fstr(column_info*, gint, const gchar*, ...);
52 void col_append_fstr(column_info*, gint, const gchar*, ...);
53 void col_prepend_fstr(column_info*, gint, const gchar*, ...);
54 void col_add_str(column_info*, gint, const gchar*);
55 void col_append_str(column_info*, gint, const gchar*);
56 void col_set_str(column_info*, gint, gchar*);
57
58 void register_init_routine(void (*func)(void));
59 void register_postseq_cleanup_routine(void (*func)(void));
60
61 gchar* match_strval(guint32, const value_string*);
62 gchar* val_to_str(guint32, const value_string *, const char *);
63
64 conversation_t *conversation_new(address *, address *,
65     port_type, guint32, guint32, guint);
66 conversation_t *find_conversation(address *, address *,
67     port_type, guint32, guint32, guint);
68 void conversation_set_dissector(conversation_t *,
69     dissector_handle_t);
70
71 int proto_register_protocol(char*, char*, char*);
72 void proto_register_field_array(int, hf_register_info*, int);
73 void proto_register_subtree_array(int**, int);
74
75 void dissector_add(const char *, guint32, dissector_handle_t);
76 void dissector_delete(const char *, guint32,
77     dissector_handle_t);
78 void dissector_add_handle(const char *,
79     dissector_handle_t);
80
81 void heur_dissector_add(const char *, heur_dissector_t, int);
82
83 void register_dissector(const char *, dissector_t, int);
84 dissector_handle_t find_dissector(const char *);
85 dissector_handle_t create_dissector_handle(dissector_t dissector,
86     int proto);
87 int call_dissector(dissector_handle_t, tvbuff_t *,
88     packet_info *, proto_tree *);
89
90 void tcp_dissect_pdus(tvbuff_t *, packet_info *, proto_tree *,
91     gboolean, guint, guint (*)(tvbuff_t *, int),
92     void (*)(tvbuff_t *, packet_info *, proto_tree *));
93
94 gboolean proto_is_protocol_enabled(protocol_t *);
95
96 int proto_item_get_len(proto_item*);
97 void proto_item_set_len(proto_item*, gint);
98 void proto_item_set_text(proto_item*, const char*, ...);
99 void proto_item_append_text(proto_item*, const char*, ...);
100 proto_tree* proto_item_add_subtree(proto_item*, gint);
101 proto_item* proto_tree_add_item(proto_tree*, int, tvbuff_t*, gint, gint, gboolean);
102 proto_item* proto_tree_add_item_hidden(proto_tree*, int, tvbuff_t*, gint, gint, gboolean);
103 proto_item* proto_tree_add_protocol_format(proto_tree*, int, tvbuff_t*, gint, gint, const char*, ...);
104
105 proto_item* proto_tree_add_bytes(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*);
106 proto_item* proto_tree_add_bytes_hidden(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*);
107 proto_item* proto_tree_add_bytes_format(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*, const char*, ...);
108
109 proto_item* proto_tree_add_time(proto_tree*, int, tvbuff_t*, gint, gint, nstime_t*);
110 proto_item* proto_tree_add_time_hidden(proto_tree*, int, tvbuff_t*, gint, gint, nstime_t*);
111 proto_item* proto_tree_add_time_format(proto_tree*, int, tvbuff_t*, gint, gint, nstime_t*, const char*, ...);
112
113 proto_item* proto_tree_add_ipxnet(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
114 proto_item* proto_tree_add_ipxnet_hidden(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
115 proto_item* proto_tree_add_ipxnet_format(proto_tree*, int, tvbuff_t*, gint, gint, guint32, const char*, ...);
116
117 proto_item* proto_tree_add_ipv4(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
118 proto_item* proto_tree_add_ipv4_hidden(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
119 proto_item* proto_tree_add_ipv4_format(proto_tree*, int, tvbuff_t*, gint, gint, guint32, const char*, ...);
120
121 proto_item* proto_tree_add_ipv6(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*);
122 proto_item* proto_tree_add_ipv6_hidden(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*);
123 proto_item* proto_tree_add_ipv6_format(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*, const char*, ...);
124
125 proto_item* proto_tree_add_ether(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*);
126 proto_item* proto_tree_add_ether_hidden(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*);
127 proto_item* proto_tree_add_ether_format(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*, const char*, ...);
128
129 proto_item* proto_tree_add_string(proto_tree*, int, tvbuff_t*, gint, gint, const char*);
130 proto_item* proto_tree_add_string_hidden(proto_tree*, int, tvbuff_t*, gint, gint, const char*);
131 proto_item* proto_tree_add_string_format(proto_tree*, int, tvbuff_t*, gint, gint, const char*, const char*, ...);
132
133 proto_item* proto_tree_add_boolean(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
134 proto_item* proto_tree_add_boolean_hidden(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
135 proto_item* proto_tree_add_boolean_format(proto_tree*, int, tvbuff_t*, gint, gint, guint32, const char*, ...);
136
137 proto_item* proto_tree_add_double(proto_tree*, int, tvbuff_t*, gint, gint, double);
138 proto_item* proto_tree_add_double_hidden(proto_tree*, int, tvbuff_t*, gint, gint, double);
139 proto_item* proto_tree_add_double_format(proto_tree*, int, tvbuff_t*, gint, gint, double, const char*, ...);
140
141 proto_item* proto_tree_add_uint(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
142 proto_item* proto_tree_add_uint_hidden(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
143 proto_item* proto_tree_add_uint_format(proto_tree*, int, tvbuff_t*, gint, gint, guint32, const char*, ...);
144
145 proto_item* proto_tree_add_int(proto_tree*, int, tvbuff_t*, gint, gint, gint32);
146 proto_item* proto_tree_add_int_hidden(proto_tree*, int, tvbuff_t*, gint, gint, gint32);
147 proto_item* proto_tree_add_int_format(proto_tree*, int, tvbuff_t*, gint, gint, gint32, const char*, ...);
148
149 proto_item* proto_tree_add_text(proto_tree*, tvbuff_t*, gint, gint, const char*, ...);
150
151 tvbuff_t* tvb_new_subset(tvbuff_t*, gint, gint, gint);
152
153 void tvb_set_free_cb(tvbuff_t*, tvbuff_free_cb_t);
154 void tvb_set_child_real_data_tvbuff(tvbuff_t*, tvbuff_t*);
155 tvbuff_t* tvb_new_real_data(const guint8*, guint, gint);
156
157 guint tvb_length(tvbuff_t*);
158 gint tvb_length_remaining(tvbuff_t*, gint);
159 gboolean tvb_bytes_exist(tvbuff_t*, gint, gint);
160 gboolean tvb_offset_exists(tvbuff_t*, gint);
161 guint tvb_reported_length(tvbuff_t*);
162 gint tvb_reported_length_remaining(tvbuff_t*, gint);
163
164 guint8 tvb_get_guint8(tvbuff_t*, gint);
165
166 guint16 tvb_get_ntohs(tvbuff_t*, gint);
167 guint32 tvb_get_ntoh24(tvbuff_t*, gint);
168 guint32 tvb_get_ntohl(tvbuff_t*, gint);
169
170 guint16 tvb_get_letohs(tvbuff_t*, gint);
171 guint32 tvb_get_letoh24(tvbuff_t*, gint);
172 guint32 tvb_get_letohl(tvbuff_t*, gint);
173
174 guint8* tvb_memcpy(tvbuff_t*, guint8* target, gint, gint);
175 guint8* tvb_memdup(tvbuff_t*, gint, gint);
176
177 const guint8* tvb_get_ptr(tvbuff_t*, gint, gint);
178
179 gint tvb_find_guint8(tvbuff_t*, gint, gint, guint8);
180 gint tvb_pbrk_guint8(tvbuff_t *, gint, gint, guint8 *);
181
182 gint tvb_strnlen(tvbuff_t*, gint, guint);
183
184 gchar * tvb_format_text(tvbuff_t*, gint, gint);
185
186 gint tvb_get_nstringz(tvbuff_t*, gint, guint, guint8*);
187 gint tvb_get_nstringz0(tvbuff_t*, gint, guint, guint8*);
188
189 gint tvb_find_line_end(tvbuff_t*, gint, int, gint *, gboolean);
190 gint tvb_find_line_end_unquoted(tvbuff_t*, gint, int, gint *);
191
192 gint tvb_strneql(tvbuff_t*, gint, const gchar *, gint);
193 gint tvb_strncaseeql(tvbuff_t*, gint, const gchar *, gint);
194
195 gchar *tvb_bytes_to_str(tvbuff_t*, gint, gint len);
196
197 struct pref_module *prefs_register_protocol(int,
198     void (*)(void));
199 void prefs_register_uint_preference(struct pref_module *,
200     const char *, const char *, const char *, guint, guint *);
201 void prefs_register_bool_preference(struct pref_module *,
202     const char *, const char *, const char *, gboolean *);
203 void prefs_register_enum_preference(struct pref_module *,
204     const char *, const char *, const char *, gint *, const enum_val_t *,
205     gboolean);
206 void prefs_register_string_preference(struct pref_module *,
207     const char *, const char *, const char *, char**);
208
209 void register_giop_user(giop_sub_dissector_t *, gchar *, int);
210 gboolean is_big_endian(MessageHeader *);
211 guint32 get_CDR_encap_info(tvbuff_t *, proto_tree *, gint *,
212                 gboolean, guint32, gboolean *, guint32 *);
213 void get_CDR_any(tvbuff_t *, proto_tree *, gint *,
214                 gboolean, int, MessageHeader *);
215 gboolean get_CDR_boolean(tvbuff_t *, int *);
216 guint8 get_CDR_char(tvbuff_t *, int *);
217 gdouble get_CDR_double(tvbuff_t *, int *, gboolean, int);
218 guint32 get_CDR_enum(tvbuff_t *, int *, gboolean, int);
219 void get_CDR_fixed(tvbuff_t *, gchar **, gint *, guint32,
220                 gint32);
221 gfloat get_CDR_float(tvbuff_t *, int *, gboolean, int);
222 void get_CDR_interface(tvbuff_t *, packet_info *, proto_tree *,
223                 int *, gboolean, int);
224 gint32 get_CDR_long(tvbuff_t *, int *, gboolean, int);
225 void get_CDR_object(tvbuff_t *, packet_info *, proto_tree *,
226                 int *, gboolean, int);
227 guint8 get_CDR_octet(tvbuff_t *, int *);
228 void get_CDR_octet_seq(tvbuff_t *, gchar **, int *, guint32);
229 gint16 get_CDR_short(tvbuff_t *, int *, gboolean, int);
230 guint32 get_CDR_string(tvbuff_t *, gchar **, int *, gboolean,
231                 int);
232 guint32 get_CDR_typeCode(tvbuff_t *, proto_tree *, gint *,
233         gboolean, int, MessageHeader *);
234 guint32 get_CDR_ulong(tvbuff_t *, int *, gboolean, int);
235 guint16 get_CDR_ushort(tvbuff_t *, int *, gboolean, int);
236 gint get_CDR_wchar(tvbuff_t *, gchar **, int *,
237                 MessageHeader *);
238 guint32 get_CDR_wstring(tvbuff_t *, gchar **, int *, gboolean,
239                 int, MessageHeader *);
240
241 int is_tpkt(tvbuff_t *, int);
242 void dissect_tpkt_encap(tvbuff_t *, packet_info *,
243     proto_tree *, gboolean, dissector_handle_t);
244
245 void set_actual_length(tvbuff_t *, guint);
246
247 const char *decode_boolean_bitfield(guint32, guint32, int,
248     const char *, const char *);
249 const char *decode_numeric_bitfield(guint32, guint32, int,
250     const char *);
251 const char *decode_enumerated_bitfield(guint32, guint32, int,
252     const value_string *, const char *);
253
254 dissector_table_t register_dissector_table(const char *, char *, ftenum_t ,int );
255 void except_throw(long, long, const char *);
256 gboolean dissector_try_port(dissector_table_t, guint32, tvbuff_t *, packet_info *, proto_tree *);
257
258 void conversation_add_proto_data(conversation_t *, int, void *);
259 void *conversation_get_proto_data(conversation_t *, int);
260 void conversation_delete_proto_data(conversation_t *, int);
261 void p_add_proto_data(frame_data *, int, void *);
262 void *p_get_proto_data(frame_data *, int);
263
264 gchar*  ip_to_str(const guint8 *);
265 char*   ip6_to_str(const struct e_in6_addr *);
266 gchar*  time_secs_to_str(guint32);
267 gchar*  time_msecs_to_str(guint32);
268 gchar*  abs_time_to_str(nstime_t*);
269
270 int proto_get_id_by_filter_name(gchar* filter_name);
271 char *proto_get_protocol_name(int n);
272 char *proto_get_protocol_short_name(protocol_t *);
273 char *proto_get_protocol_filter_name(int proto_id);
274
275 void prefs_register_obsolete_preference(module_t *, const char *);
276
277 void add_new_data_source(packet_info *, tvbuff_t *, char *);
278
279 void fragment_table_init(GHashTable **);
280 void reassembled_table_init(GHashTable **);
281 fragment_data *fragment_add(tvbuff_t *, int, packet_info *, guint32,
282                         GHashTable *, guint32, guint32, gboolean);
283 fragment_data *fragment_add_seq(tvbuff_t *, int, packet_info *, guint32,
284                         GHashTable *, guint32, guint32, gboolean);
285 fragment_data *fragment_add_seq_check(tvbuff_t *, int, packet_info *, guint32 id,
286                         GHashTable *, GHashTable *, guint32, guint32, gboolean);
287 fragment_data *fragment_add_seq_next(tvbuff_t *, int, packet_info *, guint32,
288                         GHashTable *, GHashTable *, guint32, gboolean);
289 fragment_data *fragment_get(packet_info *, guint32, GHashTable *);
290 void fragment_set_tot_len(packet_info *, guint32, GHashTable *, guint32);
291 guint32 fragment_get_tot_len(packet_info *, guint32, GHashTable *);
292 void fragment_set_partial_reassembly(packet_info *, guint32, GHashTable *);
293 unsigned char *fragment_delete(packet_info *, guint32, GHashTable *);
294 gboolean show_fragment_tree(fragment_data *, const fragment_items *, proto_tree *, packet_info *, tvbuff_t *);
295 gboolean show_fragment_seq_tree(fragment_data *, const fragment_items *, proto_tree *, packet_info *, tvbuff_t *);
296
297 int register_tap(char *);
298 void tap_queue_packet(int, packet_info *, void *);
299
300 void asn1_open(ASN1_SCK *, tvbuff_t *, int );
301 void asn1_close(ASN1_SCK *, int *);
302 int asn1_octet_decode(ASN1_SCK *, guchar *);
303 int asn1_tag_decode(ASN1_SCK *, guint *);
304 int asn1_id_decode(ASN1_SCK *, guint *, guint *, guint *);
305 int asn1_length_decode(ASN1_SCK *, gboolean *, guint *);
306 int asn1_header_decode(ASN1_SCK *, guint *, guint *, guint *,
307                         gboolean *, guint *);
308 int asn1_eoc(ASN1_SCK *, int );
309 int asn1_eoc_decode(ASN1_SCK *, int );
310 int asn1_null_decode(ASN1_SCK *, int );
311 int asn1_bool_decode(ASN1_SCK *, int , gboolean *);
312 int asn1_int32_value_decode(ASN1_SCK *, int , gint32 *);
313 int asn1_int32_decode(ASN1_SCK *, gint32 *, guint *);
314 int asn1_uint32_value_decode(ASN1_SCK *, int , guint *);
315 int asn1_uint32_decode(ASN1_SCK *, guint32 *, guint *);
316 int asn1_bits_decode(ASN1_SCK *, int , guchar **,
317                              guint *, guchar *);
318 int asn1_string_value_decode(ASN1_SCK *, int ,
319                         guchar **);
320 int asn1_string_decode(ASN1_SCK *, guchar **, guint *,
321                         guint *, guint );
322 int asn1_octet_string_decode(ASN1_SCK *, guchar **, guint *,
323                         guint *);
324 int asn1_subid_decode(ASN1_SCK *, subid_t *);
325 int asn1_oid_value_decode(ASN1_SCK *, int , subid_t **,
326                         guint *);
327 int asn1_oid_decode( ASN1_SCK *, subid_t **, guint *, guint *);
328 int asn1_sequence_decode( ASN1_SCK *, guint *, guint *);
329
330 char *asn1_err_to_str(int );
331
332 void proto_item_set_end(proto_item*, tvbuff_t *, gint);
333
334 proto_item* proto_tree_add_none_format(proto_tree*, int, tvbuff_t*, gint, gint, const char*, ...);
335
336 int except_init(void);
337 void except_deinit(void);
338 void except_rethrow(except_t *);
339 void except_throwd(long, long, const char *, void *);
340 void except_throwf(long, long, const char *, ...);
341 void (*except_unhandled_catcher(void (*)(except_t *)))(except_t *);
342 void *except_take_data(except_t *);
343 void except_set_allocator(void *(*)(size_t), void (*)(void *));
344 void *except_alloc(size_t);
345 void except_free(void *);
346 struct except_stacknode *except_pop(void);
347 void except_setup_try(struct except_stacknode *, struct except_catch *, const except_id_t [], size_t);
348
349 void col_set_fence(column_info*, gint);
350
351 guint8 *tvb_get_string(tvbuff_t *, gint, gint);
352 guint8 *tvb_get_stringz(tvbuff_t *, gint, gint *);
353
354 dissector_table_t find_dissector_table(const char *);
355 dissector_handle_t dissector_get_port_handle(dissector_table_t, guint32);
356 char *dissector_handle_get_short_name(dissector_handle_t);
357 int dissector_handle_get_protocol_index(dissector_handle_t);
358 void new_register_dissector(const char *, new_dissector_t, int); 
359 dissector_handle_t new_create_dissector_handle(new_dissector_t, int);
360
361 void register_giop_user_module(giop_sub_dissector_t *sub, gchar *name, gchar *module, int sub_proto);
362
363 guint32 dissect_per_GeneralString(tvbuff_t*, guint32, packet_info*, proto_tree*, int);
364 guint32 dissect_per_sequence_of(tvbuff_t*, guint32, packet_info*, proto_tree*, int, gint, int (*)(tvbuff_t*, int, packet_info*, proto_tree*));
365 guint32 dissect_per_IA5String(tvbuff_t*, guint32, packet_info*, proto_tree*, int, int, int);
366 guint32 dissect_per_NumericString(tvbuff_t*, guint32, packet_info*, proto_tree*, int, int, int);
367 guint32 dissect_per_PrintableString(tvbuff_t*, guint32, packet_info*, proto_tree*, int, int, int);
368 guint32 dissect_per_BMPString(tvbuff_t*, guint32, packet_info*, proto_tree*, int, int, int);
369 guint32 dissect_per_constrained_sequence_of(tvbuff_t*, guint32, packet_info*, proto_tree*, int, gint, int (*)(tvbuff_t*, int, packet_info*, proto_tree*), int, int);
370 guint32 dissect_per_constrained_set_of(tvbuff_t*, guint32, packet_info*, proto_tree *parent_tree, int, gint, int (*)(tvbuff_t*, int, packet_info*, proto_tree*), int, int);
371 guint32 dissect_per_set_of(tvbuff_t*, guint32, packet_info*, proto_tree *parent_tree, int, gint, int (*)(tvbuff_t*, int, packet_info*, proto_tree*));
372 guint32 dissect_per_object_identifier(tvbuff_t*, guint32, packet_info*, proto_tree*, int, char*);
373 guint32 dissect_per_boolean(tvbuff_t*, guint32, packet_info *pinfo, proto_tree*, int, gboolean*, proto_item**);
374 guint32 dissect_per_integer(tvbuff_t*, guint32, packet_info*, proto_tree*, int, gint32*, proto_item**);
375 guint32 dissect_per_constrained_integer(tvbuff_t*, guint32, packet_info*, proto_tree*, int, guint32, guint32, guint32*, proto_item**, gboolean);
376 guint32 dissect_per_choice(tvbuff_t*, guint32, packet_info*, proto_tree*, int, gint, per_choice_t*, char*, guint32*);
377 guint32 dissect_per_sequence(tvbuff_t*, guint32, packet_info*, proto_tree *parent_tree, int, gint, per_sequence_t*);
378 guint32 dissect_per_octet_string(tvbuff_t*, guint32, packet_info*, proto_tree*, int, int, int, guint32*, guint32*);
379 guint32 dissect_per_restricted_character_string(tvbuff_t*, guint32, packet_info*, proto_tree*, int, int, int, char*, int);
380
381 void dissector_add_string(const char*, gchar*, dissector_handle_t);
382 void dissector_delete_string(const char*, const gchar*, dissector_handle_t);
383 void dissector_change_string(const char*, gchar *, dissector_handle_t);
384 void dissector_reset_string(const char*, const gchar*);
385 gboolean dissector_try_string(dissector_table_t, const gchar*, tvbuff_t*, packet_info*, proto_tree*);
386 dissector_handle_t dissector_get_string_handle(dissector_table_t, const gchar*);
387
388 char *get_datafile_path(const char *filename);
389 char *get_tempfile_path(const char *filename);
390
391 void register_heur_dissector_list(const char *name,
392     heur_dissector_list_t *list);
393 gboolean dissector_try_heuristic(heur_dissector_list_t sub_dissectors,
394     tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
395
396 int asn1_id_decode1(ASN1_SCK *asn1, guint *tag);
397
398 gboolean col_get_writable(column_info *);
399 void col_set_writable(column_info *, gboolean);
400
401 const char *decode_enumerated_bitfield_shifted(guint32, guint32, int,
402     const value_string *, const char *);
403
404 int dissect_xdlc_control(tvbuff_t *tvb, int offset, packet_info *pinfo,
405   proto_tree *xdlc_tree, int hf_xdlc_control, gint ett_xdlc_control,
406   const xdlc_cf_items *cf_items_nonext, const xdlc_cf_items *cf_items_ext,
407   const value_string *u_modifier_short_vals_cmd,
408   const value_string *u_modifier_short_vals_resp, int is_response,
409   int is_extended, int append_info);
410
411 protocol_t *find_protocol_by_id(int n);
412
413 guint tvb_strsize(tvbuff_t *tvb, gint offset);
414
415 void report_open_failure(const char *filename, int err, gboolean for_writing);
416
417 void report_read_failure(const char *filename, int err);
418
419 guint32 dissect_per_bit_string(tvbuff_t*, guint32, packet_info*, proto_tree*, int, int, int);
420
421 int dissect_ber_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint8 *class, gboolean *pc, guint32 *tag);
422 int dissect_ber_length(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint32 *length, gboolean *ind);
423 int dissect_ber_integer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, guint32 *value);
424 int dissect_ber_boolean(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id);
425 int dissect_ber_choice(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_choice *ch, gint hf_id, gint ett_id);
426 int dissect_ber_generalized_time(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id);
427 int dissect_ber_sequence(gboolean implicit_tag, packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, ber_sequence *seq, gint hf_id, gint ett_id);
428 int dissect_ber_sequence_of(gboolean implicit_tag, packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, ber_sequence *seq, gint hf_id, gint ett_id);
429 int dissect_ber_set_of(gboolean implicit_tag, packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, ber_sequence *seq, gint hf_id, gint ett_id);
430 int dissect_ber_octet_string(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **tvb_out);
431 int dissect_ber_bitstring(gboolean implicit_tag, packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, asn_namedbit *named_bits, gint hf_id, gint ett_id, tvbuff_t **tvb_out);
432 int dissect_ber_restricted_string(gboolean implicit_tag, guint32 type, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **tvb_out);
433 int dissect_ber_object_identifier(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, char *value_string);
434 int get_ber_identifier(tvbuff_t *tvb, int offset, guint8 *class, gboolean *pc, guint32 *tag);
435 int get_ber_length(tvbuff_t *tvb, int offset, guint32 *length, gboolean *ind);
436 proto_tree* proto_item_get_subtree(proto_item *ti);
437 proto_item* proto_tree_get_parent(proto_tree *tree);
438 proto_item* proto_item_get_parent(proto_item *ti);
439 proto_item* proto_item_get_parent_nth(proto_item *ti, int gen);
440 proto_item *get_ber_last_created_item(void);
441
442 void report_failure(const char *msg_format, ...);
443
444 void rpc_init_proc_table(guint prog, guint vers, const vsff *proc_table,
445     int procedure_hf);
446 void rpc_init_prog(int proto, guint32 prog, int ett);
447 char *rpc_prog_name(guint32 prog);
448 char *rpc_proc_name(guint32 prog, guint32 vers, guint32 proc);
449 int rpc_prog_hf(guint32 prog, guint32 vers);
450
451 unsigned int rpc_roundup(unsigned int a);
452 int dissect_rpc_bool(tvbuff_t *tvb,
453  proto_tree *tree, int hfindex, int offset);
454 int dissect_rpc_string(tvbuff_t *tvb,
455  proto_tree *tree, int hfindex, int offset, char **string_buffer_ret);
456 int dissect_rpc_opaque_data(tvbuff_t *tvb, int offset,
457     proto_tree *tree,
458     packet_info *pinfo,
459     int hfindex,
460     gboolean fixed_length, guint32 length,
461     gboolean string_data, char **string_buffer_ret,
462     dissect_function_t *dissect_it);
463 int dissect_rpc_data(tvbuff_t *tvb,
464  proto_tree *tree, int hfindex, int offset);
465 int dissect_rpc_bytes(tvbuff_t *tvb,
466  proto_tree *tree, int hfindex, int offset, guint32 length,
467  gboolean string_data, char **string_buffer_ret);
468 int dissect_rpc_list(tvbuff_t *tvb, packet_info *pinfo,
469  proto_tree *tree, int offset, dissect_function_t *rpc_list_dissector);
470 int dissect_rpc_array(tvbuff_t *tvb, packet_info *pinfo,
471  proto_tree *tree, int offset, dissect_function_t *rpc_array_dissector,
472  int hfindex);
473 int dissect_rpc_uint32(tvbuff_t *tvb,
474  proto_tree *tree, int hfindex, int offset);
475 int dissect_rpc_uint64(tvbuff_t *tvb,
476  proto_tree *tree, int hfindex, int offset);
477
478 int dissect_rpc_indir_call(tvbuff_t *tvb, packet_info *pinfo,
479  proto_tree *tree, int offset, int args_id, guint32 prog, guint32 vers,
480  guint32 proc);
481 int dissect_rpc_indir_reply(tvbuff_t *tvb, packet_info *pinfo,
482  proto_tree *tree, int offset, int result_id, int prog_id, int vers_id,
483  int proc_id);
484 guint16 crc16_ccitt_tvb(tvbuff_t *tvb, unsigned int len);
485
486 guint64 tvb_get_letoh64(tvbuff_t *tvb, gint offset);
487 guint64 tvb_get_ntoh64(tvbuff_t *tvb, gint offset);
488
489 proto_item* proto_tree_add_float(proto_tree*, int, tvbuff_t*, gint, gint, float);
490 proto_item* proto_tree_add_float_hidden(proto_tree*, int, tvbuff_t*, gint, gint, float);
491 proto_item* proto_tree_add_float_format(proto_tree*, int, tvbuff_t*, gint, gint, float, const char*, ...);
492
493 gfloat tvb_get_ntohieee_float(tvbuff_t*, gint offset);
494 gdouble tvb_get_ntohieee_double(tvbuff_t*, gint offset);
495 gfloat tvb_get_letohieee_float(tvbuff_t*, gint offset);
496 gdouble tvb_get_letohieee_double(tvbuff_t*, gint offset);
497
498 proto_item *proto_tree_add_debug_text(proto_tree *tree, const char *format, ...);
499
500 void rtp_add_address(packet_info *pinfo, address *addr, int port, int other_port, gchar *setup_method, guint32 setup_frame_number);
501 void rtcp_add_address(packet_info *pinfo, address *addr, int port, int other_port, gchar *setup_method, guint32 setup_frame_number);