Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Functions
pcap-common.h File Reference
#include "wtap.h"

Go to the source code of this file.

Functions

unsigned wtap_max_snaplen_for_encap (int wtap_encap)
 Get the maximum snapshot length for a given capture encapsulation type.
 
int pcap_process_pseudo_header (FILE_T fh, bool is_nokia, int wtap_encap, unsigned packet_size, wtap_rec *rec, int *err, char **err_info)
 
void pcap_read_post_process (bool is_nokia, int wtap_encap, wtap_rec *rec, bool bytes_swapped, int fcs_len)
 
unsigned pcap_get_phdr_size (int encap, const union wtap_pseudo_header *pseudo_header)
 Retrieves the size of the pseudo-header for a given encapsulation type and pseudo-header.
 
bool pcap_write_phdr (wtap_dumper *wdh, int wtap_encap, const union wtap_pseudo_header *pseudo_header, int *err)
 Writes a packet header to a dump file.
 

Detailed Description

Declarations for code common to pcap and pcapng file formats

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

File format support for pcapng file format Copyright (c) 2007 by Ulf Lamping ulf.l.nosp@m.ampi.nosp@m.ng@we.nosp@m.b.de

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

Function Documentation

◆ pcap_get_phdr_size()

unsigned pcap_get_phdr_size ( int  encap,
const union wtap_pseudo_header pseudo_header 
)
extern

Retrieves the size of the pseudo-header for a given encapsulation type and pseudo-header.

Parameters
encapThe encapsulation type.
pseudo_headerPointer to the pseudo-header union.
Returns
The size of the pseudo-header, or 0 if not applicable.

◆ pcap_write_phdr()

bool pcap_write_phdr ( wtap_dumper wdh,
int  wtap_encap,
const union wtap_pseudo_header pseudo_header,
int *  err 
)
extern

Writes a packet header to a dump file.

Parameters
wdhPointer to the wtap_dumper structure.
wtap_encapThe encapsulation type of the packet.
pseudo_headerPointer to the pseudo-header of the packet.
errPointer to an integer where any error code will be stored.
Returns
true if the header was successfully written, false otherwise.

◆ wtap_max_snaplen_for_encap()

unsigned wtap_max_snaplen_for_encap ( int  wtap_encap)
extern

Get the maximum snapshot length for a given capture encapsulation type.

Parameters
wtap_encapThe capture encapsulation type.
Returns
unsigned The maximum snapshot length for the specified encapsulation type.