18#include <wsutil/file_compressed.h>
89#define WTAP_ENCAP_NONE -2
90#define WTAP_ENCAP_PER_PACKET -1
91#define WTAP_ENCAP_UNKNOWN 0
92#define WTAP_ENCAP_ETHERNET 1
93#define WTAP_ENCAP_TOKEN_RING 2
94#define WTAP_ENCAP_SLIP 3
95#define WTAP_ENCAP_PPP 4
96#define WTAP_ENCAP_FDDI 5
97#define WTAP_ENCAP_FDDI_BITSWAPPED 6
98#define WTAP_ENCAP_RAW_IP 7
99#define WTAP_ENCAP_ARCNET 8
100#define WTAP_ENCAP_ARCNET_LINUX 9
101#define WTAP_ENCAP_ATM_RFC1483 10
102#define WTAP_ENCAP_LINUX_ATM_CLIP 11
103#define WTAP_ENCAP_LAPB 12
104#define WTAP_ENCAP_ATM_PDUS 13
105#define WTAP_ENCAP_ATM_PDUS_UNTRUNCATED 14
106#define WTAP_ENCAP_NULL 15
107#define WTAP_ENCAP_ASCEND 16
108#define WTAP_ENCAP_ISDN 17
109#define WTAP_ENCAP_IP_OVER_FC 18
110#define WTAP_ENCAP_PPP_WITH_PHDR 19
111#define WTAP_ENCAP_IEEE_802_11 20
112#define WTAP_ENCAP_IEEE_802_11_PRISM 21
113#define WTAP_ENCAP_IEEE_802_11_WITH_RADIO 22
114#define WTAP_ENCAP_IEEE_802_11_RADIOTAP 23
115#define WTAP_ENCAP_IEEE_802_11_AVS 24
116#define WTAP_ENCAP_SLL 25
117#define WTAP_ENCAP_FRELAY 26
118#define WTAP_ENCAP_FRELAY_WITH_PHDR 27
119#define WTAP_ENCAP_CHDLC 28
120#define WTAP_ENCAP_CISCO_IOS 29
121#define WTAP_ENCAP_LOCALTALK 30
122#define WTAP_ENCAP_OLD_PFLOG 31
123#define WTAP_ENCAP_HHDLC 32
124#define WTAP_ENCAP_DOCSIS 33
125#define WTAP_ENCAP_COSINE 34
126#define WTAP_ENCAP_WFLEET_HDLC 35
127#define WTAP_ENCAP_SDLC 36
128#define WTAP_ENCAP_TZSP 37
129#define WTAP_ENCAP_ENC 38
130#define WTAP_ENCAP_PFLOG 39
131#define WTAP_ENCAP_CHDLC_WITH_PHDR 40
132#define WTAP_ENCAP_BLUETOOTH_H4 41
133#define WTAP_ENCAP_MTP2 42
134#define WTAP_ENCAP_MTP3 43
135#define WTAP_ENCAP_IRDA 44
136#define WTAP_ENCAP_USER0 45
137#define WTAP_ENCAP_USER1 46
138#define WTAP_ENCAP_USER2 47
139#define WTAP_ENCAP_USER3 48
140#define WTAP_ENCAP_USER4 49
141#define WTAP_ENCAP_USER5 50
142#define WTAP_ENCAP_USER6 51
143#define WTAP_ENCAP_USER7 52
144#define WTAP_ENCAP_USER8 53
145#define WTAP_ENCAP_USER9 54
146#define WTAP_ENCAP_USER10 55
147#define WTAP_ENCAP_USER11 56
148#define WTAP_ENCAP_USER12 57
149#define WTAP_ENCAP_USER13 58
150#define WTAP_ENCAP_USER14 59
151#define WTAP_ENCAP_USER15 60
152#define WTAP_ENCAP_SYMANTEC 61
153#define WTAP_ENCAP_APPLE_IP_OVER_IEEE1394 62
154#define WTAP_ENCAP_BACNET_MS_TP 63
155#define WTAP_ENCAP_NETTL_RAW_ICMP 64
156#define WTAP_ENCAP_NETTL_RAW_ICMPV6 65
157#define WTAP_ENCAP_GPRS_LLC 66
158#define WTAP_ENCAP_JUNIPER_ATM1 67
159#define WTAP_ENCAP_JUNIPER_ATM2 68
160#define WTAP_ENCAP_REDBACK 69
161#define WTAP_ENCAP_NETTL_RAW_IP 70
162#define WTAP_ENCAP_NETTL_ETHERNET 71
163#define WTAP_ENCAP_NETTL_TOKEN_RING 72
164#define WTAP_ENCAP_NETTL_FDDI 73
165#define WTAP_ENCAP_NETTL_UNKNOWN 74
166#define WTAP_ENCAP_MTP2_WITH_PHDR 75
167#define WTAP_ENCAP_JUNIPER_PPPOE 76
168#define WTAP_ENCAP_GCOM_TIE1 77
169#define WTAP_ENCAP_GCOM_SERIAL 78
170#define WTAP_ENCAP_NETTL_X25 79
171#define WTAP_ENCAP_K12 80
172#define WTAP_ENCAP_JUNIPER_MLPPP 81
173#define WTAP_ENCAP_JUNIPER_MLFR 82
174#define WTAP_ENCAP_JUNIPER_ETHER 83
175#define WTAP_ENCAP_JUNIPER_PPP 84
176#define WTAP_ENCAP_JUNIPER_FRELAY 85
177#define WTAP_ENCAP_JUNIPER_CHDLC 86
178#define WTAP_ENCAP_JUNIPER_GGSN 87
179#define WTAP_ENCAP_LINUX_LAPD 88
180#define WTAP_ENCAP_CATAPULT_DCT2000 89
181#define WTAP_ENCAP_BER 90
182#define WTAP_ENCAP_JUNIPER_VP 91
183#define WTAP_ENCAP_USB_FREEBSD 92
184#define WTAP_ENCAP_IEEE802_16_MAC_CPS 93
185#define WTAP_ENCAP_NETTL_RAW_TELNET 94
186#define WTAP_ENCAP_USB_LINUX 95
187#define WTAP_ENCAP_MPEG 96
188#define WTAP_ENCAP_PPI 97
189#define WTAP_ENCAP_ERF 98
190#define WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR 99
191#define WTAP_ENCAP_SITA 100
192#define WTAP_ENCAP_SCCP 101
193#define WTAP_ENCAP_BLUETOOTH_HCI 102
194#define WTAP_ENCAP_IPMB_KONTRON 103
195#define WTAP_ENCAP_IEEE802_15_4 104
196#define WTAP_ENCAP_X2E_XORAYA 105
197#define WTAP_ENCAP_FLEXRAY 106
198#define WTAP_ENCAP_LIN 107
199#define WTAP_ENCAP_MOST 108
200#define WTAP_ENCAP_CAN20B 109
201#define WTAP_ENCAP_LAYER1_EVENT 110
202#define WTAP_ENCAP_X2E_SERIAL 111
203#define WTAP_ENCAP_I2C_LINUX 112
204#define WTAP_ENCAP_IEEE802_15_4_NONASK_PHY 113
205#define WTAP_ENCAP_TNEF 114
206#define WTAP_ENCAP_USB_LINUX_MMAPPED 115
207#define WTAP_ENCAP_GSM_UM 116
208#define WTAP_ENCAP_DPNSS 117
209#define WTAP_ENCAP_PACKETLOGGER 118
210#define WTAP_ENCAP_NSTRACE_1_0 119
211#define WTAP_ENCAP_NSTRACE_2_0 120
212#define WTAP_ENCAP_FIBRE_CHANNEL_FC2 121
213#define WTAP_ENCAP_FIBRE_CHANNEL_FC2_WITH_FRAME_DELIMS 122
214#define WTAP_ENCAP_JPEG_JFIF 123
215#define WTAP_ENCAP_IPNET 124
216#define WTAP_ENCAP_SOCKETCAN 125
217#define WTAP_ENCAP_IEEE_802_11_NETMON 126
218#define WTAP_ENCAP_IEEE802_15_4_NOFCS 127
219#define WTAP_ENCAP_RAW_IPFIX 128
220#define WTAP_ENCAP_RAW_IP4 129
221#define WTAP_ENCAP_RAW_IP6 130
222#define WTAP_ENCAP_LAPD 131
223#define WTAP_ENCAP_DVBCI 132
224#define WTAP_ENCAP_MUX27010 133
225#define WTAP_ENCAP_MIME 134
226#define WTAP_ENCAP_NETANALYZER 135
227#define WTAP_ENCAP_NETANALYZER_TRANSPARENT 136
228#define WTAP_ENCAP_IP_OVER_IB_SNOOP 137
229#define WTAP_ENCAP_MPEG_2_TS 138
230#define WTAP_ENCAP_PPP_ETHER 139
231#define WTAP_ENCAP_NFC_LLCP 140
232#define WTAP_ENCAP_NFLOG 141
233#define WTAP_ENCAP_V5_EF 142
234#define WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR 143
235#define WTAP_ENCAP_IXVERIWAVE 144
236#define WTAP_ENCAP_SDH 145
237#define WTAP_ENCAP_DBUS 146
238#define WTAP_ENCAP_AX25_KISS 147
239#define WTAP_ENCAP_AX25 148
240#define WTAP_ENCAP_SCTP 149
241#define WTAP_ENCAP_INFINIBAND 150
242#define WTAP_ENCAP_JUNIPER_SVCS 151
243#define WTAP_ENCAP_USBPCAP 152
244#define WTAP_ENCAP_RTAC_SERIAL 153
245#define WTAP_ENCAP_BLUETOOTH_LE_LL 154
246#define WTAP_ENCAP_WIRESHARK_UPPER_PDU 155
247#define WTAP_ENCAP_STANAG_4607 156
248#define WTAP_ENCAP_STANAG_5066_D_PDU 157
249#define WTAP_ENCAP_NETLINK 158
250#define WTAP_ENCAP_BLUETOOTH_LINUX_MONITOR 159
251#define WTAP_ENCAP_BLUETOOTH_BREDR_BB 160
252#define WTAP_ENCAP_BLUETOOTH_LE_LL_WITH_PHDR 161
253#define WTAP_ENCAP_NSTRACE_3_0 162
254#define WTAP_ENCAP_LOGCAT 163
255#define WTAP_ENCAP_LOGCAT_BRIEF 164
256#define WTAP_ENCAP_LOGCAT_PROCESS 165
257#define WTAP_ENCAP_LOGCAT_TAG 166
258#define WTAP_ENCAP_LOGCAT_THREAD 167
259#define WTAP_ENCAP_LOGCAT_TIME 168
260#define WTAP_ENCAP_LOGCAT_THREADTIME 169
261#define WTAP_ENCAP_LOGCAT_LONG 170
262#define WTAP_ENCAP_PKTAP 171
263#define WTAP_ENCAP_EPON 172
264#define WTAP_ENCAP_IPMI_TRACE 173
265#define WTAP_ENCAP_LOOP 174
266#define WTAP_ENCAP_JSON 175
267#define WTAP_ENCAP_NSTRACE_3_5 176
268#define WTAP_ENCAP_ISO14443 177
269#define WTAP_ENCAP_GFP_T 178
270#define WTAP_ENCAP_GFP_F 179
271#define WTAP_ENCAP_IP_OVER_IB_PCAP 180
272#define WTAP_ENCAP_JUNIPER_VN 181
273#define WTAP_ENCAP_USB_DARWIN 182
274#define WTAP_ENCAP_LORATAP 183
275#define WTAP_ENCAP_3MB_ETHERNET 184
276#define WTAP_ENCAP_VSOCK 185
277#define WTAP_ENCAP_NORDIC_BLE 186
278#define WTAP_ENCAP_NETMON_NET_NETEVENT 187
279#define WTAP_ENCAP_NETMON_HEADER 188
280#define WTAP_ENCAP_NETMON_NET_FILTER 189
281#define WTAP_ENCAP_NETMON_NETWORK_INFO_EX 190
282#define WTAP_ENCAP_MA_WFP_CAPTURE_V4 191
283#define WTAP_ENCAP_MA_WFP_CAPTURE_V6 192
284#define WTAP_ENCAP_MA_WFP_CAPTURE_2V4 193
285#define WTAP_ENCAP_MA_WFP_CAPTURE_2V6 194
286#define WTAP_ENCAP_MA_WFP_CAPTURE_AUTH_V4 195
287#define WTAP_ENCAP_MA_WFP_CAPTURE_AUTH_V6 196
288#define WTAP_ENCAP_JUNIPER_ST 197
289#define WTAP_ENCAP_ETHERNET_MPACKET 198
290#define WTAP_ENCAP_DOCSIS31_XRA31 199
291#define WTAP_ENCAP_DPAUXMON 200
292#define WTAP_ENCAP_RUBY_MARSHAL 201
293#define WTAP_ENCAP_RFC7468 202
294#define WTAP_ENCAP_SYSTEMD_JOURNAL 203
295#define WTAP_ENCAP_EBHSCR 204
296#define WTAP_ENCAP_VPP 205
297#define WTAP_ENCAP_IEEE802_15_4_TAP 206
298#define WTAP_ENCAP_LOG_3GPP 207
299#define WTAP_ENCAP_USB_2_0 208
300#define WTAP_ENCAP_MP4 209
301#define WTAP_ENCAP_SLL2 210
302#define WTAP_ENCAP_ZWAVE_SERIAL 211
303#define WTAP_ENCAP_ETW 212
304#define WTAP_ENCAP_ERI_ENB_LOG 213
305#define WTAP_ENCAP_ZBNCP 214
306#define WTAP_ENCAP_USB_2_0_LOW_SPEED 215
307#define WTAP_ENCAP_USB_2_0_FULL_SPEED 216
308#define WTAP_ENCAP_USB_2_0_HIGH_SPEED 217
309#define WTAP_ENCAP_AUTOSAR_DLT 218
310#define WTAP_ENCAP_AUERSWALD_LOG 219
311#define WTAP_ENCAP_ATSC_ALP 220
312#define WTAP_ENCAP_FIRA_UCI 221
313#define WTAP_ENCAP_SILABS_DEBUG_CHANNEL 222
314#define WTAP_ENCAP_MDB 223
315#define WTAP_ENCAP_EMS 224
316#define WTAP_ENCAP_DECT_NR 225
317#define WTAP_ENCAP_MMODULE 226
318#define WTAP_ENCAP_PROCMON 227
322#define WTAP_NUM_ENCAP_TYPES wtap_get_num_encap_types()
325#define WTAP_FILE_TYPE_SUBTYPE_UNKNOWN -1
328#define WTAP_TSPREC_UNKNOWN -2
329#define WTAP_TSPREC_PER_PACKET -1
335#define WTAP_TSPREC_SEC 0
336#define WTAP_TSPREC_100_MSEC 1
337#define WTAP_TSPREC_DSEC 1
338#define WTAP_TSPREC_10_MSEC 2
339#define WTAP_TSPREC_CSEC 2
340#define WTAP_TSPREC_MSEC 3
341#define WTAP_TSPREC_100_USEC 4
342#define WTAP_TSPREC_10_USEC 5
343#define WTAP_TSPREC_USEC 6
344#define WTAP_TSPREC_100_NSEC 7
345#define WTAP_TSPREC_10_NSEC 8
346#define WTAP_TSPREC_NSEC 9
371#define WTAP_MAX_PACKET_SIZE_STANDARD 262144U
372#define WTAP_MAX_PACKET_SIZE_USBPCAP (128U*1024U*1024U)
373#define WTAP_MAX_PACKET_SIZE_EBHSCR (32U*1024U*1024U)
374#define WTAP_MAX_PACKET_SIZE_DBUS (128U*1024U*1024U)
421#define ATM_RAW_CELL 0x01
422#define ATM_NO_HEC 0x02
423#define ATM_AAL2_NOPHDR 0x04
424#define ATM_REASSEMBLY_ERROR 0x08
435#define AAL_SIGNALLING 6
441#define TRAF_UNKNOWN 0
448#define TRAF_IPSILON 7
449#define TRAF_UMTS_FP 8
450#define TRAF_GPRS_NS 9
456#define TRAF_ST_UNKNOWN 0
461#define TRAF_ST_VCMX_802_3_FCS 1
462#define TRAF_ST_VCMX_802_4_FCS 2
463#define TRAF_ST_VCMX_802_5_FCS 3
464#define TRAF_ST_VCMX_FDDI_FCS 4
465#define TRAF_ST_VCMX_802_6_FCS 5
466#define TRAF_ST_VCMX_802_3 7
467#define TRAF_ST_VCMX_802_4 8
468#define TRAF_ST_VCMX_802_5 9
469#define TRAF_ST_VCMX_FDDI 10
470#define TRAF_ST_VCMX_802_6 11
471#define TRAF_ST_VCMX_FRAGMENTS 12
472#define TRAF_ST_VCMX_BPDU 13
477#define TRAF_ST_LANE_LE_CTRL 1
478#define TRAF_ST_LANE_802_3 2
479#define TRAF_ST_LANE_802_5 3
480#define TRAF_ST_LANE_802_3_MC 4
481#define TRAF_ST_LANE_802_5_MC 5
486#define TRAF_ST_IPSILON_FT0 1
487#define TRAF_ST_IPSILON_FT1 2
488#define TRAF_ST_IPSILON_FT2 3
502 uint32_t aal5t_chksum;
508#define ASCEND_MAX_STR_LEN 64
510#define ASCEND_PFX_WDS_X 1
511#define ASCEND_PFX_WDS_R 2
512#define ASCEND_PFX_WDD 3
513#define ASCEND_PFX_ISDN_X 4
514#define ASCEND_PFX_ISDN_R 5
515#define ASCEND_PFX_ETHER 6
519 char user[ASCEND_MAX_STR_LEN];
521 char call_num[ASCEND_MAX_STR_LEN];
559#define PHDR_802_11_PHY_UNKNOWN 0
560#define PHDR_802_11_PHY_11_FHSS 1
561#define PHDR_802_11_PHY_11_IR 2
562#define PHDR_802_11_PHY_11_DSSS 3
563#define PHDR_802_11_PHY_11B 4
564#define PHDR_802_11_PHY_11A 5
565#define PHDR_802_11_PHY_11G 6
566#define PHDR_802_11_PHY_11N 7
567#define PHDR_802_11_PHY_11AC 8
568#define PHDR_802_11_PHY_11AD 9
569#define PHDR_802_11_PHY_11AH 10
570#define PHDR_802_11_PHY_11AX 11
571#define PHDR_802_11_PHY_11BE 12
581 unsigned has_hop_set:1;
582 unsigned has_hop_pattern:1;
583 unsigned has_hop_index:1;
595 unsigned has_short_preamble:1;
605 unsigned has_channel_type:1;
606 unsigned has_turbo_type:1;
608 unsigned channel_type:2;
609 unsigned turbo_type:2;
615#define PHDR_802_11A_CHANNEL_TYPE_NORMAL 0
616#define PHDR_802_11A_CHANNEL_TYPE_HALF_CLOCKED 1
617#define PHDR_802_11A_CHANNEL_TYPE_QUARTER_CLOCKED 2
627#define PHDR_802_11A_TURBO_TYPE_NORMAL 0
628#define PHDR_802_11A_TURBO_TYPE_TURBO 1
629#define PHDR_802_11A_TURBO_TYPE_DYNAMIC_TURBO 2
630#define PHDR_802_11A_TURBO_TYPE_STATIC_TURBO 3
649#define PHDR_802_11G_MODE_NORMAL 0
650#define PHDR_802_11G_MODE_SUPER_G 1
657 unsigned has_mcs_index:1;
658 unsigned has_bandwidth:1;
659 unsigned has_short_gi:1;
660 unsigned has_greenfield:1;
662 unsigned has_stbc_streams:1;
668 unsigned greenfield:1;
670 unsigned stbc_streams:2;
677#define PHDR_802_11_BANDWIDTH_20_MHZ 0
678#define PHDR_802_11_BANDWIDTH_40_MHZ 1
679#define PHDR_802_11_BANDWIDTH_20_20L 2
680#define PHDR_802_11_BANDWIDTH_20_20U 3
681#define PHDR_802_11_BANDWIDTH_80_MHZ 4
682#define PHDR_802_11_BANDWIDTH_40_40L 5
683#define PHDR_802_11_BANDWIDTH_40_40U 6
684#define PHDR_802_11_BANDWIDTH_20LL 7
685#define PHDR_802_11_BANDWIDTH_20LU 8
686#define PHDR_802_11_BANDWIDTH_20UL 9
687#define PHDR_802_11_BANDWIDTH_20UU 10
688#define PHDR_802_11_BANDWIDTH_160_MHZ 11
689#define PHDR_802_11_BANDWIDTH_80_80L 12
690#define PHDR_802_11_BANDWIDTH_80_80U 13
691#define PHDR_802_11_BANDWIDTH_40LL 14
692#define PHDR_802_11_BANDWIDTH_40LU 15
693#define PHDR_802_11_BANDWIDTH_40UL 16
694#define PHDR_802_11_BANDWIDTH_40UU 17
695#define PHDR_802_11_BANDWIDTH_20LLL 18
696#define PHDR_802_11_BANDWIDTH_20LLU 19
697#define PHDR_802_11_BANDWIDTH_20LUL 20
698#define PHDR_802_11_BANDWIDTH_20LUU 21
699#define PHDR_802_11_BANDWIDTH_20ULL 22
700#define PHDR_802_11_BANDWIDTH_20ULU 23
701#define PHDR_802_11_BANDWIDTH_20UUL 24
702#define PHDR_802_11_BANDWIDTH_20UUU 25
710 unsigned has_txop_ps_not_allowed:1;
711 unsigned has_short_gi:1;
712 unsigned has_short_gi_nsym_disambig:1;
713 unsigned has_ldpc_extra_ofdm_symbol:1;
714 unsigned has_beamformed:1;
715 unsigned has_bandwidth:1;
717 unsigned has_group_id:1;
718 unsigned has_partial_aid:1;
721 unsigned txop_ps_not_allowed:1;
723 unsigned short_gi_nsym_disambig:1;
724 unsigned ldpc_extra_ofdm_symbol:1;
725 unsigned beamformed:1;
731 uint16_t partial_aid;
742#define PHDR_802_11AD_MIN_FREQUENCY 57000
743#define PHDR_802_11AD_MAX_FREQUENCY 71000
745#define IS_80211AD(frequency) (((frequency) >= PHDR_802_11AD_MIN_FREQUENCY) &&\
746 ((frequency) <= PHDR_802_11AD_MAX_FREQUENCY))
750 unsigned has_mcs_index:1;
760 unsigned has_mcs_index:1;
774 unsigned sta_id_known:1;
775 unsigned mcs_known:1;
776 unsigned coding_known:1;
777 unsigned rsv_known:1;
778 unsigned nsts_known:1;
780 unsigned spatial_config_known:1;
781 unsigned data_for_this_user:1;
783 unsigned ldpc_coding:1;
791#define PHDR_802_11BE_MAX_USERS 4
794 unsigned has_ru_mru_size:1;
796 unsigned has_bandwidth:1;
799 uint8_t ru_mru_size:4;
830 unsigned decrypted:1;
832 unsigned no_a_msdus:1;
837 unsigned has_channel:1;
838 unsigned has_frequency:1;
839 unsigned has_data_rate:1;
840 unsigned has_signal_percent:1;
841 unsigned has_noise_percent:1;
842 unsigned has_signal_dbm:1;
843 unsigned has_noise_dbm:1;
844 unsigned has_signal_db:1;
845 unsigned has_noise_db:1;
846 unsigned has_tsf_timestamp:1;
847 unsigned has_aggregate_info:1;
848 unsigned has_zero_length_psdu_type:1;
853 uint8_t signal_percent;
854 uint8_t noise_percent;
859 uint64_t tsf_timestamp;
860 uint32_t aggregate_flags;
861 uint32_t aggregate_id;
862 uint8_t zero_length_psdu_type;
868#define PHDR_802_11_LAST_PART_OF_A_MPDU 0x00000001
869#define PHDR_802_11_A_MPDU_DELIM_CRC_ERROR 0x00000002
874#define PHDR_802_11_SOUNDING_PSDU 0
875#define PHDR_802_11_DATA_NOT_CAPTURED 1
876#define PHDR_802_11_0_LENGTH_PSDU_VENDOR_SPECIFIC 0xff
880#define COSINE_MAX_IF_NAME_LEN 128
882#define COSINE_ENCAP_TEST 1
883#define COSINE_ENCAP_PPoATM 2
884#define COSINE_ENCAP_PPoFR 3
885#define COSINE_ENCAP_ATM 4
886#define COSINE_ENCAP_FR 5
887#define COSINE_ENCAP_HDLC 6
888#define COSINE_ENCAP_PPP 7
889#define COSINE_ENCAP_ETH 8
890#define COSINE_ENCAP_UNKNOWN 99
892#define COSINE_DIR_TX 1
893#define COSINE_DIR_RX 2
898 char if_name[COSINE_MAX_IF_NAME_LEN];
911#define IRDA_INCOMING 0x0000
912#define IRDA_OUTGOING 0x0004
917#define IRDA_LOG_MESSAGE 0x0100
918#define IRDA_MISSED_MSG 0x0101
923#define IRDA_CLASS_FRAME 0x0000
924#define IRDA_CLASS_LOG 0x0100
925#define IRDA_CLASS_MASK 0xFF00
943#define MTP2_ANNEX_A_NOT_USED 0
944#define MTP2_ANNEX_A_USED 1
945#define MTP2_ANNEX_A_USED_UNKNOWN 2
949 uint8_t annex_a_used;
950 uint16_t link_number;
983 const char *input_name;
984 const char *stack_file;
988 uint32_t extra_length;
992#define K12_PORT_DS0S 0x00010008
993#define K12_PORT_DS1 0x00100008
994#define K12_PORT_ATMPVC 0x01020000
1020 } inner_pseudo_header;
1047#define MAX_ERF_EHDR 16
1079#define SITA_FRAME_DIR_TXED (0x00)
1080#define SITA_FRAME_DIR_RXED (0x01)
1081#define SITA_FRAME_DIR (0x01)
1082#define SITA_ERROR_NO_BUFFER (0x80)
1084#define SITA_SIG_DSR (0x01)
1085#define SITA_SIG_DTR (0x02)
1086#define SITA_SIG_CTS (0x04)
1087#define SITA_SIG_RTS (0x08)
1088#define SITA_SIG_DCD (0x10)
1089#define SITA_SIG_UNDEF1 (0x20)
1090#define SITA_SIG_UNDEF2 (0x40)
1091#define SITA_SIG_UNDEF3 (0x80)
1093#define SITA_ERROR_TX_UNDERRUN (0x01)
1094#define SITA_ERROR_TX_CTS_LOST (0x02)
1095#define SITA_ERROR_TX_UART_ERROR (0x04)
1096#define SITA_ERROR_TX_RETX_LIMIT (0x08)
1097#define SITA_ERROR_TX_UNDEF1 (0x10)
1098#define SITA_ERROR_TX_UNDEF2 (0x20)
1099#define SITA_ERROR_TX_UNDEF3 (0x40)
1100#define SITA_ERROR_TX_UNDEF4 (0x80)
1102#define SITA_ERROR_RX_FRAMING (0x01)
1103#define SITA_ERROR_RX_PARITY (0x02)
1104#define SITA_ERROR_RX_COLLISION (0x04)
1105#define SITA_ERROR_RX_FRAME_LONG (0x08)
1106#define SITA_ERROR_RX_FRAME_SHORT (0x10)
1107#define SITA_ERROR_RX_UNDEF1 (0x20)
1108#define SITA_ERROR_RX_UNDEF2 (0x40)
1109#define SITA_ERROR_RX_UNDEF3 (0x80)
1111#define SITA_ERROR_RX_NONOCTET_ALIGNED (0x01)
1112#define SITA_ERROR_RX_ABORT (0x02)
1113#define SITA_ERROR_RX_CD_LOST (0x04)
1114#define SITA_ERROR_RX_DPLL (0x08)
1115#define SITA_ERROR_RX_OVERRUN (0x10)
1116#define SITA_ERROR_RX_FRAME_LEN_VIOL (0x20)
1117#define SITA_ERROR_RX_CRC (0x40)
1118#define SITA_ERROR_RX_BREAK (0x80)
1120#define SITA_PROTO_UNUSED (0x00)
1121#define SITA_PROTO_BOP_LAPB (0x01)
1122#define SITA_PROTO_ETHERNET (0x02)
1123#define SITA_PROTO_ASYNC_INTIO (0x03)
1124#define SITA_PROTO_ASYNC_BLKIO (0x04)
1125#define SITA_PROTO_ALC (0x05)
1126#define SITA_PROTO_UTS (0x06)
1127#define SITA_PROTO_PPP_HDLC (0x07)
1128#define SITA_PROTO_SDLC (0x08)
1129#define SITA_PROTO_TOKENRING (0x09)
1130#define SITA_PROTO_I2C (0x10)
1131#define SITA_PROTO_DPM_LINK (0x11)
1132#define SITA_PROTO_BOP_FRL (0x12)
1136 uint8_t sita_signals;
1137 uint8_t sita_errors1;
1138 uint8_t sita_errors2;
1148#define BTHCI_CHANNEL_COMMAND 1
1149#define BTHCI_CHANNEL_ACL 2
1150#define BTHCI_CHANNEL_SCO 3
1151#define BTHCI_CHANNEL_EVENT 4
1152#define BTHCI_CHANNEL_ISO 5
1156 uint16_t adapter_id;
1179 uint32_t tdma_frame;
1184#define GSM_UM_CHANNEL_UNKNOWN 0
1185#define GSM_UM_CHANNEL_BCCH 1
1186#define GSM_UM_CHANNEL_SDCCH 2
1187#define GSM_UM_CHANNEL_SACCH 3
1188#define GSM_UM_CHANNEL_FACCH 4
1189#define GSM_UM_CHANNEL_CCCH 5
1190#define GSM_UM_CHANNEL_RACH 6
1191#define GSM_UM_CHANNEL_AGCH 7
1192#define GSM_UM_CHANNEL_PCH 8
1198 uint8_t nicno_offset;
1202 uint16_t eth_offset;
1204 uint8_t l_pcb_offset;
1206 uint8_t vlantag_offset;
1207 uint8_t coreid_offset;
1208 uint8_t srcnodeid_offset;
1209 uint8_t destnodeid_offset;
1210 uint8_t clflags_offset;
1211 uint8_t src_vmname_len_offset;
1212 uint8_t dst_vmname_len_offset;
1213 uint8_t ns_activity_offset;
1214 uint8_t data_offset;
1223#define LLCP_PHDR_FLAG_SENT 0
1263 bool system_bitness;
1268 const char *pathname;
1360#define REC_TYPE_PACKET 0
1361#define REC_TYPE_FT_SPECIFIC_EVENT 1
1362#define REC_TYPE_FT_SPECIFIC_REPORT 2
1363#define REC_TYPE_SYSCALL 3
1364#define REC_TYPE_SYSTEMD_JOURNAL_EXPORT 4
1365#define REC_TYPE_CUSTOM_BLOCK 5
1372 uint32_t interface_id;
1405#define PACK_FLAGS_DIRECTION_MASK 0x00000003
1406#define PACK_FLAGS_DIRECTION_SHIFT 0
1407#define PACK_FLAGS_DIRECTION(pack_flags) (((pack_flags) & PACK_FLAGS_DIRECTION_MASK) >> PACK_FLAGS_DIRECTION_SHIFT)
1408#define PACK_FLAGS_DIRECTION_UNKNOWN 0
1409#define PACK_FLAGS_DIRECTION_INBOUND 1
1410#define PACK_FLAGS_DIRECTION_OUTBOUND 2
1413#define PACK_FLAGS_RECEPTION_TYPE_MASK 0x0000001C
1414#define PACK_FLAGS_RECEPTION_TYPE_SHIFT 2
1415#define PACK_FLAGS_RECEPTION_TYPE(pack_flags) (((pack_flags) & PACK_FLAGS_RECEPTION_TYPE_MASK) >> PACK_FLAGS_RECEPTION_TYPE_SHIFT)
1416#define PACK_FLAGS_RECEPTION_TYPE_UNSPECIFIED 0
1417#define PACK_FLAGS_RECEPTION_TYPE_UNICAST 1
1418#define PACK_FLAGS_RECEPTION_TYPE_MULTICAST 2
1419#define PACK_FLAGS_RECEPTION_TYPE_BROADCAST 3
1420#define PACK_FLAGS_RECEPTION_TYPE_PROMISCUOUS 4
1423#define PACK_FLAGS_FCS_LENGTH_MASK 0x000001E0
1424#define PACK_FLAGS_FCS_LENGTH_SHIFT 5
1425#define PACK_FLAGS_FCS_LENGTH(pack_flags) (((pack_flags) & PACK_FLAGS_FCS_LENGTH_MASK) >> PACK_FLAGS_FCS_LENGTH_SHIFT)
1428#define PACK_FLAGS_RESERVED_MASK 0x0000FE00
1433#define PACK_FLAGS_CRC_ERROR 0x01000000
1434#define PACK_FLAGS_PACKET_TOO_LONG 0x02000000
1435#define PACK_FLAGS_PACKET_TOO_SHORT 0x04000000
1436#define PACK_FLAGS_WRONG_INTER_FRAME_GAP 0x08000000
1437#define PACK_FLAGS_UNALIGNED_FRAME 0x10000000
1438#define PACK_FLAGS_START_FRAME_DELIMITER_ERROR 0x20000000
1439#define PACK_FLAGS_PREAMBLE_ERROR 0x40000000
1440#define PACK_FLAGS_SYMBOL_ERROR 0x80000000
1443#define PACK_FLAGS_VALUE(direction, reception_type, fcs_length, ll_dependent_errors) \
1444 (((direction) << 30) | \
1445 ((reception_type) << 27) | \
1446 ((fcs_length) << 23) | \
1447 (ll_dependent_errors))
1450 int file_type_subtype;
1451 unsigned record_type;
1452 uint32_t record_len;
1458 const char *pathname;
1459 unsigned record_type;
1465 uint32_t event_data_len;
1468 uint16_t event_type;
1474 uint32_t record_len;
1505#define WTAP_NSTIME_32BIT_SECS_MAX ((time_t)(sizeof(time_t) > sizeof(int32_t) ? UINT32_MAX : INT32_MAX))
1509 uint32_t presence_flags;
1510 unsigned section_number;
1513 const char *rec_type_name;
1533 bool block_was_modified;
1567#define WTAP_HAS_TS 0x00000001
1568#define WTAP_HAS_CAP_LEN 0x00000002
1569#define WTAP_HAS_INTERFACE_ID 0x00000004
1570#define WTAP_HAS_SECTION_NUMBER 0x00000008
1578#define MAXNAMELEN 64
1581#ifndef MAXDNSNAMELEN
1582#define MAXDNSNAMELEN 256
1588 char ip[WS_INET_ADDRSTRLEN];
1589 char name[MAXDNSNAMELEN];
1590 char cidr_addr[WS_INET_CIDRADDRSTRLEN];
1596 char ip6[WS_INET6_ADDRSTRLEN];
1597 char name[MAXDNSNAMELEN];
1650#define WTAP_DUMP_PARAMS_INIT {.snaplen=0}
1671 int (*wslua_can_write_encap)(int,
void*);
1779WS_DLL_PUBLIC
void init_open_routines(
void);
1840#define WTAP_COMMENT_PER_SECTION 0x00000001
1847#define WTAP_COMMENT_PER_INTERFACE 0x00000002
1854#define WTAP_COMMENT_PER_PACKET 0x00000004
1888#define OPTION_TYPES_SUPPORTED(option_type_array) \
1889 array_length(option_type_array), option_type_array
1896#define NO_OPTIONS_SUPPORTED \
1904 BLOCK_NOT_SUPPORTED,
1905 ONE_BLOCK_SUPPORTED,
1906 MULTIPLE_BLOCKS_SUPPORTED
1913 wtap_block_type_t type;
1914 block_support_t support;
1915 size_t num_supported_options;
1919#define BLOCKS_SUPPORTED(block_type_array) \
1920 array_length(block_type_array), block_type_array
1986#define WTAP_TYPE_AUTO 0
1997void wtap_init(
bool load_wiretap_plugins,
const char* app_env_var_prefix,
const struct file_extension_info* file_extensions,
unsigned num_extensions);
2140 int *err,
char **err_info);
2218 unsigned record_type);
2231 unsigned record_type);
2266 uint32_t payload_length,
bool copy_allowed);
2481 const char* line_end);
2710 int *err,
char **err_info);
2748 int *err,
char **err_info);
2764 int *err,
char **err_info);
2785int wtap_dump_file_type_subtype(
const wtap_dumper *wdh);
2787int64_t wtap_get_bytes_dumped(
const wtap_dumper *);
2789void wtap_set_bytes_dumped(
wtap_dumper *wdh, int64_t bytes_dumped);
2796void wtap_dump_discard_name_resolution(
wtap_dumper *wdh);
2798void wtap_dump_discard_decryption_secrets(
wtap_dumper *wdh);
2818 int *err,
char **err_info);
2893 FT_SORT_BY_DESCRIPTION
2914 const GArray *file_encaps, uint32_t required_comment_types,
2915 ft_sort_order sort_order);
3003 wtap_block_type_t type);
3021 wtap_block_type_t type,
unsigned opttype);
3252 void (*register_wtap_module)(void);
3363#define WTAP_ERR_NOT_REGULAR_FILE -1
3366#define WTAP_ERR_RANDOM_OPEN_PIPE -2
3369#define WTAP_ERR_FILE_UNKNOWN_FORMAT -3
3372#define WTAP_ERR_UNSUPPORTED -4
3376#define WTAP_ERR_CANT_WRITE_TO_PIPE -5
3379#define WTAP_ERR_CANT_OPEN -6
3382#define WTAP_ERR_UNWRITABLE_FILE_TYPE -7
3385#define WTAP_ERR_UNWRITABLE_ENCAP -8
3389#define WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED -9
3392#define WTAP_ERR_CANT_WRITE -10
3395#define WTAP_ERR_CANT_CLOSE -11
3398#define WTAP_ERR_SHORT_READ -12
3401#define WTAP_ERR_BAD_FILE -13
3404#define WTAP_ERR_SHORT_WRITE -14
3407#define WTAP_ERR_UNC_OVERFLOW -15
3410#define WTAP_ERR_RANDOM_OPEN_STDIN -16
3413#define WTAP_ERR_COMPRESSION_NOT_SUPPORTED -17
3416#define WTAP_ERR_CANT_SEEK -18
3419#define WTAP_ERR_CANT_SEEK_COMPRESSED -19
3422#define WTAP_ERR_DECOMPRESS -20
3425#define WTAP_ERR_INTERNAL -21
3428#define WTAP_ERR_PACKET_TOO_LARGE -22
3432#define WTAP_ERR_CHECK_WSLUA -23
3436#define WTAP_ERR_UNWRITABLE_REC_TYPE -24
3439#define WTAP_ERR_UNWRITABLE_REC_DATA -25
3442#define WTAP_ERR_DECOMPRESSION_NOT_SUPPORTED -26
3445#define WTAP_ERR_TIME_STAMP_NOT_SUPPORTED -27
3449#define WTAP_ERR_REC_MALFORMED -28
Definition packet-eth.h:15
A dynamic byte buffer with adjustable start and end positions.
Definition buffer.h:30
GList * ipv6_addr_list
Definition wtap.h:1605
GList * ipv4_addr_list
Definition wtap.h:1604
Pseudo-header for Catapult DCT2000 captures.
Definition wtap.h:1015
int64_t seek_off
Definition wtap.h:1022
struct wtap * wth
Definition wtap.h:1023
struct isdn_phdr isdn
Definition wtap.h:1017
struct p2p_phdr p2p
Definition wtap.h:1019
struct atm_phdr atm
Definition wtap.h:1018
Represents a 128-bit IPv6 address.
Definition inet_addr.h:27
Extended pseudo-header for ERF multi-channel (MC) packet records.
Definition wtap.h:1062
struct erf_ehdr ehdr_list[MAX_ERF_EHDR]
Definition wtap.h:1065
struct erf_phdr phdr
Definition wtap.h:1063
uint32_t aal2_hdr
Definition wtap.h:1075
union erf_mc_phdr::@645 subhdr
Protocol-specific subheader union.
uint32_t mc_hdr
Definition wtap.h:1074
For registering extensions used for file formats.
Definition wtap.h:1713
const char * extensions
Definition wtap.h:1716
const char * name
Definition wtap.h:1714
bool is_capture_file
Definition wtap.h:1715
wtap_wslua_file_info_t * wslua_info
Definition wtap.h:1983
const char * name
Definition wtap.h:1932
const char * additional_file_extensions
Definition wtap.h:1946
int(* can_write_encap)(int)
Definition wtap.h:1971
const struct supported_block_type * supported_blocks
Definition wtap.h:1961
bool writing_must_seek
Definition wtap.h:1951
const char * description
Definition wtap.h:1926
bool(* dump_open)(wtap_dumper *, int *, char **)
Definition wtap.h:1977
size_t num_supported_blocks
Definition wtap.h:1956
const char * default_file_extension
Definition wtap.h:1938
LAPD pseudo-header for packet metadata.
Definition wtap.h:1003
uint8_t we_network
Definition wtap.h:1005
uint16_t pkttype
Definition wtap.h:1004
Pseudo-header metadata for packets captured in NetMon (Network Monitor) files.
Definition wtap.h:1241
unsigned sub_encap
Definition wtap.h:1246
uint8_t * description
Definition wtap.h:1244
uint8_t * title
Definition wtap.h:1242
uint32_t descLength
Definition wtap.h:1243
Information about a given file type that applies to all subtypes of the file type.
Definition wtap.h:1815
const char * name
Definition wtap.h:1816
wtap_open_routine_t open_routine
Definition wtap.h:1818
void * wslua_data
Definition wtap.h:1821
const char * extensions
Definition wtap.h:1819
wtap_open_type type
Definition wtap.h:1817
char ** extensions_set
Definition wtap.h:1820
Entry describing support level for a specific option type.
Definition wtap.h:1878
unsigned opt
Definition wtap.h:1879
option_support_t support
Definition wtap.h:1880
Definition wtap_opttypes.h:272
const GArray * nrbs_growing
Definition wtap.h:1633
const GArray * dsbs_growing
Definition wtap.h:1637
int tsprec
Definition wtap.h:1627
GArray * shb_hdrs
Definition wtap.h:1628
int encap
Definition wtap.h:1625
bool dont_copy_idbs
Definition wtap.h:1646
GArray * dsbs_initial
Definition wtap.h:1636
wtapng_iface_descriptions_t * idb_inf
Definition wtap.h:1632
const GArray * mevs_growing
Definition wtap.h:1640
const GArray * shb_iface_to_global
Definition wtap.h:1629
const GArray * dpibs_growing
Definition wtap.h:1643
int snaplen
Definition wtap.h:1626
Wiretap dumper handle and associated state.
Definition wtap_module.h:163
Plugin registration callback table.
Definition wtap.h:3251
Definition file_wrappers.c:97
Definition wtap_module.h:58
wtap_new_secrets_callback_t add_new_secrets
Definition wtap_module.h:113
const char * app_env_var_prefix
Definition wtap_module.h:74
int file_type_subtype
Definition wtap_module.h:62
wtap_new_ipv4_callback_t add_new_ipv4
Definition wtap_module.h:111
wtap_new_ipv6_callback_t add_new_ipv6
Definition wtap_module.h:112
Definition wtap_opttypes.h:308
Definition wtap_opttypes.h:300
Union representing physical layer information for IEEE 802.11 variants.
Definition wtap.h:816
struct ieee_802_11_fhss info_11_fhss
Definition wtap.h:817
struct ieee_802_11ac info_11ac
Definition wtap.h:822
struct ieee_802_11n info_11n
Definition wtap.h:821
struct ieee_802_11g info_11g
Definition wtap.h:820
struct ieee_802_11ax info_11ax
Definition wtap.h:824
struct ieee_802_11b info_11b
Definition wtap.h:818
struct ieee_802_11be info_11be
Definition wtap.h:825
struct ieee_802_11ad info_11ad
Definition wtap.h:823
struct ieee_802_11a info_11a
Definition wtap.h:819
WS_DLL_PUBLIC bool wtap_dump_can_open(int filetype)
Check if a file type can be opened for dumping.
Definition file_access.c:2068
WS_DLL_PUBLIC void wtap_buffer_append_epdu_tag(Buffer *buf, uint16_t epdu_tag, const uint8_t *data, uint16_t data_len)
Generates arbitrary packet data in "exported PDU" format and appends it to buf.
Definition wtap.c:2196
WS_DLL_PUBLIC GSList * wtap_get_all_file_extensions_list(void)
Return a list of all extensions that are used by all file types that we can read, including compresse...
Definition file_access.c:2012
WS_DLL_PUBLIC wtap_dumper * wtap_dump_open(const char *filename, int file_type_subtype, ws_compression_type compression_type, const wtap_dump_params *params, int *err, char **err_info)
Opens a new capture file for writing.
Definition file_access.c:2239
void(* wtap_new_secrets_callback_t)(uint32_t secrets_type, const void *secrets, unsigned size)
Callback type for receiving new decryption secrets.
Definition wtap.h:2089
WS_DLL_PUBLIC int wtap_register_file_type_subtype(const struct file_type_subtype_info *fi)
Register a file type/subtype.
Definition file_access.c:1172
WS_DLL_PUBLIC int64_t wtap_file_size(wtap *wth, int *err)
Get the size of the capture file.
Definition wtap.c:81
WS_DLL_PUBLIC GSList * wtap_get_all_capture_file_extensions_list(void)
Return a list of all extensions that are used by all capture file types, including compressed extensi...
Definition file_access.c:1963
WS_DLL_PUBLIC wtap_dumper * wtap_dump_open_tempfile(const char *tmpdir, char **filenamep, const char *pfx, int file_type_subtype, ws_compression_type compression_type, const wtap_dump_params *params, int *err, char **err_info)
Creates a dumper for a temporary file.
Definition file_access.c:2278
option_support_t
Indicates how a file format supports a given option type.
Definition wtap.h:1866
@ MULTIPLE_OPTIONS_SUPPORTED
Definition wtap.h:1869
@ OPTION_NOT_SUPPORTED
Definition wtap.h:1867
@ ONE_OPTION_SUPPORTED
Definition wtap.h:1868
WS_DLL_PUBLIC GSList * wtap_get_file_extensions_list(int file_type_subtype, bool include_compressed)
Return a list of file extensions that are used by the specified file type and subtype.
Definition file_access.c:1906
WS_DLL_PUBLIC GArray * wtap_get_savable_file_types_subtypes_for_file(int file_type_subtype, const GArray *file_encaps, uint32_t required_comment_types, ft_sort_order sort_order)
Get savable file type/subtype candidates for saving a capture file.
Definition file_access.c:1455
WS_DLL_PUBLIC char * wtap_unwritable_rec_type_err_string(const wtap_rec *rec)
Return an error string for WTAP_ERR_UNWRITABLE_REC_TYPE.
Definition wtap.c:1779
WS_DLL_PUBLIC int wtap_plugins_supported(void)
Query whether libwiretap plugin loading is available.
Definition wtap.c:57
WS_DLL_PUBLIC const char * wtap_encap_description(int encap)
Get a human-readable description for an encapsulation type.
Definition wtap.c:1404
WS_DLL_PUBLIC wtap_block_t wtap_file_get_shb(wtap *wth, unsigned shb_num)
Gets existing section header block, not for new file.
Definition wtap.c:146
WS_DLL_PUBLIC const char * wtap_file_type_subtype_description(int file_type_subtype)
Get a human-readable description for a file type/subtype.
Definition file_access.c:1631
WS_DLL_PUBLIC void wtap_dump_params_cleanup(wtap_dump_params *params)
Free memory associated with the wtap_dump_params when it is no longer in use by wtap_dumper.
Definition wtap.c:644
void(* wtap_new_ipv6_callback_t)(const ws_in6_addr *addrp, const char *name, const bool static_entry)
Callback type for registering new IPv6 hostnames.
Definition wtap.h:2065
WS_DLL_PUBLIC wtapng_iface_descriptions_t * wtap_file_get_idb_info(wtap *wth)
Gets existing interface descriptions.
Definition wtap.c:198
WS_DLL_PUBLIC void wtap_setup_packet_rec(wtap_rec *rec, int encap)
Set up a wtap_rec for a packet (REC_TYPE_PACKET).
Definition wtap.c:1789
WS_DLL_PUBLIC GSList * wtap_get_file_extension_type_extensions(unsigned extension_type)
Get the list of extensions for a file extension type.
Definition file_access.c:207
WS_DLL_PUBLIC void wtap_deregister_open_info(const char *name)
Deregister an open_info handler by name.
Definition file_access.c:498
WS_DLL_PUBLIC bool wtap_dump_close(wtap_dumper *wdh, bool *needs_reload, int *err, char **err_info)
Definition file_access.c:2577
WS_DLL_PUBLIC wtap_block_t wtap_get_next_interface_description(wtap *wth)
Gets next interface description.
Definition wtap.c:221
WS_DLL_PUBLIC bool wtap_read(wtap *wth, wtap_rec *rec, int *err, char **err_info, int64_t *offset)
Read the next record in the file, filling in *phdr and *buf.
Definition wtap.c:1850
WS_DLL_PUBLIC void wtap_buffer_append_epdu_string(Buffer *buf, uint16_t epdu_tag, const char *val)
Generates packet data for a string in "exported PDU" format. For filetype readers to transform non-pa...
Definition wtap.c:2243
WS_DLL_PUBLIC void wtap_free_idb_info(wtapng_iface_descriptions_t *idb_info)
Free's a interface description block and all of its members.
Definition wtap.c:396
WS_DLL_PUBLIC struct wtap * wtap_open_offline(const char *filename, unsigned int type, int *err, char **err_info, bool do_random, const char *app_env_var_prefix)
Open a capture file for offline analysis.
Definition file_access.c:846
WS_DLL_PUBLIC int wtap_file_type_subtype(wtap *wth)
Get the file type subtype.
Definition wtap.c:104
WS_DLL_PUBLIC void wtap_register_file_type_extension(const struct file_extension_info *ei)
Register file extension information for a file type.
Definition file_access.c:151
WS_DLL_PUBLIC struct open_info * open_routines
Table of registered wiretap file open handlers.
Definition wtap.h:1830
WS_DLL_PUBLIC const char * wtap_get_file_extension_type_name(int extension_type)
Get the short name for a file extension type.
Definition file_access.c:165
WS_DLL_PUBLIC bool wtap_dump_add_idb(wtap_dumper *wdh, wtap_block_t idb, int *err, char **err_info)
Add an IDB to the list of IDBs for a file we're writing. Makes a copy of the IDB, so it can be freed ...
Definition file_access.c:2510
wtap_open_type
Strategy used to identify a file format.
Definition wtap.h:1774
@ OPEN_INFO_MAGIC
Definition wtap.h:1775
@ OPEN_INFO_HEURISTIC
Definition wtap.h:1776
WS_DLL_PUBLIC void wtap_dump_params_discard_decryption_secrets(wtap_dump_params *params)
Remove any decryption secret information from the per-file information; used if we're stripping decry...
Definition wtap.c:631
WS_DLL_PUBLIC void wtap_fdclose(wtap *wth)
Close all file descriptors for the current wiretap file.
Definition wtap.c:1597
wtap_open_return_val
For registering file types that we can open.
Definition wtap.h:1745
@ WTAP_OPEN_MINE
Definition wtap.h:1747
@ WTAP_OPEN_NOT_MINE
Definition wtap.h:1746
@ WTAP_OPEN_ERROR
Definition wtap.h:1748
WS_DLL_PUBLIC void wtap_rec_reset(wtap_rec *rec)
Re-initialize a wtap_rec structure.
Definition wtap.c:2034
WS_DLL_PUBLIC bool wtap_has_open_info(const char *name)
Check if an open_info handler with the given name is registered.
Definition file_access.c:522
WS_DLL_PUBLIC int wtap_dump_required_file_encap_type(const GArray *file_encaps)
Determine the required per-file encapsulation type.
Definition file_access.c:1289
WS_DLL_PUBLIC int wtap_file_encap(wtap *wth)
Get the encapsulation type for the capture file.
Definition wtap.c:116
WS_DLL_PUBLIC void wtap_dump_params_discard_name_resolution(wtap_dump_params *params)
Remove any name resolution information from the per-file information; used if we're stripping name re...
Definition wtap.c:625
WS_DLL_PUBLIC wtap_dumper * wtap_dump_open_stdout(int file_type_subtype, ws_compression_type compression_type, const wtap_dump_params *params, int *err, char **err_info)
Creates a dumper for the standard output.
Definition file_access.c:2375
WS_DLL_PUBLIC void wtap_dump_params_init_no_idbs(wtap_dump_params *params, wtap *wth)
Initialize the per-file information based on an existing file, but don't copy over the interface info...
Definition wtap.c:602
WS_DLL_PUBLIC wtap_dumper * wtap_dump_fdopen(int fd, int file_type_subtype, ws_compression_type compression_type, const wtap_dump_params *params, int *err, char **err_info)
Creates a dumper for an existing file descriptor.
Definition file_access.c:2340
WS_DLL_PUBLIC void wtap_buffer_append_epdu_uint(Buffer *buf, uint16_t epdu_tag, uint32_t val)
Generates packet data for an unsigned integer in "exported PDU" format. For filetype readers to trans...
Definition wtap.c:2227
WS_DLL_PUBLIC const nstime_t * wtap_file_start_ts(wtap *wth)
Get the start timestamp of the capture file.
Definition wtap.c:128
WS_DLL_PUBLIC int wtap_get_num_file_type_extensions(void)
Return the number of registered file type extension groups.
Definition file_access.c:159
WS_DLL_PUBLIC void wtap_setup_custom_block_rec(wtap_rec *rec, uint32_t pen, uint32_t payload_length, bool copy_allowed)
Set up a wtap_rec for a custom block.
Definition wtap.c:1839
WS_DLL_PUBLIC const char * wtap_strerror(int err)
Return a human-readable error string for a WTAP error code.
Definition wtap.c:1546
WS_DLL_PUBLIC unsigned wtap_file_get_shb_global_interface_id(wtap *wth, unsigned shb_num, uint32_t interface_id)
Gets the unique interface id for a SHB's interface.
Definition wtap.c:155
WS_DLL_PUBLIC unsigned wtap_file_get_num_shbs(wtap *wth)
Gets number of section header blocks.
Definition wtap.c:140
WS_DLL_PUBLIC void wtap_register_plugin(const wtap_plugin *plug)
Register a wiretap plugin.
WS_DLL_PUBLIC void wtap_deregister_file_type_subtype(const int file_type_subtype)
Deregister a previously registered file type/subtype.
Definition file_access.c:1249
WS_DLL_PUBLIC void wtap_dump_params_init(wtap_dump_params *params, wtap *wth)
Initialize the per-file information based on an existing file.
Definition wtap.c:575
WS_DLL_PUBLIC void wtap_free_extensions_list(GSList *extensions)
Free a list of file extension strings returned by extension helpers.
Definition file_access.c:2039
WS_DLL_PUBLIC bool wtap_uses_lua_filehandler(const wtap *wth)
Check whether a wtap handle uses a Lua-based file handler.
Definition file_access.c:542
WS_DLL_PUBLIC void wtap_write_shb_comment(wtap *wth, char *comment)
Sets or replaces the section header comment.
Definition wtap.c:190
WS_DLL_PUBLIC int64_t wtap_read_so_far(wtap *wth)
Return an approximation of the amount of data read sequentially.
Definition wtap.c:1988
WS_DLL_PUBLIC void wtap_file_add_decryption_secrets(wtap *wth, const wtap_block_t dsb)
Adds a Decryption Secrets Block to the open wiretap session.
Definition wtap.c:262
WS_DLL_PUBLIC void wtap_set_cb_new_secrets(wtap *wth, wtap_new_secrets_callback_t add_new_secrets)
Set the callback for receiving new decryption secrets.
Definition wtap.c:1718
WS_DLL_PUBLIC void wtap_setup_systemd_journal_export_rec(wtap_rec *rec)
Set up a wtap_rec for a systemd journal export entry.
Definition wtap.c:1829
WS_DLL_PUBLIC void wtap_cleanup(void)
Clean up libwiretap internal registrations and plugin state.
Definition wtap.c:2296
WS_DLL_PUBLIC int wtap_pcapng_file_type_subtype(void)
Get the file type/subtype identifier for pcapng.
Definition file_access.c:1728
void cleanup_open_routines(void)
Clean up registered file open routines.
Definition file_access.c:2838
WS_DLL_PUBLIC void wtap_cleareof(wtap *wth)
Clear EOF status for a wiretap file.
Definition wtap.c:1637
struct addrinfo_lists addrinfo_lists_t
WS_DLL_PUBLIC const nstime_t * wtap_file_end_ts(wtap *wth)
Get the end timestamp of the capture file.
Definition wtap.c:134
WS_DLL_PUBLIC unsigned wtap_file_get_num_dsbs(wtap *wth)
Gets number of decryption secrets blocks.
Definition wtap.c:244
WS_DLL_PUBLIC ws_compression_type wtap_get_compression_type(wtap *wth)
Get the compression type used for the capture file.
Definition file_wrappers.c:47
WS_DLL_PUBLIC int wtap_pcap_nsec_file_type_subtype(void)
Get the file type/subtype identifier for pcap with nanosecond timestamps.
Definition file_access.c:1714
WS_DLL_PUBLIC void wtap_close(wtap *wth)
Fully close the wiretap file and release all resources.
Definition wtap.c:1606
WS_DLL_PUBLIC void wtap_setup_syscall_rec(wtap_rec *rec)
Set up a wtap_rec for a system call.
Definition pcapng-sysdig.c:40
WS_DLL_PUBLIC void wtap_rec_apply_snapshot(wtap_rec *rec, uint32_t snaplen)
Apply a snapshot length to a wtap_rec.
Definition wtap.c:2008
WS_DLL_PUBLIC int wtap_file_tsprec(wtap *wth)
Get the timestamp precision for the capture file.
Definition wtap.c:122
WS_DLL_PUBLIC void wtap_init(bool load_wiretap_plugins, const char *app_env_var_prefix, const struct file_extension_info *file_extensions, unsigned num_extensions)
Initialize the Wiretap library.
Definition wtap.c:2277
WS_DLL_PUBLIC bool wtap_dump_can_write_encap(int file_type_subtype, int encap)
Check if a file type/subtype supports writing a given encapsulation.
Definition file_access.c:1302
WS_DLL_PUBLIC bool wtap_dump_can_write(const GArray *file_encaps, uint32_t required_comment_types)
Determine whether a capture file can be written with the specified options.
Definition file_access.c:1404
WS_DLL_PUBLIC const char * wtap_file_type_subtype_name(int file_type_subtype)
Get a short name for a file type/subtype.
Definition file_access.c:1644
WS_DLL_PUBLIC void wtap_setup_ft_specific_report_rec(wtap_rec *rec, int file_type_subtype, unsigned record_type)
Set up a wtap_rec for a file-type specific report.
Definition wtap.c:1815
WS_DLL_PUBLIC int wtap_get_num_encap_types(void)
Return the number of known encapsulation types.
Definition wtap.c:1370
WS_DLL_PUBLIC void wtap_rec_cleanup(wtap_rec *rec)
Clean up a wtap_rec structure.
Definition wtap.c:2043
WS_DLL_PUBLIC const char * wtap_tsprec_string(int tsprec)
Convert a timestamp precision constant to a string.
Definition wtap.c:1447
WS_DLL_PUBLIC unsigned int open_info_name_to_type(const char *name)
Convert an open_info short name to its numeric type.
Definition file_access.c:580
WS_DLL_PUBLIC wtap_block_t wtap_file_get_dsb(wtap *wth, unsigned dsb_num)
Gets existing decryption secrets block, not for new file.
Definition wtap.c:253
WS_DLL_PUBLIC bool wtap_dump_can_compress(int file_type_subtype)
Check if a file type/subtype supports compression.
Definition file_access.c:2100
WS_DLL_PUBLIC unsigned wtap_snapshot_length(wtap *wth)
Get the snapshot length for the capture file.
Definition wtap.c:110
WS_DLL_PUBLIC bool wtap_fdreopen(wtap *wth, const char *filename, int *err)
Reopen the random-access file descriptor for the current file.
Definition file_access.c:1031
WS_DLL_PUBLIC void wtap_rec_init(wtap_rec *rec, size_t space)
Initialize a wtap_rec structure.
Definition wtap.c:1995
WS_DLL_PUBLIC bool wtap_file_discard_decryption_secrets(wtap *wth)
Remove any decryption secret information from the per-file information; used if we're stripping decry...
Definition wtap.c:271
WS_DLL_PUBLIC void wtap_setup_ft_specific_event_rec(wtap_rec *rec, int file_type_subtype, unsigned record_type)
Set up a wtap_rec for a file-type specific event.
Definition wtap.c:1801
WS_DLL_PUBLIC void wtap_set_cb_new_ipv6(wtap *wth, wtap_new_ipv6_callback_t add_new_ipv6)
Set the callback for adding new IPv6 hostnames.
Definition wtap.c:1691
WS_DLL_PUBLIC const char * wtap_default_file_extension(int file_type_subtype)
Get the default file extension for a file type/subtype.
Definition file_access.c:2055
WS_DLL_PUBLIC int wtap_pcap_file_type_subtype(void)
Get the file type/subtype identifier for classic pcap (microsecond timestamps).
Definition file_access.c:1700
WS_DLL_PUBLIC void wtap_register_open_info(struct open_info *oi, const bool first_routine)
Register an open_info probe/open handler.
Definition file_access.c:462
WS_DLL_PUBLIC int wtap_buffer_append_epdu_end(Buffer *buf)
Close off a set of "exported PDUs" added to the buffer. For filetype readers to transform non-packeti...
Definition wtap.c:2260
WS_DLL_PUBLIC block_support_t wtap_file_type_subtype_supports_block(int file_type_subtype, wtap_block_type_t type)
Determine whether a capture file format supports a given block type.
Definition file_access.c:1742
WS_DLL_PUBLIC GArray * wtap_get_writable_file_types_subtypes(ft_sort_order sort_order)
Get a list of all writable file type/subtype values.
Definition file_access.c:1567
WS_DLL_PUBLIC const char * wtap_encap_name(int encap)
Get a short name for an encapsulation type.
Definition wtap.c:1390
WS_DLL_PUBLIC int wtap_register_encap_type(const char *description, const char *name)
Register a new packet encapsulation type.
Definition wtap.c:1376
WS_DLL_PUBLIC char * wtap_get_debug_if_descr(const wtap_block_t if_descr, const int indent, const char *line_end)
Gets a debug string of an interface description.
Definition wtap.c:406
WS_DLL_PUBLIC wtap_block_t wtap_file_get_nrb(wtap *wth)
Gets existing name resolution block, not for new file.
Definition wtap.c:545
WS_DLL_PUBLIC void wtap_set_cb_new_ipv4(wtap *wth, wtap_new_ipv4_callback_t add_new_ipv4)
Set the callback for adding new IPv4 hostnames.
Definition wtap.c:1671
WS_DLL_PUBLIC int wtap_name_to_file_type_subtype(const char *name)
Convert a file type/subtype name to its identifier.
Definition file_access.c:1668
WS_DLL_PUBLIC void wtap_sequential_close(wtap *wth)
Close the sequential-access side of the file.
Definition wtap.c:1573
void(* wtap_new_ipv4_callback_t)(const unsigned addr, const char *name, const bool static_entry)
Callback type for registering new IPv4 hostnames.
Definition wtap.h:2041
WS_DLL_PUBLIC option_support_t wtap_file_type_subtype_supports_option(int file_type_subtype, wtap_block_type_t type, unsigned opttype)
Determine whether a capture file format supports a specific option for a block.
Definition file_access.c:1777
WS_DLL_PUBLIC int wtap_name_to_encap(const char *short_name)
Convert a short encapsulation name to its WTAP_ENCAP_ value.
Definition wtap.c:1418
WS_DLL_PUBLIC bool wtap_seek_read(wtap *wth, int64_t seek_off, wtap_rec *rec, int *err, char **err_info)
Read the record at a specified offset in a capture file, filling in *phdr and *buf.
Definition wtap.c:2065