3 * Updated routines for Gryphon protocol packet dissection
4 * By Mark C. <markc@dgtech.com>
5 * Copyright (C) 2018 DG Technologies, Inc. (Dearborn Group, Inc.) USA
7 * Routines for Gryphon protocol packet disassembly
8 * By Steve Limkemann <stevelim@dgtech.com>
9 * Copyright 1998 Steve Limkemann
11 * Wireshark - Network traffic analyzer
12 * By Gerald Combs <gerald@wireshark.org>
13 * Copyright 1998 Gerald Combs
15 * SPDX-License-Identifier: GPL-2.0-or-later
17 * Specification: http://www.dgtech.com/product/gryphon/manual/html/GCprotocol/
23 #include <epan/packet.h>
24 #include <epan/prefs.h>
25 #include <epan/expert.h>
26 #include <epan/proto_data.h>
27 #include <epan/conversation.h>
28 #include <epan/dissectors/packet-tcp.h>
30 #include <wsutil/array.h>
31 #include <wsutil/str_util.h>
32 #include "packet-gryphon.h"
37 * https://www.dgtech.com/product/gryphon/manual/html/GCprotocol/
40 void proto_register_gryphon(void);
41 void proto_reg_handoff_gryphon(void);
43 static dissector_handle_t gryphon_handle
;
45 #define GRYPHON_TCP_PORT 7000 /* Not IANA registed */
47 static int proto_gryphon
;
49 static int hf_gryphon_src
;
50 static int hf_gryphon_srcchan
;
51 static int hf_gryphon_srcchanclient
;
52 static int hf_gryphon_dest
;
53 static int hf_gryphon_destchan
;
54 static int hf_gryphon_destchanclient
;
55 static int hf_gryphon_type
;
56 static int hf_gryphon_cmd
;
57 static int hf_gryphon_cmd_context
;
58 static int hf_gryphon_cmd_ioctl_context
;
59 static int hf_gryphon_data
;
60 static int hf_gryphon_data_length
;
61 static int hf_gryphon_reserved
;
62 static int hf_gryphon_padding
;
63 static int hf_gryphon_ignored
;
64 static int hf_gryphon_wait_flags
;
65 static int hf_gryphon_wait_resp
;
66 static int hf_gryphon_wait_prev_resp
;
67 static int hf_gryphon_status
;
68 static int hf_gryphon_response_in
;
69 static int hf_gryphon_response_to
;
70 static int hf_gryphon_response_time
;
71 static int hf_gryphon_data_header_length
;
72 static int hf_gryphon_data_header_length_bits
;
73 static int hf_gryphon_data_data_length
;
74 static int hf_gryphon_data_extra_data_length
;
75 static int hf_gryphon_data_mode
;
76 static int hf_gryphon_data_mode_transmitted
;
77 static int hf_gryphon_data_mode_receive
;
78 static int hf_gryphon_data_mode_local
;
79 static int hf_gryphon_data_mode_remote
;
80 static int hf_gryphon_data_mode_oneshot
;
81 static int hf_gryphon_data_mode_combined
;
82 static int hf_gryphon_data_mode_nomux
;
83 static int hf_gryphon_data_mode_internal
;
84 static int hf_gryphon_data_priority
;
85 static int hf_gryphon_data_error_status
;
86 static int hf_gryphon_data_time
;
87 static int hf_gryphon_data_context
;
88 static int hf_gryphon_data_header_data
;
89 static int hf_gryphon_data_data
;
90 static int hf_gryphon_data_extra_data
;
91 static int hf_gryphon_data_padding
;
92 static int hf_gryphon_event_id
;
93 static int hf_gryphon_event_context
;
94 static int hf_gryphon_event_time
;
95 static int hf_gryphon_event_data
;
96 static int hf_gryphon_event_padding
;
97 static int hf_gryphon_misc_text
;
98 static int hf_gryphon_misc_padding
;
99 static int hf_gryphon_eventnum
;
100 static int hf_gryphon_resp_time
;
101 static int hf_gryphon_setfilt
;
102 static int hf_gryphon_setfilt_length
;
103 static int hf_gryphon_setfilt_discard_data
;
104 static int hf_gryphon_setfilt_padding
;
105 static int hf_gryphon_ioctl
;
106 static int hf_gryphon_ioctl_nbytes
;
107 static int hf_gryphon_ioctl_data
;
108 static int hf_gryphon_addfilt_pass
;
109 static int hf_gryphon_addfilt_active
;
110 static int hf_gryphon_addfilt_blocks
;
111 static int hf_gryphon_addfilt_handle
;
112 static int hf_gryphon_modfilt
;
113 static int hf_gryphon_modfilt_action
;
114 static int hf_gryphon_filthan
;
115 static int hf_gryphon_filthan_id
;
116 static int hf_gryphon_filthan_padding
;
117 static int hf_gryphon_dfiltmode
;
118 static int hf_gryphon_filtmode
;
119 static int hf_gryphon_event_name
;
120 static int hf_gryphon_register_username
;
121 static int hf_gryphon_register_password
;
122 static int hf_gryphon_register_client_id
;
123 static int hf_gryphon_register_privileges
;
124 static int hf_gryphon_getspeeds_set_ioctl
;
125 static int hf_gryphon_getspeeds_get_ioctl
;
126 static int hf_gryphon_getspeeds_size
;
127 static int hf_gryphon_getspeeds_preset
;
128 static int hf_gryphon_getspeeds_data
;
129 static int hf_gryphon_cmd_sort
;
130 static int hf_gryphon_cmd_optimize
;
131 static int hf_gryphon_config_device_name
;
132 static int hf_gryphon_config_device_version
;
133 static int hf_gryphon_config_device_serial_number
;
134 static int hf_gryphon_config_num_channels
;
135 static int hf_gryphon_config_name_version_ext
;
136 static int hf_gryphon_config_driver_name
;
137 static int hf_gryphon_config_driver_version
;
138 static int hf_gryphon_config_device_security
;
139 static int hf_gryphon_config_max_data_length
;
140 static int hf_gryphon_config_min_data_length
;
141 static int hf_gryphon_config_hardware_serial_number
;
142 static int hf_gryphon_config_protocol_type
;
143 static int hf_gryphon_config_channel_id
;
144 static int hf_gryphon_config_card_slot_number
;
145 static int hf_gryphon_config_max_extra_data
;
146 static int hf_gryphon_config_min_extra_data
;
147 static int hf_gryphon_sched_num_iterations
;
148 static int hf_gryphon_sched_flags
;
149 static int hf_gryphon_sched_flags_scheduler
;
150 static int hf_gryphon_sched_sleep
;
151 static int hf_gryphon_sched_transmit_count
;
152 static int hf_gryphon_sched_transmit_period
;
153 static int hf_gryphon_sched_transmit_flags
;
154 static int hf_gryphon_sched_skip_transmit_period
;
155 static int hf_gryphon_sched_skip_sleep
;
156 static int hf_gryphon_sched_channel
;
157 static int hf_gryphon_sched_channel0
;
158 static int hf_gryphon_sched_rep_id
;
159 static int hf_gryphon_sched_rep_message_index
;
160 static int hf_gryphon_blm_data_time
;
161 static int hf_gryphon_blm_data_bus_load
;
162 static int hf_gryphon_blm_data_current_bus_load
;
163 static int hf_gryphon_blm_data_peak_bus_load
;
164 static int hf_gryphon_blm_data_historic_peak_bus_load
;
165 static int hf_gryphon_blm_stat_receive_frame_count
;
166 static int hf_gryphon_blm_stat_transmit_frame_count
;
167 static int hf_gryphon_blm_stat_receive_dropped_frame_count
;
168 static int hf_gryphon_blm_stat_transmit_dropped_frame_count
;
169 static int hf_gryphon_blm_stat_receive_error_count
;
170 static int hf_gryphon_blm_stat_transmit_error_count
;
171 static int hf_gryphon_addresp_flags
;
172 static int hf_gryphon_addresp_flags_active
;
173 static int hf_gryphon_addresp_blocks
;
174 static int hf_gryphon_addresp_responses
;
175 static int hf_gryphon_addresp_old_handle
;
176 static int hf_gryphon_addresp_action
;
177 static int hf_gryphon_addresp_action_period
;
178 static int hf_gryphon_addresp_action_deact_on_event
;
179 static int hf_gryphon_addresp_action_deact_after_period
;
180 static int hf_gryphon_addresp_action_period_type
;
181 static int hf_gryphon_addresp_handle
;
182 static int hf_gryphon_ldf_list
;
183 static int hf_gryphon_ldf_number
;
184 static int hf_gryphon_ldf_nodenumber
;
185 static int hf_gryphon_ldf_remaining
;
186 static int hf_gryphon_ldf_name
;
187 static int hf_gryphon_ldf_info_pv
;
188 static int hf_gryphon_ldf_info_lv
;
189 static int hf_gryphon_ldf_ui
;
190 static int hf_gryphon_lin_nodename
;
191 static int hf_gryphon_lin_data_length
;
192 static int hf_gryphon_lin_slave_table_enable
;
193 static int hf_gryphon_lin_slave_table_cs
;
194 static int hf_gryphon_lin_slave_table_data
;
195 static int hf_gryphon_lin_slave_table_datacs
;
196 static int hf_gryphon_lin_masterevent
;
197 static int hf_gryphon_lin_numdata
;
198 static int hf_gryphon_lin_numextra
;
199 static int hf_gryphon_ldf_description
;
200 static int hf_gryphon_ldf_size
;
201 static int hf_gryphon_ldf_exists
;
202 static int hf_gryphon_ldf_blockn
;
203 static int hf_gryphon_ldf_file
;
204 static int hf_gryphon_ldf_desc_pad
;
205 static int hf_gryphon_ldf_restore_session
;
206 static int hf_gryphon_ldf_schedule_name
;
207 static int hf_gryphon_ldf_schedule_msg_dbytes
;
208 static int hf_gryphon_ldf_schedule_flags
;
209 static int hf_gryphon_ldf_schedule_event
;
210 static int hf_gryphon_ldf_schedule_sporadic
;
211 static int hf_gryphon_ldf_ioctl_setflags
;
212 static int hf_gryphon_ldf_numb_ids
;
213 static int hf_gryphon_ldf_bitrate
;
214 static int hf_gryphon_ldf_ioctl_setflags_flags
;
215 static int hf_gryphon_ldf_sched_size_place
;
216 static int hf_gryphon_ldf_sched_numb_place
;
217 static int hf_gryphon_ldf_sched_size
;
218 static int hf_gryphon_ldf_num_node_names
;
219 static int hf_gryphon_ldf_num_frames
;
220 static int hf_gryphon_ldf_num_signal_names
;
221 static int hf_gryphon_ldf_num_schedules
;
222 static int hf_gryphon_ldf_num_encodings
;
223 static int hf_gryphon_ldf_encoding_value
;
224 static int hf_gryphon_ldf_encoding_min
;
225 static int hf_gryphon_ldf_encoding_max
;
226 static int hf_gryphon_ldf_master_node_name
;
227 static int hf_gryphon_ldf_slave_node_name
;
228 static int hf_gryphon_ldf_node_name
;
229 static int hf_gryphon_ldf_signal_name
;
230 static int hf_gryphon_ldf_signal_encoding_name
;
231 static int hf_gryphon_ldf_signal_encoding_type
;
232 static int hf_gryphon_ldf_signal_encoding_logical
;
233 static int hf_gryphon_ldf_signal_offset
;
234 static int hf_gryphon_ldf_signal_length
;
235 static int hf_gryphon_ldf_get_frame
;
236 static int hf_gryphon_ldf_get_frame_num
;
237 static int hf_gryphon_ldf_get_frame_pub
;
238 static int hf_gryphon_ldf_get_frame_num_signals
;
239 static int hf_gryphon_cnvt_valuef
;
240 static int hf_gryphon_cnvt_valuei
;
241 static int hf_gryphon_cnvt_values
;
242 static int hf_gryphon_cnvt_units
;
243 static int hf_gryphon_cnvt_flags_getvalues
;
244 static int hf_gryphon_dd_stream
;
245 static int hf_gryphon_dd_value
;
246 static int hf_gryphon_dd_time
;
247 static int hf_gryphon_modresp_handle
;
248 static int hf_gryphon_modresp_action
;
249 static int hf_gryphon_num_resphan
;
250 static int hf_gryphon_handle
;
251 static int hf_gryphon_transmit_sched_id
;
252 static int hf_gryphon_desc_program_size
;
253 static int hf_gryphon_desc_program_name
;
254 static int hf_gryphon_desc_program_description
;
255 static int hf_gryphon_desc_flags
;
256 static int hf_gryphon_desc_flags_program
;
257 static int hf_gryphon_desc_handle
;
258 static int hf_gryphon_upload_block_number
;
259 static int hf_gryphon_upload_handle
;
260 static int hf_gryphon_upload_data
;
261 static int hf_gryphon_delete
;
262 static int hf_gryphon_list_block_number
;
263 static int hf_gryphon_list_num_programs
;
264 static int hf_gryphon_list_num_remain_programs
;
265 static int hf_gryphon_list_name
;
266 static int hf_gryphon_list_description
;
267 static int hf_gryphon_start_arguments
;
268 static int hf_gryphon_start_channel
;
269 static int hf_gryphon_status_num_running_copies
;
270 static int hf_gryphon_options_handle
;
271 static int hf_gryphon_files
;
272 static int hf_gryphon_usdt_flags_register
;
273 static int hf_gryphon_usdt_action_flags
;
274 static int hf_gryphon_usdt_action_flags_non_legacy
;
275 static int hf_gryphon_usdt_action_flags_register
;
276 static int hf_gryphon_usdt_action_flags_action
;
277 static int hf_gryphon_usdt_transmit_options_flags
;
278 static int hf_gryphon_usdt_transmit_options_flags_echo
;
279 static int hf_gryphon_usdt_transmit_options_done_event
;
280 static int hf_gryphon_usdt_transmit_options_echo_short
;
281 static int hf_gryphon_usdt_transmit_options_rx_nth_fc
;
282 static int hf_gryphon_usdt_transmit_options_action
;
283 static int hf_gryphon_usdt_transmit_options_send_done
;
284 static int hf_gryphon_usdt_receive_options_flags
;
285 static int hf_gryphon_usdt_receive_options_action
;
286 static int hf_gryphon_usdt_receive_options_firstframe_event
;
287 static int hf_gryphon_usdt_receive_options_lastframe_event
;
288 static int hf_gryphon_usdt_receive_options_tx_nth_fc
;
289 static int hf_gryphon_usdt_length_options_flags
;
290 static int hf_gryphon_usdt_length_control_j1939
;
291 static int hf_gryphon_usdt_stmin_fc
;
292 static int hf_gryphon_usdt_bsmax_fc
;
293 static int hf_gryphon_usdt_stmin_override
;
294 static int hf_gryphon_usdt_stmin_override_active
;
295 static int hf_gryphon_usdt_stmin_override_activate
;
296 static int hf_gryphon_usdt_set_stmin_mul
;
297 static int hf_gryphon_usdt_receive_options_firstframe
;
298 static int hf_gryphon_usdt_receive_options_lastframe
;
299 static int hf_gryphon_usdt_ext_address
;
300 static int hf_gryphon_usdt_ext_address_id
;
301 static int hf_gryphon_usdt_block_size
;
302 static int hf_gryphon_bits_in_input1
;
303 static int hf_gryphon_bits_in_input2
;
304 static int hf_gryphon_bits_in_input3
;
305 static int hf_gryphon_bits_in_pushbutton
;
306 static int hf_gryphon_bits_out_output1
;
307 static int hf_gryphon_bits_out_output2
;
308 static int hf_gryphon_init_strat_reset_limit
;
309 static int hf_gryphon_init_strat_delay
;
310 static int hf_gryphon_speed_baud_rate_index
;
311 static int hf_gryphon_filter_block_filter_start
;
312 static int hf_gryphon_filter_block_filter_length
;
313 static int hf_gryphon_filter_block_filter_type
;
314 static int hf_gryphon_filter_block_filter_operator
;
315 static int hf_gryphon_filter_block_filter_value1
;
316 static int hf_gryphon_filter_block_filter_value2
;
317 static int hf_gryphon_filter_block_filter_value4
;
318 static int hf_gryphon_filter_block_filter_value_bytes
;
319 static int hf_gryphon_blm_mode
;
320 static int hf_gryphon_blm_mode_avg_period
;
321 static int hf_gryphon_blm_mode_avg_frames
;
322 static int hf_gryphon_command
;
323 static int hf_gryphon_cmd_mode
;
324 static int hf_gryphon_option
;
325 static int hf_gryphon_option_data
;
326 static int hf_gryphon_cmd_file
;
327 static int hf_gryphon_bit_in_digital_data
;
328 static int hf_gryphon_bit_out_digital_data
;
329 static int hf_gryphon_filter_block_pattern
;
330 static int hf_gryphon_filter_block_mask
;
331 static int hf_gryphon_usdt_request
;
332 static int hf_gryphon_usdt_request_ext
;
333 static int hf_gryphon_usdt_nids
;
334 static int hf_gryphon_usdt_response
;
335 static int hf_gryphon_usdt_response_ext
;
336 static int hf_gryphon_uudt_response
;
337 static int hf_gryphon_uudt_response_ext
;
338 static int hf_gryphon_more_filenames
;
339 static int hf_gryphon_filenames
;
340 static int hf_gryphon_program_channel_number
;
341 static int hf_gryphon_valid_header_length
;
343 static int ett_gryphon
;
344 static int ett_gryphon_header
;
345 static int ett_gryphon_body
;
346 static int ett_gryphon_command_data
;
347 static int ett_gryphon_response_data
;
348 static int ett_gryphon_data_header
;
349 static int ett_gryphon_flags
;
350 static int ett_gryphon_data_body
;
351 static int ett_gryphon_cmd_filter_block
;
352 static int ett_gryphon_cmd_events_data
;
353 static int ett_gryphon_cmd_config_device
;
354 static int ett_gryphon_cmd_sched_data
;
355 static int ett_gryphon_cmd_sched_cmd
;
356 static int ett_gryphon_cmd_response_block
;
357 static int ett_gryphon_pgm_list
;
358 static int ett_gryphon_pgm_status
;
359 static int ett_gryphon_pgm_options
;
360 static int ett_gryphon_valid_headers
;
361 static int ett_gryphon_usdt_data
;
362 static int ett_gryphon_usdt_action_flags
;
363 static int ett_gryphon_usdt_tx_options_flags
;
364 static int ett_gryphon_usdt_rx_options_flags
;
365 static int ett_gryphon_usdt_len_options_flags
;
366 static int ett_gryphon_usdt_data_block
;
367 static int ett_gryphon_lin_emulate_node
;
368 static int ett_gryphon_ldf_block
;
369 static int ett_gryphon_ldf_schedule_name
;
370 static int ett_gryphon_lin_schedule_msg
;
371 static int ett_gryphon_cnvt_getflags
;
372 static int ett_gryphon_digital_data
;
373 static int ett_gryphon_blm_mode
;
375 static expert_field ei_gryphon_type
;
377 /* desegmentation of Gryphon */
378 static bool gryphon_desegment
= true;
381 * Length of the frame header.
383 #define GRYPHON_FRAME_HEADER_LEN 8
385 static int dissect_gryphon_message(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, bool is_msgresp_add
);
386 static int cmd_ioctl(tvbuff_t
*, packet_info
*, int, proto_tree
*, uint32_t ui_command
);
387 static int cmd_ioctl_resp(tvbuff_t
*, packet_info
*, int, proto_tree
*, uint32_t ui_command
);
389 static const value_string action_vals
[] = {
390 { FR_RESP_AFTER_EVENT
,
391 "Send response(s) for each conforming message" },
392 { FR_RESP_AFTER_PERIOD
,
393 "Send response(s) after the specified period expires following a conforming message" },
394 { FR_IGNORE_DURING_PER
,
395 "Send response(s) for a conforming message and ignore further messages until the specified period expires" },
400 static const value_string deact_on_event_vals
[] = {
402 "Deactivate this response for a conforming message" },
403 { FR_DELETE
|FR_DEACT_ON_EVENT
,
404 "Delete this response for a conforming message" },
409 static const value_string deact_after_per_vals
[] = {
410 { FR_DEACT_AFTER_PER
,
411 "Deactivate this response after the specified period following a conforming message" },
412 { FR_DELETE
|FR_DEACT_AFTER_PER
,
413 "Delete this response after the specified period following a conforming message" },
418 static const value_string cmd_optimize_type
[] = {
419 {0, "Optimize for throughput (Nagle algorithm enabled)"},
420 {1, "Optimize for latency (Nagle algorithm disabled)"},
424 static const value_string usdt_action_vals
[] = {
425 { 0, "Use 11 bit headers only" },
426 { 1, "Use 29 bit headers only" },
427 { 2, "Use both 11 & 29 bit headers" },
432 static const value_string xmit_opt_nth_fc_event
[] = {
433 { 0, "Do not send a USDT_RX_NTH_FLOWCONTROL event when the 1st, 2nd, 3rd, etc. flow control message is received" },
434 { 1, "Send a USDT_RX_NTH_FLOWCONTROL event when the 1st, 2nd, 3rd, etc. flow control message is received" },
438 static const value_string xmit_opt_echo_short
[] = {
439 { 0, "Do not Echo short transmitted messages back to the client (message less than 8 bytes)" },
440 { 1, "Echo short transmitted messages back to the client (message less than 8 bytes)" },
444 static const value_string xmit_opt_done
[] = {
445 { 0, "Do not send a USDT_DONE event when the last frame of a multi-frame message is transmitted" },
446 { 1, "Send a USDT_DONE event when the last frame of a multi-frame message is transmitted" },
450 static const value_string xmit_opt_vals
[] = {
451 { 0, "Pad messages with less than 8 data bytes with 0x00's" },
452 { 1, "Pad messages with less than 8 data bytes with 0xFF's" },
453 { 2, "Do not pad messages with less than 8 data bytes" },
458 static const value_string xmit_opt_echo_long
[] = {
459 { 0, "Do not Echo long transmitted messages back to the client (message longer than 6 or 7 bytes)" },
460 { 1, "Echo long transmitted messages back to the client (message longer than 6 or 7 bytes)" },
465 static const value_string recv_opt_nth_fc_event
[] = {
466 { 0, "Do not send a USDT_TX_NTH_FLOWCONTROL event when the 1st, 2nd, 3rd, etc. flow control message is sent" },
467 { 1, "Send a USDT_TX_NTH_FLOWCONTROL event when the 1st, 2nd, 3rd, etc. flow control message is sent" },
470 static const value_string recv_opt_lastframe_event
[] = {
471 { 0, "Do not send a USDT_LASTFRAME event when the last frame of a multi-frame message is received" },
472 { 1, "Send a USDT_LASTFRAME event when the last frame of a multi-frame message is received" },
475 static const value_string recv_opt_firstframe_event
[] = {
476 { 0, "Do not send a USDT_FIRSTFRAME event when the first frame of a multi-frame message is received" },
477 { 1, "Send a USDT_FIRSTFRAME event when the first frame of a multi-frame message is received" },
481 static const value_string recv_opt_j1939
[] = {
482 { 0, "Treat the length as a regular 4-byte size in calculating the multi-ID block range (not J1939-style)" },
483 { 1, "Use J1939-style length (the source and destination bytes are swapped in response (for 29-bit ID/headers only))" },
488 static const value_string recv_opt_vals
[] = {
489 { 0, "Do not verify the integrity of long received messages and do not send them to the client" },
490 { 1, "Verify the integrity of long received messages and send them to the client" },
491 { 2, "Verify the integrity of long received messages but do not send them to the client" },
496 static const value_string register_unregister
[] = {
502 static const value_string ldf_exists
[] = {
503 { 0, "Name is OK, does not already exist" },
504 { 1, "*** Warning ***: LDF file with same name already exists" },
508 static const value_string lin_slave_table_enable
[] = {
511 { 2, "One-shot enabled" },
515 static const value_string lin_slave_table_cs
[] = {
521 static const value_string lin_ldf_ioctl_setflags
[] = {
522 {0, "Clear all flags first"},
523 {1, "Leave existing flags intact"},
526 static const value_string lin_cnvt_getflags
[] = {
529 {3, "Float and Int value"},
531 {5, "Float and String value"},
532 {6, "Int and String value"},
533 {7, "Float, Int, and String value"},
537 static const value_string lin_ioctl_masterevent
[] = {
538 {0, "LIN driver will not send an event on master schedule start-of-cycle"},
539 {1, "LIN driver will send an event on master schedule start-of-cycle"},
543 static const value_string blm_mode_vals
[] = {
545 { 1, "Average over time" },
546 { 2, "Average over frame count" },
550 static const value_string dmodes
[] = {
551 {DEFAULT_FILTER_BLOCK
, "Block"},
552 {DEFAULT_FILTER_PASS
, "Pass"},
556 static const value_string frame_type
[] = {
558 {1, "Command request"},
559 {2, "Command response"},
560 {3, "Network (vehicle) data"},
562 {5, "Miscellaneous"},
564 {7, "Signal (vehicle) network"},
568 static const value_string src_dest
[] = {
570 {SD_SERVER
, "Server"},
571 {SD_CLIENT
, "Client"},
572 {SD_SCHED
, "Scheduler"},
573 {SD_SCRIPT
, "Script Processor"},
574 {SD_PGM
, "Program Loader"},
575 {SD_USDT
, "USDT Server"},
576 {SD_BLM
, "Bus Load Monitoring"},
577 {SD_LIN
, "LIN LDF Server"}, /* 20171031 mc */
578 {SD_FLIGHT
, "Flight Recorder / Data Logger"},
579 {SD_RESP
, "Message Responder"},
580 {SD_IOPWR
, "I/O and power"},
581 {SD_UTIL
, "Utility/Miscellaneous"},
582 {SD_CNVT
, "Signal Conversion Utility"}, /* 20171031 mc */
586 /* 20180305 use with BASE_SPECIAL_VALS */
587 static const value_string channel_or_broadcast
[] = {
588 {CH_BROADCAST
, "Broadcast"},
592 static const value_string cmd_vals
[] = {
593 { CMD_INIT
, "Initialize" },
594 { CMD_GET_STAT
, "Get status" },
595 { CMD_GET_CONFIG
, "Get configuration" },
596 { CMD_EVENT_ENABLE
, "Enable event" },
597 { CMD_EVENT_DISABLE
, "Disable event" },
598 { CMD_GET_TIME
, "Get time" },
599 { CMD_GET_RXDROP
, "Get number of dropped RX messages" },
600 { CMD_RESET_RXDROP
, "Clear number of dropped RX messages" },
601 { CMD_BCAST_ON
, "Set broadcasts on" },
602 { CMD_BCAST_OFF
, "Set broadcasts off" },
603 { CMD_SET_TIME
, "Set time" },
604 { CMD_CARD_SET_SPEED
, "Set channel baud rate" },
605 { CMD_CARD_GET_SPEED
, "Get channel baud rate" },
606 { CMD_CARD_SET_FILTER
, "Set filter (deprecated)" },
607 { CMD_CARD_GET_FILTER
, "Get filter" },
608 { CMD_CARD_TX
, "Transmit message" },
609 { CMD_CARD_TX_LOOP_ON
, "Set transmit loopback on" },
610 { CMD_CARD_TX_LOOP_OFF
, "Set transmit loopback off" },
611 { CMD_CARD_IOCTL
, "IOCTL pass-through" },
612 { CMD_CARD_ADD_FILTER
, "Add a filter" },
613 { CMD_CARD_MODIFY_FILTER
, "Modify a filter" },
614 { CMD_CARD_GET_FILTER_HANDLES
, "Get filter handles" },
615 { CMD_CARD_SET_DEFAULT_FILTER
, "Set default filter" },
616 { CMD_CARD_GET_DEFAULT_FILTER
, "Get default filter mode" },
617 { CMD_CARD_SET_FILTER_MODE
, "Set filter mode" },
618 { CMD_CARD_GET_FILTER_MODE
, "Get filter mode" },
619 { CMD_CARD_GET_EVNAMES
, "Get event names" },
620 { CMD_CARD_GET_SPEEDS
, "Get defined speeds" },
621 { CMD_SERVER_REG
, "Register with server" },
622 { CMD_SERVER_SET_SORT
, "Set the sorting behavior" },
623 { CMD_SERVER_SET_OPT
, "Set the type of optimization" },
624 { CMD_PGM_START2
, "Start an uploaded program" },
625 { CMD_SCHED_TX
, "Schedule transmission of messages" },
626 { CMD_SCHED_KILL_TX
, "Stop and destroy a message schedule transmission" },
627 { CMD_SCHED_MSG_REPLACE
, "Replace a scheduled message" },
628 { CMD_PGM_DESC
, "Describe program to be uploaded" },
629 { CMD_PGM_UPLOAD
, "Upload a program to the Gryphon" },
630 { CMD_PGM_DELETE
, "Delete an uploaded program" },
631 { CMD_PGM_LIST
, "Get a list of uploaded programs" },
632 { CMD_PGM_START
, "Start an uploaded program" },
633 { CMD_PGM_STOP
, "Stop an uploaded program" },
634 { CMD_PGM_STATUS
, "Get status of an uploaded program" },
635 { CMD_PGM_OPTIONS
, "Set program upload options" },
636 { CMD_PGM_FILES
, "Get a list of files & directories" },
637 { CMD_USDT_REGISTER
, "Register/Unregister with USDT server (deprecated)" },
638 { CMD_USDT_SET_FUNCTIONAL
, "Set IDs to use extended addressing (deprecated)" },
639 { CMD_USDT_SET_STMIN_MULT
, "Set USDT STMIN multiplier" },
640 { CMD_USDT_SET_STMIN_FC
, "Set USDT STMIN flow control (new command July 2017)" },
641 { CMD_USDT_GET_STMIN_FC
, "Get USDT STMIN flow control (new command July 2017)" },
642 { CMD_USDT_SET_BSMAX_FC
, "Set USDT BSMAX flow control (new command July 2017)" },
643 { CMD_USDT_GET_BSMAX_FC
, "Get USDT BSMAX flow control (new command July 2017)" },
644 { CMD_USDT_REGISTER_NON_LEGACY
, "Register/Unregister with USDT (ISO-15765) server, non-legacy (new command July 2017)" },
645 { CMD_USDT_SET_STMIN_OVERRIDE
, "Set USDT STMIN override (new command July 2017)" },
646 { CMD_USDT_GET_STMIN_OVERRIDE
, "Get USDT STMIN override (new command July 2017)" },
647 { CMD_USDT_ACTIVATE_STMIN_OVERRIDE
, "Activate/deactivate USDT STMIN override (new command July 2017)" },
648 { CMD_BLM_SET_MODE
, "Set Bus Load Monitoring mode" },
649 { CMD_BLM_GET_MODE
, "Get Bus Load Monitoring mode" },
650 { CMD_BLM_GET_DATA
, "Get Bus Load data" },
651 { CMD_BLM_GET_STATS
, "Get Bus Load statistics" },
652 { CMD_GET_FRAMES
, "Get frames defined in the LIN LDF file" },
653 { CMD_LDF_DESC
, "Set Name and description of LIN LDF file" },
654 { CMD_LDF_UPLOAD
, "Upload a LIN LDF file to the Gryphon" },
655 { CMD_LDF_LIST
, "Get list of loaded LIN LDFs" },
656 { CMD_LDF_DELETE
, "Delete LIN LDF" },
657 { CMD_LDF_PARSE
, "Parse an uploaded LIN LDF file" },
658 { CMD_GET_LDF_INFO
, "Get info of a parsed LDF file" },
659 { CMD_GET_NODE_NAMES
, "Get names of nodes defined in the LIN LDF file" },
660 { CMD_EMULATE_NODES
, "Emulate LIN nodes" },
661 { CMD_GET_FRAME_INFO
, "Get info from a frame defined in the LIN LDF file" },
662 { CMD_GET_SIGNAL_INFO
, "Get info from a signal defined in the LIN LDF file" },
663 { CMD_GET_SIGNAL_DETAIL
, "Get details from a signal defined in the LIN LDF file" },
664 { CMD_GET_ENCODING_INFO
, "Get details from an encoding name defined in the LIN LDF file" },
665 { CMD_GET_SCHEDULES
, "Get schedules of the LIN LDF file" },
666 { CMD_START_SCHEDULE
, "Start a LIN schedule from the LIN LDF file" },
667 { CMD_SAVE_SESSION
, "Save an internal representation of the LIN LDF file" },
668 { CMD_RESTORE_SESSION
, "Restore a previously saved LIN LDF session" },
669 { CMD_GET_NODE_SIGNALS
, "Get signal names of the node defined in the LIN LDF file" },
670 { CMD_FLIGHT_GET_CONFIG
, "Get flight recorder channel info" },
671 { CMD_FLIGHT_START_MON
, "Start flight recorder monitoring" },
672 { CMD_FLIGHT_STOP_MON
, "Stop flight recorder monitoring" },
673 { CMD_MSGRESP_ADD
, "Add response message" },
674 { CMD_MSGRESP_GET
, "Get response message" },
675 { CMD_MSGRESP_MODIFY
, "Modify response message state" },
676 { CMD_MSGRESP_GET_HANDLES
, "Get response message handles" },
677 { CMD_IOPWR_GETINP
, "Read current digital inputs" },
678 { CMD_IOPWR_GETLATCH
, "Read latched digital inputs" },
679 { CMD_IOPWR_CLRLATCH
, "Read & clear latched digital inputs" },
680 { CMD_IOPWR_GETOUT
, "Read digital outputs" },
681 { CMD_IOPWR_SETOUT
, "Write digital outputs" },
682 { CMD_IOPWR_SETBIT
, "Set indicated output bits" },
683 { CMD_IOPWR_CLRBIT
, "Clear indicated output bits" },
684 { CMD_IOPWR_GETPOWER
, "Read digital inputs at power on time" },
685 { CMD_UTIL_SET_INIT_STRATEGY
, "Set initialization strategy" },
686 { CMD_UTIL_GET_INIT_STRATEGY
, "Get initialization strategy" },
687 { CMD_CNVT_GET_VALUES
, "Read one or more signal values from LIN Signal Conversion" },
688 { CMD_CNVT_GET_UNITS
, "Read one or more signal units from LIN Signal Conversion" },
689 { CMD_CNVT_SET_VALUES
, "Write one or more signal values for LIN Signal Conversion" },
690 { CMD_CNVT_DESTROY_SESSION
, "Destroy internal LIN Signal Conversion info" },
691 { CMD_CNVT_SAVE_SESSION
, "Save an internal representation of the LIN Signal Conversion" },
692 { CMD_CNVT_RESTORE_SESSION
, "Restore a previously saved LIN Signal Conversion session" },
693 { CMD_CNVT_GET_NODE_SIGNALS
, "Get signal names of the node defined in the LIN Signal Conversion Session" },
697 static value_string_ext cmd_vals_ext
= VALUE_STRING_EXT_INIT(cmd_vals
);
699 static const value_string responses_vs
[] = {
700 {RESP_OK
, "OK - no error"},
701 {RESP_UNKNOWN_ERR
, "Unknown error"},
702 {RESP_UNKNOWN_CMD
, "Unrecognised command"},
703 {RESP_UNSUPPORTED
, "Unsupported command"},
704 {RESP_INVAL_CHAN
, "Invalid channel specified"},
705 {RESP_INVAL_DST
, "Invalid destination"},
706 {RESP_INVAL_PARAM
, "Invalid parameter(s)"},
707 {RESP_INVAL_MSG
, "Invalid message"},
708 {RESP_INVAL_LEN
, "Invalid length field"},
709 {RESP_TX_FAIL
, "Transmit failed"},
710 {RESP_RX_FAIL
, "Receive failed"},
711 {RESP_AUTH_FAIL
, "Authorization failed"},
712 {RESP_MEM_ALLOC_ERR
, "Memory allocation error"},
713 {RESP_TIMEOUT
, "Command timed out"},
714 {RESP_UNAVAILABLE
, "Unavailable"},
715 {RESP_BUF_FULL
, "Buffer full"},
716 {RESP_NO_SUCH_JOB
, "No such job"},
720 static const value_string filter_data_types
[] = {
721 {FILTER_DATA_TYPE_HEADER_FRAME
, "frame header"},
722 {FILTER_DATA_TYPE_HEADER
, "data message header"},
723 {FILTER_DATA_TYPE_DATA
, "data message data"},
724 {FILTER_DATA_TYPE_EXTRA_DATA
, "data message extra data"},
725 {FILTER_EVENT_TYPE_HEADER
, "event message header"},
726 {FILTER_EVENT_TYPE_DATA
, "event message"},
730 static const value_string operators
[] = {
731 {BIT_FIELD_CHECK
, "Bit field check"},
732 {SVALUE_GT
, "Greater than (signed)"},
733 {SVALUE_GE
, "Greater than or equal to (signed)"},
734 {SVALUE_LT
, "Less than (signed)"},
735 {SVALUE_LE
, "Less than or equal to (signed)"},
736 {VALUE_EQ
, "Equal to"},
737 {VALUE_NE
, "Not equal to"},
738 {UVALUE_GT
, "Greater than (unsigned)"},
739 {UVALUE_GE
, "Greater than or equal to (unsigned)"},
740 {UVALUE_LT
, "Less than (unsigned)"},
741 {UVALUE_LE
, "Less than or equal to (unsigned)"},
742 {DIG_LOW_TO_HIGH
, "Digital, low to high transition"},
743 {DIG_HIGH_TO_LOW
, "Digital, high to low transition"},
744 {DIG_TRANSITION
, "Digital, change of state"},
748 static const value_string modes
[] = {
749 {FILTER_OFF_PASS_ALL
, "Filter off, pass all messages"},
750 {FILTER_OFF_BLOCK_ALL
, "Filter off, block all messages"},
751 {FILTER_ON
, "Filter on"},
755 static const value_string filtacts
[] = {
756 {DELETE_FILTER
, "Delete"},
757 {ACTIVATE_FILTER
, "Activate"},
758 {DEACTIVATE_FILTER
, "Deactivate"},
762 static const value_string ioctls
[] = {
763 {GINIT
, "GINIT: Initialize"},
764 {GLOOPON
, "GLOOPON: Loop on"},
765 {GLOOPOFF
, "GLOOPOFF: Loop off"},
766 {GGETHWTYPE
, "GGETHWTYPE: Get hardware type"},
767 {GGETREG
, "GGETREG: Get register"},
768 {GSETREG
, "GSETREG: Set register"},
769 {GGETRXCOUNT
, "GGETRXCOUNT: Get the receive message counter"},
770 {GSETRXCOUNT
, "GSETRXCOUNT: Set the receive message counter"},
771 {GGETTXCOUNT
, "GGETTXCOUNT: Get the transmit message counter"},
772 {GSETTXCOUNT
, "GSETTXCOUNT: Set the transmit message counter"},
773 {GGETRXDROP
, "GGETRXDROP: Get the number of dropped receive messages"},
774 {GSETRXDROP
, "GSETRXDROP: Set the number of dropped receive messages"},
775 {GGETTXDROP
, "GGETTXDROP: Get the number of dropped transmit messages"},
776 {GSETTXDROP
, "GSETTXDROP: Set the number of dropped transmit messages"},
777 {GGETRXBAD
, "GGETRXBAD: Get the number of bad receive messages"},
778 {GGETTXBAD
, "GGETTXBAD: Get the number of bad transmit messages"},
779 {GGETCOUNTS
, "GGETCOUNTS: Get total message counter"},
780 {GGETBLMON
, "GGETBLMON: Get bus load monitoring status"},
781 {GSETBLMON
, "GSETBLMON: Set bus load monitoring status (turn on/off)"},
782 {GGETERRLEV
, "GGETERRLEV: Get error level"},
783 {GSETERRLEV
, "GSETERRLEV: Set error level"},
784 {GGETBITRATE
, "GGETBITRATE: Get bit rate"},
785 {GGETRAM
, "GGETRAM: Read value from RAM"},
786 {GSETRAM
, "GSETRAM: Write value to RAM"},
787 {GCANGETBTRS
, "GCANGETBTRS: Read CAN bit timing registers"},
788 {GCANSETBTRS
, "GCANSETBTRS: Write CAN bit timing registers"},
789 {GCANGETBC
, "GCANGETBC: Read CAN bus configuration register"},
790 {GCANSETBC
, "GCANSETBC: Write CAN bus configuration register"},
791 {GCANGETMODE
, "GCANGETMODE"},
792 {GCANSETMODE
, "GCANSETMODE"},
793 {GCANGETTRANS
, "GCANGETTRANS"},
794 {GCANSETTRANS
, "GCANSETTRANS"},
795 {GCANSENDERR
, "GCANSENDERR"},
796 {GCANRGETOBJ
, "GCANRGETOBJ"},
797 {GCANRSETSTDID
, "GCANRSETSTDID"},
798 {GCANRSETEXTID
, "GCANRSETEXTID"},
799 {GCANRSETDATA
, "GCANRSETDATA"},
800 {GCANRENABLE
, "GCANRENABLE"},
801 {GCANRDISABLE
, "GCANRDISABLE"},
802 {GCANRGETMASKS
, "GCANRGETMASKS"},
803 {GCANRSETMASKS
, "GCANRSETMASKS"},
804 {GCANSWGETMODE
, "GCANSWGETMODE"},
805 {GCANSWSETMODE
, "GCANSWSETMODE"},
806 {GDLCGETFOURX
, "GDLCGETFOURX"},
807 {GDLCSETFOURX
, "GDLCSETFOURX"},
808 {GDLCGETLOAD
, "GDLCGETLOAD"},
809 {GDLCSETLOAD
, "GDLCSETLOAD"},
810 {GDLCSENDBREAK
, "GDLCSENDBREAK"},
811 {GDLCABORTTX
, "GDLCABORTTX"},
812 {GDLCGETHDRMODE
, "DLCGETHDRMODE"},
813 {GDLCSETHDRMODE
, "GDLCSETHDRMODE"},
814 {GHONSLEEP
, "GHONSLEEP"},
815 {GHONSILENCE
, "GHONSILENCE"},
816 {GKWPSETPTIMES
, "GKWPSETPTIMES"},
817 {GKWPSETWTIMES
, "GKWPSETWTIMES"},
818 {GKWPDOWAKEUP
, "GKWPDOWAKEUP"},
819 {GKWPGETBITTIME
, "GKWPGETBITTIME"},
820 {GKWPSETBITTIME
, "GKWPSETBITTIME"},
821 {GKWPSETNODEADDR
, "GKWPSETNODEADDR"},
822 {GKWPGETNODETYPE
, "GKWPGETNODETYPE"},
823 {GKWPSETNODETYPE
, "GKWPSETNODETYPE"},
824 {GKWPSETWAKETYPE
, "GKWPSETWAKETYPE"},
825 {GKWPSETTARGADDR
, "GKWPSETTARGADDR"},
826 {GKWPSETKEYBYTES
, "GKWPSETKEYBYTES"},
827 {GKWPSETSTARTREQ
, "GKWPSETSTARTREQ"},
828 {GKWPSETSTARTRESP
, "GKWPSETSTARTRESP"},
829 {GKWPSETPROTOCOL
, "GKWPSETPROTOCOL"},
830 {GKWPGETLASTKEYBYTES
, "GKWPGETLASTKEYBYTES"},
831 {GKWPSETLASTKEYBYTES
, "GKWPSETLASTKEYBYTES"},
832 {GSCPGETBBR
, "GSCPGETBBR"},
833 {GSCPSETBBR
, "GSCPSETBBR"},
834 {GSCPGETID
, "GSCPGETID"},
835 {GSCPSETID
, "GSCPSETID"},
836 {GSCPADDFUNCID
, "GSCPADDFUNCID"},
837 {GSCPCLRFUNCID
, "GSCPCLRFUNCID"},
838 {GUBPGETBITRATE
, "GUBPGETBITRATE"},
839 {GUBPSETBITRATE
, "GUBPSETBITRATE"},
840 {GUBPGETINTERBYTE
, "GUBPGETINTERBYTE"},
841 {GUBPSETINTERBYTE
, "GUBPSETINTERBYTE"},
842 {GUBPGETNACKMODE
, "GUBPGETNACKMODE"},
843 {GUBPSETNACKMODE
, "GUBPSETNACKMODE"},
844 {GUBPGETRETRYDELAY
, "GUBPGETRETRYDELAY"},
845 {GUBPSETRETRYDELAY
, "GUBPSETRETRYDELAY"},
846 {GRESETHC08
, "GRESETHC08: Reset the HC08 processor"},
847 {GTESTHC08COP
, "GTESTHC08COP: Stop updating the HC08 watchdog timer"},
848 {GSJAGETLISTEN
, "GSJAGETLISTEN"},
849 {GSJASETLISTEN
, "GSJASETLISTEN"},
850 {GSJAGETSELFTEST
, "GSJAGETSELFTEST"},
851 {GSJASETSELFTEST
, "GSJASETSELFTEST"},
852 {GSJAGETXMITONCE
, "GSJAGETXMITONCE"},
853 {GSJASETXMITONCE
, "GSJASETXMITONCE"},
854 {GSJAGETTRIGSTATE
, "GSJAGETTRIGSTATE"},
855 {GSJASETTRIGCTRL
, "GSJASETTRIGCTRL"},
856 {GSJAGETTRIGCTRL
, "GSJAGETTRIGCTRL"},
857 {GSJAGETOUTSTATE
, "GSJAGETOUTSTATE"},
858 {GSJASETOUTSTATE
, "GSJASETOUTSTATE"},
859 {GSJAGETFILTER
, "GSJAGETFILTER"},
860 {GSJASETFILTER
, "GSJASETFILTER"},
861 {GSJAGETMASK
, "GSJAGETMASK"},
862 {GSJASETMASK
, "GSJASETMASK"},
863 {GSJAGETINTTERM
, "GSJAGETINTTERM"},
864 {GSJASETINTTERM
, "GSJASETINTTERM"},
865 {GSJAGETFTTRANS
, "GSJAGETFTTRANS"},
866 {GSJASETFTTRANS
, "GSJASETFTTRANS"},
867 {GSJAGETFTERROR
, "GSJAGETFTERROR"},
868 {GLINGETBITRATE
, "GLINGETBITRATE: Get the current bit rate"},
869 {GLINSETBITRATE
, "GLINSETBITRATE: Set the bit rate"},
870 {GLINGETBRKSPACE
, "GLINGETBRKSPACE"},
871 {GLINSETBRKSPACE
, "GLINSETBRKSPACE"},
872 {GLINGETBRKMARK
, "GLINGETBRKMARK"},
873 {GLINSETBRKMARK
, "GLINSETBRKMARK"},
874 {GLINGETIDDELAY
, "GLINGETIDDELAY"},
875 {GLINSETIDDELAY
, "GLINSETIDDELAY"},
876 {GLINGETRESPDELAY
, "GLINGETRESPDELAY"},
877 {GLINSETRESPDELAY
, "GLINSETRESPDELAY"},
878 {GLINGETINTERBYTE
, "GLINGETINTERBYTE"},
879 {GLINSETINTERBYTE
, "GLINSETINTERBYTE"},
880 {GLINGETWAKEUPDELAY
, "GLINGETWAKEUPDELAY"},
881 {GLINSETWAKEUPDELAY
, "GLINSETWAKEUPDELAY"},
882 {GLINGETWAKEUPTIMEOUT
, "GLINGETWAKEUPTIMEOUT"},
883 {GLINSETWAKEUPTIMEOUT
, "GLINSETWAKEUPTIMEOUT"},
884 {GLINGETWUTIMOUT3BR
, "GLINGETWUTIMOUT3BR"},
885 {GLINSETWUTIMOUT3BR
, "GLINSETWUTIMOUT3BR"},
886 {GLINSENDWAKEUP
, "GLINSENDWAKEUP"},
887 {GLINGETMODE
, "GLINGETMODE"},
888 {GLINSETMODE
, "GLINSETMODE"},
889 /* 20171109 lin LDF */
890 {GLINGETSLEW
, "GLINGETSLEW: get slew rate"},
891 {GLINSETSLEW
, "GLINSETSLEW: set slew rate"},
892 {GLINADDSCHED
, "GLINADDSCHED: add a LIN schedule"},
893 {GLINGETSCHED
, "GLINGETSCHED: get a LIN schedule"},
894 {GLINGETSCHEDSIZE
, "GLINGETSCHEDSIZE: get schedule size"},
895 {GLINDELSCHED
, "GLINDELSCHED: delete a LIN schedule"},
896 {GLINACTSCHED
, "GLINACTSCHED: activate a LIN schedule"},
897 {GLINDEACTSCHED
, "GLINDEACTSCHED: deactivate a LIN schedule"},
898 {GLINGETACTSCHED
, "GLINGETACTSCHED: get active LIN schedule"},
899 {GLINGETNUMSCHEDS
, "GLINGETNUMSCHED: get number of LIN schedules"},
900 {GLINGETSCHEDNAMES
, "GLINGETSCHEDNAMES: get LIN schedule names"},
901 {GLINGETMASTEREVENTENABLE
, "GLINGETMASTEREVENTENABLE: get LIN master schedule event enable flag"},
902 {GLINSETMASTEREVENTENABLE
, "GLINSETMASTEREVENTENABLE: set LIN master schedule event enable flag"},
903 {GLINGETNSLAVETABLE
, "GLINGETNSLAVETABLE: set number of LIN slave table entries"},
904 {GLINGETSLAVETABLEPIDS
, "GLINGETSLAVETABLEPIDS: get list of LIN slave table PIDs"},
905 {GLINGETSLAVETABLE
, "GLINGETSLAVETABLE: get LIN slave table entry for this PID"},
906 {GLINSETSLAVETABLE
, "GLINSETSLAVETABLE: set LIN slave table entry for this PID"},
907 {GLINCLEARSLAVETABLE
, "GLINCLEARSLAVETABLE: clear LIN slave table entry for this PID"},
908 {GLINCLEARALLSLAVETABLE
, "GLINCLEARALLSLAVETABLE: clear all LIN slave table entries"},
909 {GLINGETONESHOT
, "GLINGETONESHOT: get LIN one-shot entry"},
910 {GLINSETONESHOT
, "GLINSETONESHOT: set LIN one-shot entry"},
911 {GLINCLEARONESHOT
, "GLINCLEARONESHOT: clear LIN one-shot entry"},
912 {GLINSETFLAGS
, "GLINSETFLAGS"},
913 {GLINGETAUTOCHECKSUM
, "GLINGETAUTOCHECKSUM: get LIN auto checksum"},
914 {GLINSETAUTOCHECKSUM
, "GLINSETAUTOCHECKSUM: set LIN auto checksum"},
915 {GLINGETAUTOPARITY
, "GLINGETAUTOPARITY: get LIN auto parity"},
916 {GLINSETAUTOPARITY
, "GLINSETAUTOPARITY: set LIN auto parity"},
917 {GLINGETSLAVETABLEENABLE
, "GLINGETSLAVETABLEENABLE: get LIN slave table enable"},
918 {GLINSETSLAVETABLEENABLE
, "GLINSETSLAVETABLEENABLE: set LIN slave table enable"},
919 {GLINGETFLAGS
, "GLINGETFLAGS"},
920 {GLINGETWAKEUPMODE
, "GLINGETWAKEUPMODE: get LIN wakeup mode"},
921 {GLINSETWAKEUPMODE
, "GLINSETWAKEUPMODE: set LIN wakeup mode"},
922 {GDLYGETHIVALUE
, "GDLYGETHIVALUE: get the high water value"},
923 {GDLYSETHIVALUE
, "GDLYSETHIVALUE: set the high water value"},
924 {GDLYGETLOVALUE
, "GDLYGETLOVALUE: get the low water value"},
925 {GDLYSETLOVALUE
, "GDLYSETLOVALUE: set the low water value"},
926 {GDLYGETHITIME
, "GDLYGETHITIME: get the high water time"},
927 {GDLYSETHITIME
, "GDLYSETHITIME: set the high water time"},
928 {GDLYGETLOTIME
, "GDLYGETLOTIME: get the low water time"},
929 {GDLYSETLOTIME
, "GDLYSETLOTIME: set the low water time"},
930 {GDLYGETLOREPORT
, "GDLYGETLOREPORT:get the low water report flag"},
931 {GDLYFLUSHSTREAM
, "GDLYFLUSHSTREAM: flush the delay buffer"},
932 {GDLYINITSTREAM
, "GDLYINITSTREAM: set default hi & lo water marks"},
933 {GDLYPARTIALFLUSHSTREAM
, "GDLYPARTIALFLUSHSTREAM: flush the delay buffer"},
934 {GINPGETINP
, "GINPGETINP: Read current digital inputs"},
935 {GINPGETLATCH
, "GINPGETLATCH: Read latched digital inputs"},
936 {GINPCLRLATCH
, "GINPCLRLATCH: Read and clear latched digital inputs"},
937 {GOUTGET
, "GOUTGET: Read digital outputs"},
938 {GOUTSET
, "GOUTSET: Write digital outputs"},
939 {GOUTSETBIT
, "GOUTSETBIT: Set digital output bits"},
940 {GOUTCLEARBIT
, "GOUTCLEARBIT"},
941 {GPWRGETWHICH
, "GPWRGETWHICH"},
942 {GPWROFF
, "GPWROFF"},
943 {GPWROFFRESET
, "GPWROFFRESET"},
944 {GPWRRESET
, "GPWRRESET"},
949 static const value_string cmd_sort_type
[] = {
950 {0, "Do not sort messages"},
951 {1, "Sort into blocks of up to 16 messages"},
955 static const value_string protocol_types
[] = {
956 {GDUMMY
* 256 + GDGDMARKONE
, "Dummy device driver"},
957 {GCAN
* 256 + G82527
, "CAN, 82527 subtype"},
958 {GCAN
* 256 + GSJA1000
, "CAN, SJA1000 subtype"},
959 {GCAN
* 256 + G82527SW
, "CAN, 82527 single wire subtype"},
960 {GCAN
* 256 + G82527ISO11992
, "CAN, 82527 ISO11992 subtype"},
961 {GCAN
* 256 + G82527_SINGLECHAN
, "CAN, Fiber Optic 82527 subtype"},
962 {GCAN
* 256 + G82527SW_SINGLECHAN
, "CAN, Fiber Optic 82527 single wire subtype"},
963 {GCAN
* 256 + G82527ISO11992_SINGLECHAN
, "CAN, Fiber Optic ISO11992 subtype"},
964 {GCAN
* 256 + GSJA1000FT
, "CAN, SJA1000 Fault Tolerant subtype"},
965 {GCAN
* 256 + GSJA1000C
, "CAN, SJA1000 onboard subtype"},
966 {GCAN
* 256 + GSJA1000FT_FO
, "CAN, SJA1000 Fiber Optic Fault Tolerant subtype"},
967 {GCAN
* 256 + GSJA1000_BEACON_CANFD
, "CAN, SJA1000 BEACON CAN-FD subtype"},
968 {GCAN
* 256 + GSJA1000_BEACON_SW
, "CAN, SJA1000 BEACON CAN single wire subtype"},
969 {GCAN
* 256 + GSJA1000_BEACON_FT
, "CAN, SJA1000 BEACON CAN Fault Tolerant subtype"},
970 {GJ1850
* 256 + GHBCCPAIR
, "J1850, HBCC subtype"},
971 {GJ1850
* 256 + GDLC
, "J1850, GM DLC subtype"},
972 {GJ1850
* 256 + GCHRYSLER
, "J1850, Chrysler subtype"},
973 {GJ1850
* 256 + GDEHC12
, "J1850, DE HC12 KWP/BDLC subtype"},
974 {GKWP2000
* 256 + GDEHC12KWP
, "Keyword protocol 2000/ISO 9141"},
975 {GHONDA
* 256 + GDGHC08
, "Honda UART, DG HC08 subtype"},
976 {GFORDUBP
* 256 + GDGUBP08
, "Ford UBP, DG HC08 subtype"},
977 {GSCI
* 256 + G16550SCI
, "Chrysler SCI, UART subtype"},
978 {GCCD
* 256 + G16550CDP68HC68
, "Chrysler C2D, UART / CDP68HC68S1 subtype"},
979 {GLIN
* 256 + GDGLIN08
, "LIN, DG HC08 subtype"},
980 {GLIN
* 256 + GDGLIN_BEACON
, "LIN, BEACON LIN updated subtype"},
985 * Note: using external tfs strings doesn't work in a plugin.
986 * The address of a data item exported from a shared library
987 * such as libwireshark is not known until the library is
988 * loaded, so "&data_item" is not a constant; MSVC complains
991 * (*Direct* references to the item in code can execute a
992 * different code sequence to get the address and then load
993 * from that address, but references from a data structure
996 static const true_false_string tfs_wait_response
= { "Wait", "Don't Wait" };
997 static const true_false_string true_false
= { "True", "False" };
998 static const true_false_string register_unregister_action_flags
= { "Register", "Unregister" };
999 static const true_false_string tfs_passed_blocked
= { "Pass", "Block" };
1000 static const true_false_string active_inactive
= { "Active", "Inactive" };
1001 static const true_false_string critical_normal
= { "Critical", "Normal" };
1002 static const true_false_string skip_not_skip
= { "Skip", "Do not skip" };
1003 static const true_false_string frames_01seconds
= { "Frames", "0.01 seconds" };
1004 static const true_false_string present_not_present
= { "Present", "Not present" };
1005 static const true_false_string yes_no
= { "Yes", "No" };
1006 static const true_false_string set_not_set
= { "Set", "Not set" };
1009 * returns 1 if the ID is one of the special servers
1010 * return 0 otherwise
1012 static int is_special_client(uint32_t id
)
1014 if((id
== SD_SERVER
) || (id
== SD_CLIENT
)) {
1021 decode_data(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1024 int hdrsize
, datasize
, extrasize
, msgsize
, padding
;
1028 static int * const data_mode_flags
[] = {
1029 &hf_gryphon_data_mode_transmitted
,
1030 &hf_gryphon_data_mode_receive
,
1031 &hf_gryphon_data_mode_local
,
1032 &hf_gryphon_data_mode_remote
,
1033 &hf_gryphon_data_mode_oneshot
,
1034 &hf_gryphon_data_mode_combined
,
1035 &hf_gryphon_data_mode_nomux
,
1036 &hf_gryphon_data_mode_internal
,
1040 hdrsize
= tvb_get_uint8(tvb
, offset
+0);
1041 /* hdrbits = tvb_get_uint8(tvb, offset+1); */
1042 datasize
= tvb_get_ntohs(tvb
, offset
+2);
1043 extrasize
= tvb_get_uint8(tvb
, offset
+4);
1044 padding
= 3 - (hdrsize
+ datasize
+ extrasize
+ 3) % 4;
1045 msgsize
= hdrsize
+ datasize
+ extrasize
+ padding
+ 16;
1047 tree
= proto_tree_add_subtree(pt
, tvb
, offset
, 16, ett_gryphon_data_header
, NULL
, "Message header");
1049 /* fixed major problem with header length, length is 1-byte not 2-bytes */
1050 proto_tree_add_item(tree
, hf_gryphon_data_header_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1051 proto_tree_add_item(tree
, hf_gryphon_data_header_length_bits
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1052 proto_tree_add_item(tree
, hf_gryphon_data_data_length
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
1053 proto_tree_add_item(tree
, hf_gryphon_data_extra_data_length
, tvb
, offset
+4, 1, ENC_BIG_ENDIAN
);
1055 /* 20171012 always display mode bits, not just conditionally */
1056 proto_tree_add_bitmask(tree
, tvb
, offset
+5, hf_gryphon_data_mode
, ett_gryphon_flags
, data_mode_flags
, ENC_BIG_ENDIAN
);
1058 proto_tree_add_item(tree
, hf_gryphon_data_priority
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
1059 proto_tree_add_item(tree
, hf_gryphon_data_error_status
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
1061 timestamp
.secs
= tvb_get_ntohl(tvb
, offset
+8)/100000;
1062 timestamp
.nsecs
= (tvb_get_ntohl(tvb
, offset
+8)%100000)*1000;
1063 proto_tree_add_time(tree
, hf_gryphon_data_time
, tvb
, offset
+8, 4, ×tamp
);
1065 proto_tree_add_item(tree
, hf_gryphon_data_context
, tvb
, offset
+12, 1, ENC_BIG_ENDIAN
);
1066 proto_tree_add_item(tree
, hf_gryphon_reserved
, tvb
, offset
+13, 3, ENC_NA
);
1069 tree
= proto_tree_add_subtree(pt
, tvb
, offset
, msgsize
-16-padding
, ett_gryphon_data_body
, NULL
, "Message Body");
1071 proto_tree_add_item(tree
, hf_gryphon_data_header_data
, tvb
, offset
, hdrsize
, ENC_NA
);
1075 proto_tree_add_item(tree
, hf_gryphon_data_data
, tvb
, offset
, datasize
, ENC_NA
);
1079 proto_tree_add_item(tree
, hf_gryphon_data_extra_data
, tvb
, offset
, extrasize
, ENC_NA
);
1080 offset
+= extrasize
;
1083 proto_tree_add_item(tree
, hf_gryphon_data_padding
, tvb
, offset
, padding
, ENC_NA
);
1086 /*proto_tree_add_debug_text(pt, "decode_data() debug offset=%d msgsize=%d", offset, msgsize);*/
1091 decode_event(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1093 int msglen
, msgend
, padding
, length
;
1096 msglen
= tvb_reported_length_remaining(tvb
, offset
);
1097 padding
= 3 - (msglen
+ 3) % 4;
1098 msgend
= offset
+ msglen
;
1100 proto_tree_add_item(pt
, hf_gryphon_event_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1101 proto_tree_add_item(pt
, hf_gryphon_event_context
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1102 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+2, 2, ENC_NA
);
1105 timestamp
.secs
= tvb_get_ntohl(tvb
, offset
)/100000;
1106 timestamp
.nsecs
= (tvb_get_ntohl(tvb
, offset
)%100000)*1000;
1107 proto_tree_add_time(pt
, hf_gryphon_event_time
, tvb
, offset
, 4, ×tamp
);
1110 if (offset
< msgend
) {
1111 length
= msgend
- offset
;
1112 proto_tree_add_item(pt
, hf_gryphon_event_data
, tvb
, offset
, length
, ENC_NA
);
1116 proto_tree_add_item(pt
, hf_gryphon_event_padding
, tvb
, offset
, padding
, ENC_NA
);
1123 // NOLINTNEXTLINE(misc-no-recursion)
1124 decode_misc (tvbuff_t
*tvb
, int offset
, packet_info
* pinfo
, proto_tree
*pt
)
1128 /* proto_tree_add_debug_text(pt, "decode_misc() debug a offset=%d msglen=%d",offset, msglen); */
1129 while(tvb_reported_length_remaining(tvb
, offset
) > 0) {
1132 * This function is called because Gryphon Protocol MISC packets contain within
1133 * them Gryphon Protocol packets (including possibly MISC packets!). So, this
1134 * function decodes that packet and return the offset. Loop thru all such packets
1135 * in the MISC packet.
1138 next_tvb
= tvb_new_subset_remaining(tvb
, offset
);
1139 offset
+= dissect_gryphon_message(next_tvb
, pinfo
, pt
, true);
1145 decode_text (tvbuff_t
*tvb
, int offset
, int msglen
, proto_tree
*pt
)
1147 int padding
, length
;
1149 padding
= 3 - (msglen
+ 3) % 4;
1151 proto_tree_add_item_ret_length(pt
, hf_gryphon_misc_text
, tvb
, offset
, -1, ENC_NA
|ENC_ASCII
, &length
);
1154 proto_tree_add_item(pt
, hf_gryphon_misc_padding
, tvb
, offset
, padding
, ENC_NA
);
1161 cmd_init(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1163 uint8_t mode
= tvb_get_uint8(tvb
, offset
);
1166 proto_tree_add_uint_format_value(pt
, hf_gryphon_cmd_mode
, tvb
, offset
, 1, mode
, "Always initialize");
1168 proto_tree_add_uint_format_value(pt
, hf_gryphon_cmd_mode
, tvb
, offset
, 1, mode
, "Initialize if not previously initialized");
1169 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+1, 3, ENC_NA
);
1174 eventnum(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1176 uint8_t event
= tvb_get_uint8(tvb
, offset
);
1179 proto_tree_add_item(pt
, hf_gryphon_eventnum
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1181 proto_tree_add_uint_format_value(pt
, hf_gryphon_eventnum
, tvb
, offset
, 1, 0, "All Events.");
1187 resp_time(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1192 val
= tvb_get_ntoh64(tvb
, offset
);
1193 timestamp
.secs
= (time_t)(val
/100000);
1194 timestamp
.nsecs
= (int)((val
%100000)*1000);
1196 proto_tree_add_time(pt
, hf_gryphon_resp_time
, tvb
, offset
, 8, ×tamp
);
1203 cmd_setfilt(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1205 int flag
= tvb_get_ntohl(tvb
, offset
);
1206 int length
, padding
;
1208 length
= tvb_get_uint8(tvb
, offset
+4) + tvb_get_uint8(tvb
, offset
+5)
1209 + tvb_get_ntohs(tvb
, offset
+6);
1211 proto_tree_add_uint_format_value(pt
, hf_gryphon_setfilt
, tvb
, offset
, 4,
1212 flag
, "%s%s", ((flag
) ? "Pass" : "Block"), ((length
== 0) ? " all" : ""));
1213 proto_tree_add_uint(pt
, hf_gryphon_setfilt_length
, tvb
, offset
+4, 4, length
);
1216 proto_tree_add_item(pt
, hf_gryphon_setfilt_discard_data
, tvb
, offset
, length
* 2, ENC_NA
);
1217 offset
+= length
* 2;
1219 padding
= 3 - (length
* 2 + 3) % 4;
1221 proto_tree_add_item(pt
, hf_gryphon_setfilt_padding
, tvb
, offset
, padding
, ENC_NA
);
1228 cmd_ioctl_details(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, proto_tree
*pt
, uint32_t ui_command
, int msglen
)
1233 int32_t block_nbytes
;
1239 uint8_t number_bytes
;
1240 uint8_t number_extra_bytes
;
1249 static int * const ldf_schedule_flags
[] = {
1250 &hf_gryphon_ldf_schedule_event
,
1251 &hf_gryphon_ldf_schedule_sporadic
,
1255 /* TODO Gryphon Protocol has LOTS more ioctls, for CANbus, etc. */
1257 switch(ui_command
) {
1258 case GLINDEACTSCHED
:
1266 proto_tree_add_item(pt
, hf_gryphon_ldf_schedule_name
, tvb
, offset
, 32, ENC_ASCII
|ENC_NA
);
1270 case GLINGETNUMSCHEDS
:
1273 us_nsched
= tvb_get_letohs(tvb
, offset
);
1274 proto_tree_add_uint_format_value(pt
, hf_gryphon_ldf_sched_numb_place
, tvb
, offset
, 2, us_nsched
, "%d", us_nsched
);
1278 case GLINGETSCHEDNAMES
:
1280 nbytes
= tvb_reported_length_remaining(tvb
, offset
);
1284 proto_tree_add_item(pt
, hf_gryphon_ldf_schedule_name
, tvb
, offset
, 32, ENC_ASCII
|ENC_NA
);
1293 nbytes
= tvb_get_letohl(tvb
, offset
);
1294 proto_tree_add_uint_format_value(pt
, hf_gryphon_ldf_sched_size
, tvb
, offset
, 4, nbytes
, "%d", nbytes
);
1297 proto_tree_add_item(pt
, hf_gryphon_ldf_schedule_name
, tvb
, offset
, 32, ENC_ASCII
|ENC_NA
);
1301 mtime
= tvb_get_letohl(tvb
, offset
);
1302 value
= (float)mtime
/ (float)10.0;
1303 proto_tree_add_float_format_value(pt
, hf_gryphon_init_strat_delay
, tvb
, offset
, 4, value
, "%.1f milliseconds", value
);
1306 number_ids
= tvb_get_uint8(tvb
, offset
);
1308 /* header length, number of IDs to follow */
1309 proto_tree_add_item(pt
, hf_gryphon_data_header_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1312 number_bytes
= tvb_get_uint8(tvb
, offset
);
1313 number_bytes
&= 0x0F; /* bit0 thru bit3 */
1315 /* data length, number data bytes to follow */
1316 proto_tree_add_uint_format_value(pt
, hf_gryphon_ldf_schedule_msg_dbytes
, tvb
, offset
, 1, number_bytes
, "%d", number_bytes
);
1317 /* sporadic, event-driven flags */
1318 proto_tree_add_bitmask(pt
, tvb
, offset
, hf_gryphon_ldf_schedule_flags
, ett_gryphon_flags
, ldf_schedule_flags
, ENC_BIG_ENDIAN
);
1322 proto_tree_add_item(pt
, hf_gryphon_data_header_data
, tvb
, offset
, number_ids
, ENC_NA
);
1323 offset
+= number_ids
;
1324 proto_tree_add_item(pt
, hf_gryphon_data_data
, tvb
, offset
, number_bytes
, ENC_NA
);
1325 offset
+= number_bytes
;
1328 case GLINGETSCHEDSIZE
:
1331 nbytes
= tvb_get_letohl(tvb
, offset
);
1332 proto_tree_add_uint_format_value(pt
, hf_gryphon_ldf_sched_size_place
, tvb
, offset
, 4, nbytes
, "%d", nbytes
);
1335 proto_tree_add_item(pt
, hf_gryphon_ldf_schedule_name
, tvb
, offset
, 32, ENC_ASCII
|ENC_NA
);
1341 string
= tvb_get_stringz_enc(pinfo
->pool
, tvb
, offset
, &length
, ENC_ASCII
);
1342 /*proto_tree_add_debug_text(pt, "cmd_ioctl_details() debug offset=%d length=%d string='%s'",offset,length,string); */
1343 if(string
[0] == '\0') {
1344 proto_tree_add_string(pt
, hf_gryphon_ldf_schedule_name
, tvb
, offset
, 32, "All schedules");
1346 proto_tree_add_string(pt
, hf_gryphon_ldf_schedule_name
, tvb
, offset
, 32, string
);
1354 /* number of bytes to follow */
1355 nbytes
= tvb_get_letohl(tvb
, offset
);
1356 /*proto_tree_add_item(pt, hf_gryphon_ioctl_nbytes, tvb, offset, 4, ENC_BIG_ENDIAN);*/
1357 proto_tree_add_uint_format_value(pt
, hf_gryphon_ioctl_nbytes
, tvb
, offset
, 4, nbytes
, "%d", nbytes
);
1361 proto_tree_add_item(pt
, hf_gryphon_ldf_schedule_name
, tvb
, offset
, 32, ENC_ASCII
|ENC_NA
);
1369 /* calc the number of bytes in this block */
1370 number_ids
= tvb_get_uint8(tvb
, offset
+4);
1371 number_bytes
= tvb_get_uint8(tvb
, offset
+5);
1373 number_bytes
&= 0x0F; /* bit0 thru bit3 */
1374 block_nbytes
= 4 + 1 + 1 + number_ids
+ number_bytes
;
1376 /* message number */
1377 tree
= proto_tree_add_subtree_format(pt
, tvb
, offset
, block_nbytes
, ett_gryphon_lin_schedule_msg
, NULL
, "LIN message %u", msg
);
1380 /*mtime = tvb_get_ntohl(tvb, offset);*/
1381 mtime
= tvb_get_letohl(tvb
, offset
);
1382 value
= (float)mtime
/ (float)10.0;
1383 proto_tree_add_float_format_value(tree
, hf_gryphon_init_strat_delay
, tvb
, offset
, 4, value
, "%.1f milliseconds", value
);
1386 /* header length, number of IDs to follow */
1387 proto_tree_add_item(tree
, hf_gryphon_data_header_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1390 /* data length, number data bytes to follow */
1391 /*proto_tree_add_item(tree, hf_gryphon_data_data_length, tvb, offset, 1, ENC_BIG_ENDIAN);*/
1392 proto_tree_add_uint_format_value(tree
, hf_gryphon_ldf_schedule_msg_dbytes
, tvb
, offset
, 1, number_bytes
, "%d", number_bytes
);
1393 /* sporadic, event-driven flags */
1394 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_gryphon_ldf_schedule_flags
, ett_gryphon_flags
, ldf_schedule_flags
, ENC_BIG_ENDIAN
);
1398 proto_tree_add_item(tree
, hf_gryphon_data_header_data
, tvb
, offset
, number_ids
, ENC_NA
);
1399 offset
+= number_ids
;
1400 proto_tree_add_item(tree
, hf_gryphon_data_data
, tvb
, offset
, number_bytes
, ENC_NA
);
1401 offset
+= number_bytes
;
1403 nbytes
-= block_nbytes
;
1405 /* proto_tree_add_debug_text(pt, "cmd_ioctl_details() debug offset=%d msglen=%d nbytes=%d",offset,msglen,nbytes);*/
1412 proto_tree_add_item(pt
, hf_gryphon_ldf_ioctl_setflags
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1414 number_ids
= tvb_get_uint8(tvb
, offset
);
1415 proto_tree_add_item(pt
, hf_gryphon_ldf_numb_ids
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1417 for(i
= 0; i
< number_ids
; i
++) {
1418 flags
= tvb_get_uint8(tvb
, offset
);
1419 proto_tree_add_uint_format_value(pt
, hf_gryphon_ldf_ioctl_setflags_flags
, tvb
, offset
, 1, flags
, "0x%x %s",i
,flags
==0 ? "Classic checksum" : (flags
==0x80?"Enhanced checksum":(flags
==0x40?"Event":"UNKNOWN")));
1424 case GLINSETBITRATE
:
1428 mtime
= tvb_get_letohl(tvb
, offset
);
1429 value
= (float)mtime
/ (float)1000.0;
1430 proto_tree_add_float_format_value(pt
, hf_gryphon_ldf_bitrate
, tvb
, offset
, 4, value
, "%.3f Kbps", value
);
1434 case GLINGETNSLAVETABLE
:
1437 proto_tree_add_item(pt
, hf_gryphon_ldf_numb_ids
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1441 case GLINGETSLAVETABLEPIDS
:
1444 number_ids
= tvb_get_uint8(tvb
, offset
);
1445 proto_tree_add_item(pt
, hf_gryphon_ldf_numb_ids
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1447 for(i
= 0; i
< number_ids
; i
++) {
1448 pid
= tvb_get_uint8(tvb
, offset
);
1449 proto_tree_add_uint_format_value(pt
, hf_gryphon_ldf_ioctl_setflags_flags
, tvb
, offset
, 1, pid
, "0x%x ",pid
);
1454 case GLINGETSLAVETABLE
:
1461 * byte 3: enabled=1 or disabled=0, 2=has one-shot
1462 * byte 4: good cs=0 or bad cs=1
1463 * byte 5-13: data[datalen]
1466 pid
= tvb_get_uint8(tvb
, offset
);
1467 proto_tree_add_uint_format_value(pt
, hf_gryphon_ldf_ioctl_setflags_flags
, tvb
, offset
, 1, pid
, "0x%02x ",pid
);
1469 datalen
= tvb_get_uint8(tvb
, offset
);
1470 proto_tree_add_item(pt
, hf_gryphon_lin_data_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1472 extralen
= tvb_get_uint8(tvb
, offset
);
1473 proto_tree_add_item(pt
, hf_gryphon_data_extra_data_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1475 proto_tree_add_item(pt
, hf_gryphon_lin_slave_table_enable
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1477 proto_tree_add_item(pt
, hf_gryphon_lin_slave_table_cs
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1480 proto_tree_add_item(pt
, hf_gryphon_lin_slave_table_data
, tvb
, offset
, datalen
, ENC_NA
);
1484 proto_tree_add_item(pt
, hf_gryphon_lin_slave_table_datacs
, tvb
, offset
, 1, ENC_NA
);
1489 case GLINSETSLAVETABLE
:
1496 * byte 3: enabled=1 or disabled=0
1497 * byte 4-12: data[datalen]
1500 pid
= tvb_get_uint8(tvb
, offset
);
1501 proto_tree_add_uint_format_value(pt
, hf_gryphon_ldf_ioctl_setflags_flags
, tvb
, offset
, 1, pid
, "0x%02x ",pid
);
1503 datalen
= tvb_get_uint8(tvb
, offset
);
1504 proto_tree_add_item(pt
, hf_gryphon_lin_data_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1506 extralen
= tvb_get_uint8(tvb
, offset
);
1507 proto_tree_add_item(pt
, hf_gryphon_data_extra_data_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1509 proto_tree_add_item(pt
, hf_gryphon_lin_slave_table_enable
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1512 proto_tree_add_item(pt
, hf_gryphon_lin_slave_table_data
, tvb
, offset
, datalen
, ENC_NA
);
1516 proto_tree_add_item(pt
, hf_gryphon_lin_slave_table_datacs
, tvb
, offset
, 1, ENC_NA
);
1521 case GLINCLEARSLAVETABLE
:
1524 pid
= tvb_get_uint8(tvb
, offset
);
1525 proto_tree_add_uint_format_value(pt
, hf_gryphon_ldf_ioctl_setflags_flags
, tvb
, offset
, 1, pid
, "0x%02x ",pid
);
1529 case GLINCLEARALLSLAVETABLE
:
1534 case GLINGETMASTEREVENTENABLE
:
1535 case GLINSETMASTEREVENTENABLE
:
1538 proto_tree_add_item(pt
, hf_gryphon_lin_masterevent
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1542 case GLINGETONESHOT
:
1543 case GLINSETONESHOT
:
1547 number_bytes
= tvb_get_uint8(tvb
, offset
+1);
1548 number_extra_bytes
= tvb_get_uint8(tvb
, offset
+2);
1550 proto_tree_add_item(pt
, hf_gryphon_data_header_data
, tvb
, offset
, 1, ENC_NA
);
1552 proto_tree_add_item(pt
, hf_gryphon_lin_numdata
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1554 proto_tree_add_item(pt
, hf_gryphon_lin_numextra
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1557 proto_tree_add_item(pt
, hf_gryphon_data_data
, tvb
, offset
, number_bytes
, ENC_NA
);
1558 offset
+= number_bytes
;
1560 if (number_extra_bytes
) {
1561 proto_tree_add_item(pt
, hf_gryphon_data_extra_data
, tvb
, offset
, number_extra_bytes
, ENC_NA
);
1562 offset
+= number_extra_bytes
;
1566 case GLINCLEARONESHOT
:
1572 case GDLYGETHIVALUE
:
1573 case GDLYSETHIVALUE
:
1574 case GDLYGETLOVALUE
:
1575 case GDLYSETLOVALUE
:
1579 us_stream
= tvb_get_letohs(tvb
, offset
);
1580 proto_tree_add_uint_format_value(pt
, hf_gryphon_dd_stream
, tvb
, offset
, 2, us_stream
, "%d (0x%04X)", us_stream
, us_stream
);
1582 us_value
= tvb_get_letohs(tvb
, offset
);
1583 /* proto_tree_add_item(pt, hf_gryphon_dd_value, tvb, offset, 2, ENC_BIG_ENDIAN);*/
1584 proto_tree_add_uint_format_value(pt
, hf_gryphon_dd_value
, tvb
, offset
, 2, us_value
, "%d (0x%04X)", us_value
, us_value
);
1595 us_stream
= tvb_get_letohs(tvb
, offset
);
1596 proto_tree_add_uint_format_value(pt
, hf_gryphon_dd_stream
, tvb
, offset
, 2, us_stream
, "%d (0x%04X)", us_stream
, us_stream
);
1598 mtime
= tvb_get_letohs(tvb
, offset
);
1599 proto_tree_add_uint_format_value(pt
, hf_gryphon_dd_time
, tvb
, offset
, 2, mtime
, "%d", mtime
);
1603 /* TODO implement remaining delay driver ioctls */
1605 case GDLYGETLOREPORT
: /*get the low water report flag*/
1607 case GDLYFLUSHSTREAM
: /*flush the delay buffer*/
1609 case GDLYINITSTREAM
: /*set default hi & lo water marks*/
1611 case GDLYPARTIALFLUSHSTREAM
: /*flush the delay buffer */
1615 proto_tree_add_item(pt
, hf_gryphon_ioctl_data
, tvb
, offset
, msglen
, ENC_NA
);
1623 * cmd_ioctl() performs the initial decode of the IOCTL command, then
1624 * calls cmd_ioctl_details()
1627 cmd_ioctl(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, proto_tree
*pt
, uint32_t ui_command
)
1633 msglen
= tvb_reported_length_remaining(tvb
, offset
);
1635 /*ioctl = tvb_get_ntohl(tvb, offset);*/
1637 /* 20171012 debug */
1638 /*proto_tree_add_debug_text(pt, "cmd_ioctl() debug offset=%d msglen=%d",offset,msglen);*/
1639 proto_tree_add_item(pt
, hf_gryphon_ioctl
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1644 offset
= cmd_ioctl_details(tvb
, pinfo
, offset
, pt
, ui_command
, msglen
);
1647 padding
= tvb_reported_length_remaining(tvb
, offset
);
1648 /*proto_tree_add_debug_text(pt, "cmd_ioctl() debug offset=%d msglen=%d padding=%d",offset,msglen,padding);*/
1650 proto_tree_add_item(pt
, hf_gryphon_setfilt_padding
, tvb
, offset
, padding
, ENC_NA
);
1658 * displays the IOCTL data in the IOCTL response to the IOCTL request
1659 * Here is an issue with the IOCTLs. The IOCTL request contains the IOCTL number,
1660 * but the IOCTL response does not contain the number. IOCTL response
1661 * contains the context byte of the request, so application software can match
1662 * the IOCTL response to the request.
1665 cmd_ioctl_resp(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, proto_tree
*pt
, uint32_t ui_command
)
1667 int msglen
= tvb_reported_length_remaining(tvb
, offset
);
1669 /* 20171012 debug */
1670 /*proto_tree_add_debug_text(pt, "cmd_ioctl_resp() debug offset=%d msglen=%d",offset,msglen);*/
1673 /*proto_tree_add_item(pt, hf_gryphon_ioctl_data, tvb, offset, msglen, ENC_NA);*/
1674 /*offset += msglen;*/
1675 offset
= cmd_ioctl_details(tvb
, pinfo
, offset
, pt
, ui_command
, msglen
);
1681 filter_block(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1683 uint32_t op
, length
, padding
;
1685 /* 20171017 fixed display of filter block padding */
1688 proto_tree_add_item(pt
, hf_gryphon_filter_block_filter_start
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1692 proto_tree_add_item_ret_uint(pt
, hf_gryphon_filter_block_filter_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &length
);
1696 proto_tree_add_item(pt
, hf_gryphon_filter_block_filter_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1699 /* operator 1byte */
1700 proto_tree_add_item_ret_uint(pt
, hf_gryphon_filter_block_filter_operator
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &op
);
1704 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
, 2, ENC_NA
);
1707 if (op
== BIT_FIELD_CHECK
) {
1708 proto_tree_add_item(pt
, hf_gryphon_filter_block_pattern
, tvb
, offset
, length
, ENC_NA
);
1709 proto_tree_add_item(pt
, hf_gryphon_filter_block_mask
, tvb
, offset
+ length
, length
, ENC_NA
);
1711 offset
+= length
* 2;
1712 padding
= (length
* 2) % 4;
1714 proto_tree_add_item(pt
, hf_gryphon_padding
, tvb
, offset
, padding
, ENC_NA
);
1721 proto_tree_add_item(pt
, hf_gryphon_filter_block_filter_value1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1725 proto_tree_add_item(pt
, hf_gryphon_filter_block_filter_value2
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1729 proto_tree_add_item(pt
, hf_gryphon_filter_block_filter_value4
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1733 proto_tree_add_item(pt
, hf_gryphon_filter_block_filter_value_bytes
, tvb
, offset
, length
, ENC_NA
);
1737 padding
= 3 - ((length
+ 3) % 4);
1739 proto_tree_add_item(pt
, hf_gryphon_padding
, tvb
, offset
, padding
, ENC_NA
);
1747 cmd_addfilt(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1750 int blocks
, i
, length
;
1753 tree
= proto_tree_add_subtree(pt
, tvb
, offset
, 1, ett_gryphon_flags
, NULL
, "Flags");
1754 proto_tree_add_item(tree
, hf_gryphon_addfilt_pass
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1755 proto_tree_add_item(tree
, hf_gryphon_addfilt_active
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1758 blocks
= tvb_get_uint8(tvb
, offset
);
1759 proto_tree_add_item(pt
, hf_gryphon_addfilt_blocks
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1760 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+1, 6, ENC_NA
);
1763 for (i
= 1; i
<= blocks
; i
++) {
1764 length
= tvb_get_ntohs(tvb
, offset
+2) + 8;
1765 /*length += 3 - (length + 3) % 4; */
1766 padding
= 3 - (length
+ 3) % 4;
1767 tree
= proto_tree_add_subtree_format(pt
, tvb
, offset
, length
+ padding
, ett_gryphon_cmd_filter_block
, NULL
, "Filter block %d", i
);
1768 offset
= filter_block(tvb
, offset
, tree
);
1774 resp_addfilt(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1776 proto_tree_add_item(pt
, hf_gryphon_addfilt_handle
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1777 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+1, 3, ENC_NA
);
1783 cmd_modfilt(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1785 uint8_t filter_handle
= tvb_get_uint8(tvb
, offset
);
1788 proto_tree_add_item(pt
, hf_gryphon_modfilt
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1790 proto_tree_add_uint_format_value(pt
, hf_gryphon_modfilt
, tvb
, offset
, 1,
1791 0, "Filter handles: all");
1793 proto_tree_add_item(pt
, hf_gryphon_modfilt_action
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1794 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+2, 2, ENC_NA
);
1800 resp_filthan(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1802 int handles
= tvb_get_uint8(tvb
, offset
);
1803 int i
, padding
, handle
;
1805 proto_tree_add_item(pt
, hf_gryphon_filthan
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1806 for (i
= 1; i
<= handles
; i
++){
1807 handle
= tvb_get_uint8(tvb
, offset
+i
);
1808 proto_tree_add_uint_format_value(pt
, hf_gryphon_filthan_id
, tvb
, offset
+i
, 1,
1809 handle
, "Handle %d: %u", i
, handle
);
1811 padding
= 3 - (handles
+ 1 + 3) % 4;
1813 proto_tree_add_item(pt
, hf_gryphon_filthan_padding
, tvb
, offset
+1+handles
, padding
, ENC_NA
);
1814 offset
+= 1+handles
+padding
;
1819 dfiltmode(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1821 proto_tree_add_item(pt
, hf_gryphon_dfiltmode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1822 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+1, 3, ENC_NA
);
1828 filtmode(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1830 proto_tree_add_item(pt
, hf_gryphon_filtmode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1831 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+1, 3, ENC_NA
);
1837 resp_events(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1843 msglen
= tvb_reported_length_remaining(tvb
, offset
);
1845 while (msglen
!= 0) {
1846 tree
= proto_tree_add_subtree_format(pt
, tvb
, offset
, 20, ett_gryphon_cmd_events_data
, NULL
, "Event %d:", i
);
1847 proto_tree_add_item(tree
, hf_gryphon_event_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1848 proto_tree_add_item(tree
, hf_gryphon_event_name
, tvb
, offset
+1, 19, ENC_NA
|ENC_ASCII
);
1857 cmd_register(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1859 proto_tree_add_item(pt
, hf_gryphon_register_username
, tvb
, offset
, 16, ENC_NA
|ENC_ASCII
);
1861 proto_tree_add_item(pt
, hf_gryphon_register_password
, tvb
, offset
, 32, ENC_NA
|ENC_ASCII
);
1867 resp_register(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1869 proto_tree_add_item(pt
, hf_gryphon_register_client_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1870 proto_tree_add_item(pt
, hf_gryphon_register_privileges
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1871 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+2, 2, ENC_NA
);
1878 resp_getspeeds(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1881 size
= tvb_get_uint8(tvb
, offset
+8),
1882 number
= tvb_get_uint8(tvb
, offset
+9);
1884 proto_tree_add_item(pt
, hf_gryphon_getspeeds_set_ioctl
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1885 proto_tree_add_item(pt
, hf_gryphon_getspeeds_get_ioctl
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
1886 proto_tree_add_item(pt
, hf_gryphon_getspeeds_size
, tvb
, offset
+8, 1, ENC_BIG_ENDIAN
);
1887 proto_tree_add_item(pt
, hf_gryphon_getspeeds_preset
, tvb
, offset
+9, 1, ENC_BIG_ENDIAN
);
1890 for (indx
= 1; indx
<= number
; indx
++) {
1891 proto_tree_add_bytes_format(pt
, hf_gryphon_getspeeds_data
, tvb
, offset
, size
,
1892 tvb_get_ptr(tvb
, offset
, size
), "Data for preset %d", indx
);
1899 cmd_sort(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1901 proto_tree_add_item(pt
, hf_gryphon_cmd_sort
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1906 cmd_optimize(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1908 proto_tree_add_item(pt
, hf_gryphon_cmd_optimize
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1913 resp_config(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1915 proto_tree
*ft
, *tree
;
1920 proto_tree_add_item(pt
, hf_gryphon_config_device_name
, tvb
, offset
, 20, ENC_NA
|ENC_ASCII
);
1923 proto_tree_add_item(pt
, hf_gryphon_config_device_version
, tvb
, offset
, 8, ENC_NA
|ENC_ASCII
);
1926 proto_tree_add_item(pt
, hf_gryphon_config_device_serial_number
, tvb
, offset
, 20, ENC_NA
|ENC_ASCII
);
1929 devices
= tvb_get_uint8(tvb
, offset
);
1931 proto_tree_add_item(pt
, hf_gryphon_config_num_channels
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1932 proto_tree_add_item(pt
, hf_gryphon_config_name_version_ext
, tvb
, offset
+1, 11, ENC_NA
|ENC_ASCII
);
1933 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+12, 4, ENC_NA
);
1936 for (i
= 1; i
<= devices
; i
++) {
1937 ft
= proto_tree_add_subtree_format(pt
, tvb
, offset
, 80, ett_gryphon_cmd_config_device
, NULL
, "Channel %d:", i
);
1939 proto_tree_add_item(ft
, hf_gryphon_config_driver_name
, tvb
, offset
, 20, ENC_NA
|ENC_ASCII
);
1942 proto_tree_add_item(ft
, hf_gryphon_config_driver_version
, tvb
, offset
, 8, ENC_NA
|ENC_ASCII
);
1945 proto_tree_add_item(ft
, hf_gryphon_config_device_security
, tvb
, offset
, 16, ENC_NA
|ENC_ASCII
);
1948 x
= tvb_get_ntohl (tvb
, offset
);
1950 tree
= proto_tree_add_subtree(ft
, tvb
, offset
, 4, ett_gryphon_valid_headers
, NULL
, "Valid Header lengths");
1951 for (j
= 0; ; j
++) {
1953 proto_tree_add_uint_format(tree
, hf_gryphon_valid_header_length
, tvb
, offset
, 4, j
, "%d byte%s", j
,
1962 proto_tree_add_item(ft
, hf_gryphon_config_max_data_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1965 proto_tree_add_item(ft
, hf_gryphon_config_min_data_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1968 proto_tree_add_item(ft
, hf_gryphon_config_hardware_serial_number
, tvb
, offset
, 20, ENC_NA
|ENC_ASCII
);
1971 proto_tree_add_item(ft
, hf_gryphon_config_protocol_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1974 proto_tree_add_item(ft
, hf_gryphon_config_channel_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1977 proto_tree_add_item(ft
, hf_gryphon_config_card_slot_number
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1980 proto_tree_add_item(ft
, hf_gryphon_config_max_extra_data
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1983 proto_tree_add_item(ft
, hf_gryphon_config_min_extra_data
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1991 cmd_sched(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1994 proto_item
*item
, *item1
;
1995 proto_tree
*tree
, *tree1
;
1997 unsigned int i
, x
, length
;
1998 uint8_t def_chan
= tvb_get_uint8(tvb
, offset
-9);
2000 msglen
= tvb_reported_length_remaining(tvb
, offset
);
2002 if (tvb_get_ntohl(tvb
, offset
) == 0xFFFFFFFF)
2003 proto_tree_add_uint_format_value(pt
, hf_gryphon_sched_num_iterations
, tvb
, offset
, 4,
2006 proto_tree_add_item(pt
, hf_gryphon_sched_num_iterations
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2011 item
= proto_tree_add_item(pt
, hf_gryphon_sched_flags
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2012 tree
= proto_item_add_subtree (item
, ett_gryphon_flags
);
2013 proto_tree_add_item(tree
, hf_gryphon_sched_flags_scheduler
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2018 while (msglen
> 0) {
2020 length
= 16 + tvb_get_uint8(tvb
, offset
+16) + tvb_get_ntohs(tvb
, offset
+18) + tvb_get_uint8(tvb
, offset
+20) + 16;
2021 length
+= 3 - (length
+ 3) % 4;
2023 tree
= proto_tree_add_subtree_format(pt
, tvb
, offset
, length
, ett_gryphon_cmd_sched_data
, NULL
, "Message %d", i
);
2024 proto_tree_add_item(tree
, hf_gryphon_sched_sleep
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2028 proto_tree_add_item(tree
, hf_gryphon_sched_transmit_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2032 proto_tree_add_item(tree
, hf_gryphon_sched_transmit_period
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2036 item1
= proto_tree_add_item(tree
, hf_gryphon_sched_transmit_flags
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2037 tree1
= proto_item_add_subtree (item1
, ett_gryphon_flags
);
2038 proto_tree_add_item(tree1
, hf_gryphon_sched_skip_transmit_period
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2040 /* N.B. Same bit as skip_transmit_period..? */
2041 proto_tree_add_item(tree1
, hf_gryphon_sched_skip_sleep
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2044 x
= tvb_get_uint8(tvb
, offset
+2);
2048 proto_tree_add_uint(tree
, hf_gryphon_sched_channel0
, tvb
, offset
+2, 1, x
);
2050 proto_tree_add_uint(tree
, hf_gryphon_sched_channel
, tvb
, offset
+2, 1, x
);
2053 proto_tree_add_item(tree
, hf_gryphon_reserved
, tvb
, offset
+3, 1, ENC_NA
);
2057 tree1
= proto_tree_add_subtree(tree
, tvb
, offset
, msglen
, ett_gryphon_cmd_sched_cmd
, NULL
, "Message");
2058 save_offset
= offset
;
2059 offset
= decode_data(tvb
, offset
, tree1
);
2060 msglen
-= offset
- save_offset
;
2067 cmd_sched_rep(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2072 x
= tvb_get_ntohl(tvb
, offset
);
2077 proto_tree_add_uint_format_value(pt
, hf_gryphon_sched_rep_id
, tvb
,
2078 offset
, 4, x
, "%s schedule ID: %u", type
, x
);
2081 proto_tree_add_item(pt
, hf_gryphon_sched_rep_message_index
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2082 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+1, 3, ENC_NA
);
2084 offset
= decode_data(tvb
, offset
, pt
);
2089 resp_blm_data(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2095 timestamp
.secs
= tvb_get_ntohl(tvb
, offset
)/100000;
2096 timestamp
.nsecs
= (tvb_get_ntohl(tvb
, offset
)%100000)*1000;
2097 proto_tree_add_time(pt
, hf_gryphon_blm_data_time
, tvb
, offset
, 4, ×tamp
);
2100 x
= tvb_get_ntohs(tvb
, offset
);
2101 proto_tree_add_uint_format_value(pt
, hf_gryphon_blm_data_bus_load
, tvb
,
2102 offset
, 2, x
, "%d.%02d%%", x
/ 100, x
% 100);
2104 x
= tvb_get_ntohs(tvb
, offset
);
2105 proto_tree_add_uint_format_value(pt
, hf_gryphon_blm_data_current_bus_load
, tvb
,
2106 offset
, 2, x
, "%d.%02d%%", x
/ 100, x
% 100);
2108 x
= tvb_get_ntohs(tvb
, offset
);
2109 proto_tree_add_uint_format_value(pt
, hf_gryphon_blm_data_peak_bus_load
, tvb
,
2110 offset
, 2, x
, "%d.%02d%%", x
/ 100, x
% 100);
2112 x
= tvb_get_ntohs(tvb
, offset
);
2113 proto_tree_add_uint_format_value(pt
, hf_gryphon_blm_data_historic_peak_bus_load
, tvb
,
2114 offset
, 2, x
, "%d.%02d%%", x
/ 100, x
% 100);
2121 resp_blm_stat(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2123 offset
= resp_blm_data(tvb
, offset
, pt
);
2125 proto_tree_add_item(pt
, hf_gryphon_blm_stat_receive_frame_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2127 proto_tree_add_item(pt
, hf_gryphon_blm_stat_transmit_frame_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2129 proto_tree_add_item(pt
, hf_gryphon_blm_stat_receive_dropped_frame_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2131 proto_tree_add_item(pt
, hf_gryphon_blm_stat_transmit_dropped_frame_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2133 proto_tree_add_item(pt
, hf_gryphon_blm_stat_receive_error_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2135 proto_tree_add_item(pt
, hf_gryphon_blm_stat_transmit_error_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2141 * command to get a list of LDFs
2144 cmd_ldf_list(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2148 proto_tree_add_item(pt
, hf_gryphon_ldf_list
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2155 resp_ldf_list(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2159 proto_tree
*localTree
;
2162 blocks
= tvb_get_uint8(tvb
, offset
);
2163 proto_tree_add_item(pt
, hf_gryphon_ldf_number
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2167 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
, 1, ENC_NA
);
2170 /* number remaining */
2171 proto_tree_add_item(pt
, hf_gryphon_ldf_remaining
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2175 for(i
=0;i
<blocks
;i
++) {
2176 localTree
= proto_tree_add_subtree_format(pt
, tvb
, offset
, 32+80, ett_gryphon_ldf_block
, NULL
, "LDF %d",i
+1);
2177 proto_tree_add_item(localTree
, hf_gryphon_ldf_name
, tvb
, offset
, 32, ENC_ASCII
|ENC_NA
);
2179 proto_tree_add_item(localTree
, hf_gryphon_ldf_description
, tvb
, offset
, 80, ENC_ASCII
|ENC_NA
);
2187 cmd_ldf_delete(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2190 proto_tree_add_item(pt
, hf_gryphon_ldf_name
, tvb
, offset
, 32, ENC_ASCII
|ENC_NA
);
2197 cmd_ldf_desc(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2202 size
= tvb_get_ntohl(tvb
, offset
);
2203 proto_tree_add_uint_format_value(pt
, hf_gryphon_ldf_size
, tvb
, offset
, 4, size
, "%u", size
);
2205 proto_tree_add_item(pt
, hf_gryphon_ldf_name
, tvb
, offset
, 32, ENC_ASCII
|ENC_NA
);
2207 proto_tree_add_item(pt
, hf_gryphon_ldf_description
, tvb
, offset
, 80, ENC_ASCII
|ENC_NA
);
2213 resp_ldf_desc(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2215 proto_tree_add_item(pt
, hf_gryphon_ldf_exists
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2217 proto_tree_add_item(pt
, hf_gryphon_ldf_desc_pad
, tvb
, offset
, 2, ENC_NA
);
2223 cmd_ldf_upload(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2228 msglen
= tvb_reported_length_remaining(tvb
, offset
);
2231 /*blockn = tvb_get_ntohs(tvb, offset);*/
2232 /* 20171101 debug */
2233 /*proto_tree_add_debug_text(pt, "------------------debug offset=%d blockn=%d msglen=%d",offset,blockn,msglen);*/
2234 proto_tree_add_item(pt
, hf_gryphon_ldf_blockn
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2237 /* 20171101 file string */
2238 proto_tree_add_item(pt
, hf_gryphon_ldf_file
, tvb
, offset
, msglen
- 2, ENC_NA
|ENC_ASCII
);
2239 offset
+= msglen
- 2;
2244 cmd_ldf_parse(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2246 proto_tree_add_item(pt
, hf_gryphon_ldf_name
, tvb
, offset
, 32, ENC_ASCII
|ENC_NA
);
2252 resp_get_ldf_info(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2256 proto_tree_add_item(pt
, hf_gryphon_ldf_info_pv
, tvb
, offset
, 16, ENC_ASCII
|ENC_NA
);
2258 proto_tree_add_item(pt
, hf_gryphon_ldf_info_lv
, tvb
, offset
, 16, ENC_ASCII
|ENC_NA
);
2260 bitrate
= tvb_get_ntohl(tvb
, offset
);
2261 value
= (float)bitrate
/ (float)1000.0;
2262 proto_tree_add_float_format_value(pt
, hf_gryphon_ldf_bitrate
, tvb
, offset
, 4, value
, "%.3f Kbps", value
);
2268 cmd_cnvt_get_values(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2270 uint8_t num_signals
;
2273 num_signals
= tvb_get_uint8(tvb
, offset
);
2274 proto_tree_add_item(pt
, hf_gryphon_ldf_get_frame_num_signals
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2276 for(i
=0;i
< num_signals
; i
++) {
2277 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_signal_name
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2284 resp_cnvt_get_values(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2287 uint8_t num_signals
;
2291 num_signals
= tvb_get_uint8(tvb
, offset
);
2292 proto_tree_add_item(pt
, hf_gryphon_ldf_get_frame_num_signals
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2294 for(i
=0;i
< num_signals
; i
++) {
2296 flag
= tvb_get_uint8(tvb
, offset
);
2297 proto_tree_add_item(pt
, hf_gryphon_cnvt_flags_getvalues
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2302 fvalue
= tvb_get_ntohieee_float (tvb
, offset
);
2303 proto_tree_add_float_format_value(pt
, hf_gryphon_cnvt_valuef
, tvb
, offset
, 4, fvalue
, "%.1f", fvalue
);
2308 proto_tree_add_item(pt
, hf_gryphon_cnvt_valuei
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2313 proto_tree_add_item_ret_length(pt
, hf_gryphon_cnvt_values
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2322 cmd_cnvt_get_units(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2324 uint8_t num_signals
;
2327 num_signals
= tvb_get_uint8(tvb
, offset
);
2328 proto_tree_add_item(pt
, hf_gryphon_ldf_get_frame_num_signals
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2330 for(i
=0;i
< num_signals
; i
++) {
2331 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_signal_name
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2338 resp_cnvt_get_units(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2340 uint8_t num_signals
;
2343 num_signals
= tvb_get_uint8(tvb
, offset
);
2344 proto_tree_add_item(pt
, hf_gryphon_ldf_get_frame_num_signals
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2346 for(i
=0;i
< num_signals
; i
++) {
2348 proto_tree_add_item_ret_length(pt
, hf_gryphon_cnvt_units
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2355 cmd_cnvt_set_values(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2357 uint8_t num_signals
;
2361 num_signals
= tvb_get_uint8(tvb
, offset
);
2362 proto_tree_add_item(pt
, hf_gryphon_ldf_get_frame_num_signals
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2364 for(i
=0;i
< num_signals
; i
++) {
2365 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_signal_name
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2368 fvalue
= tvb_get_ntohieee_float (tvb
, offset
);
2369 proto_tree_add_float_format_value(pt
, hf_gryphon_cnvt_valuef
, tvb
, offset
, 4, fvalue
, "%.2f", fvalue
);
2376 cmd_cnvt_destroy_session(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2379 msglen
= tvb_reported_length_remaining(tvb
, offset
);
2380 proto_tree_add_item(pt
, hf_gryphon_ldf_ui
, tvb
, offset
, msglen
, ENC_NA
);
2386 resp_ldf_get_node_names(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2391 us_num
= tvb_get_ntohs(tvb
, offset
);
2392 proto_tree_add_item(pt
, hf_gryphon_ldf_num_node_names
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2394 /* master node name */
2395 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_master_node_name
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2399 /* slave node names */
2400 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_slave_node_name
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2408 cmd_ldf_get_frames(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2411 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_get_frame
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2417 resp_ldf_get_frames(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2423 us_num
= tvb_get_ntohs(tvb
, offset
);
2424 proto_tree_add_item(pt
, hf_gryphon_ldf_num_frames
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2428 pid
= tvb_get_uint8(tvb
, offset
);
2429 proto_tree_add_uint_format_value(pt
, hf_gryphon_ldf_ioctl_setflags_flags
, tvb
, offset
, 1, pid
, "0x%x ",pid
);
2432 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_get_frame
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2440 cmd_ldf_get_frame_info(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, proto_tree
*pt
)
2445 string
= tvb_get_stringz_enc(pinfo
->pool
, tvb
, offset
, &length
, ENC_ASCII
);
2447 proto_tree_add_string(pt
, hf_gryphon_ldf_get_frame
, tvb
, offset
, length
, string
);
2449 proto_tree_add_uint_format_value(pt
, hf_gryphon_ldf_ioctl_setflags_flags
, tvb
, offset
, 1, 0, "(Id not used)");
2452 id
= tvb_get_uint8(tvb
, offset
);
2453 proto_tree_add_uint_format_value(pt
, hf_gryphon_ldf_ioctl_setflags_flags
, tvb
, offset
, 1, id
, "0x%x ",id
);
2460 resp_ldf_get_frame_info(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2464 proto_tree_add_item(pt
, hf_gryphon_ldf_get_frame_num
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2466 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_get_frame_pub
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2468 count
= tvb_get_uint8(tvb
, offset
);
2469 proto_tree_add_item(pt
, hf_gryphon_ldf_get_frame_num_signals
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2471 for (i
= 0; i
< count
; i
++) {
2472 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_signal_name
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2479 cmd_ldf_get_signal_info(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2482 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_signal_name
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2488 resp_ldf_get_signal_info(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2492 proto_tree_add_item(pt
, hf_gryphon_ldf_signal_offset
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2496 proto_tree_add_item(pt
, hf_gryphon_ldf_signal_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2499 /* signal encoding name */
2500 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_signal_encoding_name
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2506 cmd_ldf_get_signal_detail(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2509 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_signal_name
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2515 resp_ldf_do_encoding_block(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, proto_tree
*pt
)
2520 string
= tvb_get_stringz_enc(pinfo
->pool
, tvb
, offset
, &length
, ENC_ASCII
);
2521 proto_tree_add_string(pt
, hf_gryphon_ldf_signal_encoding_type
, tvb
, offset
, 12, string
);
2523 if(string
[0] == 'l') {
2525 proto_tree_add_item(pt
, hf_gryphon_ldf_encoding_value
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2527 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_signal_encoding_logical
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2529 } else if(string
[0] == 'p') {
2531 proto_tree_add_item(pt
, hf_gryphon_ldf_encoding_min
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2533 proto_tree_add_item(pt
, hf_gryphon_ldf_encoding_max
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2535 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_signal_encoding_logical
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2537 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_signal_encoding_logical
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2539 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_signal_encoding_logical
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2541 } else if(string
[0] == 'b') {
2542 proto_tree_add_item(pt
, hf_gryphon_ldf_encoding_value
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2545 } else if(string
[0] == 'a') {
2546 proto_tree_add_item(pt
, hf_gryphon_ldf_encoding_value
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2556 resp_ldf_get_signal_detail(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, proto_tree
*pt
)
2560 proto_tree_add_item(pt
, hf_gryphon_ldf_signal_offset
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2564 proto_tree_add_item(pt
, hf_gryphon_ldf_signal_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2568 us_num
= tvb_get_ntohs(tvb
, offset
);
2569 proto_tree_add_item(pt
, hf_gryphon_ldf_num_encodings
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2572 offset
= resp_ldf_do_encoding_block(tvb
, pinfo
, offset
, pt
);
2580 cmd_ldf_get_encoding_info(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2583 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_signal_encoding_name
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2589 resp_ldf_get_encoding_info(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, proto_tree
*pt
)
2593 us_num
= tvb_get_ntohs(tvb
, offset
);
2594 proto_tree_add_item(pt
, hf_gryphon_ldf_num_encodings
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2598 offset
= resp_ldf_do_encoding_block(tvb
, pinfo
, offset
, pt
);
2605 cmd_ldf_save_session(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2608 msglen
= tvb_reported_length_remaining(tvb
, offset
);
2609 proto_tree_add_item(pt
, hf_gryphon_ldf_restore_session
, tvb
, offset
, msglen
, ENC_NA
);
2615 cmd_ldf_emulate_nodes(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, proto_tree
*pt
)
2620 unsigned int xchannel
;
2625 nnodes
= tvb_get_uint8(tvb
, offset
);
2626 proto_tree_add_item(pt
, hf_gryphon_ldf_nodenumber
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2629 for(i
=0;i
<nnodes
;i
++) {
2630 /* first, find the end of the string, then use that string len to build a subtree */
2632 string
= tvb_get_stringz_enc(pinfo
->pool
, tvb
, offset
+1, &length
, ENC_ASCII
);
2634 tree2
= proto_tree_add_subtree_format(pt
, tvb
, offset
, 1+length
, ett_gryphon_lin_emulate_node
, NULL
, "Node %u", node_numb
);
2636 xchannel
= tvb_get_uint8(tvb
, offset
);
2637 proto_tree_add_uint(tree2
, hf_gryphon_sched_channel
, tvb
, offset
, 1, xchannel
);
2640 proto_tree_add_string(tree2
, hf_gryphon_lin_nodename
, tvb
, offset
, length
, string
);
2649 resp_ldf_get_schedules(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2654 us_num
= tvb_get_ntohs(tvb
, offset
);
2655 proto_tree_add_item(pt
, hf_gryphon_ldf_num_schedules
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2658 /* slave node names */
2659 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_schedule_name
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2667 cmd_ldf_start_schedule(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2670 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_schedule_name
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2676 cmd_ldf_get_node_signals(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2679 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_node_name
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2685 resp_ldf_get_node_signals(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2690 us_num
= tvb_get_ntohs(tvb
, offset
);
2691 proto_tree_add_item(pt
, hf_gryphon_ldf_num_signal_names
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2695 proto_tree_add_item_ret_length(pt
, hf_gryphon_ldf_signal_name
, tvb
, offset
, -1, ENC_NA
| ENC_ASCII
, &length
);
2703 cmd_restore_session(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2706 msglen
= tvb_reported_length_remaining(tvb
, offset
);
2707 proto_tree_add_item(pt
, hf_gryphon_ldf_restore_session
, tvb
, offset
, msglen
, ENC_NA
);
2713 resp_restore_session(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2715 proto_tree_add_item(pt
, hf_gryphon_ldf_name
, tvb
, offset
, 32, ENC_ASCII
|ENC_NA
);
2721 // NOLINTNEXTLINE(misc-no-recursion)
2722 cmd_addresp(tvbuff_t
*tvb
, int offset
, packet_info
* pinfo
, proto_tree
*pt
)
2726 unsigned blocks
, responses
, i
, msglen
, length
;
2728 int action
, actionType
, actionValue
;
2733 item
= proto_tree_add_item(pt
, hf_gryphon_addresp_flags
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2734 tree
= proto_item_add_subtree (item
, ett_gryphon_flags
);
2735 /* 20171017 fixed display of filter flags */
2737 proto_tree_add_item(tree
, hf_gryphon_addresp_flags_active
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2741 /* number of filter blocks */
2742 proto_tree_add_item_ret_uint(pt
, hf_gryphon_addresp_blocks
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &blocks
);
2745 /* number of responses */
2746 proto_tree_add_item_ret_uint(pt
, hf_gryphon_addresp_responses
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &responses
);
2750 proto_tree_add_item(pt
, hf_gryphon_addresp_old_handle
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2754 action
= tvb_get_uint8(tvb
, offset
);
2755 item
= proto_tree_add_item(pt
, hf_gryphon_addresp_action
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2756 tree
= proto_item_add_subtree (item
, ett_gryphon_flags
);
2757 actionValue
= tvb_get_ntohs(tvb
, offset
+2);
2759 if (action
& FR_PERIOD_MSGS
) {
2765 proto_tree_add_item(tree
, hf_gryphon_addresp_action_period
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2768 proto_tree_add_item(tree
, hf_gryphon_addresp_action_deact_on_event
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2769 proto_tree_add_item(tree
, hf_gryphon_addresp_action_deact_after_period
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2773 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
, 1, ENC_NA
);
2776 if (actionType
== 1) {
2777 proto_tree_add_uint_format_value(pt
, hf_gryphon_addresp_action_period_type
, tvb
,
2778 offset
, 2, actionValue
, "Period: %d messages", actionValue
);
2780 proto_tree_add_uint_format_value(pt
, hf_gryphon_addresp_action_period_type
, tvb
,
2781 offset
, 2, actionValue
, "Period: %d.%02d seconds", actionValue
/100, actionValue
%100);
2786 proto_tree_add_uint_format_value(pt
, hf_gryphon_addresp_action_period_type
, tvb
, offset
, 2, actionValue
, "(not used)");
2790 for (i
= 1; i
<= blocks
; i
++) {
2791 length
= tvb_get_ntohs(tvb
, offset
+2) + 8;
2792 padding
= 3 - (length
+ 3) % 4;
2793 tree
= proto_tree_add_subtree_format(pt
, tvb
, offset
, length
+ padding
, ett_gryphon_cmd_filter_block
, NULL
, "Filter block %d", i
);
2794 /* 20171017 fixed display of filter block padding */
2795 offset
= filter_block(tvb
, offset
, tree
);
2797 for (i
= 1; i
<= responses
; i
++) {
2798 msglen
= tvb_get_ntohs(tvb
, offset
+4) + 8;
2799 padding
= 3 - (msglen
+ 3) % 4;
2800 tree
= proto_tree_add_subtree_format(pt
, tvb
, offset
, msglen
+ padding
, ett_gryphon_cmd_response_block
, NULL
, "Response block %d", i
);
2801 next_tvb
= tvb_new_subset_length(tvb
, offset
, msglen
+ padding
);
2802 dissect_gryphon_message(next_tvb
, pinfo
, tree
, true);
2803 offset
+= msglen
+ padding
;
2809 resp_addresp(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2811 proto_tree_add_item(pt
, hf_gryphon_addresp_handle
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2812 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+1, 3, ENC_NA
);
2818 cmd_modresp(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2820 uint8_t dest
= tvb_get_uint8(tvb
, offset
-5),
2821 resp_handle
= tvb_get_uint8(tvb
, offset
);
2824 proto_tree_add_item(pt
, hf_gryphon_modresp_handle
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2826 proto_tree_add_uint_format_value(pt
, hf_gryphon_modresp_handle
, tvb
,
2827 offset
, 1, dest
, "Response handles: all on channel %c", dest
);
2829 proto_tree_add_uint_format_value(pt
, hf_gryphon_modresp_handle
, tvb
, offset
, 1,
2830 0, "Response handles: all");
2832 proto_tree_add_item(pt
, hf_gryphon_modresp_action
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
2833 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+2, 2, ENC_NA
);
2839 resp_resphan(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2841 int handles
= tvb_get_uint8(tvb
, offset
);
2842 int i
, padding
, handle
;
2844 proto_tree_add_item(pt
, hf_gryphon_num_resphan
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2845 for (i
= 1; i
<= handles
; i
++){
2846 handle
= tvb_get_uint8(tvb
, offset
+i
);
2847 proto_tree_add_uint_format(pt
, hf_gryphon_handle
, tvb
, offset
+i
, 1, handle
, "Handle %d: %u", i
,
2850 padding
= 3 - (handles
+ 1 + 3) % 4;
2852 proto_tree_add_item(pt
, hf_gryphon_padding
, tvb
, offset
+1+handles
, padding
, ENC_NA
);
2853 offset
+= 1+handles
+padding
;
2858 resp_sched(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2860 proto_tree_add_item(pt
, hf_gryphon_transmit_sched_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2866 cmd_desc(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2868 proto_tree_add_item(pt
, hf_gryphon_desc_program_size
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2871 proto_tree_add_item(pt
, hf_gryphon_desc_program_name
, tvb
, offset
, 32, ENC_NA
|ENC_ASCII
);
2874 proto_tree_add_item(pt
, hf_gryphon_desc_program_description
, tvb
, offset
, 80, ENC_NA
|ENC_ASCII
);
2881 resp_desc(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2886 item
= proto_tree_add_item(pt
, hf_gryphon_desc_flags
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2887 tree
= proto_item_add_subtree (item
, ett_gryphon_flags
);
2888 proto_tree_add_item(tree
, hf_gryphon_desc_flags_program
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2889 proto_tree_add_item(pt
, hf_gryphon_desc_handle
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2890 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+2, 2, ENC_NA
);
2896 cmd_upload(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2899 unsigned int length
;
2901 msglen
= tvb_reported_length_remaining(tvb
, offset
);
2902 proto_tree_add_item(pt
, hf_gryphon_upload_block_number
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2903 proto_tree_add_item(pt
, hf_gryphon_upload_handle
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
2908 proto_tree_add_item(pt
, hf_gryphon_upload_data
, tvb
, offset
, length
, ENC_NA
);
2911 length
= 3 - (length
+ 3) % 4;
2913 proto_tree_add_item(pt
, hf_gryphon_padding
, tvb
, offset
, length
, ENC_NA
);
2920 cmd_delete(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2922 proto_tree_add_item(pt
, hf_gryphon_delete
, tvb
, offset
, 32, ENC_NA
|ENC_ASCII
);
2928 cmd_list(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2930 proto_tree_add_item(pt
, hf_gryphon_list_block_number
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2931 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+1, 3, ENC_NA
);
2937 resp_list(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2942 proto_tree_add_item_ret_uint(pt
, hf_gryphon_list_num_programs
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &count
);
2943 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+1, 1, ENC_NA
);
2946 proto_tree_add_item(pt
, hf_gryphon_list_num_remain_programs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2949 for (i
= 1; i
<= count
; i
++) {
2950 tree
= proto_tree_add_subtree_format(pt
, tvb
, offset
, 112, ett_gryphon_pgm_list
, NULL
, "Program %u", i
);
2951 proto_tree_add_item(tree
, hf_gryphon_list_name
, tvb
, offset
, 32, ENC_NA
|ENC_ASCII
);
2954 proto_tree_add_item(tree
, hf_gryphon_list_description
, tvb
, offset
, 80, ENC_NA
|ENC_ASCII
);
2961 cmd_start(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, proto_tree
*pt
)
2966 int hdr_stuff
= offset
;
2968 msglen
= tvb_reported_length_remaining(tvb
, offset
);
2969 offset
= cmd_delete(tvb
, offset
, pt
); /* decode the name */
2970 if (offset
< msglen
+ hdr_stuff
) {
2971 string
= tvb_get_stringz_enc(pinfo
->pool
, tvb
, offset
, &length
, ENC_ASCII
);
2973 proto_tree_add_string(pt
, hf_gryphon_start_arguments
, tvb
, offset
,
2977 length
= 3 - (length
+ 3) % 4;
2979 proto_tree_add_item(pt
, hf_gryphon_padding
, tvb
, offset
, length
, ENC_NA
);
2988 resp_start(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2992 msglen
= tvb_reported_length_remaining(tvb
, offset
);
2994 proto_tree_add_item(pt
, hf_gryphon_start_channel
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2995 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+1, 3, ENC_NA
);
3002 resp_status(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3006 unsigned int i
, copies
, length
, channel
;
3008 copies
= tvb_get_uint8(tvb
, offset
);
3009 item
= proto_tree_add_item(pt
, hf_gryphon_status_num_running_copies
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3010 tree
= proto_item_add_subtree (item
, ett_gryphon_pgm_status
);
3013 for (i
= 1; i
<= copies
; i
++) {
3014 channel
= tvb_get_uint8(tvb
, offset
);
3015 proto_tree_add_uint_format(tree
, hf_gryphon_program_channel_number
, tvb
, offset
, 1, channel
,
3016 "Program %u channel (client) number %u", i
, channel
);
3020 length
= 3 - (copies
+ 1 + 3) % 4;
3022 proto_tree_add_item(pt
, hf_gryphon_padding
, tvb
, offset
, length
, ENC_NA
);
3029 cmd_options(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3033 unsigned int i
, size
, padding
, option
, option_length
, option_value
;
3034 const char *string
, *string1
;
3036 msglen
= tvb_reported_length_remaining(tvb
, offset
);
3037 proto_tree_add_item(pt
, hf_gryphon_options_handle
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3038 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+1, 3, ENC_NA
);
3042 for (i
= 1; msglen
> 0; i
++) {
3043 option_length
= tvb_get_uint8(tvb
, offset
+1);
3044 size
= option_length
+ 2;
3045 padding
= 3 - ((size
+ 3) %4);
3046 tree
= proto_tree_add_subtree_format(pt
, tvb
, offset
, size
+ padding
, ett_gryphon_pgm_options
, NULL
, "Option number %u", i
);
3047 option
= tvb_get_uint8(tvb
, offset
);
3048 switch (option_length
) {
3050 option_value
= tvb_get_uint8(tvb
, offset
+2);
3053 option_value
= tvb_get_ntohs(tvb
, offset
+2);
3056 option_value
= tvb_get_ntohl(tvb
, offset
+2);
3061 string
= "unknown option";
3062 string1
= "unknown option data";
3065 string
= "Type of data in the file";
3066 switch (option_value
) {
3068 string1
= "Binary - Don't modify";
3071 string1
= "ASCII - Remove CR's";
3076 string
= "Type of file";
3077 switch (option_value
) {
3079 string1
= "Executable";
3087 proto_tree_add_uint_format_value(tree
, hf_gryphon_option
, tvb
, offset
, 1, option
, "%s", string
);
3088 proto_tree_add_bytes_format_value(tree
, hf_gryphon_option_data
, tvb
, offset
+2, option_length
, NULL
, "%s", string1
);
3090 proto_tree_add_item(tree
, hf_gryphon_padding
, tvb
, offset
+option_length
+2, padding
, ENC_NA
);
3091 offset
+= size
+ padding
;
3092 msglen
-= size
+ padding
;
3098 cmd_files(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3103 msglen
= tvb_reported_length_remaining(tvb
, offset
);
3104 file
= tvb_get_uint8(tvb
, offset
);
3106 proto_tree_add_uint_format(pt
, hf_gryphon_cmd_file
, tvb
, offset
, 1, file
, "First group of names");
3108 proto_tree_add_uint_format(pt
, hf_gryphon_cmd_file
, tvb
, offset
, 1, file
, "Subsequent group of names");
3110 proto_tree_add_item(pt
, hf_gryphon_files
, tvb
, offset
+1, msglen
-1, ENC_NA
|ENC_ASCII
);
3116 resp_files(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3120 msglen
= tvb_reported_length_remaining(tvb
, offset
);
3121 proto_tree_add_item(pt
, hf_gryphon_more_filenames
, tvb
, offset
, 1, ENC_NA
);
3122 proto_tree_add_item(pt
, hf_gryphon_filenames
, tvb
, offset
+1, msglen
-1, ENC_ASCII
|ENC_NA
);
3127 /* 20171012 gryphon command for USDT */
3129 cmd_usdt_register_non_legacy(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3132 unsigned int ui_block
;
3138 uint8_t u8USDTReqExtAddr_bit
;
3139 uint8_t u8USDTRespExtAddr_bit
;
3140 uint8_t u8UUDTRespExtAddr_bit
;
3141 uint8_t u8USDTReqExtAddr
;
3142 uint8_t u8USDTRespExtAddr
;
3143 uint8_t u8UUDTRespExtAddr
;
3144 uint8_t u8USDTReqHeaderSize
;
3145 uint8_t u8USDTRespHeaderSize
;
3146 uint8_t u8UUDTRespHeaderSize
;
3153 static int * const transmit_options_flags
[] = {
3154 &hf_gryphon_usdt_transmit_options_flags_echo
,
3155 &hf_gryphon_usdt_transmit_options_action
,
3156 &hf_gryphon_usdt_transmit_options_done_event
,
3157 &hf_gryphon_usdt_transmit_options_echo_short
,
3158 &hf_gryphon_usdt_transmit_options_rx_nth_fc
,
3161 static int * const receive_options_flags
[] = {
3162 &hf_gryphon_usdt_receive_options_action
,
3163 &hf_gryphon_usdt_receive_options_firstframe_event
,
3164 &hf_gryphon_usdt_receive_options_lastframe_event
,
3165 &hf_gryphon_usdt_receive_options_tx_nth_fc
,
3168 static int * const length_options_flags
[] = {
3169 &hf_gryphon_usdt_length_control_j1939
,
3172 remain
= tvb_reported_length_remaining(tvb
, offset
);
3176 flags
= tvb_get_uint8(tvb
, offset
);
3177 tree1
= proto_tree_add_subtree_format(pt
, tvb
, offset
, 1, ett_gryphon_usdt_action_flags
, NULL
, "Action flags 0x%02x", flags
);
3178 proto_tree_add_item(tree1
, hf_gryphon_usdt_action_flags_non_legacy
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3183 flags
= tvb_get_uint8(tvb
, offset
);
3184 tree2
= proto_tree_add_subtree_format(pt
, tvb
, offset
, 1, ett_gryphon_usdt_tx_options_flags
, NULL
, "Transmit options 0x%02x", flags
);
3185 proto_tree_add_bitmask(tree2
, tvb
, offset
, hf_gryphon_usdt_transmit_options_flags
, ett_gryphon_flags
, transmit_options_flags
, ENC_BIG_ENDIAN
);
3190 flags
= tvb_get_uint8(tvb
, offset
);
3191 tree3
= proto_tree_add_subtree_format(pt
, tvb
, offset
, 1, ett_gryphon_usdt_rx_options_flags
, NULL
, "Receive options 0x%02x", flags
);
3192 proto_tree_add_bitmask(tree3
, tvb
, offset
, hf_gryphon_usdt_receive_options_flags
, ett_gryphon_flags
, receive_options_flags
, ENC_BIG_ENDIAN
);
3197 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
, 1, ENC_NA
);
3203 while (remain
> 0) {
3204 tree4
= proto_tree_add_subtree_format(pt
, tvb
, offset
, 20, ett_gryphon_usdt_data_block
, NULL
, "Block %u", ui_block
);
3206 /* TODO implement J1939-style length address src and dst byte swap */
3208 /* mask the upper bits of the long */
3209 /* number of IDs in the block */
3210 ui_ids
= tvb_get_ntohl (tvb
, offset
);
3211 u8_options
= ((ui_ids
>> 24) & 0xE0);
3212 ui_ids
&= 0x1FFFFFFF; /* mask the upper control bits */
3213 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_nids
, tvb
, offset
, 4, ui_ids
, "%u", ui_ids
);
3216 proto_item_set_len(tree4
, 20);
3220 /* display control bits */
3221 tree5
= proto_tree_add_subtree_format(tree4
, tvb
, offset
, 1, ett_gryphon_usdt_len_options_flags
, NULL
, "Options 0x%02x", u8_options
);
3222 proto_tree_add_bitmask(tree5
, tvb
, offset
, hf_gryphon_usdt_length_options_flags
, ett_gryphon_flags
, length_options_flags
, ENC_BIG_ENDIAN
);
3226 u8UUDTRespExtAddr
= tvb_get_uint8(tvb
, offset
+10);
3227 u8USDTRespExtAddr
= tvb_get_uint8(tvb
, offset
+13);
3228 u8USDTReqExtAddr
= tvb_get_uint8(tvb
, offset
+16);
3232 /* add extended address display of the IDs */
3233 /* mask the upper bits of the IDs */
3235 id_usdtreq
= tvb_get_ntohl (tvb
, offset
);
3236 u8USDTReqExtAddr_bit
= ((id_usdtreq
>> 24) & 0x20);
3237 u8USDTReqHeaderSize
= ((id_usdtreq
>> 24) & 0x80);
3238 id_usdtreq
&= 0x1FFFFFFF;
3240 if(u8USDTReqExtAddr_bit
== 0) {
3241 if(u8USDTReqHeaderSize
== 0) {
3242 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_request
, tvb
, offset
, 4, id_usdtreq
, "0x%02x (11-bit)", id_usdtreq
);
3244 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_request
, tvb
, offset
, 4, id_usdtreq
, "0x%04x (29-bit)", id_usdtreq
);
3247 u8USDTReqExtAddr
= tvb_get_uint8(tvb
, offset
+16);
3248 if(u8USDTReqHeaderSize
== 0) {
3249 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_request
, tvb
, offset
, 4, id_usdtreq
, "0x%02x (11-bit extended address %01x)", id_usdtreq
, u8USDTReqExtAddr
);
3251 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_request
, tvb
, offset
, 4, id_usdtreq
, "0x%04x (29-bit extended address %01x)", id_usdtreq
, u8USDTReqExtAddr
);
3258 id_usdtresp
= tvb_get_ntohl (tvb
, offset
);
3259 u8USDTRespExtAddr_bit
= ((id_usdtresp
>> 24) & 0x20);
3260 u8USDTRespHeaderSize
= ((id_usdtresp
>> 24) & 0x80);
3261 id_usdtresp
&= 0x1FFFFFFF;
3263 if(u8USDTRespExtAddr_bit
== 0) {
3264 if(u8USDTRespHeaderSize
== 0) {
3265 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_response
, tvb
, offset
, 4, id_usdtresp
, "0x%02x (11-bit)", id_usdtresp
);
3267 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_response
, tvb
, offset
, 4, id_usdtresp
, "0x%04x (29-bit)", id_usdtresp
);
3270 u8USDTRespExtAddr
= tvb_get_uint8(tvb
, offset
+13);
3271 if(u8USDTRespHeaderSize
== 0) {
3272 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_response
, tvb
, offset
, 4, id_usdtresp
, "0x%02x (11-bit extended address %01x)", id_usdtresp
, u8USDTRespExtAddr
);
3274 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_response
, tvb
, offset
, 4, id_usdtresp
, "0x%04x (29-bit extended address %01x)", id_usdtresp
, u8USDTRespExtAddr
);
3282 id_uudtresp
= tvb_get_ntohl (tvb
, offset
);
3283 u8UUDTRespExtAddr_bit
= ((id_uudtresp
>> 24) & 0x20);
3284 u8UUDTRespHeaderSize
= ((id_uudtresp
>> 24) & 0x80);
3285 id_uudtresp
&= 0x1FFFFFFF;
3287 if(u8UUDTRespExtAddr_bit
== 0) {
3288 if(u8UUDTRespHeaderSize
== 0) {
3289 proto_tree_add_uint_format_value(tree4
, hf_gryphon_uudt_response
, tvb
, offset
, 4, id_uudtresp
, "0x%02x (11-bit)", id_uudtresp
);
3291 proto_tree_add_uint_format_value(tree4
, hf_gryphon_uudt_response
, tvb
, offset
, 4, id_uudtresp
, "0x%04x (29-bit)", id_uudtresp
);
3294 u8UUDTRespExtAddr
= tvb_get_uint8(tvb
, offset
+10);
3295 if(u8UUDTRespHeaderSize
== 0) {
3296 proto_tree_add_uint_format_value(tree4
, hf_gryphon_uudt_response
, tvb
, offset
, 4, id_uudtresp
, "0x%02x (11-bit extended address %01x)", id_uudtresp
, u8UUDTRespExtAddr
);
3298 proto_tree_add_uint_format_value(tree4
, hf_gryphon_uudt_response
, tvb
, offset
, 4, id_uudtresp
, "0x%04x (29-bit extended address %01x)", id_uudtresp
, u8UUDTRespExtAddr
);
3308 /* add extended address display of the IDs */
3309 /* mask the upper bits of the IDs */
3312 id_usdtreq
= tvb_get_ntohl (tvb
, offset
);
3313 u8USDTReqExtAddr_bit
= ((id_usdtreq
>> 24) & 0x20);
3314 u8USDTReqHeaderSize
= ((id_usdtreq
>> 24) & 0x80);
3315 id_usdtreq
&= 0x1FFFFFFF;
3317 if(u8USDTReqExtAddr_bit
== 0) {
3318 if(u8USDTReqHeaderSize
== 0) {
3319 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_request
, tvb
, offset
, 4, id_usdtreq
, "0x%02x through 0x%02x (11-bit)", id_usdtreq
, id_usdtreq
+ ui_ids
-1);
3321 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_request
, tvb
, offset
, 4, id_usdtreq
, "0x%04x through 0x%04x (29-bit)", id_usdtreq
, id_usdtreq
+ ui_ids
-1);
3324 u8USDTReqExtAddr
= tvb_get_uint8(tvb
, offset
+16);
3325 if(u8USDTReqHeaderSize
== 0) {
3326 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_request
, tvb
, offset
, 4, id_usdtreq
, "0x%02x through 0x%02x (11-bit extended address %0x)", id_usdtreq
, id_usdtreq
+ ui_ids
-1, u8USDTReqExtAddr
);
3328 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_request
, tvb
, offset
, 4, id_usdtreq
, "0x%04x through 0x%04x (29-bit extended address %0x)", id_usdtreq
, id_usdtreq
+ ui_ids
-1, u8USDTReqExtAddr
);
3335 id_usdtresp
= tvb_get_ntohl (tvb
, offset
);
3336 u8USDTRespExtAddr_bit
= ((id_usdtresp
>> 24) & 0x20);
3337 u8USDTRespHeaderSize
= ((id_usdtresp
>> 24) & 0x80);
3338 id_usdtresp
&= 0x1FFFFFFF;
3340 if(u8USDTRespExtAddr_bit
== 0) {
3341 if(u8USDTRespHeaderSize
== 0) {
3342 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_response
, tvb
, offset
, 4, id_usdtresp
, "0x%02x through 0x%02x (11-bit)", id_usdtresp
, id_usdtresp
+ ui_ids
-1);
3344 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_response
, tvb
, offset
, 4, id_usdtresp
, "0x%04x through 0x%04x (29-bit)", id_usdtresp
, id_usdtresp
+ ui_ids
-1);
3347 u8USDTRespExtAddr
= tvb_get_uint8(tvb
, offset
+13);
3348 if(u8USDTRespHeaderSize
== 0) {
3349 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_response
, tvb
, offset
, 4, id_usdtresp
, "0x%02x through 0x%02x (11-bit extended address %01x)", id_usdtresp
, id_usdtresp
+ ui_ids
-1, u8USDTRespExtAddr
);
3351 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_response
, tvb
, offset
, 4, id_usdtresp
, "0x%04x through 0x%04x (29-bit extended address %01x)", id_usdtresp
, id_usdtresp
+ ui_ids
-1, u8USDTRespExtAddr
);
3358 id_uudtresp
= tvb_get_ntohl (tvb
, offset
);
3359 u8UUDTRespExtAddr_bit
= ((id_uudtresp
>> 24) & 0x20);
3360 u8UUDTRespHeaderSize
= ((id_uudtresp
>> 24) & 0x80);
3361 id_uudtresp
&= 0x1FFFFFFF;
3363 if(u8UUDTRespExtAddr_bit
== 0) {
3364 if(u8UUDTRespHeaderSize
== 0) {
3365 proto_tree_add_uint_format_value(tree4
, hf_gryphon_uudt_response
, tvb
, offset
, 4, id_uudtresp
, "0x%02x through 0x%02x (11-bit)", id_uudtresp
, id_uudtresp
+ ui_ids
-1);
3367 proto_tree_add_uint_format_value(tree4
, hf_gryphon_uudt_response
, tvb
, offset
, 4, id_uudtresp
, "0x%04x through 0x%04x (29-bit)", id_uudtresp
, id_uudtresp
+ ui_ids
-1);
3370 u8UUDTRespExtAddr
= tvb_get_uint8(tvb
, offset
+10);
3371 if(u8UUDTRespHeaderSize
== 0) {
3372 proto_tree_add_uint_format_value(tree4
, hf_gryphon_uudt_response
, tvb
, offset
, 4, id_uudtresp
, "0x%02x through 0x%02x (11-bit extended address %01x)", id_uudtresp
, id_uudtresp
+ ui_ids
-1, u8UUDTRespExtAddr
);
3374 proto_tree_add_uint_format_value(tree4
, hf_gryphon_uudt_response
, tvb
, offset
, 4, id_uudtresp
, "0x%04x through 0x%04x (29-bit extended address %01x)", id_uudtresp
, id_uudtresp
+ ui_ids
-1, u8UUDTRespExtAddr
);
3381 if(u8USDTReqExtAddr_bit
== 0) {
3382 /* proto_tree_add_item(tree4, hf_gryphon_reserved, tvb, offset, 1, ENC_NA); */
3383 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_request_ext
, tvb
, offset
, 1, 0, "(no extended address)");
3385 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_request_ext
, tvb
, offset
, 1, u8USDTReqExtAddr
, "0x%01x", u8USDTReqExtAddr
);
3390 if(u8USDTRespExtAddr_bit
== 0) {
3391 /* proto_tree_add_item(tree4, hf_gryphon_reserved, tvb, offset, 1, ENC_NA); */
3392 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_response_ext
, tvb
, offset
, 1, 0, "(no extended address)");
3394 proto_tree_add_uint_format_value(tree4
, hf_gryphon_usdt_response_ext
, tvb
, offset
, 1, u8USDTRespExtAddr
, "0x%01x", u8USDTRespExtAddr
);
3399 if(u8UUDTRespExtAddr_bit
== 0) {
3400 /* proto_tree_add_item(tree4, hf_gryphon_reserved, tvb, offset, 1, ENC_NA); */
3401 proto_tree_add_uint_format_value(tree4
, hf_gryphon_uudt_response_ext
, tvb
, offset
, 1, 0, "(no extended address)");
3403 proto_tree_add_uint_format_value(tree4
, hf_gryphon_uudt_response_ext
, tvb
, offset
, 1, u8UUDTRespExtAddr
, "0x%01x", u8UUDTRespExtAddr
);
3408 proto_tree_add_item(tree4
, hf_gryphon_reserved
, tvb
, offset
, 1, ENC_NA
);
3420 /* 20171012 gryphon command for USDT */
3422 cmd_usdt_stmin_fc(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3424 proto_tree_add_item(pt
, hf_gryphon_usdt_stmin_fc
, tvb
, offset
, 1, ENC_NA
);
3430 /* 20171012 gryphon command for USDT */
3432 cmd_usdt_bsmax_fc(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3434 proto_tree_add_item(pt
, hf_gryphon_usdt_bsmax_fc
, tvb
, offset
, 1, ENC_NA
);
3440 /* 20171012 gryphon command for USDT */
3442 cmd_usdt_stmin_override(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3444 proto_tree_add_item(pt
, hf_gryphon_usdt_stmin_override
, tvb
, offset
, 1, ENC_NA
);
3450 /* 20171012 gryphon command for USDT */
3452 cmd_usdt_get_stmin_override(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3454 proto_tree_add_item(pt
, hf_gryphon_usdt_stmin_override
, tvb
, offset
, 1, ENC_NA
);
3456 /* fixed this for get */
3457 proto_tree_add_item(pt
, hf_gryphon_usdt_stmin_override_active
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3463 /* 20171012 gryphon command for USDT */
3465 cmd_usdt_stmin_override_activate(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3467 proto_tree_add_item(pt
, hf_gryphon_usdt_stmin_override_activate
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3473 /* 20171012 gryphon command for USDT */
3475 cmd_usdt_set_stmin_mul(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3478 /* TODO fix this float value? */
3479 value
= tvb_get_ntohieee_float (tvb
, offset
);
3480 proto_tree_add_float_format_value(pt
, hf_gryphon_usdt_set_stmin_mul
, tvb
, offset
, 4,
3481 value
, "%.1f", value
);
3488 * legacy command for usdt register
3491 cmd_usdt(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3493 int ids
, id
, remain
, size
, i
, bytes
;
3495 proto_tree
*localTree
;
3496 proto_item
*localItem
;
3498 flags
= tvb_get_uint8(tvb
, offset
);
3499 proto_tree_add_item(pt
, hf_gryphon_usdt_flags_register
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3502 static int * const action_flags
[] = {
3503 &hf_gryphon_usdt_action_flags_register
,
3504 &hf_gryphon_usdt_action_flags_action
,
3508 static int * const transmit_option_flags
[] = {
3509 &hf_gryphon_usdt_transmit_options_flags_echo
,
3510 &hf_gryphon_usdt_transmit_options_action
,
3511 &hf_gryphon_usdt_transmit_options_send_done
,
3515 static int * const receive_option_flags
[] = {
3516 &hf_gryphon_usdt_receive_options_action
,
3517 &hf_gryphon_usdt_receive_options_firstframe
,
3518 &hf_gryphon_usdt_receive_options_lastframe
,
3522 proto_tree_add_bitmask(pt
, tvb
, offset
, hf_gryphon_usdt_action_flags
, ett_gryphon_flags
, action_flags
, ENC_BIG_ENDIAN
);
3523 proto_tree_add_bitmask(pt
, tvb
, offset
+1, hf_gryphon_usdt_transmit_options_flags
, ett_gryphon_flags
, transmit_option_flags
, ENC_BIG_ENDIAN
);
3524 proto_tree_add_bitmask(pt
, tvb
, offset
+2, hf_gryphon_usdt_receive_options_flags
, ett_gryphon_flags
, receive_option_flags
, ENC_BIG_ENDIAN
);
3526 if ((ids
= tvb_get_uint8(tvb
, offset
+3))) {
3527 localItem
= proto_tree_add_item(pt
, hf_gryphon_usdt_ext_address
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
3530 localTree
= proto_item_add_subtree (localItem
, ett_gryphon_usdt_data
);
3532 proto_tree_add_item(localTree
, hf_gryphon_usdt_ext_address_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3537 proto_tree_add_uint_format_value(pt
, hf_gryphon_usdt_ext_address
, tvb
, offset
+3, 1,
3538 0, "Using extended addressing for the single, internally defined, ID");
3541 for (i
= 0; i
< 2; i
++) {
3542 bytes
= tvb_reported_length_remaining (tvb
, offset
);
3545 localTree
= proto_tree_add_subtree_format(pt
, tvb
, offset
, 16, ett_gryphon_usdt_data
, NULL
, "%s block of USDT/UUDT IDs", i
==0?"First":"Second");
3547 size
= tvb_get_ntohl (tvb
, offset
);
3548 localItem
= proto_tree_add_item(localTree
, hf_gryphon_usdt_block_size
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3549 localTree
= proto_item_add_subtree (localItem
, ett_gryphon_usdt_data_block
);
3551 proto_item_set_len(localItem
, 16);
3554 id
= tvb_get_ntohl (tvb
, offset
);
3555 proto_tree_add_uint_format_value(localTree
, hf_gryphon_usdt_request
, tvb
, offset
, 4, id
, "%04X through %04X", id
, id
+size
-1);
3558 id
= tvb_get_ntohl (tvb
, offset
);
3559 proto_tree_add_uint_format_value(localTree
, hf_gryphon_usdt_response
, tvb
, offset
, 4, id
, "%04X through %04X", id
, id
+size
-1);
3562 id
= tvb_get_ntohl (tvb
, offset
);
3563 proto_tree_add_uint_format_value(localTree
, hf_gryphon_uudt_response
, tvb
, offset
, 4, id
, "%04X through %04X", id
, id
+size
-1);
3568 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+1, 3, ENC_NA
);
3572 if ((remain
= tvb_reported_length_remaining(tvb
, offset
))) {
3573 proto_tree_add_item(pt
, hf_gryphon_ignored
, tvb
, offset
, remain
, ENC_NA
);
3581 cmd_bits_in (tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3585 value
= tvb_get_uint8(tvb
, offset
);
3587 static int * const digital_values
[] = {
3588 &hf_gryphon_bits_in_input1
,
3589 &hf_gryphon_bits_in_input2
,
3590 &hf_gryphon_bits_in_input3
,
3591 &hf_gryphon_bits_in_pushbutton
,
3594 proto_tree_add_bitmask(pt
, tvb
, 1, hf_gryphon_bit_in_digital_data
, ett_gryphon_digital_data
, digital_values
, ENC_NA
);
3596 proto_tree_add_uint_format(pt
, hf_gryphon_bit_in_digital_data
, tvb
, offset
, 1, value
, "No digital values are set");
3604 cmd_bits_out (tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3608 value
= tvb_get_uint8(tvb
, offset
);
3610 static int * const digital_values
[] = {
3611 &hf_gryphon_bits_out_output1
,
3612 &hf_gryphon_bits_out_output2
,
3615 proto_tree_add_bitmask(pt
, tvb
, 1, hf_gryphon_bit_out_digital_data
, ett_gryphon_digital_data
, digital_values
, ENC_NA
);
3617 proto_tree_add_uint_format(pt
, hf_gryphon_bit_out_digital_data
, tvb
, offset
, 1, value
, "No digital values are set");
3625 cmd_init_strat (tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3627 uint32_t reset_limit
;
3631 msglen
= tvb_reported_length_remaining(tvb
, offset
);
3632 reset_limit
= tvb_get_ntohl(tvb
, offset
);
3633 proto_tree_add_uint_format_value(pt
, hf_gryphon_init_strat_reset_limit
, tvb
, offset
, 4,
3634 reset_limit
, "Reset Limit = %u messages", reset_limit
);
3637 for (indx
= 1; msglen
; indx
++, offset
++, msglen
--) {
3638 value
= tvb_get_uint8(tvb
, offset
);
3640 proto_tree_add_float_format_value(pt
, hf_gryphon_init_strat_delay
, tvb
, offset
, 1,
3641 value
/4, "Delay %d = %.2f seconds", indx
, value
/4);
3643 proto_tree_add_float_format_value(pt
, hf_gryphon_init_strat_delay
, tvb
, offset
, 1,
3644 0, "Delay %d = infinite", indx
);
3651 speed(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3653 proto_tree_add_item(pt
, hf_gryphon_speed_baud_rate_index
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3654 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+1, 3, ENC_NA
);
3660 blm_mode(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
3664 uint32_t mode
, milliseconds
;
3666 item
= proto_tree_add_item_ret_uint(pt
, hf_gryphon_blm_mode
, tvb
, offset
, 4, ENC_BIG_ENDIAN
, &mode
);
3667 tree
= proto_item_add_subtree(item
, ett_gryphon_blm_mode
);
3671 milliseconds
= tvb_get_ntohl(tvb
, offset
);
3672 proto_tree_add_uint_format_value(tree
, hf_gryphon_blm_mode_avg_period
, tvb
, offset
, 4,
3673 milliseconds
, "%d.%03d seconds", milliseconds
/1000, milliseconds
%1000);
3676 proto_tree_add_item(tree
, hf_gryphon_blm_mode_avg_frames
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3679 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
, 4, ENC_NA
);
3687 static gryphon_conversation
*
3688 get_conversation_data(packet_info
* pinfo
)
3690 conversation_t
*conversation
;
3691 gryphon_conversation
*conv_data
;
3693 /* Find a conversation, create a new if no one exists */
3694 conversation
= find_or_create_conversation(pinfo
);
3695 conv_data
= (gryphon_conversation
*)conversation_get_proto_data(conversation
, proto_gryphon
);
3697 if (conv_data
== NULL
) {
3698 conv_data
= wmem_new(wmem_file_scope(), gryphon_conversation
);
3699 conv_data
->request_frame_data
= wmem_list_new(wmem_file_scope());
3700 conversation_add_proto_data(conversation
, proto_gryphon
, (void *)conv_data
);
3707 // NOLINTNEXTLINE(misc-no-recursion)
3708 decode_command(tvbuff_t
*tvb
, packet_info
* pinfo
, int msglen
, int offset
, int dst
, proto_tree
*pt
)
3711 uint32_t context
, ioctl_command
;
3714 gryphon_pkt_info_t
*pkt_info
;
3716 hi
= proto_tree_add_item_ret_uint(pt
, hf_gryphon_cmd
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &cmd
);
3717 proto_item_set_hidden(hi
);
3722 pkt_info
= (gryphon_pkt_info_t
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_gryphon
, (uint32_t)tvb_raw_offset(tvb
));
3725 /* Find a conversation, create a new if no one exists */
3726 gryphon_conversation
*conv_data
= get_conversation_data(pinfo
);
3728 pkt_info
= wmem_new0(wmem_file_scope(), gryphon_pkt_info_t
);
3730 /* load information into the request frame */
3731 pkt_info
->cmd
= cmd
;
3732 pkt_info
->req_frame_num
= pinfo
->num
;
3733 pkt_info
->req_time
= pinfo
->abs_ts
;
3735 wmem_list_prepend(conv_data
->request_frame_data
, pkt_info
);
3737 p_add_proto_data(wmem_file_scope(), pinfo
, proto_gryphon
, (uint32_t)tvb_raw_offset(tvb
), pkt_info
);
3740 proto_tree_add_uint(pt
, hf_gryphon_command
, tvb
, offset
, 1, cmd
);
3741 proto_tree_add_item_ret_uint(pt
, hf_gryphon_cmd_context
, tvb
, offset
+ 1, 1, ENC_NA
, &context
);
3742 if (!pinfo
->fd
->visited
) {
3743 pkt_info
->cmd_context
= context
;
3745 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+ 2, 2, ENC_NA
);
3746 if (pkt_info
->rsp_frame_num
> 0) {
3747 proto_item
* it
= proto_tree_add_uint(pt
, hf_gryphon_response_in
,
3748 tvb
, 0, 0, pkt_info
->rsp_frame_num
);
3749 proto_item_set_generated(it
);
3756 ft
= proto_tree_add_subtree_format(pt
, tvb
, offset
, msglen
, ett_gryphon_command_data
, NULL
,
3757 "Data: (%d byte%s)", msglen
, plurality(msglen
, "", "s"));
3759 increment_dissection_depth(pinfo
);
3763 offset
= cmd_init(tvb
, offset
, ft
);
3765 case CMD_EVENT_ENABLE
:
3766 case CMD_EVENT_DISABLE
:
3767 offset
= eventnum(tvb
, offset
, ft
);
3770 offset
= resp_time(tvb
, offset
, ft
);
3772 case CMD_CARD_SET_SPEED
:
3773 offset
= speed(tvb
, offset
, ft
);
3775 case CMD_CARD_SET_FILTER
:
3776 offset
= cmd_setfilt(tvb
, offset
, ft
);
3778 case CMD_CARD_GET_FILTER
:
3779 offset
= resp_addfilt(tvb
, offset
, ft
);
3782 offset
= decode_data(tvb
, offset
, ft
);
3784 case CMD_CARD_ADD_FILTER
:
3785 offset
= cmd_addfilt(tvb
, offset
, ft
);
3787 case CMD_CARD_MODIFY_FILTER
:
3788 offset
= cmd_modfilt(tvb
, offset
, ft
);
3790 case CMD_CARD_SET_DEFAULT_FILTER
:
3791 offset
= dfiltmode(tvb
, offset
, ft
);
3793 case CMD_CARD_SET_FILTER_MODE
:
3794 offset
= filtmode(tvb
, offset
, ft
);
3796 case CMD_SERVER_REG
:
3797 offset
= cmd_register(tvb
, offset
, ft
);
3799 case CMD_SERVER_SET_SORT
:
3800 offset
= cmd_sort(tvb
, offset
, ft
);
3802 case CMD_SERVER_SET_OPT
:
3803 offset
= cmd_optimize(tvb
, offset
, ft
);
3805 case CMD_BLM_SET_MODE
:
3806 offset
= blm_mode(tvb
, offset
, ft
);
3809 offset
= cmd_ldf_list(tvb
, offset
, ft
);
3811 case CMD_LDF_DELETE
:
3812 offset
= cmd_ldf_delete(tvb
, offset
, ft
);
3815 offset
= cmd_ldf_desc(tvb
, offset
, ft
);
3817 case CMD_LDF_UPLOAD
:
3818 offset
= cmd_ldf_upload(tvb
, offset
, ft
);
3821 offset
= cmd_ldf_parse(tvb
, offset
, ft
);
3823 case CMD_GET_NODE_SIGNALS
:
3824 offset
= cmd_ldf_get_node_signals(tvb
, offset
, ft
);
3826 case CMD_GET_FRAMES
:
3827 offset
= cmd_ldf_get_frames(tvb
, offset
, ft
);
3829 case CMD_GET_FRAME_INFO
:
3830 offset
= cmd_ldf_get_frame_info(tvb
, pinfo
, offset
, ft
);
3832 case CMD_GET_SIGNAL_INFO
:
3833 offset
= cmd_ldf_get_signal_info(tvb
, offset
, ft
);
3835 case CMD_GET_SIGNAL_DETAIL
:
3836 offset
= cmd_ldf_get_signal_detail(tvb
, offset
, ft
);
3838 case CMD_GET_ENCODING_INFO
:
3839 offset
= cmd_ldf_get_encoding_info(tvb
, offset
, ft
);
3841 case CMD_SAVE_SESSION
:
3842 offset
= cmd_ldf_save_session(tvb
, offset
, ft
);
3844 case CMD_EMULATE_NODES
:
3845 offset
= cmd_ldf_emulate_nodes(tvb
, pinfo
, offset
, ft
);
3847 case CMD_START_SCHEDULE
:
3848 offset
= cmd_ldf_start_schedule(tvb
, offset
, ft
);
3850 case CMD_RESTORE_SESSION
:
3851 offset
= cmd_restore_session(tvb
, offset
, ft
);
3853 case CMD_CNVT_GET_VALUES
:
3854 offset
= cmd_cnvt_get_values(tvb
, offset
, ft
);
3856 case CMD_CNVT_GET_UNITS
:
3857 offset
= cmd_cnvt_get_units(tvb
, offset
, ft
);
3859 case CMD_CNVT_SET_VALUES
:
3860 offset
= cmd_cnvt_set_values(tvb
, offset
, ft
);
3862 case CMD_CNVT_SAVE_SESSION
:
3863 offset
= cmd_ldf_save_session(tvb
, offset
, ft
);
3865 case CMD_CNVT_RESTORE_SESSION
:
3866 offset
= cmd_restore_session(tvb
, offset
, ft
);
3868 case CMD_CNVT_DESTROY_SESSION
:
3869 offset
= cmd_cnvt_destroy_session(tvb
, offset
, ft
);
3871 case CMD_CNVT_GET_NODE_SIGNALS
:
3872 offset
= cmd_ldf_get_node_signals(tvb
, offset
, ft
);
3874 case CMD_MSGRESP_ADD
:
3875 offset
= cmd_addresp(tvb
, offset
, pinfo
, ft
);
3877 case CMD_MSGRESP_GET
:
3878 offset
= resp_addresp(tvb
, offset
, ft
);
3880 case CMD_MSGRESP_MODIFY
:
3881 offset
= cmd_modresp(tvb
, offset
, ft
);
3884 offset
= cmd_desc(tvb
, offset
, ft
);
3886 case CMD_PGM_UPLOAD
:
3887 offset
= cmd_upload(tvb
, offset
, ft
);
3889 case CMD_PGM_DELETE
:
3890 offset
= cmd_delete(tvb
, offset
, ft
);
3893 offset
= cmd_list(tvb
, offset
, ft
);
3896 offset
= cmd_start(tvb
, pinfo
, offset
, ft
);
3899 offset
= resp_start(tvb
, offset
, ft
);
3901 case CMD_PGM_STATUS
:
3902 offset
= cmd_delete(tvb
, offset
, ft
);
3904 case CMD_PGM_OPTIONS
:
3905 offset
= cmd_options(tvb
, offset
, ft
);
3908 offset
= cmd_files(tvb
, offset
, ft
);
3911 offset
= cmd_sched(tvb
, offset
, ft
);
3913 case CMD_SCHED_KILL_TX
:
3914 offset
= resp_sched(tvb
, offset
, ft
);
3916 case CMD_SCHED_MSG_REPLACE
:
3917 offset
= cmd_sched_rep(tvb
, offset
, ft
);
3919 case CMD_USDT_REGISTER
:
3920 offset
= cmd_usdt(tvb
, offset
, ft
);
3922 case CMD_USDT_SET_FUNCTIONAL
:
3923 offset
= cmd_usdt(tvb
, offset
, ft
);
3925 case CMD_USDT_SET_STMIN_MULT
:
3926 offset
= cmd_usdt_set_stmin_mul(tvb
, offset
, ft
);
3928 case CMD_USDT_REGISTER_NON_LEGACY
:
3929 offset
= cmd_usdt_register_non_legacy(tvb
, offset
, ft
);
3931 case CMD_USDT_SET_STMIN_FC
:
3932 offset
= cmd_usdt_stmin_fc(tvb
, offset
, ft
);
3934 case CMD_USDT_SET_BSMAX_FC
:
3935 offset
= cmd_usdt_bsmax_fc(tvb
, offset
, ft
);
3937 case CMD_USDT_SET_STMIN_OVERRIDE
:
3938 offset
= cmd_usdt_stmin_override(tvb
, offset
, ft
);
3940 case CMD_USDT_ACTIVATE_STMIN_OVERRIDE
:
3941 offset
= cmd_usdt_stmin_override_activate(tvb
, offset
, ft
);
3943 case CMD_IOPWR_CLRLATCH
:
3944 offset
= cmd_bits_in(tvb
, offset
, ft
);
3946 case CMD_IOPWR_SETOUT
:
3947 case CMD_IOPWR_SETBIT
:
3948 case CMD_IOPWR_CLRBIT
:
3949 offset
= cmd_bits_out(tvb
, offset
, ft
);
3951 case CMD_UTIL_SET_INIT_STRATEGY
:
3952 offset
= cmd_init_strat(tvb
, offset
, ft
);
3954 case CMD_CARD_IOCTL
:
3955 ioctl_command
= tvb_get_ntohl(tvb
, offset
);
3956 /* save the IOCTL in the context array for use during the command response */
3957 if (!pinfo
->fd
->visited
) {
3958 pkt_info
->ioctl_command
= ioctl_command
;
3960 offset
= cmd_ioctl(tvb
, pinfo
, offset
, ft
, ioctl_command
);
3963 proto_tree_add_item(ft
, hf_gryphon_data
, tvb
, offset
, msglen
, ENC_NA
);
3967 decrement_dissection_depth(pinfo
);
3974 // NOLINTNEXTLINE(misc-no-recursion)
3975 decode_response(tvbuff_t
*tvb
, packet_info
* pinfo
, int offset
, int src
, proto_tree
*pt
)
3980 gryphon_pkt_info_t
*pkt_info
, *pkt_info_list
;
3982 msglen
= tvb_reported_length_remaining(tvb
, offset
);
3983 cmd
= tvb_get_uint8(tvb
, offset
);
3988 pkt_info
= (gryphon_pkt_info_t
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_gryphon
, (uint32_t)tvb_raw_offset(tvb
));
3991 /* Find a conversation, create a new if no one exists */
3992 gryphon_conversation
*conv_data
= get_conversation_data(pinfo
);
3994 pkt_info
= wmem_new0(wmem_file_scope(), gryphon_pkt_info_t
);
3996 wmem_list_frame_t
*frame
= wmem_list_head(conv_data
->request_frame_data
);
3997 /* Step backward through all logged instances of request frames, looking for a request frame number that
3998 occurred immediately prior to current frame number that has a matching command */
4000 pkt_info_list
= (gryphon_pkt_info_t
*)wmem_list_frame_data(frame
);
4001 if ((pinfo
->num
> pkt_info_list
->req_frame_num
) && (pkt_info_list
->rsp_frame_num
== 0) && (pkt_info_list
->cmd
== cmd
)) {
4002 pkt_info
->req_frame_num
= pkt_info_list
->req_frame_num
;
4003 pkt_info
->cmd_context
= pkt_info_list
->cmd_context
;
4004 pkt_info
->ioctl_command
= pkt_info_list
->ioctl_command
;
4005 pkt_info
->req_time
= pkt_info_list
->req_time
;
4006 pkt_info_list
->rsp_frame_num
= pinfo
->num
;
4010 frame
= wmem_list_frame_next(frame
);
4013 p_add_proto_data(wmem_file_scope(), pinfo
, proto_gryphon
, (uint32_t)tvb_raw_offset(tvb
), pkt_info
);
4017 * This is the old original way of displaying.
4019 * XXX - is there some reason not to display the context for ioctl
4020 * commands, and to display the ioctl code here, rather than in
4021 * the part of the tree for the ioctl response?
4023 proto_tree_add_uint(pt
, hf_gryphon_command
, tvb
, offset
, 1, cmd
);
4024 if (pkt_info
->ioctl_command
!= 0) {
4025 proto_tree_add_uint(pt
, hf_gryphon_cmd_ioctl_context
, tvb
, 0, 0, pkt_info
->ioctl_command
);
4027 proto_tree_add_item(pt
, hf_gryphon_cmd_context
, tvb
, offset
+ 1, 1, ENC_NA
);
4029 proto_tree_add_item(pt
, hf_gryphon_reserved
, tvb
, offset
+ 2, 2, ENC_NA
);
4033 proto_tree_add_item(pt
, hf_gryphon_status
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4037 if (pkt_info
->req_frame_num
) {
4041 it
= proto_tree_add_uint(pt
, hf_gryphon_response_to
, tvb
, 0, 0, pkt_info
->req_frame_num
);
4042 proto_item_set_generated(it
);
4044 nstime_delta(&ns
, &pinfo
->fd
->abs_ts
, &pkt_info
->req_time
);
4045 it
= proto_tree_add_time(pt
, hf_gryphon_response_time
, tvb
, 0, 0, &ns
);
4046 proto_item_set_generated(it
);
4050 ft
= proto_tree_add_subtree_format(pt
, tvb
, offset
, msglen
, ett_gryphon_response_data
, NULL
,
4051 "Data: (%d byte%s)", msglen
, plurality(msglen
, "", "s"));
4053 increment_dissection_depth(pinfo
);
4056 case CMD_GET_CONFIG
:
4057 offset
= resp_config(tvb
, offset
, ft
);
4060 offset
= resp_time(tvb
, offset
, ft
);
4062 case CMD_CARD_GET_SPEED
:
4063 offset
= speed(tvb
, offset
, ft
);
4065 case CMD_CARD_GET_FILTER
:
4066 offset
= cmd_addfilt(tvb
, offset
, ft
);
4068 case CMD_CARD_ADD_FILTER
:
4069 offset
= resp_addfilt(tvb
, offset
, ft
);
4071 case CMD_CARD_GET_FILTER_HANDLES
:
4072 offset
= resp_filthan(tvb
, offset
, ft
);
4074 case CMD_CARD_GET_DEFAULT_FILTER
:
4075 offset
= dfiltmode(tvb
, offset
, ft
);
4077 case CMD_CARD_GET_FILTER_MODE
:
4078 offset
= filtmode(tvb
, offset
, ft
);
4080 case CMD_CARD_GET_EVNAMES
:
4081 offset
= resp_events(tvb
, offset
, ft
);
4083 case CMD_CARD_GET_SPEEDS
:
4084 offset
= resp_getspeeds(tvb
, offset
, ft
);
4086 case CMD_SERVER_REG
:
4087 offset
= resp_register(tvb
, offset
, ft
);
4089 case CMD_BLM_GET_MODE
:
4090 offset
= blm_mode(tvb
, offset
, ft
);
4092 case CMD_BLM_GET_DATA
:
4093 offset
= resp_blm_data(tvb
, offset
, ft
);
4095 case CMD_BLM_GET_STATS
:
4096 offset
= resp_blm_stat(tvb
, offset
, ft
);
4099 offset
= resp_ldf_list(tvb
, offset
, ft
);
4102 offset
= resp_ldf_desc(tvb
, offset
, ft
);
4104 case CMD_GET_LDF_INFO
:
4105 offset
= resp_get_ldf_info(tvb
, offset
, ft
);
4107 case CMD_GET_NODE_NAMES
:
4108 offset
= resp_ldf_get_node_names(tvb
, offset
, ft
);
4110 case CMD_GET_NODE_SIGNALS
:
4111 offset
= resp_ldf_get_node_signals(tvb
, offset
, ft
);
4113 case CMD_GET_FRAMES
:
4114 offset
= resp_ldf_get_frames(tvb
, offset
, ft
);
4116 case CMD_GET_FRAME_INFO
:
4117 offset
= resp_ldf_get_frame_info(tvb
, offset
, ft
);
4119 case CMD_GET_SIGNAL_INFO
:
4120 offset
= resp_ldf_get_signal_info(tvb
, offset
, ft
);
4122 case CMD_GET_SIGNAL_DETAIL
:
4123 offset
= resp_ldf_get_signal_detail(tvb
, pinfo
, offset
, ft
);
4125 case CMD_GET_ENCODING_INFO
:
4126 offset
= resp_ldf_get_encoding_info(tvb
, pinfo
, offset
, ft
);
4128 case CMD_GET_SCHEDULES
:
4129 offset
= resp_ldf_get_schedules(tvb
, offset
, ft
);
4131 case CMD_RESTORE_SESSION
:
4132 offset
= resp_restore_session(tvb
, offset
, ft
);
4134 case CMD_CNVT_GET_VALUES
:
4135 offset
= resp_cnvt_get_values(tvb
, offset
, ft
);
4137 case CMD_CNVT_GET_UNITS
:
4138 offset
= resp_cnvt_get_units(tvb
, offset
, ft
);
4140 case CMD_CNVT_RESTORE_SESSION
:
4141 offset
= resp_restore_session(tvb
, offset
, ft
);
4143 case CMD_CNVT_GET_NODE_SIGNALS
:
4144 offset
= resp_ldf_get_node_signals(tvb
, offset
, ft
);
4146 case CMD_MSGRESP_ADD
:
4147 offset
= resp_addresp(tvb
, offset
, ft
);
4149 case CMD_MSGRESP_GET
:
4150 offset
= cmd_addresp(tvb
, offset
, pinfo
, ft
);
4152 case CMD_MSGRESP_GET_HANDLES
:
4153 offset
= resp_resphan(tvb
, offset
, ft
);
4156 offset
= resp_desc(tvb
, offset
, ft
);
4159 offset
= resp_list(tvb
, offset
, ft
);
4162 case CMD_PGM_START2
:
4163 offset
= resp_start(tvb
, offset
, ft
);
4165 case CMD_PGM_STATUS
:
4166 case CMD_PGM_OPTIONS
:
4167 offset
= resp_status(tvb
, offset
, ft
);
4170 offset
= resp_files(tvb
, offset
, ft
);
4173 offset
= resp_sched(tvb
, offset
, ft
);
4175 case CMD_USDT_GET_STMIN_FC
:
4176 offset
= cmd_usdt_stmin_fc(tvb
, offset
, ft
);
4178 case CMD_USDT_GET_BSMAX_FC
:
4179 offset
= cmd_usdt_bsmax_fc(tvb
, offset
, ft
);
4181 case CMD_USDT_GET_STMIN_OVERRIDE
:
4182 offset
= cmd_usdt_get_stmin_override(tvb
, offset
, ft
);
4184 case CMD_IOPWR_GETINP
:
4185 case CMD_IOPWR_GETLATCH
:
4186 case CMD_IOPWR_CLRLATCH
:
4187 case CMD_IOPWR_GETPOWER
:
4188 offset
= cmd_bits_in(tvb
, offset
, ft
);
4190 case CMD_IOPWR_GETOUT
:
4191 offset
= cmd_bits_out(tvb
, offset
, ft
);
4193 case CMD_UTIL_GET_INIT_STRATEGY
:
4194 offset
= cmd_init_strat(tvb
, offset
, ft
);
4196 case CMD_CARD_IOCTL
:
4197 offset
= cmd_ioctl_resp(tvb
, pinfo
, offset
, ft
, pkt_info
->ioctl_command
);
4200 proto_tree_add_item(ft
, hf_gryphon_data
, tvb
, offset
, msglen
, ENC_NA
);
4203 decrement_dissection_depth(pinfo
);
4211 * This function exists because Gryphon Protocol MISC packets contain within them Gryphon Protocol packets.
4212 * So, this function will decode a packet and return the offset.
4215 // NOLINTNEXTLINE(misc-no-recursion)
4216 dissect_gryphon_message(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, bool is_msgresp_add
)
4218 proto_tree
*gryphon_tree
;
4219 proto_item
*ti
, *type_item
;
4220 proto_tree
*header_tree
, *body_tree
;
4221 int msgend
, msglen
, msgpad
;
4223 uint32_t src
, dest
, i
, frmtyp
, flags
;
4225 if (!is_msgresp_add
) {
4226 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "Gryphon");
4227 col_clear(pinfo
->cinfo
, COL_INFO
);
4229 ti
= proto_tree_add_item(tree
, proto_gryphon
, tvb
, 0, -1, ENC_NA
);
4230 gryphon_tree
= proto_item_add_subtree(ti
, ett_gryphon
);
4233 gryphon_tree
= tree
;
4236 header_tree
= proto_tree_add_subtree(gryphon_tree
, tvb
, offset
, MSG_HDR_SZ
, ett_gryphon_header
, NULL
, "Header");
4239 proto_tree_add_item_ret_uint(header_tree
, hf_gryphon_src
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &src
);
4240 /* 20180306 20171012 */
4242 if (is_special_client(src
)) {
4243 proto_tree_add_item(header_tree
, hf_gryphon_srcchanclient
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
4246 proto_tree_add_item(header_tree
, hf_gryphon_srcchan
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
4250 proto_tree_add_item_ret_uint(header_tree
, hf_gryphon_dest
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
, &dest
);
4251 /* 20180306 20171012 */
4253 if (is_special_client(dest
)) {
4254 proto_tree_add_item(header_tree
, hf_gryphon_destchanclient
, tvb
, offset
+ 3, 1, ENC_BIG_ENDIAN
);
4257 proto_tree_add_item(header_tree
, hf_gryphon_destchan
, tvb
, offset
+ 3, 1, ENC_BIG_ENDIAN
);
4260 proto_tree_add_item_ret_uint(header_tree
, hf_gryphon_data_length
, tvb
, offset
+ 4, 2, ENC_BIG_ENDIAN
, &msglen
);
4261 flags
= tvb_get_uint8(tvb
, offset
+ 6);
4262 frmtyp
= flags
& ~RESPONSE_FLAGS
;
4263 type_item
= proto_tree_add_uint(header_tree
, hf_gryphon_type
, tvb
, offset
+ 6, 1, frmtyp
);
4265 * Indicate what kind of message this is.
4267 if (!is_msgresp_add
)
4268 col_set_str(pinfo
->cinfo
, COL_INFO
, val_to_str_const(frmtyp
, frame_type
, "- Invalid -"));
4270 if (is_msgresp_add
) {
4271 static int * const wait_flags
[] = {
4272 &hf_gryphon_wait_resp
,
4273 &hf_gryphon_wait_prev_resp
,
4277 proto_tree_add_bitmask(header_tree
, tvb
, offset
+ 6, hf_gryphon_wait_flags
, ett_gryphon_flags
, wait_flags
, ENC_NA
);
4279 proto_tree_add_item(header_tree
, hf_gryphon_reserved
, tvb
, offset
+ 7, 1, ENC_NA
);
4280 offset
+= MSG_HDR_SZ
;
4282 msgpad
= 3 - (msglen
+ 3) % 4;
4283 msgend
= offset
+ msglen
+ msgpad
;
4285 body_tree
= proto_tree_add_subtree(gryphon_tree
, tvb
, offset
, msglen
, ett_gryphon_body
, NULL
, "Body");
4287 increment_dissection_depth(pinfo
);
4290 offset
= decode_command(tvb
, pinfo
, msglen
, offset
, dest
, body_tree
);
4293 offset
= decode_response(tvb
, pinfo
, offset
, src
, body_tree
);
4296 offset
= decode_data(tvb
, offset
, body_tree
);
4299 offset
= decode_event(tvb
, offset
, body_tree
);
4302 offset
= decode_misc(tvb
, offset
, pinfo
, body_tree
);
4305 offset
= decode_text(tvb
, offset
, msglen
, body_tree
);
4310 expert_add_info(pinfo
, type_item
, &ei_gryphon_type
);
4311 proto_tree_add_item(body_tree
, hf_gryphon_data
, tvb
, offset
, msglen
, ENC_NA
);
4314 decrement_dissection_depth(pinfo
);
4317 /*i = msgend - offset;*/
4318 /*proto_tree_add_debug_text(gryphon_tree, "debug offset=%d msgend=%d i=%d",offset,msgend,i);*/
4320 if (offset
< msgend
) {
4321 i
= msgend
- offset
;
4323 * worked when msglen=4, offset=8, msgend=12, get i=4
4324 * did not work when msglen=5, offset=8, msgend=16, i is 8
4326 proto_tree_add_item(gryphon_tree
, hf_gryphon_padding
, tvb
, offset
, i
, ENC_NA
);
4333 get_gryphon_pdu_len(packet_info
*pinfo _U_
, tvbuff_t
*tvb
, int offset
, void *data _U_
)
4339 * Get the length of the Gryphon packet, and then get the length as
4340 * padded to a 4-byte boundary.
4342 plen
= tvb_get_ntohs(tvb
, offset
+ 4);
4343 padded_len
= plen
+ 3 - (plen
+ 3) % 4;
4346 * That length doesn't include the fixed-length part of the header;
4349 return padded_len
+ GRYPHON_FRAME_HEADER_LEN
;
4353 dissect_gryphon_pdu(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4355 dissect_gryphon_message(tvb
, pinfo
, tree
, false);
4356 return tvb_reported_length(tvb
);
4360 dissect_gryphon(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data
)
4362 tcp_dissect_pdus(tvb
, pinfo
, tree
, gryphon_desegment
, GRYPHON_FRAME_HEADER_LEN
,
4363 get_gryphon_pdu_len
, dissect_gryphon_pdu
, data
);
4364 return tvb_reported_length(tvb
);
4368 proto_register_gryphon(void)
4370 static hf_register_info hf
[] = {
4372 { "Source", "gryphon.src", FT_UINT8
, BASE_HEX
, VALS(src_dest
), 0x0,
4374 { &hf_gryphon_srcchan
,
4375 { "Source channel", "gryphon.srcchan", FT_UINT8
,
4376 BASE_DEC
| BASE_SPECIAL_VALS
, VALS(channel_or_broadcast
), 0x0,
4378 { &hf_gryphon_srcchanclient
,
4379 { "Source client id", "gryphon.srcchanclient", FT_UINT8
,
4380 BASE_DEC
| BASE_SPECIAL_VALS
, VALS(channel_or_broadcast
), 0x0,
4383 { "Destination", "gryphon.dest", FT_UINT8
, BASE_HEX
, VALS(src_dest
), 0x0,
4385 { &hf_gryphon_destchan
,
4386 { "Destination channel", "gryphon.destchan", FT_UINT8
,
4387 BASE_DEC
| BASE_SPECIAL_VALS
, VALS(channel_or_broadcast
), 0x0,
4389 { &hf_gryphon_destchanclient
,
4390 { "Destination client id", "gryphon.destchanclient", FT_UINT8
,
4391 BASE_DEC
| BASE_SPECIAL_VALS
, VALS(channel_or_broadcast
), 0x0,
4394 { "Frame type", "gryphon.type", FT_UINT8
, BASE_DEC
, VALS(frame_type
), 0x0,
4397 { "Command", "gryphon.cmd", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4399 { &hf_gryphon_cmd_context
,
4400 { "Context", "gryphon.cmd.context", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4402 { &hf_gryphon_cmd_ioctl_context
,
4403 { "IOCTL Response", "gryphon.cmd.ioctl_response", FT_UINT32
, BASE_DEC
, VALS(ioctls
), 0x0,
4406 { "Data", "gryphon.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4408 { &hf_gryphon_padding
,
4409 { "Padding", "gryphon.padding", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4411 { &hf_gryphon_ignored
,
4412 { "Ignored", "gryphon.ignored", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4414 { &hf_gryphon_data_length
,
4415 { "Data length (bytes)", "gryphon.data_length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4417 { &hf_gryphon_reserved
,
4418 { "Reserved", "gryphon.reserved", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4420 { &hf_gryphon_wait_flags
,
4421 { "Flags", "gryphon.wait_flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
4423 { &hf_gryphon_wait_resp
,
4424 { "Wait for response", "gryphon.wait_resp", FT_BOOLEAN
, 8, TFS(&tfs_wait_response
), DONT_WAIT_FOR_RESP
,
4426 { &hf_gryphon_wait_prev_resp
,
4427 { "Wait for previous response", "gryphon.wait_prev_resp", FT_BOOLEAN
, 8, TFS(&tfs_wait_response
), WAIT_FOR_PREV_RESP
,
4429 { &hf_gryphon_status
,
4430 { "Status", "gryphon.status", FT_UINT32
, BASE_HEX
, VALS(responses_vs
), 0x0,
4432 { &hf_gryphon_response_in
,
4433 { "Response In", "gryphon.response_in", FT_FRAMENUM
, BASE_NONE
, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE
), 0x0,
4434 "The response to this Gryphon request is in this frame", HFILL
}},
4435 { &hf_gryphon_response_to
,
4436 { "Request In", "gryphon.response_to", FT_FRAMENUM
, BASE_NONE
, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST
), 0x0,
4437 "This is a response to the PANA request in this frame", HFILL
}},
4438 { &hf_gryphon_response_time
,
4439 { "Response Time", "gryphon.response_time", FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x0,
4440 "The time between the request and the response", HFILL
}},
4441 { &hf_gryphon_data_header_length
,
4442 { "Header length (bytes)", "gryphon.data.header_length", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4444 { &hf_gryphon_data_header_length_bits
,
4445 { "Header length (bits)", "gryphon.data.header_length", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4447 { &hf_gryphon_data_data_length
,
4448 { "Data length (bytes)", "gryphon.data.data_length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4450 { &hf_gryphon_data_extra_data_length
,
4451 { "Extra data length (bytes)", "gryphon.data.extra_length", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4453 { &hf_gryphon_data_mode
,
4454 { "Mode", "gryphon.data.mode", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4456 { &hf_gryphon_data_mode_transmitted
,
4457 { "Transmitted message", "gryphon.data.mode.transmitted", FT_BOOLEAN
, 8, TFS(&true_false
), 0x80,
4459 { &hf_gryphon_data_mode_receive
,
4460 { "Received message", "gryphon.data.mode.receive", FT_BOOLEAN
, 8, TFS(&true_false
), 0x40,
4462 { &hf_gryphon_data_mode_local
,
4463 { "Local message", "gryphon.data.mode.local", FT_BOOLEAN
, 8, TFS(&true_false
), 0x20,
4465 { &hf_gryphon_data_mode_remote
,
4466 { "Remote message (LIN)", "gryphon.data.mode.remote", FT_BOOLEAN
, 8, TFS(&true_false
), 0x10,
4468 /* 20171012 added additional mode bits */
4469 { &hf_gryphon_data_mode_oneshot
,
4470 { "One-shot slave table message (LIN)", "gryphon.data.mode.oneshot", FT_BOOLEAN
, 8, TFS(&true_false
), 0x08,
4472 { &hf_gryphon_data_mode_combined
,
4473 { "Channel number is in context", "gryphon.data.mode.combined", FT_BOOLEAN
, 8, TFS(&true_false
), 0x04,
4475 { &hf_gryphon_data_mode_nomux
,
4476 { "Do not multiplex message", "gryphon.data.mode.nomux", FT_BOOLEAN
, 8, TFS(&true_false
), 0x02,
4478 { &hf_gryphon_data_mode_internal
,
4479 { "Internal message", "gryphon.data.mode.internal", FT_BOOLEAN
, 8, TFS(&true_false
), 0x01,
4481 { &hf_gryphon_data_priority
,
4482 { "Priority", "gryphon.data.priority", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4484 { &hf_gryphon_data_error_status
,
4485 { "Error status", "gryphon.data.error_status", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4487 { &hf_gryphon_data_time
,
4488 { "Timestamp", "gryphon.data.time", FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x0,
4490 { &hf_gryphon_data_context
,
4491 { "Context", "gryphon.data.context", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4493 { &hf_gryphon_data_header_data
,
4494 { "Header", "gryphon.data.header_data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4496 { &hf_gryphon_data_data
,
4497 { "Data", "gryphon.data.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4499 { &hf_gryphon_data_extra_data
,
4500 { "Extra data", "gryphon.data.extra_data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4502 { &hf_gryphon_data_padding
,
4503 { "Padding", "gryphon.data.padding", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4505 { &hf_gryphon_event_id
,
4506 { "Event ID", "gryphon.event.id", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4508 { &hf_gryphon_event_name
,
4509 { "Event name", "gryphon.event.name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4511 { &hf_gryphon_event_context
,
4512 { "Event context", "gryphon.event.context", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4514 { &hf_gryphon_event_time
,
4515 { "Timestamp", "gryphon.event.time", FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x0,
4517 { &hf_gryphon_event_data
,
4518 { "Data", "gryphon.event.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4520 { &hf_gryphon_event_padding
,
4521 { "Padding", "gryphon.event.padding", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4523 { &hf_gryphon_misc_text
,
4524 { "Text", "gryphon.misc.text", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4526 { &hf_gryphon_misc_padding
,
4527 { "Padding", "gryphon.misc.padding", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4529 { &hf_gryphon_eventnum
,
4530 { "Event numbers", "gryphon.eventnum", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4532 { &hf_gryphon_resp_time
,
4533 { "Date/Time", "gryphon.resp_time", FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_LOCAL
, NULL
, 0x0,
4535 { &hf_gryphon_setfilt
,
4536 { "Pass/Block flag", "gryphon.setfilt.flag", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4538 { &hf_gryphon_setfilt_length
,
4539 { "Length of Pattern & Mask", "gryphon.setfilt.length", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4541 { &hf_gryphon_setfilt_discard_data
,
4542 { "Discarded data", "gryphon.setfilt.discard_data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4544 { &hf_gryphon_setfilt_padding
,
4545 { "Padding", "gryphon.setfilt.padding", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4547 { &hf_gryphon_ioctl
,
4548 { "IOCTL", "gryphon.ioctl", FT_UINT32
, BASE_HEX
, VALS(ioctls
), 0x0,
4550 { &hf_gryphon_ioctl_nbytes
,
4551 { "Number of bytes to follow (bytes)", "gryphon.ioctl_nbytes", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4553 { &hf_gryphon_ioctl_data
,
4554 { "Data", "gryphon.ioctl.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4556 { &hf_gryphon_addfilt_pass
,
4557 { "Conforming messages", "gryphon.addfilt.pass", FT_BOOLEAN
, 8, TFS(&tfs_passed_blocked
), FILTER_PASS_FLAG
,
4559 { &hf_gryphon_addfilt_active
,
4560 { "Filter", "gryphon.addfilt.active", FT_BOOLEAN
, 8, TFS(&active_inactive
), FILTER_ACTIVE_FLAG
,
4562 { &hf_gryphon_addfilt_blocks
,
4563 { "Number of filter blocks", "gryphon.addfilt.blocks", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4565 { &hf_gryphon_addfilt_handle
,
4566 { "Filter handle", "gryphon.addfilt.handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4568 { &hf_gryphon_modfilt
,
4569 { "Filter handle", "gryphon.modfilt", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4571 { &hf_gryphon_modfilt_action
,
4572 { "Action", "gryphon.modfilt.action", FT_UINT8
, BASE_DEC
, VALS(filtacts
), 0x0,
4574 { &hf_gryphon_filthan
,
4575 { "Number of filter handles", "gryphon.filthan", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4577 { &hf_gryphon_filthan_id
,
4578 { "Filter handle ID", "gryphon.filthan.id", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4580 { &hf_gryphon_filthan_padding
,
4581 { "Padding", "gryphon.filthan.padding", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4583 { &hf_gryphon_dfiltmode
,
4584 { "Filter mode", "gryphon.dfiltmode", FT_UINT8
, BASE_DEC
, VALS(dmodes
), 0x0,
4586 { &hf_gryphon_filtmode
,
4587 { "Filter mode", "gryphon.filtmode", FT_UINT8
, BASE_DEC
, VALS(modes
), 0x0,
4589 { &hf_gryphon_register_username
,
4590 { "Username", "gryphon.register.username", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4592 { &hf_gryphon_register_password
,
4593 { "Password", "gryphon.register.password", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4595 { &hf_gryphon_register_client_id
,
4596 { "Client ID", "gryphon.register.client_id", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4598 { &hf_gryphon_register_privileges
,
4599 { "Privileges", "gryphon.register.privileges", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4601 { &hf_gryphon_getspeeds_set_ioctl
,
4602 { "Set Speed IOCTL", "gryphon.getspeeds.set_ioctl", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4604 { &hf_gryphon_getspeeds_get_ioctl
,
4605 { "Get Speed IOCTL", "gryphon.getspeeds.get_ioctl", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4607 { &hf_gryphon_getspeeds_size
,
4608 { "Speed data size (bytes)", "gryphon.getspeeds.size", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4610 { &hf_gryphon_getspeeds_preset
,
4611 { "Preset speed numbers", "gryphon.getspeeds.preset", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4613 { &hf_gryphon_getspeeds_data
,
4614 { "Data for preset", "gryphon.getspeeds.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4616 { &hf_gryphon_cmd_sort
,
4617 { "Set sorting", "gryphon.cmd_sort", FT_UINT8
, BASE_DEC
, VALS(cmd_sort_type
), 0x0,
4619 { &hf_gryphon_cmd_optimize
,
4620 { "Set optimization", "gryphon.cmd_optimize", FT_UINT8
, BASE_DEC
, VALS(cmd_optimize_type
), 0x0,
4622 { &hf_gryphon_config_device_name
,
4623 { "Device name", "gryphon.config.device_name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4625 { &hf_gryphon_config_device_version
,
4626 { "Device version", "gryphon.config.device_version", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4628 { &hf_gryphon_config_device_serial_number
,
4629 { "Device serial number", "gryphon.config.device_serial_number", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4631 { &hf_gryphon_config_num_channels
,
4632 { "Number of channels", "gryphon.config.num_channels", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4634 { &hf_gryphon_config_name_version_ext
,
4635 { "Name & version extension", "gryphon.config.name_version_ext", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4637 { &hf_gryphon_config_driver_name
,
4638 { "Driver name", "gryphon.config.driver_name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4640 { &hf_gryphon_config_driver_version
,
4641 { "Driver version", "gryphon.config.driver_version", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4643 { &hf_gryphon_config_device_security
,
4644 { "Device security string", "gryphon.config.device_security", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4646 { &hf_gryphon_config_max_data_length
,
4647 { "Maximum data length (bytes)", "gryphon.config.max_data_length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4649 { &hf_gryphon_config_min_data_length
,
4650 { "Minimum data length (bytes)", "gryphon.config.min_data_length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4652 { &hf_gryphon_config_hardware_serial_number
,
4653 { "Hardware serial number", "gryphon.config.hardware_serial_number", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4655 { &hf_gryphon_config_protocol_type
,
4656 { "Protocol type & subtype", "gryphon.config.protocol_type", FT_UINT16
, BASE_HEX
, VALS(protocol_types
), 0x0,
4658 { &hf_gryphon_config_channel_id
,
4659 { "Channel ID", "gryphon.config.channel_id", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4661 { &hf_gryphon_config_card_slot_number
,
4662 { "Card slot number", "gryphon.config.card_slot_number", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4664 { &hf_gryphon_config_max_extra_data
,
4665 { "Maximum extra data (bytes)", "gryphon.config.max_extra_data", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4667 { &hf_gryphon_config_min_extra_data
,
4668 { "Minimum extra data (bytes)", "gryphon.config.min_extra_data", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4670 { &hf_gryphon_sched_num_iterations
,
4671 { "Number of iterations", "gryphon.sched.num_iterations", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4673 { &hf_gryphon_sched_flags
,
4674 { "Flags", "gryphon.sched.flags", FT_UINT32
, BASE_HEX
, NULL
, 0x0,
4676 { &hf_gryphon_sched_flags_scheduler
,
4677 { "Scheduler", "gryphon.sched.flags.scheduler", FT_BOOLEAN
, 32, TFS(&critical_normal
), 0x00000001,
4679 { &hf_gryphon_sched_sleep
,
4680 { "Sleep (milliseconds)", "gryphon.sched.sleep", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4682 { &hf_gryphon_sched_transmit_count
,
4683 { "Transmit count", "gryphon.sched.transmit_count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4685 { &hf_gryphon_sched_transmit_period
,
4686 { "Transmit period (milliseconds)", "gryphon.sched.transmit_period", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4688 { &hf_gryphon_sched_transmit_flags
,
4689 { "Flags", "gryphon.sched.transmit_flags", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
4691 { &hf_gryphon_sched_skip_transmit_period
,
4692 { "Last transmit period", "gryphon.sched.skip_transmit_period", FT_BOOLEAN
, 16, TFS(&skip_not_skip
), 0x0001,
4694 { &hf_gryphon_sched_skip_sleep
,
4695 { "Last transmit period", "gryphon.sched.skip_transmit_period", FT_BOOLEAN
, 16, TFS(&skip_not_skip
), 0x0001,
4697 { &hf_gryphon_sched_channel
,
4698 { "Channel", "gryphon.sched.channel", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4700 { &hf_gryphon_sched_channel0
,
4701 { "Channel (specified by the destination channel)", "gryphon.sched.channel", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4703 { &hf_gryphon_sched_rep_id
,
4704 { "Schedule ID", "gryphon.sched.rep_id", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4706 { &hf_gryphon_sched_rep_message_index
,
4707 { "Message index", "gryphon.sched.rep_message_index", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4709 { &hf_gryphon_blm_data_time
,
4710 { "Timestamp", "gryphon.blm_data.time", FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x0,
4712 { &hf_gryphon_blm_data_bus_load
,
4713 { "Bus load average (%)", "gryphon.blm_data.bus_load", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4715 { &hf_gryphon_blm_data_current_bus_load
,
4716 { "Current bus load (%)", "gryphon.blm_data.current_bus_load", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4718 { &hf_gryphon_blm_data_peak_bus_load
,
4719 { "Peak bus load (%)", "gryphon.blm_data.peak_bus_load", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4721 { &hf_gryphon_blm_data_historic_peak_bus_load
,
4722 { "Historic peak bus load (%)", "gryphon.blm_data.historic_peak_bus_load", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4724 { &hf_gryphon_blm_stat_receive_frame_count
,
4725 { "Receive frame count", "gryphon.blm_stat.receive_frame_count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4727 { &hf_gryphon_blm_stat_transmit_frame_count
,
4728 { "Transmit frame count", "gryphon.blm_stat.transmit_frame_count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4730 { &hf_gryphon_blm_stat_receive_dropped_frame_count
,
4731 { "Receive dropped frame count", "gryphon.blm_stat.receive_dropped_frame_count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4733 { &hf_gryphon_blm_stat_transmit_dropped_frame_count
,
4734 { "Transmit dropped frame count", "gryphon.blm_stat.transmit_dropped_frame_count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4736 { &hf_gryphon_blm_stat_receive_error_count
,
4737 { "Receive error count", "gryphon.blm_stat.receive_error_count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4739 { &hf_gryphon_blm_stat_transmit_error_count
,
4740 { "Transmit error count", "gryphon.blm_stat.transmit_error_count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4742 { &hf_gryphon_addresp_flags
,
4743 { "Flags", "gryphon.addresp.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
4745 /* 20171017 fixed display of filter flags */
4746 { &hf_gryphon_addresp_flags_active
,
4747 { "Filter active flag", "gryphon.addresp.flags.active", FT_BOOLEAN
, 8, TFS(&active_inactive
), FILTER_ACTIVE_FLAG
,
4749 { &hf_gryphon_addresp_blocks
,
4750 { "Number of filter blocks", "gryphon.addresp.blocks", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4752 { &hf_gryphon_ldf_number
,
4753 { "Number of LDF names", "gryphon.ldf.number", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4755 { &hf_gryphon_ldf_nodenumber
,
4756 { "Number of nodes", "gryphon.ldf.nodenumber", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4758 { &hf_gryphon_ldf_list
,
4759 { "LDF block index", "gryphon.ldf.list", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4761 { &hf_gryphon_ldf_remaining
,
4762 { "Remaining LDF names", "gryphon.ldf.remaining", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4764 { &hf_gryphon_ldf_name
,
4765 { "File Name", "gryphon.ldf.name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4767 { &hf_gryphon_ldf_info_pv
,
4768 { "Protocol version", "gryphon.ldf.pv", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4770 { &hf_gryphon_ldf_info_lv
,
4771 { "Language version", "gryphon.ldf.lv", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4773 { &hf_gryphon_ldf_ui
,
4774 { "Unique identifier", "gryphon.ldf.ui", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4776 { &hf_gryphon_lin_nodename
,
4777 { "Node Name", "gryphon.lin.nodename", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4779 { &hf_gryphon_lin_data_length
,
4780 { "Data length (bytes)", "gryphon.lin.data_length", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4782 { &hf_gryphon_lin_slave_table_enable
,
4783 { "Slave table entry", "gryphon.lin.slave_table_enable", FT_UINT8
, BASE_DEC
, VALS(lin_slave_table_enable
), 0x0,
4785 { &hf_gryphon_lin_slave_table_cs
,
4786 { "Slave table checksum", "gryphon.lin.slave_table_cs", FT_UINT8
, BASE_DEC
, VALS(lin_slave_table_cs
), 0x0,
4788 { &hf_gryphon_lin_slave_table_data
,
4789 { "Data", "gryphon.lin.slave_table_data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4791 { &hf_gryphon_lin_slave_table_datacs
,
4792 { "Checksum", "gryphon.lin.slave_table_datacs", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
4794 { &hf_gryphon_lin_masterevent
,
4795 { "Starting frame id", "gryphon.lin.masterevent", FT_UINT8
, BASE_DEC
, VALS(lin_ioctl_masterevent
), 0x0,
4797 { &hf_gryphon_lin_numdata
,
4798 { "Number of data bytes", "gryphon.lin.numdata", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4800 { &hf_gryphon_lin_numextra
,
4801 { "Number of extra bytes", "gryphon.lin.numextra", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4803 { &hf_gryphon_ldf_description
,
4804 { "Description", "gryphon.ldf.description", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4806 { &hf_gryphon_ldf_size
,
4807 { "Size of LDF to be uploaded", "gryphon.ldf.size", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4809 { &hf_gryphon_ldf_exists
,
4810 { "LDF name existence check", "gryphon.ldf.exists", FT_UINT8
, BASE_DEC
, VALS(ldf_exists
), 0x0,
4812 { &hf_gryphon_ldf_blockn
,
4813 { "Block number", "gryphon.ldf.blockn", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4815 { &hf_gryphon_ldf_file
,
4816 { "Upload text block", "gryphon.ldf.file", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4818 { &hf_gryphon_ldf_desc_pad
,
4819 { "Padding (TODO: need to fix response data length)", "gryphon.ldf.desc_pad", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4821 { &hf_gryphon_ldf_restore_session
,
4822 { "Session id", "gryphon.ldf.restore_session", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4824 { &hf_gryphon_ldf_schedule_name
,
4825 { "Schedule name", "gryphon.ldf.schedule_name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4827 { &hf_gryphon_ldf_schedule_msg_dbytes
,
4828 { "Data length (bytes)", "gryphon.ldf.schedule_msg_dbytes", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4830 { &hf_gryphon_ldf_schedule_flags
,
4831 { "Flags", "gryphon.ldf.schedule_flags", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4833 { &hf_gryphon_ldf_schedule_event
,
4834 { "Event driven", "gryphon.ldf.schedule_event_ev", FT_BOOLEAN
, 8, TFS(&true_false
), 0x80,
4836 { &hf_gryphon_ldf_schedule_sporadic
,
4837 { "Sporadic", "gryphon.ldf.schedule_event_sp", FT_BOOLEAN
, 8, TFS(&true_false
), 0x40,
4839 { &hf_gryphon_ldf_ioctl_setflags
,
4840 { "Starting frame id", "gryphon.ldf.ioctl_setflags", FT_UINT8
, BASE_DEC
, VALS(lin_ldf_ioctl_setflags
), 0x0,
4842 { &hf_gryphon_ldf_ioctl_setflags_flags
,
4843 { "Id", "gryphon.ldf.ioctl_setflags_flags", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4845 { &hf_gryphon_ldf_numb_ids
,
4846 { "Number of ids", "gryphon.ldf.numb_ids", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4848 { &hf_gryphon_ldf_bitrate
,
4849 { "Bitrate", "gryphon.ldf.bitrate", FT_FLOAT
, BASE_NONE
, NULL
, 0x0,
4851 { &hf_gryphon_ldf_sched_size_place
,
4852 { "Placeholder for schedule size (bytes)", "gryphon.ldf.schedsize", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4854 { &hf_gryphon_ldf_sched_numb_place
,
4855 { "Placeholder for number of schedules", "gryphon.ldf.numbsched", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4857 { &hf_gryphon_ldf_sched_size
,
4858 { "Schedule size (bytes)", "gryphon.ldf.schedsize", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4860 { &hf_gryphon_ldf_num_node_names
,
4861 { "Number of node names", "gryphon.ldf.num_node_names", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4863 { &hf_gryphon_ldf_num_frames
,
4864 { "Number of frames", "gryphon.ldf.num_frames", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4866 { &hf_gryphon_ldf_get_frame
,
4867 { "Frame", "gryphon.ldf.get_frame", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4869 { &hf_gryphon_ldf_get_frame_num
,
4870 { "Number of data bytes in slave response", "gryphon.ldf.get_frame_num", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4872 { &hf_gryphon_ldf_get_frame_pub
,
4873 { "Publisher", "gryphon.ldf.get_frame_pub", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4875 { &hf_gryphon_ldf_get_frame_num_signals
,
4876 { "Number of signals", "gryphon.ldf.get_frame_num_signals", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4878 { &hf_gryphon_ldf_num_signal_names
,
4879 { "Number of signal names", "gryphon.ldf.num_signal_names", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4881 { &hf_gryphon_ldf_num_schedules
,
4882 { "Number of schedules", "gryphon.ldf.num_schedules", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4884 { &hf_gryphon_ldf_num_encodings
,
4885 { "Number of encodings", "gryphon.ldf.num_encodings", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4887 { &hf_gryphon_ldf_encoding_value
,
4888 { "Encoding value", "gryphon.ldf.encoding_value", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4890 { &hf_gryphon_ldf_encoding_min
,
4891 { "Encoding min value", "gryphon.ldf.encoding_min", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4893 { &hf_gryphon_ldf_encoding_max
,
4894 { "Encoding max value", "gryphon.ldf.encoding_max", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4896 { &hf_gryphon_ldf_master_node_name
,
4897 { "Master node name", "gryphon.ldf.master", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4899 { &hf_gryphon_ldf_slave_node_name
,
4900 { "Slave node name", "gryphon.ldf.slave", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4902 { &hf_gryphon_ldf_node_name
,
4903 { "Node name", "gryphon.ldf.node_name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4905 { &hf_gryphon_ldf_signal_name
,
4906 { "Signal name", "gryphon.ldf.signal_name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4908 { &hf_gryphon_ldf_signal_encoding_name
,
4909 { "Signal encoding name", "gryphon.ldf.signal_encoding_name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4911 { &hf_gryphon_ldf_signal_encoding_type
,
4912 { "Signal encoding type", "gryphon.ldf.signal_encoding_type", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4914 { &hf_gryphon_ldf_signal_encoding_logical
,
4915 { "Signal encoding string", "gryphon.ldf.signal_encoding_logical", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4917 { &hf_gryphon_ldf_signal_offset
,
4918 { "Offset (bits)", "gryphon.ldf.signal_offset", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4920 { &hf_gryphon_ldf_signal_length
,
4921 { "Length (bits)", "gryphon.ldf.signal_length", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4924 { &hf_gryphon_cnvt_valuef
,
4925 { "Float value", "gryphon.cnvt.valuef", FT_FLOAT
, BASE_NONE
, NULL
, 0x0,
4927 { &hf_gryphon_cnvt_valuei
,
4928 { "Int value", "gryphon.cnvt.valuei", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4930 { &hf_gryphon_cnvt_values
,
4931 { "String value", "gryphon.cnvt.values", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4933 { &hf_gryphon_cnvt_units
,
4934 { "String units", "gryphon.cnvt.units", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4936 { &hf_gryphon_cnvt_flags_getvalues
,
4937 { "Flags", "gryphon.cnvt.flags.getvalues", FT_UINT8
, BASE_DEC
, VALS(lin_cnvt_getflags
), 0x0,
4940 { &hf_gryphon_dd_stream
,
4941 { "Stream number", "gryphon.dd.stream", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4943 { &hf_gryphon_dd_value
,
4944 { "Value (bytes)", "gryphon.dd.value", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4946 { &hf_gryphon_dd_time
,
4947 { "Time (msec)", "gryphon.dd.time", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4949 { &hf_gryphon_addresp_responses
,
4950 { "Number of response blocks", "gryphon.addresp.responses", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4952 { &hf_gryphon_addresp_old_handle
,
4953 { "Old handle", "gryphon.addresp.old_handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4955 { &hf_gryphon_addresp_action
,
4956 { "Action", "gryphon.addresp.action", FT_UINT8
, BASE_DEC
, VALS(action_vals
), 0x07,
4958 { &hf_gryphon_addresp_action_period
,
4959 { "Period", "gryphon.addresp.action_period", FT_BOOLEAN
, 8, TFS(&frames_01seconds
), FR_PERIOD_MSGS
,
4961 { &hf_gryphon_addresp_action_deact_on_event
,
4962 { "Deact on event", "gryphon.addresp.action.deact_on_event", FT_UINT8
, BASE_DEC
, VALS(deact_on_event_vals
), FR_DELETE
|FR_DEACT_ON_EVENT
,
4964 { &hf_gryphon_addresp_action_deact_after_period
,
4965 { "Deact on Period", "gryphon.addresp.action.deact_after_period", FT_UINT8
, BASE_DEC
, VALS(deact_after_per_vals
), FR_DELETE
|FR_DEACT_AFTER_PER
,
4967 { &hf_gryphon_addresp_action_period_type
,
4968 { "Period", "gryphon.addresp.action_period_type", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
4970 { &hf_gryphon_addresp_handle
,
4971 { "Response handle", "gryphon.addresp.handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4973 { &hf_gryphon_modresp_handle
,
4974 { "Response handle", "gryphon.modresp.handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4976 { &hf_gryphon_modresp_action
,
4977 { "Action response", "gryphon.modresp.action", FT_UINT8
, BASE_DEC
, VALS(filtacts
), 0x0,
4979 { &hf_gryphon_num_resphan
,
4980 { "Number of response handles", "gryphon.num_resphan", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4982 { &hf_gryphon_handle
,
4983 { "Handle", "gryphon.handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
4985 { &hf_gryphon_transmit_sched_id
,
4986 { "Transmit schedule ID", "gryphon.transmit_sched_id", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4988 { &hf_gryphon_desc_program_size
,
4989 { "Program size", "gryphon.desc.program_size", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
4991 { &hf_gryphon_desc_program_name
,
4992 { "Program name", "gryphon.desc.program_name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4994 { &hf_gryphon_desc_program_description
,
4995 { "Program description", "gryphon.desc.program_description", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4997 { &hf_gryphon_desc_flags
,
4998 { "Flags", "gryphon.desc.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5000 { &hf_gryphon_desc_flags_program
,
5001 { "Period", "gryphon.desc.flags.program", FT_BOOLEAN
, 8, TFS(&present_not_present
), 0x01,
5003 { &hf_gryphon_desc_handle
,
5004 { "Handle", "gryphon.desc.handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
5006 { &hf_gryphon_upload_block_number
,
5007 { "Block number", "gryphon.upload.block_number", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5009 { &hf_gryphon_upload_handle
,
5010 { "Handle", "gryphon.upload.handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
5012 { &hf_gryphon_upload_data
,
5013 { "Data", "gryphon.upload.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
5015 { &hf_gryphon_delete
,
5016 { "Program name", "gryphon.delete", FT_STRING
, BASE_NONE
, NULL
, 0x0,
5018 { &hf_gryphon_list_block_number
,
5019 { "Block number", "gryphon.list.block_number", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
5021 { &hf_gryphon_list_num_programs
,
5022 { "Number of programs in this response", "gryphon.list.num_programs", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
5024 { &hf_gryphon_list_num_remain_programs
,
5025 { "Number of remaining programs", "gryphon.list.num_remain_programs", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5027 { &hf_gryphon_list_name
,
5028 { "Name", "gryphon.list.name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
5030 { &hf_gryphon_list_description
,
5031 { "Description", "gryphon.list.description", FT_STRING
, BASE_NONE
, NULL
, 0x0,
5033 { &hf_gryphon_start_arguments
,
5034 { "Arguments", "gryphon.start.arguments", FT_STRINGZ
, BASE_NONE
, NULL
, 0x0,
5036 { &hf_gryphon_start_channel
,
5037 { "Channel (Client) number", "gryphon.start.channel", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
5039 { &hf_gryphon_status_num_running_copies
,
5040 { "Number of running copies", "gryphon.status.num_running_copies", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
5042 { &hf_gryphon_options_handle
,
5043 { "Handle", "gryphon.options.handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
5045 { &hf_gryphon_files
,
5046 { "Directory", "gryphon.files", FT_STRING
, BASE_NONE
, NULL
, 0x0,
5048 { &hf_gryphon_usdt_flags_register
,
5049 { "USDT", "gryphon.usdt.flags_register", FT_UINT8
, BASE_DEC
, VALS(register_unregister
), 0x01,
5051 { &hf_gryphon_usdt_action_flags
,
5052 { "Action Flags", "gryphon.usdt.action_flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5055 /* 20171012 added non legacy USDT */
5056 { &hf_gryphon_usdt_action_flags_non_legacy
,
5057 { "Action Flags", "gryphon.usdt.action_flags.non_legacy", FT_BOOLEAN
, 8, TFS(®ister_unregister_action_flags
), 0x01,
5060 { &hf_gryphon_usdt_action_flags_register
,
5061 { "Register", "gryphon.usdt.action_flags.register", FT_UINT8
, BASE_DEC
, VALS(register_unregister
), 0x01,
5063 { &hf_gryphon_usdt_action_flags_action
,
5064 { "Action", "gryphon.usdt.action_flags.action", FT_UINT8
, BASE_DEC
, VALS(usdt_action_vals
), 0x06,
5066 { &hf_gryphon_usdt_transmit_options_flags
,
5067 { "Transmit options", "gryphon.usdt.transmit_options_flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5069 /* 20171012 USDT tx options */
5071 { &hf_gryphon_usdt_transmit_options_flags_echo
,
5072 { "Echo long", "gryphon.usdt.transmit_options_flags.echo_long", FT_UINT8
, BASE_DEC
, VALS(xmit_opt_echo_long
), 0x01, NULL
, HFILL
}},
5074 { &hf_gryphon_usdt_transmit_options_action
,
5075 { "Transmit Action", "gryphon.usdt.transmit_options_flags.action", FT_UINT8
, BASE_DEC
, VALS(xmit_opt_vals
), 0x06,
5078 { &hf_gryphon_usdt_transmit_options_done_event
,
5079 { "Done event", "gryphon.usdt.transmit_options_flags.done_event", FT_UINT8
, BASE_DEC
, VALS(xmit_opt_done
), 0x08, NULL
, HFILL
}},
5081 { &hf_gryphon_usdt_transmit_options_echo_short
,
5082 { "Echo short", "gryphon.usdt.transmit_options_flags.echo_log", FT_UINT8
, BASE_DEC
, VALS(xmit_opt_echo_short
), 0x10, NULL
, HFILL
}},
5084 { &hf_gryphon_usdt_transmit_options_rx_nth_fc
,
5085 { "Nth flowcontrol event", "gryphon.usdt.transmit_options_flags.nth_fc_event", FT_UINT8
, BASE_DEC
, VALS(xmit_opt_nth_fc_event
), 0x20, NULL
, HFILL
}},
5088 { &hf_gryphon_usdt_transmit_options_send_done
,
5089 { "Send a USDT_DONE event when the last frame of a multi-frame USDT message is transmitted",
5090 "gryphon.usdt.transmit_options_flags.send_done", FT_BOOLEAN
, 8, TFS(&yes_no
), 0x08, NULL
, HFILL
}},
5092 /* 20171012 USDT rx options */
5093 { &hf_gryphon_usdt_receive_options_flags
,
5094 { "Receive options", "gryphon.usdt.receive_options_flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5097 { &hf_gryphon_usdt_receive_options_action
, /* legacy */
5098 { "Receive Action", "gryphon.usdt.receive_options_flags.action", FT_UINT8
, BASE_DEC
, VALS(recv_opt_vals
), 0x03, NULL
, HFILL
}},
5100 { &hf_gryphon_usdt_receive_options_firstframe_event
,
5101 { "First frame event", "gryphon.usdt.receive_options_flags.firstframe_event", FT_UINT8
, BASE_DEC
, VALS(recv_opt_firstframe_event
), 0x04, NULL
, HFILL
}},
5103 { &hf_gryphon_usdt_receive_options_lastframe_event
,
5104 { "Last frame event", "gryphon.usdt.receive_options_flags.lastframe_event", FT_UINT8
, BASE_DEC
, VALS(recv_opt_lastframe_event
), 0x08, NULL
, HFILL
}},
5106 { &hf_gryphon_usdt_receive_options_tx_nth_fc
,
5107 { "Nth flowcontrol event", "gryphon.usdt.receive_options_flags.nth_fc_event", FT_UINT8
, BASE_DEC
, VALS(recv_opt_nth_fc_event
), 0x20, NULL
, HFILL
}},
5110 { &hf_gryphon_usdt_length_options_flags
,
5111 { "Length options", "gryphon.usdt.length_options_flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5114 { &hf_gryphon_usdt_length_control_j1939
,
5115 { "Length control bit", "gryphon.usdt.length_options_flags.j1939", FT_UINT8
, BASE_DEC
, VALS(recv_opt_j1939
), 0x40, NULL
, HFILL
}},
5118 { &hf_gryphon_usdt_stmin_fc
,
5119 { "STMIN flow control time (milliseconds)", "gryphon.usdt.set_stmin_fc", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
5120 { &hf_gryphon_usdt_set_stmin_mul
,
5121 { "STMIN multiplier", "gryphon.usdt.set_stmin_mul", FT_FLOAT
, BASE_NONE
, NULL
, 0x0,
5123 { &hf_gryphon_usdt_bsmax_fc
,
5124 { "Block size max for flow control", "gryphon.usdt.set_bsmax_fc", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
5125 { &hf_gryphon_usdt_stmin_override
,
5126 { "STMIN override time (milliseconds)", "gryphon.usdt.set_stmin_override", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
5127 { &hf_gryphon_usdt_stmin_override_active
,
5128 { "STMIN override active", "gryphon.usdt.stmin_active", FT_BOOLEAN
, 8, TFS(&active_inactive
), FILTER_ACTIVE_FLAG
,
5130 { &hf_gryphon_usdt_stmin_override_activate
,
5131 { "STMIN override activate", "gryphon.usdt.stmin_active", FT_BOOLEAN
, 8, TFS(&active_inactive
), FILTER_ACTIVE_FLAG
,
5134 { &hf_gryphon_usdt_receive_options_firstframe
,
5135 { "Send a USDT_FIRSTFRAME event when the first frame of a multi-frame USDT message is received",
5136 "gryphon.usdt.receive_options_flags.firstframe", FT_BOOLEAN
, 8, TFS(&yes_no
), 0x04, NULL
, HFILL
}},
5137 { &hf_gryphon_usdt_receive_options_lastframe
,
5138 { "Send a USDT_LASTFRAME event when the first frame of a multi-frame USDT message is received",
5139 "gryphon.usdt.receive_options_flags.lastframe", FT_BOOLEAN
, 8, TFS(&yes_no
), 0x08, NULL
, HFILL
}},
5140 { &hf_gryphon_usdt_ext_address
,
5141 { "Using extended addressing for", "gryphon.usdt.ext_address", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
5143 { &hf_gryphon_usdt_ext_address_id
,
5144 { "ID", "gryphon.usdt.ext_address.id", FT_UINT32
, BASE_HEX
, NULL
, 0x0,
5146 { &hf_gryphon_usdt_block_size
,
5147 { "Number of IDs in the block", "gryphon.usdt.block_size", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
5149 { &hf_gryphon_bits_in_input1
,
5150 { "Input 1", "gryphon.bits_in.input1", FT_BOOLEAN
, 8, TFS(&set_not_set
), 0x01,
5152 { &hf_gryphon_bits_in_input2
,
5153 { "Input 2", "gryphon.bits_in.input2", FT_BOOLEAN
, 8, TFS(&set_not_set
), 0x02,
5155 { &hf_gryphon_bits_in_input3
,
5156 { "Input 3", "gryphon.bits_in.input3", FT_BOOLEAN
, 8, TFS(&set_not_set
), 0x04,
5158 { &hf_gryphon_bits_in_pushbutton
,
5159 { "Pushbutton", "gryphon.bits_in.pushbutton", FT_BOOLEAN
, 8, TFS(&set_not_set
), 0x08,
5161 { &hf_gryphon_bits_out_output1
,
5162 { "Input 1", "gryphon.bits_out.output1", FT_BOOLEAN
, 8, TFS(&set_not_set
), 0x01,
5164 { &hf_gryphon_bits_out_output2
,
5165 { "Input 2", "gryphon.bits_out.output2", FT_BOOLEAN
, 8, TFS(&set_not_set
), 0x02,
5167 { &hf_gryphon_init_strat_reset_limit
,
5168 { "Reset Limit", "gryphon.init_strat.reset_limit", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
5170 { &hf_gryphon_init_strat_delay
,
5171 { "Delay", "gryphon.init_strat.strat_delay", FT_FLOAT
, BASE_NONE
, NULL
, 0x0,
5173 { &hf_gryphon_speed_baud_rate_index
,
5174 { "Baud rate index", "gryphon.speed.baud_rate_index", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
5176 { &hf_gryphon_filter_block_filter_start
,
5177 { "Filter field starts at byte", "gryphon.filter_block.filter_start", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5179 { &hf_gryphon_filter_block_filter_length
,
5180 { "Filter field length", "gryphon.filter_block.filter_length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5182 { &hf_gryphon_filter_block_filter_type
,
5183 { "Filtering on", "gryphon.filter_block.filter_type", FT_UINT8
, BASE_DEC
, VALS(filter_data_types
), 0x0,
5185 { &hf_gryphon_filter_block_filter_operator
,
5186 { "Type of comparison", "gryphon.filter_block.filter_operator", FT_UINT8
, BASE_DEC
, VALS(operators
), 0x0,
5188 { &hf_gryphon_filter_block_filter_value1
,
5189 { "Value", "gryphon.filter_block.filter_value", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
5191 { &hf_gryphon_filter_block_filter_value2
,
5192 { "Value", "gryphon.filter_block.filter_value", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5194 { &hf_gryphon_filter_block_filter_value4
,
5195 { "Value", "gryphon.filter_block.filter_value", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
5197 { &hf_gryphon_filter_block_filter_value_bytes
,
5198 { "Value", "gryphon.filter_block.filter_value_bytes", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
5200 { &hf_gryphon_blm_mode
,
5201 { "Mode", "gryphon.blm_mode", FT_UINT32
, BASE_DEC
, VALS(blm_mode_vals
), 0x0,
5203 { &hf_gryphon_blm_mode_avg_period
,
5204 { "Averaging period", "gryphon.blm_mode.avg_period", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
5206 { &hf_gryphon_blm_mode_avg_frames
,
5207 { "Averaging period (frames)", "gryphon.blm_mode.avg_frames", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
5209 { &hf_gryphon_command
,
5210 { "Command", "gryphon.command", FT_UINT32
, BASE_HEX
|BASE_EXT_STRING
, &cmd_vals_ext
, 0x0,
5212 { &hf_gryphon_cmd_mode
,
5213 { "Mode", "gryphon.command.mode", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
5215 { &hf_gryphon_option
,
5216 { "Option", "gryphon.option", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
5218 { &hf_gryphon_option_data
,
5219 { "Option data", "gryphon.option_data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
5221 { &hf_gryphon_cmd_file
,
5222 { "File", "gryphon.command.file", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
5224 { &hf_gryphon_bit_in_digital_data
,
5225 { "Digital values set", "gryphon.bit_in_digital_data", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5227 { &hf_gryphon_bit_out_digital_data
,
5228 { "Digital values set", "gryphon.bit_out_digital_data", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5230 { &hf_gryphon_filter_block_pattern
,
5231 { "Pattern", "gryphon.filter_block.pattern", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
5233 { &hf_gryphon_filter_block_mask
,
5234 { "Mask", "gryphon.filter_block.mask", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
5237 { &hf_gryphon_usdt_nids
,
5238 { "Number of IDs in block", "gryphon.nids", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
5240 { &hf_gryphon_usdt_request
,
5241 { "USDT request IDs", "gryphon.usdt_request", FT_UINT32
, BASE_HEX
, NULL
, 0x0,
5243 { &hf_gryphon_usdt_request_ext
,
5244 { "USDT request extended address", "gryphon.usdt_request_ext", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5246 { &hf_gryphon_usdt_response
,
5247 { "USDT response IDs", "gryphon.usdt_response", FT_UINT32
, BASE_HEX
, NULL
, 0x0,
5249 { &hf_gryphon_usdt_response_ext
,
5250 { "USDT response extended address", "gryphon.usdt_response_ext", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5252 { &hf_gryphon_uudt_response
,
5253 { "UUDT response IDs", "gryphon.uudt_response", FT_UINT32
, BASE_HEX
, NULL
, 0x0,
5255 { &hf_gryphon_uudt_response_ext
,
5256 { "UUDT response extended address", "gryphon.uudt_response_ext", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5258 { &hf_gryphon_more_filenames
,
5259 { "More filenames to return", "gryphon.more_filenames", FT_BOOLEAN
, BASE_NONE
, TFS(&yes_no
), 0x0,
5261 { &hf_gryphon_filenames
,
5262 { "File and directory names", "gryphon.filenames", FT_STRING
, BASE_NONE
, NULL
, 0x0,
5264 { &hf_gryphon_program_channel_number
,
5265 { "Program channel number", "gryphon.program_channel_number", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
5267 { &hf_gryphon_valid_header_length
,
5268 { "Valid Header length", "gryphon.valid_header_length", FT_UINT32
, BASE_HEX
, NULL
, 0x0,
5272 static int *ett
[] = {
5274 &ett_gryphon_header
,
5276 &ett_gryphon_command_data
,
5277 &ett_gryphon_response_data
,
5278 &ett_gryphon_data_header
,
5280 &ett_gryphon_data_body
,
5281 &ett_gryphon_cmd_filter_block
,
5282 &ett_gryphon_cmd_events_data
,
5283 &ett_gryphon_cmd_config_device
,
5284 &ett_gryphon_cmd_sched_data
,
5285 &ett_gryphon_cmd_sched_cmd
,
5286 &ett_gryphon_cmd_response_block
,
5287 &ett_gryphon_pgm_list
,
5288 &ett_gryphon_pgm_status
,
5289 &ett_gryphon_pgm_options
,
5290 &ett_gryphon_valid_headers
,
5291 &ett_gryphon_usdt_data
,
5292 &ett_gryphon_usdt_action_flags
,
5293 &ett_gryphon_usdt_tx_options_flags
,
5294 &ett_gryphon_usdt_rx_options_flags
,
5295 &ett_gryphon_usdt_len_options_flags
,
5296 &ett_gryphon_usdt_data_block
,
5297 &ett_gryphon_lin_emulate_node
,
5298 &ett_gryphon_ldf_block
,
5299 &ett_gryphon_ldf_schedule_name
,
5300 &ett_gryphon_lin_schedule_msg
,
5301 &ett_gryphon_cnvt_getflags
,
5302 &ett_gryphon_digital_data
,
5303 &ett_gryphon_blm_mode
5306 static ei_register_info ei
[] = {
5307 { &ei_gryphon_type
,{ "gryphon.type.invalid", PI_PROTOCOL
, PI_WARN
, "Invalid frame type", EXPFILL
} },
5310 module_t
*gryphon_module
;
5311 expert_module_t
* expert_gryphon
;
5313 proto_gryphon
= proto_register_protocol("DG Gryphon Protocol", "Gryphon", "gryphon");
5314 proto_register_field_array(proto_gryphon
, hf
, array_length(hf
));
5315 proto_register_subtree_array(ett
, array_length(ett
));
5316 expert_gryphon
= expert_register_protocol(proto_gryphon
);
5317 expert_register_field_array(expert_gryphon
, ei
, array_length(ei
));
5318 gryphon_handle
= register_dissector("gryphon", dissect_gryphon
, proto_gryphon
);
5320 gryphon_module
= prefs_register_protocol(proto_gryphon
, NULL
);
5321 prefs_register_bool_preference(gryphon_module
, "desegment",
5322 "Desegment all Gryphon messages spanning multiple TCP segments",
5323 "Whether the Gryphon dissector should desegment all messages spanning multiple TCP segments",
5324 &gryphon_desegment
);
5329 proto_reg_handoff_gryphon(void)
5331 dissector_add_uint_with_preference("tcp.port", GRYPHON_TCP_PORT
, gryphon_handle
);
5335 * Editor modelines - https://www.wireshark.org/tools/modelines.html
5340 * indent-tabs-mode: nil
5343 * vi: set shiftwidth=4 tabstop=8 expandtab:
5344 * :indentSize=4:tabSize=8:noTabs=true: