Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
pcapio.h
Go to the documentation of this file.
1
15/* Writing pcap files */
16
20extern bool
21libpcap_write_file_header(FILE* pfile, int linktype, int snaplen,
22 bool ts_nsecs, uint64_t *bytes_written, int *err);
23
26extern bool
27libpcap_write_packet(FILE* pfile,
28 time_t sec, uint32_t usec,
29 uint32_t caplen, uint32_t len,
30 const uint8_t *pd,
31 uint64_t *bytes_written, int *err);
32
33/* Writing pcapng files */
34
35/* Write a pre-formatted pcapng block */
36extern bool
37pcapng_write_block(FILE* pfile,
38 const uint8_t *data,
39 uint32_t block_total_length,
40 uint64_t *bytes_written,
41 int *err);
42
46extern bool
48 GPtrArray *comments,
51 const char *hw,
54 const char *os,
57 const char *appname,
60 uint64_t section_length,
61 uint64_t *bytes_written,
62 int *err
63 );
64
65extern bool
66pcapng_write_interface_description_block(FILE* pfile,
67 const char *comment, /* OPT_COMMENT 1 */
68 const char *name, /* IDB_NAME 2 */
69 const char *descr, /* IDB_DESCRIPTION 3 */
70 const char *filter, /* IDB_FILTER 11 */
71 const char *os, /* IDB_OS 12 */
72 const char *hardware, /* IDB_HARDWARE 15 */
73 int link_type,
74 int snap_len,
75 uint64_t *bytes_written,
76 uint64_t if_speed, /* IDB_IF_SPEED 8 */
77 uint8_t tsresol, /* IDB_TSRESOL 9 */
78 int *err);
79
80extern bool
81pcapng_write_interface_statistics_block(FILE* pfile,
82 uint32_t interface_id,
83 uint64_t *bytes_written,
84 const char *comment, /* OPT_COMMENT 1 */
85 uint64_t isb_starttime, /* ISB_STARTTIME 2 */
86 uint64_t isb_endtime, /* ISB_ENDTIME 3 */
87 uint64_t isb_ifrecv, /* ISB_IFRECV 4 */
88 uint64_t isb_ifdrop, /* ISB_IFDROP 5 */
89 int *err);
90
91extern bool
92pcapng_write_enhanced_packet_block(FILE* pfile,
93 const char *comment,
94 time_t sec, uint32_t usec,
95 uint32_t caplen, uint32_t len,
96 uint32_t interface_id,
97 unsigned ts_mul,
98 const uint8_t *pd,
99 uint32_t flags,
100 uint64_t *bytes_written,
101 int *err);
102
103/*
104 * Editor modelines - https://www.wireshark.org/tools/modelines.html
105 *
106 * Local variables:
107 * c-basic-offset: 4
108 * tab-width: 8
109 * indent-tabs-mode: nil
110 * End:
111 *
112 * vi: set shiftwidth=4 tabstop=8 expandtab:
113 * :indentSize=4:tabSize=8:noTabs=true:
114 */
bool libpcap_write_file_header(FILE *pfile, int linktype, int snaplen, bool ts_nsecs, uint64_t *bytes_written, int *err)
Definition pcapio.c:199
bool pcapng_write_section_header_block(FILE *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:311
bool libpcap_write_packet(FILE *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:218