/src/wireshark/epan/dissectors/file-blf.c
Line | Count | Source |
1 | | /* file-blf.c |
2 | | * BLF File Format. |
3 | | * By Dr. Lars Völker <lars.voelker@technica-engineering.de> |
4 | | * Copyright 2020-2025 Dr. Lars Völker |
5 | | * |
6 | | * Wireshark - Network traffic analyzer |
7 | | * By Gerald Combs <gerald@wireshark.org> |
8 | | * Copyright 1998 Gerald Combs |
9 | | * |
10 | | * SPDX-License-Identifier: GPL-2.0-or-later |
11 | | * |
12 | | * This dissector allows to parse BLF files. |
13 | | */ |
14 | | |
15 | | /* |
16 | | * The following was used as a reference for the file format: |
17 | | * https://bitbucket.org/tobylorenz/vector_blf |
18 | | * The repo above includes multiple examples files as well. |
19 | | */ |
20 | | |
21 | | #include "config.h" |
22 | | |
23 | | #include <epan/packet.h> |
24 | | #include <epan/expert.h> |
25 | | #include <epan/unit_strings.h> |
26 | | #include <epan/dissectors/packet-socketcan.h> |
27 | | |
28 | | #include <wiretap/blf.h> |
29 | | #include <wsutil/array.h> |
30 | | |
31 | | static int proto_blf; |
32 | | static int proto_blf_ethernetstatus_obj; |
33 | | static int proto_blf_ethernetphystate_obj; |
34 | | |
35 | | static dissector_handle_t xml_handle; |
36 | | |
37 | | static int hf_blf_file_header; |
38 | | static int hf_blf_file_header_magic; |
39 | | static int hf_blf_file_header_length; |
40 | | static int hf_blf_file_header_api; |
41 | | static int hf_blf_file_header_app; |
42 | | static int hf_blf_file_header_comp_level; |
43 | | static int hf_blf_file_header_app_major; |
44 | | static int hf_blf_file_header_app_minor; |
45 | | static int hf_blf_file_header_len_comp; |
46 | | static int hf_blf_file_header_len_uncomp; |
47 | | static int hf_blf_file_header_obj_count; |
48 | | static int hf_blf_file_header_app_build; |
49 | | static int hf_blf_file_header_start_date; |
50 | | static int hf_blf_file_header_end_date; |
51 | | static int hf_blf_file_header_restore_point_offset; |
52 | | |
53 | | static int hf_blf_lobj; |
54 | | static int hf_blf_lobj_hdr; |
55 | | static int hf_blf_lobj_magic; |
56 | | static int hf_blf_lobj_hdr_len; |
57 | | static int hf_blf_lobj_hdr_type; |
58 | | static int hf_blf_lobj_obj_len; |
59 | | static int hf_blf_lobj_obj_type; |
60 | | static int hf_blf_lobj_obj_flags; |
61 | | static int hf_blf_lobj_obj_flags_time_ten_ms; |
62 | | static int hf_blf_lobj_obj_flags_time_one_ns; |
63 | | static int hf_blf_lobj_client_index; |
64 | | static int hf_blf_lobj_time_stamp_status; |
65 | | static int hf_blf_lobj_reserved; |
66 | | static int hf_blf_lobj_obj_version; |
67 | | static int hf_blf_lobj_obj_timestamp; |
68 | | static int hf_blf_lobj_org_timestamp; |
69 | | static int hf_blf_lobj_hdr_remains; |
70 | | static int hf_blf_lobj_payload; |
71 | | static int hf_blf_lobj_payload_channel_8bit; |
72 | | static int hf_blf_lobj_payload_channel_16bit; |
73 | | |
74 | | static int hf_blf_cont_comp_method; |
75 | | static int hf_blf_cont_res1; |
76 | | static int hf_blf_cont_res2; |
77 | | static int hf_blf_cont_uncomp_size; |
78 | | static int hf_blf_cont_res4; |
79 | | static int hf_blf_cont_payload; |
80 | | |
81 | | static int hf_blf_app_text_source; |
82 | | static int hf_blf_app_text_reservedapptext1; |
83 | | static int hf_blf_app_text_textlength; |
84 | | static int hf_blf_app_text_reservedapptext2; |
85 | | static int hf_blf_app_text_data_version; |
86 | | static int hf_blf_app_text_channelno; |
87 | | static int hf_blf_app_text_busstype; |
88 | | static int hf_blf_app_text_can_fd_channel; |
89 | | static int hf_blf_app_text_metadata_remaining_length; |
90 | | static int hf_blf_app_text_metadata_type; |
91 | | static int hf_blf_app_text_traceline_source; |
92 | | static int hf_blf_app_text_traceline_display_in_tracewindow; |
93 | | static int hf_blf_app_text_traceline_ascii_conversion_wo_comment_indicator_timestamp; |
94 | | static int hf_blf_app_text_text; |
95 | | static int hf_blf_trigg_cond_state; |
96 | | static int hf_blf_trigg_cond_triggerblocknamelength; |
97 | | static int hf_blf_trigg_cond_triggerconditionlength; |
98 | | static int hf_blf_trigg_cond_triggerblockname; |
99 | | static int hf_blf_trigg_cond_triggercondition; |
100 | | static int hf_blf_sys_var_type; |
101 | | static int hf_blf_sys_var_rep; |
102 | | static int hf_blf_sys_var_reservedsystemvariable1; |
103 | | static int hf_blf_sys_var_namelength; |
104 | | static int hf_blf_sys_var_datalength; |
105 | | static int hf_blf_sys_var_reservedsystemvariable2; |
106 | | static int hf_blf_sys_var_name; |
107 | | static int hf_blf_sys_var_data; |
108 | | static int hf_blf_eth_status_channel; |
109 | | static int hf_blf_eth_status_flags1_b0; |
110 | | static int hf_blf_eth_status_flags1_b1; |
111 | | static int hf_blf_eth_status_flags1_b2; |
112 | | static int hf_blf_eth_status_flags1_b3; |
113 | | static int hf_blf_eth_status_flags1_b4; |
114 | | static int hf_blf_eth_status_flags1_b5; |
115 | | static int hf_blf_eth_status_flags1_b6; |
116 | | static int hf_blf_eth_status_flags1_b7; |
117 | | static int hf_blf_eth_status_flags1_b8; |
118 | | static int hf_blf_eth_status_flags1_b9; |
119 | | |
120 | | static int hf_blf_eth_status_linkstatus; |
121 | | static int hf_blf_eth_status_ethernetphy; |
122 | | static int hf_blf_eth_status_duplex; |
123 | | static int hf_blf_eth_status_mdi; |
124 | | static int hf_blf_eth_status_connector; |
125 | | static int hf_blf_eth_status_clockmode; |
126 | | static int hf_blf_eth_status_pairs; |
127 | | static int hf_blf_eth_status_hardwarechannel; |
128 | | static int hf_blf_eth_status_bitrate; |
129 | | static int hf_blf_eth_status_linkupduration; |
130 | | static int hf_blf_eth_frame_ext_structlength; |
131 | | static int hf_blf_eth_frame_ext_flags; |
132 | | static int hf_blf_eth_frame_ext_channel; |
133 | | static int hf_blf_eth_frame_ext_hardwarechannel; |
134 | | static int hf_blf_eth_frame_ext_frameduration; |
135 | | static int hf_blf_eth_frame_ext_framechecksum; |
136 | | static int hf_blf_eth_frame_ext_dir; |
137 | | static int hf_blf_eth_frame_ext_framelength; |
138 | | static int hf_blf_eth_frame_ext_framehandle; |
139 | | static int hf_blf_eth_frame_ext_reservedethernetframeex; |
140 | | |
141 | | static int hf_blf_eth_phystate_channel; |
142 | | static int hf_blf_eth_phy_state_flags1_b0; |
143 | | static int hf_blf_eth_phy_state_flags1_b1; |
144 | | static int hf_blf_eth_phy_state_flags1_b2; |
145 | | static int hf_blf_eth_phy_state_phystate; |
146 | | static int hf_blf_eth_phy_state_eventstate; |
147 | | static int hf_blf_eth_phy_state_hardwarechannel; |
148 | | static int hf_blf_eth_phy_state_res1; |
149 | | |
150 | | static int hf_blf_canxl_tx_count_number; |
151 | | static int hf_blf_canxl_tx_count_attempts; |
152 | | static int hf_blf_canxl_tx_dir; |
153 | | static int hf_blf_canxl_res1; |
154 | | static int hf_blf_canxl_frame_duration_in_ns; |
155 | | static int hf_blf_canxl_bit_count; |
156 | | static int hf_blf_canxl_res2; |
157 | | static int hf_blf_canxl_id; |
158 | | static int hf_blf_canxl_sdt; |
159 | | static int hf_blf_canxl_res3; |
160 | | static int hf_blf_canxl_dlc; |
161 | | static int hf_blf_canxl_data_length; |
162 | | static int hf_blf_canxl_sbc; |
163 | | static int hf_blf_canxl_pcrc; |
164 | | static int hf_blf_canxl_vcid; |
165 | | static int hf_blf_canxl_res4; |
166 | | static int hf_blf_canxl_af; |
167 | | static int hf_blf_canxl_stuff_count; |
168 | | static int hf_blf_canxl_res5; |
169 | | static int hf_blf_canxl_res6; |
170 | | static int hf_blf_canxl_fcrc; |
171 | | static int hf_blf_canxl_time_offset_brs; |
172 | | static int hf_blf_canxl_time_offset_crc_delim; |
173 | | static int hf_blf_canxl_flags; |
174 | | static int hf_blf_canxl_res; |
175 | | static int hf_blf_canxl_arbitration_data_bit_timing; |
176 | | static int hf_blf_canxl_arbitration_data_hardware_channel_setting; |
177 | | static int hf_blf_canxl_fd_phase_bit_timing; |
178 | | static int hf_blf_canxl_fd_phasea_hardware_channel_setting; |
179 | | static int hf_blf_canxl_xl_phase_bit_timing; |
180 | | static int hf_blf_canxl_xl_phase_hardware_channel_setting; |
181 | | static int hf_blf_canxl_data; |
182 | | |
183 | | static expert_field ei_blf_file_header_length_too_short; |
184 | | static expert_field ei_blf_object_header_length_too_short; |
185 | | static expert_field ei_blf_object_length_less_than_header_length; |
186 | | |
187 | | static int ett_blf; |
188 | | static int ett_blf_header; |
189 | | static int ett_blf_obj; |
190 | | static int ett_blf_obj_header; |
191 | | static int ett_blf_obj_header_flags; |
192 | | static int ett_blf_obj_payload; |
193 | | static int ett_blf_logcontainer_payload; |
194 | | static int ett_blf_app_text_payload; |
195 | | |
196 | | static const value_string blf_object_names[] = { |
197 | | { BLF_OBJTYPE_UNKNOWN, "Unknown" }, |
198 | | { BLF_OBJTYPE_CAN_MESSAGE, "CAN Message" }, |
199 | | { BLF_OBJTYPE_CAN_ERROR, "CAN Error" }, |
200 | | { BLF_OBJTYPE_CAN_OVERLOAD, "CAN Overload" }, |
201 | | { BLF_OBJTYPE_CAN_STATISTIC, "CAN Statistics" }, |
202 | | { BLF_OBJTYPE_APP_TRIGGER, "App Trigger" }, |
203 | | { BLF_OBJTYPE_ENV_INTEGER, "Env Integer" }, |
204 | | { BLF_OBJTYPE_ENV_DOUBLE, "Env Double" }, |
205 | | { BLF_OBJTYPE_ENV_STRING, "Env String" }, |
206 | | { BLF_OBJTYPE_ENV_DATA, "Env Data" }, |
207 | | { BLF_OBJTYPE_LOG_CONTAINER, "Log Container" }, |
208 | | { BLF_OBJTYPE_LIN_MESSAGE, "LIN Message" }, |
209 | | { BLF_OBJTYPE_LIN_CRC_ERROR, "LIN CRC Error" }, |
210 | | { BLF_OBJTYPE_LIN_DLC_INFO, "LIN DLC Info" }, |
211 | | { BLF_OBJTYPE_LIN_RCV_ERROR, "LIN Receive Error" }, |
212 | | { BLF_OBJTYPE_LIN_SND_ERROR, "LIN Send Error" }, |
213 | | { BLF_OBJTYPE_LIN_SLV_TIMEOUT, "LIN Slave Timeout" }, |
214 | | { BLF_OBJTYPE_LIN_SCHED_MODCH, "LIN Schedule Mode Change" }, |
215 | | { BLF_OBJTYPE_LIN_SYN_ERROR, "LIN Sync Error" }, |
216 | | { BLF_OBJTYPE_LIN_BAUDRATE, "LIN Baudrate" }, |
217 | | { BLF_OBJTYPE_LIN_SLEEP, "LIN Sleep" }, |
218 | | { BLF_OBJTYPE_LIN_WAKEUP, "LIN Wakeup" }, |
219 | | { BLF_OBJTYPE_MOST_SPY, "MOST Spy" }, |
220 | | { BLF_OBJTYPE_MOST_CTRL, "MOST Control" }, |
221 | | { BLF_OBJTYPE_MOST_LIGHTLOCK, "MOST Light Lock" }, |
222 | | { BLF_OBJTYPE_MOST_STATISTIC, "MOST Statistics" }, |
223 | | { BLF_OBJTYPE_FLEXRAY_DATA, "FlexRay Data" }, |
224 | | { BLF_OBJTYPE_FLEXRAY_SYNC, "FlexRay Sync" }, |
225 | | { BLF_OBJTYPE_CAN_DRIVER_ERROR, "CAN Driver Error" }, |
226 | | { BLF_OBJTYPE_MOST_PKT, "MOST Packet" }, |
227 | | { BLF_OBJTYPE_MOST_PKT2, "MOST Packet 2" }, |
228 | | { BLF_OBJTYPE_MOST_HWMODE, "MOST Hardware Mode" }, |
229 | | { BLF_OBJTYPE_MOST_REG, "MOST Register Data" }, |
230 | | { BLF_OBJTYPE_MOST_GENREG, "MOST Register Data" }, |
231 | | { BLF_OBJTYPE_MOST_NETSTATE, "MOST Net State" }, |
232 | | { BLF_OBJTYPE_MOST_DATALOST, "MOST Data Lost" }, |
233 | | { BLF_OBJTYPE_MOST_TRIGGER, "MOST Trigger" }, |
234 | | { BLF_OBJTYPE_FLEXRAY_CYCLE, "FlexRay Cycle" }, |
235 | | { BLF_OBJTYPE_FLEXRAY_MESSAGE, "FlexRay Message" }, |
236 | | { BLF_OBJTYPE_LIN_CHECKSUM_INFO, "LIN Checksum Info" }, |
237 | | { BLF_OBJTYPE_LIN_SPIKE_EVENT, "LIN Spike Event" }, |
238 | | { BLF_OBJTYPE_CAN_DRIVER_SYNC, "CAN Driver Sync" }, |
239 | | { BLF_OBJTYPE_FLEXRAY_STATUS, "FlexRay Status" }, |
240 | | { BLF_OBJTYPE_GPS_EVENT, "GPS Event" }, |
241 | | { BLF_OBJTYPE_FLEXRAY_ERROR, "FlexRay Error" }, |
242 | | { BLF_OBJTYPE_FLEXRAY_STATUS2, "FlexRay Status 2" }, |
243 | | { BLF_OBJTYPE_FLEXRAY_STARTCYCLE, "FlexRay Start Cycle" }, |
244 | | { BLF_OBJTYPE_FLEXRAY_RCVMESSAGE, "FlexRay Receive Message" }, |
245 | | { BLF_OBJTYPE_REALTIMECLOCK, "Realtime Clock" }, |
246 | | { BLF_OBJTYPE_LIN_STATISTIC, "LIN Statistics" }, |
247 | | { BLF_OBJTYPE_J1708_MESSAGE, "J1708 Message" }, |
248 | | { BLF_OBJTYPE_J1708_VIRTUAL_MSG, "J1708 Virtual Message" }, |
249 | | { BLF_OBJTYPE_LIN_MESSAGE2, "LIN Message 2" }, |
250 | | { BLF_OBJTYPE_LIN_SND_ERROR2, "LIN Send Error 2" }, |
251 | | { BLF_OBJTYPE_LIN_SYN_ERROR2, "LIN Sync Error 2" }, |
252 | | { BLF_OBJTYPE_LIN_CRC_ERROR2, "LIN CRC Error 2" }, |
253 | | { BLF_OBJTYPE_LIN_RCV_ERROR2, "LIN Receive Error 2" }, |
254 | | { BLF_OBJTYPE_LIN_WAKEUP2, "LIN Wakeup 2" }, |
255 | | { BLF_OBJTYPE_LIN_SPIKE_EVENT2, "LIN Spike Event 2" }, |
256 | | { BLF_OBJTYPE_LIN_LONG_DOM_SIG, "LIN Long Dominant Signal" }, |
257 | | { BLF_OBJTYPE_APP_TEXT, "Text" }, |
258 | | { BLF_OBJTYPE_FLEXRAY_RCVMESSAGE_EX, "FlexRay Receive Message Ext" }, |
259 | | { BLF_OBJTYPE_MOST_STATISTICEX, "MOST Statistics Ext" }, |
260 | | { BLF_OBJTYPE_MOST_TXLIGHT, "MOST TX Light" }, |
261 | | { BLF_OBJTYPE_MOST_ALLOCTAB, "MOST Allocation Table" }, |
262 | | { BLF_OBJTYPE_MOST_STRESS, "MOST Stress" }, |
263 | | { BLF_OBJTYPE_ETHERNET_FRAME, "Ethernet Frame" }, |
264 | | { BLF_OBJTYPE_SYS_VARIABLE, "System Variable" }, |
265 | | { BLF_OBJTYPE_CAN_ERROR_EXT, "CAN Error Ext" }, |
266 | | { BLF_OBJTYPE_CAN_DRIVER_ERROR_EXT, "CAN Driver Error Ext" }, |
267 | | { BLF_OBJTYPE_LIN_LONG_DOM_SIG2, "LIN Long Dominant Signal 2" }, |
268 | | { BLF_OBJTYPE_MOST_150_MESSAGE, "MOST150 Message" }, |
269 | | { BLF_OBJTYPE_MOST_150_PKT, "MOST150 Packet" }, |
270 | | { BLF_OBJTYPE_MOST_ETHERNET_PKT, "MOST Ethernet Packet" }, |
271 | | { BLF_OBJTYPE_MOST_150_MESSAGE_FRAGMENT, "MOST150 Message Fragment" }, |
272 | | { BLF_OBJTYPE_MOST_150_PKT_FRAGMENT, "MOST150 Packet Fragment" }, |
273 | | { BLF_OBJTYPE_MOST_ETHERNET_PKT_FRAGMENT, "MOST Ethernet Packet Fragment" }, |
274 | | { BLF_OBJTYPE_MOST_SYSTEM_EVENT, "MOST System Event" }, |
275 | | { BLF_OBJTYPE_MOST_150_ALLOCTAB, "MOST150 Allocation Table" }, |
276 | | { BLF_OBJTYPE_MOST_50_MESSAGE, "MOST50 Message" }, |
277 | | { BLF_OBJTYPE_MOST_50_PKT, "MOST50 Packet" }, |
278 | | { BLF_OBJTYPE_CAN_MESSAGE2, "CAN Message 2" }, |
279 | | { BLF_OBJTYPE_LIN_UNEXPECTED_WAKEUP, "LIN Unexpected Wakeup" }, |
280 | | { BLF_OBJTYPE_LIN_SHORT_OR_SLOW_RESPONSE, "LIN Short or Slow Response" }, |
281 | | { BLF_OBJTYPE_LIN_DISTURBANCE_EVENT, "LIN Disturbance" }, |
282 | | { BLF_OBJTYPE_SERIAL_EVENT, "Serial" }, |
283 | | { BLF_OBJTYPE_OVERRUN_ERROR, "Overrun Error" }, |
284 | | { BLF_OBJTYPE_EVENT_COMMENT, "Comment" }, |
285 | | { BLF_OBJTYPE_WLAN_FRAME, "WLAN Frame" }, |
286 | | { BLF_OBJTYPE_WLAN_STATISTIC, "WLAN Statistics" }, |
287 | | { BLF_OBJTYPE_MOST_ECL, "MOST Electric Control Line" }, |
288 | | { BLF_OBJTYPE_GLOBAL_MARKER, "Global Marker" }, |
289 | | { BLF_OBJTYPE_AFDX_FRAME, "AFDX Frame" }, |
290 | | { BLF_OBJTYPE_AFDX_STATISTIC, "AFDX Statistics" }, |
291 | | { BLF_OBJTYPE_KLINE_STATUSEVENT, "KLINE Status" }, |
292 | | { BLF_OBJTYPE_CAN_FD_MESSAGE, "CANFD Message" }, |
293 | | { BLF_OBJTYPE_CAN_FD_MESSAGE_64, "CANFD Message 64" }, |
294 | | { BLF_OBJTYPE_ETHERNET_RX_ERROR, "Ethernet RX Error" }, |
295 | | { BLF_OBJTYPE_ETHERNET_STATUS, "Ethernet Status" }, |
296 | | { BLF_OBJTYPE_CAN_FD_ERROR_64, "CANFD Error 64" }, |
297 | | { BLF_OBJTYPE_AFDX_STATUS, "AFDX Status" }, |
298 | | { BLF_OBJTYPE_AFDX_BUS_STATISTIC, "AFDX Bus Statistics" }, |
299 | | { BLF_OBJTYPE_AFDX_ERROR_EVENT, "AFDX Error" }, |
300 | | { BLF_OBJTYPE_A429_ERROR, "A429 Error" }, |
301 | | { BLF_OBJTYPE_A429_STATUS, "A429 Status" }, |
302 | | { BLF_OBJTYPE_A429_BUS_STATISTIC, "A429 Bus Statistics" }, |
303 | | { BLF_OBJTYPE_A429_MESSAGE, "A429 Message" }, |
304 | | { BLF_OBJTYPE_ETHERNET_STATISTIC, "Ethernet Statistics" }, |
305 | | { BLF_OBJTYPE_TEST_STRUCTURE, "Test Structure" }, |
306 | | { BLF_OBJTYPE_DIAG_REQUEST_INTERPRETATION, "Diagnostics Request Interpretation" }, |
307 | | { BLF_OBJTYPE_ETHERNET_FRAME_EX, "Ethernet Frame Ext" }, |
308 | | { BLF_OBJTYPE_ETHERNET_FRAME_FORWARDED, "Ethernet Frame Forwarded" }, |
309 | | { BLF_OBJTYPE_ETHERNET_ERROR_EX, "Ethernet Error Ext" }, |
310 | | { BLF_OBJTYPE_ETHERNET_ERROR_FORWARDED, "Ethernet Error Forwarded" }, |
311 | | { BLF_OBJTYPE_FUNCTION_BUS, "Function Bus" }, |
312 | | { BLF_OBJTYPE_DATA_LOST_BEGIN, "Data Lost Begin" }, |
313 | | { BLF_OBJTYPE_DATA_LOST_END, "Data Lost End" }, |
314 | | { BLF_OBJTYPE_WATER_MARK_EVENT, "Watermark" }, |
315 | | { BLF_OBJTYPE_TRIGGER_CONDITION, "Trigger Condition" }, |
316 | | { BLF_OBJTYPE_CAN_SETTING_CHANGED, "CAN Settings Changed" }, |
317 | | { BLF_OBJTYPE_DISTRIBUTED_OBJECT_MEMBER, "Distributed Object Member" }, |
318 | | { BLF_OBJTYPE_ATTRIBUTE_EVENT, "Attribute Event" }, |
319 | | { BLF_OBJTYPE_DISTRIBUTED_OBJECT_CHANGE, "Distributed Object Change" }, |
320 | | { BLF_OBJTYPE_ETHERNET_PHY_STATE, "Ethernet PHY State" }, |
321 | | { BLF_OBJTYPE_MACSEC_STATUS, "MACsec Status" }, |
322 | | { BLF_OBJTYPE_10BASET1S_STATUS, "10BASE-T1S Status" }, |
323 | | { BLF_OBJTYPE_10BASET1S_STATISTIC, "10BASE-T1S Statistic" }, |
324 | | { BLF_OBJTYPE_TUNNEL_PROTO_DECODER_EVENT, "Tunnel Protocol Decoder Event" }, |
325 | | { BLF_OBJTYPE_CAN_XL_CHANNEL_FRAME, "CAN XL Channel Frame" }, |
326 | | { BLF_OBJTYPE_CAN_XL_CHANNEL_ERRORFRAME, "CAN XL Channel Error" }, |
327 | | { 0, NULL } |
328 | | }; |
329 | | |
330 | | /* blf.c has the same table! */ |
331 | | static const value_string application_names[] = { |
332 | | { 0, "Unknown" }, |
333 | | { 1, "Vector CANalyzer" }, |
334 | | { 2, "Vector CANoe" }, |
335 | | { 3, "Vector CANstress" }, |
336 | | { 4, "Vector CANlog" }, |
337 | | { 5, "Vector CANape" }, |
338 | | { 6, "Vector CANcaseXL log" }, |
339 | | { 7, "Vector Logger Configurator" }, |
340 | | { 200, "Porsche Logger" }, |
341 | | { 201, "CAETEC Logger" }, |
342 | | { 202, "Vector Network Simulator" }, |
343 | | { 203, "IPETRONIK logger" }, |
344 | | { 204, "RT PK" }, |
345 | | { 205, "PikeTec" }, |
346 | | { 206, "Sparks" }, |
347 | | { 0, NULL } |
348 | | }; |
349 | | |
350 | | |
351 | 0 | #define BLF_COMPRESSION_NONE 0 |
352 | | #define BLF_COMPRESSION_ZLIB 2 |
353 | | |
354 | | static const value_string blf_compression_names[] = { |
355 | | { BLF_COMPRESSION_NONE, "No Compression" }, |
356 | | { BLF_COMPRESSION_ZLIB, "Compression ZLIB" }, |
357 | | { 0, NULL } |
358 | | }; |
359 | | |
360 | | static const value_string blf_app_text_source_vals[] = { |
361 | | { 0, "Measurement comment" }, |
362 | | { 1, "Database channel information" }, |
363 | | { 2, "Meta data" }, |
364 | | { 3, "Attachment" }, |
365 | | { 4, "Trace line" }, |
366 | | { 0, NULL } |
367 | | }; |
368 | | |
369 | | static const value_string blf_trigger_cond_state_vals[] = { |
370 | | { 0, "Unknown" }, |
371 | | { 1, "Start" }, |
372 | | { 2, "Stop" }, |
373 | | { 3, "StartStop"}, |
374 | | { 0, NULL } |
375 | | }; |
376 | | |
377 | | static const value_string blf_sys_var_type_vals[] = { |
378 | | { 1, "Double" }, |
379 | | { 2, "Long" }, |
380 | | { 3, "String"}, |
381 | | { 4, "DoubleArray"}, |
382 | | { 5, "LongArray"}, |
383 | | { 6, "LongLong"}, |
384 | | { 7, "ByteArray"}, |
385 | | { 0, NULL } |
386 | | }; |
387 | | |
388 | | static const value_string blf_eth_status_linkstatus_vals[] = { |
389 | | { 0, "UnknownLinkStatus" }, |
390 | | { 1, "LinkDown" }, |
391 | | { 2, "LinkUp"}, |
392 | | { 3, "Negotiate"}, |
393 | | { 4, "LinkError"}, |
394 | | { 0, NULL } |
395 | | }; |
396 | | |
397 | | static const value_string blf_eth_status_ethernetphy_vals[] = { |
398 | | { 0, "UnknownEthernetPhy" }, |
399 | | { 1, "Ieee802_3" }, |
400 | | { 2, "BroadR_Reach"}, |
401 | | { 0, NULL } |
402 | | }; |
403 | | |
404 | | static const value_string blf_eth_status_duplex_vals[] = { |
405 | | { 0, "UnknownDuplex" }, |
406 | | { 1, "HalfDuplex" }, |
407 | | { 2, "FullDuplex"}, |
408 | | { 0, NULL } |
409 | | }; |
410 | | |
411 | | static const value_string blf_eth_status_mdi_vals[] = { |
412 | | { 0, "UnknownMDI" }, |
413 | | { 1, "Direct" }, |
414 | | { 2, "Crossover"}, |
415 | | { 0, NULL } |
416 | | }; |
417 | | |
418 | | static const value_string blf_eth_status_connector_vals[] = { |
419 | | { 0, "UnknownConnector" }, |
420 | | { 1, "RJ45" }, |
421 | | { 2, "D-sub"}, |
422 | | { 0, NULL } |
423 | | }; |
424 | | |
425 | | static const value_string blf_eth_status_clockmode_vals[] = { |
426 | | { 0, "UnknownClockMode" }, |
427 | | { 1, "Master" }, |
428 | | { 2, "Slave"}, |
429 | | { 0, NULL } |
430 | | }; |
431 | | |
432 | | static const value_string blf_eth_status_pairs_vals[] = { |
433 | | { 0, "UnknownPairs" }, |
434 | | { 1, "1" }, |
435 | | { 2, "2"}, |
436 | | { 3, "4"}, |
437 | | { 0, NULL } |
438 | | }; |
439 | | |
440 | | static const value_string blf_bustype_vals[] = { |
441 | | { BLF_BUSTYPE_CAN, "CAN" }, |
442 | | { BLF_BUSTYPE_LIN, "LIN" }, |
443 | | { BLF_BUSTYPE_MOST, "MOST"}, |
444 | | { BLF_BUSTYPE_FLEXRAY, "FLEXRAY"}, |
445 | | { BLF_BUSTYPE_J1708, "J1708"}, |
446 | | { BLF_BUSTYPE_ETHERNET, "ETHERNET"}, |
447 | | { BLF_BUSTYPE_WLAN, "WLAN"}, |
448 | | { BLF_BUSTYPE_AFDX, "AFDX"}, |
449 | | { 0, NULL } |
450 | | }; |
451 | | |
452 | | static const value_string blf_app_text_metadata_type_vals[] = { |
453 | | { 1, "General" }, |
454 | | { 2, "Channels" }, |
455 | | { 3, "Identity" }, |
456 | | { 0, NULL } |
457 | | }; |
458 | | |
459 | | static const value_string hf_blf_app_text_traceline_source_vals[] = { |
460 | | { 0, "Write to log" }, |
461 | | { 1, "Timer" }, |
462 | | { 2, "Write to X" }, |
463 | | { 3, "Node layer" }, |
464 | | { 4, "CAPL on board" }, |
465 | | { 0, NULL } |
466 | | }; |
467 | | |
468 | | static const value_string blf_eth_phystate_phystate_vals[] = { |
469 | | { 0, "Invalid" }, |
470 | | { 1, "Normal" }, |
471 | | { 2, "Sleep"}, |
472 | | { 3, "PowerOff"}, |
473 | | { 4, "SleepRequest"}, |
474 | | { 0, NULL } |
475 | | }; |
476 | | |
477 | | static const value_string blf_eth_phystate_eventstate_vals[] = { |
478 | | { 0, "Invalid" }, |
479 | | { 1, "SleepReceived" }, |
480 | | { 2, "SleepSent"}, |
481 | | { 3, "SleepAbort"}, |
482 | | { 4, "SleepAckReceived"}, |
483 | | { 5, "SleepForwarded"}, |
484 | | { 8, "WakeUpReceived"}, |
485 | | { 9, "WakeUpSent"}, |
486 | | { 10, "WakeUpForwarded"}, |
487 | | { 17, "PowerOff"}, |
488 | | { 18, "PowerOn"}, |
489 | | { 25, "Activated"}, |
490 | | { 0, NULL } |
491 | | }; |
492 | | |
493 | | static const value_string blf_direction[] = { |
494 | | { 0, "RX" }, |
495 | | { 1, "TX" }, |
496 | | { 0, NULL } |
497 | | }; |
498 | | |
499 | | void proto_register_file_blf(void); |
500 | | void proto_reg_handoff_file_blf(void); |
501 | | static int dissect_blf_next_object(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, uint32_t *frame_number); |
502 | | |
503 | 0 | #define MAGIC_NUMBER_SIZE 4 |
504 | | static const uint8_t blf_file_magic[MAGIC_NUMBER_SIZE] = { 'L', 'O', 'G', 'G' }; |
505 | | static const uint8_t blf_lobj_magic[MAGIC_NUMBER_SIZE] = { 'L', 'O', 'B', 'J' }; |
506 | | |
507 | | |
508 | | static proto_item * |
509 | 0 | dissect_blf_header_date(proto_tree *tree, packet_info* pinfo, int hf, tvbuff_t *tvb, int offset, int length) { |
510 | |
|
511 | 0 | static const value_string weekday_names[] = { |
512 | 0 | { 0, "Sunday"}, |
513 | 0 | { 1, "Monday"}, |
514 | 0 | { 2, "Tuesday"}, |
515 | 0 | { 3, "Wednesday"}, |
516 | 0 | { 4, "Thursday"}, |
517 | 0 | { 5, "Friday"}, |
518 | 0 | { 6, "Saturday"}, |
519 | 0 | { 0, NULL } |
520 | 0 | }; |
521 | |
|
522 | 0 | nstime_t ns_ts; |
523 | 0 | struct tm tm = { 0 }; |
524 | |
|
525 | 0 | uint16_t year = tvb_get_letohs(tvb, offset + 0); |
526 | 0 | tm.tm_year = year; |
527 | 0 | if (tm.tm_year != 0) |
528 | 0 | tm.tm_year -= 1900; |
529 | 0 | tm.tm_mon = tvb_get_letohs(tvb, offset + 2); |
530 | 0 | tm.tm_wday = tvb_get_letohs(tvb, offset + 4); |
531 | 0 | tm.tm_mday = tvb_get_letohs(tvb, offset + 6); |
532 | 0 | tm.tm_hour = tvb_get_letohs(tvb, offset + 8); |
533 | 0 | tm.tm_min = tvb_get_letohs(tvb, offset + 10); |
534 | 0 | tm.tm_sec = tvb_get_letohs(tvb, offset + 12); |
535 | 0 | tm.tm_isdst = -1; // Let mktime() determine if DST is in effect |
536 | 0 | uint16_t ms = tvb_get_letohs(tvb, offset + 14); |
537 | |
|
538 | 0 | ns_ts.secs = mktime(&tm); |
539 | 0 | ns_ts.nsecs = ms * 1000000; |
540 | |
|
541 | 0 | return proto_tree_add_time_format_value(tree, hf, tvb, offset, length, &ns_ts, |
542 | 0 | "%s %d-%02d-%02d %02d:%02d:%02d.%03d", |
543 | 0 | val_to_str(pinfo->pool, tm.tm_mday, weekday_names, "%d"), |
544 | 0 | year, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, ms); |
545 | 0 | } |
546 | | |
547 | | static void |
548 | | version_format(char* string, uint32_t value) |
549 | 0 | { |
550 | 0 | uint8_t patch = value % 100; |
551 | 0 | value /= 100; |
552 | |
|
553 | 0 | uint8_t build = value % 100; |
554 | 0 | value /= 100; |
555 | |
|
556 | 0 | uint8_t minor = value % 100; |
557 | 0 | value /= 100; |
558 | |
|
559 | 0 | uint8_t major = value % 100; |
560 | |
|
561 | 0 | snprintf(string, ITEM_LABEL_LENGTH, "%d.%d.%d.%d", major, minor, build, patch); |
562 | 0 | } |
563 | | |
564 | | static int |
565 | | // NOLINTNEXTLINE(misc-no-recursion) |
566 | 0 | dissect_blf_lobj(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset_orig, uint32_t *frame_number) { |
567 | 0 | proto_item *ti_root = NULL; |
568 | 0 | proto_item *ti = NULL; |
569 | 0 | proto_item *ti_lobj_hdr; |
570 | 0 | proto_tree *objtree = NULL; |
571 | 0 | proto_tree *subtree = NULL; |
572 | 0 | volatile int offset = offset_orig; |
573 | 0 | tvbuff_t *sub_tvb; |
574 | |
|
575 | 0 | uint32_t hdr_length; |
576 | 0 | uint32_t hdr_type; |
577 | 0 | uint32_t obj_length; |
578 | 0 | unsigned obj_type; |
579 | 0 | uint32_t comp_method; |
580 | 0 | uint32_t channel; |
581 | | |
582 | | /* this should never happen since we should only be called with at least 16 Bytes present */ |
583 | 0 | if (tvb_captured_length_remaining(tvb, offset_orig) < 16) { |
584 | 0 | return tvb_captured_length_remaining(tvb, offset_orig); |
585 | 0 | } |
586 | | |
587 | 0 | ti_root = proto_tree_add_item(tree, hf_blf_lobj, tvb, offset, -1, ENC_NA); |
588 | 0 | objtree = proto_item_add_subtree(ti_root, ett_blf_obj); |
589 | |
|
590 | 0 | ti_lobj_hdr = proto_tree_add_item(objtree, hf_blf_lobj_hdr, tvb, offset, -1, ENC_NA); |
591 | 0 | subtree = proto_item_add_subtree(ti_lobj_hdr, ett_blf_obj_header); |
592 | |
|
593 | 0 | proto_tree_add_item(subtree, hf_blf_lobj_magic, tvb, offset, 4, ENC_NA); |
594 | 0 | offset += 4; |
595 | |
|
596 | 0 | ti = proto_tree_add_item_ret_uint(subtree, hf_blf_lobj_hdr_len, tvb, offset, 2, ENC_LITTLE_ENDIAN, &hdr_length); |
597 | 0 | if (hdr_length < sizeof (struct blf_blockheader)) { |
598 | 0 | expert_add_info(pinfo, ti, &ei_blf_object_header_length_too_short); |
599 | 0 | } |
600 | 0 | offset += 2; |
601 | |
|
602 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_lobj_hdr_type, tvb, offset, 2, ENC_LITTLE_ENDIAN, &hdr_type); |
603 | 0 | offset += 2; |
604 | |
|
605 | 0 | ti = proto_tree_add_item_ret_uint(subtree, hf_blf_lobj_obj_len, tvb, offset, 4, ENC_LITTLE_ENDIAN, &obj_length); |
606 | 0 | if (obj_length < hdr_length) { |
607 | 0 | expert_add_info(pinfo, ti, &ei_blf_object_length_less_than_header_length); |
608 | 0 | } |
609 | 0 | offset += 4; |
610 | |
|
611 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_lobj_obj_type, tvb, offset, 4, ENC_LITTLE_ENDIAN, &obj_type); |
612 | 0 | offset += 4; |
613 | |
|
614 | 0 | if ((int)hdr_length > 16 && (hdr_type == 1 || hdr_type == 2)) { |
615 | 0 | static int* const obj_header_flags[] = { |
616 | 0 | &hf_blf_lobj_obj_flags_time_ten_ms, |
617 | 0 | &hf_blf_lobj_obj_flags_time_one_ns, |
618 | 0 | NULL |
619 | 0 | }; |
620 | |
|
621 | 0 | proto_tree_add_bitmask(subtree, tvb, offset, hf_blf_lobj_obj_flags, ett_blf_obj_header_flags, obj_header_flags, ENC_LITTLE_ENDIAN); |
622 | 0 | offset += 4; |
623 | |
|
624 | 0 | if (hdr_type == 1) { |
625 | 0 | proto_tree_add_item(subtree, hf_blf_lobj_client_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
626 | 0 | } else if (hdr_type == 2) { |
627 | 0 | proto_tree_add_item(subtree, hf_blf_lobj_time_stamp_status, tvb, offset, 1, ENC_NA); |
628 | 0 | proto_tree_add_item(subtree, hf_blf_lobj_reserved, tvb, offset + 1, 1, ENC_NA); |
629 | 0 | } |
630 | 0 | offset += 2; |
631 | |
|
632 | 0 | proto_tree_add_item(subtree, hf_blf_lobj_obj_version, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
633 | 0 | offset += 2; |
634 | |
|
635 | 0 | proto_tree_add_item(subtree, hf_blf_lobj_obj_timestamp, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
636 | 0 | offset += 8; |
637 | |
|
638 | 0 | if (hdr_type == 2) { |
639 | 0 | proto_tree_add_item(subtree, hf_blf_lobj_org_timestamp, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
640 | 0 | offset += 8; |
641 | 0 | } |
642 | 0 | } |
643 | |
|
644 | 0 | if ((offset - offset_orig) - hdr_length > 0) { |
645 | 0 | proto_tree_add_item(subtree, hf_blf_lobj_hdr_remains, tvb, offset, hdr_length - (offset - offset_orig), ENC_NA); |
646 | 0 | offset = offset_orig + hdr_length; |
647 | 0 | } |
648 | 0 | proto_item_set_end(ti_lobj_hdr, tvb, offset); |
649 | | |
650 | | /* check if the whole object is present or if it was truncated */ |
651 | 0 | if (tvb_captured_length_remaining(tvb, offset_orig) < obj_length) { |
652 | 0 | proto_item_set_end(ti_root, tvb, offset_orig + tvb_captured_length_remaining(tvb, offset_orig)); |
653 | 0 | proto_item_append_text(ti_root, " TRUNCATED"); |
654 | 0 | return tvb_captured_length_remaining(tvb, offset_orig); |
655 | 0 | } |
656 | | |
657 | 0 | proto_item_set_end(ti_root, tvb, offset_orig + obj_length); |
658 | 0 | if (obj_type != BLF_OBJTYPE_LOG_CONTAINER) { |
659 | 0 | proto_item_append_text(ti_root, " [%d] (%s)", *frame_number, val_to_str(pinfo->pool, obj_type, blf_object_names, "%d")); |
660 | 0 | (*frame_number)++; |
661 | 0 | } else { |
662 | 0 | proto_item_append_text(ti_root, " (%s)", val_to_str(pinfo->pool, obj_type, blf_object_names, "%d")); |
663 | 0 | } |
664 | |
|
665 | 0 | switch (obj_type) { |
666 | 0 | case BLF_OBJTYPE_LOG_CONTAINER: |
667 | 0 | proto_tree_add_item_ret_uint(objtree, hf_blf_cont_comp_method, tvb, offset, 2, ENC_LITTLE_ENDIAN, &comp_method); |
668 | 0 | offset += 2; |
669 | 0 | proto_tree_add_item(objtree, hf_blf_cont_res1, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
670 | 0 | offset += 2; |
671 | 0 | proto_tree_add_item(objtree, hf_blf_cont_res2, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
672 | 0 | offset += 4; |
673 | 0 | proto_tree_add_item(objtree, hf_blf_cont_uncomp_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
674 | 0 | offset += 4; |
675 | 0 | proto_tree_add_item(objtree, hf_blf_cont_res4, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
676 | 0 | offset += 4; |
677 | 0 | if (comp_method == BLF_COMPRESSION_NONE) { |
678 | 0 | sub_tvb = tvb_new_subset_length(tvb, offset, offset_orig + obj_length - offset); |
679 | 0 | } else { |
680 | 0 | sub_tvb = tvb_child_uncompress_zlib(tvb, tvb, offset, offset_orig + obj_length - offset); |
681 | 0 | if (sub_tvb) { |
682 | 0 | add_new_data_source(pinfo, sub_tvb, "Decompressed Data"); |
683 | 0 | } |
684 | 0 | } |
685 | | |
686 | | /* TODO: actually the objects might overlap containers, which we do not consider here... */ |
687 | 0 | if (sub_tvb && tvb_captured_length(sub_tvb) > 0) { |
688 | 0 | unsigned offset_sub = 0; |
689 | 0 | ti = proto_tree_add_item(objtree, hf_blf_cont_payload, sub_tvb, 0, offset_orig + obj_length - offset, ENC_NA); |
690 | 0 | subtree = proto_item_add_subtree(ti, ett_blf_logcontainer_payload); |
691 | |
|
692 | 0 | unsigned tmp = 42; |
693 | 0 | while ((offset_sub + 16 <= offset_orig + obj_length - offset) && (tmp > 0)) { |
694 | 0 | tmp = dissect_blf_next_object(sub_tvb, pinfo, subtree, offset_sub, frame_number); |
695 | 0 | offset_sub += tmp; |
696 | 0 | } |
697 | 0 | } |
698 | 0 | break; |
699 | 0 | case BLF_OBJTYPE_APP_TEXT: |
700 | 0 | { |
701 | 0 | uint32_t source; |
702 | 0 | uint32_t remaining = 0; |
703 | 0 | uint32_t textlength; |
704 | |
|
705 | 0 | ti = proto_tree_add_item(objtree, hf_blf_lobj_payload, tvb, offset, obj_length - hdr_length, ENC_NA); |
706 | 0 | subtree = proto_item_add_subtree(ti, ett_blf_app_text_payload); |
707 | |
|
708 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_app_text_source, tvb, offset, 4, ENC_LITTLE_ENDIAN, &source); |
709 | 0 | offset += 4; |
710 | | |
711 | | /*uint32_t reservedAppText1 {};*/ |
712 | 0 | switch (source) { |
713 | 0 | case BLF_APPTEXT_CHANNEL: |
714 | | /* 1: Database channel information |
715 | | * - reserved contains channel information. The following |
716 | | * - table show how the 4 bytes are used: |
717 | | * - Bit 0-7: Version of the data |
718 | | * - Bit 8-15: Channel number |
719 | | * - Bit 15-23: Bus type of the channel. One of the |
720 | | * following values: |
721 | | * - 1: BL_BUSTYPE_CAN |
722 | | * - 5: BL_BUSTYPE_LIN |
723 | | * - 6: BL_BUSTYPE_MOST |
724 | | * - 7: BL_BUSTYPE_FLEXRAY |
725 | | * - 9: BL_BUSTYPE_J1708 |
726 | | * - 10: BL_BUSTYPE_ETHERNET |
727 | | * - 13: BL_BUSTYPE_WLAN |
728 | | * - 14: BL_BUSTYPE_AFDX |
729 | | * - Bit 24: Flag, that determines, if channel is a CAN- |
730 | | * FD channel |
731 | | * - Bit 25-31: Unused at the moment |
732 | | * - text contains database information for the specific |
733 | | * channel. Each database is defined by the database path and |
734 | | * the cluster name (if available). The single databases and the |
735 | | * cluster name are separated by a semicolon. Example: |
736 | | * \<Path1\>;\<ClusterName1\>;\<Path2\>;\<ClusterName2\>;... |
737 | | * If for a database there's no cluster name available, an |
738 | | * empty string is written as cluster name. |
739 | | */ |
740 | 0 | proto_tree_add_item(subtree, hf_blf_app_text_data_version, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
741 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_app_text_channelno, tvb, offset, 4, ENC_LITTLE_ENDIAN, &channel); |
742 | 0 | proto_item_append_text(ti_root, " (Channel: %d)", channel); |
743 | 0 | proto_tree_add_item(subtree, hf_blf_app_text_busstype, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
744 | 0 | proto_tree_add_item(subtree, hf_blf_app_text_can_fd_channel, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
745 | 0 | break; |
746 | 0 | case BLF_APPTEXT_METADATA: |
747 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_app_text_metadata_remaining_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &remaining); |
748 | 0 | proto_tree_add_item(subtree, hf_blf_app_text_metadata_type, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
749 | 0 | break; |
750 | 0 | case BLF_APPTEXT_TRACELINE: |
751 | 0 | proto_tree_add_item(subtree, hf_blf_app_text_traceline_source, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
752 | 0 | proto_tree_add_item(subtree, hf_blf_app_text_traceline_display_in_tracewindow, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
753 | 0 | proto_tree_add_item(subtree, hf_blf_app_text_traceline_ascii_conversion_wo_comment_indicator_timestamp, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
754 | 0 | break; |
755 | 0 | default: |
756 | 0 | proto_tree_add_item(subtree, hf_blf_app_text_reservedapptext1, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
757 | 0 | break; |
758 | 0 | } |
759 | 0 | offset += 4; |
760 | | /*uint32_t textLength {};*/ |
761 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_app_text_textlength, tvb, offset, 4, ENC_LITTLE_ENDIAN, &textlength); |
762 | 0 | offset += 4; |
763 | | /*uint32_t reservedAppText2 {};*/ |
764 | 0 | proto_tree_add_item(subtree, hf_blf_app_text_reservedapptext2, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
765 | 0 | offset += 4; |
766 | | /* If there is less than 38 characters this is not XML |
767 | | * <?xml version="1.0" encoding="UTF-8"?> |
768 | | */ |
769 | 0 | if ((textlength > 37) && (tvb_strncaseeql(tvb, offset, "<?xml", 5) == 0) &&( xml_handle)) { |
770 | 0 | tvbuff_t* new_tvb = tvb_new_subset_length(tvb, offset, textlength); |
771 | 0 | call_dissector(xml_handle, new_tvb, pinfo, subtree); |
772 | 0 | } else { |
773 | 0 | proto_tree_add_item(subtree, hf_blf_app_text_text, tvb, offset, textlength, ENC_UTF_8|ENC_NA); |
774 | 0 | } |
775 | |
|
776 | 0 | if (remaining != 0 && remaining > textlength) { |
777 | | /* This is not the final Meta Data packet, so we need to adjust */ |
778 | 0 | (*frame_number)--; |
779 | 0 | } |
780 | 0 | } |
781 | 0 | break; |
782 | 0 | case BLF_OBJTYPE_SYS_VARIABLE: |
783 | 0 | { |
784 | 0 | uint32_t namelength; |
785 | 0 | uint32_t datalength; |
786 | |
|
787 | 0 | ti = proto_tree_add_item(objtree, hf_blf_lobj_payload, tvb, offset, obj_length - hdr_length, ENC_NA); |
788 | 0 | subtree = proto_item_add_subtree(ti, ett_blf_obj_payload); |
789 | | |
790 | | /* uint32_t type {}; */ |
791 | 0 | proto_tree_add_item(subtree, hf_blf_sys_var_type, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
792 | 0 | offset += 4; |
793 | | /* uint32_t representation {}; */ |
794 | 0 | proto_tree_add_item(subtree, hf_blf_sys_var_rep, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
795 | 0 | offset += 4; |
796 | | /* uint64_t reservedSystemVariable1 {}; */ |
797 | 0 | proto_tree_add_item(subtree, hf_blf_sys_var_reservedsystemvariable1, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
798 | 0 | offset += 8; |
799 | | /* uint32_t nameLength {}; */ |
800 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_sys_var_namelength, tvb, offset, 4, ENC_LITTLE_ENDIAN, &namelength); |
801 | 0 | offset += 4; |
802 | | /* uint32_t dataLength {}; */ |
803 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_sys_var_datalength, tvb, offset, 4, ENC_LITTLE_ENDIAN, &datalength); |
804 | 0 | offset += 4; |
805 | | /* uint64_t reservedSystemVariable2 {}; */ |
806 | 0 | proto_tree_add_item(subtree, hf_blf_sys_var_reservedsystemvariable2, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
807 | 0 | offset += 8; |
808 | 0 | proto_tree_add_item(subtree, hf_blf_sys_var_name, tvb, offset, namelength, ENC_UTF_8); |
809 | 0 | offset += namelength; |
810 | 0 | proto_tree_add_item(subtree, hf_blf_sys_var_data, tvb, offset, datalength, ENC_NA); |
811 | 0 | offset += datalength; |
812 | 0 | } |
813 | 0 | break; |
814 | 0 | case BLF_OBJTYPE_ETHERNET_STATUS: |
815 | 0 | { |
816 | 0 | static int* const flags1[] = { |
817 | 0 | &hf_blf_eth_status_flags1_b9, |
818 | 0 | &hf_blf_eth_status_flags1_b8, |
819 | 0 | &hf_blf_eth_status_flags1_b7, |
820 | 0 | &hf_blf_eth_status_flags1_b6, |
821 | 0 | &hf_blf_eth_status_flags1_b5, |
822 | 0 | &hf_blf_eth_status_flags1_b4, |
823 | 0 | &hf_blf_eth_status_flags1_b3, |
824 | 0 | &hf_blf_eth_status_flags1_b2, |
825 | 0 | &hf_blf_eth_status_flags1_b1, |
826 | 0 | &hf_blf_eth_status_flags1_b0, |
827 | 0 | NULL |
828 | 0 | }; |
829 | |
|
830 | 0 | ti = proto_tree_add_item(objtree, hf_blf_lobj_payload, tvb, offset, obj_length - hdr_length, ENC_NA); |
831 | 0 | subtree = proto_item_add_subtree(ti, ett_blf_obj_payload); |
832 | | |
833 | | /* uint16_t channel {}; */ |
834 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_eth_status_channel, tvb, offset, 2, ENC_LITTLE_ENDIAN, &channel); |
835 | 0 | proto_item_append_text(ti_root, " (Channel: %d)", channel); |
836 | 0 | offset += 2; |
837 | | /* uint16_t flags; */ |
838 | 0 | proto_tree_add_bitmask_list(subtree, tvb, offset, 2, flags1, ENC_LITTLE_ENDIAN); |
839 | 0 | offset += 2; |
840 | | /* uint8_t linkStatus {}; */ |
841 | 0 | proto_tree_add_item(subtree, hf_blf_eth_status_linkstatus, tvb, offset, 1, ENC_LITTLE_ENDIAN); |
842 | 0 | offset += 1; |
843 | | /* uint8_t ethernetPhy {};*/ |
844 | 0 | proto_tree_add_item(subtree, hf_blf_eth_status_ethernetphy, tvb, offset, 1, ENC_LITTLE_ENDIAN); |
845 | 0 | offset += 1; |
846 | | /* uint8_t duplex {}; */ |
847 | 0 | proto_tree_add_item(subtree, hf_blf_eth_status_duplex, tvb, offset, 1, ENC_LITTLE_ENDIAN); |
848 | 0 | offset += 1; |
849 | | /* uint8_t mdi {}; */ |
850 | 0 | proto_tree_add_item(subtree, hf_blf_eth_status_mdi, tvb, offset, 1, ENC_LITTLE_ENDIAN); |
851 | 0 | offset += 1; |
852 | | /* uint8_t connector {};*/ |
853 | 0 | proto_tree_add_item(subtree, hf_blf_eth_status_connector, tvb, offset, 1, ENC_LITTLE_ENDIAN); |
854 | 0 | offset += 1; |
855 | | /* uint8_t clockMode {}; */ |
856 | 0 | proto_tree_add_item(subtree, hf_blf_eth_status_clockmode, tvb, offset, 1, ENC_LITTLE_ENDIAN); |
857 | 0 | offset += 1; |
858 | | /* uint8_t pairs {}; */ |
859 | 0 | proto_tree_add_item(subtree, hf_blf_eth_status_pairs, tvb, offset, 1, ENC_LITTLE_ENDIAN); |
860 | 0 | offset += 1; |
861 | | /* uint8_t hardwareChannel {};*/ |
862 | 0 | proto_tree_add_item(subtree, hf_blf_eth_status_hardwarechannel, tvb, offset, 1, ENC_LITTLE_ENDIAN); |
863 | 0 | offset += 1; |
864 | | /* uint32_t bitrate {}; */ |
865 | 0 | proto_tree_add_item(subtree, hf_blf_eth_status_bitrate, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
866 | 0 | offset += 4; |
867 | 0 | if (offset_orig + obj_length - offset >= 8) { |
868 | 0 | proto_tree_add_item(subtree, hf_blf_eth_status_linkupduration, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
869 | 0 | } |
870 | 0 | } |
871 | 0 | break; |
872 | 0 | case BLF_OBJTYPE_ETHERNET_FRAME_EX: |
873 | 0 | { |
874 | 0 | ti = proto_tree_add_item(objtree, hf_blf_lobj_payload, tvb, offset, obj_length - hdr_length, ENC_NA); |
875 | 0 | subtree = proto_item_add_subtree(ti, ett_blf_obj_payload); |
876 | | |
877 | | /* uint16_t structLength {}; */ |
878 | 0 | proto_tree_add_item(subtree, hf_blf_eth_frame_ext_structlength, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
879 | 0 | offset += 2; |
880 | | /* uint16_t flags {}; */ |
881 | 0 | proto_tree_add_item(subtree, hf_blf_eth_frame_ext_flags, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
882 | 0 | offset += 2; |
883 | | /* uint16_t channel {}; */ |
884 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_eth_frame_ext_channel, tvb, offset, 2, ENC_LITTLE_ENDIAN, &channel); |
885 | 0 | proto_item_append_text(ti_root, " (Channel: %d)", channel); |
886 | |
|
887 | 0 | offset += 2; |
888 | | /* uint16_t hardwareChannel {}; */ |
889 | 0 | proto_tree_add_item(subtree, hf_blf_eth_frame_ext_hardwarechannel, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
890 | 0 | offset += 2; |
891 | | /* uint64_t frameDuration {}; */ |
892 | 0 | proto_tree_add_item(subtree, hf_blf_eth_frame_ext_frameduration, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
893 | 0 | offset += 8; |
894 | | /* uint32_t frameChecksum {}; */ |
895 | 0 | proto_tree_add_item(subtree, hf_blf_eth_frame_ext_framechecksum, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
896 | 0 | offset += 4; |
897 | | /* uint16_t dir {}; */ |
898 | 0 | proto_tree_add_item(subtree, hf_blf_eth_frame_ext_dir, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
899 | 0 | offset += 2; |
900 | | /* uint16_t frameLength {}; */ |
901 | 0 | proto_tree_add_item(subtree, hf_blf_eth_frame_ext_framelength, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
902 | 0 | offset += 2; |
903 | | /* uint32_t frameHandle {}; */ |
904 | 0 | proto_tree_add_item(subtree, hf_blf_eth_frame_ext_framehandle, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
905 | 0 | offset += 4; |
906 | | /* uint32_t reservedEthernetFrameEx {}; */ |
907 | 0 | proto_tree_add_item(subtree, hf_blf_eth_frame_ext_reservedethernetframeex, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
908 | 0 | offset += 4; |
909 | 0 | } |
910 | 0 | break; |
911 | 0 | case BLF_OBJTYPE_TRIGGER_CONDITION: |
912 | 0 | { |
913 | 0 | uint32_t triggerblocknamelength; |
914 | 0 | uint32_t triggerconditionlength; |
915 | |
|
916 | 0 | ti = proto_tree_add_item(objtree, hf_blf_lobj_payload, tvb, offset, obj_length - hdr_length, ENC_NA); |
917 | 0 | subtree = proto_item_add_subtree(ti, ett_blf_obj_payload); |
918 | | |
919 | | /* uint32_t state {}; */ |
920 | 0 | proto_tree_add_item(subtree, hf_blf_trigg_cond_state, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
921 | 0 | offset += 4; |
922 | | /* uint32_t triggerBlockNameLength {}; */ |
923 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_trigg_cond_triggerblocknamelength, tvb, offset, 4, ENC_LITTLE_ENDIAN,&triggerblocknamelength); |
924 | 0 | offset += 4; |
925 | | /* uint32_t triggerConditionLength {};*/ |
926 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_trigg_cond_triggerconditionlength, tvb, offset, 4, ENC_LITTLE_ENDIAN, &triggerconditionlength); |
927 | 0 | offset += 4; |
928 | | /* std::string triggerBlockName {};*/ |
929 | 0 | proto_tree_add_item(subtree, hf_blf_trigg_cond_triggerblockname, tvb, offset, triggerblocknamelength, ENC_UTF_8 | ENC_NA); |
930 | 0 | offset += triggerblocknamelength; |
931 | | /* std::string triggerCondition {};*/ |
932 | 0 | proto_tree_add_item(subtree, hf_blf_trigg_cond_triggercondition, tvb, offset, triggerconditionlength, ENC_UTF_8 | ENC_NA); |
933 | 0 | offset += triggerconditionlength; |
934 | 0 | } |
935 | 0 | break; |
936 | 0 | case BLF_OBJTYPE_ETHERNET_PHY_STATE: |
937 | 0 | { |
938 | 0 | static int* const flags1[] = { |
939 | 0 | &hf_blf_eth_phy_state_flags1_b2, |
940 | 0 | &hf_blf_eth_phy_state_flags1_b1, |
941 | 0 | &hf_blf_eth_phy_state_flags1_b0, |
942 | 0 | NULL |
943 | 0 | }; |
944 | |
|
945 | 0 | ti = proto_tree_add_item(objtree, hf_blf_lobj_payload, tvb, offset, obj_length - hdr_length, ENC_NA); |
946 | 0 | subtree = proto_item_add_subtree(ti, ett_blf_obj_payload); |
947 | | |
948 | | /* uint16_t channel {}; */ |
949 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_eth_phystate_channel, tvb, offset, 2, ENC_LITTLE_ENDIAN, &channel); |
950 | 0 | proto_item_append_text(ti_root, " (Channel: %d)", channel); |
951 | 0 | offset += 2; |
952 | | /* uint16_t flags; */ |
953 | 0 | proto_tree_add_bitmask_list(subtree, tvb, offset, 2, flags1, ENC_LITTLE_ENDIAN); |
954 | 0 | offset += 2; |
955 | | /* uint8_t phyState {}; */ |
956 | 0 | proto_tree_add_item(subtree, hf_blf_eth_phy_state_phystate, tvb, offset, 1, ENC_NA); |
957 | 0 | offset += 1; |
958 | | /* uint8_t eventState {}; */ |
959 | 0 | proto_tree_add_item(subtree, hf_blf_eth_phy_state_eventstate, tvb, offset, 1, ENC_NA); |
960 | 0 | offset += 1; |
961 | | /* uint8_t hardwareChannel {}; */ |
962 | 0 | proto_tree_add_item(subtree, hf_blf_eth_phy_state_hardwarechannel, tvb, offset, 1, ENC_NA); |
963 | 0 | offset += 1; |
964 | | /* uint8_t res1 {}; */ |
965 | 0 | proto_tree_add_item(subtree, hf_blf_eth_phy_state_res1, tvb, offset, 1, ENC_NA); |
966 | 0 | offset += 1; |
967 | 0 | } |
968 | 0 | break; |
969 | | |
970 | 0 | case BLF_OBJTYPE_CAN_XL_CHANNEL_FRAME: |
971 | 0 | { |
972 | 0 | ti = proto_tree_add_item(objtree, hf_blf_lobj_payload, tvb, offset, obj_length - hdr_length, ENC_NA); |
973 | 0 | subtree = proto_item_add_subtree(ti, ett_blf_obj_payload); |
974 | |
|
975 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_lobj_payload_channel_8bit, tvb, offset, 1, ENC_NA, &channel); |
976 | 0 | proto_item_append_text(ti_root, " (Channel: %d)", channel); |
977 | 0 | offset += 1; |
978 | |
|
979 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_tx_count_number, tvb, offset, 1, ENC_NA); |
980 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_tx_count_attempts, tvb, offset, 1, ENC_NA); |
981 | 0 | offset += 1; |
982 | |
|
983 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_tx_dir, tvb, offset, 1, ENC_NA); |
984 | 0 | offset += 1; |
985 | |
|
986 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_res1, tvb, offset, 1, ENC_NA); |
987 | 0 | offset += 1; |
988 | |
|
989 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_frame_duration_in_ns, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
990 | 0 | offset += 4; |
991 | |
|
992 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_bit_count, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
993 | 0 | offset += 2; |
994 | |
|
995 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_res2, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
996 | 0 | offset += 2; |
997 | |
|
998 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_id, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
999 | 0 | offset += 4; |
1000 | |
|
1001 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_sdt, tvb, offset, 1, ENC_NA); |
1002 | 0 | offset += 1; |
1003 | |
|
1004 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_res3, tvb, offset, 1, ENC_NA); |
1005 | 0 | offset += 1; |
1006 | |
|
1007 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_dlc, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
1008 | 0 | offset += 2; |
1009 | |
|
1010 | 0 | uint32_t data_length; |
1011 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_canxl_data_length, tvb, offset, 2, ENC_LITTLE_ENDIAN, &data_length); |
1012 | 0 | offset += 2; |
1013 | |
|
1014 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_sbc, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
1015 | 0 | offset += 2; |
1016 | |
|
1017 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_pcrc, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
1018 | 0 | offset += 2; |
1019 | |
|
1020 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_vcid, tvb, offset, 1, ENC_NA); |
1021 | 0 | offset += 1; |
1022 | |
|
1023 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_res4, tvb, offset, 1, ENC_NA); |
1024 | 0 | offset += 1; |
1025 | |
|
1026 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_af, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
1027 | 0 | offset += 4; |
1028 | |
|
1029 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_stuff_count, tvb, offset, 1, ENC_NA); |
1030 | 0 | offset += 1; |
1031 | |
|
1032 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_res5, tvb, offset, 1, ENC_NA); |
1033 | 0 | offset += 1; |
1034 | |
|
1035 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_res6, tvb, offset, 1, ENC_NA); |
1036 | 0 | offset += 2; |
1037 | |
|
1038 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_fcrc, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
1039 | 0 | offset += 4; |
1040 | |
|
1041 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_time_offset_brs, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
1042 | 0 | offset += 4; |
1043 | |
|
1044 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_time_offset_crc_delim, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
1045 | 0 | offset += 4; |
1046 | |
|
1047 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
1048 | 0 | offset += 4; |
1049 | |
|
1050 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_res, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
1051 | 0 | offset += 4; |
1052 | |
|
1053 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_arbitration_data_bit_timing, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
1054 | 0 | offset += 8; |
1055 | |
|
1056 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_arbitration_data_hardware_channel_setting, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
1057 | 0 | offset += 8; |
1058 | |
|
1059 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_fd_phase_bit_timing, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
1060 | 0 | offset += 8; |
1061 | |
|
1062 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_fd_phasea_hardware_channel_setting, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
1063 | 0 | offset += 8; |
1064 | |
|
1065 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_xl_phase_bit_timing, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
1066 | 0 | offset += 8; |
1067 | |
|
1068 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_xl_phase_hardware_channel_setting, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
1069 | 0 | offset += 8; |
1070 | |
|
1071 | 0 | proto_tree_add_item(subtree, hf_blf_canxl_data, tvb, offset, data_length, ENC_NA); |
1072 | 0 | } |
1073 | 0 | break; |
1074 | | |
1075 | 0 | default: |
1076 | 0 | ti = proto_tree_add_item(objtree, hf_blf_lobj_payload, tvb, offset, obj_length - hdr_length, ENC_NA); |
1077 | 0 | subtree = proto_item_add_subtree(ti, ett_blf_obj_payload); |
1078 | | |
1079 | | /* lets add at least the channels for the formats not being parsed */ |
1080 | 0 | if ((BLF_OBJTYPE_CAN_MESSAGE <= obj_type && obj_type <= BLF_OBJTYPE_CAN_STATISTIC) || |
1081 | 0 | (BLF_OBJTYPE_LIN_MESSAGE <= obj_type && obj_type <= BLF_OBJTYPE_MOST_STATISTIC) || |
1082 | 0 | (BLF_OBJTYPE_FLEXRAY_DATA <= obj_type && obj_type <= BLF_OBJTYPE_FLEXRAY_STATUS) || |
1083 | 0 | (BLF_OBJTYPE_FLEXRAY_ERROR <= obj_type && obj_type <= BLF_OBJTYPE_FLEXRAY_RCVMESSAGE) || |
1084 | 0 | (BLF_OBJTYPE_LIN_STATISTIC <= obj_type && obj_type <= BLF_OBJTYPE_J1708_MESSAGE) || |
1085 | 0 | (BLF_OBJTYPE_FLEXRAY_RCVMESSAGE_EX <= obj_type && obj_type <= BLF_OBJTYPE_MOST_STRESS) || |
1086 | 0 | (BLF_OBJTYPE_CAN_ERROR_EXT <= obj_type && obj_type <= BLF_OBJTYPE_CAN_DRIVER_ERROR_EXT) || |
1087 | 0 | (BLF_OBJTYPE_MOST_150_MESSAGE <= obj_type && obj_type <= BLF_OBJTYPE_CAN_MESSAGE2) || |
1088 | 0 | (obj_type == BLF_OBJTYPE_LIN_DISTURBANCE_EVENT) || |
1089 | 0 | (BLF_OBJTYPE_WLAN_FRAME <= obj_type && obj_type <= BLF_OBJTYPE_MOST_ECL) || |
1090 | 0 | (obj_type == BLF_OBJTYPE_AFDX_STATISTIC) || |
1091 | 0 | (obj_type == BLF_OBJTYPE_CAN_FD_MESSAGE) || |
1092 | 0 | (obj_type == BLF_OBJTYPE_ETHERNET_STATUS) || |
1093 | 0 | (BLF_OBJTYPE_AFDX_STATUS <= obj_type && obj_type <= BLF_OBJTYPE_A429_BUS_STATISTIC) || |
1094 | 0 | (obj_type == BLF_OBJTYPE_ETHERNET_STATISTIC) || |
1095 | 0 | (BLF_OBJTYPE_ETHERNET_PHY_STATE <= obj_type && obj_type <= BLF_OBJTYPE_MACSEC_STATUS)) { |
1096 | | /* 16bit channel */ |
1097 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_lobj_payload_channel_16bit, tvb, offset, 2, ENC_LITTLE_ENDIAN, &channel); |
1098 | 0 | proto_item_append_text(ti_root, " (Channel: %d)", channel); |
1099 | 0 | } else if ((obj_type == BLF_OBJTYPE_CAN_FD_MESSAGE_64) || |
1100 | 0 | (obj_type == BLF_OBJTYPE_CAN_FD_ERROR_64) || |
1101 | 0 | (obj_type == BLF_OBJTYPE_CAN_XL_CHANNEL_FRAME) || |
1102 | 0 | (obj_type == BLF_OBJTYPE_CAN_XL_CHANNEL_ERRORFRAME)) { |
1103 | | /* 8 bit channel */ |
1104 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_lobj_payload_channel_8bit, tvb, offset, 1, ENC_NA, &channel); |
1105 | 0 | proto_item_append_text(ti_root, " (Channel: %d)", channel); |
1106 | 0 | } else if (obj_type == BLF_OBJTYPE_ETHERNET_RX_ERROR) { |
1107 | | /* 16 bit channel after 2 byte offset */ |
1108 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_lobj_payload_channel_16bit, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN, &channel); |
1109 | 0 | proto_item_append_text(ti_root, " (Channel: %d)", channel); |
1110 | 0 | } else if ((obj_type == BLF_OBJTYPE_GPS_EVENT) || |
1111 | 0 | (obj_type == BLF_OBJTYPE_A429_MESSAGE) || |
1112 | 0 | (BLF_OBJTYPE_ETHERNET_FRAME_EX <= obj_type && obj_type <= BLF_OBJTYPE_ETHERNET_ERROR_FORWARDED)) { |
1113 | | /* 16 bit channel after 4 byte offset */ |
1114 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_lobj_payload_channel_16bit, tvb, offset + 4, 2, ENC_LITTLE_ENDIAN, &channel); |
1115 | 0 | proto_item_append_text(ti_root, " (Channel: %d)", channel); |
1116 | 0 | } else if ((obj_type == BLF_OBJTYPE_ETHERNET_FRAME) || |
1117 | 0 | (obj_type == BLF_OBJTYPE_AFDX_FRAME)) { |
1118 | | /* 16 bit channel after 6 byte offset */ |
1119 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_lobj_payload_channel_16bit, tvb, offset + 6, 2, ENC_LITTLE_ENDIAN, &channel); |
1120 | 0 | proto_item_append_text(ti_root, " (Channel: %d)", channel); |
1121 | 0 | } else if ((BLF_OBJTYPE_LIN_MESSAGE2 <= obj_type && obj_type <= BLF_OBJTYPE_LIN_LONG_DOM_SIG) || |
1122 | 0 | (obj_type == BLF_OBJTYPE_LIN_LONG_DOM_SIG) || |
1123 | 0 | (obj_type == BLF_OBJTYPE_LIN_LONG_DOM_SIG2) || |
1124 | 0 | (obj_type == BLF_OBJTYPE_LIN_UNEXPECTED_WAKEUP)) { |
1125 | | /* 16 bit channel after 12 byte offset */ |
1126 | 0 | proto_tree_add_item_ret_uint(subtree, hf_blf_lobj_payload_channel_16bit, tvb, offset + 12, 2, ENC_LITTLE_ENDIAN, &channel); |
1127 | 0 | proto_item_append_text(ti_root, " (Channel: %d)", channel); |
1128 | 0 | } |
1129 | |
|
1130 | 0 | offset = offset_orig + obj_length; |
1131 | 0 | break; |
1132 | 0 | } |
1133 | | |
1134 | 0 | return (int)obj_length; |
1135 | 0 | } |
1136 | | |
1137 | | static int |
1138 | | // NOLINTNEXTLINE(misc-no-recursion) |
1139 | 0 | dissect_blf_next_object(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, uint32_t *frame_number) { |
1140 | 0 | int offset_orig = offset; |
1141 | |
|
1142 | 0 | while (tvb_captured_length_remaining(tvb, offset) >= 16) { |
1143 | 0 | if (tvb_memeql(tvb, offset, blf_lobj_magic, MAGIC_NUMBER_SIZE) != 0) { |
1144 | 0 | offset += 1; |
1145 | 0 | } else { |
1146 | 0 | increment_dissection_depth(pinfo); |
1147 | 0 | int bytes_parsed = dissect_blf_lobj(tvb, pinfo, tree, offset, frame_number); |
1148 | 0 | decrement_dissection_depth(pinfo); |
1149 | 0 | if (bytes_parsed <= 0) { |
1150 | 0 | return 0; |
1151 | 0 | } else { |
1152 | 0 | offset += bytes_parsed; |
1153 | 0 | } |
1154 | 0 | } |
1155 | 0 | } |
1156 | | |
1157 | 0 | return offset - offset_orig; |
1158 | 0 | } |
1159 | | |
1160 | | |
1161 | | static int |
1162 | 0 | dissect_blf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { |
1163 | 0 | volatile int offset = 0; |
1164 | 0 | proto_tree *blf_tree; |
1165 | 0 | uint32_t header_length; |
1166 | 0 | proto_tree *subtree; |
1167 | 0 | proto_item *ti; |
1168 | 0 | unsigned length; |
1169 | |
|
1170 | 0 | if (tvb_captured_length(tvb) < 8 || tvb_memeql(tvb, 0, blf_file_magic, MAGIC_NUMBER_SIZE) != 0) { |
1171 | | /* does not start with LOGG, so this is not BLF it seems */ |
1172 | 0 | return 0; |
1173 | 0 | } |
1174 | | |
1175 | 0 | ti = proto_tree_add_item(tree, proto_blf, tvb, offset, -1, ENC_NA); |
1176 | 0 | blf_tree = proto_item_add_subtree(ti, ett_blf); |
1177 | 0 | length = tvb_get_letohl(tvb, 4); |
1178 | |
|
1179 | 0 | ti = proto_tree_add_item(blf_tree, hf_blf_file_header, tvb, offset, length, ENC_NA); |
1180 | 0 | subtree = proto_item_add_subtree(ti, ett_blf_header); |
1181 | |
|
1182 | 0 | proto_tree_add_item(subtree, hf_blf_file_header_magic, tvb, offset, 4, ENC_NA); |
1183 | 0 | offset += 4; |
1184 | 0 | ti = proto_tree_add_item_ret_uint(subtree, hf_blf_file_header_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &header_length); |
1185 | 0 | if (header_length < sizeof (struct blf_fileheader)) { |
1186 | 0 | expert_add_info(pinfo, ti, &ei_blf_file_header_length_too_short); |
1187 | 0 | } |
1188 | 0 | offset += 4; |
1189 | 0 | proto_tree_add_item(subtree, hf_blf_file_header_api, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
1190 | 0 | offset += 4; |
1191 | 0 | proto_tree_add_item(subtree, hf_blf_file_header_app, tvb, offset, 1, ENC_NA); |
1192 | 0 | offset += 1; |
1193 | 0 | proto_tree_add_item(subtree, hf_blf_file_header_comp_level, tvb, offset, 1, ENC_NA); |
1194 | 0 | offset += 1; |
1195 | 0 | proto_tree_add_item(subtree, hf_blf_file_header_app_major, tvb, offset, 1, ENC_NA); |
1196 | 0 | offset += 1; |
1197 | 0 | proto_tree_add_item(subtree, hf_blf_file_header_app_minor, tvb, offset, 1, ENC_NA); |
1198 | 0 | offset += 1; |
1199 | 0 | proto_tree_add_item(subtree, hf_blf_file_header_len_comp, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
1200 | 0 | offset += 8; |
1201 | 0 | proto_tree_add_item(subtree, hf_blf_file_header_len_uncomp, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
1202 | 0 | offset += 8; |
1203 | 0 | proto_tree_add_item(subtree, hf_blf_file_header_obj_count, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
1204 | 0 | offset += 4; |
1205 | 0 | proto_tree_add_item(subtree, hf_blf_file_header_app_build, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
1206 | 0 | offset += 4; |
1207 | 0 | dissect_blf_header_date(subtree, pinfo, hf_blf_file_header_start_date, tvb, offset, 16); |
1208 | 0 | offset += 16; |
1209 | 0 | dissect_blf_header_date(subtree, pinfo, hf_blf_file_header_end_date, tvb, offset, 16); |
1210 | 0 | offset += 16; |
1211 | 0 | proto_tree_add_item(subtree, hf_blf_file_header_restore_point_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
1212 | 0 | offset += 8; |
1213 | |
|
1214 | 0 | uint32_t frame_number = 1; |
1215 | 0 | offset += dissect_blf_next_object(tvb, pinfo, blf_tree, offset, &frame_number); |
1216 | |
|
1217 | 0 | return offset; |
1218 | 0 | } |
1219 | | |
1220 | | static bool |
1221 | 0 | dissect_blf_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { |
1222 | 0 | return dissect_blf(tvb, pinfo, tree, data) > 0; |
1223 | 0 | } |
1224 | | |
1225 | | static int |
1226 | 0 | dissect_blf_ethernetstatus_obj(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_) { |
1227 | 0 | proto_item *ti; |
1228 | 0 | proto_tree* blf_tree; |
1229 | 0 | int offset = 0; |
1230 | |
|
1231 | 0 | static int* const flags1[] = { |
1232 | 0 | &hf_blf_eth_status_flags1_b9, |
1233 | 0 | &hf_blf_eth_status_flags1_b8, |
1234 | 0 | &hf_blf_eth_status_flags1_b7, |
1235 | 0 | &hf_blf_eth_status_flags1_b6, |
1236 | 0 | &hf_blf_eth_status_flags1_b5, |
1237 | 0 | &hf_blf_eth_status_flags1_b4, |
1238 | 0 | &hf_blf_eth_status_flags1_b3, |
1239 | 0 | &hf_blf_eth_status_flags1_b2, |
1240 | 0 | &hf_blf_eth_status_flags1_b1, |
1241 | 0 | &hf_blf_eth_status_flags1_b0, |
1242 | 0 | NULL |
1243 | 0 | }; |
1244 | |
|
1245 | 0 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "BLF Ethernet Status"); |
1246 | 0 | col_clear(pinfo->cinfo, COL_INFO); |
1247 | |
|
1248 | 0 | ti = proto_tree_add_item(tree, proto_blf_ethernetstatus_obj, tvb, offset, -1, ENC_NA); |
1249 | 0 | blf_tree = proto_item_add_subtree(ti, ett_blf); |
1250 | | |
1251 | | /* uint16_t channel {}; */ |
1252 | 0 | uint32_t channel; |
1253 | 0 | proto_tree_add_item_ret_uint(blf_tree, hf_blf_eth_status_channel, tvb, offset, 2, ENC_BIG_ENDIAN, &channel); |
1254 | 0 | offset += 2; |
1255 | | /* uint16_t flags; */ |
1256 | 0 | uint16_t flags = tvb_get_ntohs(tvb, offset); |
1257 | 0 | proto_tree_add_bitmask_list(blf_tree, tvb, offset, 2, flags1, ENC_BIG_ENDIAN); |
1258 | 0 | offset += 2; |
1259 | | |
1260 | | /* uint8_t linkStatus {}; */ |
1261 | 0 | uint32_t linkstatus; |
1262 | 0 | ti = proto_tree_add_item_ret_uint(blf_tree, hf_blf_eth_status_linkstatus, tvb, offset, 1, ENC_BIG_ENDIAN, &linkstatus); |
1263 | 0 | if ((flags & BLF_ETH_STATUS_LINKSTATUS) == 0) { |
1264 | 0 | proto_item_append_text(ti, " - Invalid"); |
1265 | 0 | } |
1266 | 0 | offset += 1; |
1267 | | |
1268 | | /* uint8_t ethernetPhy {};*/ |
1269 | 0 | ti = proto_tree_add_item(blf_tree, hf_blf_eth_status_ethernetphy, tvb, offset, 1, ENC_BIG_ENDIAN); |
1270 | 0 | if ((flags & BLF_ETH_STATUS_ETHERNETPHY) == 0) { |
1271 | 0 | proto_item_append_text(ti, " - Invalid"); |
1272 | 0 | } |
1273 | 0 | offset += 1; |
1274 | | |
1275 | | /* uint8_t duplex {}; */ |
1276 | 0 | ti = proto_tree_add_item(blf_tree, hf_blf_eth_status_duplex, tvb, offset, 1, ENC_BIG_ENDIAN); |
1277 | 0 | if ((flags & BLF_ETH_STATUS_DUPLEX) == 0) { |
1278 | 0 | proto_item_append_text(ti, " - Invalid"); |
1279 | 0 | } |
1280 | 0 | offset += 1; |
1281 | | |
1282 | | /* uint8_t mdi {}; */ |
1283 | 0 | ti = proto_tree_add_item(blf_tree, hf_blf_eth_status_mdi, tvb, offset, 1, ENC_BIG_ENDIAN); |
1284 | 0 | if ((flags & BLF_ETH_STATUS_MDITYPE) == 0) { |
1285 | 0 | proto_item_append_text(ti, " - Invalid"); |
1286 | 0 | } |
1287 | 0 | offset += 1; |
1288 | | |
1289 | | /* uint8_t connector {};*/ |
1290 | 0 | ti = proto_tree_add_item(blf_tree, hf_blf_eth_status_connector, tvb, offset, 1, ENC_BIG_ENDIAN); |
1291 | 0 | if ((flags & BLF_ETH_STATUS_CONNECTOR) == 0) { |
1292 | 0 | proto_item_append_text(ti, " - Invalid"); |
1293 | 0 | } |
1294 | 0 | offset += 1; |
1295 | | |
1296 | | /* uint8_t clockMode {}; */ |
1297 | 0 | ti = proto_tree_add_item(blf_tree, hf_blf_eth_status_clockmode, tvb, offset, 1, ENC_BIG_ENDIAN); |
1298 | 0 | if ((flags & BLF_ETH_STATUS_CLOCKMODE) == 0) { |
1299 | 0 | proto_item_append_text(ti, " - Invalid"); |
1300 | 0 | } |
1301 | 0 | offset += 1; |
1302 | | |
1303 | | /* uint8_t pairs {}; */ |
1304 | 0 | ti = proto_tree_add_item(blf_tree, hf_blf_eth_status_pairs, tvb, offset, 1, ENC_BIG_ENDIAN); |
1305 | 0 | if ((flags & BLF_ETH_STATUS_BRPAIR) == 0) { |
1306 | 0 | proto_item_append_text(ti, " - Invalid"); |
1307 | 0 | } |
1308 | 0 | offset += 1; |
1309 | | |
1310 | | /* uint8_t hardwareChannel {};*/ |
1311 | 0 | uint32_t hardwarechannel; |
1312 | 0 | ti = proto_tree_add_item_ret_uint(blf_tree, hf_blf_eth_status_hardwarechannel, tvb, offset, 1, ENC_BIG_ENDIAN, &hardwarechannel); |
1313 | 0 | if ((flags & BLF_ETH_STATUS_HARDWARECHANNEL) == 0) { |
1314 | 0 | proto_item_append_text(ti, " - Invalid"); |
1315 | 0 | } |
1316 | 0 | offset += 1; |
1317 | | |
1318 | | /* uint32_t bitrate {}; */ |
1319 | 0 | ti = proto_tree_add_item(blf_tree, hf_blf_eth_status_bitrate, tvb, offset, 4, ENC_BIG_ENDIAN); |
1320 | 0 | if ((flags & BLF_ETH_STATUS_BITRATE) == 0) { |
1321 | 0 | proto_item_append_text(ti, " - Invalid"); |
1322 | 0 | } |
1323 | 0 | offset += 4; |
1324 | |
|
1325 | 0 | if ((int)tvb_captured_length(tvb) >= offset + 8) { |
1326 | | /* uint64_t linkUpDuration {}; */ |
1327 | 0 | ti = proto_tree_add_item(blf_tree, hf_blf_eth_status_linkupduration, tvb, offset, 8, ENC_BIG_ENDIAN); |
1328 | 0 | if ((flags & BLF_ETH_STATUS_LINKUPDURATION) == 0) { |
1329 | 0 | proto_item_append_text(ti, " - Invalid"); |
1330 | 0 | } |
1331 | 0 | } |
1332 | |
|
1333 | 0 | if ((flags & BLF_ETH_STATUS_LINKSTATUS) != 0) { |
1334 | 0 | if ((flags & BLF_ETH_STATUS_HARDWARECHANNEL) == 0) { |
1335 | 0 | col_add_fstr(pinfo->cinfo, COL_INFO, "ETH-%u %s", channel, val_to_str_const(linkstatus, blf_eth_status_linkstatus_vals, "Unknown")); |
1336 | 0 | } else { |
1337 | 0 | col_add_fstr(pinfo->cinfo, COL_INFO, "ETH-%u-%u %s", channel, hardwarechannel, val_to_str_const(linkstatus, blf_eth_status_linkstatus_vals, "Unknown")); |
1338 | 0 | } |
1339 | 0 | } |
1340 | |
|
1341 | 0 | return tvb_reported_length(tvb); |
1342 | 0 | } |
1343 | | |
1344 | | static int |
1345 | 0 | dissect_blf_ethernetphystate_obj(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_) { |
1346 | 0 | proto_item* ti; |
1347 | 0 | proto_tree* blf_tree; |
1348 | 0 | int offset = 0; |
1349 | |
|
1350 | 0 | static int* const flags1[] = { |
1351 | 0 | &hf_blf_eth_phy_state_flags1_b2, |
1352 | 0 | &hf_blf_eth_phy_state_flags1_b1, |
1353 | 0 | &hf_blf_eth_phy_state_flags1_b0, |
1354 | 0 | NULL |
1355 | 0 | }; |
1356 | |
|
1357 | 0 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "BLF Ethernet PHY State"); |
1358 | 0 | col_clear(pinfo->cinfo, COL_INFO); |
1359 | |
|
1360 | 0 | ti = proto_tree_add_item(tree, proto_blf_ethernetphystate_obj, tvb, offset, -1, ENC_NA); |
1361 | 0 | blf_tree = proto_item_add_subtree(ti, ett_blf); |
1362 | | |
1363 | | /* uint16_t channel {}; */ |
1364 | 0 | uint32_t channel; |
1365 | 0 | proto_tree_add_item_ret_uint(blf_tree, hf_blf_eth_phystate_channel, tvb, offset, 2, ENC_BIG_ENDIAN, &channel); |
1366 | 0 | offset += 2; |
1367 | | |
1368 | | /* uint16_t flags; */ |
1369 | 0 | uint16_t flags = tvb_get_ntohs(tvb, offset); |
1370 | 0 | proto_tree_add_bitmask_list(blf_tree, tvb, offset, 2, flags1, ENC_BIG_ENDIAN); |
1371 | 0 | offset += 2; |
1372 | | |
1373 | | /* uint8_t phyState {}; */ |
1374 | 0 | uint32_t phyState; |
1375 | 0 | ti = proto_tree_add_item_ret_uint(blf_tree, hf_blf_eth_phy_state_phystate, tvb, offset, 1, ENC_BIG_ENDIAN, &phyState); |
1376 | 0 | if ((flags & BLF_PHY_STATE_PHYSTATE) == 0) { |
1377 | 0 | proto_item_append_text(ti, " - Invalid"); |
1378 | 0 | } |
1379 | 0 | offset += 1; |
1380 | | |
1381 | | /* uint8_t eventState {}; */ |
1382 | 0 | uint32_t eventState; |
1383 | 0 | ti = proto_tree_add_item_ret_uint(blf_tree, hf_blf_eth_phy_state_eventstate, tvb, offset, 1, ENC_BIG_ENDIAN, &eventState); |
1384 | 0 | if ((flags & BLF_PHY_STATE_PHYEVENT) == 0) { |
1385 | 0 | proto_item_append_text(ti, " - Invalid"); |
1386 | 0 | } |
1387 | 0 | offset += 1; |
1388 | | |
1389 | | /* uint8_t hardwareChannel {}; */ |
1390 | 0 | uint32_t hardwareChannel; |
1391 | 0 | ti = proto_tree_add_item_ret_uint(blf_tree, hf_blf_eth_phy_state_hardwarechannel, tvb, offset, 1, ENC_BIG_ENDIAN, &hardwareChannel); |
1392 | 0 | if ((flags & BLF_PHY_STATE_HARDWARECHANNEL) == 0) { |
1393 | 0 | proto_item_append_text(ti, " - Invalid"); |
1394 | 0 | } |
1395 | 0 | offset += 1; |
1396 | | |
1397 | | /* uint8_t res1 {}; */ |
1398 | 0 | proto_tree_add_item(blf_tree, hf_blf_eth_phy_state_res1, tvb, offset, 1, ENC_BIG_ENDIAN); |
1399 | |
|
1400 | 0 | if ((flags & (BLF_PHY_STATE_PHYSTATE | BLF_PHY_STATE_PHYEVENT)) != 0) { |
1401 | | /* One of the two is valid */ |
1402 | 0 | if ((flags & BLF_PHY_STATE_HARDWARECHANNEL) == 0) { |
1403 | 0 | col_add_fstr(pinfo->cinfo, COL_INFO, "ETH-%u", channel); |
1404 | 0 | } |
1405 | 0 | else { |
1406 | 0 | col_add_fstr(pinfo->cinfo, COL_INFO, "ETH-%u-%u", channel, hardwareChannel); |
1407 | 0 | } |
1408 | 0 | if ((flags & BLF_PHY_STATE_PHYSTATE) != 0) { |
1409 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " - State: %s", val_to_str_const(phyState, blf_eth_phystate_phystate_vals, "Unknown")); |
1410 | 0 | } |
1411 | 0 | if ((flags & BLF_PHY_STATE_PHYEVENT) != 0) { |
1412 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " - Event: %s", val_to_str_const(eventState, blf_eth_phystate_eventstate_vals, "Unknown")); |
1413 | 0 | } |
1414 | 0 | } |
1415 | |
|
1416 | 0 | return tvb_reported_length(tvb); |
1417 | 0 | } |
1418 | | |
1419 | | |
1420 | | void |
1421 | 15 | proto_register_file_blf(void) { |
1422 | 15 | expert_module_t *expert_blf; |
1423 | | |
1424 | 15 | static hf_register_info hf[] = { |
1425 | 15 | { &hf_blf_file_header, |
1426 | 15 | { "File Header", "blf.file_header", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }}, |
1427 | 15 | { &hf_blf_file_header_magic, |
1428 | 15 | { "Magic", "blf.file_header.magic", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }}, |
1429 | 15 | { &hf_blf_file_header_length, |
1430 | 15 | { "Header Length", "blf.file_header.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1431 | 15 | { &hf_blf_file_header_api, |
1432 | 15 | { "API Version", "blf.file_header.api", FT_UINT32, BASE_CUSTOM, CF_FUNC(version_format), 0x00, NULL, HFILL }}, |
1433 | 15 | { &hf_blf_file_header_app, |
1434 | 15 | { "Application", "blf.file_header.application", FT_UINT8, BASE_DEC, VALS(application_names), 0x00, NULL, HFILL }}, |
1435 | 15 | { &hf_blf_file_header_comp_level, |
1436 | 15 | { "Compression Level", "blf.file_header.compression_level", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1437 | 15 | { &hf_blf_file_header_app_major, |
1438 | 15 | { "Application Major Version", "blf.file_header.application_major", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1439 | 15 | { &hf_blf_file_header_app_minor, |
1440 | 15 | { "Application Minor Version", "blf.file_header.application_minor", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1441 | 15 | { &hf_blf_file_header_len_comp, |
1442 | 15 | { "Length (compressed)", "blf.file_header.length_compressed", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1443 | 15 | { &hf_blf_file_header_len_uncomp, |
1444 | 15 | { "Length (uncompressed)", "blf.file_header.length_uncompressed", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1445 | 15 | { &hf_blf_file_header_obj_count, |
1446 | 15 | { "Object Count", "blf.file_header.object_count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1447 | 15 | { &hf_blf_file_header_app_build, |
1448 | 15 | { "Application Build", "blf.file_header.application_build", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1449 | 15 | { &hf_blf_file_header_start_date, |
1450 | 15 | { "Start Date", "blf.file_header.start_date", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x00, NULL, HFILL }}, |
1451 | 15 | { &hf_blf_file_header_end_date, |
1452 | 15 | { "End Date", "blf.file_header.end_date", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x00, NULL, HFILL }}, |
1453 | 15 | { &hf_blf_file_header_restore_point_offset, |
1454 | 15 | { "Restore Point Offset", "blf.file_header.restore_point_offset", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1455 | | |
1456 | 15 | { &hf_blf_lobj, |
1457 | 15 | { "Object", "blf.object", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }}, |
1458 | 15 | { &hf_blf_lobj_hdr, |
1459 | 15 | { "Object Header", "blf.object.header", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }}, |
1460 | 15 | { &hf_blf_lobj_magic, |
1461 | 15 | { "Magic", "blf.object.header.magic", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }}, |
1462 | 15 | { &hf_blf_lobj_hdr_len, |
1463 | 15 | { "Header Length", "blf.object.header.header_length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1464 | 15 | { &hf_blf_lobj_hdr_type, |
1465 | 15 | { "Header Type", "blf.object.header.header_type", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1466 | 15 | { &hf_blf_lobj_obj_len, |
1467 | 15 | { "Object Length", "blf.object.header.object_length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1468 | 15 | { &hf_blf_lobj_obj_type, |
1469 | 15 | { "Object Type", "blf.object.header.object_type", FT_UINT32, BASE_DEC, VALS(blf_object_names), 0x00, NULL, HFILL }}, |
1470 | 15 | { &hf_blf_lobj_obj_flags, |
1471 | 15 | { "Object Flags", "blf.object.header.object_flags", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL }}, |
1472 | 15 | { &hf_blf_lobj_obj_flags_time_ten_ms, |
1473 | 15 | { "Time Resolution 10ms", "blf.object.header.object_flags.timeres_ten_ms", FT_BOOLEAN, 32, NULL, 0x00000001, NULL, HFILL } }, |
1474 | 15 | { &hf_blf_lobj_obj_flags_time_one_ns, |
1475 | 15 | { "Time Resolution 1ns", "blf.object.header.object_flags.timeres_one_ms", FT_BOOLEAN, 32, NULL, 0x00000002, NULL, HFILL } }, |
1476 | 15 | { &hf_blf_lobj_client_index, |
1477 | 15 | { "Client Index", "blf.object.header.client_index", FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL }}, |
1478 | 15 | { &hf_blf_lobj_time_stamp_status, |
1479 | 15 | { "Time Stamp Status", "blf.object.header.time_stamp_status", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL }}, |
1480 | 15 | { &hf_blf_lobj_reserved, |
1481 | 15 | { "Reserved", "blf.object.header.reserved", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL }}, |
1482 | 15 | { &hf_blf_lobj_obj_version, |
1483 | 15 | { "Object Version", "blf.object.header.object_version", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1484 | 15 | { &hf_blf_lobj_obj_timestamp, |
1485 | 15 | { "Object Timestamp", "blf.object.header.object_timestamp", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1486 | 15 | { &hf_blf_lobj_org_timestamp, |
1487 | 15 | { "Original Timestamp", "blf.object.header.original_timestamp", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1488 | | |
1489 | 15 | { &hf_blf_lobj_hdr_remains, |
1490 | 15 | { "Header unparsed", "blf.object.header.unparsed", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }}, |
1491 | 15 | { &hf_blf_lobj_payload, |
1492 | 15 | { "Payload", "blf.object.payload", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }}, |
1493 | 15 | { &hf_blf_lobj_payload_channel_8bit, |
1494 | 15 | { "Channel", "blf.object.payload.channel_8bit", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1495 | 15 | { &hf_blf_lobj_payload_channel_16bit, |
1496 | 15 | { "Channel", "blf.object.payload.channel_16bit", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1497 | | |
1498 | 15 | { &hf_blf_cont_comp_method, |
1499 | 15 | { "Compression Method", "blf.object.logcontainer.compression_method", FT_UINT16, BASE_HEX, VALS(blf_compression_names), 0x00, NULL, HFILL }}, |
1500 | 15 | { &hf_blf_cont_res1, |
1501 | 15 | { "Reserved", "blf.object.logcontainer.res1", FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL }}, |
1502 | 15 | { &hf_blf_cont_res2, |
1503 | 15 | { "Reserved", "blf.object.logcontainer.res2", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL }}, |
1504 | 15 | { &hf_blf_cont_uncomp_size, |
1505 | 15 | { "Uncompressed Length", "blf.object.logcontainer.uncompressed_length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1506 | 15 | { &hf_blf_cont_res4, |
1507 | 15 | { "Reserved", "blf.object.logcontainer.res4", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL }}, |
1508 | 15 | { &hf_blf_cont_payload, |
1509 | 15 | { "Payload", "blf.object.logcontainer.payload", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }}, |
1510 | 15 | { &hf_blf_app_text_source, |
1511 | 15 | { "Source", "blf.object.app_text.source", FT_UINT32, BASE_DEC, VALS(blf_app_text_source_vals), 0x00, NULL, HFILL }}, |
1512 | 15 | { &hf_blf_app_text_reservedapptext1, |
1513 | 15 | { "reservedAppText1", "blf.object.app_text.reservedapptext1", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1514 | 15 | { &hf_blf_app_text_textlength, |
1515 | 15 | { "Text length", "blf.object.app_text.textlength", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1516 | 15 | { &hf_blf_app_text_reservedapptext2, |
1517 | 15 | { "reservedAppText2", "blf.object.app_text.reservedapptext2", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1518 | 15 | { &hf_blf_app_text_data_version, |
1519 | 15 | { "Version", "blf.object.app_text.version", FT_UINT32, BASE_DEC, NULL, 0x000000ff, NULL, HFILL }}, |
1520 | 15 | { &hf_blf_app_text_channelno, |
1521 | 15 | { "Channel number", "blf.object.app_text.channelno", FT_UINT32, BASE_DEC, NULL, 0x0000ff00, NULL, HFILL }}, |
1522 | 15 | { &hf_blf_app_text_busstype, |
1523 | 15 | { "Bus type", "blf.object.app_text.bustype", FT_UINT32, BASE_DEC, VALS(blf_bustype_vals), 0x00ff0000, NULL, HFILL}}, |
1524 | 15 | { &hf_blf_app_text_can_fd_channel, |
1525 | 15 | { "CAN FD-Channel", "blf.object.app_text.can_fd_channel", FT_BOOLEAN, 32, NULL, 0x01000000, NULL, HFILL }}, |
1526 | 15 | { &hf_blf_app_text_metadata_remaining_length, |
1527 | 15 | { "Remaining length", "blf.object.app_text.remaining_length", FT_UINT32, BASE_DEC, NULL, 0x00ffffff, NULL, HFILL }}, |
1528 | 15 | { &hf_blf_app_text_metadata_type, |
1529 | 15 | { "Metadata type", "blf.object.app_text.metadata_type", FT_UINT32, BASE_DEC, VALS(blf_app_text_metadata_type_vals), 0xff000000, NULL, HFILL}}, |
1530 | 15 | { &hf_blf_app_text_traceline_source, |
1531 | 15 | { "Metadata type", "blf.object.app_text.traceline_source", FT_UINT32, BASE_DEC, VALS(hf_blf_app_text_traceline_source_vals), 0x0000000f, NULL, HFILL}}, |
1532 | 15 | { &hf_blf_app_text_traceline_display_in_tracewindow, |
1533 | 15 | { "Display in trace window", "blf.object.app_text.display_in_tracewindow", FT_BOOLEAN, 32, NULL, 0x00000010, NULL, HFILL}}, |
1534 | 15 | { &hf_blf_app_text_traceline_ascii_conversion_wo_comment_indicator_timestamp, |
1535 | 15 | { "ASCII conversion should be done without comment indicator and timestamp", "blf.object.app_text.ascii_conversion_wo_comment_indicator_timestamp", FT_BOOLEAN, 32, NULL, 0x00000020, NULL, HFILL}}, |
1536 | 15 | { &hf_blf_app_text_text, |
1537 | 15 | { "Text", "blf.object.app_text.text", FT_STRINGZPAD, BASE_NONE, NULL, 0x00, NULL, HFILL }}, |
1538 | 15 | { &hf_blf_trigg_cond_state, |
1539 | 15 | { "State", "blf.object.trigg_con.state", FT_UINT32, BASE_DEC, VALS(blf_trigger_cond_state_vals), 0x00, NULL, HFILL}}, |
1540 | 15 | { &hf_blf_trigg_cond_triggerblocknamelength, |
1541 | 15 | { "Trigger blockname length", "blf.object.trigg_con.triggerblocknamelength", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1542 | 15 | { &hf_blf_trigg_cond_triggerconditionlength, |
1543 | 15 | { "Trigger condition length", "blf.object.trigg_con.triggerconditionlength", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1544 | 15 | { &hf_blf_trigg_cond_triggerblockname, |
1545 | 15 | { "Trigger blockname", "blf.object.trigg_con.triggerblockname", FT_STRINGZPAD, BASE_NONE, NULL, 0x00, NULL, HFILL }}, |
1546 | 15 | { &hf_blf_trigg_cond_triggercondition, |
1547 | 15 | { "Trigger condition", "blf.object.trigg_con.triggercondition", FT_STRINGZPAD, BASE_NONE, NULL, 0x00, NULL, HFILL }}, |
1548 | 15 | { &hf_blf_sys_var_type, |
1549 | 15 | { "Type", "blf.object.sys_var.type", FT_UINT32, BASE_DEC, VALS(blf_sys_var_type_vals), 0x00, NULL, HFILL}}, |
1550 | 15 | { &hf_blf_sys_var_rep, |
1551 | 15 | { "Representation", "blf.object.sys_var.representation", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1552 | 15 | { &hf_blf_sys_var_reservedsystemvariable1, |
1553 | 15 | { "Reserved systemvariable 1", "blf.object.sys_var.reservedsystemvariable1", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1554 | 15 | { &hf_blf_sys_var_namelength, |
1555 | 15 | { "Name length", "blf.object.sys_var.namelength", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL}}, |
1556 | 15 | { &hf_blf_sys_var_datalength, |
1557 | 15 | { "Data length", "blf.object.sys_var.datalength", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL}}, |
1558 | 15 | { &hf_blf_sys_var_reservedsystemvariable2, |
1559 | 15 | { "Reserved systemvariable 2", "blf.object.sys_var.reservedsystemvariable2", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL }}, |
1560 | 15 | { &hf_blf_sys_var_name, |
1561 | 15 | { "Name", "blf.object.sys_var.name", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, |
1562 | 15 | { &hf_blf_sys_var_data, |
1563 | 15 | { "Data", "blf.object.sys_var.data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, |
1564 | 15 | { &hf_blf_eth_status_channel, |
1565 | 15 | { "Channel", "blf.object.eth_status.channel", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1566 | 15 | { &hf_blf_eth_status_flags1_b0, |
1567 | 15 | { "LinkStatus", "blf.object.eth_status.flags.b0", FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL } }, |
1568 | 15 | { &hf_blf_eth_status_flags1_b1, |
1569 | 15 | { "Bitrate", "blf.object.eth_status.flags.b1", FT_BOOLEAN, 16, NULL, 0x0002, NULL, HFILL } }, |
1570 | 15 | { &hf_blf_eth_status_flags1_b2, |
1571 | 15 | { "EthernetPhy", "blf.object.eth_status.flags.b2", FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL } }, |
1572 | 15 | { &hf_blf_eth_status_flags1_b3, |
1573 | 15 | { "Duplex", "blf.object.eth_status.flags.b3", FT_BOOLEAN, 16, NULL, 0x0008, NULL, HFILL } }, |
1574 | 15 | { &hf_blf_eth_status_flags1_b4, |
1575 | 15 | { "MdiType", "blf.object.eth_status.flags.b4", FT_BOOLEAN, 16, NULL, 0x0010, NULL, HFILL } }, |
1576 | 15 | { &hf_blf_eth_status_flags1_b5, |
1577 | 15 | { "Connector", "blf.object.eth_status.flags.b5", FT_BOOLEAN, 16, NULL, 0x0020, NULL, HFILL } }, |
1578 | 15 | { &hf_blf_eth_status_flags1_b6, |
1579 | 15 | { "ClockMode", "blf.object.eth_status.flags.b6", FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL } }, |
1580 | 15 | { &hf_blf_eth_status_flags1_b7, |
1581 | 15 | { "BrPair", "blf.object.eth_status.flags.b7", FT_BOOLEAN, 16, NULL, 0x0080, NULL, HFILL } }, |
1582 | 15 | { &hf_blf_eth_status_flags1_b8, |
1583 | 15 | { "HardwareChannel", "blf.object.eth_status.flags.b8", FT_BOOLEAN, 16, NULL, 0x0100, NULL, HFILL } }, |
1584 | 15 | { &hf_blf_eth_status_flags1_b9, |
1585 | 15 | { "Link up duration", "blf.object.eth_status.flags.b9", FT_BOOLEAN, 16, NULL, 0x0200, NULL, HFILL } }, |
1586 | 15 | { &hf_blf_eth_status_linkstatus, |
1587 | 15 | { "Link status", "blf.object.eth_status.linkstatus", FT_UINT8, BASE_DEC, VALS(blf_eth_status_linkstatus_vals), 0x00, NULL, HFILL}}, |
1588 | 15 | { &hf_blf_eth_status_ethernetphy, |
1589 | 15 | { "Ethernet PHY", "blf.object.eth_status.ethernetphy", FT_UINT8, BASE_DEC, VALS(blf_eth_status_ethernetphy_vals), 0x00, NULL, HFILL}}, |
1590 | 15 | { &hf_blf_eth_status_duplex, |
1591 | 15 | { "Duplex", "blf.object.eth_status.duplex", FT_UINT8, BASE_DEC, VALS(blf_eth_status_duplex_vals), 0x00, NULL, HFILL}}, |
1592 | 15 | { &hf_blf_eth_status_mdi, |
1593 | 15 | { "MDI", "blf.object.eth_status.mdi", FT_UINT8, BASE_DEC, VALS(blf_eth_status_mdi_vals), 0x00, NULL, HFILL}}, |
1594 | 15 | { &hf_blf_eth_status_connector, |
1595 | 15 | { "Connector", "blf.object.eth_status.connector", FT_UINT8, BASE_DEC, VALS(blf_eth_status_connector_vals), 0x00, NULL, HFILL}}, |
1596 | 15 | { &hf_blf_eth_status_clockmode, |
1597 | 15 | { "Clock mode", "blf.object.eth_status.clockmode", FT_UINT8, BASE_DEC, VALS(blf_eth_status_clockmode_vals), 0x00, NULL, HFILL}}, |
1598 | 15 | { &hf_blf_eth_status_pairs, |
1599 | 15 | { "Pairs", "blf.object.eth_status.pairs", FT_UINT8, BASE_DEC, VALS(blf_eth_status_pairs_vals), 0x00, NULL, HFILL}}, |
1600 | 15 | { &hf_blf_eth_status_hardwarechannel, |
1601 | 15 | { "Hardware channel", "blf.object.eth_status.hardwarechannel", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1602 | 15 | { &hf_blf_eth_status_bitrate, |
1603 | 15 | { "Bitrate (kbps)", "blf.object.eth_status.bitrate", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1604 | 15 | { &hf_blf_eth_status_linkupduration, |
1605 | 15 | { "Link up duration (ns)", "blf.object.eth_status.linkupduration", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1606 | 15 | { &hf_blf_eth_frame_ext_structlength, |
1607 | 15 | { "Struct length", "blf.object.eth_frame_ext.structlength", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1608 | 15 | { &hf_blf_eth_frame_ext_flags, |
1609 | 15 | { "Flags", "blf.object.eth_frame_ext.flags", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1610 | 15 | { &hf_blf_eth_frame_ext_channel, |
1611 | 15 | { "Channel", "blf.object.eth_frame_ext.channel", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1612 | 15 | { &hf_blf_eth_frame_ext_hardwarechannel, |
1613 | 15 | { "Hardware Channel", "blf.object.eth_frame_ext.hardwarechannel", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1614 | 15 | { &hf_blf_eth_frame_ext_frameduration, |
1615 | 15 | { "Frame duration", "blf.object.eth_frame_ext.frameduration", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1616 | 15 | { &hf_blf_eth_frame_ext_framechecksum, |
1617 | 15 | { "Frame checksum", "blf.object.eth_frame_ext.framechecksum", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1618 | 15 | { &hf_blf_eth_frame_ext_dir, |
1619 | 15 | { "Dir", "blf.object.eth_frame_ext.dir", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1620 | 15 | { &hf_blf_eth_frame_ext_framelength, |
1621 | 15 | { "Frame length", "blf.object.eth_frame_ext.frame_length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1622 | 15 | { &hf_blf_eth_frame_ext_framehandle, |
1623 | 15 | { "Frame handle", "blf.object.eth_frame_ext.frame_handle", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1624 | 15 | { &hf_blf_eth_frame_ext_reservedethernetframeex, |
1625 | 15 | { "Reserved ethernet frame ex", "blf.object.eth_frame_ext.reservedethernetframeex", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1626 | 15 | { &hf_blf_eth_phystate_channel, |
1627 | 15 | { "Channel", "blf.object.eth_phy_state.channel", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1628 | 15 | { &hf_blf_eth_phy_state_flags1_b0, |
1629 | 15 | { "PHYState", "blf.object.eth_phy_state.flags.b0", FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL } }, |
1630 | 15 | { &hf_blf_eth_phy_state_flags1_b1, |
1631 | 15 | { "PHYEvent", "blf.object.eth_phy_state.flags.b1", FT_BOOLEAN, 16, NULL, 0x0002, NULL, HFILL } }, |
1632 | 15 | { &hf_blf_eth_phy_state_flags1_b2, |
1633 | 15 | { "HardwareChannel", "blf.object.eth_phy_state.flags.b2", FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL } }, |
1634 | 15 | { &hf_blf_eth_phy_state_phystate, |
1635 | 15 | { "PHY state", "blf.object.eth_status.phystate", FT_UINT8, BASE_DEC, VALS(blf_eth_phystate_phystate_vals), 0x00, NULL, HFILL} }, |
1636 | 15 | { &hf_blf_eth_phy_state_eventstate, |
1637 | 15 | { "Event state", "blf.object.eth_status.eventstate", FT_UINT8, BASE_DEC, VALS(blf_eth_phystate_eventstate_vals), 0x00, NULL, HFILL} }, |
1638 | 15 | { &hf_blf_eth_phy_state_hardwarechannel, |
1639 | 15 | { "Hardware channel", "blf.object.eth_status.hardwarechannel", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1640 | 15 | { &hf_blf_eth_phy_state_res1, |
1641 | 15 | { "Reserved", "blf.object.eth_status.res1", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1642 | | |
1643 | 15 | { &hf_blf_canxl_tx_count_number, |
1644 | 15 | { "Number of TX attempts", "blf.object.canxl_channel_frame.tx_attempts", FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL} }, |
1645 | 15 | { &hf_blf_canxl_tx_count_attempts, |
1646 | 15 | { "Max number of TX attempts", "blf.object.canxl_channel_frame.max_attempts", FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL} }, |
1647 | 15 | { &hf_blf_canxl_tx_dir, |
1648 | 15 | { "Direction", "blf.object.canxl_channel_frame.dir", FT_UINT8, BASE_DEC, VALS(blf_direction), 0x00, NULL, HFILL}}, |
1649 | 15 | { &hf_blf_canxl_res1, |
1650 | 15 | { "Reserved1", "blf.object.canxl_channel_frame.reserved1", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1651 | 15 | { &hf_blf_canxl_frame_duration_in_ns, |
1652 | 15 | { "Frame duration", "blf.object.canxl_channel_frame.frameduration_in_ns", FT_UINT32, BASE_DEC | BASE_UNIT_STRING, UNS(&units_nanoseconds), 0x00, NULL, HFILL} }, |
1653 | 15 | { &hf_blf_canxl_bit_count, |
1654 | 15 | { "Bit Count", "blf.object.canxl_channel_frame.bit_count", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1655 | 15 | { &hf_blf_canxl_res2, |
1656 | 15 | { "Reserved2", "blf.object.canxl_channel_frame.reserved2", FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1657 | 15 | { &hf_blf_canxl_id, |
1658 | 15 | { "Frame ID", "blf.object.canxl_channel_frame.frame_id", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1659 | 15 | { &hf_blf_canxl_sdt, |
1660 | 15 | { "Service Data Unit", "blf.object.canxl_channel_frame.sdt", FT_UINT8, BASE_HEX, VALS(canxl_sdu_type_vals), 0x00, NULL, HFILL}}, |
1661 | 15 | { &hf_blf_canxl_res3, |
1662 | 15 | { "Reserved3", "blf.object.canxl_channel_frame.reserved3", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1663 | 15 | { &hf_blf_canxl_dlc, |
1664 | 15 | { "Data Length Code", "blf.object.canxl_channel_frame.dlc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL}}, |
1665 | 15 | { &hf_blf_canxl_data_length, |
1666 | 15 | { "Data Length", "blf.object.canxl_channel_frame.data_length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1667 | 15 | { &hf_blf_canxl_sbc, |
1668 | 15 | { "Stuff Bit Count", "blf.object.canxl_channel_frame.sbc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1669 | 15 | { &hf_blf_canxl_pcrc, |
1670 | 15 | { "Preface CRC", "blf.object.canxl_channel_frame.pcrc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1671 | 15 | { &hf_blf_canxl_vcid, |
1672 | 15 | { "VCID", "blf.object.canxl_channel_frame.vcid", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1673 | 15 | { &hf_blf_canxl_res4, |
1674 | 15 | { "Reserved4", "blf.object.canxl_channel_frame.reserved4", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1675 | 15 | { &hf_blf_canxl_af, |
1676 | 15 | { "Acceptance Field", "blf.object.canxl_channel_frame.af", FT_UINT32, BASE_DEC_HEX, NULL, 0x00, NULL, HFILL} }, |
1677 | 15 | { &hf_blf_canxl_stuff_count, |
1678 | 15 | { "Stuff Count", "blf.object.canxl_channel_frame.stuff_count", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL} }, |
1679 | 15 | { &hf_blf_canxl_res5, |
1680 | 15 | { "Reserved5", "blf.object.canxl_channel_frame.reserved5", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1681 | 15 | { &hf_blf_canxl_res6, |
1682 | 15 | { "Reserved6", "blf.object.canxl_channel_frame.reserved6", FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1683 | 15 | { &hf_blf_canxl_fcrc, |
1684 | 15 | { "Frame CRC", "blf.object.canxl_channel_frame.fcrc", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1685 | 15 | { &hf_blf_canxl_time_offset_brs, |
1686 | 15 | { "Time Offset BRS", "blf.object.canxl_channel_frame.time_offset_brs", FT_UINT32, BASE_DEC | BASE_UNIT_STRING, UNS(&units_nanoseconds), 0x00, NULL, HFILL} }, |
1687 | 15 | { &hf_blf_canxl_time_offset_crc_delim, |
1688 | 15 | { "Time Offset CRC Delim", "blf.object.canxl_channel_frame.time_offset_crc_delim", FT_UINT32, BASE_DEC | BASE_UNIT_STRING, UNS(&units_nanoseconds), 0x00, NULL, HFILL} }, |
1689 | 15 | { &hf_blf_canxl_flags, |
1690 | 15 | { "Flags", "blf.object.canxl_channel_frame.flags", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1691 | 15 | { &hf_blf_canxl_res, |
1692 | 15 | { "Reserved", "blf.object.canxl_channel_frame.reserved", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1693 | 15 | { &hf_blf_canxl_arbitration_data_bit_timing, |
1694 | 15 | { "Arbitration Data: Bit Timing", "blf.object.canxl_channel_frame.arbitration_data.bit_timing", FT_UINT64, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1695 | 15 | { &hf_blf_canxl_arbitration_data_hardware_channel_setting, |
1696 | 15 | { "Arbitration Data: HW Channel Setting", "blf.object.canxl_channel_frame.arbitration_data.hw_channel_set", FT_UINT64, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1697 | 15 | { &hf_blf_canxl_fd_phase_bit_timing, |
1698 | 15 | { "FD Phase: Bit Timing", "blf.object.canxl_channel_frame.fd_phase.bit_timing", FT_UINT64, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1699 | 15 | { &hf_blf_canxl_fd_phasea_hardware_channel_setting, |
1700 | 15 | { "FD Phase: HW Channel Setting", "blf.object.canxl_channel_frame.fd_phase.hw_channel_set", FT_UINT64, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1701 | 15 | { &hf_blf_canxl_xl_phase_bit_timing, |
1702 | 15 | { "XL Phase: Bit Timing", "blf.object.canxl_channel_frame.xl_phase.bit_timing", FT_UINT64, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1703 | 15 | { &hf_blf_canxl_xl_phase_hardware_channel_setting, |
1704 | 15 | { "XL Phase: HW Channel Setting", "blf.object.canxl_channel_frame.xl_phase.hw_channel_set", FT_UINT64, BASE_HEX, NULL, 0x00, NULL, HFILL} }, |
1705 | 15 | { &hf_blf_canxl_data, |
1706 | 15 | { "Data", "blf.object.canxl_channel_frame.data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, |
1707 | 15 | }; |
1708 | | |
1709 | 15 | static ei_register_info ei[] = { |
1710 | 15 | { &ei_blf_file_header_length_too_short, |
1711 | 15 | { "blf.file_header_length_too_short", PI_MALFORMED, PI_ERROR, |
1712 | 15 | "file header length is too short", |
1713 | 15 | EXPFILL }}, |
1714 | 15 | { &ei_blf_object_header_length_too_short, |
1715 | 15 | { "blf.object_header_length_too_short", PI_MALFORMED, PI_ERROR, |
1716 | 15 | "object header length is too short", |
1717 | 15 | EXPFILL }}, |
1718 | 15 | { &ei_blf_object_length_less_than_header_length, |
1719 | 15 | { "blf.object_length_less_than_header_length", PI_MALFORMED, PI_ERROR, |
1720 | 15 | "object length is less than the object header length", |
1721 | 15 | EXPFILL }}, |
1722 | 15 | }; |
1723 | | |
1724 | 15 | static int *ett[] = { |
1725 | 15 | &ett_blf, |
1726 | 15 | &ett_blf_header, |
1727 | 15 | &ett_blf_obj, |
1728 | 15 | &ett_blf_obj_header, |
1729 | 15 | &ett_blf_obj_header_flags, |
1730 | 15 | &ett_blf_obj_payload, |
1731 | 15 | &ett_blf_logcontainer_payload, |
1732 | 15 | &ett_blf_app_text_payload, |
1733 | 15 | }; |
1734 | | |
1735 | 15 | proto_blf = proto_register_protocol("BLF File Format", "File-BLF", "file-blf"); |
1736 | 15 | proto_blf_ethernetstatus_obj = proto_register_protocol("BLF Ethernet Status", "BLF-Ethernet-Status", "blf-ethernet-status"); |
1737 | 15 | proto_blf_ethernetphystate_obj = proto_register_protocol("BLF Ethernet PHY State", "BLF-Ethernet-PHY-State", "blf-ethernet-phystate"); |
1738 | 15 | expert_blf = expert_register_protocol(proto_blf); |
1739 | 15 | expert_register_field_array(expert_blf, ei, array_length(ei)); |
1740 | | |
1741 | 15 | proto_register_field_array(proto_blf, hf, array_length(hf)); |
1742 | 15 | proto_register_subtree_array(ett, array_length(ett)); |
1743 | | |
1744 | 15 | register_dissector("file-blf", dissect_blf, proto_blf); |
1745 | 15 | register_dissector("blf-ethernetstatus-obj", dissect_blf_ethernetstatus_obj, proto_blf_ethernetstatus_obj); |
1746 | 15 | register_dissector("blf-ethernetphystate-obj", dissect_blf_ethernetphystate_obj, proto_blf_ethernetphystate_obj); |
1747 | 15 | } |
1748 | | |
1749 | | void |
1750 | 15 | proto_reg_handoff_file_blf(void) { |
1751 | 15 | heur_dissector_add("wtap_file", dissect_blf_heur, "BLF File", "blf_wtap", proto_blf, HEURISTIC_ENABLE); |
1752 | 15 | xml_handle = find_dissector_add_dependency("xml", proto_blf); |
1753 | 15 | } |
1754 | | |
1755 | | /* |
1756 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
1757 | | * |
1758 | | * Local Variables: |
1759 | | * c-basic-offset: 4 |
1760 | | * tab-width: 8 |
1761 | | * indent-tabs-mode: nil |
1762 | | * End: |
1763 | | * |
1764 | | * ex: set shiftwidth=4 tabstop=8 expandtab: |
1765 | | * :indentSize=4:tabSize=8:noTabs=true: |
1766 | | */ |