10#ifndef __PACKET_TCP_H__
11#define __PACKET_TCP_H__
13#include "ws_symbol_export.h"
36#define IS_TH_FIN(x) (x & TH_FIN)
37#define IS_TH_URG(x) (x & TH_URG)
40#define GT_SEQ(x, y) ((int32_t)((y) - (x)) < 0)
41#define LT_SEQ(x, y) ((int32_t)((x) - (y)) < 0)
42#define GE_SEQ(x, y) ((int32_t)((y) - (x)) <= 0)
43#define LE_SEQ(x, y) ((int32_t)((x) - (y)) <= 0)
44#define EQ_SEQ(x, y) (x) == (y)
47#define MAX_CONTIGUOUS_SEQUENCES 100
62 uint8_t mh_capable_flags;
65 uint64_t mh_dss_rawdsn;
66 uint64_t mh_dss_rawack;
67 uint16_t mh_dss_length;
92 #define MAX_TCP_SACK_RANGES 4
93 uint8_t num_sack_ranges;
105 uint32_t sack_left_edge[MAX_TCP_SACK_RANGES];
106 uint32_t sack_right_edge[MAX_TCP_SACK_RANGES];
111 uint32_t th_dup_count;
112 uint32_t th_dup_orig_frame;
126 uint16_t urgent_pointer;
151tcp_dissect_pdus(tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree,
152 bool proto_desegment,
unsigned fixed_len,
153 unsigned (*get_pdu_len)(
packet_info *, tvbuff_t *,
int,
void*),
154 dissector_t dissect_pdu,
void* dissector_data);
157tcp_reassembly_table_functions;
160pdu_store_sequencenumber_of_next_pdu(
packet_info *pinfo, uint32_t seq, uint32_t nxtpdu,
wmem_tree_t *multisegment_pdus);
173 uint32_t frame_acked;
184 uint32_t dupack_frame;
185 uint32_t bytes_in_flight;
186 uint32_t push_bytes_sent;
188 uint32_t new_data_seq;
191 uint32_t dup_orig_frame;
201 uint32_t first_frame;
204 uint32_t first_frame_with_seq;
207#define MSP_FLAGS_REASSEMBLE_ENTIRE_SEGMENT 0x00000001
209#define MSP_FLAGS_GOT_ALL_SEGMENTS 0x00000002
211#define MSP_FLAGS_MISSING_FIRST_SEGMENT 0x00000004
235} mptcp_dss_mapping_t;
243} mptcp_dsn2packet_mapping_t;
252 uint8_t static_flags;
267 uint32_t nextseqframe;
270 uint64_t maxseqtobeacked;
294 mptcp_meta_flow_t *meta;
296 uint8_t static_flags;
302 MPTCP_HMAC_NOT_SET = 0,
306} mptcp_hmac_algorithm_t;
309#define MPTCP_CAPABLE_CRYPTO_MASK 0x3F
311#define MPTCP_CHECKSUM_MASK 0x80
317 tcp_unacked_t *segments;
318 uint16_t segment_count;
328 uint8_t num_contiguous_ranges;
334 uint8_t num_sack_ranges;
337 uint32_t lastnondupack;
341 uint32_t maxseqtobeacked;
344 uint32_t nextseqframe;
347 uint32_t push_bytes_sent;
353 uint32_t sack_left_edge[MAX_TCP_SACK_RANGES];
354 uint32_t sack_right_edge[MAX_TCP_SACK_RANGES];
355 uint32_t contiguous_ranges[MAX_CONTIGUOUS_SEQUENCES][2];
361 uint32_t process_uid;
362 uint32_t process_pid;
370#define TCP_MAX_UNACKED_SEGMENTS 10000
376 uint8_t static_flags;
377 uint16_t maxsizeacked;
381#define TCP_FLOW_REASSEMBLE_UNTIL_FIN 0x0001
386 uint8_t mp_operations;
388 bool closing_initiator;
389 bool closing_initiator_rst;
393 uint32_t lastsegmentflags;
418 struct mptcp_subflow *mptcp_subflow;
427 uint8_t mp_operations;
438 mptcp_meta_flow_t meta_flow[2];
510 struct mptcp_analysis* mptcp_analysis;
515 uint16_t server_port;
523 int8_t flow_direction : 2;
530 uint8_t conversation_completeness;
532 bool had_acc_ecn_setup_syn;
533 bool had_acc_ecn_setup_syn_ack;
534 bool had_acc_ecn_option;
537 char *conversation_completeness_str;
547 uint8_t tcp_snd_manual_analysis;
557 mptcp_dss_mapping_t *mapping;
559} mptcp_per_packet_data_t;
562WS_DLL_PUBLIC
void dissect_tcp_payload(tvbuff_t *tvb,
packet_info *pinfo,
int offset,
563 uint32_t seq, uint32_t nxtseq, uint32_t sport,
564 uint32_t dport, proto_tree *tree,
565 proto_tree *tcp_tree,
591extern void add_tcp_process_info(uint32_t frame_num,
address *local_addr,
address *remote_addr, uint16_t local_port, uint16_t remote_port, uint32_t uid, uint32_t pid,
char *username,
char *command);
597WS_DLL_PUBLIC uint32_t get_tcp_stream_count(
void);
603WS_DLL_PUBLIC uint32_t get_mptcp_stream_count(
void);
607extern char *tcp_follow_index_filter(
unsigned stream,
unsigned sub_stream);
608extern char *tcp_follow_address_filter(
address *src_addr,
address *dst_addr,
int src_port,
int dst_port);
struct _address address
Holds a network or link-layer address of any supported type.
struct conversation conversation_t
struct epan_dissect epan_dissect_t
Opaque type representing a single packet dissection context.
Definition epan.h:62
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
struct _wmem_array_t wmem_array_t
Opaque type representing a dynamically resizable array in the wmem system.
Definition wmem_array.h:42
struct _wmem_tree_t wmem_itree_t
Alias for a wmem interval tree.
Definition wmem_interval_tree.h:46
struct _wmem_list_t wmem_list_t
Opaque type representing a scoped, doubly-linked list in the wmem system.
Definition wmem_list.h:42
struct _wmem_map_t wmem_map_t
Opaque type representing a wmem-managed hash map.
Definition wmem_map.h:46
struct _wmem_tree_t wmem_tree_t
Opaque type representing a red-black tree in the wmem system.
Definition wmem_tree.h:49
Definition packet-tcp.h:240
Definition packet-tcp.h:219
Definition packet-tcp.h:368
Definition packet-tcp.h:162
Definition packet-tcp.h:422
Definition packet-tcp.h:554
Definition packet-tcp.h:282
Table of functions for a reassembly table.
Definition reassemble.h:151
Definition packet-tcp.h:172
Definition packet-tcp.h:441
Definition packet-tcp.h:316
Definition packet-tcp.h:198
Definition packet-tcp.h:544
Definition packet-tcp.h:360
Definition packet-tcp.h:121