Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Functions
pcapio.h File Reference

Go to the source code of this file.

Functions

bool libpcap_write_file_header (FILE *pfile, int linktype, int snaplen, bool ts_nsecs, uint64_t *bytes_written, int *err)
 
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)
 
bool pcapng_write_block (FILE *pfile, const uint8_t *data, uint32_t block_total_length, uint64_t *bytes_written, int *err)
 
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)
 
bool pcapng_write_interface_description_block (FILE *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)
 
bool pcapng_write_interface_statistics_block (FILE *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)
 
bool pcapng_write_enhanced_packet_block (FILE *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)
 

Detailed Description

Declarations of our own routines for writing pcap and pcapng files.

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

Derived from code in the Wiretap Library Copyright (c) 1998 by Gilbert Ramirez gram@.nosp@m.alum.nosp@m.ni.ri.nosp@m.ce.e.nosp@m.du

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ libpcap_write_file_header()

bool libpcap_write_file_header ( FILE *  pfile,
int  linktype,
int  snaplen,
bool  ts_nsecs,
uint64_t *  bytes_written,
int *  err 
)
extern

Write the file header to a dump file. Returns true on success, false on failure. Sets "*err" to an error code, or 0 for a short write, on failure

◆ libpcap_write_packet()

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 
)
extern

Write a record for a packet to a dump file. Returns true on success, false on failure.

◆ pcapng_write_section_header_block()

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 
)
extern

Write a section header block (SHB)

Parameters
pfileWrite information
commentsComments on the section, Optinon 1 opt_comment UTF-8 strings containing comments that areassociated to the current block.
hwHW, Optinon 2 shb_hardware An UTF-8 string containing the description of the hardware used to create this section.
osOperating system name, Optinon 3 shb_os An UTF-8 string containing the name of the operating system used to create this section.
appnameApplication name, Optinon 4 shb_userappl An UTF-8 string containing the name of the application used to create this section.
section_lengthLength of section
bytes_writtenNumber of written bytes
errError type