2 * Used to generate various included files for plugin API
4 * $Id: plugin_api_list.c,v 1.27 2004/02/16 18:31:40 sahlberg Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@ethereal.com>
8 * Copyright 1998 Gerald Combs
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.
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.
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.
29 #include <epan/packet.h>
30 #include <epan/conversation.h>
31 #include <epan/filesystem.h>
33 #include "reassemble.h"
34 #include "packet-giop.h"
35 #include "packet-per.h"
36 #include "packet-tpkt.h"
37 #include "packet-tcp.h"
41 #include "epan/except.h"
43 gint check_col(column_info*, gint);
44 void col_clear(column_info*, gint);
45 void col_add_fstr(column_info*, gint, const gchar*, ...);
46 void col_append_fstr(column_info*, gint, const gchar*, ...);
47 void col_prepend_fstr(column_info*, gint, const gchar*, ...);
48 void col_add_str(column_info*, gint, const gchar*);
49 void col_append_str(column_info*, gint, const gchar*);
50 void col_set_str(column_info*, gint, gchar*);
52 void register_init_routine(void (*func)(void));
53 void register_postseq_cleanup_routine(void (*func)(void));
55 gchar* match_strval(guint32, const value_string*);
56 gchar* val_to_str(guint32, const value_string *, const char *);
58 conversation_t *conversation_new(address *, address *,
59 port_type, guint32, guint32, guint);
60 conversation_t *find_conversation(address *, address *,
61 port_type, guint32, guint32, guint);
62 void conversation_set_dissector(conversation_t *,
65 int proto_register_protocol(char*, char*, char*);
66 void proto_register_field_array(int, hf_register_info*, int);
67 void proto_register_subtree_array(int**, int);
69 void dissector_add(const char *, guint32, dissector_handle_t);
70 void dissector_delete(const char *, guint32,
72 void dissector_add_handle(const char *,
75 void heur_dissector_add(const char *, heur_dissector_t, int);
77 void register_dissector(const char *, dissector_t, int);
78 dissector_handle_t find_dissector(const char *);
79 dissector_handle_t create_dissector_handle(dissector_t dissector,
81 int call_dissector(dissector_handle_t, tvbuff_t *,
82 packet_info *, proto_tree *);
84 void tcp_dissect_pdus(tvbuff_t *, packet_info *, proto_tree *,
85 gboolean, guint, guint (*)(tvbuff_t *, int),
86 void (*)(tvbuff_t *, packet_info *, proto_tree *));
88 gboolean proto_is_protocol_enabled(protocol_t *);
90 int proto_item_get_len(proto_item*);
91 void proto_item_set_len(proto_item*, gint);
92 void proto_item_set_text(proto_item*, const char*, ...);
93 void proto_item_append_text(proto_item*, const char*, ...);
94 proto_tree* proto_item_add_subtree(proto_item*, gint);
95 proto_item* proto_tree_add_item(proto_tree*, int, tvbuff_t*, gint, gint, gboolean);
96 proto_item* proto_tree_add_item_hidden(proto_tree*, int, tvbuff_t*, gint, gint, gboolean);
97 proto_item* proto_tree_add_protocol_format(proto_tree*, int, tvbuff_t*, gint, gint, const char*, ...);
99 proto_item* proto_tree_add_bytes(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*);
100 proto_item* proto_tree_add_bytes_hidden(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*);
101 proto_item* proto_tree_add_bytes_format(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*, const char*, ...);
103 proto_item* proto_tree_add_time(proto_tree*, int, tvbuff_t*, gint, gint, nstime_t*);
104 proto_item* proto_tree_add_time_hidden(proto_tree*, int, tvbuff_t*, gint, gint, nstime_t*);
105 proto_item* proto_tree_add_time_format(proto_tree*, int, tvbuff_t*, gint, gint, nstime_t*, const char*, ...);
107 proto_item* proto_tree_add_ipxnet(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
108 proto_item* proto_tree_add_ipxnet_hidden(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
109 proto_item* proto_tree_add_ipxnet_format(proto_tree*, int, tvbuff_t*, gint, gint, guint32, const char*, ...);
111 proto_item* proto_tree_add_ipv4(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
112 proto_item* proto_tree_add_ipv4_hidden(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
113 proto_item* proto_tree_add_ipv4_format(proto_tree*, int, tvbuff_t*, gint, gint, guint32, const char*, ...);
115 proto_item* proto_tree_add_ipv6(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*);
116 proto_item* proto_tree_add_ipv6_hidden(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*);
117 proto_item* proto_tree_add_ipv6_format(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*, const char*, ...);
119 proto_item* proto_tree_add_ether(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*);
120 proto_item* proto_tree_add_ether_hidden(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*);
121 proto_item* proto_tree_add_ether_format(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*, const char*, ...);
123 proto_item* proto_tree_add_string(proto_tree*, int, tvbuff_t*, gint, gint, const char*);
124 proto_item* proto_tree_add_string_hidden(proto_tree*, int, tvbuff_t*, gint, gint, const char*);
125 proto_item* proto_tree_add_string_format(proto_tree*, int, tvbuff_t*, gint, gint, const char*, const char*, ...);
127 proto_item* proto_tree_add_boolean(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
128 proto_item* proto_tree_add_boolean_hidden(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
129 proto_item* proto_tree_add_boolean_format(proto_tree*, int, tvbuff_t*, gint, gint, guint32, const char*, ...);
131 proto_item* proto_tree_add_double(proto_tree*, int, tvbuff_t*, gint, gint, double);
132 proto_item* proto_tree_add_double_hidden(proto_tree*, int, tvbuff_t*, gint, gint, double);
133 proto_item* proto_tree_add_double_format(proto_tree*, int, tvbuff_t*, gint, gint, double, const char*, ...);
135 proto_item* proto_tree_add_uint(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
136 proto_item* proto_tree_add_uint_hidden(proto_tree*, int, tvbuff_t*, gint, gint, guint32);
137 proto_item* proto_tree_add_uint_format(proto_tree*, int, tvbuff_t*, gint, gint, guint32, const char*, ...);
139 proto_item* proto_tree_add_int(proto_tree*, int, tvbuff_t*, gint, gint, gint32);
140 proto_item* proto_tree_add_int_hidden(proto_tree*, int, tvbuff_t*, gint, gint, gint32);
141 proto_item* proto_tree_add_int_format(proto_tree*, int, tvbuff_t*, gint, gint, gint32, const char*, ...);
143 proto_item* proto_tree_add_text(proto_tree*, tvbuff_t*, gint, gint, const char*, ...);
145 tvbuff_t* tvb_new_subset(tvbuff_t*, gint, gint, gint);
147 void tvb_set_free_cb(tvbuff_t*, tvbuff_free_cb_t);
148 void tvb_set_child_real_data_tvbuff(tvbuff_t*, tvbuff_t*);
149 tvbuff_t* tvb_new_real_data(const guint8*, guint, gint);
151 guint tvb_length(tvbuff_t*);
152 gint tvb_length_remaining(tvbuff_t*, gint);
153 gboolean tvb_bytes_exist(tvbuff_t*, gint, gint);
154 gboolean tvb_offset_exists(tvbuff_t*, gint);
155 guint tvb_reported_length(tvbuff_t*);
156 gint tvb_reported_length_remaining(tvbuff_t*, gint);
158 guint8 tvb_get_guint8(tvbuff_t*, gint);
160 guint16 tvb_get_ntohs(tvbuff_t*, gint);
161 guint32 tvb_get_ntoh24(tvbuff_t*, gint);
162 guint32 tvb_get_ntohl(tvbuff_t*, gint);
164 guint16 tvb_get_letohs(tvbuff_t*, gint);
165 guint32 tvb_get_letoh24(tvbuff_t*, gint);
166 guint32 tvb_get_letohl(tvbuff_t*, gint);
168 guint8* tvb_memcpy(tvbuff_t*, guint8* target, gint, gint);
169 guint8* tvb_memdup(tvbuff_t*, gint, gint);
171 const guint8* tvb_get_ptr(tvbuff_t*, gint, gint);
173 gint tvb_find_guint8(tvbuff_t*, gint, gint, guint8);
174 gint tvb_pbrk_guint8(tvbuff_t *, gint, gint, guint8 *);
176 gint tvb_strnlen(tvbuff_t*, gint, guint);
178 gchar * tvb_format_text(tvbuff_t*, gint, gint);
180 gint tvb_get_nstringz(tvbuff_t*, gint, guint, guint8*);
181 gint tvb_get_nstringz0(tvbuff_t*, gint, guint, guint8*);
183 gint tvb_find_line_end(tvbuff_t*, gint, int, gint *, gboolean);
184 gint tvb_find_line_end_unquoted(tvbuff_t*, gint, int, gint *);
186 gint tvb_strneql(tvbuff_t*, gint, const gchar *, gint);
187 gint tvb_strncaseeql(tvbuff_t*, gint, const gchar *, gint);
189 gchar *tvb_bytes_to_str(tvbuff_t*, gint, gint len);
191 struct pref_module *prefs_register_protocol(int,
193 void prefs_register_uint_preference(struct pref_module *,
194 const char *, const char *, const char *, guint, guint *);
195 void prefs_register_bool_preference(struct pref_module *,
196 const char *, const char *, const char *, gboolean *);
197 void prefs_register_enum_preference(struct pref_module *,
198 const char *, const char *, const char *, gint *, const enum_val_t *,
200 void prefs_register_string_preference(struct pref_module *,
201 const char *, const char *, const char *, char**);
203 void register_giop_user(giop_sub_dissector_t *, gchar *, int);
204 gboolean is_big_endian(MessageHeader *);
205 guint32 get_CDR_encap_info(tvbuff_t *, proto_tree *, gint *,
206 gboolean, guint32, gboolean *, guint32 *);
207 void get_CDR_any(tvbuff_t *, proto_tree *, gint *,
208 gboolean, int, MessageHeader *);
209 gboolean get_CDR_boolean(tvbuff_t *, int *);
210 guint8 get_CDR_char(tvbuff_t *, int *);
211 gdouble get_CDR_double(tvbuff_t *, int *, gboolean, int);
212 guint32 get_CDR_enum(tvbuff_t *, int *, gboolean, int);
213 void get_CDR_fixed(tvbuff_t *, gchar **, gint *, guint32,
215 gfloat get_CDR_float(tvbuff_t *, int *, gboolean, int);
216 void get_CDR_interface(tvbuff_t *, packet_info *, proto_tree *,
217 int *, gboolean, int);
218 gint32 get_CDR_long(tvbuff_t *, int *, gboolean, int);
219 void get_CDR_object(tvbuff_t *, packet_info *, proto_tree *,
220 int *, gboolean, int);
221 guint8 get_CDR_octet(tvbuff_t *, int *);
222 void get_CDR_octet_seq(tvbuff_t *, gchar **, int *, guint32);
223 gint16 get_CDR_short(tvbuff_t *, int *, gboolean, int);
224 guint32 get_CDR_string(tvbuff_t *, gchar **, int *, gboolean,
226 guint32 get_CDR_typeCode(tvbuff_t *, proto_tree *, gint *,
227 gboolean, int, MessageHeader *);
228 guint32 get_CDR_ulong(tvbuff_t *, int *, gboolean, int);
229 guint16 get_CDR_ushort(tvbuff_t *, int *, gboolean, int);
230 gint get_CDR_wchar(tvbuff_t *, gchar **, int *,
232 guint32 get_CDR_wstring(tvbuff_t *, gchar **, int *, gboolean,
233 int, MessageHeader *);
235 int is_tpkt(tvbuff_t *, int);
236 void dissect_tpkt_encap(tvbuff_t *, packet_info *,
237 proto_tree *, gboolean, dissector_handle_t);
239 void set_actual_length(tvbuff_t *, guint);
241 const char *decode_boolean_bitfield(guint32, guint32, int,
242 const char *, const char *);
243 const char *decode_numeric_bitfield(guint32, guint32, int,
245 const char *decode_enumerated_bitfield(guint32, guint32, int,
246 const value_string *, const char *);
248 dissector_table_t register_dissector_table(const char *, char *, ftenum_t ,int );
249 void except_throw(long, long, const char *);
250 gboolean dissector_try_port(dissector_table_t, guint32, tvbuff_t *, packet_info *, proto_tree *);
252 void conversation_add_proto_data(conversation_t *, int, void *);
253 void *conversation_get_proto_data(conversation_t *, int);
254 void conversation_delete_proto_data(conversation_t *, int);
255 void p_add_proto_data(frame_data *, int, void *);
256 void *p_get_proto_data(frame_data *, int);
258 gchar* ip_to_str(const guint8 *);
259 char* ip6_to_str(const struct e_in6_addr *);
260 gchar* time_secs_to_str(guint32);
261 gchar* time_msecs_to_str(guint32);
262 gchar* abs_time_to_str(nstime_t*);
264 int proto_get_id_by_filter_name(gchar* filter_name);
265 char *proto_get_protocol_name(int n);
266 char *proto_get_protocol_short_name(protocol_t *);
267 char *proto_get_protocol_filter_name(int proto_id);
269 void prefs_register_obsolete_preference(module_t *, const char *);
271 void add_new_data_source(packet_info *, tvbuff_t *, char *);
273 void fragment_table_init(GHashTable **);
274 void reassembled_table_init(GHashTable **);
275 fragment_data *fragment_add(tvbuff_t *, int, packet_info *, guint32,
276 GHashTable *, guint32, guint32, gboolean);
277 fragment_data *fragment_add_seq(tvbuff_t *, int, packet_info *, guint32,
278 GHashTable *, guint32, guint32, gboolean);
279 fragment_data *fragment_add_seq_check(tvbuff_t *, int, packet_info *, guint32 id,
280 GHashTable *, GHashTable *, guint32, guint32, gboolean);
281 fragment_data *fragment_add_seq_next(tvbuff_t *, int, packet_info *, guint32,
282 GHashTable *, GHashTable *, guint32, gboolean);
283 fragment_data *fragment_get(packet_info *, guint32, GHashTable *);
284 void fragment_set_tot_len(packet_info *, guint32, GHashTable *, guint32);
285 guint32 fragment_get_tot_len(packet_info *, guint32, GHashTable *);
286 void fragment_set_partial_reassembly(packet_info *, guint32, GHashTable *);
287 unsigned char *fragment_delete(packet_info *, guint32, GHashTable *);
288 gboolean show_fragment_tree(fragment_data *, const fragment_items *, proto_tree *, packet_info *, tvbuff_t *);
289 gboolean show_fragment_seq_tree(fragment_data *, const fragment_items *, proto_tree *, packet_info *, tvbuff_t *);
291 int register_tap(char *);
292 void tap_queue_packet(int, packet_info *, void *);
294 void asn1_open(ASN1_SCK *, tvbuff_t *, int );
295 void asn1_close(ASN1_SCK *, int *);
296 int asn1_octet_decode(ASN1_SCK *, guchar *);
297 int asn1_tag_decode(ASN1_SCK *, guint *);
298 int asn1_id_decode(ASN1_SCK *, guint *, guint *, guint *);
299 int asn1_length_decode(ASN1_SCK *, gboolean *, guint *);
300 int asn1_header_decode(ASN1_SCK *, guint *, guint *, guint *,
301 gboolean *, guint *);
302 int asn1_eoc(ASN1_SCK *, int );
303 int asn1_eoc_decode(ASN1_SCK *, int );
304 int asn1_null_decode(ASN1_SCK *, int );
305 int asn1_bool_decode(ASN1_SCK *, int , gboolean *);
306 int asn1_int32_value_decode(ASN1_SCK *, int , gint32 *);
307 int asn1_int32_decode(ASN1_SCK *, gint32 *, guint *);
308 int asn1_uint32_value_decode(ASN1_SCK *, int , guint *);
309 int asn1_uint32_decode(ASN1_SCK *, guint32 *, guint *);
310 int asn1_bits_decode(ASN1_SCK *, int , guchar **,
312 int asn1_string_value_decode(ASN1_SCK *, int ,
314 int asn1_string_decode(ASN1_SCK *, guchar **, guint *,
316 int asn1_octet_string_decode(ASN1_SCK *, guchar **, guint *,
318 int asn1_subid_decode(ASN1_SCK *, subid_t *);
319 int asn1_oid_value_decode(ASN1_SCK *, int , subid_t **,
321 int asn1_oid_decode( ASN1_SCK *, subid_t **, guint *, guint *);
322 int asn1_sequence_decode( ASN1_SCK *, guint *, guint *);
324 char *asn1_err_to_str(int );
326 void proto_item_set_end(proto_item*, tvbuff_t *, gint);
328 proto_item* proto_tree_add_none_format(proto_tree*, int, tvbuff_t*, gint, gint, const char*, ...);
330 int except_init(void);
331 void except_deinit(void);
332 void except_rethrow(except_t *);
333 void except_throwd(long, long, const char *, void *);
334 void except_throwf(long, long, const char *, ...);
335 void (*except_unhandled_catcher(void (*)(except_t *)))(except_t *);
336 void *except_take_data(except_t *);
337 void except_set_allocator(void *(*)(size_t), void (*)(void *));
338 void *except_alloc(size_t);
339 void except_free(void *);
340 struct except_stacknode *except_pop(void);
341 void except_setup_try(struct except_stacknode *, struct except_catch *, const except_id_t [], size_t);
343 void col_set_fence(column_info*, gint);
345 guint8 *tvb_get_string(tvbuff_t *, gint, gint);
346 guint8 *tvb_get_stringz(tvbuff_t *, gint, gint *);
348 dissector_table_t find_dissector_table(const char *);
349 dissector_handle_t dissector_get_port_handle(dissector_table_t, guint32);
350 char *dissector_handle_get_short_name(dissector_handle_t);
351 int dissector_handle_get_protocol_index(dissector_handle_t);
352 void new_register_dissector(const char *, new_dissector_t, int);
353 dissector_handle_t new_create_dissector_handle(new_dissector_t, int);
355 void register_giop_user_module(giop_sub_dissector_t *sub, gchar *name, gchar *module, int sub_proto);
357 guint32 dissect_per_GeneralString(tvbuff_t*, guint32, packet_info*, proto_tree*, int);
358 guint32 dissect_per_sequence_of(tvbuff_t*, guint32, packet_info*, proto_tree*, int, gint, int (*)(tvbuff_t*, int, packet_info*, proto_tree*));
359 guint32 dissect_per_IA5String(tvbuff_t*, guint32, packet_info*, proto_tree*, int, int, int);
360 guint32 dissect_per_NumericString(tvbuff_t*, guint32, packet_info*, proto_tree*, int, int, int);
361 guint32 dissect_per_PrintableString(tvbuff_t*, guint32, packet_info*, proto_tree*, int, int, int);
362 guint32 dissect_per_BMPString(tvbuff_t*, guint32, packet_info*, proto_tree*, int, int, int);
363 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);
364 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);
365 guint32 dissect_per_set_of(tvbuff_t*, guint32, packet_info*, proto_tree *parent_tree, int, gint, int (*)(tvbuff_t*, int, packet_info*, proto_tree*));
366 guint32 dissect_per_object_identifier(tvbuff_t*, guint32, packet_info*, proto_tree*, int, char*);
367 guint32 dissect_per_boolean(tvbuff_t*, guint32, packet_info *pinfo, proto_tree*, int, gboolean*, proto_item**);
368 guint32 dissect_per_integer(tvbuff_t*, guint32, packet_info*, proto_tree*, int, gint32*, proto_item**);
369 guint32 dissect_per_constrained_integer(tvbuff_t*, guint32, packet_info*, proto_tree*, int, guint32, guint32, guint32*, proto_item**, gboolean);
370 guint32 dissect_per_choice(tvbuff_t*, guint32, packet_info*, proto_tree*, int, gint, per_choice_t*, char*, guint32*);
371 guint32 dissect_per_sequence(tvbuff_t*, guint32, packet_info*, proto_tree *parent_tree, int, gint, per_sequence_t*);
372 guint32 dissect_per_octet_string(tvbuff_t*, guint32, packet_info*, proto_tree*, int, int, int, guint32*, guint32*);
373 guint32 dissect_per_restricted_character_string(tvbuff_t*, guint32, packet_info*, proto_tree*, int, int, int, char*, int);
375 void dissector_add_string(const char*, gchar*, dissector_handle_t);
376 void dissector_delete_string(const char*, const gchar*, dissector_handle_t);
377 void dissector_change_string(const char*, gchar *, dissector_handle_t);
378 void dissector_reset_string(const char*, const gchar*);
379 gboolean dissector_try_string(dissector_table_t, const gchar*, tvbuff_t*, packet_info*, proto_tree*);
380 dissector_handle_t dissector_get_string_handle(dissector_table_t, const gchar*);
382 char *get_datafile_path(const char *filename);
383 char *get_tempfile_path(const char *filename);
385 void register_heur_dissector_list(const char *name,
386 heur_dissector_list_t *list);
387 gboolean dissector_try_heuristic(heur_dissector_list_t sub_dissectors,
388 tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
390 int asn1_id_decode1(ASN1_SCK *asn1, guint *tag);
392 gboolean col_get_writable(column_info *);
393 void col_set_writable(column_info *, gboolean);
395 const char *decode_enumerated_bitfield_shifted(guint32, guint32, int,
396 const value_string *, const char *);
398 guint32 dissect_per_bit_string(tvbuff_t*, guint32, packet_info*, proto_tree*, int, int, int);
400 int dissect_xdlc_control(tvbuff_t *tvb, int offset, packet_info *pinfo,
401 proto_tree *xdlc_tree, int hf_xdlc_control, gint ett_xdlc_control,
402 const xdlc_cf_items *cf_items_nonext, const xdlc_cf_items *cf_items_ext,
403 const value_string *u_modifier_short_vals_cmd,
404 const value_string *u_modifier_short_vals_resp, int is_response,
405 int is_extended, int append_info);
407 protocol_t *find_protocol_by_id(int n);
409 guint tvb_strsize(tvbuff_t *tvb, gint offset);