| 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
24 extern bool
25 libpcap_write_file_header(ws_cwstream* pfile, int linktype, int snaplen,
26 bool ts_nsecs, uint64_t *bytes_written, int *err);
27
30 extern bool
31 libpcap_write_packet(ws_cwstream* pfile,
32 time_t sec, uint32_t usec,
33 uint32_t caplen, uint32_t len,
34 const uint8_t *pd,
35 uint64_t *bytes_written, int *err);
36
37/* Writing pcapng files */
38
39/* Write a pre-formatted pcapng block */
40 extern bool
41pcapng_write_block(ws_cwstream* pfile,
42 const uint8_t *data,
43 uint32_t block_total_length,
44 uint64_t *bytes_written,
45 int *err);
46
50 extern bool
51 pcapng_write_section_header_block(ws_cwstream* pfile,
52 GPtrArray *comments,
55 const char *hw,
58 const char *os,
61 const char *appname,
64 uint64_t section_length,
65 uint64_t *bytes_written,
66 int *err
67 );
68
85 extern bool
86 pcapng_write_interface_description_block(ws_cwstream* pfile,
87 const char *comment, /* OPT_COMMENT 1 */
88 const char *name, /* IDB_NAME 2 */
89 const char *descr, /* IDB_DESCRIPTION 3 */
90 const char *filter, /* IDB_FILTER 11 */
91 const char *os, /* IDB_OS 12 */
92 const char *hardware, /* IDB_HARDWARE 15 */
93 int link_type,
94 int snap_len,
95 uint64_t *bytes_written,
96 uint64_t if_speed, /* IDB_IF_SPEED 8 */
97 uint8_t tsresol, /* IDB_TSRESOL 9 */
98 int *err);
99
114 extern bool
115 pcapng_write_interface_statistics_block(ws_cwstream* pfile,
116 uint32_t interface_id,
117 uint64_t *bytes_written,
118 const char *comment, /* OPT_COMMENT 1 */
119 uint64_t isb_starttime, /* ISB_STARTTIME 2 */
120 uint64_t isb_endtime, /* ISB_ENDTIME 3 */
121 uint64_t isb_ifrecv, /* ISB_IFRECV 4 */
122 uint64_t isb_ifdrop, /* ISB_IFDROP 5 */
123 int *err);
124
141 extern bool
142 pcapng_write_enhanced_packet_block(ws_cwstream* pfile,
143 const char *comment,
144 time_t sec, uint32_t usec,
145 uint32_t caplen, uint32_t len,
146 uint32_t interface_id,
147 unsigned ts_mul,
148 const uint8_t *pd,
149 uint32_t flags,
150 uint64_t *bytes_written,
151 int *err);
libpcap_write_file_header
bool libpcap_write_file_header(ws_cwstream *pfile, int linktype, int snaplen, bool ts_nsecs, uint64_t *bytes_written, int *err)
Definition pcapio.c:182
pcapng_write_interface_description_block
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
pcapng_write_section_header_block
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)
Definition pcapio.c:296
libpcap_write_packet
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)
Definition pcapio.c:201
pcapng_write_enhanced_packet_block
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
pcapng_write_interface_statistics_block
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
ws_cwstream
Definition file_compressed.c:152