Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Functions
capture-pcap-util-int.h File Reference

Go to the source code of this file.

Functions

void if_info_add_address (if_info_t *if_info, struct sockaddr *addr)
 Adds an address to an interface information structure.
 
GList * get_local_interface_list (int *err, char **err_str)
 Retrieves a list of local network interfaces.
 
if_capabilities_tget_if_capabilities_local (interface_options *interface_opts, cap_device_open_status *status, char **status_str)
 Retrieves local interface capabilities.
 
pcap_t * open_capture_device_local (capture_options *capture_opts, interface_options *interface_opts, int timeout, cap_device_open_status *open_status, char(*open_status_str)[PCAP_ERRBUF_SIZE])
 Opens a capture device using pcap_create.
 
if_capabilities_tget_if_capabilities_pcap_create (interface_options *interface_opts, cap_device_open_status *status, char **status_str)
 Retrieves capabilities for a network interface using pcap.
 
pcap_t * open_capture_device_pcap_create (capture_options *capture_opts, interface_options *interface_opts, int timeout, cap_device_open_status *open_status, char(*open_status_str)[PCAP_ERRBUF_SIZE])
 Open a capture device using pcap_create() with the given options.
 
char * cant_get_if_list_error_message (const char *err_str)
 Get an error message string for a get_interface_list() CANT_GET_INTERFACE_LIST error.
 
const char * get_pcap_failure_secondary_error_message (cap_device_open_status open_status, const char *open_status_str)
 Retrieves a secondary error message for a given capture device open status.
 

Detailed Description

Definitions of routines internal to the libpcap/WinPcap/Npcap utilities

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

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

Function Documentation

◆ cant_get_if_list_error_message()

char * cant_get_if_list_error_message ( const char *  err_str)
extern

Get an error message string for a get_interface_list() CANT_GET_INTERFACE_LIST error.

Get an error message string for a CANT_GET_INTERFACE_LIST error from "get_interface_list()". This is used to let the error message string be platform-dependent.

Parameters
err_strThe error string from the underlying system.
Returns
A pointer to a string containing the error message, or NULL if no additional information is available.

◆ get_if_capabilities_local()

if_capabilities_t * get_if_capabilities_local ( interface_options interface_opts,
cap_device_open_status *  status,
char **  status_str 
)
extern

Retrieves local interface capabilities.

Parameters
interface_optsPointer to the interface options structure.
statusPointer to a cap_device_open_status structure that receives the open status.
status_strPointer to a string that receives an error message if any.
Returns
A pointer to an if_capabilities_t structure representing the local interface capabilities, or NULL on failure.

◆ get_if_capabilities_pcap_create()

if_capabilities_t * get_if_capabilities_pcap_create ( interface_options interface_opts,
cap_device_open_status *  status,
char **  status_str 
)
extern

Retrieves capabilities for a network interface using pcap.

Parameters
interface_optsPointer to the interface options structure.
statusPointer to a cap_device_open_status structure that receives the open status.
status_strPointer to a string that receives an error message if any.
Returns
A pointer to an if_capabilities_t structure containing the capabilities, or NULL on failure.

◆ get_local_interface_list()

GList * get_local_interface_list ( int *  err,
char **  err_str 
)
extern

Retrieves a list of local network interfaces.

Parameters
errPointer to an integer that receives an error code.
err_strPointer to a string that receives an error message.
Returns
A GList containing pointers to if_info_t structures representing the local interfaces, or NULL on failure.

◆ get_pcap_failure_secondary_error_message()

const char * get_pcap_failure_secondary_error_message ( cap_device_open_status  open_status,
const char *  open_status_str 
)
extern

Retrieves a secondary error message for a given capture device open status.

Get a longer, secondary error message corresponding to why getting capabilities or opening a device failed. This is used to let the error message string be platform-dependent.

Parameters
open_statusThe capture device open status code.
open_status_strA string representation of the open status.
Returns
A pointer to a constant character string representing the secondary error message, or NULL if none is available.

◆ if_info_add_address()

void if_info_add_address ( if_info_t if_info,
struct sockaddr *  addr 
)
extern

Adds an address to an interface information structure.

Parameters
if_infoPointer to the interface information structure.
addrPointer to the sockaddr structure containing the address to add.

◆ open_capture_device_local()

pcap_t * open_capture_device_local ( capture_options capture_opts,
interface_options interface_opts,
int  timeout,
cap_device_open_status *  open_status,
char(*)  open_status_str[PCAP_ERRBUF_SIZE] 
)
extern

Opens a capture device using pcap_create.

Parameters
capture_optsPointer to the capture options structure.
interface_optsPointer to the interface options structure.
timeoutTimeout for the capture operation.
open_statusPointer to the capture device open status structure.
open_status_strPointer to the buffer for the open status string.
Returns
pcap_t* Pointer to the opened pcap_t structure, or NULL on failure.

◆ open_capture_device_pcap_create()

pcap_t * open_capture_device_pcap_create ( capture_options capture_opts,
interface_options interface_opts,
int  timeout,
cap_device_open_status *  open_status,
char(*)  open_status_str[PCAP_ERRBUF_SIZE] 
)
extern

Open a capture device using pcap_create() with the given options.

Parameters
capture_optsGlobal capture options.
interface_optsPer‑interface capture options.
timeoutTimeout (in milliseconds) for packet buffering.
open_statusOutput parameter describing the open result.
open_status_strOutput buffer for a human‑readable status message.
Returns
A pcap_t* handle on success, or NULL on failure.