| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
tap-dis-common.h
1/* tap-dis-common.h
2 * DIS streams handler functions used by tshark and wireshark.
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef __TAP_DIS_COMMON_H__
8#define __TAP_DIS_COMMON_H__
9
10#include <stdio.h>
11
12#include <glib.h>
13
14#include <epan/address.h>
15#include <epan/epan_dissect.h>
16#include <epan/packet_info.h>
17#include <epan/tap.h>
18
19#ifdef __cplusplus
20 extern "C" {
21#endif /* __cplusplus */
22
23 typedef struct _disstream_id {
24 address src_addr;
25 uint16_t src_port;
26 address dst_addr;
27 uint16_t dst_port;
28 uint16_t radio_id;
29 uint16_t entity_id_site;
30 uint16_t entity_id_appl;
31 uint16_t entity_id_entity;
32} disstream_id_t;
33
34 typedef struct _disstream_packet {
35 uint32_t frame_num;
36 nstime_t rel_time;
37 uint8_t payload_type;
38 guint payload_len;
39 guint8 *payload_data;
40 double delta_ms;
41 double jitter_ms;
42 uint32_t estimated_lost_added;
43 bool problem;
44} disstream_packet_t;
45
46 typedef struct _disstream_info {
47 disstream_id_t id;
48
49 uint8_t payload_type;
50 const char *payload_type_str;
51 uint8_t radio_input_source;
52 uint8_t transmit_state;
53
54 uint32_t packet_count;
55 uint32_t signal_packet_count;
56 uint32_t transmitter_packet_count;
57 uint64_t total_payload_bytes;
58 uint32_t estimated_lost_packets;
59
60 uint32_t first_packet_num;
61 uint32_t last_packet_num;
62 uint32_t first_signal_frame_num;
63 uint32_t last_signal_frame_num;
64 nstime_t start_rel_time;
65 nstime_t stop_rel_time;
66
67 double max_delta_ms;
68 double mean_delta_ms;
69 double max_jitter_ms;
70 double mean_jitter_ms;
71
72 bool transmission_stopped;
73 bool problem;
74
75 GPtrArray *signal_packets;
76
77 /* Internal running analysis state. */
78 bool first_timing_packet;
79 uint32_t timing_packet_count;
80 double start_arrival_ms;
81 double prev_arrival_ms;
82 double prev_nominal_ms;
83 double first_tx_ms;
84 double prev_tx_ms;
85 double filtered_jitter_ms;
86 double excess_codec_time_ms;
87} disstream_info_t;
88
89 typedef enum {
90 DISSTREAM_TAP_ANALYSE,
91 DISSTREAM_TAP_SAVE,
92 DISSTREAM_TAP_MARK
93} disstream_tap_mode_t;
94
95 struct _disstream_tapinfo;
96 typedef void (*disstream_tap_draw_cb)(struct _disstream_tapinfo *tapinfo);
97 typedef void (*disstream_tap_reset_cb)(struct _disstream_tapinfo *tapinfo);
98 typedef void (*disstream_tap_error_cb)(GString *error);
99
100 typedef struct _disstream_tapinfo {
101 GList *strinfo_list;
102 GHashTable *strinfo_hash;
103 uint32_t nstreams;
104 uint32_t npackets;
105
106 disstream_tap_mode_t mode;
107 disstream_info_t *filter_stream;
108 FILE *save_file;
109
110 disstream_tap_draw_cb tap_draw;
111 disstream_tap_reset_cb tap_reset;
112 bool is_registered;
113} disstream_tapinfo_t;
114
115 void disstream_id_copy(const disstream_id_t *src, disstream_id_t *dst);
116 void disstream_id_copy_pinfo(const packet_info *pinfo, disstream_id_t *dst);
117 void disstream_id_copy_pinfo_shallow(const packet_info *pinfo, disstream_id_t *dst);
118 void disstream_id_free(disstream_id_t *id);
119 unsigned disstream_id_to_hash(const disstream_id_t *id);
120 bool disstream_id_equal(const disstream_id_t *id1, const disstream_id_t *id2);
121
122 void disstream_info_init(disstream_info_t *info);
123 disstream_info_t *disstream_info_malloc_and_init(void);
124 void disstream_info_free_data(disstream_info_t *info);
125 void disstream_info_free_all(disstream_info_t *info);
126 void disstream_packet_free(disstream_packet_t *packet);
127
128 void register_tap_listener_disstream(disstream_tapinfo_t *tapinfo, const char *fstring,
129 disstream_tap_error_cb tap_error);
130 void remove_tap_listener_disstream(disstream_tapinfo_t *tapinfo);
131 void disstream_reset(disstream_tapinfo_t *tapinfo);
132 void disstream_reset_cb(void *arg);
133 tap_packet_status disstream_packet_cb(void *arg, packet_info *pinfo, epan_dissect_t *edt,
134 const void *arg2, tap_flags_t flags);
135
136#ifdef __cplusplus
137}
138#endif /* __cplusplus */
139
140#endif /* __TAP_DIS_COMMON_H__ */
address.h
epan_dissect.h
packet_info.h
_address
Definition address.h:58
_disstream_id
Definition tap-dis-common.h:23
_disstream_info
Definition tap-dis-common.h:46
_disstream_packet
Definition tap-dis-common.h:34
_disstream_tapinfo
Definition tap-dis-common.h:100
_packet_info
Definition packet_info.h:43
epan_dissect
Definition epan_dissect.h:28
info
Definition file-pcapng.h:57
nstime_t
Definition nstime.h:26
tap.h
tap_packet_status
tap_packet_status
Definition tap.h:25