Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions
tap-tcp-stream.h File Reference

Go to the source code of this file.

Classes

struct  segment
 
struct  tcp_graph
 
struct  rtt_unack
 

Macros

#define RTT_ALL   0x0001
 
#define RTT_SAK   0x0002
 
#define RTT_RTT   0x0004
 
#define RTT_KRN   0x0008
 
#define COMPARE_CURR_DIR   0
 
#define COMPARE_ANY_DIR   1
 

Typedefs

typedef enum tcp_graph_type_ tcp_graph_type
 
typedef enum rtt_sampling_method_ rtt_sampling_method
 

Enumerations

enum  tcp_graph_type_ {
  GRAPH_TSEQ_STEVENS , GRAPH_TSEQ_TCPTRACE , GRAPH_THROUGHPUT , GRAPH_RTT ,
  GRAPH_WSCALE , GRAPH_UNDEFINED
}
 
enum  rtt_sampling_method_ {
  SAMPLING_ALL , SAMPLING_ALL_SACK , SAMPLING_RTT , SAMPLING_KARN ,
  SAMPLING_UNDEFINED
}
 

Functions

void graph_segment_list_get (capture_file *cf, struct tcp_graph *tg)
 Fill in the segment list for a TCP graph.
 
void graph_segment_list_free (struct tcp_graph *tg)
 Frees the memory allocated for a TCP graph segment list.
 
int compare_headers (address *saddr1, address *daddr1, uint16_t sport1, uint16_t dport1, const address *saddr2, const address *daddr2, uint16_t sport2, uint16_t dport2, int dir)
 Compares the headers of two TCP segments.
 
int get_num_dsegs (struct tcp_graph *tg)
 Gets the number of data segments in a TCP graph.
 
int get_num_acks (struct tcp_graph *tg, int *num_sack_ranges)
 Gets the number of ACKs in a TCP graph.
 
uint32_t select_tcpip_session (capture_file *cf)
 Selects a TCP/IP session based on capture file.
 
bool rtt_is_retrans (struct rtt_unack *list, unsigned int seqno)
 
struct rtt_unackrtt_get_new_unack (double time_val, unsigned int seqno, unsigned int seglen)
 Creates a new RTT unacknowledged packet structure.
 
void rtt_put_unack_on_list (struct rtt_unack **l, struct rtt_unack *new_unack)
 Adds a new unacknowledged packet to the list.
 
void rtt_delete_unack_from_list (struct rtt_unack **l, struct rtt_unack *dead)
 Removes a specific RTT unacknowledged packet from the list.
 
void rtt_destroy_unack_list (struct rtt_unack **l)
 Destroys the unacknowledged list of TCP sequences.
 

Detailed Description

TCP stream statistics Originally from tcp_graph.c by Pavel Mores pvl@u.nosp@m.h.cz Win32 port: rwh@u.nosp@m.nifi.nosp@m.edtec.nosp@m.h.co.nosp@m.m

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

◆ compare_headers()

int compare_headers ( address saddr1,
address daddr1,
uint16_t  sport1,
uint16_t  dport1,
const address saddr2,
const address daddr2,
uint16_t  sport2,
uint16_t  dport2,
int  dir 
)

Compares the headers of two TCP segments.

Parameters
saddr1Source address of the first segment.
daddr1Destination address of the first segment.
sport1Source port of the first segment.
dport1Destination port of the first segment.
saddr2Source address of the second segment.
daddr2Destination address of the second segment.
sport2Source port of the second segment.
dport2Destination port of the second segment.
dirDirection flag for comparison.
Returns
The result of the comparison.

◆ get_num_acks()

int get_num_acks ( struct tcp_graph tg,
int *  num_sack_ranges 
)

Gets the number of ACKs in a TCP graph.

Parameters
tgPointer to the TCP graph structure.
num_sack_rangesPointer to an integer where the sum of SACK ranges will be stored.
Returns
The count of ACKs.

◆ get_num_dsegs()

int get_num_dsegs ( struct tcp_graph tg)

Gets the number of data segments in a TCP graph.

Parameters
tgPointer to the TCP graph structure.
Returns
The count of data segments.

◆ graph_segment_list_free()

void graph_segment_list_free ( struct tcp_graph tg)

Frees the memory allocated for a TCP graph segment list.

This function releases all resources associated with the given TCP graph, including freeing memory for addresses and segments.

Parameters
tgPointer to the TCP graph structure to be freed.

◆ graph_segment_list_get()

void graph_segment_list_get ( capture_file cf,
struct tcp_graph tg 
)

Fill in the segment list for a TCP graph.

Parameters
cfCapture file to scan
tgTCP graph. A valid stream must be set. If either the source or destination address types are AT_NONE the address and port information will be filled in using the first packet in the specified stream.

◆ rtt_delete_unack_from_list()

void rtt_delete_unack_from_list ( struct rtt_unack **  l,
struct rtt_unack dead 
)

Removes a specific RTT unacknowledged packet from the list.

Parameters
lPointer to the head of the RTT unacknowledged packet list.
deadThe RTT unacknowledged packet to be removed.

◆ rtt_destroy_unack_list()

void rtt_destroy_unack_list ( struct rtt_unack **  l)

Destroys the unacknowledged list of TCP sequences.

Parameters
lPointer to the pointer of the head of the unacknowledged list.

◆ rtt_get_new_unack()

struct rtt_unack * rtt_get_new_unack ( double  time_val,
unsigned int  seqno,
unsigned int  seglen 
)

Creates a new RTT unacknowledged packet structure.

Parameters
time_valThe timestamp of the packet.
seqnoThe sequence number of the packet.
seglenThe length of the segment.
Returns
A pointer to the newly created rtt_unack structure.

◆ rtt_is_retrans()

bool rtt_is_retrans ( struct rtt_unack list,
unsigned int  seqno 
)

Check if a sequence number is currently in the Unacked list, typically for avoiding adding redundant sequences. In practice, the retrans meaning in this particular code is different from TCP's one and would rather cover Keep-Alives and Spurious Retrans.

Parameters
listThe list containing the Unacked sequences
seqnoThe sequence number to be searched for in the Unacked list
Returns
true if the list contains the sequence number, false otherwise

◆ rtt_put_unack_on_list()

void rtt_put_unack_on_list ( struct rtt_unack **  l,
struct rtt_unack new_unack 
)

Adds a new unacknowledged packet to the list.

Parameters
lPointer to the head of the unacknowledged packet list.
new_unackThe new unacknowledged packet to add.

◆ select_tcpip_session()

uint32_t select_tcpip_session ( capture_file cf)

Selects a TCP/IP session based on capture file.

This function is used to select a TCP/IP session from a capture file.

Parameters
cfPointer to the capture file containing the sessions.
Returns
The selected TCP/IP session ID.