Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
pcapio.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <wsutil/file_compressed.h>
18
19/* Writing pcap files */
20
36extern bool
37libpcap_write_file_header(ws_cwstream* pfile, int linktype, int snaplen,
38 bool ts_nsecs, uint64_t *bytes_written, int *err);
39
56extern bool
58 time_t sec, uint32_t usec,
59 uint32_t caplen, uint32_t len,
60 const uint8_t *pd,
61 uint64_t *bytes_written, int *err);
62
63/* Writing pcapng files */
64
77extern bool
79 const uint8_t *data,
80 uint32_t block_total_length,
81 uint64_t *bytes_written,
82 int *err);
83
87extern bool
89 GPtrArray *comments,
92 const char *hw,
95 const char *os,
98 const char *appname,
101 uint64_t section_length,
102 uint64_t *bytes_written,
103 int *err
104 );
105
122extern bool
124 const char *comment, /* OPT_COMMENT 1 */
125 const char *name, /* IDB_NAME 2 */
126 const char *descr, /* IDB_DESCRIPTION 3 */
127 const char *filter, /* IDB_FILTER 11 */
128 const char *os, /* IDB_OS 12 */
129 const char *hardware, /* IDB_HARDWARE 15 */
130 int link_type,
131 int snap_len,
132 uint64_t *bytes_written,
133 uint64_t if_speed, /* IDB_IF_SPEED 8 */
134 uint8_t tsresol, /* IDB_TSRESOL 9 */
135 int *err);
136
151extern bool
153 uint32_t interface_id,
154 uint64_t *bytes_written,
155 const char *comment, /* OPT_COMMENT 1 */
156 uint64_t isb_starttime, /* ISB_STARTTIME 2 */
157 uint64_t isb_endtime, /* ISB_ENDTIME 3 */
158 uint64_t isb_ifrecv, /* ISB_IFRECV 4 */
159 uint64_t isb_ifdrop, /* ISB_IFDROP 5 */
160 int *err);
161
178extern bool
180 const char *comment,
181 time_t sec, uint32_t usec,
182 uint32_t caplen, uint32_t len,
183 uint32_t interface_id,
184 unsigned ts_mul,
185 const uint8_t *pd,
186 uint32_t flags,
187 uint64_t *bytes_written,
188 int *err);
bool libpcap_write_file_header(ws_cwstream *pfile, int linktype, int snaplen, bool ts_nsecs, uint64_t *bytes_written, int *err)
Writes a pcap file header to the specified output stream.
Definition pcapio.c:182
bool pcapng_write_block(ws_cwstream *pfile, const uint8_t *data, uint32_t block_total_length, uint64_t *bytes_written, int *err)
Write a pre-formatted pcapng block to the output stream.
Definition pcapio.c:267
bool pcapng_write_interface_description_block(ws_cwstream *pfile, const char *comment, const char *name, const char *descr, const char *filter, const char *os, const char *hardware, int link_type, int snap_len, uint64_t *bytes_written, uint64_t if_speed, uint8_t tsresol, int *err)
Writes an Interface Description Block (IDB) to a pcapng file.
Definition pcapio.c:368
bool pcapng_write_section_header_block(ws_cwstream *pfile, GPtrArray *comments, const char *hw, const char *os, const char *appname, uint64_t section_length, uint64_t *bytes_written, int *err)
Write a section header block (SHB)
Definition pcapio.c:296
bool libpcap_write_packet(ws_cwstream *pfile, time_t sec, uint32_t usec, uint32_t caplen, uint32_t len, const uint8_t *pd, uint64_t *bytes_written, int *err)
Writes a packet to a pcap file.
Definition pcapio.c:201
bool pcapng_write_enhanced_packet_block(ws_cwstream *pfile, const char *comment, time_t sec, uint32_t usec, uint32_t caplen, uint32_t len, uint32_t interface_id, unsigned ts_mul, const uint8_t *pd, uint32_t flags, uint64_t *bytes_written, int *err)
Writes an Enhanced Packet Block (EPB) to a pcapng file.
Definition pcapio.c:530
bool pcapng_write_interface_statistics_block(ws_cwstream *pfile, uint32_t interface_id, uint64_t *bytes_written, const char *comment, uint64_t isb_starttime, uint64_t isb_endtime, uint64_t isb_ifrecv, uint64_t isb_ifdrop, int *err)
Writes an Interface Statistics Block to a pcapng file.
Definition pcapio.c:620
Definition file_compressed.c:152