2 * Routines for exporting PDUs to file
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef __TAP_EXPORT_PDU_H__
24 #define __TAP_EXPORT_PDU_H__
28 #endif /* __cplusplus */
30 typedef struct _exp_pdu_t {
36 * Registers the tap listener which will add matching packets to the exported
37 * file. Must be called before exp_pdu_open.
39 * @param tap_name One of the names registered with register_export_pdu_tap().
40 * @param filter An tap filter, may be NULL to disable filtering which
41 * improves performance if you do not need a filter.
42 * @return NULL on success or an error string on failure which must be freed
43 * with g_free(). Failure could occur when the filter or tap_name are invalid.
45 char *exp_pdu_pre_open(const char *tap_name, const char *filter,
46 exp_pdu_t *exp_pdu_tap_data);
49 * Use the given file descriptor for writing an output file. Can only be called
50 * once and exp_pdu_pre_open() must be called before.
52 * @return 0 on success or a wtap error code.
54 int exp_pdu_open(exp_pdu_t *data, int fd, char *comment);
56 /* Stops the PDUs export. */
57 int exp_pdu_close(exp_pdu_t *exp_pdu_tap_data);
61 #endif /* __cplusplus */
63 #endif /* __TAP_EXPORT_PDU_H__ */
71 * indent-tabs-mode: nil
74 * ex: set shiftwidth=4 tabstop=8 expandtab:
75 * :indentSize=4:tabSize=8:noTabs=true: