Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
text_import.h
Go to the documentation of this file.
1
18#ifndef __TEXT_IMPORT_H__
19#define __TEXT_IMPORT_H__
20
21#include <stdio.h>
22#include <wireshark.h>
23
24#include <wiretap/wtap.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif /* __cplusplus */
29
30/* The parameter interface */
31
42
43
53
54
69
70
78
79
83typedef struct
84{
85 /* --- Input / output paths --- */
91 struct {
97 } hexdump;
98
100 struct {
102 GRegex *format;
106 } regex;
107
108 const char *timestamp_format;
110 /* --- Wiretap output --- */
111 unsigned encapsulation;
114 /* --- Dummy header configuration (used when encapsulation == 1) --- */
116 unsigned pid;
117 bool ipv6;
120 union {
123 } ip_src_addr;
124
126 union {
127 ws_in4_addr ipv4;
128 ws_in6_addr ipv6;
129 } ip_dest_addr;
130
131 unsigned protocol;
132 unsigned src_port;
133 unsigned dst_port;
134 unsigned tag;
135 unsigned ppi;
136 char *payload;
140 /* --- Operation results --- */
144
155
173int
174text_import_pre_open(wtap_dump_params * const params, int file_type_subtype, const char* const input_filename, const char* const interface_name);
175
176#ifdef __cplusplus
177}
178#endif /* __cplusplus */
179
180#endif /* __TEXT_IMPORT_H__ */
uint32_t ws_in4_addr
Represents a 32-bit IPv4 address in network byte order.
Definition inet_addr.h:22
Represents a 128-bit IPv6 address.
Definition inet_addr.h:27
Definition file-pcapng.h:57
Complete configuration and runtime state for a text-to-pcap import operation.
Definition text_import.h:84
unsigned protocol
Definition text_import.h:131
unsigned num_packets_written
Definition text_import.h:142
FILE * import_text_FILE
Definition text_import.h:92
unsigned num_packets_read
Definition text_import.h:141
char * out_indication
Definition text_import.h:105
wtap_dumper * wdh
Definition text_import.h:112
unsigned ppi
Definition text_import.h:135
enum data_encoding encoding
Definition text_import.h:103
ws_in4_addr ipv4
Definition text_import.h:121
char * in_indication
Definition text_import.h:104
bool identify_ascii
Definition text_import.h:95
bool ipv6
Definition text_import.h:117
unsigned tag
Definition text_import.h:134
bool has_direction
Definition text_import.h:94
unsigned pid
Definition text_import.h:116
ws_in6_addr ipv6
Definition text_import.h:122
enum text_import_mode mode
Definition text_import.h:88
unsigned dst_port
Definition text_import.h:133
unsigned src_port
Definition text_import.h:132
GRegex * format
Definition text_import.h:102
GMappedFile * import_text_GMappedFile
Definition text_import.h:101
bool little_endian
Definition text_import.h:96
unsigned max_frame_length
Definition text_import.h:138
char * payload
Definition text_import.h:136
enum offset_type offset_type
Definition text_import.h:93
char * output_filename
Definition text_import.h:87
enum dummy_header_type dummy_header_type
Definition text_import.h:115
const char * timestamp_format
Definition text_import.h:108
unsigned encapsulation
Definition text_import.h:111
char * import_text_filename
Definition text_import.h:86
Definition wtap.h:1658
Wiretap dumper handle and associated state.
Definition wtap_module.h:163
dummy_header_type
Selects the synthetic protocol header prepended to each imported frame.
Definition text_import.h:59
@ HEADER_TCP
Definition text_import.h:64
@ HEADER_NONE
Definition text_import.h:60
@ HEADER_ETH
Definition text_import.h:61
@ HEADER_EXPORT_PDU
Definition text_import.h:67
@ HEADER_SCTP_DATA
Definition text_import.h:66
@ HEADER_IPV4
Definition text_import.h:62
@ HEADER_UDP
Definition text_import.h:63
@ HEADER_SCTP
Definition text_import.h:65
text_import_mode
Selects the parsing mode used to extract packet data from the input text file.
Definition text_import.h:74
@ TEXT_IMPORT_HEXDUMP
Definition text_import.h:75
@ TEXT_IMPORT_REGEX
Definition text_import.h:76
offset_type
Numeric base used to render byte offsets in a hex dump import.
Definition text_import.h:36
@ OFFSET_DEC
Definition text_import.h:40
@ OFFSET_HEX
Definition text_import.h:38
@ OFFSET_OCT
Definition text_import.h:39
@ OFFSET_NONE
Definition text_import.h:37
data_encoding
Encoding used to represent raw byte data in a regex-mode text import.
Definition text_import.h:47
@ ENCODING_PLAIN_BIN
Definition text_import.h:50
@ ENCODING_PLAIN_HEX
Definition text_import.h:48
@ ENCODING_BASE64
Definition text_import.h:51
@ ENCODING_PLAIN_OCT
Definition text_import.h:49
int text_import_pre_open(wtap_dump_params *const params, int file_type_subtype, const char *const input_filename, const char *const interface_name)
Prepares the wtap_dump_params with necessary headers before opening the wtap dump file.
Definition text_import.c:1962
int text_import(text_import_info_t *const info)
Import a text file.
Definition text_import.c:1741