Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / ui / tap_export_pdu.h
blob19f31e0da6674f5c2b0ce085916ca7a5b3a3b0df
1 /** @file
3 * Routines for exporting PDUs to file
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef __TAP_EXPORT_PDU_H__
13 #define __TAP_EXPORT_PDU_H__
15 #ifdef __cplusplus
16 extern "C" {
17 #endif /* __cplusplus */
19 typedef struct _exp_pdu_t {
20 char* pathname;
21 int pkt_encap;
22 wtap_dumper* wdh;
23 GArray* shb_hdrs;
24 wtapng_iface_descriptions_t* idb_inf;
25 uint32_t framenum;
26 } exp_pdu_t;
28 /**
29 * Registers the tap listener which will add matching packets to the exported
30 * file. Must be called before exp_pdu_open.
32 * @param tap_name One of the names registered with register_export_pdu_tap().
33 * @param filter An tap filter, may be NULL to disable filtering which
34 * improves performance if you do not need a filter.
35 * @return NULL on success or an error string on failure which must be freed
36 * with g_free(). Failure could occur when the filter or tap_name are invalid.
38 char *exp_pdu_pre_open(const char *tap_name, const char *filter,
39 exp_pdu_t *exp_pdu_tap_data);
41 /**
42 * Use the given file descriptor for writing an output file. Can only be called
43 * once and exp_pdu_pre_open() must be called before.
45 * @param[out] err Will be set to an error code on failure.
46 * @param[out] err_info for some errors, a string giving more details of
47 * the error
48 * @return true on success or false on failure.
50 bool exp_pdu_open(exp_pdu_t *data, char *pathname, int file_type_subtype,
51 int fd, const char *comment, int *err, char **err_info);
53 /* Stops the PDUs export. */
54 bool exp_pdu_close(exp_pdu_t *exp_pdu_tap_data, int *err, char **err_info);
56 #ifdef __cplusplus
58 #endif /* __cplusplus */
60 #endif /* __TAP_EXPORT_PDU_H__ */