2 * Routines for Gryphon protocol packet disassembly
3 * By Steve Limkemann <stevelim@dgtech.com>
4 * Copyright 1998 Steve Limkemann
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 #include <epan/packet.h>
31 #include <epan/dissectors/packet-tcp.h>
32 #include <epan/prefs.h>
33 #include "packet-gryphon.h"
38 * http://www.dgtech.com/gryphon/sys/www/docs/html/
41 static int proto_gryphon
= -1;
43 static int hf_gryphon_src
= -1;
44 static int hf_gryphon_srcchan
= -1;
45 static int hf_gryphon_dest
= -1;
46 static int hf_gryphon_destchan
= -1;
47 static int hf_gryphon_type
= -1;
48 static int hf_gryphon_cmd
= -1;
49 static int hf_gryphon_data
= -1;
50 static int hf_gryphon_data_length
= -1;
51 static int hf_gryphon_reserved1
= -1;
52 static int hf_gryphon_reserved2
= -1;
53 static int hf_gryphon_reserved3
= -1;
54 static int hf_gryphon_reserved4
= -1;
55 static int hf_gryphon_reserved_bytes
= -1;
56 static int hf_gryphon_padding
= -1;
57 static int hf_gryphon_ignored
= -1;
58 static int hf_gryphon_wait_resp
= -1;
59 static int hf_gryphon_wait_prev_resp
= -1;
60 static int hf_gryphon_status
= -1;
61 static int hf_gryphon_data_header_length
= -1;
62 static int hf_gryphon_data_data_length
= -1;
63 static int hf_gryphon_data_extra_data_length
= -1;
64 static int hf_gryphon_data_mode
= -1;
65 static int hf_gryphon_data_mode_transmitted
= -1;
66 static int hf_gryphon_data_mode_receive
= -1;
67 static int hf_gryphon_data_mode_local
= -1;
68 static int hf_gryphon_data_mode_remote
= -1;
69 static int hf_gryphon_data_mode_internal
= -1;
70 static int hf_gryphon_data_priority
= -1;
71 static int hf_gryphon_data_error_status
= -1;
72 static int hf_gryphon_data_time
= -1;
73 static int hf_gryphon_data_context
= -1;
74 static int hf_gryphon_data_header_data
= -1;
75 static int hf_gryphon_data_data
= -1;
76 static int hf_gryphon_data_extra_data
= -1;
77 static int hf_gryphon_data_padding
= -1;
78 static int hf_gryphon_event_id
= -1;
79 static int hf_gryphon_event_context
= -1;
80 static int hf_gryphon_event_time
= -1;
81 static int hf_gryphon_event_data
= -1;
82 static int hf_gryphon_event_padding
= -1;
83 static int hf_gryphon_misc_data
= -1;
84 static int hf_gryphon_misc_padding
= -1;
85 static int hf_gryphon_eventnum
= -1;
86 static int hf_gryphon_resp_time
= -1;
87 static int hf_gryphon_setfilt
= -1;
88 static int hf_gryphon_setfilt_length
= -1;
89 static int hf_gryphon_setfilt_discard_data
= -1;
90 static int hf_gryphon_setfilt_padding
= -1;
91 static int hf_gryphon_ioctl
= -1;
92 static int hf_gryphon_ioctl_data
= -1;
93 static int hf_gryphon_addfilt_pass
= -1;
94 static int hf_gryphon_addfilt_active
= -1;
95 static int hf_gryphon_addfilt_blocks
= -1;
96 static int hf_gryphon_addfilt_handle
= -1;
97 static int hf_gryphon_modfilt
= -1;
98 static int hf_gryphon_modfilt_action
= -1;
99 static int hf_gryphon_filthan
= -1;
100 static int hf_gryphon_filthan_id
= -1;
101 static int hf_gryphon_filthan_padding
= -1;
102 static int hf_gryphon_dfiltmode
= -1;
103 static int hf_gryphon_filtmode
= -1;
104 static int hf_gryphon_event_name
= -1;
105 static int hf_gryphon_register_username
= -1;
106 static int hf_gryphon_register_password
= -1;
107 static int hf_gryphon_register_client_id
= -1;
108 static int hf_gryphon_register_privileges
= -1;
109 static int hf_gryphon_getspeeds_set_ioctl
= -1;
110 static int hf_gryphon_getspeeds_get_ioctl
= -1;
111 static int hf_gryphon_getspeeds_size
= -1;
112 static int hf_gryphon_getspeeds_preset
= -1;
113 static int hf_gryphon_getspeeds_data
= -1;
114 static int hf_gryphon_cmd_sort
= -1;
115 static int hf_gryphon_cmd_optimize
= -1;
116 static int hf_gryphon_config_device_name
= -1;
117 static int hf_gryphon_config_device_version
= -1;
118 static int hf_gryphon_config_device_serial_number
= -1;
119 static int hf_gryphon_config_num_channels
= -1;
120 static int hf_gryphon_config_name_version_ext
= -1;
121 static int hf_gryphon_config_driver_name
= -1;
122 static int hf_gryphon_config_driver_version
= -1;
123 static int hf_gryphon_config_device_security
= -1;
124 static int hf_gryphon_config_max_data_length
= -1;
125 static int hf_gryphon_config_min_data_length
= -1;
126 static int hf_gryphon_config_hardware_serial_number
= -1;
127 static int hf_gryphon_config_protocol_type
= -1;
128 static int hf_gryphon_config_channel_id
= -1;
129 static int hf_gryphon_config_card_slot_number
= -1;
130 static int hf_gryphon_config_max_extra_data
= -1;
131 static int hf_gryphon_config_min_extra_data
= -1;
132 static int hf_gryphon_sched_num_iterations
= -1;
133 static int hf_gryphon_sched_flags
= -1;
134 static int hf_gryphon_sched_flags_scheduler
= -1;
135 static int hf_gryphon_sched_sleep
= -1;
136 static int hf_gryphon_sched_transmit_count
= -1;
137 static int hf_gryphon_sched_transmit_period
= -1;
138 static int hf_gryphon_sched_transmit_flags
= -1;
139 static int hf_gryphon_sched_skip_transmit_period
= -1;
140 static int hf_gryphon_sched_skip_sleep
= -1;
141 static int hf_gryphon_sched_channel
= -1;
142 static int hf_gryphon_sched_rep_id
= -1;
143 static int hf_gryphon_sched_rep_message_index
= -1;
144 static int hf_gryphon_blm_data_time
= -1;
145 static int hf_gryphon_blm_data_bus_load
= -1;
146 static int hf_gryphon_blm_data_current_bus_load
= -1;
147 static int hf_gryphon_blm_data_peak_bus_load
= -1;
148 static int hf_gryphon_blm_data_historic_peak_bus_load
= -1;
149 static int hf_gryphon_blm_stat_receive_frame_count
= -1;
150 static int hf_gryphon_blm_stat_transmit_frame_count
= -1;
151 static int hf_gryphon_blm_stat_receive_dropped_frame_count
= -1;
152 static int hf_gryphon_blm_stat_transmit_dropped_frame_count
= -1;
153 static int hf_gryphon_blm_stat_receive_error_count
= -1;
154 static int hf_gryphon_blm_stat_transmit_error_count
= -1;
155 static int hf_gryphon_addresp_flags
= -1;
156 static int hf_gryphon_addresp_flags_active
= -1;
157 static int hf_gryphon_addresp_blocks
= -1;
158 static int hf_gryphon_addresp_responses
= -1;
159 static int hf_gryphon_addresp_old_handle
= -1;
160 static int hf_gryphon_addresp_action
= -1;
161 static int hf_gryphon_addresp_action_period
= -1;
162 static int hf_gryphon_addresp_action_deact_on_event
= -1;
163 static int hf_gryphon_addresp_action_deact_after_period
= -1;
164 static int hf_gryphon_addresp_action_period_type
= -1;
165 static int hf_gryphon_addresp_handle
= -1;
166 static int hf_gryphon_modresp_handle
= -1;
167 static int hf_gryphon_modresp_action
= -1;
168 static int hf_gryphon_num_resphan
= -1;
169 static int hf_gryphon_transmit_sched_id
= -1;
170 static int hf_gryphon_desc_program_size
= -1;
171 static int hf_gryphon_desc_program_name
= -1;
172 static int hf_gryphon_desc_program_description
= -1;
173 static int hf_gryphon_desc_flags
= -1;
174 static int hf_gryphon_desc_flags_program
= -1;
175 static int hf_gryphon_desc_handle
= -1;
176 static int hf_gryphon_upload_block_number
= -1;
177 static int hf_gryphon_upload_handle
= -1;
178 static int hf_gryphon_upload_data
= -1;
179 static int hf_gryphon_delete
= -1;
180 static int hf_gryphon_list_block_number
= -1;
181 static int hf_gryphon_list_num_programs
= -1;
182 static int hf_gryphon_list_num_remain_programs
= -1;
183 static int hf_gryphon_list_name
= -1;
184 static int hf_gryphon_list_description
= -1;
185 static int hf_gryphon_start_arguments
= -1;
186 static int hf_gryphon_start_channel
= -1;
187 static int hf_gryphon_status_num_running_copies
= -1;
188 static int hf_gryphon_options_handle
= -1;
189 static int hf_gryphon_files
= -1;
190 static int hf_gryphon_usdt_flags_register
= -1;
191 static int hf_gryphon_usdt_action_flags
= -1;
192 static int hf_gryphon_usdt_action_flags_register
= -1;
193 static int hf_gryphon_usdt_action_flags_action
= -1;
194 static int hf_gryphon_usdt_transmit_options_flags
= -1;
195 static int hf_gryphon_usdt_transmit_options_flags_echo
= -1;
196 static int hf_gryphon_usdt_transmit_options_action
= -1;
197 static int hf_gryphon_usdt_transmit_options_send_done
= -1;
198 static int hf_gryphon_usdt_receive_options_flags
= -1;
199 static int hf_gryphon_usdt_receive_options_action
= -1;
200 static int hf_gryphon_usdt_receive_options_firstframe
= -1;
201 static int hf_gryphon_usdt_receive_options_lastframe
= -1;
202 static int hf_gryphon_usdt_ext_address
= -1;
203 static int hf_gryphon_usdt_ext_address_id
= -1;
204 static int hf_gryphon_usdt_block_size
= -1;
205 static int hf_gryphon_bits_in_input1
= -1;
206 static int hf_gryphon_bits_in_input2
= -1;
207 static int hf_gryphon_bits_in_input3
= -1;
208 static int hf_gryphon_bits_in_pushbutton
= -1;
209 static int hf_gryphon_bits_out_output1
= -1;
210 static int hf_gryphon_bits_out_output2
= -1;
211 static int hf_gryphon_init_strat_reset_limit
= -1;
212 static int hf_gryphon_init_strat_delay
= -1;
213 static int hf_gryphon_speed_baud_rate_index
= -1;
214 static int hf_gryphon_filter_block_filter_start
= -1;
215 static int hf_gryphon_filter_block_filter_length
= -1;
216 static int hf_gryphon_filter_block_filter_type
= -1;
217 static int hf_gryphon_filter_block_filter_operator
= -1;
218 static int hf_gryphon_filter_block_filter_value1
= -1;
219 static int hf_gryphon_filter_block_filter_value2
= -1;
220 static int hf_gryphon_filter_block_filter_value4
= -1;
221 static int hf_gryphon_filter_block_filter_value_bytes
= -1;
222 static int hf_gryphon_blm_mode
= -1;
223 static int hf_gryphon_blm_mode_avg_period
= -1;
224 static int hf_gryphon_blm_mode_avg_frames
= -1;
226 static gint ett_gryphon
= -1;
227 static gint ett_gryphon_header
= -1;
228 static gint ett_gryphon_body
= -1;
229 static gint ett_gryphon_command_data
= -1;
230 static gint ett_gryphon_response_data
= -1;
231 static gint ett_gryphon_data_header
= -1;
232 static gint ett_gryphon_flags
= -1;
233 static gint ett_gryphon_data_body
= -1;
234 static gint ett_gryphon_cmd_filter_block
= -1;
235 static gint ett_gryphon_cmd_events_data
= -1;
236 static gint ett_gryphon_cmd_config_device
= -1;
237 static gint ett_gryphon_cmd_sched_data
= -1;
238 static gint ett_gryphon_cmd_sched_cmd
= -1;
239 static gint ett_gryphon_cmd_response_block
= -1;
240 static gint ett_gryphon_pgm_list
= -1;
241 static gint ett_gryphon_pgm_status
= -1;
242 static gint ett_gryphon_pgm_options
= -1;
243 static gint ett_gryphon_valid_headers
= -1;
244 static gint ett_gryphon_usdt_data
= -1;
245 static gint ett_gryphon_usdt_data_block
= -1;
246 static gint ett_gryphon_digital_data
= -1;
247 static gint ett_gryphon_blm_mode
= -1;
249 /* desegmentation of Gryphon */
250 static gboolean gryphon_desegment
= TRUE
;
252 static void dissect_gryphon_message(tvbuff_t
*tvb
, packet_info
*pinfo
,
253 proto_tree
*tree
, gboolean is_msgresp_add
);
254 static int decode_command(tvbuff_t
*, int, int, proto_tree
*);
255 static int decode_response(tvbuff_t
*, int, int, proto_tree
*);
256 static int decode_data(tvbuff_t
*, int, proto_tree
*);
257 static int decode_event(tvbuff_t
*, int, proto_tree
*);
258 static int decode_misc(tvbuff_t
*, int, proto_tree
*);
259 static int cmd_init(tvbuff_t
*, int, proto_tree
*);
260 static int resp_time(tvbuff_t
*, int, proto_tree
*);
261 static int cmd_setfilt(tvbuff_t
*, int, proto_tree
*);
262 static int cmd_ioctl(tvbuff_t
*, int, proto_tree
*);
263 static int cmd_addfilt(tvbuff_t
*, int, proto_tree
*);
264 static int resp_addfilt(tvbuff_t
*, int, proto_tree
*);
265 static int cmd_modfilt(tvbuff_t
*, int, proto_tree
*);
266 static int resp_filthan(tvbuff_t
*, int, proto_tree
*);
267 static int dfiltmode(tvbuff_t
*, int, proto_tree
*);
268 static int filtmode(tvbuff_t
*, int, proto_tree
*);
269 static int resp_events(tvbuff_t
*, int, proto_tree
*);
270 static int cmd_register(tvbuff_t
*, int, proto_tree
*);
271 static int resp_register(tvbuff_t
*, int, proto_tree
*);
272 static int resp_getspeeds(tvbuff_t
*, int, proto_tree
*);
273 static int cmd_sort(tvbuff_t
*, int, proto_tree
*);
274 static int cmd_optimize(tvbuff_t
*, int, proto_tree
*);
275 static int resp_config(tvbuff_t
*, int, proto_tree
*);
276 static int cmd_sched(tvbuff_t
*, int, proto_tree
*);
277 static int cmd_sched_rep(tvbuff_t
*, int, proto_tree
*);
278 static int resp_blm_data(tvbuff_t
*, int, proto_tree
*);
279 static int resp_blm_stat(tvbuff_t
*, int, proto_tree
*);
280 static int cmd_addresp(tvbuff_t
*, int, proto_tree
*);
281 static int resp_addresp(tvbuff_t
*, int, proto_tree
*);
282 static int cmd_modresp(tvbuff_t
*, int, proto_tree
*);
283 static int resp_resphan(tvbuff_t
*, int, proto_tree
*);
284 static int resp_sched(tvbuff_t
*, int, proto_tree
*);
285 static int cmd_desc(tvbuff_t
*, int, proto_tree
*);
286 static int resp_desc(tvbuff_t
*, int, proto_tree
*);
287 static int cmd_upload(tvbuff_t
*, int, proto_tree
*);
288 static int cmd_delete(tvbuff_t
*, int, proto_tree
*);
289 static int cmd_list(tvbuff_t
*, int, proto_tree
*);
290 static int resp_list(tvbuff_t
*, int, proto_tree
*);
291 static int cmd_start(tvbuff_t
*, int, proto_tree
*);
292 static int resp_start(tvbuff_t
*, int, proto_tree
*);
293 static int resp_status(tvbuff_t
*, int, proto_tree
*);
294 static int cmd_options(tvbuff_t
*, int, proto_tree
*);
295 static int cmd_files(tvbuff_t
*, int, proto_tree
*);
296 static int resp_files(tvbuff_t
*, int, proto_tree
*);
297 static int eventnum(tvbuff_t
*, int, proto_tree
*);
298 static int speed(tvbuff_t
*, int, proto_tree
*);
299 static int filter_block(tvbuff_t
*, int, proto_tree
*);
300 static int blm_mode(tvbuff_t
*, int, proto_tree
*);
301 static int cmd_usdt(tvbuff_t
*, int, proto_tree
*);
302 static int cmd_bits_in(tvbuff_t
*, int, proto_tree
*);
303 static int cmd_bits_out(tvbuff_t
*, int, proto_tree
*);
304 static int cmd_init_strat(tvbuff_t
*, int, proto_tree
*);
308 static const value_string action_vals
[] = {
309 { FR_RESP_AFTER_EVENT
,
310 "Send response(s) for each conforming message" },
311 { FR_RESP_AFTER_PERIOD
,
312 "Send response(s) after the specified period expires following a conforming message" },
313 { FR_IGNORE_DURING_PER
,
314 "Send response(s) for a conforming message and ignore\nfurther messages until the specified period expires" },
319 static const value_string deact_on_event_vals
[] = {
321 "Deactivate this response for a conforming message" },
322 { FR_DELETE
|FR_DEACT_ON_EVENT
,
323 "Delete this response for a conforming message" },
328 static const value_string deact_after_per_vals
[] = {
329 { FR_DEACT_AFTER_PER
,
330 "Deactivate this response after the specified period following a conforming message" },
331 { FR_DELETE
|FR_DEACT_AFTER_PER
,
332 "Delete this response after the specified period following a conforming message" },
337 static const value_string cmd_optimize_type
[] = {
338 {0, "Optimize for throughput (Nagle algorithm enabled)"},
339 {1, "Optimize for latency (Nagle algorithm disabled)"},
343 static const value_string usdt_action_vals
[] = {
344 { 0, "Use 11 bit headers only" },
345 { 1, "Use 29 bit headers only" },
346 { 2, "Use both 11 & 29 bit headers" },
351 static const value_string xmit_opt_vals
[] = {
352 { 0, "Pad messages with less than 8 data bytes with 0x00's" },
353 { 1, "Pad messages with less than 8 data bytes with 0xFF's" },
354 { 2, "Do not pad messages with less than 8 data bytes" },
359 static const value_string recv_opt_vals
[] = {
360 { 0, "Do not verify the integrity of long received messages and do not send them to the client" },
361 { 1, "Verify the integrity of long received messages and send them to the client" },
362 { 2, "Verify the integrity of long received messages but do not send them to the client" },
367 static const value_string register_unregister
[] = {
373 static const value_string blm_mode_vals
[] = {
375 { 1, "Average over time" },
376 { 2, "Average over frame count" },
380 static const value_string dmodes
[] = {
381 {DEFAULT_FILTER_BLOCK
, "Block"},
382 {DEFAULT_FILTER_PASS
, "Pass"},
386 static const value_string frame_type
[] = {
388 {1, "Command request"},
389 {2, "Command response"},
390 {3, "Network (vehicle) data"},
392 {5, "Miscellaneous"},
397 static const value_string src_dest
[] = {
399 {SD_SERVER
, "Server"},
400 {SD_CLIENT
, "Client"},
401 {SD_SCHED
, "Scheduler"},
402 {SD_SCRIPT
, "Script Processor"},
403 {SD_PGM
, "Program Loader"},
404 {SD_USDT
, "USDT Server"},
405 {SD_BLM
, "Bus Load Monitoring"},
406 {SD_FLIGHT
, "Flight Recorder"},
407 {SD_RESP
, "Message Responder"},
408 {SD_IOPWR
, "I/O and power"},
409 {SD_UTIL
, "Utility/Miscellaneous"},
414 static const val_str_dsp cmds
[] = {
415 {CMD_INIT
, "Initialize" , cmd_init
, NULL
},
416 {CMD_GET_STAT
, "Get status" , NULL
, NULL
},
417 {CMD_GET_CONFIG
, "Get configuration" , NULL
, resp_config
},
418 {CMD_EVENT_ENABLE
, "Enable event" , eventnum
, NULL
},
419 {CMD_EVENT_DISABLE
, "Disable event" , eventnum
, NULL
},
420 {CMD_GET_TIME
, "Get time" , NULL
, resp_time
},
421 {CMD_SET_TIME
, "Set time" , resp_time
, NULL
},
422 {CMD_GET_RXDROP
, "Get number of dropped RX messages" , NULL
, NULL
},
423 {CMD_RESET_RXDROP
, "Clear number of dropped RX messages" , NULL
, NULL
},
424 {CMD_BCAST_ON
, "Set broadcasts on" , NULL
, NULL
},
425 {CMD_BCAST_OFF
, "Set broadcasts off" , NULL
, NULL
},
426 {CMD_CARD_SET_SPEED
, "Set channel baud rate" , speed
, NULL
},
427 {CMD_CARD_GET_SPEED
, "Get channel baud rate" , NULL
, speed
},
428 {CMD_CARD_SET_FILTER
, "Set filter (deprecated)" , cmd_setfilt
, NULL
},
429 {CMD_CARD_GET_FILTER
, "Get filter" , resp_addfilt
, cmd_addfilt
},
430 {CMD_CARD_TX
, "Transmit message" , decode_data
, NULL
},
431 {CMD_CARD_TX_LOOP_ON
, "Set transmit loopback on" , NULL
, NULL
},
432 {CMD_CARD_TX_LOOP_OFF
, "Set transmit loopback off" , NULL
, NULL
},
433 {CMD_CARD_IOCTL
, "IOCTL pass-through" , cmd_ioctl
, NULL
},
434 {CMD_CARD_ADD_FILTER
, "Add a filter" , cmd_addfilt
, resp_addfilt
},
435 {CMD_CARD_MODIFY_FILTER
, "Modify a filter" , cmd_modfilt
, NULL
},
436 {CMD_CARD_GET_FILTER_HANDLES
, "Get filter handles" , NULL
, resp_filthan
},
437 {CMD_CARD_SET_DEFAULT_FILTER
, "Set default filter" , dfiltmode
, NULL
},
438 {CMD_CARD_GET_DEFAULT_FILTER
, "Get default filter mode" , NULL
, dfiltmode
},
439 {CMD_CARD_SET_FILTER_MODE
, "Set filter mode" , filtmode
, NULL
},
440 {CMD_CARD_GET_FILTER_MODE
, "Get filter mode" , NULL
, filtmode
},
441 {CMD_CARD_GET_EVNAMES
, "Get event names" , NULL
, resp_events
},
442 {CMD_CARD_GET_SPEEDS
, "Get defined speeds" , NULL
, resp_getspeeds
},
443 {CMD_SERVER_REG
, "Register with server" , cmd_register
, resp_register
},
444 {CMD_SERVER_SET_SORT
, "Set the sorting behavior" , cmd_sort
, NULL
},
445 {CMD_SERVER_SET_OPT
, "Set the type of optimization" , cmd_optimize
, NULL
},
446 {CMD_BLM_SET_MODE
, "Set Bus Load Monitoring mode" , blm_mode
, NULL
},
447 {CMD_BLM_GET_MODE
, "Get Bus Load Monitoring mode" , NULL
, blm_mode
},
448 {CMD_BLM_GET_DATA
, "Get Bus Load data" , NULL
, resp_blm_data
},
449 {CMD_BLM_GET_STATS
, "Get Bus Load statistics" , NULL
, resp_blm_stat
},
450 {CMD_FLIGHT_GET_CONFIG
, "Get flight recorder channel info" , NULL
, NULL
},
451 {CMD_FLIGHT_START_MON
, "Start flight recorder monitoring" , NULL
, NULL
},
452 {CMD_FLIGHT_STOP_MON
, "Stop flight recorder monitoring" , NULL
, NULL
},
453 {CMD_MSGRESP_ADD
, "Add response message" , cmd_addresp
, resp_addresp
},
454 {CMD_MSGRESP_GET
, "Get response message" , resp_addresp
, cmd_addresp
},
455 {CMD_MSGRESP_MODIFY
, "Modify response message state" , cmd_modresp
, NULL
},
456 {CMD_MSGRESP_GET_HANDLES
, "Get response message handles" , NULL
, resp_resphan
},
457 {CMD_PGM_DESC
, "Describe program to to uploaded" , cmd_desc
, resp_desc
},
458 {CMD_PGM_UPLOAD
, "Upload a program to the Gryphon" , cmd_upload
, NULL
},
459 {CMD_PGM_DELETE
, "Delete an uploaded program" , cmd_delete
, NULL
},
460 {CMD_PGM_LIST
, "Get a list of uploaded programs" , cmd_list
, resp_list
},
461 {CMD_PGM_START
, "Start an uploaded program" , cmd_start
, resp_start
},
462 {CMD_PGM_START2
, "Start an uploaded program" , NULL
, resp_start
},
463 {CMD_PGM_STOP
, "Stop an uploaded program" , resp_start
, NULL
},
464 {CMD_PGM_STATUS
, "Get status of an uploaded program" , cmd_delete
, resp_status
},
465 {CMD_PGM_OPTIONS
, "Set program upload options" , cmd_options
, resp_status
},
466 {CMD_PGM_FILES
, "Get a list of files & directories" , cmd_files
, resp_files
},
467 {CMD_SCHED_TX
, "Schedule transmission of messages" , cmd_sched
, resp_sched
},
468 {CMD_SCHED_KILL_TX
, "Stop and destroy a message transmission" , resp_sched
, NULL
},
469 {CMD_SCHED_STOP_TX
, "Kill a message transmission (deprecated)", resp_sched
, NULL
},
470 {CMD_SCHED_MSG_REPLACE
, "Replace a scheduled message" , cmd_sched_rep
, NULL
},
471 {CMD_USDT_IOCTL
, "Register/Unregister with USDT server" , cmd_usdt
, NULL
},
472 {CMD_USDT_REGISTER
, "Register/Unregister with USDT server" , cmd_usdt
, NULL
},
473 {CMD_USDT_SET_FUNCTIONAL
, "Set IDs to use extended addressing" , cmd_usdt
, NULL
},
474 {CMD_IOPWR_GETINP
, "Read current digital inputs" , NULL
, cmd_bits_in
},
475 {CMD_IOPWR_GETLATCH
, "Read latched digital inputs" , NULL
, cmd_bits_in
},
476 {CMD_IOPWR_CLRLATCH
, "Read & clear latched digital inputs" , cmd_bits_in
, cmd_bits_in
},
477 {CMD_IOPWR_GETOUT
, "Read digital outputs" , NULL
, cmd_bits_out
},
478 {CMD_IOPWR_SETOUT
, "Write digital outputs" , cmd_bits_out
, NULL
},
479 {CMD_IOPWR_SETBIT
, "Set indicated output bits" , cmd_bits_out
, NULL
},
480 {CMD_IOPWR_CLRBIT
, "Clear indicated output bits" , cmd_bits_out
, NULL
},
481 {CMD_IOPWR_GETPOWER
, "Read digital inputs at power on time" , NULL
, cmd_bits_in
},
482 {CMD_UTIL_SET_INIT_STRATEGY
, "Set initialization strategy" , cmd_init_strat
, NULL
},
483 {CMD_UTIL_GET_INIT_STRATEGY
, "Get initialization strategy" , NULL
, cmd_init_strat
},
484 {-1, "- unknown -" , NULL
, NULL
},
487 static const value_string responses_vs
[] = {
488 {RESP_OK
, "OK - no error"},
489 {RESP_UNKNOWN_ERR
, "Unknown error"},
490 {RESP_UNKNOWN_CMD
, "Unrecognised command"},
491 {RESP_UNSUPPORTED
, "Unsupported command"},
492 {RESP_INVAL_CHAN
, "Invalid channel specified"},
493 {RESP_INVAL_DST
, "Invalid destination"},
494 {RESP_INVAL_PARAM
, "Invalid parameter(s)"},
495 {RESP_INVAL_MSG
, "Invalid message"},
496 {RESP_INVAL_LEN
, "Invalid length field"},
497 {RESP_TX_FAIL
, "Transmit failed"},
498 {RESP_RX_FAIL
, "Receive failed"},
499 {RESP_AUTH_FAIL
, "Authorization failed"},
500 {RESP_MEM_ALLOC_ERR
, "Memory allocation error"},
501 {RESP_TIMEOUT
, "Command timed out"},
502 {RESP_UNAVAILABLE
, "Unavailable"},
503 {RESP_BUF_FULL
, "Buffer full"},
504 {RESP_NO_SUCH_JOB
, "No such job"},
508 static const value_string filter_data_types
[] = {
509 {FILTER_DATA_TYPE_HEADER_FRAME
, "frame header"},
510 {FILTER_DATA_TYPE_HEADER
, "data message header"},
511 {FILTER_DATA_TYPE_DATA
, "data message data"},
512 {FILTER_DATA_TYPE_EXTRA_DATA
, "data message extra data"},
513 {FILTER_EVENT_TYPE_HEADER
, "event message header"},
514 {FILTER_EVENT_TYPE_DATA
, "event message"},
518 static const value_string operators
[] = {
519 {BIT_FIELD_CHECK
, "Bit field check"},
520 {SVALUE_GT
, "Greater than (signed)"},
521 {SVALUE_GE
, "Greater than or equal to (signed)"},
522 {SVALUE_LT
, "Less than (signed)"},
523 {SVALUE_LE
, "Less than or equal to (signed)"},
524 {VALUE_EQ
, "Equal to"},
525 {VALUE_NE
, "Not equal to"},
526 {UVALUE_GT
, "Greater than (unsigned)"},
527 {UVALUE_GE
, "Greater than or equal to (unsigned)"},
528 {UVALUE_LT
, "Less than (unsigned)"},
529 {UVALUE_LE
, "Less than or equal to (unsigned)"},
530 {DIG_LOW_TO_HIGH
, "Digital, low to high transistion"},
531 {DIG_HIGH_TO_LOW
, "Digital, high to low transistion"},
532 {DIG_TRANSITION
, "Digital, change of state"},
536 static const value_string modes
[] = {
537 {FILTER_OFF_PASS_ALL
, "Filter off, pass all messages"},
538 {FILTER_OFF_BLOCK_ALL
, "Filter off, block all messages"},
539 {FILTER_ON
, "Filter on"},
543 static const value_string filtacts
[] = {
544 {DELETE_FILTER
, "Delete"},
545 {ACTIVATE_FILTER
, "Activate"},
546 {DEACTIVATE_FILTER
, "Deactivate"},
550 static const value_string ioctls
[] = {
551 {GINIT
, "GINIT: Initialize"},
552 {GLOOPON
, "GLOOPON: Loop on"},
553 {GLOOPOFF
, "GLOOPOFF: Loop off"},
554 {GGETHWTYPE
, "GGETHWTYPE: Get hardware type"},
555 {GGETREG
, "GGETREG: Get register"},
556 {GSETREG
, "GSETREG: Set register"},
557 {GGETRXCOUNT
, "GGETRXCOUNT: Get the receive message counter"},
558 {GSETRXCOUNT
, "GSETRXCOUNT: Set the receive message counter"},
559 {GGETTXCOUNT
, "GGETTXCOUNT: Get the transmit message counter"},
560 {GSETTXCOUNT
, "GSETTXCOUNT: Set the transmit message counter"},
561 {GGETRXDROP
, "GGETRXDROP: Get the number of dropped receive messages"},
562 {GSETRXDROP
, "GSETRXDROP: Set the number of dropped receive messages"},
563 {GGETTXDROP
, "GGETTXDROP: Get the number of dropped transmit messages"},
564 {GSETTXDROP
, "GSETTXDROP: Set the number of dropped transmit messages"},
565 {GGETRXBAD
, "GGETRXBAD: Get the number of bad receive messages"},
566 {GGETTXBAD
, "GGETTXBAD: Get the number of bad transmit messages"},
567 {GGETCOUNTS
, "GGETCOUNTS: Get total message counter"},
568 {GGETBLMON
, "GGETBLMON: Get bus load monitoring status"},
569 {GSETBLMON
, "GSETBLMON: Set bus load monitoring status (turn on/off)"},
570 {GGETERRLEV
, "GGETERRLEV: Get error level"},
571 {GSETERRLEV
, "GSETERRLEV: Set error level"},
572 {GGETBITRATE
, "GGETBITRATE: Get bit rate"},
573 {GGETRAM
, "GGETRAM: Read value from RAM"},
574 {GSETRAM
, "GSETRAM: Write value to RAM"},
575 {GCANGETBTRS
, "GCANGETBTRS: Read CAN bit timing registers"},
576 {GCANSETBTRS
, "GCANSETBTRS: Write CAN bit timing registers"},
577 {GCANGETBC
, "GCANGETBC: Read CAN bus configuration register"},
578 {GCANSETBC
, "GCANSETBC: Write CAN bus configuration register"},
579 {GCANGETMODE
, "GCANGETMODE"},
580 {GCANSETMODE
, "GCANSETMODE"},
581 {GCANGETTRANS
, "GCANGETTRANS"},
582 {GCANSETTRANS
, "GCANSETTRANS"},
583 {GCANSENDERR
, "GCANSENDERR"},
584 {GCANRGETOBJ
, "GCANRGETOBJ"},
585 {GCANRSETSTDID
, "GCANRSETSTDID"},
586 {GCANRSETEXTID
, "GCANRSETEXTID"},
587 {GCANRSETDATA
, "GCANRSETDATA"},
588 {GCANRENABLE
, "GCANRENABLE"},
589 {GCANRDISABLE
, "GCANRDISABLE"},
590 {GCANRGETMASKS
, "GCANRGETMASKS"},
591 {GCANRSETMASKS
, "GCANRSETMASKS"},
592 {GCANSWGETMODE
, "GCANSWGETMODE"},
593 {GCANSWSETMODE
, "GCANSWSETMODE"},
594 {GDLCGETFOURX
, "GDLCGETFOURX"},
595 {GDLCSETFOURX
, "GDLCSETFOURX"},
596 {GDLCGETLOAD
, "GDLCGETLOAD"},
597 {GDLCSETLOAD
, "GDLCSETLOAD"},
598 {GDLCSENDBREAK
, "GDLCSENDBREAK"},
599 {GDLCABORTTX
, "GDLCABORTTX"},
600 {GDLCGETHDRMODE
, "DLCGETHDRMODE"},
601 {GDLCSETHDRMODE
, "GDLCSETHDRMODE"},
602 {GHONSLEEP
, "GHONSLEEP"},
603 {GHONSILENCE
, "GHONSILENCE"},
604 {GKWPSETPTIMES
, "GKWPSETPTIMES"},
605 {GKWPSETWTIMES
, "GKWPSETWTIMES"},
606 {GKWPDOWAKEUP
, "GKWPDOWAKEUP"},
607 {GKWPGETBITTIME
, "GKWPGETBITTIME"},
608 {GKWPSETBITTIME
, "GKWPSETBITTIME"},
609 {GKWPSETNODEADDR
, "GKWPSETNODEADDR"},
610 {GKWPGETNODETYPE
, "GKWPGETNODETYPE"},
611 {GKWPSETNODETYPE
, "GKWPSETNODETYPE"},
612 {GKWPSETWAKETYPE
, "GKWPSETWAKETYPE"},
613 {GKWPSETTARGADDR
, "GKWPSETTARGADDR"},
614 {GKWPSETKEYBYTES
, "GKWPSETKEYBYTES"},
615 {GKWPSETSTARTREQ
, "GKWPSETSTARTREQ"},
616 {GKWPSETSTARTRESP
, "GKWPSETSTARTRESP"},
617 {GKWPSETPROTOCOL
, "GKWPSETPROTOCOL"},
618 {GKWPGETLASTKEYBYTES
, "GKWPGETLASTKEYBYTES"},
619 {GKWPSETLASTKEYBYTES
, "GKWPSETLASTKEYBYTES"},
620 {GSCPGETBBR
, "GSCPGETBBR"},
621 {GSCPSETBBR
, "GSCPSETBBR"},
622 {GSCPGETID
, "GSCPGETID"},
623 {GSCPSETID
, "GSCPSETID"},
624 {GSCPADDFUNCID
, "GSCPADDFUNCID"},
625 {GSCPCLRFUNCID
, "GSCPCLRFUNCID"},
626 {GUBPGETBITRATE
, "GUBPGETBITRATE"},
627 {GUBPSETBITRATE
, "GUBPSETBITRATE"},
628 {GUBPGETINTERBYTE
, "GUBPGETINTERBYTE"},
629 {GUBPSETINTERBYTE
, "GUBPSETINTERBYTE"},
630 {GUBPGETNACKMODE
, "GUBPGETNACKMODE"},
631 {GUBPSETNACKMODE
, "GUBPSETNACKMODE"},
632 {GUBPGETRETRYDELAY
, "GUBPGETRETRYDELAY"},
633 {GUBPSETRETRYDELAY
, "GUBPSETRETRYDELAY"},
634 {GRESETHC08
, "GRESETHC08: Reset the HC08 processor"},
635 {GTESTHC08COP
, "GTESTHC08COP: Stop updating the HC08 watchdog timer"},
636 {GSJAGETLISTEN
, "GSJAGETLISTEN"},
637 {GSJASETLISTEN
, "GSJASETLISTEN"},
638 {GSJAGETSELFTEST
, "GSJAGETSELFTEST"},
639 {GSJASETSELFTEST
, "GSJASETSELFTEST"},
640 {GSJAGETXMITONCE
, "GSJAGETXMITONCE"},
641 {GSJASETXMITONCE
, "GSJASETXMITONCE"},
642 {GSJAGETTRIGSTATE
, "GSJAGETTRIGSTATE"},
643 {GSJASETTRIGCTRL
, "GSJASETTRIGCTRL"},
644 {GSJAGETTRIGCTRL
, "GSJAGETTRIGCTRL"},
645 {GSJAGETOUTSTATE
, "GSJAGETOUTSTATE"},
646 {GSJASETOUTSTATE
, "GSJASETOUTSTATE"},
647 {GSJAGETFILTER
, "GSJAGETFILTER"},
648 {GSJASETFILTER
, "GSJASETFILTER"},
649 {GSJAGETMASK
, "GSJAGETMASK"},
650 {GSJASETMASK
, "GSJASETMASK"},
651 {GSJAGETINTTERM
, "GSJAGETINTTERM"},
652 {GSJASETINTTERM
, "GSJASETINTTERM"},
653 {GSJAGETFTTRANS
, "GSJAGETFTTRANS"},
654 {GSJASETFTTRANS
, "GSJASETFTTRANS"},
655 {GSJAGETFTERROR
, "GSJAGETFTERROR"},
656 {GLINGETBITRATE
, "GLINGETBITRATE: Get the current bit rate"},
657 {GLINSETBITRATE
, "GLINSETBITRATE: Set the bit rate"},
658 {GLINGETBRKSPACE
, "GLINGETBRKSPACE"},
659 {GLINSETBRKSPACE
, "GLINSETBRKSPACE"},
660 {GLINGETBRKMARK
, "GLINGETBRKMARK"},
661 {GLINSETBRKMARK
, "GLINSETBRKMARK"},
662 {GLINGETIDDELAY
, "GLINGETIDDELAY"},
663 {GLINSETIDDELAY
, "GLINSETIDDELAY"},
664 {GLINGETRESPDELAY
, "GLINGETRESPDELAY"},
665 {GLINSETRESPDELAY
, "GLINSETRESPDELAY"},
666 {GLINGETINTERBYTE
, "GLINGETINTERBYTE"},
667 {GLINSETINTERBYTE
, "GLINSETINTERBYTE"},
668 {GLINGETWAKEUPDELAY
, "GLINGETWAKEUPDELAY"},
669 {GLINSETWAKEUPDELAY
, "GLINSETWAKEUPDELAY"},
670 {GLINGETWAKEUPTIMEOUT
, "GLINGETWAKEUPTIMEOUT"},
671 {GLINSETWAKEUPTIMEOUT
, "GLINSETWAKEUPTIMEOUT"},
672 {GLINGETWUTIMOUT3BR
, "GLINGETWUTIMOUT3BR"},
673 {GLINSETWUTIMOUT3BR
, "GLINSETWUTIMOUT3BR"},
674 {GLINSENDWAKEUP
, "GLINSENDWAKEUP"},
675 {GLINGETMODE
, "GLINGETMODE"},
676 {GLINSETMODE
, "GLINSETMODE"},
677 {GINPGETINP
, "GINPGETINP: Read current digital inputs"},
678 {GINPGETLATCH
, "GINPGETLATCH: Read latched digital inputs"},
679 {GINPCLRLATCH
, "GINPCLRLATCH: Read and clear latched digital inputs"},
680 {GOUTGET
, "GOUTGET: Read digital outputs"},
681 {GOUTSET
, "GOUTSET: Write digital outputs"},
682 {GOUTSETBIT
, "GOUTSETBIT: Set digital output bits"},
683 {GOUTCLEARBIT
, "GOUTCLEARBIT"},
684 {GPWRGETWHICH
, "GPWRGETWHICH"},
685 {GPWROFF
, "GPWROFF"},
686 {GPWROFFRESET
, "GPWROFFRESET"},
687 {GPWRRESET
, "GPWRRESET"},
692 static const value_string cmd_sort_type
[] = {
693 {0, "Do not sort messages"},
694 {1, "Sort into blocks of up to 16 messages"},
698 static const value_string protocol_types
[] = {
699 {GDUMMY
* 256 + GDGDMARKONE
, "Dummy device driver"},
700 {GCAN
* 256 + G82527
, "CAN, 82527 subtype"},
701 {GCAN
* 256 + GSJA1000
, "CAN, SJA1000 subtype"},
702 {GCAN
* 256 + G82527SW
, "CAN, 82527 single wire subtype"},
703 {GCAN
* 256 + G82527ISO11992
, "CAN, 82527 ISO11992 subtype"},
704 {GCAN
* 256 + G82527_SINGLECHAN
, "CAN, Fiber Optic 82527 subtype"},
705 {GCAN
* 256 + G82527SW_SINGLECHAN
, "CAN, Fiber Optic 82527 single wire subtype"},
706 {GCAN
* 256 + G82527ISO11992_SINGLECHAN
, "CAN, Fiber Optic ISO11992 subtype"},
707 {GCAN
* 256 + GSJA1000FT
, "CAN, SJA1000 Fault Tolerant subtype"},
708 {GCAN
* 256 + GSJA1000C
, "CAN, SJA1000 onboard subtype"},
709 {GCAN
* 256 + GSJA1000FT_FO
, "CAN, SJA1000 Fiber Optic Fault Tolerant subtype"},
710 {GJ1850
* 256 + GHBCCPAIR
, "J1850, HBCC subtype"},
711 {GJ1850
* 256 + GDLC
, "J1850, GM DLC subtype"},
712 {GJ1850
* 256 + GCHRYSLER
, "J1850, Chrysler subtype"},
713 {GJ1850
* 256 + GDEHC12
, "J1850, DE HC12 KWP/BDLC subtype"},
714 {GKWP2000
* 256 + GDEHC12KWP
, "Keyword protocol 2000/ISO 9141"},
715 {GHONDA
* 256 + GDGHC08
, "Honda UART, DG HC08 subtype"},
716 {GFORDUBP
* 256 + GDGUBP08
, "Ford UBP, DG HC08 subtype"},
717 {GSCI
* 256 + G16550SCI
, "Chrysler SCI, UART subtype"},
718 {GCCD
* 256 + G16550CDP68HC68
, "Chrysler C2D, UART / CDP68HC68S1 subtype"},
719 {GLIN
* 256 + GDGLIN08
, "LIN, DG HC08 subtype"},
723 static const true_false_string tfs_wait_response
= { "Wait", "Don't Wait" };
724 static const true_false_string true_false
= { "True", "False" };
725 static const true_false_string tfs_passed_blocked
= { "Pass", "Block" };
726 static const true_false_string active_inactive
= { "Active", "Inactive" };
727 static const true_false_string critical_normal
= { "Critical", "Normal" };
728 static const true_false_string skip_not_skip
= { "Skip", "Do not skip" };
729 static const true_false_string frames_01seconds
= { "Frames", "0.01 seconds" };
730 static const true_false_string present_not_present
= { "Present", "Not present" };
731 static const true_false_string yes_no
= { "Yes", "No" };
732 static const true_false_string set_not_set
= { "Set", "Not set" };
735 * Length of the frame header.
737 #define FRAME_HEADER_LEN 8
740 get_gryphon_pdu_len(packet_info
*pinfo _U_
, tvbuff_t
*tvb
, int offset
)
746 * Get the length of the Gryphon packet, and then get the length as
747 * padded to a 4-byte boundary.
749 plen
= tvb_get_ntohs(tvb
, offset
+ 4);
750 padded_len
= plen
+ 3 - (plen
+ 3) % 4;
753 * That length doesn't include the fixed-length part of the header;
756 return padded_len
+ FRAME_HEADER_LEN
;
760 dissect_gryphon_pdu(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
762 dissect_gryphon_message(tvb
, pinfo
, tree
, FALSE
);
763 return tvb_length(tvb
);
767 dissect_gryphon(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data
)
769 tcp_dissect_pdus(tvb
, pinfo
, tree
, gryphon_desegment
, FRAME_HEADER_LEN
,
770 get_gryphon_pdu_len
, dissect_gryphon_pdu
, data
);
771 return tvb_length(tvb
);
775 dissect_gryphon_message(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
776 gboolean is_msgresp_add
)
779 proto_tree
*gryphon_tree
;
781 proto_tree
*header_tree
, *body_tree
, *local_tree
;
782 proto_item
*header_item
, *body_item
, *local_item
;
785 unsigned int src
, dest
, i
, frmtyp
;
788 if (!is_msgresp_add
) {
789 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "Gryphon");
790 col_clear(pinfo
->cinfo
, COL_INFO
);
793 if (!is_msgresp_add
) {
794 ti
= proto_tree_add_item(tree
, proto_gryphon
, tvb
, 0, -1, ENC_NA
);
795 gryphon_tree
= proto_item_add_subtree(ti
, ett_gryphon
);
799 src
= tvb_get_guint8(tvb
, offset
+ 0);
800 dest
= tvb_get_guint8(tvb
, offset
+ 2);
801 msglen
= tvb_get_ntohs(tvb
, offset
+ 4);
802 flags
= tvb_get_guint8(tvb
, offset
+ 6);
803 frmtyp
= flags
& ~RESPONSE_FLAGS
;
805 if (!is_msgresp_add
) {
807 * This tvbuff includes padding to make its length a multiple
808 * of 4 bytes; set it to the actual length.
810 set_actual_length(tvb
, msglen
+ FRAME_HEADER_LEN
);
813 * Indicate what kind of message this is.
815 col_set_str(pinfo
->cinfo
, COL_INFO
, val_to_str(frmtyp
, frame_type
, "- Invalid -"));
821 if (try_val_to_str(frmtyp
, frame_type
) == NULL
) {
823 * Unknown message type.
825 proto_tree_add_item(gryphon_tree
, hf_gryphon_data
, tvb
, offset
, msglen
, ENC_NA
);
829 header_item
= proto_tree_add_text(gryphon_tree
, tvb
, offset
, MSG_HDR_SZ
, "Header");
830 header_tree
= proto_item_add_subtree(header_item
, ett_gryphon_header
);
832 proto_tree_add_item(header_tree
, hf_gryphon_src
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
833 proto_tree_add_item(header_tree
, hf_gryphon_srcchan
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
835 proto_tree_add_item(header_tree
, hf_gryphon_dest
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
836 proto_tree_add_item(header_tree
, hf_gryphon_destchan
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
838 proto_tree_add_item(header_tree
, hf_gryphon_data_length
, tvb
, offset
+4, 2, ENC_BIG_ENDIAN
);
839 proto_tree_add_item(header_tree
, hf_gryphon_type
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
841 if (is_msgresp_add
) {
842 local_item
= proto_tree_add_text(header_tree
, tvb
, offset
+6, 1, "Flags");
843 local_tree
= proto_item_add_subtree (local_item
, ett_gryphon_flags
);
844 proto_tree_add_item(local_tree
, hf_gryphon_wait_resp
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
845 proto_tree_add_item(local_tree
, hf_gryphon_wait_prev_resp
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
847 proto_tree_add_item(header_tree
, hf_gryphon_reserved1
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
849 msgpad
= 3 - (msglen
+ 3) % 4;
850 msgend
= offset
+ msglen
+ msgpad
+ MSG_HDR_SZ
;
852 body_item
= proto_tree_add_text(gryphon_tree
, tvb
, offset
+ MSG_HDR_SZ
,
853 msglen
+ msgpad
, "Body");
854 body_tree
= proto_item_add_subtree(body_item
, ett_gryphon_body
);
856 offset
+= MSG_HDR_SZ
;
859 offset
= decode_command(tvb
, offset
, dest
, body_tree
);
862 offset
= decode_response(tvb
, offset
, src
, body_tree
);
865 offset
= decode_data(tvb
, offset
, body_tree
);
868 offset
= decode_event(tvb
, offset
, body_tree
);
871 offset
= decode_misc (tvb
, offset
, body_tree
);
878 if (offset
< msgend
- msgpad
) {
879 i
= msgend
- msgpad
- offset
;
880 proto_tree_add_item(gryphon_tree
, hf_gryphon_data
, tvb
, offset
, i
, ENC_NA
);
883 if (offset
< msgend
) {
885 proto_tree_add_item(gryphon_tree
, hf_gryphon_padding
, tvb
, offset
, i
, ENC_NA
);
890 decode_command(tvbuff_t
*tvb
, int offset
, int dst
, proto_tree
*pt
)
898 msglen
= tvb_reported_length_remaining(tvb
, offset
);
899 cmd
= tvb_get_guint8(tvb
, offset
);
900 hi
= proto_tree_add_uint(pt
, hf_gryphon_cmd
, tvb
, offset
, 1, cmd
);
901 PROTO_ITEM_SET_HIDDEN(hi
);
905 for (i
= 0; i
< SIZEOF(cmds
); i
++) {
906 if (cmds
[i
].value
== cmd
)
909 if (i
>= SIZEOF(cmds
) && dst
>= SD_KNOWN
) {
910 cmd
= (cmd
& 0xFF) + SD_CARD
* 256;
911 for (i
= 0; i
< SIZEOF(cmds
); i
++) {
912 if (cmds
[i
].value
== cmd
)
916 if (i
>= SIZEOF(cmds
))
917 i
= SIZEOF(cmds
) - 1;
919 proto_tree_add_text (pt
, tvb
, offset
, 4, "Command: %s", cmds
[i
].strptr
);
923 if (cmds
[i
].cmd_fnct
&& msglen
> 0) {
924 ti
= proto_tree_add_text(pt
, tvb
, offset
, -1, "Data: (%d byte%s)",
925 msglen
, msglen
== 1 ? "" : "s");
926 ft
= proto_item_add_subtree(ti
, ett_gryphon_command_data
);
927 offset
= (*(cmds
[i
].cmd_fnct
)) (tvb
, offset
, ft
);
933 decode_response(tvbuff_t
*tvb
, int offset
, int src
, proto_tree
*pt
)
940 msglen
= tvb_reported_length_remaining(tvb
, offset
);
941 cmd
= tvb_get_guint8(tvb
, offset
);
945 for (i
= 0; i
< SIZEOF(cmds
); i
++) {
946 if (cmds
[i
].value
== cmd
)
949 if (i
>= SIZEOF(cmds
) && src
>= SD_KNOWN
) {
950 cmd
= (cmd
& 0xFF) + SD_CARD
* 256;
951 for (i
= 0; i
< SIZEOF(cmds
); i
++) {
952 if (cmds
[i
].value
== cmd
)
956 if (i
>= SIZEOF(cmds
))
957 i
= SIZEOF(cmds
) - 1;
958 proto_tree_add_text (pt
, tvb
, offset
, 4, "Command: %s", cmds
[i
].strptr
);
962 proto_tree_add_item(pt
, hf_gryphon_status
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
966 if (cmds
[i
].rsp_fnct
&& msglen
> 0) {
967 ti
= proto_tree_add_text(pt
, tvb
, offset
, msglen
, "Data: (%d byte%s)",
968 msglen
, msglen
== 1 ? "" : "s");
969 ft
= proto_item_add_subtree(ti
, ett_gryphon_response_data
);
970 offset
= (*(cmds
[i
].rsp_fnct
)) (tvb
, offset
, ft
);
976 decode_data(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
978 proto_item
*item
, *item1
;
979 proto_tree
*tree
, *tree1
;
980 int hdrsize
, datasize
, extrasize
, /* hdrbits, */ msgsize
, padding
, mode
;
983 hdrsize
= tvb_get_guint8(tvb
, offset
+0);
984 /* hdrbits = tvb_get_guint8(tvb, offset+1); */
985 datasize
= tvb_get_ntohs(tvb
, offset
+2);
986 extrasize
= tvb_get_guint8(tvb
, offset
+4);
987 padding
= 3 - (hdrsize
+ datasize
+ extrasize
+ 3) % 4;
988 msgsize
= hdrsize
+ datasize
+ extrasize
+ padding
+ 16;
990 item
= proto_tree_add_text(pt
, tvb
, offset
, 16, "Message header");
991 tree
= proto_item_add_subtree (item
, ett_gryphon_data_header
);
993 proto_tree_add_item(tree
, hf_gryphon_data_header_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
994 proto_tree_add_item(tree
, hf_gryphon_data_data_length
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
995 proto_tree_add_item(tree
, hf_gryphon_data_extra_data_length
, tvb
, offset
+4, 1, ENC_BIG_ENDIAN
);
997 mode
= tvb_get_guint8(tvb
, offset
+5);
998 item1
= proto_tree_add_item(tree
, hf_gryphon_data_mode
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
1000 tree1
= proto_item_add_subtree (item1
, ett_gryphon_flags
);
1001 proto_tree_add_item(tree1
, hf_gryphon_data_mode_transmitted
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
1002 proto_tree_add_item(tree1
, hf_gryphon_data_mode_receive
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
1003 proto_tree_add_item(tree1
, hf_gryphon_data_mode_local
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
1004 proto_tree_add_item(tree1
, hf_gryphon_data_mode_remote
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
1005 proto_tree_add_item(tree1
, hf_gryphon_data_mode_internal
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
1008 proto_tree_add_item(tree
, hf_gryphon_data_priority
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
1009 proto_tree_add_item(tree
, hf_gryphon_data_error_status
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
1011 timestamp
.secs
= tvb_get_ntohl(tvb
, offset
+8)/100000;
1012 timestamp
.nsecs
= (tvb_get_ntohl(tvb
, offset
+8)%100000)*1000;
1013 proto_tree_add_time(tree
, hf_gryphon_data_time
, tvb
, offset
+8, 4, ×tamp
);
1015 proto_tree_add_item(tree
, hf_gryphon_data_context
, tvb
, offset
+12, 1, ENC_BIG_ENDIAN
);
1016 proto_tree_add_item(tree
, hf_gryphon_reserved3
, tvb
, offset
+13, 3, ENC_BIG_ENDIAN
);
1019 item
= proto_tree_add_text(pt
, tvb
, offset
, msgsize
-16-padding
, "Message Body");
1020 tree
= proto_item_add_subtree (item
, ett_gryphon_data_body
);
1022 proto_tree_add_item(tree
, hf_gryphon_data_header_data
, tvb
, offset
, hdrsize
, ENC_NA
);
1026 proto_tree_add_item(tree
, hf_gryphon_data_data
, tvb
, offset
, datasize
, ENC_NA
);
1030 proto_tree_add_item(tree
, hf_gryphon_data_extra_data
, tvb
, offset
, extrasize
, ENC_NA
);
1031 offset
+= extrasize
;
1034 proto_tree_add_item(tree
, hf_gryphon_data_padding
, tvb
, offset
, padding
, ENC_NA
);
1041 decode_event(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1043 int msglen
, msgend
, padding
, length
;
1046 msglen
= tvb_reported_length_remaining(tvb
, offset
);
1047 padding
= 3 - (msglen
+ 3) % 4;
1048 msgend
= offset
+ msglen
;
1050 proto_tree_add_item(pt
, hf_gryphon_event_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1051 proto_tree_add_item(pt
, hf_gryphon_event_context
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1052 proto_tree_add_item(pt
, hf_gryphon_reserved2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
1055 timestamp
.secs
= tvb_get_ntohl(tvb
, offset
)/100000;
1056 timestamp
.nsecs
= (tvb_get_ntohl(tvb
, offset
)%100000)*1000;
1057 proto_tree_add_time(pt
, hf_gryphon_event_time
, tvb
, offset
, 4, ×tamp
);
1060 if (offset
< msgend
) {
1061 length
= msgend
- offset
;
1062 proto_tree_add_item(pt
, hf_gryphon_event_data
, tvb
, offset
, length
, ENC_NA
);
1066 proto_tree_add_item(pt
, hf_gryphon_event_padding
, tvb
, offset
, padding
, ENC_NA
);
1073 decode_misc (tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1075 int padding
, msglen
;
1078 msglen
= tvb_reported_length_remaining(tvb
, offset
);
1079 padding
= 3 - (msglen
+ 3) % 4;
1080 proto_tree_add_item(pt
, hf_gryphon_misc_data
, tvb
, offset
, length
, ENC_NA
|ENC_ASCII
);
1083 proto_tree_add_item(pt
, hf_gryphon_misc_padding
, tvb
, offset
, padding
, ENC_NA
);
1090 cmd_init(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1094 if (tvb_get_guint8(tvb
, offset
) == 0)
1095 ptr
= "Always initialize";
1097 ptr
= "Initialize if not previously initialized";
1098 proto_tree_add_text(pt
, tvb
, offset
, 1, "Mode: %s", ptr
);
1099 proto_tree_add_item(pt
, hf_gryphon_reserved3
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
1105 eventnum(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1107 guint8 event
= tvb_get_guint8(tvb
, offset
);
1110 proto_tree_add_item(pt
, hf_gryphon_eventnum
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1112 proto_tree_add_uint_format_value(pt
, hf_gryphon_eventnum
, tvb
, offset
, 1,
1113 0, "Event numbers: All");
1114 proto_tree_add_item(pt
, hf_gryphon_reserved3
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
1120 resp_time(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1125 val
= tvb_get_ntoh64(tvb
, offset
);
1126 timestamp
.secs
= (time_t)(val
/100000);
1127 timestamp
.nsecs
= (int)((val
%100000)*1000);
1129 proto_tree_add_time(pt
, hf_gryphon_resp_time
, tvb
, offset
, 8, ×tamp
);
1136 cmd_setfilt(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1138 int flag
= tvb_get_ntohl(tvb
, offset
);
1139 int length
, padding
;
1141 length
= tvb_get_guint8(tvb
, offset
+4) + tvb_get_guint8(tvb
, offset
+5)
1142 + tvb_get_ntohs(tvb
, offset
+6);
1144 proto_tree_add_uint_format_value(pt
, hf_gryphon_setfilt
, tvb
, offset
, 4,
1145 flag
, "%s%s", ((flag
) ? "Pass" : "Block"), ((length
== 0) ? " all" : ""));
1146 proto_tree_add_uint(pt
, hf_gryphon_setfilt_length
, tvb
, offset
+4, 4, length
);
1149 proto_tree_add_item(pt
, hf_gryphon_setfilt_discard_data
, tvb
, offset
, length
* 2, ENC_NA
);
1150 offset
+= length
* 2;
1152 padding
= 3 - (length
* 2 + 3) % 4;
1154 proto_tree_add_item(pt
, hf_gryphon_setfilt_padding
, tvb
, offset
, padding
, ENC_NA
);
1161 cmd_ioctl(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1163 int msglen
= tvb_reported_length_remaining(tvb
, offset
);
1165 proto_tree_add_item(pt
, hf_gryphon_ioctl
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1170 proto_tree_add_item(pt
, hf_gryphon_ioctl_data
, tvb
, offset
, msglen
, ENC_NA
);
1177 cmd_addfilt(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1181 int blocks
, i
, length
;
1183 item
= proto_tree_add_text(pt
, tvb
, offset
, 1, "Flags");
1184 tree
= proto_item_add_subtree (item
, ett_gryphon_flags
);
1185 proto_tree_add_item(tree
, hf_gryphon_addfilt_pass
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1186 proto_tree_add_item(tree
, hf_gryphon_addfilt_active
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1189 blocks
= tvb_get_guint8(tvb
, offset
);
1190 proto_tree_add_item(pt
, hf_gryphon_addfilt_blocks
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1191 proto_tree_add_item(pt
, hf_gryphon_reserved_bytes
, tvb
, offset
+1, 6, ENC_BIG_ENDIAN
);
1194 for (i
= 1; i
<= blocks
; i
++) {
1195 length
= tvb_get_ntohs(tvb
, offset
+2) * 2 + 8;
1196 length
+= 3 - (length
+ 3) % 4;
1197 item
= proto_tree_add_text(pt
, tvb
, offset
, length
, "Filter block %d", i
);
1198 tree
= proto_item_add_subtree (item
, ett_gryphon_cmd_filter_block
);
1199 offset
= filter_block(tvb
, offset
, tree
);
1205 resp_addfilt(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1207 proto_tree_add_item(pt
, hf_gryphon_addfilt_handle
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1208 proto_tree_add_item(pt
, hf_gryphon_reserved3
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
1214 cmd_modfilt(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1216 guint8 filter_handle
= tvb_get_guint8(tvb
, offset
);
1219 proto_tree_add_item(pt
, hf_gryphon_modfilt
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1221 proto_tree_add_uint_format_value(pt
, hf_gryphon_modfilt
, tvb
, offset
, 1,
1222 0, "Filter handles: all");
1224 proto_tree_add_item(pt
, hf_gryphon_modfilt_action
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1225 proto_tree_add_item(pt
, hf_gryphon_reserved2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
1231 resp_filthan(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1233 int handles
= tvb_get_guint8(tvb
, offset
);
1234 int i
, padding
, handle
;
1236 proto_tree_add_item(pt
, hf_gryphon_filthan
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1237 for (i
= 1; i
<= handles
; i
++){
1238 handle
= tvb_get_guint8(tvb
, offset
+i
);
1239 proto_tree_add_uint_format_value(pt
, hf_gryphon_filthan_id
, tvb
, offset
+i
, 1,
1240 handle
, "Handle %d: %u", i
, handle
);
1242 padding
= 3 - (handles
+ 1 + 3) % 4;
1244 proto_tree_add_item(pt
, hf_gryphon_filthan_padding
, tvb
, offset
+1+handles
, padding
, ENC_NA
);
1245 offset
+= 1+handles
+padding
;
1250 dfiltmode(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1252 proto_tree_add_item(pt
, hf_gryphon_dfiltmode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1253 proto_tree_add_item(pt
, hf_gryphon_reserved3
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
1259 filtmode(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1261 proto_tree_add_item(pt
, hf_gryphon_filtmode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1262 proto_tree_add_item(pt
, hf_gryphon_reserved3
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
1268 resp_events(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1275 msglen
= tvb_reported_length_remaining(tvb
, offset
);
1277 while (msglen
!= 0) {
1278 item
= proto_tree_add_text(pt
, tvb
, offset
, 20, "Event %d:", i
);
1279 tree
= proto_item_add_subtree (item
, ett_gryphon_cmd_events_data
);
1280 proto_tree_add_item(tree
, hf_gryphon_event_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1281 proto_tree_add_item(tree
, hf_gryphon_event_name
, tvb
, offset
+1, 19, ENC_NA
|ENC_ASCII
);
1290 cmd_register(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1292 proto_tree_add_item(pt
, hf_gryphon_register_username
, tvb
, offset
, 16, ENC_NA
|ENC_ASCII
);
1294 proto_tree_add_item(pt
, hf_gryphon_register_password
, tvb
, offset
, 32, ENC_NA
|ENC_ASCII
);
1300 resp_register(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1302 proto_tree_add_item(pt
, hf_gryphon_register_client_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1303 proto_tree_add_item(pt
, hf_gryphon_register_privileges
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1304 proto_tree_add_item(pt
, hf_gryphon_reserved2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
1311 resp_getspeeds(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1314 size
= tvb_get_guint8(tvb
, offset
+8),
1315 number
= tvb_get_guint8(tvb
, offset
+9);
1317 proto_tree_add_item(pt
, hf_gryphon_getspeeds_set_ioctl
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1318 proto_tree_add_item(pt
, hf_gryphon_getspeeds_get_ioctl
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
1319 proto_tree_add_item(pt
, hf_gryphon_getspeeds_size
, tvb
, offset
+8, 1, ENC_BIG_ENDIAN
);
1320 proto_tree_add_item(pt
, hf_gryphon_getspeeds_preset
, tvb
, offset
+9, 1, ENC_BIG_ENDIAN
);
1323 for (indx
= 1; indx
<= number
; indx
++) {
1324 proto_tree_add_bytes_format(pt
, hf_gryphon_getspeeds_data
, tvb
, offset
, size
,
1325 tvb_get_ptr(tvb
, offset
, size
), "Data for preset %d", indx
);
1332 cmd_sort(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1334 proto_tree_add_item(pt
, hf_gryphon_cmd_sort
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1339 cmd_optimize(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1341 proto_tree_add_item(pt
, hf_gryphon_cmd_optimize
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1346 resp_config(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1348 proto_item
*ti
, *item
;
1349 proto_tree
*ft
, *tree
;
1354 proto_tree_add_item(pt
, hf_gryphon_config_device_name
, tvb
, offset
, 20, ENC_NA
|ENC_ASCII
);
1357 proto_tree_add_item(pt
, hf_gryphon_config_device_version
, tvb
, offset
, 8, ENC_NA
|ENC_ASCII
);
1360 proto_tree_add_item(pt
, hf_gryphon_config_device_serial_number
, tvb
, offset
, 20, ENC_NA
|ENC_ASCII
);
1363 devices
= tvb_get_guint8(tvb
, offset
);
1365 proto_tree_add_item(pt
, hf_gryphon_config_num_channels
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1366 proto_tree_add_item(pt
, hf_gryphon_config_name_version_ext
, tvb
, offset
+1, 11, ENC_NA
|ENC_ASCII
);
1367 proto_tree_add_item(pt
, hf_gryphon_reserved4
, tvb
, offset
+12, 4, ENC_BIG_ENDIAN
);
1370 for (i
= 1; i
<= devices
; i
++) {
1371 ti
= proto_tree_add_text(pt
, tvb
, offset
, 80, "Channel %d:", i
);
1372 ft
= proto_item_add_subtree(ti
, ett_gryphon_cmd_config_device
);
1374 proto_tree_add_item(ft
, hf_gryphon_config_driver_name
, tvb
, offset
, 20, ENC_NA
|ENC_ASCII
);
1377 proto_tree_add_item(ft
, hf_gryphon_config_driver_version
, tvb
, offset
, 8, ENC_NA
|ENC_ASCII
);
1380 proto_tree_add_item(ft
, hf_gryphon_config_device_security
, tvb
, offset
, 16, ENC_NA
|ENC_ASCII
);
1383 x
= tvb_get_ntohl (tvb
, offset
);
1385 item
= proto_tree_add_text(ft
, tvb
, offset
, 4, "Valid Header lengths");
1386 tree
= proto_item_add_subtree (item
, ett_gryphon_valid_headers
);
1387 for (j
= 0; ; j
++) {
1389 proto_tree_add_text(tree
, tvb
, offset
, 4, "%d byte%s", j
,
1398 proto_tree_add_item(ft
, hf_gryphon_config_max_data_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1401 proto_tree_add_item(ft
, hf_gryphon_config_min_data_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1404 proto_tree_add_item(ft
, hf_gryphon_config_hardware_serial_number
, tvb
, offset
, 20, ENC_NA
|ENC_ASCII
);
1407 proto_tree_add_item(ft
, hf_gryphon_config_protocol_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1410 proto_tree_add_item(ft
, hf_gryphon_config_channel_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1413 proto_tree_add_item(ft
, hf_gryphon_config_card_slot_number
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1416 proto_tree_add_item(ft
, hf_gryphon_config_max_extra_data
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1419 proto_tree_add_item(ft
, hf_gryphon_config_min_extra_data
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1427 cmd_sched(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1430 proto_item
*item
, *item1
;
1431 proto_tree
*tree
, *tree1
;
1433 unsigned int i
, x
, length
;
1434 unsigned char def_chan
= tvb_get_guint8(tvb
, offset
-9);
1436 msglen
= tvb_reported_length_remaining(tvb
, offset
);
1438 if (tvb_get_ntohl(tvb
, offset
) == 0xFFFFFFFF)
1439 proto_tree_add_uint_format_value(pt
, hf_gryphon_sched_num_iterations
, tvb
, offset
, 4,
1440 0, "Number of iterations: \"infinite\"");
1442 proto_tree_add_item(pt
, hf_gryphon_sched_num_iterations
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1446 item
= proto_tree_add_item(pt
, hf_gryphon_sched_flags
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1447 tree
= proto_item_add_subtree (item
, ett_gryphon_flags
);
1448 proto_tree_add_item(tree
, hf_gryphon_sched_flags_scheduler
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1453 while (msglen
> 0) {
1454 length
= 16 + tvb_get_guint8(tvb
, offset
+16) +
1455 tvb_get_ntohs(tvb
, offset
+18) + tvb_get_guint8(tvb
, offset
+20) + 16;
1456 length
+= 3 - (length
+ 3) % 4;
1457 item
= proto_tree_add_text(pt
, tvb
, offset
, length
, "Message %d", i
);
1458 tree
= proto_item_add_subtree (item
, ett_gryphon_cmd_sched_data
);
1459 proto_tree_add_item(tree
, hf_gryphon_sched_sleep
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1463 proto_tree_add_item(tree
, hf_gryphon_sched_transmit_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1467 proto_tree_add_item(tree
, hf_gryphon_sched_transmit_period
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1471 item1
= proto_tree_add_item(tree
, hf_gryphon_sched_transmit_flags
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1472 tree1
= proto_item_add_subtree (item1
, ett_gryphon_flags
);
1473 proto_tree_add_item(tree1
, hf_gryphon_sched_skip_transmit_period
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1475 proto_tree_add_item(tree1
, hf_gryphon_sched_skip_sleep
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1478 x
= tvb_get_guint8(tvb
, offset
+2);
1482 proto_tree_add_uint(tree
, hf_gryphon_sched_channel
, tvb
, offset
+2, 1, x
);
1483 proto_tree_add_item(tree
, hf_gryphon_reserved1
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
1487 item1
= proto_tree_add_text(tree
, tvb
, offset
, length
, "Message");
1488 tree1
= proto_item_add_subtree (item1
, ett_gryphon_cmd_sched_cmd
);
1489 save_offset
= offset
;
1490 offset
= decode_data(tvb
, offset
, tree1
);
1491 msglen
-= offset
- save_offset
;
1498 cmd_sched_rep(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1503 x
= tvb_get_ntohl(tvb
, offset
);
1508 proto_tree_add_uint_format_value(pt
, hf_gryphon_sched_rep_id
, tvb
,
1509 offset
, 4, x
, "%s schedule ID: %u", type
, x
);
1512 proto_tree_add_item(pt
, hf_gryphon_sched_rep_message_index
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1513 proto_tree_add_item(pt
, hf_gryphon_reserved3
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
1515 offset
= decode_data(tvb
, offset
, pt
);
1520 resp_blm_data(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1526 timestamp
.secs
= tvb_get_ntohl(tvb
, offset
)/100000;
1527 timestamp
.nsecs
= (tvb_get_ntohl(tvb
, offset
)%100000)*1000;
1528 proto_tree_add_time(pt
, hf_gryphon_blm_data_time
, tvb
, offset
, 4, ×tamp
);
1531 x
= tvb_get_ntohs(tvb
, offset
);
1532 proto_tree_add_uint_format_value(pt
, hf_gryphon_blm_data_bus_load
, tvb
,
1533 offset
, 2, x
, "%d.%02d%%", x
/ 100, x
% 100);
1535 x
= tvb_get_ntohs(tvb
, offset
);
1536 proto_tree_add_uint_format_value(pt
, hf_gryphon_blm_data_current_bus_load
, tvb
,
1537 offset
, 2, x
, "%d.%02d%%", x
/ 100, x
% 100);
1539 x
= tvb_get_ntohs(tvb
, offset
);
1540 proto_tree_add_uint_format_value(pt
, hf_gryphon_blm_data_peak_bus_load
, tvb
,
1541 offset
, 2, x
, "%d.%02d%%", x
/ 100, x
% 100);
1543 x
= tvb_get_ntohs(tvb
, offset
);
1544 proto_tree_add_uint_format_value(pt
, hf_gryphon_blm_data_historic_peak_bus_load
, tvb
,
1545 offset
, 2, x
, "%d.%02d%%", x
/ 100, x
% 100);
1552 resp_blm_stat(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1554 offset
= resp_blm_data(tvb
, offset
, pt
);
1556 proto_tree_add_item(pt
, hf_gryphon_blm_stat_receive_frame_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1558 proto_tree_add_item(pt
, hf_gryphon_blm_stat_transmit_frame_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1560 proto_tree_add_item(pt
, hf_gryphon_blm_stat_receive_dropped_frame_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1562 proto_tree_add_item(pt
, hf_gryphon_blm_stat_transmit_dropped_frame_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1564 proto_tree_add_item(pt
, hf_gryphon_blm_stat_receive_error_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1566 proto_tree_add_item(pt
, hf_gryphon_blm_stat_transmit_error_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1572 cmd_addresp(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1576 int blocks
, responses
, i
, msglen
, length
;
1577 int action
, actionType
, actionValue
;
1581 item
= proto_tree_add_item(pt
, hf_gryphon_addresp_flags
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1582 tree
= proto_item_add_subtree (item
, ett_gryphon_flags
);
1583 proto_tree_add_item(tree
, hf_gryphon_addresp_flags_active
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1586 blocks
= tvb_get_guint8(tvb
, offset
);
1587 proto_tree_add_item(tree
, hf_gryphon_addresp_blocks
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1590 responses
= tvb_get_guint8(tvb
, offset
);
1591 proto_tree_add_item(tree
, hf_gryphon_addresp_responses
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1594 proto_tree_add_item(tree
, hf_gryphon_addresp_old_handle
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1597 action
= tvb_get_guint8(tvb
, offset
);
1598 item
= proto_tree_add_item(tree
, hf_gryphon_addresp_action
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1599 tree
= proto_item_add_subtree (item
, ett_gryphon_flags
);
1600 actionValue
= tvb_get_ntohs(tvb
, offset
+2);
1602 if (action
& FR_PERIOD_MSGS
) {
1608 proto_tree_add_item(tree
, hf_gryphon_addresp_action_period
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1611 proto_tree_add_item(tree
, hf_gryphon_addresp_action_deact_on_event
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1612 proto_tree_add_item(tree
, hf_gryphon_addresp_action_deact_after_period
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1615 proto_tree_add_item(pt
, hf_gryphon_reserved1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1618 if (actionType
== 1) {
1619 proto_tree_add_uint_format_value(tree
, hf_gryphon_addresp_action_period_type
, tvb
,
1620 offset
, 2, actionValue
, "Period: %d messages", actionValue
);
1622 proto_tree_add_uint_format_value(tree
, hf_gryphon_addresp_action_period_type
, tvb
,
1623 offset
, 2, actionValue
, "Period: %d.%02d seconds", actionValue
/100, actionValue
%100);
1628 for (i
= 1; i
<= blocks
; i
++) {
1629 length
= tvb_get_ntohs(tvb
, offset
+2) * 2 + 8;
1630 length
+= 3 - (length
+ 3) % 4;
1631 item
= proto_tree_add_text(pt
, tvb
, offset
, length
, "Filter block %d", i
);
1632 tree
= proto_item_add_subtree (item
, ett_gryphon_cmd_filter_block
);
1633 offset
= filter_block(tvb
, offset
, tree
);
1635 for (i
= 1; i
<= responses
; i
++) {
1636 msglen
= tvb_get_ntohs(tvb
, offset
+4) + 8;
1637 length
= msglen
+ 3 - (msglen
+ 3) % 4;
1638 item
= proto_tree_add_text(pt
, tvb
, offset
, length
, "Response block %d", i
);
1639 tree
= proto_item_add_subtree (item
, ett_gryphon_cmd_response_block
);
1640 next_tvb
= tvb_new_subset(tvb
, offset
, msglen
, msglen
);
1641 dissect_gryphon_message(next_tvb
, NULL
, tree
, TRUE
);
1648 resp_addresp(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1650 proto_tree_add_item(pt
, hf_gryphon_addresp_handle
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1651 proto_tree_add_item(pt
, hf_gryphon_reserved3
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
1657 cmd_modresp(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1659 guint8 dest
= tvb_get_guint8(tvb
, offset
-5),
1660 resp_handle
= tvb_get_guint8(tvb
, offset
);
1663 proto_tree_add_item(pt
, hf_gryphon_modresp_handle
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1665 proto_tree_add_uint_format_value(pt
, hf_gryphon_modresp_handle
, tvb
,
1666 offset
, 1, dest
, "Response handles: all on channel %c", dest
);
1668 proto_tree_add_uint_format_value(pt
, hf_gryphon_modresp_handle
, tvb
, offset
, 1,
1669 0, "Response handles: all");
1671 proto_tree_add_item(pt
, hf_gryphon_modresp_action
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1672 proto_tree_add_item(pt
, hf_gryphon_reserved2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
1678 resp_resphan(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1680 int handles
= tvb_get_guint8(tvb
, offset
);
1683 proto_tree_add_item(pt
, hf_gryphon_num_resphan
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1684 for (i
= 1; i
<= handles
; i
++){
1685 proto_tree_add_text(pt
, tvb
, offset
+i
, 1, "Handle %d: %u", i
,
1686 tvb_get_guint8(tvb
, offset
+i
));
1688 padding
= 3 - (handles
+ 1 + 3) % 4;
1690 proto_tree_add_item(pt
, hf_gryphon_padding
, tvb
, offset
+1+handles
, padding
, ENC_NA
);
1691 offset
+= 1+handles
+padding
;
1696 resp_sched(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1698 proto_tree_add_item(pt
, hf_gryphon_transmit_sched_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1704 cmd_desc(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1706 proto_tree_add_item(pt
, hf_gryphon_desc_program_size
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1709 proto_tree_add_item(pt
, hf_gryphon_desc_program_name
, tvb
, offset
, 32, ENC_NA
|ENC_ASCII
);
1712 proto_tree_add_item(pt
, hf_gryphon_desc_program_description
, tvb
, offset
, 80, ENC_NA
|ENC_ASCII
);
1719 resp_desc(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1724 item
= proto_tree_add_item(pt
, hf_gryphon_desc_flags
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1725 tree
= proto_item_add_subtree (item
, ett_gryphon_flags
);
1726 proto_tree_add_item(tree
, hf_gryphon_desc_flags_program
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1727 proto_tree_add_item(pt
, hf_gryphon_desc_handle
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1728 proto_tree_add_item(pt
, hf_gryphon_reserved2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
1734 cmd_upload(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1737 unsigned int length
;
1739 msglen
= tvb_reported_length_remaining(tvb
, offset
);
1740 proto_tree_add_item(pt
, hf_gryphon_upload_block_number
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1741 proto_tree_add_item(pt
, hf_gryphon_upload_handle
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
1746 proto_tree_add_item(pt
, hf_gryphon_upload_data
, tvb
, offset
, length
, ENC_NA
);
1749 length
= 3 - (length
+ 3) % 4;
1751 proto_tree_add_item(pt
, hf_gryphon_padding
, tvb
, offset
, length
, ENC_NA
);
1758 cmd_delete(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1760 proto_tree_add_item(pt
, hf_gryphon_delete
, tvb
, offset
, 32, ENC_NA
|ENC_ASCII
);
1766 cmd_list(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1768 proto_tree_add_item(pt
, hf_gryphon_list_block_number
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1769 proto_tree_add_item(pt
, hf_gryphon_reserved3
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
1775 resp_list(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1779 unsigned int i
, count
;
1781 count
= tvb_get_guint8(tvb
, offset
);
1782 proto_tree_add_item(pt
, hf_gryphon_list_num_programs
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1783 proto_tree_add_item(pt
, hf_gryphon_reserved1
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1786 proto_tree_add_item(pt
, hf_gryphon_list_num_remain_programs
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1789 for (i
= 1; i
<= count
; i
++) {
1790 item
= proto_tree_add_text(pt
, tvb
, offset
, 112, "Program %u", i
);
1791 tree
= proto_item_add_subtree (item
, ett_gryphon_pgm_list
);
1792 proto_tree_add_item(tree
, hf_gryphon_list_name
, tvb
, offset
, 32, ENC_NA
|ENC_ASCII
);
1795 proto_tree_add_item(tree
, hf_gryphon_list_description
, tvb
, offset
, 80, ENC_NA
|ENC_ASCII
);
1802 cmd_start(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1807 int hdr_stuff
= offset
;
1809 msglen
= tvb_reported_length_remaining(tvb
, offset
);
1810 offset
= cmd_delete(tvb
, offset
, pt
); /* decode the name */
1811 if (offset
< msglen
+ hdr_stuff
) {
1812 string
= tvb_get_stringz(wmem_packet_scope(), tvb
, offset
, &length
);
1814 proto_tree_add_string(pt
, hf_gryphon_start_arguments
, tvb
, offset
,
1818 length
= 3 - (length
+ 3) % 4;
1820 proto_tree_add_item(pt
, hf_gryphon_padding
, tvb
, offset
, length
, ENC_NA
);
1829 resp_start(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1833 msglen
= tvb_reported_length_remaining(tvb
, offset
);
1835 proto_tree_add_item(pt
, hf_gryphon_start_channel
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1836 proto_tree_add_item(pt
, hf_gryphon_reserved3
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
1843 resp_status(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1847 unsigned int i
, copies
, length
;
1849 copies
= tvb_get_guint8(tvb
, offset
);
1850 item
= proto_tree_add_item(pt
, hf_gryphon_status_num_running_copies
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1851 tree
= proto_item_add_subtree (item
, ett_gryphon_pgm_status
);
1854 for (i
= 1; i
<= copies
; i
++) {
1855 proto_tree_add_text(tree
, tvb
, offset
, 1, "Program %u channel (client) number %u",
1856 i
, tvb_get_guint8(tvb
, offset
));
1860 length
= 3 - (copies
+ 1 + 3) % 4;
1862 proto_tree_add_item(pt
, hf_gryphon_padding
, tvb
, offset
, length
, ENC_NA
);
1869 cmd_options(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1874 unsigned int i
, size
, padding
, option
, option_length
, option_value
;
1875 const char *string
, *string1
;
1877 msglen
= tvb_reported_length_remaining(tvb
, offset
);
1878 proto_tree_add_item(pt
, hf_gryphon_options_handle
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1879 proto_tree_add_item(pt
, hf_gryphon_reserved3
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
1883 for (i
= 1; msglen
> 0; i
++) {
1884 option_length
= tvb_get_guint8(tvb
, offset
+1);
1885 size
= option_length
+ 2;
1886 padding
= 3 - ((size
+ 3) %4);
1887 item
= proto_tree_add_text(pt
, tvb
, offset
, size
+ padding
, "Option number %u", i
);
1888 tree
= proto_item_add_subtree (item
, ett_gryphon_pgm_options
);
1889 option
= tvb_get_guint8(tvb
, offset
);
1890 switch (option_length
) {
1892 option_value
= tvb_get_guint8(tvb
, offset
+2);
1895 option_value
= tvb_get_ntohs(tvb
, offset
+2);
1898 option_value
= tvb_get_ntohl(tvb
, offset
+2);
1903 string
= "unknown option";
1904 string1
= "unknown option data";
1907 string
= "Type of data in the file";
1908 switch (option_value
) {
1910 string1
= "Binary - Don't modify";
1913 string1
= "ASCII - Remove CR's";
1918 string
= "Type of file";
1919 switch (option_value
) {
1921 string1
= "Executable";
1929 proto_tree_add_text(tree
, tvb
, offset
, 1, "%s", string
);
1930 proto_tree_add_text(tree
, tvb
, offset
+2, option_length
, "%s", string1
);
1932 proto_tree_add_item(tree
, hf_gryphon_padding
, tvb
, offset
+option_length
+2, padding
, ENC_NA
);
1933 offset
+= size
+ padding
;
1934 msglen
-= size
+ padding
;
1940 cmd_files(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1945 msglen
= tvb_reported_length_remaining(tvb
, offset
);
1946 if (tvb_get_guint8(tvb
, offset
) == 0)
1947 which
= "First group of names";
1949 which
= "Subsequent group of names";
1951 proto_tree_add_text(pt
, tvb
, offset
, 1, "%s", which
);
1952 proto_tree_add_item(pt
, hf_gryphon_files
, tvb
, offset
+1, msglen
-1, ENC_NA
|ENC_ASCII
);
1958 resp_files(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1963 msglen
= tvb_reported_length_remaining(tvb
, offset
);
1964 flag
= tvb_get_guint8(tvb
, offset
) ? "Yes": "No";
1965 proto_tree_add_text(pt
, tvb
, offset
, 1, "More filenames to return: %s", flag
);
1966 proto_tree_add_text(pt
, tvb
, offset
+1, msglen
-1, "File and directory names");
1972 cmd_usdt(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
1974 int ids
, id
, remain
, size
, i
, j
, bytes
;
1976 proto_tree
*localTree
;
1977 proto_item
*localItem
;
1979 static const gchar
*block_desc
[] = {"USDT request", "USDT response", "UUDT response"};
1981 flags
= tvb_get_guint8(tvb
, offset
);
1982 proto_tree_add_item(pt
, hf_gryphon_usdt_flags_register
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1985 localItem
= proto_tree_add_item(pt
, hf_gryphon_usdt_action_flags
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1986 localTree
= proto_item_add_subtree (localItem
, ett_gryphon_flags
);
1988 proto_tree_add_item(localTree
, hf_gryphon_usdt_action_flags_register
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1989 proto_tree_add_item(localTree
, hf_gryphon_usdt_action_flags_action
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1991 localItem
= proto_tree_add_item(pt
, hf_gryphon_usdt_transmit_options_flags
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1992 localTree
= proto_item_add_subtree (localItem
, ett_gryphon_flags
);
1993 proto_tree_add_item(localTree
, hf_gryphon_usdt_transmit_options_flags_echo
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1994 proto_tree_add_item(localTree
, hf_gryphon_usdt_transmit_options_action
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1995 proto_tree_add_item(localTree
, hf_gryphon_usdt_transmit_options_send_done
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1997 localItem
= proto_tree_add_item(pt
, hf_gryphon_usdt_receive_options_flags
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
1998 localTree
= proto_item_add_subtree (localItem
, ett_gryphon_flags
);
1999 proto_tree_add_item(localTree
, hf_gryphon_usdt_receive_options_action
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
2000 proto_tree_add_item(localTree
, hf_gryphon_usdt_receive_options_firstframe
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
2001 proto_tree_add_item(localTree
, hf_gryphon_usdt_receive_options_lastframe
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
2003 if ((ids
= tvb_get_guint8(tvb
, offset
+3))) {
2004 localItem
= proto_tree_add_item(pt
, hf_gryphon_usdt_ext_address
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
2007 localTree
= proto_item_add_subtree (localItem
, ett_gryphon_usdt_data
);
2009 proto_tree_add_item(localTree
, hf_gryphon_usdt_ext_address_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2014 proto_tree_add_uint_format_value(pt
, hf_gryphon_usdt_ext_address
, tvb
, offset
+3, 1,
2015 0, "Using extended addressing for the single, internally defined, ID");
2018 for (i
= 0; i
< 2; i
++) {
2019 bytes
= tvb_reported_length_remaining (tvb
, offset
);
2022 localItem
= proto_tree_add_text(pt
, tvb
, offset
, 16, "%s block of USDT/UUDT IDs", i
==0?"First":"Second");
2023 localTree
= proto_item_add_subtree (localItem
, ett_gryphon_usdt_data
);
2025 size
= tvb_get_ntohl (tvb
, offset
);
2026 localItem
= proto_tree_add_item(localTree
, hf_gryphon_usdt_block_size
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2027 localTree
= proto_item_add_subtree (localItem
, ett_gryphon_usdt_data_block
);
2029 proto_item_set_len(localItem
, 16);
2032 for (j
= 0; j
< 3; j
++){
2033 id
= tvb_get_ntohl (tvb
, offset
);
2034 proto_tree_add_text (localTree
, tvb
, offset
, 4,
2035 "%s IDs from %04X through %04X", block_desc
[j
], id
, id
+size
-1);
2041 proto_tree_add_item(pt
, hf_gryphon_reserved3
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
2045 if ((remain
= tvb_reported_length_remaining(tvb
, offset
))) {
2046 proto_tree_add_item(pt
, hf_gryphon_ignored
, tvb
, offset
, remain
, ENC_NA
);
2054 cmd_bits_in (tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2060 msglen
= tvb_reported_length_remaining(tvb
, offset
);
2061 value
= tvb_get_guint8(tvb
, offset
);
2063 item
= proto_tree_add_text(pt
, tvb
, offset
, 1, "Digital values set");
2064 tree
= proto_item_add_subtree (item
, ett_gryphon_digital_data
);
2066 proto_tree_add_item(tree
, hf_gryphon_bits_in_input1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2067 proto_tree_add_item(tree
, hf_gryphon_bits_in_input2
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2068 proto_tree_add_item(tree
, hf_gryphon_bits_in_input3
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2069 proto_tree_add_item(tree
, hf_gryphon_bits_in_pushbutton
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2071 proto_tree_add_text(pt
, tvb
, offset
, 1, "No digital values are set");
2080 cmd_bits_out (tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2086 msglen
= tvb_reported_length_remaining(tvb
, offset
);
2087 value
= tvb_get_guint8(tvb
, offset
);
2089 item
= proto_tree_add_text(pt
, tvb
, offset
, 1, "Digital values set");
2090 tree
= proto_item_add_subtree (item
, ett_gryphon_digital_data
);
2092 proto_tree_add_item(tree
, hf_gryphon_bits_out_output1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2093 proto_tree_add_item(tree
, hf_gryphon_bits_out_output2
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2095 proto_tree_add_text(pt
, tvb
, offset
, 1, "No digital values are set");
2104 cmd_init_strat (tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2106 guint32 reset_limit
;
2110 msglen
= tvb_reported_length_remaining(tvb
, offset
);
2111 reset_limit
= tvb_get_ntohl(tvb
, offset
);
2112 proto_tree_add_uint_format_value(pt
, hf_gryphon_init_strat_reset_limit
, tvb
, offset
, 4,
2113 reset_limit
, "Reset Limit = %u messages", reset_limit
);
2116 for (indx
= 1; msglen
; indx
++, offset
++, msglen
--) {
2117 value
= tvb_get_guint8(tvb
, offset
);
2119 proto_tree_add_float_format_value(pt
, hf_gryphon_init_strat_delay
, tvb
, offset
, 1,
2120 value
/4, "Delay %d = %.2f seconds", indx
, value
/4);
2122 proto_tree_add_float_format_value(pt
, hf_gryphon_init_strat_delay
, tvb
, offset
, 1,
2123 0, "Delay %d = infinite", indx
);
2130 speed(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2132 proto_tree_add_item(pt
, hf_gryphon_speed_baud_rate_index
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2133 proto_tree_add_item(pt
, hf_gryphon_reserved3
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
2139 filter_block(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2142 int length
, padding
;
2144 proto_tree_add_item(pt
, hf_gryphon_filter_block_filter_start
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2145 length
= tvb_get_ntohs(tvb
, offset
+2);
2147 proto_tree_add_item(pt
, hf_gryphon_filter_block_filter_length
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
2148 proto_tree_add_item(pt
, hf_gryphon_filter_block_filter_type
, tvb
, offset
+4, 1, ENC_BIG_ENDIAN
);
2149 proto_tree_add_item(pt
, hf_gryphon_filter_block_filter_operator
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
2150 op
= tvb_get_guint8(tvb
, offset
+5);
2151 proto_tree_add_item(pt
, hf_gryphon_reserved2
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
2154 if (op
== BIT_FIELD_CHECK
) {
2155 proto_tree_add_text(pt
, tvb
, offset
, length
, "Pattern");
2156 proto_tree_add_text(pt
, tvb
, offset
+length
, length
, "Mask");
2160 proto_tree_add_item(pt
, hf_gryphon_filter_block_filter_value1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2163 proto_tree_add_item(pt
, hf_gryphon_filter_block_filter_value2
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2166 proto_tree_add_item(pt
, hf_gryphon_filter_block_filter_value4
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2169 proto_tree_add_item(pt
, hf_gryphon_filter_block_filter_value_bytes
, tvb
, offset
, length
, ENC_NA
);
2172 offset
+= length
* 2;
2173 padding
= 3 - (length
* 2 + 3) % 4;
2175 proto_tree_add_item(pt
, hf_gryphon_padding
, tvb
, offset
, padding
, ENC_NA
);
2182 blm_mode(tvbuff_t
*tvb
, int offset
, proto_tree
*pt
)
2186 int mode
, milliseconds
;
2188 mode
= tvb_get_ntohl(tvb
, offset
);
2189 item
= proto_tree_add_item(pt
, hf_gryphon_blm_mode
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2193 tree
= proto_item_add_subtree (item
, ett_gryphon_blm_mode
);
2194 milliseconds
= tvb_get_ntohl(tvb
, offset
);
2196 proto_tree_add_uint_format_value(tree
, hf_gryphon_blm_mode_avg_period
, tvb
, offset
, 4,
2197 milliseconds
, "Averaging period: %d.%03d seconds", milliseconds
/1000, milliseconds
%1000);
2200 tree
= proto_item_add_subtree (item
, ett_gryphon_blm_mode
);
2201 proto_tree_add_item(tree
, hf_gryphon_blm_mode_avg_frames
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2204 proto_tree_add_text(pt
, tvb
, offset
, 4, "Reserved");
2213 proto_register_gryphon(void)
2215 static hf_register_info hf
[] = {
2217 { "Source", "gryphon.src", FT_UINT8
, BASE_HEX
, VALS(src_dest
), 0x0,
2219 { &hf_gryphon_srcchan
,
2220 { "Source channel", "gryphon.srcchan", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2223 { "Destination", "gryphon.dest", FT_UINT8
, BASE_HEX
, VALS(src_dest
), 0x0,
2225 { &hf_gryphon_destchan
,
2226 { "Destination channel", "gryphon.destchan", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2229 { "Frame type", "gryphon.type", FT_UINT8
, BASE_DEC
, VALS(frame_type
), 0x0,
2232 { "Command", "gryphon.cmd", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2235 { "Data", "gryphon.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2237 { &hf_gryphon_padding
,
2238 { "Padding", "gryphon.padding", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2240 { &hf_gryphon_ignored
,
2241 { "Ignored", "gryphon.ignored", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2243 { &hf_gryphon_data_length
,
2244 { "Data length (bytes)", "gryphon.data_length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2246 { &hf_gryphon_reserved1
,
2247 { "Reserved", "gryphon.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
2249 { &hf_gryphon_reserved2
,
2250 { "Reserved", "gryphon.reserved", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
2252 { &hf_gryphon_reserved3
,
2253 { "Reserved", "gryphon.reserved", FT_UINT24
, BASE_HEX
, NULL
, 0x0,
2255 { &hf_gryphon_reserved4
,
2256 { "Reserved", "gryphon.reserved", FT_UINT32
, BASE_HEX
, NULL
, 0x0,
2258 { &hf_gryphon_reserved_bytes
,
2259 { "Reserved", "gryphon.reserved", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2261 { &hf_gryphon_wait_resp
,
2262 { "Wait for response", "gryphon.wait_resp", FT_BOOLEAN
, 8, TFS(&tfs_wait_response
), DONT_WAIT_FOR_RESP
,
2264 { &hf_gryphon_wait_prev_resp
,
2265 { "Wait for previous response", "gryphon.wait_prev_resp", FT_BOOLEAN
, 8, TFS(&tfs_wait_response
), WAIT_FOR_PREV_RESP
,
2267 { &hf_gryphon_status
,
2268 { "Status", "gryphon.status", FT_UINT32
, BASE_HEX
, VALS(responses_vs
), 0x0,
2270 { &hf_gryphon_data_header_length
,
2271 { "Header length (bytes)", "gryphon.data.header_length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2273 { &hf_gryphon_data_data_length
,
2274 { "Data length (bytes)", "gryphon.data.data_length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2276 { &hf_gryphon_data_extra_data_length
,
2277 { "Extra data length (bytes)", "gryphon.data.extra_length", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2279 { &hf_gryphon_data_mode
,
2280 { "Mode", "gryphon.data.mode", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2282 { &hf_gryphon_data_mode_transmitted
,
2283 { "Transmitted message", "gryphon.data.mode.transmitted", FT_BOOLEAN
, 8, TFS(&true_false
), 0x80,
2285 { &hf_gryphon_data_mode_receive
,
2286 { "Received message", "gryphon.data.mode.receive", FT_BOOLEAN
, 8, TFS(&true_false
), 0x40,
2288 { &hf_gryphon_data_mode_local
,
2289 { "Local message", "gryphon.data.mode.local", FT_BOOLEAN
, 8, TFS(&true_false
), 0x20,
2291 { &hf_gryphon_data_mode_remote
,
2292 { "Remote message", "gryphon.data.mode.remote", FT_BOOLEAN
, 8, TFS(&true_false
), 0x10,
2294 { &hf_gryphon_data_mode_internal
,
2295 { "Internal message", "gryphon.data.mode.internal", FT_BOOLEAN
, 8, TFS(&true_false
), 0x01,
2297 { &hf_gryphon_data_priority
,
2298 { "Priority", "gryphon.data.priority", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2300 { &hf_gryphon_data_error_status
,
2301 { "Error status", "gryphon.data.error_status", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2303 { &hf_gryphon_data_time
,
2304 { "Timestamp", "gryphon.data.time", FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x0,
2306 { &hf_gryphon_data_context
,
2307 { "Context", "gryphon.data.context", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2309 { &hf_gryphon_data_header_data
,
2310 { "Header", "gryphon.data.header_data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2312 { &hf_gryphon_data_data
,
2313 { "Data", "gryphon.data.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2315 { &hf_gryphon_data_extra_data
,
2316 { "Extra data", "gryphon.data.extra_data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2318 { &hf_gryphon_data_padding
,
2319 { "Padding", "gryphon.data.padding", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2321 { &hf_gryphon_event_id
,
2322 { "Event ID", "gryphon.event.id", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2324 { &hf_gryphon_event_name
,
2325 { "Event name", "gryphon.event.name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2327 { &hf_gryphon_event_context
,
2328 { "Event context", "gryphon.event.context", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2330 { &hf_gryphon_event_time
,
2331 { "Timestamp", "gryphon.event.time", FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x0,
2333 { &hf_gryphon_event_data
,
2334 { "Data", "gryphon.event.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2336 { &hf_gryphon_event_padding
,
2337 { "Padding", "gryphon.event.padding", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2339 { &hf_gryphon_misc_data
,
2340 { "Data", "gryphon.misc.data", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2342 { &hf_gryphon_misc_padding
,
2343 { "Padding", "gryphon.misc.padding", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2345 { &hf_gryphon_eventnum
,
2346 { "Event numbers", "gryphon.eventnum", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2348 { &hf_gryphon_resp_time
,
2349 { "Date/Time", "gryphon.resp_time", FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_LOCAL
, NULL
, 0x0,
2351 { &hf_gryphon_setfilt
,
2352 { "Pass/Block flag", "gryphon.setfilt.flag", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2354 { &hf_gryphon_setfilt_length
,
2355 { "Length of Pattern & Mask", "gryphon.setfilt.length", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2357 { &hf_gryphon_setfilt_discard_data
,
2358 { "Discarded data", "gryphon.setfilt.discard_data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2360 { &hf_gryphon_setfilt_padding
,
2361 { "Padding", "gryphon.setfilt.padding", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2363 { &hf_gryphon_ioctl
,
2364 { "IOCTL", "gryphon.ioctl", FT_UINT32
, BASE_HEX
, VALS(ioctls
), 0x0,
2366 { &hf_gryphon_ioctl_data
,
2367 { "Data", "gryphon.ioctl.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2369 { &hf_gryphon_addfilt_pass
,
2370 { "Conforming messages", "gryphon.addfilt.pass", FT_BOOLEAN
, 8, TFS(&tfs_passed_blocked
), FILTER_PASS_FLAG
,
2372 { &hf_gryphon_addfilt_active
,
2373 { "Filter", "gryphon.addfilt.active", FT_BOOLEAN
, 8, TFS(&active_inactive
), FILTER_ACTIVE_FLAG
,
2375 { &hf_gryphon_addfilt_blocks
,
2376 { "Number of filter blocks", "gryphon.addfilt.blocks", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2378 { &hf_gryphon_addfilt_handle
,
2379 { "Filter handle", "gryphon.addfilt.handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2381 { &hf_gryphon_modfilt
,
2382 { "Filter handle", "gryphon.modfilt", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2384 { &hf_gryphon_modfilt_action
,
2385 { "Action", "gryphon.modfilt.action", FT_UINT8
, BASE_DEC
, VALS(filtacts
), 0x0,
2387 { &hf_gryphon_filthan
,
2388 { "Number of filter handles", "gryphon.filthan", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2390 { &hf_gryphon_filthan_id
,
2391 { "Filter handle ID", "gryphon.filthan.id", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2393 { &hf_gryphon_filthan_padding
,
2394 { "Padding", "gryphon.filthan.padding", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2396 { &hf_gryphon_dfiltmode
,
2397 { "Filter mode", "gryphon.dfiltmode", FT_UINT8
, BASE_DEC
, VALS(dmodes
), 0x0,
2399 { &hf_gryphon_filtmode
,
2400 { "Filter mode", "gryphon.filtmode", FT_UINT8
, BASE_DEC
, VALS(modes
), 0x0,
2402 { &hf_gryphon_register_username
,
2403 { "Username", "gryphon.register.username", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2405 { &hf_gryphon_register_password
,
2406 { "Password", "gryphon.register.password", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2408 { &hf_gryphon_register_client_id
,
2409 { "Client ID", "gryphon.register.client_id", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2411 { &hf_gryphon_register_privileges
,
2412 { "Privileges", "gryphon.register.privileges", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2414 { &hf_gryphon_getspeeds_set_ioctl
,
2415 { "Set Speed IOCTL", "gryphon.getspeeds.set_ioctl", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2417 { &hf_gryphon_getspeeds_get_ioctl
,
2418 { "Get Speed IOCTL", "gryphon.getspeeds.get_ioctl", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2420 { &hf_gryphon_getspeeds_size
,
2421 { "Speed data size (bytes)", "gryphon.getspeeds.size", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2423 { &hf_gryphon_getspeeds_preset
,
2424 { "Preset speed numbers", "gryphon.getspeeds.preset", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2426 { &hf_gryphon_getspeeds_data
,
2427 { "Data for preset", "gryphon.getspeeds.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2429 { &hf_gryphon_cmd_sort
,
2430 { "Set sorting", "gryphon.cmd_sort", FT_UINT8
, BASE_DEC
, VALS(cmd_sort_type
), 0x0,
2432 { &hf_gryphon_cmd_optimize
,
2433 { "Set optimization", "gryphon.cmd_optimize", FT_UINT8
, BASE_DEC
, VALS(cmd_optimize_type
), 0x0,
2435 { &hf_gryphon_config_device_name
,
2436 { "Device name", "gryphon.config.device_name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2438 { &hf_gryphon_config_device_version
,
2439 { "Device version", "gryphon.config.device_version", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2441 { &hf_gryphon_config_device_serial_number
,
2442 { "Device serial number", "gryphon.config.device_serial_number", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2444 { &hf_gryphon_config_num_channels
,
2445 { "Number of channels", "gryphon.config.num_channels", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2447 { &hf_gryphon_config_name_version_ext
,
2448 { "Name & version extension", "gryphon.config.name_version_ext", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2450 { &hf_gryphon_config_driver_name
,
2451 { "Driver name", "gryphon.config.driver_name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2453 { &hf_gryphon_config_driver_version
,
2454 { "Driver version", "gryphon.config.driver_version", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2456 { &hf_gryphon_config_device_security
,
2457 { "Device security string", "gryphon.config.device_security", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2459 { &hf_gryphon_config_max_data_length
,
2460 { "Maximum data length (bytes)", "gryphon.config.max_data_length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2462 { &hf_gryphon_config_min_data_length
,
2463 { "Minimum data length (bytes)", "gryphon.config.min_data_length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2465 { &hf_gryphon_config_hardware_serial_number
,
2466 { "Hardware serial number", "gryphon.config.hardware_serial_number", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2468 { &hf_gryphon_config_protocol_type
,
2469 { "Protocol type & subtype", "gryphon.config.protocol_type", FT_UINT16
, BASE_HEX
, VALS(protocol_types
), 0x0,
2471 { &hf_gryphon_config_channel_id
,
2472 { "Channel ID", "gryphon.config.channel_id", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2474 { &hf_gryphon_config_card_slot_number
,
2475 { "Card slot number", "gryphon.config.card_slot_number", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2477 { &hf_gryphon_config_max_extra_data
,
2478 { "Maximum extra data (bytes)", "gryphon.config.max_extra_data", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2480 { &hf_gryphon_config_min_extra_data
,
2481 { "Minimum extra data (bytes)", "gryphon.config.min_extra_data", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2483 { &hf_gryphon_sched_num_iterations
,
2484 { "Number of iterations", "gryphon.sched.num_iterations", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2486 { &hf_gryphon_sched_flags
,
2487 { "Flags", "gryphon.sched.flags", FT_UINT32
, BASE_HEX
, NULL
, 0x0,
2489 { &hf_gryphon_sched_flags_scheduler
,
2490 { "Scheduler", "gryphon.sched.flags.scheduler", FT_BOOLEAN
, 32, TFS(&critical_normal
), 0x01,
2492 { &hf_gryphon_sched_sleep
,
2493 { "Sleep (milliseconds)", "gryphon.sched.sleep", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2495 { &hf_gryphon_sched_transmit_count
,
2496 { "Transmit count", "gryphon.sched.transmit_count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2498 { &hf_gryphon_sched_transmit_period
,
2499 { "Transmit period (milliseconds)", "gryphon.sched.transmit_period", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2501 { &hf_gryphon_sched_transmit_flags
,
2502 { "Flags", "gryphon.sched.transmit_flags", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
2504 { &hf_gryphon_sched_skip_transmit_period
,
2505 { "Last transmit period", "gryphon.sched.skip_transmit_period", FT_BOOLEAN
, 16, TFS(&skip_not_skip
), 0x01,
2507 { &hf_gryphon_sched_skip_sleep
,
2508 { "Last transmit period", "gryphon.sched.skip_transmit_period", FT_BOOLEAN
, 16, TFS(&skip_not_skip
), 0x01,
2510 { &hf_gryphon_sched_channel
,
2511 { "Channel", "gryphon.sched.channel", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2513 { &hf_gryphon_sched_rep_id
,
2514 { "Schedule ID", "gryphon.sched.rep_id", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2516 { &hf_gryphon_sched_rep_message_index
,
2517 { "Message index", "gryphon.sched.rep_message_index", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2519 { &hf_gryphon_blm_data_time
,
2520 { "Timestamp", "gryphon.blm_data.time", FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x0,
2522 { &hf_gryphon_blm_data_bus_load
,
2523 { "Bus load average (%)", "gryphon.blm_data.bus_load", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2525 { &hf_gryphon_blm_data_current_bus_load
,
2526 { "Current bus load (%)", "gryphon.blm_data.current_bus_load", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2528 { &hf_gryphon_blm_data_peak_bus_load
,
2529 { "Peak bus load (%)", "gryphon.blm_data.peak_bus_load", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2531 { &hf_gryphon_blm_data_historic_peak_bus_load
,
2532 { "Historic peak bus load (%)", "gryphon.blm_data.historic_peak_bus_load", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2534 { &hf_gryphon_blm_stat_receive_frame_count
,
2535 { "Receive frame count", "gryphon.blm_stat.receive_frame_count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2537 { &hf_gryphon_blm_stat_transmit_frame_count
,
2538 { "Transmit frame count", "gryphon.blm_stat.transmit_frame_count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2540 { &hf_gryphon_blm_stat_receive_dropped_frame_count
,
2541 { "Receive dropped frame count", "gryphon.blm_stat.receive_dropped_frame_count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2543 { &hf_gryphon_blm_stat_transmit_dropped_frame_count
,
2544 { "Transmit dropped frame count", "gryphon.blm_stat.transmit_dropped_frame_count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2546 { &hf_gryphon_blm_stat_receive_error_count
,
2547 { "Receive error count", "gryphon.blm_stat.receive_error_count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2549 { &hf_gryphon_blm_stat_transmit_error_count
,
2550 { "Transmit error count", "gryphon.blm_stat.transmit_error_count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2552 { &hf_gryphon_addresp_flags
,
2553 { "Flags", "gryphon.addresp.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
2555 { &hf_gryphon_addresp_flags_active
,
2556 { "Response", "gryphon.addresp.flags.active", FT_BOOLEAN
, 8, TFS(&active_inactive
), FILTER_ACTIVE_FLAG
,
2558 { &hf_gryphon_addresp_blocks
,
2559 { "Number of filter blocks", "gryphon.addresp.blocks", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2561 { &hf_gryphon_addresp_responses
,
2562 { "Number of response blocks", "gryphon.addresp.responses", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2564 { &hf_gryphon_addresp_old_handle
,
2565 { "Old handle", "gryphon.addresp.old_handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2567 { &hf_gryphon_addresp_action
,
2568 { "Old handle", "gryphon.addresp.action", FT_UINT8
, BASE_DEC
, VALS(action_vals
), 0x07,
2570 { &hf_gryphon_addresp_action_period
,
2571 { "Period", "gryphon.addresp.action_period", FT_BOOLEAN
, 8, TFS(&frames_01seconds
), FR_PERIOD_MSGS
,
2573 { &hf_gryphon_addresp_action_deact_on_event
,
2574 { "Deact on event", "gryphon.addresp.action.deact_on_event", FT_UINT8
, BASE_DEC
, VALS(deact_on_event_vals
), FR_DELETE
|FR_DEACT_ON_EVENT
,
2576 { &hf_gryphon_addresp_action_deact_after_period
,
2577 { "Deact on Period", "gryphon.addresp.action.deact_after_period", FT_UINT8
, BASE_DEC
, VALS(deact_after_per_vals
), FR_DELETE
|FR_DEACT_AFTER_PER
,
2579 { &hf_gryphon_addresp_action_period_type
,
2580 { "Period", "gryphon.addresp.action_period_type", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2582 { &hf_gryphon_addresp_handle
,
2583 { "Response handle", "gryphon.addresp.handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2585 { &hf_gryphon_modresp_handle
,
2586 { "Response handle", "gryphon.modresp.handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2588 { &hf_gryphon_modresp_action
,
2589 { "Action response", "gryphon.modresp.action", FT_UINT8
, BASE_DEC
, VALS(filtacts
), 0x0,
2591 { &hf_gryphon_num_resphan
,
2592 { "Number of response handles", "gryphon.num_resphan", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2594 { &hf_gryphon_transmit_sched_id
,
2595 { "Transmit schedule ID", "gryphon.transmit_sched_id", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2597 { &hf_gryphon_desc_program_size
,
2598 { "Program size", "gryphon.desc.program_size", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2600 { &hf_gryphon_desc_program_name
,
2601 { "Program name", "gryphon.desc.program_name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2603 { &hf_gryphon_desc_program_description
,
2604 { "Program description", "gryphon.desc.program_description", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2606 { &hf_gryphon_desc_flags
,
2607 { "Flags", "gryphon.desc.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
2609 { &hf_gryphon_desc_flags_program
,
2610 { "Period", "gryphon.desc.flags.program", FT_BOOLEAN
, 8, TFS(&present_not_present
), 0x01,
2612 { &hf_gryphon_desc_handle
,
2613 { "Handle", "gryphon.desc.handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2615 { &hf_gryphon_upload_block_number
,
2616 { "Block number", "gryphon.upload.block_number", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2618 { &hf_gryphon_upload_handle
,
2619 { "Handle", "gryphon.upload.handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2621 { &hf_gryphon_upload_data
,
2622 { "Data", "gryphon.upload.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2624 { &hf_gryphon_delete
,
2625 { "Program name", "gryphon.delete", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2627 { &hf_gryphon_list_block_number
,
2628 { "Block number", "gryphon.list.block_number", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2630 { &hf_gryphon_list_num_programs
,
2631 { "Number of programs in this response", "gryphon.list.num_programs", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2633 { &hf_gryphon_list_num_remain_programs
,
2634 { "Number of remaining programs", "gryphon.list.num_remain_programs", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2636 { &hf_gryphon_list_name
,
2637 { "Name", "gryphon.list.name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2639 { &hf_gryphon_list_description
,
2640 { "Description", "gryphon.list.description", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2642 { &hf_gryphon_start_arguments
,
2643 { "Arguments", "gryphon.start.arguments", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2645 { &hf_gryphon_start_channel
,
2646 { "Channel (Client) number", "gryphon.start.channel", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2648 { &hf_gryphon_status_num_running_copies
,
2649 { "Number of running copies", "gryphon.status.num_running_copies", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2651 { &hf_gryphon_options_handle
,
2652 { "Handle", "gryphon.options.handle", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2654 { &hf_gryphon_files
,
2655 { "Directory", "gryphon.files", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2657 { &hf_gryphon_usdt_flags_register
,
2658 { "USDT", "gryphon.usdt.flags_register", FT_UINT8
, BASE_DEC
, VALS(register_unregister
), 0x01,
2660 { &hf_gryphon_usdt_action_flags
,
2661 { "Action Flags", "gryphon.usdt.action_flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
2663 { &hf_gryphon_usdt_action_flags_register
,
2664 { "Register", "gryphon.usdt.action_flags.register", FT_UINT8
, BASE_DEC
, VALS(register_unregister
), 0x01,
2666 { &hf_gryphon_usdt_action_flags_action
,
2667 { "Action", "gryphon.usdt.action_flags.action", FT_UINT8
, BASE_DEC
, VALS(usdt_action_vals
), 0x06,
2669 { &hf_gryphon_usdt_transmit_options_flags
,
2670 { "Transmit options", "gryphon.usdt.transmit_options_flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
2672 { &hf_gryphon_usdt_transmit_options_flags_echo
,
2673 { "Echo long transmit messages back to the client", "gryphon.usdt.transmit_options_flags.echo",
2674 FT_BOOLEAN
, 8, TFS(&yes_no
), 0x01, NULL
, HFILL
}},
2675 { &hf_gryphon_usdt_transmit_options_action
,
2676 { "Transmit Action", "gryphon.usdt.transmit_options_flags.action", FT_UINT8
, BASE_DEC
, VALS(xmit_opt_vals
), 0x06,
2678 { &hf_gryphon_usdt_transmit_options_send_done
,
2679 { "Send a USDT_DONE event when the last frame of a multi-frame USDT message is transmitted",
2680 "gryphon.usdt.transmit_options_flags.send_done", FT_BOOLEAN
, 8, TFS(&yes_no
), 0x08, NULL
, HFILL
}},
2681 { &hf_gryphon_usdt_receive_options_flags
,
2682 { "Receive options", "gryphon.usdt.receive_options_flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
2684 { &hf_gryphon_usdt_receive_options_action
,
2685 { "Receive Action", "gryphon.usdt.receive_options_flags.action", FT_UINT8
, BASE_DEC
, VALS(recv_opt_vals
), 0x03,
2687 { &hf_gryphon_usdt_receive_options_firstframe
,
2688 { "Send a USDT_FIRSTFRAME event when the first frame of a multi-frame USDT message is received",
2689 "gryphon.usdt.receive_options_flags.firstframe", FT_BOOLEAN
, 8, TFS(&yes_no
), 0x04, NULL
, HFILL
}},
2690 { &hf_gryphon_usdt_receive_options_lastframe
,
2691 { "Send a USDT_LASTFRAME event when the first frame of a multi-frame USDT message is received",
2692 "gryphon.usdt.receive_options_flags.lastframe", FT_BOOLEAN
, 8, TFS(&yes_no
), 0x08, NULL
, HFILL
}},
2693 { &hf_gryphon_usdt_ext_address
,
2694 { "Using extended addressing for", "gryphon.usdt.ext_address", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2696 { &hf_gryphon_usdt_ext_address_id
,
2697 { "ID", "gryphon.usdt.ext_address.id", FT_UINT32
, BASE_HEX
, NULL
, 0x0,
2699 { &hf_gryphon_usdt_block_size
,
2700 { "Number of IDs in the block", "gryphon.usdt.block_size", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2702 { &hf_gryphon_bits_in_input1
,
2703 { "Input 1", "gryphon.bits_in.input1", FT_BOOLEAN
, 8, TFS(&set_not_set
), 0x01,
2705 { &hf_gryphon_bits_in_input2
,
2706 { "Input 2", "gryphon.bits_in.input2", FT_BOOLEAN
, 8, TFS(&set_not_set
), 0x02,
2708 { &hf_gryphon_bits_in_input3
,
2709 { "Input 3", "gryphon.bits_in.input3", FT_BOOLEAN
, 8, TFS(&set_not_set
), 0x04,
2711 { &hf_gryphon_bits_in_pushbutton
,
2712 { "Pushbutton", "gryphon.bits_in.pushbutton", FT_BOOLEAN
, 8, TFS(&set_not_set
), 0x08,
2714 { &hf_gryphon_bits_out_output1
,
2715 { "Input 1", "gryphon.bits_out.output1", FT_BOOLEAN
, 8, TFS(&set_not_set
), 0x01,
2717 { &hf_gryphon_bits_out_output2
,
2718 { "Input 2", "gryphon.bits_out.output2", FT_BOOLEAN
, 8, TFS(&set_not_set
), 0x02,
2720 { &hf_gryphon_init_strat_reset_limit
,
2721 { "Reset Limit", "gryphon.init_strat.reset_limit", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2723 { &hf_gryphon_init_strat_delay
,
2724 { "Delay", "gryphon.init_strat.strat_delay", FT_FLOAT
, BASE_NONE
, NULL
, 0x0,
2726 { &hf_gryphon_speed_baud_rate_index
,
2727 { "Baud rate index", "gryphon.speed.baud_rate_index", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2729 { &hf_gryphon_filter_block_filter_start
,
2730 { "Filter field starts at byte", "gryphon.filter_block.filter_start", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2732 { &hf_gryphon_filter_block_filter_length
,
2733 { "Filter field length", "gryphon.filter_block.filter_length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2735 { &hf_gryphon_filter_block_filter_type
,
2736 { "Filtering on", "gryphon.filter_block.filter_type", FT_UINT8
, BASE_DEC
, VALS(filter_data_types
), 0x0,
2738 { &hf_gryphon_filter_block_filter_operator
,
2739 { "Type of comparison", "gryphon.filter_block.filter_operator", FT_UINT8
, BASE_DEC
, VALS(operators
), 0x0,
2741 { &hf_gryphon_filter_block_filter_value1
,
2742 { "Value", "gryphon.filter_block.filter_value", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2744 { &hf_gryphon_filter_block_filter_value2
,
2745 { "Value", "gryphon.filter_block.filter_value", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2747 { &hf_gryphon_filter_block_filter_value4
,
2748 { "Value", "gryphon.filter_block.filter_value", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2750 { &hf_gryphon_filter_block_filter_value_bytes
,
2751 { "Value", "gryphon.filter_block.filter_value_bytes", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2753 { &hf_gryphon_blm_mode
,
2754 { "Mode", "gryphon.blm_mode", FT_UINT32
, BASE_DEC
, VALS(blm_mode_vals
), 0x0,
2756 { &hf_gryphon_blm_mode_avg_period
,
2757 { "Averaging period (seconds)", "gryphon.blm_mode.avg_period", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2759 { &hf_gryphon_blm_mode_avg_frames
,
2760 { "Averaging period (frames)", "gryphon.blm_mode.avg_frames", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2764 static gint
*ett
[] = {
2766 &ett_gryphon_header
,
2768 &ett_gryphon_command_data
,
2769 &ett_gryphon_response_data
,
2770 &ett_gryphon_data_header
,
2772 &ett_gryphon_data_body
,
2773 &ett_gryphon_cmd_filter_block
,
2774 &ett_gryphon_cmd_events_data
,
2775 &ett_gryphon_cmd_config_device
,
2776 &ett_gryphon_cmd_sched_data
,
2777 &ett_gryphon_cmd_sched_cmd
,
2778 &ett_gryphon_cmd_response_block
,
2779 &ett_gryphon_pgm_list
,
2780 &ett_gryphon_pgm_status
,
2781 &ett_gryphon_pgm_options
,
2782 &ett_gryphon_valid_headers
,
2783 &ett_gryphon_usdt_data
,
2784 &ett_gryphon_usdt_data_block
,
2785 &ett_gryphon_digital_data
,
2786 &ett_gryphon_blm_mode
2788 module_t
*gryphon_module
;
2790 proto_gryphon
= proto_register_protocol("DG Gryphon Protocol",
2793 proto_register_field_array(proto_gryphon
, hf
, array_length(hf
));
2794 proto_register_subtree_array(ett
, array_length(ett
));
2796 gryphon_module
= prefs_register_protocol(proto_gryphon
, NULL
);
2797 prefs_register_bool_preference(gryphon_module
, "desegment",
2798 "Desegment all Gryphon messages spanning multiple TCP segments",
2799 "Whether the Gryphon dissector should desegment all messages spanning multiple TCP segments",
2800 &gryphon_desegment
);
2804 proto_reg_handoff_gryphon(void)
2806 dissector_handle_t gryphon_handle
;
2808 gryphon_handle
= new_create_dissector_handle(dissect_gryphon
, proto_gryphon
);
2809 dissector_add_uint("tcp.port", 7000, gryphon_handle
);