Witness: fix notify change
[metze/wireshark/wip.git] / ui / text_import.h
1 /**-*-C-*-**********************************************************************
2  * text_import.h
3  * State machine for text import
4  * November 2010, Jaap Keuter <jaap.keuter@xs4all.nl>
5  *
6  * $Id$
7  *
8  * Wireshark - Network traffic analyzer
9  * By Gerald Combs <gerald@wireshark.org>
10  * Copyright 1998 Gerald Combs
11  *
12  * Based on text2pcap.h by Ashok Narayanan <ashokn@cisco.com>
13  *
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version 2
17  * of the License, or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27  *
28  *******************************************************************************/
29
30
31 #ifndef __TEXT_IMPORT_H__
32 #define __TEXT_IMPORT_H__
33
34 #include <glib.h>
35 #include "wtap.h"
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40
41 #define IMPORT_MAX_PACKET 65535
42
43 /* The parameter interface */
44
45 enum offset_type
46 {
47     OFFSET_NONE = 0,
48     OFFSET_HEX,
49     OFFSET_OCT,
50     OFFSET_DEC
51 };
52
53 enum dummy_header_type
54 {
55     HEADER_NONE,
56     HEADER_ETH,
57     HEADER_IPV4,
58     HEADER_UDP,
59     HEADER_TCP,
60     HEADER_SCTP,
61     HEADER_SCTP_DATA
62 };
63
64 typedef struct
65 {
66     /* Input info */
67     char *import_text_filename;
68     FILE *import_text_file;
69     enum offset_type offset_type;
70     gboolean date_timestamp;
71     gboolean has_direction;
72     char *date_timestamp_format;
73
74     /* Import info */
75     guint encapsulation;
76     wtap_dumper* wdh;
77
78     /* Dummy header info (if encapsulation == 1) */
79     enum dummy_header_type dummy_header_type;
80     guint pid;
81     guint protocol;
82     guint src_port;
83     guint dst_port;
84     guint tag;
85     guint ppi;
86
87     guint max_frame_length;
88 } text_import_info_t;
89
90 void text_import_setup(text_import_info_t *info);
91 void text_import_cleanup(void);
92
93 #ifdef __cplusplus
94 }
95 #endif /* __cplusplus */
96
97 #endif /* __TEXT_IMPORT_H__ */
98
99 /*
100  * Editor modelines
101  *
102  * Local Variables:
103  * c-basic-offset: 4
104  * tab-width: 8
105  * indent-tabs-mode: nil
106  * End:
107  *
108  * ex: set shiftwidth=4 tabstop=8 expandtab:
109  * :indentSize=4:tabSize=8:noTabs=true:
110  */