Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
tap_export_pdu.h File Reference

Go to the source code of this file.

Classes

struct  _exp_pdu_t
 

Typedefs

typedef struct _exp_pdu_t exp_pdu_t
 

Functions

char * exp_pdu_pre_open (const char *tap_name, const char *filter, exp_pdu_t *exp_pdu_tap_data)
 Registers the tap listener which will add matching packets to the exported file. Must be called before exp_pdu_open.
 
bool exp_pdu_open (exp_pdu_t *data, char *pathname, int file_type_subtype, int fd, const char *comment, int *err, char **err_info)
 Use the given file descriptor for writing an output file. Can only be called once and exp_pdu_pre_open() must be called before.
 
bool exp_pdu_close (exp_pdu_t *exp_pdu_tap_data, int *err, char **err_info)
 Closes an exported PDU tap.
 

Detailed Description

Routines for exporting PDUs to file

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

◆ exp_pdu_close()

bool exp_pdu_close ( exp_pdu_t exp_pdu_tap_data,
int *  err,
char **  err_info 
)

Closes an exported PDU tap.

Parameters
exp_pdu_tap_dataPointer to the export PDU tap data structure.
errPointer to an integer that will receive an error code if an error occurs.
err_infoPointer to a string that will receive an error message if an error occurs.
Returns
True if the tap was successfully closed, false otherwise.

◆ exp_pdu_open()

bool exp_pdu_open ( exp_pdu_t data,
char *  pathname,
int  file_type_subtype,
int  fd,
const char *  comment,
int *  err,
char **  err_info 
)

Use the given file descriptor for writing an output file. Can only be called once and exp_pdu_pre_open() must be called before.

Parameters
dataThe export PDU tap data structure.
pathnameThe name of the file to write to. This is used for error reporting and may be NULL if the file descriptor is valid.
file_type_subtypeThe file type and subtype to use for the output file.
fdThe file descriptor to use for writing the output file.
commentA comment to add to the output file, or NULL if no comment should be added.
[out]errWill be set to an error code on failure.
[out]err_infofor some errors, a string giving more details of the error
Returns
true on success or false on failure.

◆ exp_pdu_pre_open()

char * exp_pdu_pre_open ( const char *  tap_name,
const char *  filter,
exp_pdu_t exp_pdu_tap_data 
)

Registers the tap listener which will add matching packets to the exported file. Must be called before exp_pdu_open.

Parameters
tap_nameOne of the names registered with register_export_pdu_tap().
filterAn tap filter, may be NULL to disable filtering which improves performance if you do not need a filter.
Returns
NULL on success or an error string on failure which must be freed with g_free(). Failure could occur when the filter or tap_name are invalid.