2 * Harman HiQnet protocol dissector for Wireshark
3 * By Raphael Doursenaud <rdoursenaud@free.fr>
4 * Copyright 2014 Raphael Doursenaud
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
15 #include <epan/packet.h>
16 #include <epan/expert.h>
17 #include "packet-tcp.h"
21 * https://adn.harmanpro.com/site_elements/resources/487_1411413911/HiQnet_third-party_programmers_quick-start_guide_original.pdf
22 * https://adn.harmanpro.com/site_elements/resources/515_1414083576/HiQnet_Third_Party_Programmers_Guide_v2_original.pdf
25 #define HIQNET_PORT 3804
27 #define HIQNET_FLAGS_MASK 0x016f
29 #define HIQNET_REQACK_FLAG 0x0001
30 #define HIQNET_ACK_FLAG 0x0002
31 #define HIQNET_INFO_FLAG 0x0004
32 #define HIQNET_ERROR_FLAG 0x0008
33 #define HIQNET_GUARANTEED_FLAG 0x0020
34 #define HIQNET_MULTIPART_FLAG 0x0040
35 #define HIQNET_SESSION_NUMBER_FLAG 0x0100
37 #define HIQNET_SUBSCRIPTION_TYPE_MASK 0x07
39 #define HIQNET_SUBSCRIPTION_FLAGS_MASK 0x0001
41 #define HIQNET_CATEGORIES_MASK 0x00004ffe
43 #define HIQNET_APPLICATION_CAT 0x00000002
44 #define HIQNET_CONF_CAT 0x00000004
45 #define HIQNET_AUDIONET_CAT 0x00000008
46 #define HIQNET_CTRLNET_CAT 0x00000010
47 #define HIQNET_VENDNET_CAT 0x00000020
48 #define HIQNET_STARTUP_CAT 0x00000040
49 #define HIQNET_DSP_CAT 0x00000080
50 #define HIQNET_MISC_CAT 0x00000100
51 #define HIQNET_CTRLLOG_CAT 0x00000200
52 #define HIQNET_FOREIGNPROTO_CAT 0x00000400
53 #define HIQNET_DIGIO_CAT 0x00000800
54 #define HIQNET_CTRLSURF_CAT 0x00004000
56 /* Routing layer message IDs */
57 #define HIQNET_DISCOINFO_MSG 0x0000
58 #define HIQNET_RESERVED0_MSG 0x0001
59 #define HIQNET_GETNETINFO_MSG 0x0002
60 #define HIQNET_RESERVED1_MSG 0x0003
61 #define HIQNET_REQADDR_MSG 0x0004
62 #define HIQNET_ADDRUSED_MSG 0x0005
63 #define HIQNET_SETADDR_MSG 0x0006
64 #define HIQNET_GOODBYE_MSG 0x0007
65 #define HIQNET_HELLO_MSG 0x0008
67 /* Other message IDs */
68 #define HIQNET_MULTPARMSET_MSG 0x0100
69 #define HIQNET_MULTOBJPARMSET_MSG 0x0101
70 #define HIQNET_PARMSETPCT_MSG 0x0102
71 #define HIQNET_MULTPARMGET_MSG 0x0103
72 #define HIQNET_GETATTR_MSG 0x010d
73 #define HIQNET_SETATTR_MSG 0x010e /* Reverse engineered. Not part of the official spec. */
74 #define HIQNET_MULTPARMSUB_MSG 0x010f
75 #define HIQNET_PARMSUBPCT_MSG 0x0111
76 #define HIQNET_MULTPARMUNSUB_MSG 0x0112
77 #define HIQNET_PARMSUBALL_MSG 0x0113
78 #define HIQNET_PARMUNSUBALL_MSG 0x0114
79 #define HIQNET_SUBEVTLOGMSGS_MSG 0x0115
80 #define HIQNET_GETVDLIST_MSG 0x011a
81 #define HIQNET_STORE_MSG 0x0124
82 #define HIQNET_RECALL_MSG 0x0125
83 #define HIQNET_LOCATE_MSG 0x0129
84 #define HIQNET_UNSUBEVTLOGMSGS_MSG 0x012b
85 #define HIQNET_REQEVTLOG_MSG 0x012c
87 #define HIQNET_TCPIP_NET 1
88 #define HIQNET_RS232_NET 4
90 static const value_string device_attributes_names
[] = {
93 /* Device Manager attributes */
95 { 3, "Serial Number" },
96 { 4, "Software Version" },
100 static const value_string messageidnames
[] = {
101 { HIQNET_DISCOINFO_MSG
, "DiscoInfo" },
102 { HIQNET_RESERVED0_MSG
, "Reserved" },
103 { HIQNET_GETNETINFO_MSG
, "GetNetworkInfo" },
104 { HIQNET_RESERVED1_MSG
, "Reserved" },
105 { HIQNET_REQADDR_MSG
, "RequestAddress" },
106 { HIQNET_ADDRUSED_MSG
, "AddressUsed" },
107 { HIQNET_SETADDR_MSG
, "SetAddress" },
108 { HIQNET_GOODBYE_MSG
, "Goodbye" },
109 { HIQNET_HELLO_MSG
, "Hello" },
110 { HIQNET_MULTPARMSET_MSG
, "MultiParamSet" },
111 { HIQNET_MULTOBJPARMSET_MSG
, "MultiObjectParamSet" },
112 { HIQNET_PARMSETPCT_MSG
, "ParamSetPercent" },
113 { HIQNET_MULTPARMGET_MSG
, "MultiParamGet" },
114 { HIQNET_GETATTR_MSG
, "GetAttributes" },
115 { HIQNET_MULTPARMSUB_MSG
, "MultiParamSubscribe" },
116 { HIQNET_PARMSUBPCT_MSG
, "ParamSubscribePercent" },
117 { HIQNET_SETATTR_MSG
, "SetAttribute" }, /* Reverse engineered. Not part of the official spec. */
118 { HIQNET_MULTPARMUNSUB_MSG
, "MultiParamUnsubscribe" },
119 { HIQNET_PARMSUBALL_MSG
, "ParameterSubscribeAll" },
120 { HIQNET_PARMUNSUBALL_MSG
, "ParameterUnSubscribeAll" },
121 { HIQNET_SUBEVTLOGMSGS_MSG
, "Subscribe Event Log Messages" },
122 { HIQNET_GETVDLIST_MSG
, "GetVDList" },
123 { HIQNET_STORE_MSG
, "Store" },
124 { HIQNET_RECALL_MSG
, "Recall" },
125 { HIQNET_LOCATE_MSG
, "Locate" },
126 { HIQNET_UNSUBEVTLOGMSGS_MSG
, "Unsubscribe Event Log Messages" },
127 { HIQNET_REQEVTLOG_MSG
, "Request Event Log" },
132 static const value_string flagnames
[] = {
133 { HIQNET_REQACK_FLAG
, "Request Acknowledgement" },
134 { HIQNET_ACK_FLAG
, "Acknowledgement" },
135 { HIQNET_INFO_FLAG
, "Information" },
136 { HIQNET_ERROR_FLAG
, "Error" },
137 { HIQNET_GUARANTEED_FLAG
, "Guaranteed" },
138 { HIQNET_MULTIPART_FLAG
, "Multi-part" },
139 { HIQNET_SESSION_NUMBER_FLAG
, "Session Number" },
144 #define HIQNET_DATATYPE_BYTE 0
145 #define HIQNET_DATATYPE_UBYTE 1
146 #define HIQNET_DATATYPE_WORD 2
147 #define HIQNET_DATATYPE_UWORD 3
148 #define HIQNET_DATATYPE_LONG 4
149 #define HIQNET_DATATYPE_ULONG 5
150 #define HIQNET_DATATYPE_FLOAT32 6
151 #define HIQNET_DATATYPE_FLOAT64 7
152 #define HIQNET_DATATYPE_BLOCK 8
153 #define HIQNET_DATATYPE_STRING 9
154 #define HIQNET_DATATYPE_LONG64 10
155 #define HIQNET_DATATYPE_ULONG64 11
157 static const value_string datatypenames
[] = {
158 { HIQNET_DATATYPE_BYTE
, "BYTE" },
159 { HIQNET_DATATYPE_UBYTE
, "UBYTE" },
160 { HIQNET_DATATYPE_WORD
, "WORD" },
161 { HIQNET_DATATYPE_UWORD
, "UWORD" },
162 { HIQNET_DATATYPE_LONG
, "LONG" },
163 { HIQNET_DATATYPE_ULONG
, "ULONG" },
164 { HIQNET_DATATYPE_FLOAT32
, "FLOAT32" },
165 { HIQNET_DATATYPE_FLOAT64
, "FLOAT64" },
166 { HIQNET_DATATYPE_BLOCK
, "BLOCK" },
167 { HIQNET_DATATYPE_STRING
, "STRING" },
168 { HIQNET_DATATYPE_LONG64
, "LONG64" },
169 { HIQNET_DATATYPE_ULONG64
, "ULONG64" },
173 static const value_string actionnames
[] = {
175 { 1, "Subscriptions" },
183 static const value_string timenames
[] = {
184 { 0x0000, "Turn off locate LEDs" },
185 { 0xffff, "Turn on locate LEDs" },
189 static const value_string eventcategorynames
[] = {
191 { 1, "Application" },
192 { 2, "Configuration" },
193 { 3, "Audio Network" },
194 { 4, "Control Network" },
195 { 5, "Vendor Network" },
198 { 8, "Miscellaneous" },
199 { 9, "Control Logic" },
200 { 10, "Foreign Protocol" },
201 { 11, "Digital I/O" },
202 { 12, "Unassigned" },
203 { 13, "Unassigned" },
204 { 14, "Control Surface" },
205 { 15, "Unassigned" },
206 { 16, "Unassigned" },
207 { 17, "Unassigned" },
208 { 18, "Unassigned" },
209 { 19, "Unassigned" },
210 { 20, "Unassigned" },
211 { 21, "Unassigned" },
212 { 22, "Unassigned" },
213 { 23, "Unassigned" },
214 { 24, "Unassigned" },
215 { 25, "Unassigned" },
216 { 26, "Unassigned" },
217 { 27, "Unassigned" },
218 { 28, "Unassigned" },
219 { 29, "Unassigned" },
220 { 30, "Unassigned" },
221 { 31, "Unassigned" },
225 static const value_string eventidnames
[] = {
226 { 0x0001, "Invalid Version" },
227 { 0x0002, "Invalid Length" },
228 { 0x0003, "Invalid Virtual Device" },
229 { 0x0004, "Invalid Object" },
230 { 0x0005, "Invalid Parameter" },
231 { 0x0006, "Invalid Message ID" },
232 { 0x0007, "Invalid Value" },
233 { 0x0008, "Resource Unavailable" },
234 { 0x0009, "Unsupported" },
235 { 0x000a, "Invalid Virtual Device Class" },
236 { 0x000b, "Invalid Object Class" },
237 { 0x000c, "Invalid Parameter Class" },
238 { 0x000d, "Invalid Attribute ID" },
239 { 0x000e, "Invalid DataType" },
240 { 0x000f, "Invalid Configuration" },
241 { 0x0010, "Flash Error" },
242 { 0x0011, "Not a Router" },
246 static const value_string prioritynames
[] = {
249 { 2, "Information" },
253 static const value_string networknames
[] = {
254 { HIQNET_TCPIP_NET
, "TCP/IP" },
257 { HIQNET_RS232_NET
, "RS232" },
261 static const value_string paritynames
[] = {
270 static const value_string stopbitsnames
[] = {
277 static const value_string flowcontrolnames
[] = {
284 static int proto_hiqnet
;
286 static int hf_hiqnet_version
;
288 static int ett_hiqnet
;
289 static int ett_hiqnet_flags
;
290 static int ett_hiqnet_cats
;
292 static int hf_hiqnet_headerlen
;
293 static int hf_hiqnet_messagelen
;
294 static int hf_hiqnet_sourcedev
;
295 static int hf_hiqnet_sourceaddr
;
296 static int hf_hiqnet_destdev
;
297 static int hf_hiqnet_destaddr
;
298 static int hf_hiqnet_messageid
;
299 static int hf_hiqnet_flags
;
300 static int hf_hiqnet_reqack_flag
;
301 static int hf_hiqnet_ack_flag
;
302 static int hf_hiqnet_info_flag
;
303 static int hf_hiqnet_error_flag
;
304 static int hf_hiqnet_guaranteed_flag
;
305 static int hf_hiqnet_multipart_flag
;
306 static int hf_hiqnet_session_number_flag
;
307 static int hf_hiqnet_hopcnt
;
308 static int hf_hiqnet_seqnum
;
309 static int hf_hiqnet_errcode
;
310 static int hf_hiqnet_errstr
;
311 static int hf_hiqnet_startseqno
;
312 static int hf_hiqnet_rembytes
;
313 static int hf_hiqnet_sessnum
;
314 static int hf_hiqnet_cost
;
315 static int hf_hiqnet_sernumlen
;
316 static int hf_hiqnet_sernum
;
317 static int hf_hiqnet_maxmsgsize
;
318 static int hf_hiqnet_keepaliveperiod
;
319 static int hf_hiqnet_netid
;
320 static int hf_hiqnet_macaddr
;
321 static int hf_hiqnet_dhcp
;
322 static int hf_hiqnet_ipaddr
;
323 static int hf_hiqnet_subnetmsk
;
324 static int hf_hiqnet_gateway
;
325 static int hf_hiqnet_flagmask
;
326 static int hf_hiqnet_paramcount
;
327 static int hf_hiqnet_paramid
;
328 static int hf_hiqnet_vdobject
;
329 static int hf_hiqnet_subtype
;
330 static int hf_hiqnet_sensrate
;
331 static int hf_hiqnet_subflags
;
332 static int hf_hiqnet_subcount
;
333 static int hf_hiqnet_pubparmid
;
334 static int hf_hiqnet_subaddr
;
335 static int hf_hiqnet_subparmid
;
336 static int hf_hiqnet_reserved0
;
337 static int hf_hiqnet_reserved1
;
338 static int hf_hiqnet_attrcount
;
339 static int hf_hiqnet_attrid
;
340 static int hf_hiqnet_datatype
;
341 static int hf_hiqnet_datalen
;
342 static int hf_hiqnet_byte_value
;
343 static int hf_hiqnet_ubyte_value
;
344 static int hf_hiqnet_word_value
;
345 static int hf_hiqnet_uword_value
;
346 static int hf_hiqnet_long_value
;
347 static int hf_hiqnet_ulong_value
;
348 static int hf_hiqnet_float32_value
;
349 static int hf_hiqnet_float64_value
;
350 static int hf_hiqnet_block_value
;
351 static int hf_hiqnet_string_value
;
352 static int hf_hiqnet_long64_value
;
353 static int hf_hiqnet_ulong64_value
;
354 static int hf_hiqnet_wrkgrppath
;
355 static int hf_hiqnet_numvds
;
356 static int hf_hiqnet_vdaddr
;
357 static int hf_hiqnet_vdclassid
;
358 static int hf_hiqnet_stract
;
359 static int hf_hiqnet_strnum
;
360 static int hf_hiqnet_scope
;
361 static int hf_hiqnet_recact
;
362 static int hf_hiqnet_recnum
;
363 static int hf_hiqnet_strlen
;
364 static int hf_hiqnet_time
;
365 static int hf_hiqnet_maxdatasize
;
366 static int hf_hiqnet_catfilter
;
367 static int hf_hiqnet_app_cat
;
368 static int hf_hiqnet_conf_cat
;
369 static int hf_hiqnet_audionet_cat
;
370 static int hf_hiqnet_ctrlnet_cat
;
371 static int hf_hiqnet_vendnet_cat
;
372 static int hf_hiqnet_startup_cat
;
373 static int hf_hiqnet_dsp_cat
;
374 static int hf_hiqnet_misc_cat
;
375 static int hf_hiqnet_ctrlog_cat
;
376 static int hf_hiqnet_foreignproto_cat
;
377 static int hf_hiqnet_digio_cat
;
378 static int hf_hiqnet_ctrlsurf_cat
;
379 static int hf_hiqnet_entrieslen
;
380 static int hf_hiqnet_category
;
381 static int hf_hiqnet_eventid
;
382 static int hf_hiqnet_priority
;
383 static int hf_hiqnet_eventseqnum
;
384 static int hf_hiqnet_eventtime
;
385 static int hf_hiqnet_eventdate
;
386 static int hf_hiqnet_eventinfo
;
387 static int hf_hiqnet_eventadddata
;
388 static int hf_hiqnet_objcount
;
389 static int hf_hiqnet_paramval
;
390 static int hf_hiqnet_ifacecount
;
391 static int hf_hiqnet_comid
;
392 static int hf_hiqnet_baudrate
;
393 static int hf_hiqnet_parity
;
394 static int hf_hiqnet_stopbits
;
395 static int hf_hiqnet_databits
;
396 static int hf_hiqnet_flowcontrol
;
397 static int hf_hiqnet_devaddr
;
398 static int hf_hiqnet_newdevaddr
;
400 static expert_field ei_hiqnet_datatype
;
402 static int * const hiqnet_flag_fields
[] = {
403 &hf_hiqnet_reqack_flag
,
405 &hf_hiqnet_info_flag
,
406 &hf_hiqnet_error_flag
,
407 &hf_hiqnet_guaranteed_flag
,
408 &hf_hiqnet_multipart_flag
,
409 &hf_hiqnet_session_number_flag
,
413 static int * const hiqnet_cat_fields
[] = {
416 &hf_hiqnet_audionet_cat
,
417 &hf_hiqnet_ctrlnet_cat
,
418 &hf_hiqnet_vendnet_cat
,
419 &hf_hiqnet_startup_cat
,
422 &hf_hiqnet_ctrlog_cat
,
423 &hf_hiqnet_foreignproto_cat
,
424 &hf_hiqnet_digio_cat
,
425 &hf_hiqnet_ctrlsurf_cat
,
429 void proto_register_hiqnet(void);
430 void proto_reg_handoff_hiqnet(void);
432 static dissector_handle_t hiqnet_udp_handle
;
433 static dissector_handle_t hiqnet_tcp_handle
;
436 hiqnet_display_vdobjectaddr(proto_tree
*hiqnet_tree
, int hf_hiqnet
, tvbuff_t
*tvb
, int offset
) {
437 proto_tree_add_bytes_format_value(hiqnet_tree
, hf_hiqnet
, tvb
, offset
, 4, NULL
,
439 tvb_get_uint8(tvb
, offset
), /* Virtual Device address */
440 tvb_get_uint8(tvb
, offset
+ 1), /* Object address part 1 */
441 tvb_get_uint8(tvb
, offset
+ 2), /* Object address part 2 */
442 tvb_get_uint8(tvb
, offset
+ 3)); /* Object address part 3 */
447 hiqnet_display_tcpipnetinfo(proto_tree
*hiqnet_payload_tree
, tvbuff_t
*tvb
, int offset
) {
448 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_macaddr
, tvb
, offset
, 6, ENC_NA
);
450 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_dhcp
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
452 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_ipaddr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
454 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_subnetmsk
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
456 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_gateway
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
463 hiqnet_display_rs232netinfo(proto_tree
*hiqnet_payload_tree
, tvbuff_t
*tvb
, int offset
) {
464 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_comid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
466 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_baudrate
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
468 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_parity
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
470 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_stopbits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
472 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_databits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
474 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_flowcontrol
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
481 hiqnet_display_netinfo(proto_tree
*hiqnet_payload_tree
, tvbuff_t
*tvb
, int offset
) {
483 netid
= tvb_get_uint8(tvb
, offset
);
484 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_netid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
486 if (netid
== HIQNET_TCPIP_NET
) {
487 offset
= hiqnet_display_tcpipnetinfo(hiqnet_payload_tree
, tvb
, offset
);
489 if (netid
== HIQNET_RS232_NET
) {
490 offset
= hiqnet_display_rs232netinfo(hiqnet_payload_tree
, tvb
, offset
);
497 hiqnet_display_sernum(proto_tree
*hiqnet_payload_tree
, tvbuff_t
*tvb
, int offset
) {
499 str_len
= tvb_get_ntohs(tvb
, offset
);
500 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_sernumlen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
502 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_sernum
, tvb
, offset
, str_len
, ENC_NA
);
509 hiqnet_display_paramsub(proto_tree
*hiqnet_payload_tree
, tvbuff_t
*tvb
, int offset
) {
510 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_pubparmid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
512 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_subtype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
514 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_subaddr
, tvb
, offset
, 6, ENC_NA
);
516 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_subparmid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
518 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_reserved0
, tvb
, offset
, 1, ENC_NA
);
520 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_reserved1
, tvb
, offset
, 2, ENC_NA
);
522 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_sensrate
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
528 /* TODO: decode flags for attributes and parameters */
530 hiqnet_display_data(proto_tree
*hiqnet_payload_tree
, packet_info
*pinfo
, tvbuff_t
*tvb
, int offset
) {
535 ti
= proto_tree_add_item_ret_uint(hiqnet_payload_tree
, hf_hiqnet_datatype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &datatype
);
539 case HIQNET_DATATYPE_BYTE
:
540 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_byte_value
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
544 case HIQNET_DATATYPE_UBYTE
:
545 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_ubyte_value
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
549 case HIQNET_DATATYPE_WORD
:
550 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_word_value
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
554 case HIQNET_DATATYPE_UWORD
:
555 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_uword_value
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
559 case HIQNET_DATATYPE_LONG
:
560 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_long_value
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
564 case HIQNET_DATATYPE_ULONG
:
565 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_ulong_value
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
569 case HIQNET_DATATYPE_FLOAT32
:
570 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_float32_value
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
574 case HIQNET_DATATYPE_FLOAT64
:
575 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_float64_value
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
579 case HIQNET_DATATYPE_BLOCK
:
580 proto_tree_add_item_ret_uint(hiqnet_payload_tree
, hf_hiqnet_datalen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &datalen
);
582 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_block_value
, tvb
, offset
, datalen
, ENC_NA
);
586 case HIQNET_DATATYPE_STRING
:
587 proto_tree_add_item_ret_uint(hiqnet_payload_tree
, hf_hiqnet_datalen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &datalen
);
589 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_string_value
, tvb
, offset
, datalen
, ENC_UCS_2
|ENC_BIG_ENDIAN
);
593 case HIQNET_DATATYPE_LONG64
:
594 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_long64_value
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
598 case HIQNET_DATATYPE_ULONG64
:
599 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_ulong64_value
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
604 /* Flag an error, and punt and assume these values have no length. */
605 expert_add_info(pinfo
, ti
, &ei_hiqnet_datatype
);
612 dissect_hiqnet_pdu(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
614 uint8_t headerlen
= 0;
615 uint32_t messagelen
= 0;
617 uint8_t srcvdaddr
= 0;
618 uint8_t srcob0addr
= 0;
619 uint8_t srcob1addr
= 0;
620 uint8_t srcob2addr
= 0;
622 uint8_t dstvdaddr
= 0;
623 uint8_t dstob0addr
= 0;
624 uint8_t dstob1addr
= 0;
625 uint8_t dstob2addr
= 0;
626 uint16_t messageid
= 0;
628 uint16_t paramcount
= 0;
629 uint16_t subcount
= 0;
630 uint16_t attrcount
= 0;
632 uint16_t vdscount
= 0;
633 uint16_t eventscount
= 0;
634 uint16_t objcount
= 0;
635 uint16_t ifacecount
= 0;
637 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "HiQnet");
638 /* Clear out stuff in the info column */
639 col_clear(pinfo
->cinfo
,COL_INFO
);
641 srcdev
= tvb_get_ntohs(tvb
, 6);
642 srcvdaddr
= tvb_get_uint8(tvb
, 8);
643 srcob0addr
= tvb_get_uint8(tvb
, 9);
644 srcob1addr
= tvb_get_uint8(tvb
, 10);
645 srcob2addr
= tvb_get_uint8(tvb
, 11);
646 dstdev
= tvb_get_ntohs(tvb
, 12);
647 dstvdaddr
= tvb_get_uint8(tvb
, 14);
648 dstob0addr
= tvb_get_uint8(tvb
, 15);
649 dstob1addr
= tvb_get_uint8(tvb
, 16);
650 dstob2addr
= tvb_get_uint8(tvb
, 17);
651 messageid
= tvb_get_ntohs(tvb
, 18);
652 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "Msg: %s, Src: %u.%u.%u.%u.%u, Dst: %u.%u.%u.%u.%u",
653 val_to_str(messageid
, messageidnames
, "Unknown (0x%04x)"),
654 srcdev
, srcvdaddr
, srcob0addr
, srcob1addr
, srcob2addr
,
655 dstdev
, dstvdaddr
, dstob0addr
, dstob1addr
, dstob2addr
);
657 if (tree
) { /* we are being asked for details */
658 proto_item
*ti
= NULL
;
659 proto_item
*item
= NULL
;
660 proto_tree
*hiqnet_tree
= NULL
;
661 proto_tree
*hiqnet_header_tree
= NULL
;
662 proto_tree
*hiqnet_session_tree
= NULL
;
663 proto_tree
*hiqnet_error_tree
= NULL
;
664 proto_tree
*hiqnet_multipart_tree
= NULL
;
665 proto_tree
*hiqnet_payload_tree
= NULL
;
666 proto_tree
*hiqnet_parameter_tree
= NULL
;
667 proto_tree
*hiqnet_attribute_tree
= NULL
;
668 proto_tree
*hiqnet_vds_tree
= NULL
;
669 proto_tree
*hiqnet_event_tree
= NULL
;
670 proto_tree
*hiqnet_subscription_tree
= NULL
;
671 proto_tree
*hiqnet_object_tree
= NULL
;
672 proto_tree
*hiqnet_ifaces_tree
= NULL
;
675 messagelen
= tvb_get_ntohl(tvb
, 2);
676 ti
= proto_tree_add_item(tree
, proto_hiqnet
, tvb
, 0, messagelen
, ENC_NA
);
677 proto_item_append_text(ti
, ", Msg: %s",
678 val_to_str(messageid
, messageidnames
, "Unknown (0x%04x)"));
679 proto_item_append_text(ti
, ", Src %u.%u.%u.%u.%u",
680 srcdev
, srcvdaddr
, srcob0addr
, srcob1addr
, srcob2addr
);
681 proto_item_append_text(ti
, ", Dst: %u.%u.%u.%u.%u",
682 dstdev
, dstvdaddr
, dstob0addr
, dstob1addr
, dstob2addr
);
683 hiqnet_tree
= proto_item_add_subtree(ti
, ett_hiqnet
);
686 headerlen
= tvb_get_uint8(tvb
, 1);
687 hiqnet_header_tree
= proto_tree_add_subtree(hiqnet_tree
, tvb
, 0, headerlen
, ett_hiqnet
, NULL
, "Header");
689 /* Standard header */
690 proto_tree_add_item(hiqnet_header_tree
, hf_hiqnet_version
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
692 proto_tree_add_item(hiqnet_header_tree
, hf_hiqnet_headerlen
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
694 proto_tree_add_item(hiqnet_header_tree
, hf_hiqnet_messagelen
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
696 proto_tree_add_item(hiqnet_header_tree
, hf_hiqnet_sourcedev
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
697 item
= proto_tree_add_item(hiqnet_header_tree
, hf_hiqnet_devaddr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
698 proto_item_set_hidden(item
);
700 hiqnet_display_vdobjectaddr(hiqnet_header_tree
, hf_hiqnet_sourceaddr
, tvb
, offset
);
702 proto_tree_add_item(hiqnet_header_tree
, hf_hiqnet_destdev
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
703 item
= proto_tree_add_item(hiqnet_header_tree
, hf_hiqnet_devaddr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
704 proto_item_set_hidden(item
);
706 hiqnet_display_vdobjectaddr(hiqnet_header_tree
, hf_hiqnet_destaddr
, tvb
, offset
);
708 proto_tree_add_item(hiqnet_header_tree
, hf_hiqnet_messageid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
710 flags
= tvb_get_ntohs(tvb
, offset
);
711 proto_tree_add_bitmask(hiqnet_header_tree
, tvb
, offset
, hf_hiqnet_flags
,
712 ett_hiqnet_flags
, hiqnet_flag_fields
, ENC_BIG_ENDIAN
);
714 proto_tree_add_item(hiqnet_header_tree
, hf_hiqnet_hopcnt
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
716 proto_tree_add_item(hiqnet_header_tree
, hf_hiqnet_seqnum
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
719 /* Optional headers */
720 if (flags
& HIQNET_ERROR_FLAG
) {
721 /* TODO: mark the erroneous frame */
722 hiqnet_error_tree
= proto_tree_add_subtree(hiqnet_header_tree
, tvb
, offset
, 2, ett_hiqnet
, NULL
, "Error");
723 proto_tree_add_item(hiqnet_error_tree
, hf_hiqnet_errcode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
725 proto_tree_add_item(hiqnet_error_tree
, hf_hiqnet_errstr
, tvb
, offset
, headerlen
- offset
, ENC_UCS_2
|ENC_BIG_ENDIAN
);
727 if (flags
& HIQNET_MULTIPART_FLAG
) {
728 /* TODO: rebuild the full message */
729 hiqnet_multipart_tree
= proto_tree_add_subtree(hiqnet_header_tree
, tvb
, offset
, 2, ett_hiqnet
, NULL
, "Multi-part");
730 proto_tree_add_item(hiqnet_multipart_tree
, hf_hiqnet_startseqno
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
732 proto_tree_add_item(hiqnet_multipart_tree
, hf_hiqnet_rembytes
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
735 if (flags
& HIQNET_SESSION_NUMBER_FLAG
) {
736 hiqnet_session_tree
= proto_tree_add_subtree(hiqnet_header_tree
, tvb
, offset
, 2, ett_hiqnet
, NULL
, "Session");
737 proto_tree_add_item(hiqnet_session_tree
, hf_hiqnet_sessnum
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
741 offset
= headerlen
; /* Make sure we are at the payload start */
742 hiqnet_payload_tree
= proto_tree_add_subtree(
743 hiqnet_tree
, tvb
, offset
, messagelen
- headerlen
, ett_hiqnet
, NULL
, "Payload");
745 case HIQNET_DISCOINFO_MSG
:
746 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_devaddr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
748 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_cost
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
750 offset
= hiqnet_display_sernum(hiqnet_payload_tree
, tvb
, offset
);
751 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_maxmsgsize
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
753 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_keepaliveperiod
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
755 hiqnet_display_netinfo(hiqnet_payload_tree
, tvb
, offset
);
757 case HIQNET_HELLO_MSG
:
758 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_sessnum
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
760 proto_tree_add_bitmask(hiqnet_payload_tree
, tvb
, offset
, hf_hiqnet_flagmask
,
761 ett_hiqnet_flags
, hiqnet_flag_fields
, ENC_BIG_ENDIAN
);
763 case HIQNET_MULTPARMGET_MSG
:
764 paramcount
= tvb_get_ntohs(tvb
, offset
);
765 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_paramcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
767 while (paramcount
> 0) {
768 hiqnet_parameter_tree
= proto_tree_add_subtree(
769 hiqnet_payload_tree
, tvb
, offset
, -1, ett_hiqnet
, NULL
, "Parameter");
770 proto_tree_add_item(hiqnet_parameter_tree
, hf_hiqnet_paramid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
772 if (flags
& HIQNET_INFO_FLAG
) { /* This is not a request */
773 offset
= hiqnet_display_data(hiqnet_parameter_tree
, pinfo
, tvb
, offset
);
778 case HIQNET_MULTPARMSET_MSG
:
779 paramcount
= tvb_get_ntohs(tvb
, offset
);
780 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_paramcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
782 while (paramcount
> 0) {
783 hiqnet_parameter_tree
= proto_tree_add_subtree(
784 hiqnet_payload_tree
, tvb
, offset
, -1, ett_hiqnet
, NULL
, "Parameter");
785 proto_tree_add_item(hiqnet_parameter_tree
, hf_hiqnet_paramid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
787 offset
= hiqnet_display_data(hiqnet_parameter_tree
, pinfo
, tvb
, offset
);
791 case HIQNET_PARMSUBALL_MSG
:
792 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_devaddr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
794 hiqnet_display_vdobjectaddr(hiqnet_payload_tree
, hf_hiqnet_vdobject
, tvb
, offset
);
796 /* TODO: can be decoded in two ways (old and new) */
797 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_subtype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
799 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_sensrate
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
801 /* TODO: decode and display */
802 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_subflags
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
804 case HIQNET_PARMUNSUBALL_MSG
: /* Reverse engineered. Not part of the official spec. */
805 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_devaddr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
807 hiqnet_display_vdobjectaddr(hiqnet_payload_tree
, hf_hiqnet_vdobject
, tvb
, offset
);
809 /* TODO: can be decoded in two ways (old and new) */
810 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_subtype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
812 case HIQNET_MULTPARMSUB_MSG
:
813 /* FIXME: Not tested, straight from the spec, never occurred with the devices I own */
814 subcount
= tvb_get_ntohs(tvb
, offset
);
815 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_subcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
817 while (subcount
> 0) {
818 hiqnet_subscription_tree
= proto_tree_add_subtree(
819 hiqnet_payload_tree
, tvb
, offset
, -1, ett_hiqnet
, NULL
, "Subscription");
820 offset
= hiqnet_display_paramsub(hiqnet_subscription_tree
, tvb
, offset
);
824 case HIQNET_GOODBYE_MSG
:
825 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_devaddr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
827 case HIQNET_GETATTR_MSG
:
828 attrcount
= tvb_get_ntohs(tvb
, offset
);
829 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_attrcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
831 if (flags
& HIQNET_INFO_FLAG
) { /* This not a request */
832 while (attrcount
> 0) {
833 hiqnet_attribute_tree
= proto_tree_add_subtree(
834 hiqnet_payload_tree
, tvb
, offset
, -1, ett_hiqnet
, NULL
, "Attribute");
835 proto_tree_add_item(hiqnet_attribute_tree
, hf_hiqnet_attrid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
837 offset
= hiqnet_display_data(hiqnet_attribute_tree
, pinfo
, tvb
, offset
);
840 } else { /* This may be a request */
841 while (attrcount
> 0) {
842 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_attrid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
848 case HIQNET_GETVDLIST_MSG
:
849 /* FIXME: Not tested, straight from the spec, never occurred with the devices I own */
850 str_len
= tvb_get_ntohs(tvb
, offset
);
851 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_strlen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
853 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_wrkgrppath
, tvb
, offset
, str_len
, ENC_UCS_2
|ENC_BIG_ENDIAN
);
855 if (flags
& HIQNET_INFO_FLAG
) { /* This is not a request */
856 vdscount
= tvb_get_ntohs(tvb
, offset
);
857 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_numvds
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
859 while (vdscount
> 0) {
860 hiqnet_vds_tree
= proto_tree_add_subtree(
861 hiqnet_payload_tree
, tvb
, offset
, -1, ett_hiqnet
, NULL
, "Virtual Devices");
862 proto_tree_add_item(hiqnet_vds_tree
, hf_hiqnet_vdaddr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
864 proto_tree_add_item(hiqnet_vds_tree
, hf_hiqnet_vdclassid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
870 case HIQNET_STORE_MSG
:
871 /* FIXME: Not tested, straight from the spec, never occurred with the devices I own */
872 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_stract
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
874 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_strnum
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
876 str_len
= tvb_get_ntohs(tvb
, offset
);
877 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_strlen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
879 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_wrkgrppath
, tvb
, offset
, str_len
, ENC_UCS_2
|ENC_BIG_ENDIAN
);
881 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_scope
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
883 case HIQNET_RECALL_MSG
:
884 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_recact
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
886 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_recnum
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
888 str_len
= tvb_get_ntohs(tvb
, offset
);
889 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_strlen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
891 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_wrkgrppath
, tvb
, offset
, str_len
, ENC_UCS_2
|ENC_BIG_ENDIAN
);
893 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_scope
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
895 case HIQNET_LOCATE_MSG
:
896 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_time
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
898 hiqnet_display_sernum(hiqnet_payload_tree
, tvb
, offset
);
900 case HIQNET_SUBEVTLOGMSGS_MSG
:
901 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_maxdatasize
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
903 proto_tree_add_bitmask(hiqnet_payload_tree
, tvb
, offset
, hf_hiqnet_catfilter
,
904 ett_hiqnet_cats
, hiqnet_cat_fields
, ENC_BIG_ENDIAN
);
906 case HIQNET_UNSUBEVTLOGMSGS_MSG
:
907 proto_tree_add_bitmask(hiqnet_payload_tree
, tvb
, offset
, hf_hiqnet_catfilter
,
908 ett_hiqnet_cats
, hiqnet_cat_fields
, ENC_BIG_ENDIAN
);
910 case HIQNET_REQEVTLOG_MSG
:
911 /* FIXME: Not tested, straight from the spec, never occurred with the devices I own */
912 if (flags
& HIQNET_INFO_FLAG
) { /* This is not a request */
913 eventscount
= tvb_get_ntohs(tvb
, offset
);
914 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_entrieslen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
916 while (eventscount
> 0) {
917 hiqnet_event_tree
= proto_tree_add_subtree(
918 hiqnet_payload_tree
, tvb
, offset
, -1, ett_hiqnet
, NULL
, "Event");
920 proto_tree_add_item(hiqnet_event_tree
, hf_hiqnet_category
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
923 proto_tree_add_item(hiqnet_event_tree
, hf_hiqnet_eventid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
925 proto_tree_add_item(hiqnet_event_tree
, hf_hiqnet_priority
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
927 proto_tree_add_item(hiqnet_event_tree
, hf_hiqnet_eventseqnum
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
929 str_len
= tvb_get_ntohs(tvb
, offset
);
930 proto_tree_add_item(hiqnet_event_tree
, hf_hiqnet_eventtime
, tvb
, offset
, str_len
, ENC_UCS_2
|ENC_BIG_ENDIAN
);
932 str_len
= tvb_get_ntohs(tvb
, offset
);
933 proto_tree_add_item(hiqnet_event_tree
, hf_hiqnet_eventdate
, tvb
, offset
, str_len
, ENC_UCS_2
|ENC_BIG_ENDIAN
);
935 str_len
= tvb_get_ntohs(tvb
, offset
);
936 proto_tree_add_item(hiqnet_event_tree
, hf_hiqnet_eventinfo
, tvb
, offset
, str_len
, ENC_UCS_2
|ENC_BIG_ENDIAN
);
938 str_len
= tvb_get_ntohs(tvb
, offset
);
940 hiqnet_event_tree
, hf_hiqnet_eventadddata
, tvb
, offset
, str_len
, ENC_NA
);
946 case HIQNET_MULTPARMUNSUB_MSG
:
947 /* FIXME: Not tested, straight from the spec, never occurred with the devices I own */
948 subcount
= tvb_get_ntohs(tvb
, offset
);
949 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_subcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
951 while (subcount
> 0) {
952 hiqnet_subscription_tree
= proto_tree_add_subtree(
953 hiqnet_payload_tree
, tvb
, offset
, -1, ett_hiqnet
, NULL
, "Subscription");
954 proto_tree_add_item(hiqnet_subscription_tree
, hf_hiqnet_pubparmid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
956 proto_tree_add_item(hiqnet_subscription_tree
, hf_hiqnet_subparmid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
961 case HIQNET_MULTOBJPARMSET_MSG
:
962 /* FIXME: Not tested, straight from the spec, never occurred with the devices I own */
963 objcount
= tvb_get_ntohs(tvb
, offset
);
964 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_objcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
966 while (objcount
> 0) {
967 hiqnet_object_tree
= proto_tree_add_subtree(
968 hiqnet_payload_tree
, tvb
, offset
, -1, ett_hiqnet
, NULL
, "Object");
969 hiqnet_display_vdobjectaddr(hiqnet_header_tree
, hf_hiqnet_vdobject
, tvb
, offset
);
971 paramcount
= tvb_get_ntohs(tvb
, offset
);
972 proto_tree_add_item(hiqnet_object_tree
, hf_hiqnet_paramcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
974 while (paramcount
> 0) {
975 hiqnet_parameter_tree
= proto_tree_add_subtree(
976 hiqnet_object_tree
, tvb
, offset
, -1, ett_hiqnet
, NULL
, "Parameter");
977 proto_tree_add_item(hiqnet_parameter_tree
, hf_hiqnet_paramid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
979 offset
= hiqnet_display_data(hiqnet_parameter_tree
, pinfo
, tvb
, offset
);
985 case HIQNET_PARMSETPCT_MSG
:
986 /* FIXME: Not tested, straight from the spec, never occurred with the devices I own */
987 paramcount
= tvb_get_ntohs(tvb
, offset
);
988 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_paramcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
990 while (paramcount
> 0) {
991 hiqnet_parameter_tree
= proto_tree_add_subtree(
992 hiqnet_payload_tree
, tvb
, offset
, -1, ett_hiqnet
, NULL
, "Parameter");
993 proto_tree_add_item(hiqnet_parameter_tree
, hf_hiqnet_paramid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
995 /* TODO: docode paramval is in percentage represented as a 1.15 signed fixed point format */
996 proto_tree_add_item(hiqnet_parameter_tree
, hf_hiqnet_paramval
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1001 case HIQNET_PARMSUBPCT_MSG
:
1002 /* FIXME: Not tested, straight from the spec, never occurred with the devices I own */
1003 subcount
= tvb_get_ntohs(tvb
, offset
);
1004 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_subcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1006 while (subcount
> 0) {
1007 hiqnet_subscription_tree
= proto_tree_add_subtree(
1008 hiqnet_payload_tree
, tvb
, offset
, -1, ett_hiqnet
, NULL
, "Subscription");
1009 offset
= hiqnet_display_paramsub(hiqnet_subscription_tree
, tvb
, offset
);
1013 case HIQNET_GETNETINFO_MSG
:
1014 /* FIXME: Not tested, straight from the spec, never occurred with the devices I own */
1015 offset
= hiqnet_display_sernum(hiqnet_payload_tree
, tvb
, offset
);
1016 if (flags
& HIQNET_INFO_FLAG
) { /* This is not a request */
1017 ifacecount
= tvb_get_ntohs(tvb
, offset
);
1018 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_ifacecount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1020 while (ifacecount
> 0) {
1021 hiqnet_ifaces_tree
= proto_tree_add_subtree(
1022 hiqnet_payload_tree
, tvb
, offset
, -1, ett_hiqnet
, NULL
, "Interface");
1023 proto_tree_add_item(hiqnet_ifaces_tree
, hf_hiqnet_maxmsgsize
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1025 offset
= hiqnet_display_netinfo(hiqnet_ifaces_tree
, tvb
, offset
);
1030 case HIQNET_REQADDR_MSG
:
1031 /* FIXME: Not tested, straight from the spec, never occurred with the devices I own */
1032 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_devaddr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1034 case HIQNET_SETADDR_MSG
:
1035 offset
= hiqnet_display_sernum(hiqnet_payload_tree
, tvb
, offset
);
1036 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_newdevaddr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1038 hiqnet_display_netinfo(hiqnet_payload_tree
, tvb
, offset
);
1040 case HIQNET_SETATTR_MSG
: /* Reverse engineered. Not part of the official spec. */
1041 attrcount
= tvb_get_ntohs(tvb
, offset
);
1042 proto_tree_add_item(hiqnet_payload_tree
, hf_hiqnet_attrcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1044 while (attrcount
> 0) {
1045 hiqnet_attribute_tree
= proto_tree_add_subtree(
1046 hiqnet_payload_tree
, tvb
, offset
, -1, ett_hiqnet
, NULL
, "Attribute");
1047 proto_tree_add_item(hiqnet_attribute_tree
, hf_hiqnet_attrid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1049 offset
= hiqnet_display_data(hiqnet_attribute_tree
, pinfo
, tvb
, offset
);
1053 /* FIXME: Messages unknown, assumed without payload */
1054 case HIQNET_RESERVED0_MSG
:
1055 case HIQNET_RESERVED1_MSG
:
1056 /* Message without payload */
1057 case HIQNET_ADDRUSED_MSG
:
1059 default : /* Unknown message or malformed packet */
1060 /* TODO: display something useful? */
1064 return tvb_reported_length(tvb
);
1069 get_hiqnet_pdu_len(packet_info
*pinfo _U_
, tvbuff_t
*tvb
, int offset
, void *data _U_
)
1071 /* length is at offset + 2 */
1072 return tvb_get_ntohl(tvb
, offset
+ 2);
1075 /* Fixme: For multiple hiqnet PDUS in a single TCP or UDP packet,
1076 the INFO column shows the information only for the last PDU */
1079 dissect_hiqnet_tcp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
)
1081 tcp_dissect_pdus(tvb
, pinfo
, tree
, true, 6,
1082 get_hiqnet_pdu_len
, dissect_hiqnet_pdu
, data
);
1083 return tvb_captured_length(tvb
);
1087 dissect_hiqnet_udp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
)
1093 unsigned captured_length
;
1095 /* loop on (possibly multiple) hiqnet PDUs in UDP payload */
1096 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
1097 plen
= get_hiqnet_pdu_len(pinfo
, tvb
, offset
, NULL
);
1098 captured_length
= tvb_captured_length_remaining(tvb
, offset
);
1100 if (captured_length
> plen
)
1101 captured_length
= plen
;
1102 next_tvb
= tvb_new_subset_length_caplen(tvb
, offset
, captured_length
, plen
);
1104 dissect_hiqnet_pdu(next_tvb
, pinfo
, tree
, data
);
1107 * Step to the next PDU.
1108 * Make sure we don't overflow.
1110 offset_before
= offset
;
1112 if (offset
<= offset_before
)
1115 return tvb_captured_length(tvb
);
1119 proto_register_hiqnet(void)
1121 static hf_register_info hf
[] = {
1122 { &hf_hiqnet_version
,
1123 { "Version", "hiqnet.version",
1128 { &hf_hiqnet_headerlen
,
1129 { "Header length", "hiqnet.hlen",
1130 FT_UINT16
, BASE_DEC
,
1134 { &hf_hiqnet_messagelen
,
1135 { "Message length", "hiqnet.mlen",
1136 FT_UINT32
, BASE_DEC
,
1140 { &hf_hiqnet_sourcedev
,
1141 { "Source device", "hiqnet.srcdev",
1142 FT_UINT16
, BASE_DEC_HEX
,
1146 { &hf_hiqnet_sourceaddr
,
1147 { "Source address", "hiqnet.srcaddr",
1148 FT_BYTES
, BASE_NONE
,
1152 { &hf_hiqnet_destdev
,
1153 { "Destination device", "hiqnet.dstdev",
1154 FT_UINT16
, BASE_DEC_HEX
,
1158 { &hf_hiqnet_destaddr
,
1159 { "Destination address", "hiqnet.dstaddr",
1160 FT_BYTES
, BASE_NONE
,
1164 { &hf_hiqnet_messageid
,
1165 { "Message ID", "hiqnet.msgid",
1166 FT_UINT16
, BASE_HEX
,
1167 VALS(messageidnames
), 0x0,
1171 { "Flags", "hiqnet.flags",
1172 FT_UINT16
, BASE_HEX
,
1173 NULL
, HIQNET_FLAGS_MASK
,
1176 { &hf_hiqnet_reqack_flag
,
1177 { "Request Acknowledgement", "hiqnet.flags.reqack",
1179 NULL
, HIQNET_REQACK_FLAG
,
1182 { &hf_hiqnet_ack_flag
,
1183 { "Acknowledgement", "hiqnet.flags.ack",
1185 NULL
, HIQNET_ACK_FLAG
,
1188 { &hf_hiqnet_info_flag
,
1189 { "Information", "hiqnet.flags.info",
1191 NULL
, HIQNET_INFO_FLAG
,
1194 { &hf_hiqnet_error_flag
,
1195 { "Error", "hiqnet.flags.error",
1197 NULL
, HIQNET_ERROR_FLAG
,
1200 { &hf_hiqnet_guaranteed_flag
,
1201 { "Guaranteed", "hiqnet.flags.guar",
1203 NULL
, HIQNET_GUARANTEED_FLAG
,
1206 { &hf_hiqnet_multipart_flag
,
1207 { "Multipart", "hiqnet.flags.multi",
1209 NULL
, HIQNET_MULTIPART_FLAG
,
1212 { &hf_hiqnet_session_number_flag
,
1213 { "Session Number", "hiqnet.flags.session_number",
1215 NULL
, HIQNET_SESSION_NUMBER_FLAG
,
1218 { &hf_hiqnet_hopcnt
,
1219 { "Hop count", "hiqnet.hc",
1224 { &hf_hiqnet_seqnum
,
1225 { "Sequence number", "hiqnet.seqnum",
1226 FT_UINT16
, BASE_DEC
,
1230 { &hf_hiqnet_errcode
,
1231 { "Error code", "hiqnet.errcode",
1232 FT_UINT8
, BASE_DEC_HEX
,
1236 { &hf_hiqnet_errstr
,
1237 { "Error string", "hiqnet.errstr",
1238 FT_STRINGZ
, BASE_NONE
,
1242 { &hf_hiqnet_startseqno
,
1243 { "Start seq. no.", "hiqnet.ssno",
1248 { &hf_hiqnet_rembytes
,
1249 { "Remaining bytes", "hiqnet.rembytes",
1250 FT_UINT32
, BASE_DEC
,
1254 { &hf_hiqnet_sessnum
,
1255 { "Session number", "hiqnet.sessnum",
1256 FT_UINT16
, BASE_DEC
,
1261 { "Cost", "hiqnet.cost",
1266 { &hf_hiqnet_sernumlen
,
1267 { "Serial number length", "hiqnet.sernumlen",
1268 FT_UINT16
, BASE_DEC
,
1272 { &hf_hiqnet_sernum
,
1273 { "Serial number", "hiqnet.sernum",
1274 FT_BYTES
, BASE_NONE
,
1278 { &hf_hiqnet_maxmsgsize
,
1279 { "Max message size", "hiqnet.maxmsgsize",
1280 FT_UINT32
, BASE_DEC
,
1284 { &hf_hiqnet_keepaliveperiod
,
1285 { "Keepalive period (ms)", "hiqnet.keepaliveperiod",
1286 FT_UINT16
, BASE_DEC
,
1291 { "Network ID", "hiqnet.netid",
1293 VALS(networknames
), 0x0,
1296 { &hf_hiqnet_macaddr
,
1297 { "MAC address", "hiqnet.macaddr",
1298 FT_ETHER
, BASE_NONE
,
1303 { "DHCP", "hiqnet.dhcp",
1304 FT_BOOLEAN
, BASE_NONE
,
1308 { &hf_hiqnet_ipaddr
,
1309 { "IP Address", "hiqnet.ipaddr",
1314 { &hf_hiqnet_subnetmsk
,
1315 { "Subnet mask", "hiqnet.subnetmsk",
1320 { &hf_hiqnet_gateway
,
1321 { "Gateway", "hiqnet.gateway",
1326 { &hf_hiqnet_flagmask
,
1327 { "Flag mask", "hiqnet.flagmask",
1328 FT_UINT16
, BASE_HEX
,
1329 NULL
, HIQNET_FLAGS_MASK
,
1332 { &hf_hiqnet_paramcount
,
1333 { "Parameter count", "hiqnet.paramcount",
1334 FT_UINT16
, BASE_DEC
,
1338 { &hf_hiqnet_paramid
,
1339 { "Parameter ID", "hiqnet.paramid",
1340 FT_UINT16
, BASE_DEC
,
1344 { &hf_hiqnet_vdobject
,
1345 { "Virtual Device Object", "hiqnet.vdobject",
1346 FT_BYTES
, BASE_NONE
,
1350 { &hf_hiqnet_subtype
,
1351 { "Subscription Type (New Style)", "hiqnet.subtype",
1353 NULL
, HIQNET_SUBSCRIPTION_TYPE_MASK
,
1356 /* FIXME: decode old style subscription type
1357 { &hf_hiqnet_subtypeold,
1358 { "Subscription Type (Old Style)", "hiqnet.subtype",
1360 VALS(subscription_types_oldstyle_names), 0x0,
1364 { &hf_hiqnet_sensrate
,
1365 { "Sensor Rate (ms)", "hiqnet.sensrate",
1366 FT_UINT16
, BASE_DEC
,
1370 { &hf_hiqnet_subflags
,
1371 { "Subscription Flags", "hiqnet.subflags",
1372 FT_UINT16
, BASE_HEX
,
1373 NULL
, HIQNET_SUBSCRIPTION_FLAGS_MASK
,
1376 { &hf_hiqnet_subcount
,
1377 { "No of Subscriptions", "hiqnet.subcount",
1378 FT_UINT16
, BASE_DEC
,
1382 { &hf_hiqnet_pubparmid
,
1383 { "Publisher Parameter ID", "hiqnet.pubparmid",
1384 FT_UINT16
, BASE_DEC
,
1388 { &hf_hiqnet_subaddr
,
1389 { "Subscriber Address", "hiqnet.subaddr",
1390 FT_BYTES
, BASE_NONE
,
1394 { &hf_hiqnet_subparmid
,
1395 { "Subscriber Parameter ID", "hiqnet.subparmid",
1396 FT_UINT16
, BASE_DEC
,
1400 { &hf_hiqnet_reserved0
,
1401 { "Reserved", "hiqnet.reserved0",
1402 FT_BYTES
, BASE_NONE
,
1406 { &hf_hiqnet_reserved1
,
1407 { "Reserved", "hiqnet.reserved1",
1408 FT_BYTES
, BASE_NONE
,
1412 { &hf_hiqnet_attrcount
,
1413 { "Attribute count", "hiqnet.attrcount",
1414 FT_UINT16
, BASE_DEC
,
1418 { &hf_hiqnet_attrid
,
1419 { "Attribute ID", "hiqnet.attrid",
1420 FT_UINT16
, BASE_DEC
,
1421 VALS(device_attributes_names
), 0x0,
1424 { &hf_hiqnet_datatype
,
1425 { "Data type", "hiqnet.datatype",
1427 VALS(datatypenames
), 0x0,
1430 { &hf_hiqnet_datalen
,
1431 { "Data length", "hiqnet.datalen",
1432 FT_UINT16
, BASE_DEC
,
1436 { &hf_hiqnet_byte_value
,
1437 { "Value", "hiqnet.byte_value",
1442 { &hf_hiqnet_ubyte_value
,
1443 { "Value", "hiqnet.ubyte_value",
1444 FT_UINT8
, BASE_DEC_HEX
,
1448 { &hf_hiqnet_word_value
,
1449 { "Value", "hiqnet.word_value",
1454 { &hf_hiqnet_uword_value
,
1455 { "Value", "hiqnet.uword_value",
1456 FT_UINT16
, BASE_DEC_HEX
,
1460 { &hf_hiqnet_long_value
,
1461 { "Value", "hiqnet.long_value",
1466 { &hf_hiqnet_ulong_value
,
1467 { "Value", "hiqnet.ulong_value",
1468 FT_UINT32
, BASE_DEC_HEX
,
1472 { &hf_hiqnet_float32_value
,
1473 { "Value", "hiqnet.float32_value",
1474 FT_FLOAT
, BASE_NONE
,
1478 { &hf_hiqnet_float64_value
,
1479 { "Value", "hiqnet.float64_value",
1480 FT_DOUBLE
, BASE_NONE
,
1484 { &hf_hiqnet_block_value
,
1485 { "Value", "hiqnet.block_value",
1486 FT_BYTES
, BASE_NONE
,
1490 /* Counted *and* null-terminated */
1491 { &hf_hiqnet_string_value
,
1492 { "Value", "hiqnet.string_value",
1493 FT_STRINGZ
, BASE_NONE
,
1497 { &hf_hiqnet_long64_value
,
1498 { "Value", "hiqnet.long64_value",
1503 { &hf_hiqnet_ulong64_value
,
1504 { "Value", "hiqnet.ulong64_value",
1505 FT_UINT64
, BASE_DEC_HEX
,
1509 { &hf_hiqnet_wrkgrppath
,
1510 { "Workgroup Path", "hiqnet.wrkgrppath",
1511 FT_STRINGZ
, BASE_NONE
,
1515 { &hf_hiqnet_numvds
,
1516 { "Number of Virtual Devices", "hiqnet.numvds",
1517 FT_UINT16
, BASE_DEC
,
1521 { &hf_hiqnet_vdaddr
,
1522 { "Virtual Device Address", "hiqnet.vdaddr",
1527 { &hf_hiqnet_vdclassid
,
1528 { "Virtual Device Class ID", "hiqnet.vdclassid",
1529 FT_UINT16
, BASE_HEX
,
1533 { &hf_hiqnet_stract
,
1534 { "Store Action", "hiqnet.stract",
1536 VALS(actionnames
), 0x0,
1539 { &hf_hiqnet_strnum
,
1540 { "Store Number", "hiqnet.strnum",
1541 FT_UINT16
, BASE_DEC
,
1546 { "Scope", "hiqnet.scope",
1551 { &hf_hiqnet_recact
,
1552 { "Recall Action", "hiqnet.rec.act",
1554 VALS(actionnames
), 0x0,
1557 { &hf_hiqnet_recnum
,
1558 { "Recall Number", "hiqnet.recnum",
1559 FT_UINT16
, BASE_DEC
,
1563 { &hf_hiqnet_strlen
,
1564 { "String length", "hiqnet.strlen",
1565 FT_UINT16
, BASE_DEC
,
1570 { "Locate time (ms)", "hiqnet.time",
1571 FT_UINT16
, BASE_DEC
,
1572 VALS(timenames
), 0x0,
1575 { &hf_hiqnet_maxdatasize
,
1576 { "Maximum Data Size", "hiqnet.maxdatasize",
1577 FT_UINT16
, BASE_DEC
,
1581 { &hf_hiqnet_catfilter
,
1582 { "Category Filter", "hiqnet.catfilter",
1583 FT_UINT32
, BASE_HEX
,
1584 NULL
, HIQNET_CATEGORIES_MASK
,
1587 { &hf_hiqnet_app_cat
,
1588 { "Application", "hiqnet.appcat",
1590 NULL
, HIQNET_APPLICATION_CAT
,
1593 { &hf_hiqnet_conf_cat
,
1594 { "Configuration", "hiqnet.confcat",
1596 NULL
, HIQNET_CONF_CAT
,
1599 { &hf_hiqnet_audionet_cat
,
1600 { "Audio Network", "hiqnet.audionetcat",
1602 NULL
, HIQNET_AUDIONET_CAT
,
1605 { &hf_hiqnet_ctrlnet_cat
,
1606 { "Control Network", "hiqnet.ctrlnetcat",
1608 NULL
, HIQNET_CTRLNET_CAT
,
1611 { &hf_hiqnet_vendnet_cat
,
1612 { "Vendor Network", "hiqnet.vendnetcat",
1614 NULL
, HIQNET_VENDNET_CAT
,
1617 { &hf_hiqnet_startup_cat
,
1618 { "Startup", "hiqnet.startupcat",
1620 NULL
, HIQNET_STARTUP_CAT
,
1623 { &hf_hiqnet_dsp_cat
,
1624 { "DSP", "hiqnet.dspcat",
1626 NULL
, HIQNET_DSP_CAT
,
1629 { &hf_hiqnet_misc_cat
,
1630 { "Miscellaneous", "hiqnet.misccat",
1632 NULL
, HIQNET_MISC_CAT
,
1635 { &hf_hiqnet_ctrlog_cat
,
1636 { "Control Logic", "hiqnet.crtllogcat",
1638 NULL
, HIQNET_CTRLLOG_CAT
,
1641 { &hf_hiqnet_foreignproto_cat
,
1642 { "Foreign Protocol", "hiqnet.foreignprotocat",
1644 NULL
, HIQNET_FOREIGNPROTO_CAT
,
1647 { &hf_hiqnet_digio_cat
,
1648 { "Digital I/O", "hiqnet.digiocat",
1650 NULL
, HIQNET_DIGIO_CAT
,
1653 { &hf_hiqnet_ctrlsurf_cat
,
1654 { "Control Surface", "hiqnet.ctrlsurfcat",
1656 NULL
, HIQNET_CTRLSURF_CAT
,
1659 { &hf_hiqnet_entrieslen
,
1660 { "Number of Entries", "hiqnet.entrieslen",
1661 FT_UINT16
, BASE_DEC
,
1665 { &hf_hiqnet_category
,
1666 { "Category", "hiqnet.cat",
1667 FT_UINT16
, BASE_HEX
,
1668 VALS(eventcategorynames
), 0x0,
1671 { &hf_hiqnet_eventid
,
1672 { "Event ID", "hiqnet.eventid",
1673 FT_UINT16
, BASE_DEC
,
1674 VALS(eventidnames
), 0x0,
1677 { &hf_hiqnet_priority
,
1678 { "Priority", "hiqnet.priority",
1680 VALS(prioritynames
), 0x0,
1683 { &hf_hiqnet_eventseqnum
,
1684 { "Sequence Number", "hiqnet.eventseqnum",
1685 FT_UINT32
, BASE_DEC
,
1689 { &hf_hiqnet_eventtime
,
1690 { "Time", "hiqnet.eventtime",
1691 FT_STRING
, BASE_NONE
,
1695 { &hf_hiqnet_eventdate
,
1696 { "Date", "hiqnet.eventdate",
1697 FT_STRING
, BASE_NONE
,
1701 { &hf_hiqnet_eventinfo
,
1702 { "Information", "hiqnet.information",
1703 FT_STRING
, BASE_NONE
,
1707 { &hf_hiqnet_eventadddata
,
1708 { "Additional Data", "hiqnet.eventadddata",
1709 FT_BYTES
, BASE_NONE
,
1713 { &hf_hiqnet_objcount
,
1714 { "Object Count", "hiqnet.objcount",
1715 FT_UINT16
, BASE_DEC
,
1719 { &hf_hiqnet_paramval
,
1720 { "Parameter Value (%)", "hiqnet.paramval",
1725 { &hf_hiqnet_ifacecount
,
1726 { "Interface Count", "hiqnet.ifacecount",
1727 FT_UINT16
, BASE_DEC
,
1732 { "Com Port Identifier", "hiqnet.comid",
1737 { &hf_hiqnet_baudrate
,
1738 { "Baud Rate", "hiqnet.baudrate",
1739 FT_UINT32
, BASE_DEC
,
1743 { &hf_hiqnet_parity
,
1744 { "Parity", "hiqnet.parity",
1746 VALS(paritynames
), 0x0,
1749 { &hf_hiqnet_stopbits
,
1750 { "Stop Bits", "hiqnet.stopbits",
1752 VALS(stopbitsnames
), 0x0,
1755 { &hf_hiqnet_databits
,
1756 { "Data Bits", "hiqnet.databits",
1761 { &hf_hiqnet_flowcontrol
,
1762 { "Flowcontrol", "hiqnet.flowcontrol",
1764 VALS(flowcontrolnames
), 0x0,
1767 { &hf_hiqnet_devaddr
,
1768 { "Device Address", "hiqnet.device",
1769 FT_UINT16
, BASE_DEC_HEX
,
1773 { &hf_hiqnet_newdevaddr
,
1774 { "New Device Address", "hiqnet.device",
1775 FT_UINT16
, BASE_DEC_HEX
,
1781 /* Setup protocol subtree array */
1782 static int *ett
[] = {
1788 static ei_register_info ei
[] = {
1789 { &ei_hiqnet_datatype
, { "hiqnet.datatype.invalid", PI_PROTOCOL
, PI_WARN
, "Invalid datatype", EXPFILL
}},
1792 expert_module_t
* expert_hiqnet
;
1794 proto_hiqnet
= proto_register_protocol ("Harman HiQnet", "HiQnet", "hiqnet");
1796 proto_register_field_array(proto_hiqnet
, hf
, array_length(hf
));
1797 proto_register_subtree_array(ett
, array_length(ett
));
1798 expert_hiqnet
= expert_register_protocol(proto_hiqnet
);
1799 expert_register_field_array(expert_hiqnet
, ei
, array_length(ei
));
1801 hiqnet_udp_handle
= register_dissector("hiqnet.udp", dissect_hiqnet_udp
, proto_hiqnet
);
1802 hiqnet_tcp_handle
= register_dissector("hiqnet.tcp", dissect_hiqnet_tcp
, proto_hiqnet
);
1807 proto_reg_handoff_hiqnet(void)
1809 dissector_add_uint_with_preference("udp.port", HIQNET_PORT
, hiqnet_udp_handle
);
1810 dissector_add_uint_with_preference("tcp.port", HIQNET_PORT
, hiqnet_tcp_handle
);
1814 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1818 * indent-tabs-mode: nil
1821 * vi: set shiftwidth=4 expandtab:
1822 * :indentSize=4:noTabs=true: