Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions | Variables
packet_range.h File Reference
#include <glib.h>
#include <epan/range.h>
#include <epan/frame_data.h>
#include <epan/cfile.h>

Go to the source code of this file.

Classes

struct  packet_range_tag
 Fully describes a packet range selection, including UI settings, derived counts, and dependency sets used when iterating over a capture file. More...
 
struct  packet_range_iter
 

Typedefs

typedef struct packet_range_tag packet_range_t
 Fully describes a packet range selection, including UI settings, derived counts, and dependency sets used when iterating over a capture file.
 
typedef struct packet_range_iter packet_range_iter_t
 

Enumerations

enum  packet_range_e {
  range_process_all , range_process_selected , range_process_marked , range_process_marked_range ,
  range_process_user_range
}
 Selects which subset of packets in a capture file should be processed. More...
 
enum  range_process_e { range_process_this , range_process_next , range_processing_finished }
 Disposition returned per-packet by the range enumeration callback to control iteration. More...
 

Functions

void packet_range_init (packet_range_t *range, capture_file *cf)
 Initialize a packet range structure.
 
void packet_range_cleanup (packet_range_t *range)
 Cleanup the range structure before the caller frees "range".
 
convert_ret_t packet_range_check (packet_range_t *range)
 Check whether the packet range is OK.
 
void packet_range_process_init (packet_range_t *range)
 Initialize the processing run for a packet range.
 
bool packet_range_process_all (packet_range_t *range)
 Check if all packets in the range need to be processed.
 
range_process_e packet_range_process_packet (packet_range_t *range, frame_data *fdata)
 Check if a packet should be processed based on the given range.
 
void packet_range_convert_str (packet_range_t *range, const char *es)
 Convert a user-given string to an internal selection specified range representation.
 
void packet_range_convert_selection_str (packet_range_t *range, const char *es)
 Convert a selection string to a packet range.
 
uint32_t packet_range_count (const packet_range_t *range)
 Return the number of packets that will be processed.
 
void packet_range_iter_init (packet_range_iter_t *iter, packet_range_t *range)
 Initialize an iterator over a packet range.
 
frame_datapacket_range_iter_next (packet_range_iter_t *iter)
 Get the next frame data to process from a packet range.
 

Variables

uint32_t curr_selected_frame
 

Detailed Description

Packet range routines (save, print, ...)

Dick Gooris goori.nosp@m.s@lu.nosp@m.cent..nosp@m.com Ulf Lamping ulf.l.nosp@m.ampi.nosp@m.ng@we.nosp@m.b.de

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

Enumeration Type Documentation

◆ packet_range_e

Selects which subset of packets in a capture file should be processed.

Enumerator
range_process_all 

Process all packets in the capture file

range_process_selected 

Process only the currently selected packet(s)

range_process_marked 

Process only marked packets

range_process_marked_range 

Process packets in the contiguous range between the first and last marked packet

range_process_user_range 

Process packets within a user-specified range string

◆ range_process_e

Disposition returned per-packet by the range enumeration callback to control iteration.

Enumerator
range_process_this 

Process the current packet and continue to the next

range_process_next 

Skip the current packet and continue to the next

range_processing_finished 

Stop iteration; all required packets have been processed

Function Documentation

◆ packet_range_check()

convert_ret_t packet_range_check ( packet_range_t range)
extern

Check whether the packet range is OK.

Parameters
rangePointer to the packet_range_t structure to be checked.
Returns
convert_ret_t The result of the check.

◆ packet_range_cleanup()

void packet_range_cleanup ( packet_range_t range)
extern

Cleanup the range structure before the caller frees "range".

Parameters
rangePointer to the packet_range_t structure to be cleaned up.

◆ packet_range_convert_selection_str()

void packet_range_convert_selection_str ( packet_range_t range,
const char *  es 
)
extern

Convert a selection string to a packet range.

This function takes a selection string and converts it into a packet range structure.

Parameters
rangePointer to the packet_range_t structure where the result will be stored.
esThe selection string to convert.

◆ packet_range_convert_str()

void packet_range_convert_str ( packet_range_t range,
const char *  es 
)
extern

Convert a user-given string to an internal selection specified range representation.

Parameters
rangePointer to the packet_range_t structure where the result will be stored.
esThe user-given string representing the packet range.

◆ packet_range_count()

uint32_t packet_range_count ( const packet_range_t range)
extern

Return the number of packets that will be processed.

Parameters
rangePointer to the packet_range_t structure.
Returns
uint32_t The number of packets that will be processed.
Note
If live capture is occurring, the actual number of packets that will be processed may be greater; i.e., packets that are captured after this function is called may be included as well.

◆ packet_range_init()

void packet_range_init ( packet_range_t range,
capture_file cf 
)
extern

Initialize a packet range structure.

Parameters
rangePointer to the packet_range_t structure to be initialized.
cfPointer to the capture_file structure associated with the packet range.

◆ packet_range_iter_init()

void packet_range_iter_init ( packet_range_iter_t iter,
packet_range_t range 
)
extern

Initialize an iterator over a packet range.

This function will call packet_range_process_init on range, so that does not need to be called beforehand.

Parameters
iterPointer to the packet_range_iter_t structure to initialize.
rangePointer to the packet_range_t over which to iterate.

◆ packet_range_iter_next()

frame_data * packet_range_iter_next ( packet_range_iter_t iter)
extern

Get the next frame data to process from a packet range.

Parameters
iterPointer to the packet_range_iter_t iterator.
Returns
frame_data* The frame data to process. NULL when iteration is done.

◆ packet_range_process_all()

bool packet_range_process_all ( packet_range_t range)
extern

Check if all packets in the range need to be processed.

Parameters
rangePointer to the packet_range_t structure.
Returns
bool True if all packets need to be processed, false otherwise.

◆ packet_range_process_init()

void packet_range_process_init ( packet_range_t range)
extern

Initialize the processing run for a packet range.

Parameters
rangePointer to the packet_range_t structure to initialize.

◆ packet_range_process_packet()

range_process_e packet_range_process_packet ( packet_range_t range,
frame_data fdata 
)
extern

Check if a packet should be processed based on the given range.

Parameters
rangePointer to the packet range structure.
fdataPointer to the frame data structure representing the packet to be checked.
Returns
convert_ret_t The result of the check, indicating whether the packet should be processed or not.