checkAPIs.pl: support for new-style dissectors in check_hf_entries
[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  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * Based on text2pcap.h by Ashok Narayanan <ashokn@cisco.com>
11  *
12  * SPDX-License-Identifier: GPL-2.0-or-later*
13  *******************************************************************************/
14
15
16 #ifndef __TEXT_IMPORT_H__
17 #define __TEXT_IMPORT_H__
18
19 #include <glib.h>
20
21 #include <wiretap/wtap.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif /* __cplusplus */
26
27 #define IMPORT_MAX_PACKET WTAP_MAX_PACKET_SIZE_STANDARD
28
29 /* The parameter interface */
30
31 enum offset_type
32 {
33     OFFSET_NONE = 0,
34     OFFSET_HEX,
35     OFFSET_OCT,
36     OFFSET_DEC
37 };
38
39 enum dummy_header_type
40 {
41     HEADER_NONE,
42     HEADER_ETH,
43     HEADER_IPV4,
44     HEADER_UDP,
45     HEADER_TCP,
46     HEADER_SCTP,
47     HEADER_SCTP_DATA
48 };
49
50 typedef struct
51 {
52     /* Input info */
53     char *import_text_filename;
54     FILE *import_text_file;
55     enum offset_type offset_type;
56     gboolean date_timestamp;
57     gboolean has_direction;
58     char *date_timestamp_format;
59
60     /* Import info */
61     guint encapsulation;
62     wtap_dumper* wdh;
63
64     /* Dummy header info (if encapsulation == 1) */
65     enum dummy_header_type dummy_header_type;
66     guint pid;
67     guint protocol;
68     guint src_port;
69     guint dst_port;
70     guint tag;
71     guint ppi;
72
73     guint max_frame_length;
74 } text_import_info_t;
75
76 int text_import(text_import_info_t *info);
77
78 #ifdef __cplusplus
79 }
80 #endif /* __cplusplus */
81
82 #endif /* __TEXT_IMPORT_H__ */
83
84 /*
85  * Editor modelines
86  *
87  * Local Variables:
88  * c-basic-offset: 4
89  * tab-width: 8
90  * indent-tabs-mode: nil
91  * End:
92  *
93  * ex: set shiftwidth=4 tabstop=8 expandtab:
94  * :indentSize=4:tabSize=8:noTabs=true:
95  */