nexmon – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | /* tap_export_pdu.h |
2 | * Routines for exporting PDUs to file |
||
3 | * |
||
4 | * Wireshark - Network traffic analyzer |
||
5 | * By Gerald Combs <gerald@wireshark.org> |
||
6 | * Copyright 1998 Gerald Combs |
||
7 | * |
||
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. |
||
12 | * |
||
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. |
||
17 | * |
||
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. |
||
21 | */ |
||
22 | |||
23 | #ifndef __TAP_EXPORT_PDU_H__ |
||
24 | #define __TAP_EXPORT_PDU_H__ |
||
25 | |||
26 | #ifdef __cplusplus |
||
27 | extern "C" { |
||
28 | #endif /* __cplusplus */ |
||
29 | |||
30 | typedef struct _exp_pdu_t { |
||
31 | int pkt_encap; |
||
32 | wtap_dumper* wdh; |
||
33 | } exp_pdu_t; |
||
34 | |||
35 | /** |
||
36 | * Registers the tap listener which will add matching packets to the exported |
||
37 | * file. Must be called before exp_pdu_open. |
||
38 | * |
||
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. |
||
44 | */ |
||
45 | char *exp_pdu_pre_open(const char *tap_name, const char *filter, |
||
46 | exp_pdu_t *exp_pdu_tap_data); |
||
47 | |||
48 | /** |
||
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. |
||
51 | * |
||
52 | * @return 0 on success or a wtap error code. |
||
53 | */ |
||
54 | int exp_pdu_open(exp_pdu_t *data, int fd, char *comment); |
||
55 | |||
56 | /* Stops the PDUs export. */ |
||
57 | int exp_pdu_close(exp_pdu_t *exp_pdu_tap_data); |
||
58 | |||
59 | #ifdef __cplusplus |
||
60 | } |
||
61 | #endif /* __cplusplus */ |
||
62 | |||
63 | #endif /* __TAP_EXPORT_PDU_H__ */ |
||
64 | |||
65 | /* |
||
66 | * Editor modelines |
||
67 | * |
||
68 | * Local Variables: |
||
69 | * c-basic-offset: 4 |
||
70 | * tab-width: 8 |
||
71 | * indent-tabs-mode: nil |
||
72 | * End: |
||
73 | * |
||
74 | * ex: set shiftwidth=4 tabstop=8 expandtab: |
||
75 | * :indentSize=4:tabSize=8:noTabs=true: |
||
76 | */ |