| 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
24extern bool
25 libpcap_write_file_header(ws_cwstream* pfile, int linktype, int snaplen,
26 bool ts_nsecs, uint64_t *bytes_written, int *err);
27
30extern 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 */
40extern 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
50extern 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
69extern bool
70pcapng_write_interface_description_block(ws_cwstream* pfile,
71 const char *comment, /* OPT_COMMENT 1 */
72 const char *name, /* IDB_NAME 2 */
73 const char *descr, /* IDB_DESCRIPTION 3 */
74 const char *filter, /* IDB_FILTER 11 */
75 const char *os, /* IDB_OS 12 */
76 const char *hardware, /* IDB_HARDWARE 15 */
77 int link_type,
78 int snap_len,
79 uint64_t *bytes_written,
80 uint64_t if_speed, /* IDB_IF_SPEED 8 */
81 uint8_t tsresol, /* IDB_TSRESOL 9 */
82 int *err);
83
84extern bool
85pcapng_write_interface_statistics_block(ws_cwstream* pfile,
86 uint32_t interface_id,
87 uint64_t *bytes_written,
88 const char *comment, /* OPT_COMMENT 1 */
89 uint64_t isb_starttime, /* ISB_STARTTIME 2 */
90 uint64_t isb_endtime, /* ISB_ENDTIME 3 */
91 uint64_t isb_ifrecv, /* ISB_IFRECV 4 */
92 uint64_t isb_ifdrop, /* ISB_IFDROP 5 */
93 int *err);
94
95extern bool
96pcapng_write_enhanced_packet_block(ws_cwstream* pfile,
97 const char *comment,
98 time_t sec, uint32_t usec,
99 uint32_t caplen, uint32_t len,
100 uint32_t interface_id,
101 unsigned ts_mul,
102 const uint8_t *pd,
103 uint32_t flags,
104 uint64_t *bytes_written,
105 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_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
ws_cwstream
Definition file_compressed.c:159