HTTPS (almost) everywhere.
[metze/wireshark/wip.git] / epan / dissectors / packet-gvcp.c
1 /* packet-gvcp.c
2  * Routines for AIA GigE Vision (TM) Control Protocol dissection
3  * Copyright 2012, AIA <www.visiononline.org> All rights reserved
4  *
5  * GigE Vision (TM): GigE Vision a standard developed under the sponsorship of the AIA for
6  * the benefit of the machine vision industry. GVCP stands for GigE Vision (TM) Control
7  * Protocol.
8  *
9  * Wireshark - Network traffic analyzer
10  * By Gerald Combs <gerald@wireshark.org>
11  * Copyright 1998 Gerald Combs
12  *
13  * SPDX-License-Identifier: GPL-2.0-or-later
14  */
15
16 #include "config.h"
17
18 #include <epan/packet.h>
19 #include <epan/conversation.h>
20
21 #define GVCP_MIN_PACKET_SIZE          ( 8 )
22 #define GVCP_MAX_STREAM_CHANNEL_COUNT ( 512 )
23
24 /*
25    header fields to show the relations between
26    request and response as well as the response time
27 */
28 static int hf_gvcp_response_in = -1;
29 static int hf_gvcp_response_to = -1;
30
31 /*
32    structure to hold info to remember between the requests and responses
33 */
34 typedef struct _gvcp_transaction_t {
35         guint32 req_frame;
36         guint32 rep_frame;
37         wmem_array_t *addr_list;
38         guint32 addr_count;
39 } gvcp_transaction_t;
40
41 wmem_array_t* gvcp_trans_array;
42
43 /*
44    structure to hold persistent info for each conversation
45 */
46 typedef struct _gvcp_conv_info_t {
47         wmem_map_t *pdus;
48         guint32 extended_bootstrap_address[GVCP_MAX_STREAM_CHANNEL_COUNT];
49 } gvcp_conv_info_t;
50
51 /*
52 Bootstrap registers addresses
53 */
54
55 #define GVCP_VERSION (0x00000000)
56 #define GVCP_DEVICE_MODE (0x00000004)
57 #define GVCP_DEVICE_MAC_HIGH_0 (0x00000008)
58 #define GVCP_DEVICE_MAC_LOW_0 (0x0000000C)
59 #define GVCP_SUPPORTED_IP_CONFIGURATION_0 (0x00000010)
60 #define GVCP_CURIPCFG_0 (0x00000014)
61 #define GVCP_CURRENT_IP_ADDRESS_0 (0x00000024)
62 #define GVCP_CURRENT_SUBNET_MASK_0 (0x00000034)
63 #define GVCP_CURRENT_DEFAULT_GATEWAY_0 (0x00000044)
64 #define GVCP_MANUFACTURER_NAME (0x00000048)
65 #define GVCP_MODEL_NAME (0x00000068)
66 #define GVCP_DEVICE_VERSION (0x00000088)
67 #define GVCP_MANUFACTURER_INFO (0x000000A8)
68 #define GVCP_SERIAL_NUMBER (0x000000d8)
69 #define GVCP_USER_DEFINED_NAME (0x000000E8)
70 #define GVCP_FIRST_URL (0x00000200)
71 #define GVCP_SECOND_URL (0x00000400)
72 #define GVCP_NUMBER_OF_NETWORK_INTERFACES (0x00000600)
73 #define GVCP_PERSISTENT_IP_ADDRESS_0 (0x0000064C)
74 #define GVCP_PERSISTENT_SUBNET_MASK_0 (0x0000065C)
75 #define GVCP_PERSISTENT_DEFAULT_GATEWAY_0 (0x0000066C)
76 #define GVCP_LINK_SPEED_0 (0x00000670)
77 #define GVCP_DEVICE_MAC_HIGH_1 (0x00000680)
78 #define GVCP_DEVICE_MAC_LOW_1 (0x00000684)
79 #define GVCP_SUPPORTED_IP_CONFIGURATION_1 (0x00000688)
80 #define GVCP_CURIPCFG_1 (0x0000068C)
81 #define GVCP_CURRENT_IP_ADDRESS_1  (0x0000069C)
82 #define GVCP_CURRENT_SUBNET_MASK_1 (0x000006AC)
83 #define GVCP_CURRENT_DEFAULT_GATEWAY_1 (0x000006BC)
84 #define GVCP_PERSISTENT_IP_ADDRESS_1 (0x000006CC)
85 #define GVCP_PERSISTENT_SUBNET_MASK_1 (0x000006DC)
86 #define GVCP_PERSISTENT_DEFAULT_GATEWAY_1 (0x000006EC)
87 #define GVCP_LINK_SPEED_1 (0x000006F0)
88 #define GVCP_DEVICE_MAC_HIGH_2 (0x00000700)
89 #define GVCP_DEVICE_MAC_LOW_2 (0x00000704)
90 #define GVCP_SUPPORTED_IP_CONFIGURATION_2 (0x00000708)
91 #define GVCP_CURIPCFG_2 (0x0000070C)
92 #define GVCP_CURRENT_IP_ADDRESS_2 (0x0000071C)
93 #define GVCP_CURRENT_SUBNET_MASK_2 (0x0000072C)
94 #define GVCP_CURRENT_DEFAULT_GATEWAY_2 (0x0000073C)
95 #define GVCP_PERSISTENT_IP_ADDRESS_2 (0x0000074C)
96 #define GVCP_PERSISTENT_SUBNET_MASK_2 (0x0000075C)
97 #define GVCP_PERSISTENT_DEFAULT_GATEWAY_2 (0x0000076C)
98 #define GVCP_LINK_SPEED_2 (0x00000770)
99 #define GVCP_DEVICE_MAC_HIGH_3 (0x00000780)
100 #define GVCP_DEVICE_MAC_LOW_3 (0x00000784)
101 #define GVCP_SUPPORTED_IP_CONFIGURATION_3 (0x00000788)
102 #define GVCP_CURIPCFG_3 (0x0000078C)
103 #define GVCP_CURRENT_IP_ADDRESS_3 (0x0000079C)
104 #define GVCP_CURRENT_SUBNET_MASK_3 (0x000007AC)
105 #define GVCP_CURRENT_DEFAULT_GATEWAY_3 (0x000007BC)
106 #define GVCP_PERSISTENT_IP_ADDRESS_3 (0x000007CC)
107 #define GVCP_PERSISTENT_SUBNET_MASK_3 (0x000007DC)
108 #define GVCP_PERSISTENT_DEFAULT_GATEWAY_3 (0x000007EC)
109 #define GVCP_LINK_SPEED_3 (0x000007F0)
110 #define GVCP_NUMBER_OF_MESSAGE_CHANNELS (0x00000900)
111 #define GVCP_NUMBER_OF_STREAM_CHANNELS (0x00000904)
112 #define GVCP_NUMBER_OF_ACTION_SIGNALS (0x00000908)
113 #define GVCP_ACTION_DEVICE_KEY (0x0000090C)
114 #define GVCP_NUMBER_OF_ACTIVE_LINKS (0x00000910)
115 #define GVCP_SC_CAPS (0x0000092C)
116 #define GVCP_MESSAGE_CHANNEL_CAPS (0x00000930)
117 #define GVCP_CAPABILITY (0x00000934)
118 #define GVCP_HEARTBEAT_TIMEOUT (0x00000938)
119 #define GVCP_TIMESTAMP_TICK_FREQUENCY_HIGH (0x0000093C)
120 #define GVCP_TIMESTAMP_TICK_FREQUENCY_LOW (0x00000940)
121 #define GVCP_TIMESTAMP_CONTROL (0x00000944)
122 #define GVCP_TIMESTAMP_VALUE_HIGH (0x00000948)
123 #define GVCP_TIMESTAMP_VALUE_LOW (0x0000094C)
124 #define GVCP_DISCOVERY_ACK_DELAY (0x00000950)
125 #define GVCP_CONFIGURATION (0x00000954)
126 #define GVCP_PENDING_TIMEOUT (0x00000958)
127 #define GVCP_CONTROL_SWITCHOVER_KEY (0x0000095C)
128 #define GVCP_GVSCP_CONFIGURATION (0x00000960)
129 #define GVCP_PHYSICAL_LINK_CAPABILITY (0x00000964)
130 #define GVCP_PHYSICAL_LINK_CONFIGURATION (0x00000968)
131 #define GVCP_IEEE_1588_STATUS (0x0000096C)
132 #define GVCP_SCHEDULED_ACTION_COMMAND_QUEUE_SIZE (0x00000970)
133 #define GVCP_IEEE_1588_EXTENDED_CAPABILITY (0x00000974)
134 #define GVCP_IEEE_1588_SUPPORTED_PROFILES (0x00000978)
135 #define GVCP_IEEE_1588_SELECTED_PROFILE (0x0000097C)
136 #define GVCP_CCP (0x00000A00)
137 #define GVCP_PRIMARY_APPLICATION_PORT (0x00000A04)
138 #define GVCP_PRIMARY_APPLICATION_IP_ADDRESS (0x00000A14)
139 #define GVCP_MC_DESTINATION_PORT (0x00000B00)
140 #define GVCP_MC_DESTINATION_ADDRESS (0x00000B10)
141 #define GVCP_MC_TIMEOUT (0x00000B14)
142 #define GVCP_MC_RETRY_COUNT (0x00000B18)
143 #define GVCP_MC_SOURCE_PORT (0x00000B1C)
144 #define GVCP_MC_CONFIGURATION (0x00000B20) /* GEV 2.2 */
145 #define GVCP_MANIFEST_TABLE (0x00009000)
146
147 #define GVCP_SC_DESTINATION_PORT(I)           (0x0d00+(0x40*I))
148 #define GVCP_SC_PACKET_SIZE(I)                (0x0d04+(0x40*I))
149 #define GVCP_SC_PACKET_DELAY(I)               (0x0d08+(0x40*I))
150 #define GVCP_SC_DESTINATION_ADDRESS(I)        (0x0d18+(0x40*I))
151 #define GVCP_SC_SOURCE_PORT(I)                (0x0d1C+(0x40*I))
152 #define GVCP_SC_CAPABILITY(I)                 (0x0d20+(0x40*I))
153 #define GVCP_SC_CONFIGURATION(I)              (0x0d24+(0x40*I))
154 #define GVCP_SC_ZONE(I)                       (0x0d28+(0x40*I))
155 #define GVCP_SC_ZONE_DIRECTION(I)             (0x0d2C+(0x40*I))
156 #define GVCP_SC_MAX_PACKET_COUNT(I)           (0x0d30+(0x40*I)) /* GEV 2.2 */
157 #define GVCP_SC_MAX_BLOCK_SIZE_HIGH(I)        (0x0d34+(0x40*I)) /* GEV 2.2 */
158 #define GVCP_SC_MAX_BLOCK_SIZE_LOW(I)         (0x0d38+(0x40*I)) /* GEV 2.2 */
159 #define GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS(I) (0x0d3C+(0x40*I)) /* GEV 2.2 */
160
161 /* Real address: GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS(I) + the values defined here */
162 #define GVCP_SC_GENDC_DESCRIPTOR_ADDRESS         ( 0x0000 ) /* GEV 2.2 */
163 #define GVCP_SC_GENDC_DESCRIPTOR_SIZE            ( 0x0004 ) /* GEV 2.2 */
164 #define GVCP_SC_GENDC_FLOW_MAPPING_TABLE_ADDRESS ( 0x0008 ) /* GEV 2.2 */
165 #define GVCP_SC_GENDC_FLOW_MAPPING_TABLE_SIZE    ( 0x000C ) /* GEV 2.2 */
166 #define GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS_LAST  ( 0x000C )
167
168 #define GVCP_ACTION_GROUP_KEY(I)  (0x9800+(0x10*I))
169 #define GVCP_ACTION_GROUP_MASK(I) (0x9804+(0x10*I))
170
171
172 /*
173 Command and acknowledge IDs
174 */
175
176 #define GVCP_DISCOVERY_CMD (0x0002)
177 #define GVCP_DISCOVERY_ACK (0x0003)
178 #define GVCP_FORCEIP_CMD (0x0004)
179 #define GVCP_FORCEIP_ACK (0x0005)
180 #define GVCP_PACKETRESEND_CMD (0x0040)
181 #define GVCP_PACKETRESEND_ACK (0x0041)
182 #define GVCP_READREG_CMD (0x0080)
183 #define GVCP_READREG_ACK (0x0081)
184 #define GVCP_WRITEREG_CMD (0x0082)
185 #define GVCP_WRITEREG_ACK (0x0083)
186 #define GVCP_READMEM_CMD (0x0084)
187 #define GVCP_READMEM_ACK (0x0085)
188 #define GVCP_WRITEMEM_CMD (0x0086)
189 #define GVCP_WRITEMEM_ACK (0x0087)
190 #define GVCP_PENDING_ACK (0x0089)
191 #define GVCP_EVENT_CMD (0x00C0)
192 #define GVCP_EVENT_ACK (0x00C1)
193 #define GVCP_EVENTDATA_CMD (0x00C2)
194 #define GVCP_EVENTDATA_ACK (0x00C3)
195 #define GVCP_ACTION_CMD (0x0100)
196 #define GVCP_ACTION_ACK (0x0101)
197
198
199 /*
200 GVCP statuses
201 */
202
203 #define GEV_STATUS_SUCCESS (0x0000)
204 #define GEV_STATUS_PACKET_RESEND (0x0100)
205 #define GEV_STATUS_NOT_IMPLEMENTED (0x8001)
206 #define GEV_STATUS_INVALID_PARAMETER (0x8002)
207 #define GEV_STATUS_INVALID_ADDRESS (0x8003)
208 #define GEV_STATUS_WRITE_PROTECT (0x8004)
209 #define GEV_STATUS_BAD_ALIGNMENT (0x8005)
210 #define GEV_STATUS_ACCESS_DENIED (0x8006)
211 #define GEV_STATUS_BUSY (0x8007)
212 #define GEV_STATUS_LOCAL_PROBLEM (0x8008)  /* deprecated */
213 #define GEV_STATUS_MSG_MISMATCH (0x8009) /* deprecated */
214 #define GEV_STATUS_INVALID_PROTOCOL (0x800A) /* deprecated */
215 #define GEV_STATUS_NO_MSG (0x800B) /* deprecated */
216 #define GEV_STATUS_PACKET_UNAVAILABLE (0x800C)
217 #define GEV_STATUS_DATA_OVERRUN (0x800D)
218 #define GEV_STATUS_INVALID_HEADER (0x800E)
219 #define GEV_STATUS_WRONG_CONFIG (0x800F) /* deprecated */
220 #define GEV_STATUS_PACKET_NOT_YET_AVAILABLE (0x8010)
221 #define GEV_STATUS_PACKET_AND_PREV_REMOVED_FROM_MEMORY (0x8011)
222 #define GEV_STATUS_PACKET_REMOVED_FROM_MEMORY (0x8012)
223 #define GEV_STATUS_NO_REF_TIME (0x8013) /* GEV 2.0 */
224 #define GEV_STATUS_PACKET_TEMPORARILY_UNAVAILABLE (0x8014) /* GEV 2.0 */
225 #define GEV_STATUS_OVERFLOW (0x8015) /* GEV 2.0 */
226 #define GEV_STATUS_ACTION_LATE (0x8016) /* GEV 2.0 */
227 #define GEV_STATUS_LEADER_TRAILER_OVERFLOW (0x8017) /* GEV 2.1 */
228 #define GEV_STATUS_ERROR (0x8FFF)
229
230
231 /*
232 Device modes
233 */
234
235 #define GEV_DEVICEMODE_TRANSMITTER (0x00 )
236 #define GEV_DEVICEMODE_RECEIVER (0x01)
237 #define GEV_DEVICEMODE_TRANSCEIVER (0x02)
238 #define GEV_DEVICEMODE_PERIPHERAL (0x03)
239
240
241 /*
242 Event IDs
243 */
244
245 #define GEV_EVENT_TRIGGER (0x0002) /* deprecated */
246 #define GEV_EVENT_START_OF_EXPOSURE (0x0003) /* deprecated */
247 #define GEV_EVENT_END_OF_EXPOSURE (0x0004) /* deprecated */
248 #define GEV_EVENT_START_OF_TRANSFER (0x0005) /* deprecated */
249 #define GEV_EVENT_END_OF_TRANSFER (0x0006) /* deprecated */
250 #define GEV_EVENT_PRIMARY_APP_SWITCH (0x0007)
251 #define GEV_EVENT_EVENT_LINK_SPEED_CHANGE (0x0008)
252 #define GEV_EVENT_ACTION_LATE (0x0009)
253 #define GEV_EVENT_ERROR_001 (0x8001)
254
255
256 /*
257 Link configurations
258 */
259
260 #define GEV_LINKCONFIG_SINGLELINK (0x00)
261 #define GEV_LINKCONFIG_MULTIPLELINKS (0x01)
262 #define GEV_LINKCONFIG_STATICLAG (0x02)
263 #define GEV_LINKCONFIG_DYNAMICLAG (0x03)
264
265
266 void proto_register_gvcp(void);
267 void proto_reg_handoff_gvcp(void);
268
269 /* Define the gvcp proto */
270 static int proto_gvcp = -1;
271 static int global_gvcp_port = 3956;
272
273 static int hf_gvcp_custom_register_addr = -1;
274 static int hf_gvcp_custom_memory_addr = -1;
275
276 /*
277 \brief IDs used for bootstrap dissection
278 */
279
280 static int hf_gvcp_message_key_code = -1;
281 static int hf_gvcp_flag = -1;
282 static int hf_gvcp_acknowledge_required_flag = -1;
283 static int hf_gvcp_allow_broadcast_acknowledge_flag = -1;
284 static int hf_gvcp_command = -1;
285 static int hf_gvcp_length = -1;
286 static int hf_gvcp_request_id = -1;
287 static int hf_gvcp_status = -1;
288 static int hf_gvcp_acknowledge = -1;
289 static int hf_gvcp_spec_version_major = -1;
290 static int hf_gvcp_spec_version_minor = -1;
291 static int hf_gvcp_devicemodediscovery = -1;
292 static int hf_gvcp_device_mac_address = -1;
293 static int hf_gvcp_ip_config_persistent_ip = -1;
294 static int hf_gvcp_ip_config_dhcp = -1;
295 static int hf_gvcp_ip_config_lla = -1;
296 static int hf_gvcp_current_IP = -1;
297 static int hf_gvcp_current_subnet_mask = -1;
298 static int hf_gvcp_current_default_gateway = -1;
299 static int hf_gvcp_manufacturer_name = -1;
300 static int hf_gvcp_model_name = -1;
301 static int hf_gvcp_device_version = -1;
302 static int hf_gvcp_manufacturer_specific_info = -1;
303 static int hf_gvcp_serial_number = -1;
304 static int hf_gvcp_user_defined_name = -1;
305 static int hf_gvcp_first_xml_device_description_file = -1;
306 static int hf_gvcp_second_xml_device_description_file = -1;
307 static int hf_gvcp_readregcmd_bootstrap_register = -1;
308 static int hf_gvcp_writeregcmd_bootstrap_register = -1;
309 static int hf_gvcp_writeregcmd_data = -1;
310 static int hf_gvcp_writeregcmd_data_index = -1;
311 static int hf_gvcp_readmemcmd_address = -1;
312 static int hf_gvcp_readmemcmd_bootstrap_register = -1;
313 static int hf_gvcp_readmemcmd_count = -1;
314 static int hf_gvcp_writememcmd_data = -1;
315 static int hf_gvcp_writememcmd_data_index = -1;
316 static int hf_gvcp_forceip_mac_address = -1;
317 static int hf_gvcp_forceip_static_IP = -1;
318 static int hf_gvcp_forceip_static_subnet_mask = -1;
319 static int hf_gvcp_forceip_static_default_gateway = -1;
320 static int hf_gvcp_resendcmd_stream_channel_index = -1;
321 static int hf_gvcp_resendcmd_block_id = -1;
322 static int hf_gvcp_resendcmd_first_packet_id = -1;
323 static int hf_gvcp_resendcmd_last_packet_id = -1;
324 static int hf_gvcp_eventcmd_id = -1;
325 static int hf_gvcp_eventcmd_error_id = -1;
326 static int hf_gvcp_eventcmd_extid_length = -1;
327 static int hf_gvcp_eventcmd_device_specific_id = -1;
328 static int hf_gvcp_eventcmd_stream_channel_index = -1;
329 static int hf_gvcp_eventcmd_block_id = -1;
330 static int hf_gvcp_eventcmd_timestamp = -1;
331 static int hf_gvcp_eventcmd_data = -1;
332 static int hf_gvcp_actioncmd_device_key = -1;
333 static int hf_gvcp_actioncmd_group_key = -1;
334 static int hf_gvcp_actioncmd_group_mask = -1;
335 static int hf_gvcp_time_to_completion = -1;
336 static int hf_gvcp_devicemode_endianness = -1;
337 static int hf_gvcp_devicemode_deviceclass = -1;
338 static int hf_gvcp_devicemode_characterset = -1;
339 static int hf_gvcp_machigh = -1;
340 static int hf_gvcp_maclow = -1;
341 static int hf_gvcp_persistent_ip = -1;
342 static int hf_gvcp_persistent_subnet = -1;
343 static int hf_gvcp_persistent_gateway = -1;
344 static int hf_gvcp_link_speed = -1;
345 static int hf_gvcp_number_message_channels = -1;
346 static int hf_gvcp_number_stream_channels = -1;
347 static int hf_gvcp_number_action_signals = -1;
348 static int hf_gvcp_capability_user_defined = -1;
349 static int hf_gvcp_capability_serial_number = -1;
350 static int hf_gvcp_capability_heartbeat_disable = -1;
351 static int hf_gvcp_capability_link_speed = -1;
352 static int hf_gvcp_capability_extended_status_code_v1_1 = -1;
353 static int hf_gvcp_capability_ccp_application_portip = -1;
354 static int hf_gvcp_capability_manifest_table = -1;
355 static int hf_gvcp_capability_test_data = -1;
356 static int hf_gvcp_capability_discovery_ACK_delay = -1;
357 static int hf_gvcp_capability_writable_discovery_ACK_delay = -1;
358 static int hf_gvcp_capability_primary_application_switchover = -1;
359 static int hf_gvcp_capability_unconditional_action_command = -1;
360 static int hf_gvcp_capability_pending = -1;
361 static int hf_gvcp_capability_evendata = -1;
362 static int hf_gvcp_capability_event = -1;
363 static int hf_gvcp_capability_packetresend = -1;
364 static int hf_gvcp_capability_writemem = -1;
365 static int hf_gvcp_capability_concatenation = -1;
366 static int hf_gvcp_heartbeat = -1;
367 static int hf_gvcp_high_timestamp_frequency = -1;
368 static int hf_gvcp_low_timestamp_frequency = -1;
369 static int hf_gvcp_high_timestamp_value = -1;
370 static int hf_gvcp_low_timestamp_value = -1;
371 static int hf_gvcp_discovery_ACK_delay = -1;
372 static int hf_gvcp_configuration_pending_ack_enable = -1;
373 static int hf_gvcp_configuration_heartbeat_disable = -1;
374 static int hf_gvcp_pending_timeout_max_execution = -1;
375 static int hf_gvcp_control_switchover_key_register = -1;
376 static int hf_gvcp_control_switchover_key = -1;
377 static int hf_gvcp_control_switchover_en = -1;
378 static int hf_gvcp_control_access = -1;
379 static int hf_gvcp_exclusive_access = -1;
380 static int hf_gvcp_primary_application_host_port = -1;
381 static int hf_gvcp_primary_application_ip_address = -1;
382 static int hf_gvcp_network_interface_index = -1;
383 static int hf_gvcp_host_port = -1;
384 static int hf_gvcp_channel_destination_ip = -1;
385 static int hf_gvcp_message_channel_transmission_timeout = -1;
386 static int hf_gvcp_message_channel_retry_count = -1;
387 static int hf_gvcp_message_channel_source_port = -1;
388 static int hf_gvcp_sc_host_port = -1;
389 static int hf_gvcp_sc_ni_index = -1;
390 static int hf_gvcp_sc_direction = -1;
391 static int hf_gvcp_sc_fire_test_packet = -1;
392 static int hf_gvcp_sc_do_not_fragment = -1;
393 static int hf_gvcp_sc_pixel_endianness = -1;
394 static int hf_gvcp_sc_packet_size = -1;
395 static int hf_gvcp_sc_packet_delay = -1;
396 static int hf_gvcp_sc_destination_ip = -1;
397 static int hf_gvcp_sc_source_port = -1;
398 static int hf_gvcp_sc_big_little_endian_supported = -1;
399 static int hf_gvcp_sc_ip_reassembly_supported = -1;
400 static int hf_gvcp_sc_unconditional_streaming_supported = -1;
401 static int hf_gvcp_sc_extended_chunk_data_supported = -1;
402 static int hf_gvcp_sc_unconditional_streaming_enabled = -1;
403 static int hf_gvcp_configuration_extended_status_codes_enable_v1_1 = -1;
404 static int hf_gvcp_sc_extended_chunk_data_enabled = -1;
405 static int hf_gvcp_action_group_key = -1;
406 static int hf_gvcp_action_group_mask = -1;
407 static int hf_gvcp_timestamp_control_latch = -1;
408 static int hf_gvcp_timestamp_control_reset = -1;
409 static int hf_gvcp_payloaddata = -1;
410 static int hf_gvcp_number_interfaces = -1;
411 static int hf_gvcp_supportedipconfig = -1;
412 static int hf_gvcp_currentipconfig = -1;
413 static int hf_gvcp_spec_version = -1;
414
415 /* Added for 2.0 support */
416 static int hf_gvcp_devicemode_current_link_configuration_v2_0 = -1;
417 static int hf_gvcp_ip_config_can_handle_pause_frames_v2_0 = -1;
418 static int hf_gvcp_ip_config_can_generate_pause_frames_v2_0 = -1;
419 static int hf_gvcp_number_of_active_links_v2_0 = -1;
420 static int hf_gvcp_sccaps_scspx_register_supported = -1;
421 static int hf_gvcp_sccaps_legacy_16bit_blockid_supported_v2_0 = -1;
422 static int hf_gvcp_mcsp_supported = -1;
423 static int hf_gvcp_capability_1588_v2_0 = -1;
424 static int hf_gvcp_capability_extended_status_code_v2_0 = -1;
425 static int hf_gvcp_capability_scheduled_action_command_v2_0 = -1;
426 static int hf_gvcp_capability_action_command = -1;
427 static int hf_gvcp_configuration_1588_enable_v2_0 = -1;
428 static int hf_gvcp_configuration_extended_status_codes_enable_v2_0 = -1;
429 static int hf_gvcp_configuration_unconditional_action_command_enable_v2_0 = -1;
430 static int hf_gvcp_gvsp_configuration_64bit_blockid_enable_v2_0 = -1;
431 static int hf_gvcp_link_dlag_v2_0 = -1;
432 static int hf_gvcp_link_slag_v2_0 = -1;
433 static int hf_gvcp_link_ml_v2_0 = -1;
434 static int hf_gvcp_link_sl_v2_0 = -1;
435 static int hf_gvcp_ieee1588_clock_status_v2_0 = -1;
436 static int hf_gvcp_scheduled_action_command_queue_size_v2_0 = -1;
437 static int hf_gvcp_sc_multizone_supported_v2_0 = -1;
438 static int hf_gvcp_sc_packet_resend_destination_option_supported_v2_0 = -1;
439 static int hf_gvcp_sc_packet_resend_all_in_transmission_supported_v2_0 = -1;
440 static int hf_gvcp_sc_packet_resend_destination_option_enabled_v2_0 = -1;
441 static int hf_gvcp_sc_packet_resend_all_in_transmission_enabled_v2_0 = -1;
442 static int hf_gvcp_sc_additional_zones_v2_0 = -1;
443 static int hf_gvcp_sc_zone0_direction_v2_0 = -1;
444 static int hf_gvcp_sc_zone1_direction_v2_0 = -1;
445 static int hf_gvcp_sc_zone2_direction_v2_0 = -1;
446 static int hf_gvcp_sc_zone3_direction_v2_0 = -1;
447 static int hf_gvcp_sc_zone4_direction_v2_0 = -1;
448 static int hf_gvcp_sc_zone5_direction_v2_0 = -1;
449 static int hf_gvcp_sc_zone6_direction_v2_0 = -1;
450 static int hf_gvcp_sc_zone7_direction_v2_0 = -1;
451 static int hf_gvcp_sc_zone8_direction_v2_0 = -1;
452 static int hf_gvcp_sc_zone9_direction_v2_0 = -1;
453 static int hf_gvcp_sc_zone10_direction_v2_0 = -1;
454 static int hf_gvcp_sc_zone11_direction_v2_0 = -1;
455 static int hf_gvcp_sc_zone12_direction_v2_0 = -1;
456 static int hf_gvcp_sc_zone13_direction_v2_0 = -1;
457 static int hf_gvcp_sc_zone14_direction_v2_0 = -1;
458 static int hf_gvcp_sc_zone15_direction_v2_0 = -1;
459 static int hf_gvcp_sc_zone16_direction_v2_0 = -1;
460 static int hf_gvcp_sc_zone17_direction_v2_0 = -1;
461 static int hf_gvcp_sc_zone18_direction_v2_0 = -1;
462 static int hf_gvcp_sc_zone19_direction_v2_0 = -1;
463 static int hf_gvcp_sc_zone20_direction_v2_0 = -1;
464 static int hf_gvcp_sc_zone21_direction_v2_0 = -1;
465 static int hf_gvcp_sc_zone22_direction_v2_0 = -1;
466 static int hf_gvcp_sc_zone23_direction_v2_0 = -1;
467 static int hf_gvcp_sc_zone24_direction_v2_0 = -1;
468 static int hf_gvcp_sc_zone25_direction_v2_0 = -1;
469 static int hf_gvcp_sc_zone26_direction_v2_0 = -1;
470 static int hf_gvcp_sc_zone27_direction_v2_0 = -1;
471 static int hf_gvcp_sc_zone28_direction_v2_0 = -1;
472 static int hf_gvcp_sc_zone29_direction_v2_0 = -1;
473 static int hf_gvcp_sc_zone30_direction_v2_0 = -1;
474 static int hf_gvcp_sc_zone31_direction_v2_0 = -1;
475 static int hf_gvcp_scheduledactioncommand_flag_v2_0 = -1;
476 static int hf_gvcp_64bitid_flag_v2_0 = -1;
477 static int hf_gvcp_resendcmd_extended_block_id_v2_0 = -1;
478 static int hf_gvcp_resendcmd_extended_first_packet_id_v2_0 = -1;
479 static int hf_gvcp_resendcmd_extended_last_packet_id_v2_0 = -1;
480 static int hf_gvcp_actioncmd_time_v2_0 = -1;
481 static int hf_gvcp_eventcmd_block_id_64bit_v2_0 = -1;
482
483 /* Added for 2.1 support */
484 static int hf_gvcp_selected_ieee1588_profile_v2_1 = -1;
485 static int hf_gvcp_capability_ieee1588_extended_capabilities_v2_1 = -1;
486 static int hf_gvcp_ieee1588_profile_registers_present_v2_1 = -1;
487 static int hf_gvcp_ieee1588_ptp_profile_supported_v2_1 = -1;
488 static int hf_gvcp_ieee1588_802dot1as_profile_supported_v2_1 = -1;
489 static int hf_gvcp_sc_multi_part_supported_v2_1 = -1;
490 static int hf_gvcp_sc_large_leader_trailer_supported_v2_1 = -1;
491 static int hf_gvcp_sc_multi_part_enabled_v2_1 = -1;
492 static int hf_gvcp_sc_large_leader_trailer_enabled_v2_1 = -1;
493
494 /* Added for 2.2 support */
495 static int hf_gvcp_sccaps_scmbsx_supported_v2_2 = -1;
496 static int hf_gvcp_sccaps_scebax_supported_v2_2 = -1;
497 static int hf_gvcp_mcc_supported_v2_2 = -1;
498 static int hf_gvcp_mcec_supported_v2_2 = -1;
499 static int hf_gvcp_mcec_enabled_v2_2 = -1;
500 static int hf_gvcp_sc_scmpcx_supported_v2_2 = -1;
501 static int hf_gvcp_sc_gendc_supported_v2_2 = -1;
502 static int hf_gvcp_sc_gendc_enabled_v2_2 = -1;
503 static int hf_gvcp_sc_max_packet_count_v2_2 = -1;
504 static int hf_gvcp_sc_max_block_size_high_v2_2 = -1;
505 static int hf_gvcp_sc_max_block_size_low_v2_2 = -1;
506 static int hf_gvcp_sc_extended_registers_address_v2_2 = -1;
507 static int hf_gvcp_sc_gendc_descriptor_address_v2_2 = -1;
508 static int hf_gvcp_sc_gendc_descriptor_size_v2_2 = -1;
509 static int hf_gvcp_sc_gendc_flow_mapping_table_address_v2_2 = -1;
510 static int hf_gvcp_sc_gendc_flow_mapping_table_size_v2_2 = -1;
511 static int hf_gvcp_readregcmd_extended_bootstrap_register = -1;
512 static int hf_gvcp_writeregcmd_extended_bootstrap_register = -1;
513
514 /* Generated from convert_proto_tree_add_text.pl */
515 static int hf_gvcp_custom_register_value = -1;
516 static int hf_gvcp_custom_read_register_addr = -1;
517 static int hf_gvcp_readmemcmd_data_read = -1;
518 static int hf_gvcp_custom_read_register_value = -1;
519 static int hf_gvcp_manifest_table = -1;
520 static int hf_gvcp_reserved_bit = -1;
521
522 /*Define the tree for gvcp*/
523 static int ett_gvcp = -1;
524 static int ett_gvcp_cmd = -1;
525 static int ett_gvcp_flags = -1;
526 static int ett_gvcp_ack = -1;
527 static int ett_gvcp_payload_cmd = -1;
528 static int ett_gvcp_payload_ack = -1;
529 static int ett_gvcp_payload_cmd_subtree = -1;
530 static int ett_gvcp_payload_ack_subtree = -1;
531 static int ett_gvcp_bootstrap_fields = -1;
532
533 static dissector_handle_t gvcp_handle;
534 static dissector_handle_t gvsp_handle;
535
536 /*Device Mode*/
537 static const value_string devicemodenames_class[] = {
538         { GEV_DEVICEMODE_TRANSMITTER, "Transmitter" },
539         { GEV_DEVICEMODE_RECEIVER, "Receiver" },
540         { GEV_DEVICEMODE_TRANSCEIVER, "Transceiver" },
541         { GEV_DEVICEMODE_PERIPHERAL, "Peripheral" },
542         { 0, NULL },
543 };
544
545 /*Current Link Configuration*/
546 static const value_string linkconfiguration_class[] = {
547         { GEV_LINKCONFIG_SINGLELINK, "Single Link" },
548         { GEV_LINKCONFIG_MULTIPLELINKS, "Multiple Links" },
549         { GEV_LINKCONFIG_STATICLAG, "Static LAG" },
550         { GEV_LINKCONFIG_DYNAMICLAG, "Dynamic LAG" },
551         { 0, NULL },
552 };
553
554 static const value_string devicemodenames_characterset[] = {
555         { 0x01, "UTF-8 Character Set" },
556         { 0x00, "Reserved" },
557         { 0, NULL },
558 };
559
560 static const value_string commandnames[] = {
561         { GVCP_DISCOVERY_CMD, "DISCOVERY_CMD" },
562         { GVCP_FORCEIP_CMD, "FORCEIP_CMD" },
563         { GVCP_PACKETRESEND_CMD, "PACKETRESEND_CMD" },
564         { GVCP_READREG_CMD, "READREG_CMD" },
565         { GVCP_WRITEREG_CMD, "WRITEREG_CMD" },
566         { GVCP_READMEM_CMD, "READMEM_CMD" },
567         { GVCP_WRITEMEM_CMD, "WRITEMEM_CMD" },
568         { GVCP_EVENT_CMD, "EVENT_CMD" },
569         { GVCP_EVENTDATA_CMD, "EVENTDATA_CMD" },
570         { GVCP_ACTION_CMD, "ACTION_CMD" },
571         { 0, NULL }
572 };
573
574 static const value_string acknowledgenames[] = {
575         { GVCP_DISCOVERY_ACK, "DISCOVERY_ACK" },
576         { GVCP_FORCEIP_ACK, "FORCEIP_ACK" },
577         { GVCP_PACKETRESEND_ACK, "PACKETRESEND_ACK" },
578         { GVCP_READREG_ACK, "READREG_ACK" },
579         { GVCP_WRITEREG_ACK, "WRITEREG_ACK" },
580         { GVCP_READMEM_ACK, "READMEM_ACK" },
581         { GVCP_WRITEMEM_ACK, "WRITEMEM_ACK" },
582         { GVCP_PENDING_ACK, "PENDING_ACK" },
583         { GVCP_EVENT_ACK, "EVENT_ACK" },
584         { GVCP_EVENTDATA_ACK, "EVENTDATA_ACK" },
585         { GVCP_ACTION_ACK, "ACTION_ACK" },
586         { 0, NULL },
587 };
588
589 static const value_string eventidnames[] = {
590         { GEV_EVENT_TRIGGER, "GEV_EVENT_TRIGGER (deprecated)" },
591         { GEV_EVENT_START_OF_EXPOSURE, "GEV_EVENT_START_OF_EXPOSURE (deprecated)" },
592         { GEV_EVENT_END_OF_EXPOSURE, "GEV_EVENT_END_OF_EXPOSURE (deprecated)" },
593         { GEV_EVENT_START_OF_TRANSFER, "GEV_EVENT_START_OF_TRANSFER (deprecated)" },
594         { GEV_EVENT_END_OF_TRANSFER, "GEV_EVENT_END_OF_TRANSFER (deprecated)" },
595         { GEV_EVENT_PRIMARY_APP_SWITCH, "GEV_EVENT_PRIMARY_APP_SWITCH" },
596         { GEV_EVENT_EVENT_LINK_SPEED_CHANGE, "GEV_EVENT_EVENT_LINK_SPEED_CHANGE" },
597         { GEV_EVENT_ACTION_LATE, "GEV_EVENT_ACTION_LATE" },
598         { GEV_EVENT_ERROR_001, "GEV_EVENT_ERROR_001" },
599         { 0, NULL },
600 };
601
602 static const value_string statusnames[] = {
603         { GEV_STATUS_SUCCESS, "GEV_STATUS_SUCCESS" },
604         { GEV_STATUS_PACKET_RESEND, "GEV_STATUS_PACKET_RESEND" },
605         { GEV_STATUS_NOT_IMPLEMENTED, "GEV_STATUS_NOT_IMPLEMENTED" },
606         { GEV_STATUS_INVALID_PARAMETER, "GEV_STATUS_INVALID_PARAMETER" },
607         { GEV_STATUS_INVALID_ADDRESS, "GEV_STATUS_INVALID_ADDRESS" },
608         { GEV_STATUS_WRITE_PROTECT, "GEV_STATUS_WRITE_PROTECT" },
609         { GEV_STATUS_BAD_ALIGNMENT, "GEV_STATUS_BAD_ALIGNMENT" },
610         { GEV_STATUS_ACCESS_DENIED, "GEV_STATUS_ACCESS_DENIED" },
611         { GEV_STATUS_BUSY, "GEV_STATUS_BUSY" },
612         { GEV_STATUS_LOCAL_PROBLEM, "GEV_STATUS_LOCAL_PROBLEM (deprecated)" },
613         { GEV_STATUS_MSG_MISMATCH, "GEV_STATUS_MSG_MISMATCH (deprecated)" },
614         { GEV_STATUS_INVALID_PROTOCOL, "GEV_STATUS_INVALID_PROTOCOL (deprecated)" },
615         { GEV_STATUS_NO_MSG, "GEV_STATUS_NO_MSG (deprecated)" },
616         { GEV_STATUS_PACKET_UNAVAILABLE, "GEV_STATUS_PACKET_UNAVAILABLE" },
617         { GEV_STATUS_DATA_OVERRUN, "GEV_STATUS_DATA_OVERRUN" },
618         { GEV_STATUS_INVALID_HEADER, "GEV_STATUS_INVALID_HEADER" },
619         { GEV_STATUS_WRONG_CONFIG, "GEV_STATUS_WRONG_CONFIG (deprecated)" },
620         { GEV_STATUS_PACKET_NOT_YET_AVAILABLE, "GEV_STATUS_PACKET_NOT_YET_AVAILABLE" },
621         { GEV_STATUS_PACKET_AND_PREV_REMOVED_FROM_MEMORY, "GEV_STATUS_PACKET_AND_PREV_REMOVED_FROM_MEMORY" },
622         { GEV_STATUS_PACKET_REMOVED_FROM_MEMORY, "GEV_STATUS_PACKET_REMOVED_FROM_MEMORY" },
623         { GEV_STATUS_NO_REF_TIME, "GEV_STATUS_NO_REF_TIME" },
624         { GEV_STATUS_PACKET_TEMPORARILY_UNAVAILABLE, "GEV_STATUS_PACKET_TEMPORARILY_UNAVAILABLE" },
625         { GEV_STATUS_OVERFLOW, "GEV_STATUS_OVERFLOW" },
626         { GEV_STATUS_ACTION_LATE, "GEV_STATUS_ACTION_LATE" },
627         { GEV_STATUS_LEADER_TRAILER_OVERFLOW, "GEV_STATUS_LEADER_TRAILER_OVERFLOW" },
628         { GEV_STATUS_ERROR, "GEV_STATUS_ERROR" },
629         { 0, NULL },
630 };
631
632 static const value_string statusnames_short[] = {
633         { GEV_STATUS_SUCCESS, "" },
634         { GEV_STATUS_PACKET_RESEND, "(Packet Resend) " },
635         { GEV_STATUS_NOT_IMPLEMENTED, "(Not Implemented) " },
636         { GEV_STATUS_INVALID_PARAMETER, "(Invalid Parameter) " },
637         { GEV_STATUS_INVALID_ADDRESS, "(Invalid Address) " },
638         { GEV_STATUS_WRITE_PROTECT, "(Write Protect) " },
639         { GEV_STATUS_BAD_ALIGNMENT, "(Bad Alignment) " },
640         { GEV_STATUS_ACCESS_DENIED, "(Access Denied) " },
641         { GEV_STATUS_BUSY, "(Busy) " },
642         { GEV_STATUS_LOCAL_PROBLEM, "(Local Problem) " },
643         { GEV_STATUS_MSG_MISMATCH, "(Message Mismatch) " },
644         { GEV_STATUS_INVALID_PROTOCOL, "(Invalid Protocol) " },
645         { GEV_STATUS_NO_MSG, "(No Message) " },
646         { GEV_STATUS_PACKET_UNAVAILABLE, "(Packet Unavailable) " },
647         { GEV_STATUS_DATA_OVERRUN, "(Data Overrun) " },
648         { GEV_STATUS_INVALID_HEADER, "(Invalid Header) " },
649         { GEV_STATUS_WRONG_CONFIG, "(Wrong Configuration) " },
650         { GEV_STATUS_PACKET_NOT_YET_AVAILABLE, "(Packet not yet available) " },
651         { GEV_STATUS_PACKET_AND_PREV_REMOVED_FROM_MEMORY, "(Packet and previous removed from memory) " },
652         { GEV_STATUS_PACKET_REMOVED_FROM_MEMORY, "(Packet removed from memory) " },
653         { GEV_STATUS_NO_REF_TIME, "(No reference time)" },
654         { GEV_STATUS_PACKET_TEMPORARILY_UNAVAILABLE, "(Packet temp. unavailable)" },
655         { GEV_STATUS_OVERFLOW, "(overflow)" },
656         { GEV_STATUS_ACTION_LATE, "(Action late)" },
657         { GEV_STATUS_LEADER_TRAILER_OVERFLOW, "(Leader/Trailer overflow)" },
658         { GEV_STATUS_ERROR, "(Error) " },
659         { 0, NULL },
660 };
661
662 static const true_false_string directionnames = {
663         "Receiver",
664         "Transmitter"
665 };
666
667 static const true_false_string zonedirectionnames = {
668         "Bottom-Up",
669         "Top-Down"
670 };
671
672 /*
673 brief Register name to address mappings
674 */
675
676 const value_string bootstrapregisternames[] = {
677         { GVCP_VERSION, "[Version]" },
678         { GVCP_DEVICE_MODE, "[Device Mode]" },
679         { GVCP_DEVICE_MAC_HIGH_0, "[Device MAC address High (Net #0)]" },
680         { GVCP_DEVICE_MAC_LOW_0, "[Device MAC address Low (Net #0)]" },
681         { GVCP_SUPPORTED_IP_CONFIGURATION_0, "[Supported IP Configuration (Net #0)]" },
682         { GVCP_CURIPCFG_0, "[Current IP Configuration (Net #0)]" },
683         { GVCP_CURRENT_IP_ADDRESS_0, "[Current IP Address (Net #0)]" },
684         { GVCP_CURRENT_SUBNET_MASK_0, "[Current Subnet Mask (Net #0)]" },
685         { GVCP_CURRENT_DEFAULT_GATEWAY_0, "[Current Default Gateway (Net #0)]" },
686         { GVCP_MANUFACTURER_NAME, "[Manufacturer Name]" },
687         { GVCP_MODEL_NAME, "[Model Name]" },
688         { GVCP_DEVICE_VERSION, "[Device Version]" },
689         { GVCP_MANUFACTURER_INFO, "[Manufacturer Specific Information]" },
690         { GVCP_SERIAL_NUMBER, "[Serial Number]" },
691         { GVCP_USER_DEFINED_NAME, "[User-defined Name]" },
692         { GVCP_FIRST_URL, "[First Choice of URL for XML device description file]" },
693         { GVCP_SECOND_URL, "[Second Choice of URL for XML device description file]" },
694         { GVCP_NUMBER_OF_NETWORK_INTERFACES, "[Number of network interfaces]" },
695         { GVCP_PERSISTENT_IP_ADDRESS_0, "[Persistent IP address (Net #0)]" },
696         { GVCP_PERSISTENT_SUBNET_MASK_0, "[Persistent subnet mask (Net #0)]" },
697         { GVCP_PERSISTENT_DEFAULT_GATEWAY_0, "[Persistent default gateway (Net# 0)]" },
698         { GVCP_LINK_SPEED_0, "[Link Speed (Net #0)]" },
699         { GVCP_DEVICE_MAC_HIGH_1, "[Device MAC address High (Net #1)]" },
700         { GVCP_DEVICE_MAC_LOW_1, "[Device MAC address Low (Net #1)]" },
701         { GVCP_SUPPORTED_IP_CONFIGURATION_1, "[Supported IP Configuration (Net #1)]" },
702         { GVCP_CURIPCFG_1, "[Current IP Configuration (Net #1)]" },
703         { GVCP_CURRENT_IP_ADDRESS_1, "[Current IP Address (Net #1)]" },
704         { GVCP_CURRENT_SUBNET_MASK_1, "[Current Subnet Mask (Net #1)]" },
705         { GVCP_CURRENT_DEFAULT_GATEWAY_1, "[Current Default Gateway (Net #1)]" },
706         { GVCP_PERSISTENT_IP_ADDRESS_1, "[Persistent IP address (Net #1)]" },
707         { GVCP_PERSISTENT_SUBNET_MASK_1, "[Persistent subnet mask (Net#1)]" },
708         { GVCP_PERSISTENT_DEFAULT_GATEWAY_1, "[Persistent default gateway (Net #1)]" },
709         { GVCP_LINK_SPEED_1, "[Link Speed (Net #1)]" },
710         { GVCP_DEVICE_MAC_HIGH_2, "[Device MAC address High (Net #2)]" },
711         { GVCP_DEVICE_MAC_LOW_2, "[Device MAC address Low (Net #2)]" },
712         { GVCP_SUPPORTED_IP_CONFIGURATION_2, "[Supported IP Configuration (Net #2)]" },
713         { GVCP_CURIPCFG_2, "[Current IP Configuration (Net #2)]" },
714         { GVCP_CURRENT_IP_ADDRESS_2, "[Current IP Address (Net #2)]" },
715         { GVCP_CURRENT_SUBNET_MASK_2, "[Current Subnet Mask (Net #2)]" },
716         { GVCP_CURRENT_DEFAULT_GATEWAY_2, "[Current Default Gateway (Net #2)]" },
717         { GVCP_PERSISTENT_IP_ADDRESS_2, "[Persistent IP address (Net #2)]" },
718         { GVCP_PERSISTENT_SUBNET_MASK_2, "[Persistent subnet mask (Net #2)]" },
719         { GVCP_PERSISTENT_DEFAULT_GATEWAY_2, "[Persistent default gateway (Net #2)]" },
720         { GVCP_LINK_SPEED_2, "[Link Speed (Net #2)]" },
721         { GVCP_DEVICE_MAC_HIGH_3, "[Device MAC address High (Net #3)]" },
722         { GVCP_DEVICE_MAC_LOW_3, "[Device MAC address Low (Net #3)]" },
723         { GVCP_SUPPORTED_IP_CONFIGURATION_3, "[Supported IP Configuration (Net #3)]" },
724         { GVCP_CURIPCFG_3, "[Current IP Configuration (Net #3)]" },
725         { GVCP_CURRENT_IP_ADDRESS_3, "[Current IP Address (Net #3)]" },
726         { GVCP_CURRENT_SUBNET_MASK_3, "[Current Subnet Mask (Net #3)]" },
727         { GVCP_CURRENT_DEFAULT_GATEWAY_3, "[Current Default Gateway (Net #3)]" },
728         { GVCP_PERSISTENT_IP_ADDRESS_3, "[Persistent IP address (Net #3)]" },
729         { GVCP_PERSISTENT_SUBNET_MASK_3, "[Persistent subnet mask (Net #3)]" },
730         { GVCP_PERSISTENT_DEFAULT_GATEWAY_3, "[Persistent default gateway (Net #3)]" },
731         { GVCP_LINK_SPEED_3, "[Link Speed (Net #3)]" },
732         { GVCP_NUMBER_OF_MESSAGE_CHANNELS, "[Number of Message Channels]" },
733         { GVCP_NUMBER_OF_STREAM_CHANNELS, "[Number of Stream Channels]" },
734         { GVCP_NUMBER_OF_ACTION_SIGNALS, "[Number of Action Signals]" },
735         { GVCP_ACTION_DEVICE_KEY, "[Action Device Key]" },
736         { GVCP_SC_CAPS, "[Stream channels Capability]" },
737         { GVCP_MESSAGE_CHANNEL_CAPS, "[Message channel Capability]" },
738         { GVCP_CAPABILITY, "[GVCP Capability]" },
739         { GVCP_HEARTBEAT_TIMEOUT, "[Heartbeat timeout]" },
740         { GVCP_TIMESTAMP_TICK_FREQUENCY_HIGH, "[Timestamp tick frequency - High]" },
741         { GVCP_TIMESTAMP_TICK_FREQUENCY_LOW, "[Timestamp tick frequency - Low]" },
742         { GVCP_TIMESTAMP_CONTROL, "[Timestamp control]" },
743         { GVCP_TIMESTAMP_VALUE_HIGH, "[Timestamp value (latched) - High]" },
744         { GVCP_TIMESTAMP_VALUE_LOW, "[Timestamp value (latched) - Low]" },
745         { GVCP_DISCOVERY_ACK_DELAY, "[Discovery ACK delay]" },
746         { GVCP_CONFIGURATION, "[GVCP Configuration]" },
747         { GVCP_PENDING_TIMEOUT, "[Pending Timeout]" },
748         { GVCP_CONTROL_SWITCHOVER_KEY, "[Control switchover key]" },
749         { GVCP_GVSCP_CONFIGURATION, "[GVSP Configuration]" },
750         { GVCP_PHYSICAL_LINK_CAPABILITY, "[Physical link capability]" },
751         { GVCP_PHYSICAL_LINK_CONFIGURATION, "[Physical link configuration]" },
752         { GVCP_IEEE_1588_STATUS, "[IEEE1588 status]" },
753         { GVCP_SCHEDULED_ACTION_COMMAND_QUEUE_SIZE, "[Scheduled action command queue size]" },
754         { GVCP_IEEE_1588_EXTENDED_CAPABILITY, "[IEEE1588 extended capabilities]" },
755         { GVCP_IEEE_1588_SUPPORTED_PROFILES, "[IEEE1588 supported profiles]" },
756         { GVCP_IEEE_1588_SELECTED_PROFILE, "[IEEE1588 selected profile]" },
757         { GVCP_CCP, "[CCP (Control Channel Privilege)]" },
758         { GVCP_PRIMARY_APPLICATION_PORT, "[Primary Application Port]" },
759         { GVCP_PRIMARY_APPLICATION_IP_ADDRESS, "[Primary Application IP address]" },
760         { GVCP_MC_DESTINATION_PORT, "[MCP (Message Channel Port)]" },
761         { GVCP_MC_DESTINATION_ADDRESS, "[MCDA (Message Channel Destination Address)]" },
762         { GVCP_MC_TIMEOUT, "[MCTT (Message Channel Transmission Timeout in ms)]" },
763         { GVCP_MC_RETRY_COUNT, "[MCRC (Message Channel Retry Count)]" },
764         { GVCP_MC_SOURCE_PORT, "[MCSP (Message Channel Source Port)]" },
765         { GVCP_MC_CONFIGURATION, "[MCC (Message Channel Configuration)]" }, /* GEV 2.2 */
766         { GVCP_SC_DESTINATION_PORT(0), "[SCP0 (Stream Channel #0 Port)]" },
767         { GVCP_SC_PACKET_SIZE(0), "[SCPS0 (Stream Channel #0 Packet Size)]" },
768         { GVCP_SC_PACKET_DELAY(0), "[SCPD0 (Stream Channel #0 Packet Delay)]" },
769         { GVCP_SC_DESTINATION_ADDRESS(0), "[SCDA0 (Stream Channel #0 Destination Address)]" },
770         { GVCP_SC_SOURCE_PORT(0), "[SCSP0 (Stream Channel #0 Source Port)]" },
771         { GVCP_SC_CAPABILITY(0), "[SCC0 (Stream Channel #0 Capability)]" },
772         { GVCP_SC_CONFIGURATION(0), "[SCCONF0 (Stream Channel #0 Configuration)]" },
773         { GVCP_SC_ZONE(0), "[SCZ0 (Stream Channel Zone #0)]" },
774         { GVCP_SC_ZONE_DIRECTION(0), "[SCZD0 (Stream Channel Zone Direction #0)]" },
775         { GVCP_SC_MAX_PACKET_COUNT(0), "[SCMPC0 (Stream Channel Max Packet Count #0)]" },
776         { GVCP_SC_MAX_BLOCK_SIZE_HIGH(0), "[SCMBSL0 (Stream Channel Max Block Size (High) #0)]" },
777         { GVCP_SC_MAX_BLOCK_SIZE_LOW(0), "[SCMBSH0 (Stream Channel Max Block Size (Low) #0)]" },
778         { GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS(0), "SCEBA0 (Stream Channel Extended Bootstrap Address #0)]" },
779         { GVCP_SC_DESTINATION_PORT(1), "[SCP1 (Stream Channel #1 Port)]" },
780         { GVCP_SC_PACKET_SIZE(1), "[SCPS1 (Stream Channel #1 Packet Size)]" },
781         { GVCP_SC_PACKET_DELAY(1), "[SCPD1 (Stream Channel #1 Packet Delay)]" },
782         { GVCP_SC_DESTINATION_ADDRESS(1), "[SCDA1 (Stream Channel #1 Destination Address)]" },
783         { GVCP_SC_SOURCE_PORT(1), "[SCSP1 (Stream Channel #1 Source Port)]" },
784         { GVCP_SC_CAPABILITY(1), "[SCC1 (Stream Channel #1 Capability)]" },
785         { GVCP_SC_CONFIGURATION(1), "[SCCONF1 (Stream Channel #1 Configuration)]" },
786         { GVCP_SC_ZONE(1), "[SCZ1 (Stream Channel Zone #1)]" },
787         { GVCP_SC_ZONE_DIRECTION(1), "[SCZD1 (Stream Channel Zone Direction #1)]" },
788         { GVCP_SC_MAX_PACKET_COUNT(1), "[SCMPC1 (Stream Channel Max Packet Count #1)]" },
789         { GVCP_SC_MAX_BLOCK_SIZE_HIGH(1), "[SCMBSL1 (Stream Channel Max Block Size (High) #1)]" },
790         { GVCP_SC_MAX_BLOCK_SIZE_LOW(1), "[SCMBSH1 (Stream Channel Max Block Size (Low) #1)]" },
791         { GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS(1), "SCEBA1 (Stream Channel Extended Bootstrap Address #1)]" },
792         { GVCP_SC_DESTINATION_PORT(2), "[SCP2 (Stream Channel #2 Port)]" },
793         { GVCP_SC_PACKET_SIZE(2), "[SCPS2 (Stream Channel #2 Packet Size)]" },
794         { GVCP_SC_PACKET_DELAY(2), "[SCPD2 (Stream Channel #2 Packet Delay)]" },
795         { GVCP_SC_DESTINATION_ADDRESS(2), "[SCDA2 (Stream Channel #2 Destination Address)]" },
796         { GVCP_SC_SOURCE_PORT(2), "[SCSP2 (Stream Channel #2 Source Port)]" },
797         { GVCP_SC_CAPABILITY(2), "[SCC2 (Stream Channel #2 Capability)]" },
798         { GVCP_SC_CONFIGURATION(2), "[SCCONF2 (Stream Channel #2 Configuration)]" },
799         { GVCP_SC_ZONE(2), "[SCZ2 (Stream Channel Zone #2)]" },
800         { GVCP_SC_ZONE_DIRECTION(2), "[SCZD2 (Stream Channel Zone Direction #2)]" },
801         { GVCP_SC_MAX_PACKET_COUNT(2), "[SCMPC2 (Stream Channel Max Packet Count #2)]" },
802         { GVCP_SC_MAX_BLOCK_SIZE_HIGH(2), "[SCMBSL2 (Stream Channel Max Block Size (High) #2)]" },
803         { GVCP_SC_MAX_BLOCK_SIZE_LOW(2), "[SCMBSH2 (Stream Channel Max Block Size (Low) #2)]" },
804         { GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS(2), "SCEBA2 (Stream Channel Extended Bootstrap Address #2)]" },
805         { GVCP_SC_DESTINATION_PORT(3), "[SCP3 (Stream Channel #3 Port)]" },
806         { GVCP_SC_PACKET_SIZE(3), "[SCPS3 (Stream Channel #3 Packet Size)]" },
807         { GVCP_SC_PACKET_DELAY(3), "[SCPD3 (Stream Channel #3 Packet Delay)]" },
808         { GVCP_SC_DESTINATION_ADDRESS(3), "[SCDA3 (Stream Channel #3 Destination Address)]" },
809         { GVCP_SC_SOURCE_PORT(3), "[SCSP3 (Stream Channel #3 Source Port)]" },
810         { GVCP_SC_CAPABILITY(3), "[SCC3 (Stream Channel #3 Capability)]" },
811         { GVCP_SC_CONFIGURATION(3), "[SCCONF3 (Stream Channel #3 Configuration)]" },
812         { GVCP_SC_ZONE(3), "[SCZ3 (Stream Channel Zone #3)]" },
813         { GVCP_SC_ZONE_DIRECTION(3), "[SCZD3 (Stream Channel Zone Direction #3)]" },
814         { GVCP_SC_MAX_PACKET_COUNT(3), "[SCMPC3 (Stream Channel Max Packet Count #3)]" },
815         { GVCP_SC_MAX_BLOCK_SIZE_HIGH(3), "[SCMBSL3 (Stream Channel Max Block Size (High) #3)]" },
816         { GVCP_SC_MAX_BLOCK_SIZE_LOW(3), "[SCMBSH3 (Stream Channel Max Block Size (Low) #3)]" },
817         { GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS(3), "SCEBA3 (Stream Channel Extended Bootstrap Address #3)]" },
818         { GVCP_MANIFEST_TABLE, "[Manifest Table]" },
819         { GVCP_ACTION_GROUP_KEY(0), "[Action Group Key #0]" },
820         { GVCP_ACTION_GROUP_MASK(0), "[Action Group Mask #0]" },
821         { GVCP_ACTION_GROUP_KEY(1), "[Action Group Key #1]" },
822         { GVCP_ACTION_GROUP_MASK(1), "[Action Group Mask #1]" },
823         { GVCP_ACTION_GROUP_KEY(2), "[Action Group Key #2]" },
824         { GVCP_ACTION_GROUP_MASK(2), "[Action Group Mask #2]" },
825         { GVCP_ACTION_GROUP_KEY(3), "[Action Group Key #3]" },
826         { GVCP_ACTION_GROUP_MASK(3), "[Action Group Mask #3]" },
827         { GVCP_ACTION_GROUP_KEY(4), "[Action Group Key #4]" },
828         { GVCP_ACTION_GROUP_MASK(4), "[Action Group Mask #4]" },
829         { GVCP_ACTION_GROUP_KEY(5), "[Action Group Key #5]" },
830         { GVCP_ACTION_GROUP_MASK(5), "[Action Group Mask #5]" },
831         { GVCP_ACTION_GROUP_KEY(6), "[Action Group Key #6]" },
832         { GVCP_ACTION_GROUP_MASK(6), "[Action Group Mask #6]" },
833         { GVCP_ACTION_GROUP_KEY(7), "[Action Group Key #7]" },
834         { GVCP_ACTION_GROUP_MASK(7), "[Action Group Mask #7]" },
835         { GVCP_ACTION_GROUP_KEY(8), "[Action Group Key #8]" },
836         { GVCP_ACTION_GROUP_MASK(8), "[Action Group Mask #8]" },
837         { GVCP_ACTION_GROUP_KEY(9), "[Action Group Key #9]" },
838         { GVCP_ACTION_GROUP_MASK(9), "[Action Group Mask #9]" },
839         { 0, NULL },
840 };
841
842
843 /*
844 brief Extended Register name to address mappings
845 */
846
847 /* GEV 2.2 */
848 const value_string extendedbootstrapregisternames[] = {
849         { GVCP_SC_GENDC_DESCRIPTOR_ADDRESS, "[GenDC Descriptor Address]" },
850         { GVCP_SC_GENDC_DESCRIPTOR_SIZE, "[GenDC Descriptor Size]" },
851         { GVCP_SC_GENDC_FLOW_MAPPING_TABLE_ADDRESS, "[GenDC Flow Mapping Table Address]" },
852         { GVCP_SC_GENDC_FLOW_MAPPING_TABLE_SIZE, "[GenDC Flow Mapping Table Size]" },
853         { 0, NULL },
854 };
855
856
857 /*
858 \brief Check is the current register access is into one of the extended stream channel registers
859 */
860
861 static gboolean is_extended_bootstrap_address(gvcp_conv_info_t *gvcp_info, guint32 addr, guint32* extended_bootstrap_address_offset)
862 {
863         gint stream_channel_count = 0;
864         for (stream_channel_count = 0; stream_channel_count < GVCP_MAX_STREAM_CHANNEL_COUNT; stream_channel_count++)
865         {
866                 if ((gvcp_info->extended_bootstrap_address[stream_channel_count] != 0) &&
867                         (addr >= gvcp_info->extended_bootstrap_address[stream_channel_count]) &&
868                         (addr <= (gvcp_info->extended_bootstrap_address[stream_channel_count] + GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS_LAST)))
869                 {
870                         if (extended_bootstrap_address_offset)
871                         {
872                                 *extended_bootstrap_address_offset = gvcp_info->extended_bootstrap_address[stream_channel_count];
873                         }
874                         return TRUE;
875                 }
876         }
877         return FALSE;
878 }
879
880
881 /*
882 \brief Returns a register name based on its address
883 */
884
885 static const gchar* get_register_name_from_address(guint32 addr, gvcp_conv_info_t *gvcp_info, gboolean* is_custom_register)
886 {
887         const gchar* address_string = NULL;
888
889         if (is_custom_register != NULL)
890         {
891                 *is_custom_register = FALSE;
892         }
893
894         address_string = try_val_to_str(addr, bootstrapregisternames);
895         if (!address_string)
896         {
897                 guint32 extended_bootstrap_address_offset = 0;
898                 if (is_extended_bootstrap_address(gvcp_info, addr, &extended_bootstrap_address_offset))
899                 {
900                         address_string = try_val_to_str(addr - extended_bootstrap_address_offset, extendedbootstrapregisternames);
901                 }
902
903                 if (!address_string)
904                 {
905                         address_string = wmem_strdup_printf(wmem_packet_scope(), "[Addr:0x%08X]", addr);
906                         if (is_custom_register != NULL)
907                         {
908                                 *is_custom_register = TRUE;
909                         }
910                 }
911         }
912
913         return address_string;
914 }
915
916
917 /*
918 \brief Attempts to dissect a bootstrap register
919 */
920
921 static int dissect_register(guint32 addr, proto_tree *branch, tvbuff_t *tvb, gint offset, gint length)
922 {
923         switch (addr)
924         {
925         case GVCP_VERSION:
926                 proto_tree_add_item(branch, hf_gvcp_spec_version_major, tvb, offset, 4, ENC_BIG_ENDIAN);
927                 proto_tree_add_item(branch, hf_gvcp_spec_version_minor, tvb, offset, 4, ENC_BIG_ENDIAN);
928                 break;
929
930         case GVCP_DEVICE_MODE:
931                 proto_tree_add_item(branch, hf_gvcp_devicemode_endianness, tvb, offset, 4, ENC_BIG_ENDIAN);
932                 proto_tree_add_item(branch, hf_gvcp_devicemode_deviceclass, tvb, offset, 4, ENC_BIG_ENDIAN);
933                 proto_tree_add_item(branch, hf_gvcp_devicemode_current_link_configuration_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
934                 proto_tree_add_item(branch, hf_gvcp_devicemode_characterset, tvb, offset, 4, ENC_BIG_ENDIAN);
935                 break;
936
937         case GVCP_DEVICE_MAC_HIGH_0:
938         case GVCP_DEVICE_MAC_HIGH_1:
939         case GVCP_DEVICE_MAC_HIGH_2:
940         case GVCP_DEVICE_MAC_HIGH_3:
941                 proto_tree_add_item(branch, hf_gvcp_machigh, tvb, offset, 4, ENC_BIG_ENDIAN);
942                 break;
943
944         case GVCP_DEVICE_MAC_LOW_0:
945         case GVCP_DEVICE_MAC_LOW_1:
946         case GVCP_DEVICE_MAC_LOW_2:
947         case GVCP_DEVICE_MAC_LOW_3:
948                 proto_tree_add_item(branch, hf_gvcp_maclow, tvb, offset, 4, ENC_BIG_ENDIAN);
949                 break;
950
951         case GVCP_SUPPORTED_IP_CONFIGURATION_0:
952         case GVCP_SUPPORTED_IP_CONFIGURATION_1:
953         case GVCP_SUPPORTED_IP_CONFIGURATION_2:
954         case GVCP_SUPPORTED_IP_CONFIGURATION_3:
955                 proto_tree_add_item(branch, hf_gvcp_ip_config_can_handle_pause_frames_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
956                 proto_tree_add_item(branch, hf_gvcp_ip_config_can_generate_pause_frames_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
957                 proto_tree_add_item(branch, hf_gvcp_ip_config_lla, tvb, offset, 4, ENC_BIG_ENDIAN);
958                 proto_tree_add_item(branch, hf_gvcp_ip_config_dhcp, tvb, offset, 4, ENC_BIG_ENDIAN);
959                 proto_tree_add_item(branch, hf_gvcp_ip_config_persistent_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
960                 break;
961
962         case GVCP_CURIPCFG_0:
963         case GVCP_CURIPCFG_1:
964         case GVCP_CURIPCFG_2:
965         case GVCP_CURIPCFG_3:
966                 proto_tree_add_item(branch, hf_gvcp_ip_config_can_handle_pause_frames_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
967                 proto_tree_add_item(branch, hf_gvcp_ip_config_can_generate_pause_frames_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
968                 proto_tree_add_item(branch, hf_gvcp_ip_config_lla, tvb, offset, 4, ENC_BIG_ENDIAN);
969                 proto_tree_add_item(branch, hf_gvcp_ip_config_dhcp, tvb, offset, 4, ENC_BIG_ENDIAN);
970                 proto_tree_add_item(branch, hf_gvcp_ip_config_persistent_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
971                 break;
972
973         case GVCP_CURRENT_IP_ADDRESS_0:
974         case GVCP_CURRENT_IP_ADDRESS_1:
975         case GVCP_CURRENT_IP_ADDRESS_2:
976         case GVCP_CURRENT_IP_ADDRESS_3:
977                 proto_tree_add_item(branch, hf_gvcp_current_IP, tvb, offset, 4, ENC_BIG_ENDIAN);
978                 break;
979
980         case GVCP_CURRENT_SUBNET_MASK_0:
981         case GVCP_CURRENT_SUBNET_MASK_1:
982         case GVCP_CURRENT_SUBNET_MASK_2:
983         case GVCP_CURRENT_SUBNET_MASK_3:
984                 proto_tree_add_item(branch, hf_gvcp_current_subnet_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
985                 break;
986
987         case GVCP_CURRENT_DEFAULT_GATEWAY_0:
988         case GVCP_CURRENT_DEFAULT_GATEWAY_1:
989         case GVCP_CURRENT_DEFAULT_GATEWAY_2:
990         case GVCP_CURRENT_DEFAULT_GATEWAY_3:
991                 proto_tree_add_item(branch, hf_gvcp_current_default_gateway, tvb, offset, 4, ENC_BIG_ENDIAN);
992                 break;
993
994         case GVCP_MANUFACTURER_NAME:
995                 proto_tree_add_item(branch, hf_gvcp_reserved_bit, tvb, 0, length, ENC_NA); /*? */
996                 break;
997
998         case GVCP_MODEL_NAME:
999                 proto_tree_add_item(branch, hf_gvcp_reserved_bit, tvb, 0, length, ENC_NA); /*? */
1000                 break;
1001
1002         case GVCP_DEVICE_VERSION:
1003                 proto_tree_add_item(branch, hf_gvcp_reserved_bit, tvb, 0, length, ENC_NA); /*? */
1004                 break;
1005
1006         case GVCP_MANUFACTURER_INFO:
1007                 proto_tree_add_item(branch, hf_gvcp_reserved_bit, tvb, 0, length, ENC_NA); /*? */
1008                 break;
1009
1010         case GVCP_SERIAL_NUMBER:
1011                 proto_tree_add_item(branch, hf_gvcp_reserved_bit, tvb, 0, length, ENC_NA); /*? */
1012                 break;
1013
1014         case GVCP_USER_DEFINED_NAME:
1015                 proto_tree_add_item(branch, hf_gvcp_user_defined_name, tvb, offset, 4, ENC_ASCII|ENC_NA); /*? */
1016                 break;
1017
1018         case GVCP_FIRST_URL:
1019                 proto_tree_add_item(branch, hf_gvcp_reserved_bit, tvb, 0, length, ENC_NA); /*? */
1020                 break;
1021
1022         case GVCP_SECOND_URL:
1023                 proto_tree_add_item(branch, hf_gvcp_reserved_bit, tvb, 0, length, ENC_NA); /*? */
1024                 break;
1025
1026         case GVCP_NUMBER_OF_NETWORK_INTERFACES:
1027                 proto_tree_add_item(branch, hf_gvcp_number_interfaces, tvb, offset, 4, ENC_BIG_ENDIAN);
1028                 break;
1029
1030         case GVCP_PERSISTENT_IP_ADDRESS_0:
1031         case GVCP_PERSISTENT_IP_ADDRESS_1:
1032         case GVCP_PERSISTENT_IP_ADDRESS_2:
1033         case GVCP_PERSISTENT_IP_ADDRESS_3:
1034                 proto_tree_add_item(branch, hf_gvcp_persistent_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
1035                 break;
1036
1037         case GVCP_PERSISTENT_SUBNET_MASK_0:
1038         case GVCP_PERSISTENT_SUBNET_MASK_1:
1039         case GVCP_PERSISTENT_SUBNET_MASK_2:
1040         case GVCP_PERSISTENT_SUBNET_MASK_3:
1041                 proto_tree_add_item(branch, hf_gvcp_persistent_subnet, tvb, offset, 4, ENC_BIG_ENDIAN);
1042                 break;
1043
1044         case GVCP_PERSISTENT_DEFAULT_GATEWAY_0:
1045         case GVCP_PERSISTENT_DEFAULT_GATEWAY_1:
1046         case GVCP_PERSISTENT_DEFAULT_GATEWAY_2:
1047         case GVCP_PERSISTENT_DEFAULT_GATEWAY_3:
1048                 proto_tree_add_item(branch, hf_gvcp_persistent_gateway, tvb, offset, 4, ENC_BIG_ENDIAN);
1049                 break;
1050
1051         case GVCP_LINK_SPEED_0:
1052         case GVCP_LINK_SPEED_1:
1053         case GVCP_LINK_SPEED_2:
1054         case GVCP_LINK_SPEED_3:
1055                 proto_tree_add_item(branch, hf_gvcp_link_speed, tvb, offset, 4, ENC_BIG_ENDIAN);
1056                 break;
1057
1058         case GVCP_NUMBER_OF_MESSAGE_CHANNELS:
1059                 proto_tree_add_item(branch, hf_gvcp_number_message_channels, tvb, offset, 4, ENC_BIG_ENDIAN);
1060                 break;
1061
1062         case GVCP_NUMBER_OF_STREAM_CHANNELS:
1063                 proto_tree_add_item(branch, hf_gvcp_number_stream_channels, tvb, offset, 4, ENC_BIG_ENDIAN);
1064                 break;
1065
1066         case GVCP_NUMBER_OF_ACTION_SIGNALS:
1067                 proto_tree_add_item(branch, hf_gvcp_number_action_signals, tvb, offset, 4, ENC_BIG_ENDIAN);
1068                 break;
1069
1070         case GVCP_ACTION_DEVICE_KEY:
1071                 proto_tree_add_item(branch, hf_gvcp_writeregcmd_data, tvb, offset, 4, ENC_BIG_ENDIAN); /*? */
1072                 break;
1073
1074         case GVCP_NUMBER_OF_ACTIVE_LINKS:
1075                 proto_tree_add_item(branch, hf_gvcp_number_of_active_links_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1076                 break;
1077
1078         case GVCP_SC_CAPS:
1079                 proto_tree_add_item(branch, hf_gvcp_sccaps_scspx_register_supported, tvb, offset, 4, ENC_BIG_ENDIAN);
1080                 proto_tree_add_item(branch, hf_gvcp_sccaps_legacy_16bit_blockid_supported_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1081                 proto_tree_add_item(branch, hf_gvcp_sccaps_scmbsx_supported_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1082                 proto_tree_add_item(branch, hf_gvcp_sccaps_scebax_supported_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1083                 break;
1084
1085         case GVCP_MESSAGE_CHANNEL_CAPS:
1086                 proto_tree_add_item(branch, hf_gvcp_mcsp_supported, tvb, offset, 4, ENC_BIG_ENDIAN);
1087                 proto_tree_add_item(branch, hf_gvcp_mcc_supported_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1088                 proto_tree_add_item(branch, hf_gvcp_mcec_supported_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1089                 break;
1090
1091         case GVCP_CAPABILITY:
1092                 proto_tree_add_item(branch, hf_gvcp_capability_user_defined, tvb, offset, 4, ENC_BIG_ENDIAN);
1093                 proto_tree_add_item(branch, hf_gvcp_capability_serial_number, tvb, offset, 4, ENC_BIG_ENDIAN);
1094                 proto_tree_add_item(branch, hf_gvcp_capability_heartbeat_disable, tvb, offset, 4, ENC_BIG_ENDIAN);
1095                 proto_tree_add_item(branch, hf_gvcp_capability_link_speed, tvb, offset, 4, ENC_BIG_ENDIAN);
1096                 proto_tree_add_item(branch, hf_gvcp_capability_ccp_application_portip, tvb, offset, 4, ENC_BIG_ENDIAN);
1097                 proto_tree_add_item(branch, hf_gvcp_capability_manifest_table, tvb, offset, 4, ENC_BIG_ENDIAN);
1098                 proto_tree_add_item(branch, hf_gvcp_capability_test_data, tvb, offset, 4, ENC_BIG_ENDIAN);
1099                 proto_tree_add_item(branch, hf_gvcp_capability_discovery_ACK_delay, tvb, offset, 4, ENC_BIG_ENDIAN);
1100                 proto_tree_add_item(branch, hf_gvcp_capability_writable_discovery_ACK_delay, tvb, offset, 4, ENC_BIG_ENDIAN);
1101                 proto_tree_add_item(branch, hf_gvcp_capability_extended_status_code_v1_1, tvb, offset, 4, ENC_BIG_ENDIAN);
1102                 proto_tree_add_item(branch, hf_gvcp_capability_primary_application_switchover, tvb, offset, 4, ENC_BIG_ENDIAN);
1103                 proto_tree_add_item(branch, hf_gvcp_capability_unconditional_action_command, tvb, offset, 4, ENC_BIG_ENDIAN);
1104                 proto_tree_add_item(branch, hf_gvcp_capability_1588_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1105                 proto_tree_add_item(branch, hf_gvcp_capability_extended_status_code_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1106                 proto_tree_add_item(branch, hf_gvcp_capability_scheduled_action_command_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1107                 proto_tree_add_item(branch, hf_gvcp_capability_ieee1588_extended_capabilities_v2_1, tvb, offset, 4, ENC_BIG_ENDIAN);
1108                 proto_tree_add_item(branch, hf_gvcp_capability_action_command, tvb, offset, 4, ENC_BIG_ENDIAN);
1109                 proto_tree_add_item(branch, hf_gvcp_capability_pending, tvb, offset, 4, ENC_BIG_ENDIAN);
1110                 proto_tree_add_item(branch, hf_gvcp_capability_evendata, tvb, offset, 4, ENC_BIG_ENDIAN);
1111                 proto_tree_add_item(branch, hf_gvcp_capability_event, tvb, offset, 4, ENC_BIG_ENDIAN);
1112                 proto_tree_add_item(branch, hf_gvcp_capability_packetresend, tvb, offset, 4, ENC_BIG_ENDIAN);
1113                 proto_tree_add_item(branch, hf_gvcp_capability_writemem, tvb, offset, 4, ENC_BIG_ENDIAN);
1114                 proto_tree_add_item(branch, hf_gvcp_capability_concatenation, tvb, offset, 4, ENC_BIG_ENDIAN);
1115                 break;
1116
1117         case GVCP_HEARTBEAT_TIMEOUT:
1118                 proto_tree_add_item(branch, hf_gvcp_heartbeat, tvb, offset, 4, ENC_BIG_ENDIAN);
1119                 break;
1120
1121         case GVCP_TIMESTAMP_TICK_FREQUENCY_HIGH:
1122                 proto_tree_add_item(branch, hf_gvcp_high_timestamp_frequency, tvb, offset, 4, ENC_BIG_ENDIAN);
1123                 break;
1124
1125         case GVCP_TIMESTAMP_TICK_FREQUENCY_LOW:
1126                 proto_tree_add_item(branch, hf_gvcp_low_timestamp_frequency, tvb, offset, 4, ENC_BIG_ENDIAN);
1127                 break;
1128
1129         case GVCP_TIMESTAMP_CONTROL:
1130                 proto_tree_add_item(branch, hf_gvcp_timestamp_control_latch, tvb, offset, 4, ENC_BIG_ENDIAN);
1131                 proto_tree_add_item(branch, hf_gvcp_timestamp_control_reset, tvb, offset, 4, ENC_BIG_ENDIAN);
1132                 break;
1133
1134         case GVCP_TIMESTAMP_VALUE_HIGH:
1135                 proto_tree_add_item(branch, hf_gvcp_high_timestamp_value, tvb, offset, 4, ENC_BIG_ENDIAN);
1136                 break;
1137
1138         case GVCP_TIMESTAMP_VALUE_LOW:
1139                 proto_tree_add_item(branch, hf_gvcp_low_timestamp_value, tvb, offset, 4, ENC_BIG_ENDIAN);
1140                 break;
1141
1142         case GVCP_DISCOVERY_ACK_DELAY:
1143                 proto_tree_add_item(branch, hf_gvcp_discovery_ACK_delay, tvb, offset, 4, ENC_BIG_ENDIAN);
1144                 break;
1145
1146         case GVCP_CONFIGURATION:
1147                 proto_tree_add_item(branch, hf_gvcp_configuration_1588_enable_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1148                 proto_tree_add_item(branch, hf_gvcp_configuration_extended_status_codes_enable_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1149                 proto_tree_add_item(branch, hf_gvcp_configuration_unconditional_action_command_enable_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1150                 proto_tree_add_item(branch, hf_gvcp_configuration_extended_status_codes_enable_v1_1, tvb, offset, 4, ENC_BIG_ENDIAN);
1151                 proto_tree_add_item(branch, hf_gvcp_configuration_pending_ack_enable, tvb, offset, 4, ENC_BIG_ENDIAN);
1152                 proto_tree_add_item(branch, hf_gvcp_configuration_heartbeat_disable, tvb, offset, 4, ENC_BIG_ENDIAN);
1153                 break;
1154
1155         case GVCP_PENDING_TIMEOUT:
1156                 proto_tree_add_item(branch, hf_gvcp_pending_timeout_max_execution, tvb, offset, 4, ENC_BIG_ENDIAN);
1157                 break;
1158
1159         case GVCP_CONTROL_SWITCHOVER_KEY:
1160                 proto_tree_add_item(branch, hf_gvcp_control_switchover_key_register, tvb, offset, 4, ENC_BIG_ENDIAN);
1161                 break;
1162
1163         case GVCP_GVSCP_CONFIGURATION:
1164                 proto_tree_add_item(branch, hf_gvcp_gvsp_configuration_64bit_blockid_enable_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1165                 break;
1166
1167         case GVCP_PHYSICAL_LINK_CAPABILITY:
1168                 proto_tree_add_item(branch, hf_gvcp_link_dlag_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1169                 proto_tree_add_item(branch, hf_gvcp_link_slag_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1170                 proto_tree_add_item(branch, hf_gvcp_link_ml_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1171                 proto_tree_add_item(branch, hf_gvcp_link_sl_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1172                 break;
1173
1174         case GVCP_PHYSICAL_LINK_CONFIGURATION:
1175                 proto_tree_add_item(branch, hf_gvcp_link_dlag_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1176                 proto_tree_add_item(branch, hf_gvcp_link_slag_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1177                 proto_tree_add_item(branch, hf_gvcp_link_ml_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1178                 proto_tree_add_item(branch, hf_gvcp_link_sl_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1179                 break;
1180
1181         case GVCP_IEEE_1588_STATUS:
1182                 proto_tree_add_item(branch, hf_gvcp_ieee1588_clock_status_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1183                 break;
1184
1185         case GVCP_SCHEDULED_ACTION_COMMAND_QUEUE_SIZE:
1186                 proto_tree_add_item(branch, hf_gvcp_scheduled_action_command_queue_size_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1187                 break;
1188
1189         case GVCP_IEEE_1588_EXTENDED_CAPABILITY:
1190                 proto_tree_add_item(branch, hf_gvcp_ieee1588_profile_registers_present_v2_1, tvb, offset, 4, ENC_BIG_ENDIAN);
1191                 break;
1192
1193         case GVCP_IEEE_1588_SUPPORTED_PROFILES:
1194                 proto_tree_add_item(branch, hf_gvcp_ieee1588_ptp_profile_supported_v2_1, tvb, offset, 4, ENC_BIG_ENDIAN);
1195                 proto_tree_add_item(branch, hf_gvcp_ieee1588_802dot1as_profile_supported_v2_1, tvb, offset, 4, ENC_BIG_ENDIAN);
1196                 break;
1197
1198         case GVCP_IEEE_1588_SELECTED_PROFILE:
1199                 proto_tree_add_item(branch, hf_gvcp_selected_ieee1588_profile_v2_1, tvb, offset, 4, ENC_BIG_ENDIAN);
1200                 break;
1201
1202         case GVCP_CCP:
1203                 proto_tree_add_item(branch, hf_gvcp_control_switchover_key, tvb, offset, 4, ENC_BIG_ENDIAN);
1204                 proto_tree_add_item(branch, hf_gvcp_control_switchover_en, tvb, offset, 4, ENC_BIG_ENDIAN);
1205                 proto_tree_add_item(branch, hf_gvcp_control_access, tvb, offset, 4, ENC_BIG_ENDIAN);
1206                 proto_tree_add_item(branch, hf_gvcp_exclusive_access, tvb, offset, 4, ENC_BIG_ENDIAN);
1207                 break;
1208
1209         case GVCP_PRIMARY_APPLICATION_PORT:
1210                 proto_tree_add_item(branch, hf_gvcp_primary_application_host_port, tvb, offset, 4, ENC_BIG_ENDIAN);
1211                 break;
1212
1213         case GVCP_PRIMARY_APPLICATION_IP_ADDRESS:
1214                 proto_tree_add_item(branch, hf_gvcp_primary_application_ip_address, tvb, offset, 4, ENC_BIG_ENDIAN);
1215                 break;
1216
1217         case GVCP_MC_DESTINATION_PORT:
1218                 proto_tree_add_item(branch, hf_gvcp_network_interface_index, tvb, offset, 4, ENC_BIG_ENDIAN);
1219                 proto_tree_add_item(branch, hf_gvcp_host_port, tvb, offset, 4, ENC_BIG_ENDIAN);
1220                 break;
1221
1222         case GVCP_MC_DESTINATION_ADDRESS:
1223                 proto_tree_add_item(branch, hf_gvcp_channel_destination_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
1224                 break;
1225
1226         case GVCP_MC_TIMEOUT:
1227                 proto_tree_add_item(branch, hf_gvcp_message_channel_transmission_timeout, tvb, offset, 4, ENC_BIG_ENDIAN);
1228                 break;
1229
1230         case GVCP_MC_RETRY_COUNT:
1231                 proto_tree_add_item(branch, hf_gvcp_message_channel_retry_count, tvb, offset, 4, ENC_BIG_ENDIAN);
1232                 break;
1233
1234         case GVCP_MC_SOURCE_PORT:
1235                 proto_tree_add_item(branch, hf_gvcp_message_channel_source_port, tvb, offset, 4, ENC_BIG_ENDIAN);
1236                 break;
1237
1238         case GVCP_MC_CONFIGURATION:
1239                 proto_tree_add_item(branch, hf_gvcp_mcec_enabled_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1240                 break;
1241
1242         case GVCP_SC_DESTINATION_PORT(0):
1243         case GVCP_SC_DESTINATION_PORT(1):
1244         case GVCP_SC_DESTINATION_PORT(2):
1245         case GVCP_SC_DESTINATION_PORT(3):
1246                 proto_tree_add_item(branch, hf_gvcp_sc_direction, tvb, offset, 4, ENC_BIG_ENDIAN);
1247                 proto_tree_add_item(branch, hf_gvcp_sc_ni_index, tvb, offset, 4, ENC_BIG_ENDIAN);
1248                 proto_tree_add_item(branch, hf_gvcp_sc_host_port, tvb, offset, 4, ENC_BIG_ENDIAN);
1249                 break;
1250
1251         case GVCP_SC_PACKET_SIZE(0):
1252         case GVCP_SC_PACKET_SIZE(1):
1253         case GVCP_SC_PACKET_SIZE(2):
1254         case GVCP_SC_PACKET_SIZE(3):
1255                 proto_tree_add_item(branch, hf_gvcp_sc_fire_test_packet, tvb, offset, 4, ENC_BIG_ENDIAN);
1256                 proto_tree_add_item(branch, hf_gvcp_sc_do_not_fragment, tvb, offset, 4, ENC_BIG_ENDIAN);
1257                 proto_tree_add_item(branch, hf_gvcp_sc_pixel_endianness, tvb, offset, 4, ENC_BIG_ENDIAN);
1258                 proto_tree_add_item(branch, hf_gvcp_sc_packet_size, tvb, offset, 4, ENC_BIG_ENDIAN);
1259                 break;
1260
1261         case GVCP_SC_PACKET_DELAY(0):
1262         case GVCP_SC_PACKET_DELAY(1):
1263         case GVCP_SC_PACKET_DELAY(2):
1264         case GVCP_SC_PACKET_DELAY(3):
1265                 proto_tree_add_item(branch, hf_gvcp_sc_packet_delay, tvb, offset, 4, ENC_BIG_ENDIAN);
1266                 break;
1267
1268         case GVCP_SC_DESTINATION_ADDRESS(0):
1269         case GVCP_SC_DESTINATION_ADDRESS(1):
1270         case GVCP_SC_DESTINATION_ADDRESS(2):
1271         case GVCP_SC_DESTINATION_ADDRESS(3):
1272                 {
1273                         guint32 value = 0;
1274                         value = tvb_get_letohl(tvb, offset);
1275                         proto_tree_add_ipv4(branch, hf_gvcp_sc_destination_ip, tvb, offset, 4, value);
1276                 }
1277                 break;
1278
1279         case GVCP_SC_SOURCE_PORT(0):
1280         case GVCP_SC_SOURCE_PORT(1):
1281         case GVCP_SC_SOURCE_PORT(2):
1282         case GVCP_SC_SOURCE_PORT(3):
1283                 proto_tree_add_item(branch, hf_gvcp_sc_source_port, tvb, offset, 4, ENC_BIG_ENDIAN);
1284                 break;
1285
1286         case GVCP_SC_CAPABILITY(0):
1287         case GVCP_SC_CAPABILITY(1):
1288         case GVCP_SC_CAPABILITY(2):
1289         case GVCP_SC_CAPABILITY(3):
1290                 proto_tree_add_item(branch, hf_gvcp_sc_big_little_endian_supported, tvb, offset, 4, ENC_BIG_ENDIAN);
1291                 proto_tree_add_item(branch, hf_gvcp_sc_ip_reassembly_supported, tvb, offset, 4, ENC_BIG_ENDIAN);
1292                 proto_tree_add_item(branch, hf_gvcp_sc_scmpcx_supported_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1293                 proto_tree_add_item(branch, hf_gvcp_sc_gendc_supported_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1294                 proto_tree_add_item(branch, hf_gvcp_sc_multi_part_supported_v2_1, tvb, offset, 4, ENC_BIG_ENDIAN);
1295                 proto_tree_add_item(branch, hf_gvcp_sc_large_leader_trailer_supported_v2_1, tvb, offset, 4, ENC_BIG_ENDIAN);
1296                 proto_tree_add_item(branch, hf_gvcp_sc_multizone_supported_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1297                 proto_tree_add_item(branch, hf_gvcp_sc_packet_resend_destination_option_supported_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1298                 proto_tree_add_item(branch, hf_gvcp_sc_packet_resend_all_in_transmission_supported_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1299                 proto_tree_add_item(branch, hf_gvcp_sc_unconditional_streaming_supported, tvb, offset, 4, ENC_BIG_ENDIAN);
1300                 proto_tree_add_item(branch, hf_gvcp_sc_extended_chunk_data_supported, tvb, offset, 4, ENC_BIG_ENDIAN);
1301                 break;
1302
1303         case GVCP_SC_CONFIGURATION(0):
1304         case GVCP_SC_CONFIGURATION(1):
1305         case GVCP_SC_CONFIGURATION(2):
1306         case GVCP_SC_CONFIGURATION(3):
1307                 proto_tree_add_item(branch, hf_gvcp_sc_gendc_enabled_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1308                 proto_tree_add_item(branch, hf_gvcp_sc_multi_part_enabled_v2_1, tvb, offset, 4, ENC_BIG_ENDIAN);
1309                 proto_tree_add_item(branch, hf_gvcp_sc_large_leader_trailer_enabled_v2_1, tvb, offset, 4, ENC_BIG_ENDIAN);
1310                 proto_tree_add_item(branch, hf_gvcp_sc_packet_resend_destination_option_enabled_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1311                 proto_tree_add_item(branch, hf_gvcp_sc_packet_resend_all_in_transmission_enabled_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1312                 proto_tree_add_item(branch, hf_gvcp_sc_unconditional_streaming_enabled, tvb, offset, 4, ENC_BIG_ENDIAN);
1313                 proto_tree_add_item(branch, hf_gvcp_sc_extended_chunk_data_enabled, tvb, offset, 4, ENC_BIG_ENDIAN);
1314                 break;
1315
1316         case GVCP_SC_ZONE(0):
1317         case GVCP_SC_ZONE(1):
1318         case GVCP_SC_ZONE(2):
1319         case GVCP_SC_ZONE(3):
1320                 proto_tree_add_item(branch, hf_gvcp_sc_additional_zones_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1321                 break;
1322
1323         case GVCP_SC_ZONE_DIRECTION(0):
1324         case GVCP_SC_ZONE_DIRECTION(1):
1325         case GVCP_SC_ZONE_DIRECTION(2):
1326         case GVCP_SC_ZONE_DIRECTION(3):
1327                 proto_tree_add_item(branch, hf_gvcp_sc_zone0_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1328                 proto_tree_add_item(branch, hf_gvcp_sc_zone1_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1329                 proto_tree_add_item(branch, hf_gvcp_sc_zone2_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1330                 proto_tree_add_item(branch, hf_gvcp_sc_zone3_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1331                 proto_tree_add_item(branch, hf_gvcp_sc_zone4_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1332                 proto_tree_add_item(branch, hf_gvcp_sc_zone5_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1333                 proto_tree_add_item(branch, hf_gvcp_sc_zone6_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1334                 proto_tree_add_item(branch, hf_gvcp_sc_zone7_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1335                 proto_tree_add_item(branch, hf_gvcp_sc_zone8_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1336                 proto_tree_add_item(branch, hf_gvcp_sc_zone9_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1337                 proto_tree_add_item(branch, hf_gvcp_sc_zone10_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1338                 proto_tree_add_item(branch, hf_gvcp_sc_zone11_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1339                 proto_tree_add_item(branch, hf_gvcp_sc_zone12_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1340                 proto_tree_add_item(branch, hf_gvcp_sc_zone13_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1341                 proto_tree_add_item(branch, hf_gvcp_sc_zone14_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1342                 proto_tree_add_item(branch, hf_gvcp_sc_zone15_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1343                 proto_tree_add_item(branch, hf_gvcp_sc_zone16_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1344                 proto_tree_add_item(branch, hf_gvcp_sc_zone17_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1345                 proto_tree_add_item(branch, hf_gvcp_sc_zone18_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1346                 proto_tree_add_item(branch, hf_gvcp_sc_zone19_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1347                 proto_tree_add_item(branch, hf_gvcp_sc_zone20_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1348                 proto_tree_add_item(branch, hf_gvcp_sc_zone21_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1349                 proto_tree_add_item(branch, hf_gvcp_sc_zone22_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1350                 proto_tree_add_item(branch, hf_gvcp_sc_zone23_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1351                 proto_tree_add_item(branch, hf_gvcp_sc_zone24_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1352                 proto_tree_add_item(branch, hf_gvcp_sc_zone25_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1353                 proto_tree_add_item(branch, hf_gvcp_sc_zone26_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1354                 proto_tree_add_item(branch, hf_gvcp_sc_zone27_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1355                 proto_tree_add_item(branch, hf_gvcp_sc_zone28_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1356                 proto_tree_add_item(branch, hf_gvcp_sc_zone29_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1357                 proto_tree_add_item(branch, hf_gvcp_sc_zone30_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1358                 proto_tree_add_item(branch, hf_gvcp_sc_zone31_direction_v2_0, tvb, offset, 4, ENC_BIG_ENDIAN);
1359                 break;
1360
1361         case GVCP_SC_MAX_PACKET_COUNT(0):
1362         case GVCP_SC_MAX_PACKET_COUNT(1):
1363         case GVCP_SC_MAX_PACKET_COUNT(2):
1364         case GVCP_SC_MAX_PACKET_COUNT(3):
1365                 proto_tree_add_item(branch, hf_gvcp_sc_max_packet_count_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1366                 break;
1367
1368         case GVCP_SC_MAX_BLOCK_SIZE_HIGH(0):
1369         case GVCP_SC_MAX_BLOCK_SIZE_HIGH(1):
1370         case GVCP_SC_MAX_BLOCK_SIZE_HIGH(2):
1371         case GVCP_SC_MAX_BLOCK_SIZE_HIGH(3):
1372                 proto_tree_add_item(branch, hf_gvcp_sc_max_block_size_high_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1373                 break;
1374
1375         case GVCP_SC_MAX_BLOCK_SIZE_LOW(0):
1376         case GVCP_SC_MAX_BLOCK_SIZE_LOW(1):
1377         case GVCP_SC_MAX_BLOCK_SIZE_LOW(2):
1378         case GVCP_SC_MAX_BLOCK_SIZE_LOW(3):
1379                 proto_tree_add_item(branch, hf_gvcp_sc_max_block_size_low_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1380                 break;
1381
1382         case GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS(0):
1383         case GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS(1):
1384         case GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS(2):
1385         case GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS(3):
1386                 proto_tree_add_item(branch, hf_gvcp_sc_extended_registers_address_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1387
1388                 break;
1389
1390         case GVCP_MANIFEST_TABLE:
1391                 proto_tree_add_item(branch, hf_gvcp_manifest_table, tvb, 0, length, ENC_NA);
1392                 break;
1393
1394         case GVCP_ACTION_GROUP_KEY(0):
1395         case GVCP_ACTION_GROUP_KEY(1):
1396         case GVCP_ACTION_GROUP_KEY(2):
1397         case GVCP_ACTION_GROUP_KEY(3):
1398         case GVCP_ACTION_GROUP_KEY(4):
1399         case GVCP_ACTION_GROUP_KEY(5):
1400         case GVCP_ACTION_GROUP_KEY(6):
1401         case GVCP_ACTION_GROUP_KEY(7):
1402         case GVCP_ACTION_GROUP_KEY(8):
1403         case GVCP_ACTION_GROUP_KEY(9):
1404                 proto_tree_add_item(branch, hf_gvcp_action_group_key, tvb, offset, 4, ENC_BIG_ENDIAN);
1405                 break;
1406
1407         case GVCP_ACTION_GROUP_MASK(0):
1408         case GVCP_ACTION_GROUP_MASK(1):
1409         case GVCP_ACTION_GROUP_MASK(2):
1410         case GVCP_ACTION_GROUP_MASK(3):
1411         case GVCP_ACTION_GROUP_MASK(4):
1412         case GVCP_ACTION_GROUP_MASK(5):
1413         case GVCP_ACTION_GROUP_MASK(6):
1414         case GVCP_ACTION_GROUP_MASK(7):
1415         case GVCP_ACTION_GROUP_MASK(8):
1416         case GVCP_ACTION_GROUP_MASK(9):
1417                 proto_tree_add_item(branch, hf_gvcp_action_group_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
1418                 break;
1419
1420         default:
1421                 return 0;
1422         }
1423
1424         return 1;
1425 }
1426
1427 /*
1428 \brief Attempts to dissect an extended bootstrap register
1429 */
1430
1431 static int dissect_extended_bootstrap_register(guint32 addr, proto_tree *branch, tvbuff_t *tvb, gint offset, gint length _U_)
1432 {
1433         switch (addr)
1434         {
1435         case GVCP_SC_GENDC_DESCRIPTOR_ADDRESS:
1436                 proto_tree_add_item(branch, hf_gvcp_sc_gendc_descriptor_address_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1437                 break;
1438         case GVCP_SC_GENDC_DESCRIPTOR_SIZE:
1439                 proto_tree_add_item(branch, hf_gvcp_sc_gendc_descriptor_size_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1440                 break;
1441         case GVCP_SC_GENDC_FLOW_MAPPING_TABLE_ADDRESS:
1442                 proto_tree_add_item(branch, hf_gvcp_sc_gendc_flow_mapping_table_address_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1443                 break;
1444         case GVCP_SC_GENDC_FLOW_MAPPING_TABLE_SIZE:
1445                 proto_tree_add_item(branch, hf_gvcp_sc_gendc_flow_mapping_table_size_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1446                 break;
1447
1448         default:
1449                 return 0;
1450         }
1451
1452         return 1;
1453 }
1454
1455
1456 /* Attempts to dissect a bootstrap register (readmem context) */
1457 static int dissect_register_data(guint32 addr, proto_tree *branch, tvbuff_t *tvb, gint offset, gint length)
1458 {
1459         switch (addr)
1460         {
1461         case GVCP_MANUFACTURER_NAME:
1462                 if (length == 32)
1463                 {
1464                         proto_tree_add_item(branch, hf_gvcp_manufacturer_name, tvb, offset, -1, ENC_ASCII|ENC_NA);
1465                 }
1466                 break;
1467
1468         case GVCP_MODEL_NAME:
1469                 if (length == 32)
1470                 {
1471                         proto_tree_add_item(branch, hf_gvcp_model_name, tvb, offset, -1, ENC_ASCII|ENC_NA);
1472                 }
1473                 break;
1474
1475         case GVCP_DEVICE_VERSION:
1476                 if (length == 32)
1477                 {
1478                         proto_tree_add_item(branch, hf_gvcp_device_version, tvb, offset, -1, ENC_ASCII|ENC_NA);
1479                 }
1480                 break;
1481
1482         case GVCP_MANUFACTURER_INFO:
1483                 if (length == 48)
1484                 {
1485                         proto_tree_add_item(branch, hf_gvcp_manufacturer_specific_info, tvb, offset, -1, ENC_ASCII|ENC_NA);
1486                 }
1487                 break;
1488
1489         case GVCP_SERIAL_NUMBER:
1490                 if (length == 16)
1491                 {
1492                         proto_tree_add_item(branch, hf_gvcp_serial_number, tvb, offset, -1, ENC_ASCII|ENC_NA);
1493                 }
1494                 break;
1495
1496         case GVCP_USER_DEFINED_NAME:
1497                 if (length == 16)
1498                 {
1499                         proto_tree_add_item(branch, hf_gvcp_user_defined_name, tvb, offset, -1, ENC_ASCII|ENC_NA);
1500                 }
1501                 break;
1502
1503         case GVCP_FIRST_URL:
1504                 if (length == 512)
1505                 {
1506                         proto_tree_add_item(branch, hf_gvcp_first_xml_device_description_file, tvb, offset, -1, ENC_ASCII|ENC_NA);
1507                 }
1508                 break;
1509
1510         case GVCP_SECOND_URL:
1511                 if (length == 512)
1512                 {
1513                         proto_tree_add_item(branch, hf_gvcp_second_xml_device_description_file, tvb, offset, -1, ENC_ASCII|ENC_NA);
1514                 }
1515                 break;
1516
1517         default:
1518                 return 0;
1519         }
1520
1521         return 1;
1522 }
1523
1524
1525 /*
1526 \brief DISSECT: Force IP command
1527 */
1528
1529 static void dissect_forceip_cmd(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint startoffset, gint length)
1530 {
1531         const gint mac_offset = startoffset + 2;
1532         const gint ip_offset = startoffset + 20;
1533         const gint mask_offset = startoffset + 36;
1534         const gint gateway_offset = startoffset + 52;
1535
1536         if (gvcp_telegram_tree != NULL)
1537         {
1538                 gvcp_telegram_tree = proto_tree_add_subtree(gvcp_telegram_tree, tvb, startoffset, length,
1539                                                                                 ett_gvcp_payload_cmd, NULL, "FORCEIP_CMD Options");
1540
1541                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_forceip_mac_address, tvb, mac_offset, 6, ENC_NA);
1542                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_forceip_static_IP, tvb, ip_offset, 4, ENC_BIG_ENDIAN);
1543                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_forceip_static_subnet_mask, tvb, mask_offset, 4, ENC_BIG_ENDIAN);
1544                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_forceip_static_default_gateway, tvb, gateway_offset, 4, ENC_BIG_ENDIAN);
1545         }
1546 }
1547
1548
1549 /*
1550 \brief DISSECT: Packet resend command
1551 */
1552
1553 static void dissect_packetresend_cmd(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo, gint startoffset, gint length, int extendedblockid)
1554 {
1555
1556         guint64 block_id = 0;
1557         guint32 first_packet = 0;
1558         guint32 last_packet = 0;
1559         gint offset = startoffset;
1560
1561         /* Get block ID to generate summary - supports 16 and 64 bits */
1562         if (extendedblockid == 0)
1563         {
1564                 block_id = tvb_get_ntohs(tvb, offset + 2);
1565         }
1566         else
1567         {
1568                 guint64 highid;
1569                 guint64 lowid;
1570                 highid = tvb_get_ntohl(tvb, offset + 12);
1571                 lowid = tvb_get_ntohl(tvb, offset + 16);
1572
1573                 block_id = lowid | (highid << 32);
1574         }
1575
1576         /* Get first and last packet IDs for summary - supports 24 and 32 bits */
1577         if (extendedblockid == 0)
1578         {
1579                 /* in GEV1.2 and prior we use only 24 bit packet IDs */
1580                 first_packet = tvb_get_ntohl(tvb, offset + 4) & 0x00FFFFFF;
1581                 last_packet = tvb_get_ntohl(tvb, offset + 8) & 0x00FFFFFF;
1582         }
1583         else
1584         {
1585                 first_packet = tvb_get_ntohl(tvb, offset + 4);
1586                 last_packet = tvb_get_ntohl(tvb, offset + 8);
1587         }
1588
1589         col_append_fstr(pinfo->cinfo, COL_INFO, "Block %" G_GINT64_MODIFIER "u, Packets %d->%d", (gint64)block_id, first_packet, last_packet);
1590
1591         if (gvcp_telegram_tree != NULL)
1592         {
1593                 /* Command header/tree */
1594                 gvcp_telegram_tree = proto_tree_add_subtree(gvcp_telegram_tree, tvb, startoffset, length,
1595                                                                                                 ett_gvcp_payload_cmd, NULL, "PACKETRESEND_CMD Values");
1596
1597                 /* Stream channel */
1598                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_resendcmd_stream_channel_index, tvb, offset, 2, ENC_BIG_ENDIAN);
1599
1600                 /* First, last packet IDs - supports 24 and 32 bits */
1601                 if (extendedblockid == 0)
1602                 {
1603                         /* Block ID (16 bits) only if extended block ID disabled */
1604                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_resendcmd_block_id, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1605                         /* in GEV1.2 and prior we use only 24 bit packet IDs */
1606                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_resendcmd_first_packet_id, tvb, offset + 5, 3, ENC_BIG_ENDIAN);
1607                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_resendcmd_last_packet_id, tvb, offset + 9, 3, ENC_BIG_ENDIAN);
1608                 }
1609                 else
1610                 {
1611                         /* Extended block ID (64 bits) only if enabled (from GVCP header flags) */
1612                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_resendcmd_extended_block_id_v2_0, tvb, offset + 12, 8, ENC_BIG_ENDIAN);
1613                         /* Extended packed ID (32 bits) only if enabled */
1614                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_resendcmd_extended_first_packet_id_v2_0, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
1615                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_resendcmd_extended_last_packet_id_v2_0, tvb, offset + 8, 4, ENC_BIG_ENDIAN);
1616                 }
1617         }
1618 }
1619
1620
1621 /*
1622 \brief DISSECT: Read register command
1623 */
1624
1625 static void dissect_readreg_cmd(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo, gint startoffset, gint length, gvcp_conv_info_t *gvcp_info, gvcp_transaction_t* gvcp_trans)
1626 {
1627         proto_item *item = NULL;
1628         guint32 addr = 0;
1629         const gchar* address_string = NULL;
1630         gboolean is_custom_register = FALSE;
1631         gint offset = startoffset;
1632         gint i;
1633         gint num_registers = length / 4;
1634
1635         addr = tvb_get_ntohl(tvb, offset);
1636         address_string = get_register_name_from_address(addr, gvcp_info, &is_custom_register);
1637
1638         if (num_registers > 1)
1639         {
1640                 col_append_fstr(pinfo->cinfo, COL_INFO, "[Multiple Register Read Command]");
1641         }
1642         else
1643         {
1644                 col_append_str(pinfo->cinfo, COL_INFO, address_string);
1645         }
1646
1647         if (!pinfo->fd->visited)
1648         {
1649                 gvcp_trans->addr_list = wmem_array_new(wmem_file_scope(), sizeof(guint32));
1650         }
1651
1652         /* Subtree Initialization for Payload Data: READREG_CMD */
1653         if (gvcp_telegram_tree != NULL)
1654         {
1655                 if (num_registers > 1)
1656                 {
1657                         gvcp_telegram_tree = proto_tree_add_subtree(gvcp_telegram_tree, tvb, startoffset, length,
1658                                                                                                 ett_gvcp_payload_cmd, &item, "READREG_CMD Address List");
1659                 }
1660         }
1661
1662         for (i = 0; i < num_registers; i++)
1663         {
1664                 /* For block read register request, address gets re-initialized here in the for loop */
1665                 addr = tvb_get_ntohl(tvb, offset);
1666
1667                 if (gvcp_trans && (!pinfo->fd->visited))
1668                 {
1669                         wmem_array_append_one(gvcp_trans->addr_list, addr);
1670                 }
1671
1672                 if (gvcp_telegram_tree != NULL)
1673                 {
1674                         if (try_val_to_str(addr, bootstrapregisternames) != NULL)
1675                         {
1676                                 /* Use known bootstrap register */
1677                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_readregcmd_bootstrap_register, tvb, offset, 4, ENC_BIG_ENDIAN);
1678                         }
1679                         else
1680                         {
1681                                 guint32 extended_bootstrap_address_offset = 0;
1682                                 if (is_extended_bootstrap_address(gvcp_info, addr, &extended_bootstrap_address_offset))
1683                                 {
1684                                         dissect_extended_bootstrap_register(addr - extended_bootstrap_address_offset, gvcp_telegram_tree, tvb, offset, 4);
1685                                 }
1686                                 else
1687                                 {
1688                                         /* Insert data as generic register */
1689                                         item = proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_custom_register_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
1690
1691                                         /* Use generic register name */
1692                                         proto_item_append_text(item, " [Unknown Register]");
1693                                 }
1694                         }
1695                 }
1696                 offset +=4;
1697         }
1698 }
1699
1700
1701 /*
1702 \brief DISSECT: Write register command
1703 */
1704
1705 static void dissect_writereg_cmd(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo, gint startoffset, gint length, gvcp_conv_info_t *gvcp_info, gvcp_transaction_t* gvcp_trans)
1706 {
1707         gint offset = startoffset;
1708         gint i;
1709         proto_item *item = NULL;
1710         guint32 addr = 0;
1711         guint32 value = 0;
1712         const gchar *address_string = NULL;
1713         gboolean is_custom_register = FALSE;
1714         gint num_registers = length / 8; /* divide by 8 because we are counting register-value pairs */
1715         proto_tree *subtree = NULL;
1716
1717         if (gvcp_trans)
1718         {
1719                 gvcp_trans->addr_count = num_registers;
1720         }
1721
1722         addr = tvb_get_ntohl(tvb, offset);    /* first register address to be read from WRITEREG_CMD */
1723         value = tvb_get_ntohl(tvb, offset+4);
1724         address_string = get_register_name_from_address(addr, gvcp_info, &is_custom_register);
1725
1726         /* Automatically learn stream port. Dissect as external GVSP. */
1727         if ((addr == GVCP_SC_DESTINATION_PORT(0)) ||
1728                 (addr == GVCP_SC_DESTINATION_PORT(1)) ||
1729                 (addr == GVCP_SC_DESTINATION_PORT(2)) ||
1730                 (addr == GVCP_SC_DESTINATION_PORT(3)))
1731         {
1732                 /* For now we simply (always) add ports. Maybe we should remove when the dissector gets unloaded? */
1733                 dissector_add_uint("udp.port", value, gvsp_handle);
1734         }
1735
1736         /* Automatically learn messaging channel port. Dissect as GVCP. */
1737         if (addr == GVCP_MC_DESTINATION_PORT)
1738         {
1739                 /* XXX For now we simply (always) add ports. Maybe we should remove when the dissector gets unloaded? */
1740                 dissector_add_uint("udp.port", value, gvcp_handle);
1741         }
1742
1743         if (num_registers > 1)
1744         {
1745                 col_append_fstr(pinfo->cinfo, COL_INFO, "[Multiple Register Write Command]");
1746         }
1747         else
1748         {
1749                 col_append_fstr(pinfo->cinfo, COL_INFO, "%s Value=0x%08X", address_string, value);
1750         }
1751
1752         if (gvcp_telegram_tree != NULL)
1753         {
1754                 if (num_registers > 1)
1755                 {
1756                         gvcp_telegram_tree = proto_tree_add_subtree(gvcp_telegram_tree, tvb, startoffset, length,
1757                                                                         ett_gvcp_payload_cmd, &item, "WRITEREG_CMD Address List");
1758                 }
1759
1760                 for (i = 0; i < num_registers; i++)
1761                 {
1762                         /* For block write register request, address gets re-initialized here in the for loop */
1763                         addr = tvb_get_ntohl(tvb, offset);
1764
1765                         if (try_val_to_str(addr, bootstrapregisternames) != NULL)
1766                         {
1767                                 /* Read the WRITEREG_CMD requested register address */
1768                                 item = proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_writeregcmd_bootstrap_register, tvb, offset, 4, ENC_BIG_ENDIAN);
1769                                 subtree = proto_item_add_subtree(item, ett_gvcp_payload_cmd_subtree);
1770
1771                                 /* Skip 32bit to dissect the value to be written to the specified address */
1772                                 offset += 4;
1773
1774                                 /* Read the value to be written to the specified register address */
1775                                 dissect_register(addr, subtree, tvb, offset, 4);
1776                         }
1777                         else
1778                         {
1779                                 guint32 extended_bootstrap_address_offset = 0;
1780                                 if (is_extended_bootstrap_address(gvcp_info, addr, &extended_bootstrap_address_offset))
1781                                 {
1782                                         /* Read the WRITEREG_CMD requested register address */
1783                                         item = proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_writeregcmd_extended_bootstrap_register, tvb, offset, 4, ENC_BIG_ENDIAN);
1784                                         subtree = proto_item_add_subtree(item, ett_gvcp_payload_cmd_subtree);
1785
1786                                         /* Skip 32bit to dissect the value to be written to the specified address */
1787                                         offset += 4;
1788
1789                                         /* Read the value to be written to the specified register address */
1790                                         dissect_extended_bootstrap_register(addr - extended_bootstrap_address_offset, subtree, tvb, offset, 4);
1791                                 }
1792                                 else
1793                                 {
1794                                         proto_tree* temp_tree = NULL;
1795
1796                                         item = proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_custom_register_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
1797
1798                                         offset += 4;
1799                                         temp_tree = proto_item_add_subtree(item, ett_gvcp_payload_cmd_subtree);
1800                                         proto_tree_add_item(temp_tree, hf_gvcp_custom_register_value, tvb, offset, 4, ENC_BIG_ENDIAN);
1801                                 }
1802                         }
1803                         offset += 4;
1804                 }
1805         }
1806 }
1807
1808
1809 /*
1810 \brief DISSECT: Read memory command
1811 */
1812
1813 static void dissect_readmem_cmd(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo, gint startoffset, gvcp_conv_info_t *gvcp_info)
1814 {
1815         guint32 addr = 0;
1816         guint16 count = 0;
1817         gint offset = startoffset;
1818
1819         addr = tvb_get_ntohl(tvb, offset);
1820         count = tvb_get_ntohs(tvb, offset + 6);    /* Number of bytes to read from memory */
1821
1822         col_append_fstr(pinfo->cinfo, COL_INFO, " (0x%08X (%d) bytes)", addr, count);
1823
1824         if (gvcp_telegram_tree != NULL)
1825         {
1826                 proto_item *item = NULL;
1827
1828                 if (try_val_to_str(addr, bootstrapregisternames) != NULL)
1829                 {
1830                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_readmemcmd_bootstrap_register, tvb, offset, 4, ENC_BIG_ENDIAN);
1831                 }
1832                 else
1833                 {
1834                         guint32 extended_bootstrap_address_offset = 0;
1835                         if (is_extended_bootstrap_address(gvcp_info, addr, &extended_bootstrap_address_offset))
1836                         {
1837                                 dissect_extended_bootstrap_register(addr - extended_bootstrap_address_offset, gvcp_telegram_tree, tvb, offset, 4);
1838                         }
1839                         else
1840                         {
1841                                 item = proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_custom_memory_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
1842                                 proto_item_append_text(item, " [Unknown Register]");
1843                         }
1844                 }
1845                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_readmemcmd_count, tvb, (offset + 6), 2, ENC_BIG_ENDIAN);
1846         }
1847 }
1848
1849
1850 /*
1851 \brief DISSECT: Write memory command
1852 */
1853
1854 static void dissect_writemem_cmd(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo, gint startoffset, gint length, gvcp_conv_info_t *gvcp_info, gvcp_transaction_t* gvcp_trans)
1855 {
1856         const gchar* address_string = NULL;
1857         gboolean is_custom_register = FALSE;
1858         guint32 addr = 0;
1859
1860         addr = tvb_get_ntohl(tvb, startoffset);
1861         address_string = get_register_name_from_address(addr, gvcp_info, &is_custom_register);
1862
1863         /* fill in Info column in Wireshark GUI */
1864         col_append_fstr(pinfo->cinfo, COL_INFO, "%s: %d bytes", address_string, (length - 4));
1865
1866         if (gvcp_trans && (!pinfo->fd->visited))
1867         {
1868                 gvcp_trans->addr_list = wmem_array_new(wmem_file_scope(), sizeof(guint32));
1869                 wmem_array_append_one(gvcp_trans->addr_list, addr);
1870         }
1871
1872         if (gvcp_telegram_tree != NULL)
1873         {
1874                 guint offset;
1875                 guint byte_count;
1876                 offset = startoffset + 4;
1877                 byte_count = (length - 4);
1878
1879                 if (gvcp_trans && (gvcp_trans->rep_frame))
1880                 {
1881                         proto_item *item = NULL;
1882                         item = proto_tree_add_uint(gvcp_telegram_tree, hf_gvcp_response_in, tvb, 0, 0, gvcp_trans->rep_frame);
1883                         proto_item_set_generated(item);
1884                 }
1885
1886                 if (try_val_to_str(addr, bootstrapregisternames) != NULL)
1887                 {
1888                         dissect_register_data(addr, gvcp_telegram_tree, tvb, offset, byte_count);
1889                 }
1890                 else
1891                 {
1892                         guint32 extended_bootstrap_address_offset = 0;
1893                         if (is_extended_bootstrap_address(gvcp_info, addr, &extended_bootstrap_address_offset))
1894                         {
1895                                 dissect_extended_bootstrap_register(addr - extended_bootstrap_address_offset, gvcp_telegram_tree, tvb, offset, byte_count);
1896                         }
1897                         else
1898                         {
1899                                 /* Generic, unknown value */
1900                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_writememcmd_data, tvb, offset, byte_count, ENC_NA);
1901                         }
1902                 }
1903         }
1904 }
1905
1906
1907 /*
1908 \brief DISSECT: Event command
1909 */
1910
1911 static void dissect_event_cmd(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo, gint startoffset, gint length, gint extendedblockids)
1912 {
1913         gint32 eventid;
1914         gint offset;
1915         offset = startoffset;
1916
1917         /* Get event ID */
1918         eventid = tvb_get_ntohs(tvb, offset + 2);
1919
1920         /* fill in Info column in Wireshark GUI */
1921         col_append_fstr(pinfo->cinfo, COL_INFO, "[ID: 0x%04X]", eventid);
1922
1923         if (gvcp_telegram_tree != NULL)
1924         {
1925                 gint i;
1926                 gint event_count = 0;
1927
1928                 /* Compute event count based on data length */
1929                 if (extendedblockids == 0)
1930                 {
1931                         /* No enhanced block id */
1932                         event_count = length / 16;
1933                 }
1934                 else
1935                 {
1936                         /* Enhanced block id adds */
1937                         event_count = length / 24;
1938                 }
1939
1940                 if (event_count > 1)
1941                 {
1942                         gvcp_telegram_tree = proto_tree_add_subtree(gvcp_telegram_tree, tvb, offset, length,
1943                                                                                                 ett_gvcp_payload_cmd, NULL, "EVENT_CMD Event List");
1944                 }
1945
1946
1947                 for (i = 0; i < event_count; i++)
1948                 {
1949                         offset += 2;
1950
1951                         /* Get event ID */
1952                         eventid = tvb_get_ntohs(tvb, offset);
1953
1954                         /* Use range to determine type of event */
1955                         if ((eventid >= 0x0000) && (eventid <= 0x8000))
1956                         {
1957                                 /* Standard ID */
1958                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1959                         }
1960                         else if ((eventid >= 0x8001) && (eventid <= 0x8FFF))
1961                         {
1962                                 /* Error */
1963                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_error_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1964                         }
1965                         else if ((eventid >= 0x9000) && (eventid <= 0xFFFF))
1966                         {
1967                                 /* Device specific */
1968                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_device_specific_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1969                         }
1970                         offset += 2;
1971
1972                         /* Stream channel (possibly) associated with event */
1973                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_stream_channel_index, tvb, offset, 2, ENC_BIG_ENDIAN);
1974                         offset += 2;
1975
1976                         if (extendedblockids == 0)
1977                         {
1978                                 /* Block id (16 bit) associated with event */
1979                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_block_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1980                                 offset += 2;
1981                         }
1982                         else
1983                         {
1984                                 offset += 2;
1985                                 /* Block id (64 bit) only if reported by gvcp flag */
1986                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_block_id_64bit_v2_0, tvb, offset, 8, ENC_BIG_ENDIAN);
1987                                 offset += 8;
1988                         }
1989
1990                         /* Timestamp (64 bit) associated with event */
1991                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_timestamp, tvb, offset, 8, ENC_BIG_ENDIAN);
1992                         offset += 8;
1993                 }
1994         }
1995 }
1996
1997
1998 /*
1999 \brief DISSECT: Event data command
2000 */
2001
2002 static void dissect_eventdata_cmd(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo, gint startoffset, gint extendedblockids)
2003 {
2004         gint32 eventid;
2005         gint offset;
2006         gint data_length = 0;
2007         offset = startoffset;
2008
2009         while (tvb_captured_length_remaining(tvb, offset) > 12) /* At least enough bytes for and GEV 1.2 EVENTDATA_CMD with one byte of payload? */
2010         {
2011                 /* Get event ID */
2012                 eventid = tvb_get_ntohs(tvb, offset + 2);
2013
2014                 /* fill in Info column in Wireshark GUI */
2015                 col_append_fstr(pinfo->cinfo, COL_INFO, "[ID: 0x%04X]", eventid);
2016
2017                 if (gvcp_telegram_tree != NULL)
2018                 {
2019                         /* If extended ID, then we have event_size here (2.1) */
2020                         if (extendedblockids)
2021                         {
2022                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_extid_length, tvb, offset, 2, ENC_BIG_ENDIAN);
2023                                 data_length = tvb_get_ntohs(tvb, offset); // We get the data length here
2024                         }
2025
2026                         /* skip reserved field */
2027                         offset += 2;
2028
2029                         /* Use range to determine type of event */
2030                         if ((eventid >= 0x0000) && (eventid <= 0x8000))
2031                         {
2032                                 /* Standard ID */
2033                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2034                         }
2035                         else if ((eventid >= 0x8001) && (eventid <= 0x8FFF))
2036                         {
2037                                 /* Error */
2038                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_error_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2039                         }
2040                         else if ((eventid >= 0x9000) && (eventid <= 0xFFFF))
2041                         {
2042                                 /* Device specific */
2043                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_device_specific_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2044                         }
2045                         offset += 2;
2046
2047                         /* Stream channel (possibly) associated with event */
2048                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_stream_channel_index, tvb, offset, 2, ENC_BIG_ENDIAN);
2049                         offset += 2;
2050
2051                         if (extendedblockids == 0)
2052                         {
2053                                 /* Block id (16 bit) associated with event */
2054                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_block_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2055                                 offset += 2;
2056                         }
2057                         else
2058                         {
2059                                 offset += 2;
2060                                 /* Block id (64 bit) only if reported by gvcp flag */
2061                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_block_id_64bit_v2_0, tvb, offset, 8, ENC_BIG_ENDIAN);
2062                                 offset += 8;
2063                         }
2064
2065                         /* Timestamp (64 bit) associated with event */
2066                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_timestamp, tvb, offset, 8, ENC_BIG_ENDIAN);
2067                         offset += 8;
2068
2069                         if (extendedblockids)
2070                         {
2071                                 if (data_length > 24)
2072                                 {
2073                                         /* Data */
2074                                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_data, tvb, offset, data_length - 24, ENC_NA);
2075                                         offset += data_length - 24;
2076                                 }
2077                         }
2078                         else
2079                         {
2080                                 /* Data */
2081                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_data, tvb, offset, -1, ENC_NA);
2082                                 return;
2083                         }
2084                 }
2085         }
2086 }
2087
2088
2089 /*
2090 \brief DISSECT: Action command
2091 */
2092
2093 static void dissect_action_cmd(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint startoffset, gint scheduledactioncommand)
2094 {
2095         if (gvcp_telegram_tree != NULL)
2096         {
2097                 gint offset;
2098                 offset = startoffset;
2099
2100                 /* Device key */
2101                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_actioncmd_device_key, tvb, offset, 4, ENC_BIG_ENDIAN);
2102
2103                 /* Group key */
2104                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_actioncmd_group_key, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
2105
2106                 /* Group mask */
2107                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_actioncmd_group_mask, tvb, offset + 8, 4, ENC_BIG_ENDIAN);
2108
2109                 if (scheduledactioncommand != 0)
2110                 {
2111                         /* 64 bits timestamp (optional) if gvcp header flag is set */
2112                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_actioncmd_time_v2_0, tvb, offset + 12, 8, ENC_BIG_ENDIAN);
2113                 }
2114         }
2115 }
2116
2117
2118 /*
2119 \brief DISSECT: Discovery acknowledge
2120 */
2121
2122 static void dissect_discovery_ack(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo, gint startoffset, gint length)
2123 {
2124         proto_item *item = NULL;
2125         gint offset;
2126         const guint8* string_manufacturer_name = NULL;
2127         const guint8* string_serial_number = NULL;
2128         gint string_length = 0;
2129         proto_tree *tree = NULL;
2130
2131         offset = startoffset;
2132         string_manufacturer_name = tvb_get_const_stringz(tvb, 80, &string_length);
2133         string_serial_number = tvb_get_const_stringz(tvb, 224, &string_length);
2134
2135         col_append_fstr(pinfo->cinfo, COL_INFO, "(%s, %s)",string_manufacturer_name, string_serial_number);
2136
2137         if (gvcp_telegram_tree != NULL)
2138         {
2139                 gvcp_telegram_tree = proto_tree_add_subtree(gvcp_telegram_tree, tvb, offset, length,
2140                                                                                 ett_gvcp_payload_cmd, NULL, "DISCOVERY_ACK Payload");
2141
2142                 /* Version */
2143                 item = proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_spec_version, tvb, offset, 4, ENC_BIG_ENDIAN);
2144                 tree = proto_item_add_subtree(item, ett_gvcp_bootstrap_fields);
2145                 dissect_register(GVCP_VERSION, tree, tvb, offset, 4 );
2146
2147                 /* Device mode */
2148                 item = proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_devicemodediscovery, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
2149                 tree = proto_item_add_subtree(item, ett_gvcp_bootstrap_fields);
2150                 dissect_register(GVCP_DEVICE_MODE, tree, tvb, offset + 4, 4 );
2151
2152                 /* MAC address */
2153                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_device_mac_address, tvb, offset + 10, 6, ENC_NA);
2154
2155                 /* Supported IP configuration */
2156                 item = proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_supportedipconfig, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
2157                 tree = proto_item_add_subtree(item, ett_gvcp_bootstrap_fields);
2158                 dissect_register(GVCP_SUPPORTED_IP_CONFIGURATION_0, tree, tvb, offset + 16, 4);
2159
2160                 /* Current IP configuration */
2161                 item = proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_currentipconfig, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
2162                 tree = proto_item_add_subtree(item, ett_gvcp_bootstrap_fields);
2163                 dissect_register(GVCP_CURIPCFG_0, tree, tvb, offset + 20, 4);
2164
2165                 /* Current IP address */
2166                 dissect_register(GVCP_CURRENT_IP_ADDRESS_0, gvcp_telegram_tree, tvb, offset + 36, 4);
2167
2168                 /* Current subnet mask */
2169                 dissect_register(GVCP_CURRENT_SUBNET_MASK_0, gvcp_telegram_tree, tvb, offset + 52, 4);
2170
2171                 /* Current default gateway */
2172                 dissect_register(GVCP_CURRENT_DEFAULT_GATEWAY_0, gvcp_telegram_tree, tvb, offset + 68, 4);
2173
2174                 /* Manufacturer name */
2175                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_manufacturer_name, tvb, offset + 72, -1, ENC_ASCII|ENC_NA);
2176
2177                 /* Model name */
2178                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_model_name, tvb, offset + 104, -1, ENC_ASCII|ENC_NA);
2179
2180                 /* Device version */
2181                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_device_version, tvb, offset + 136, -1, ENC_ASCII|ENC_NA);
2182
2183                 /* Manufacturer specific information */
2184                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_manufacturer_specific_info, tvb, offset + 168, -1, ENC_ASCII|ENC_NA);
2185
2186                 /* Serial number */
2187                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_serial_number, tvb, offset + 216, -1, ENC_ASCII|ENC_NA);
2188
2189                 /* User defined name */
2190                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_user_defined_name, tvb, offset + 232, -1, ENC_ASCII|ENC_NA);
2191         }
2192 }
2193
2194 /*
2195 \brief DISSECT: Read register acknowledge
2196 */
2197
2198 static void dissect_readreg_ack(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo, gint startoffset, gint length, gvcp_conv_info_t *gvcp_info, gvcp_transaction_t *gvcp_trans)
2199 {
2200         guint i;
2201         gboolean is_custom_register = FALSE;
2202         const gchar* address_string = NULL;
2203         guint num_registers;
2204         gint offset;
2205         gboolean valid_trans = FALSE;
2206         guint addr_list_size = 0;
2207
2208         offset = startoffset;
2209         num_registers = length / 4;
2210
2211         if (gvcp_trans && gvcp_trans->addr_list)
2212         {
2213                 valid_trans = TRUE;
2214                 addr_list_size = wmem_array_get_count(gvcp_trans->addr_list);
2215         }
2216
2217         if (num_registers > 1)
2218         {
2219                 col_append_fstr(pinfo->cinfo, COL_INFO, "[Multiple ReadReg Ack]");
2220         }
2221         else
2222         {
2223                 if (valid_trans)
2224                 {
2225                         if (addr_list_size > 0)
2226                         {
2227                                 address_string = get_register_name_from_address(*((guint32*)wmem_array_index(gvcp_trans->addr_list, 0)), gvcp_info, &is_custom_register);
2228                         }
2229
2230                         if (num_registers)
2231                         {
2232                                 col_append_fstr(pinfo->cinfo, COL_INFO, "%s Value=0x%08X", address_string, tvb_get_ntohl(tvb, offset));
2233                         }
2234                         else
2235                         {
2236                                 col_append_str(pinfo->cinfo, COL_INFO, address_string);
2237                         }
2238                 }
2239         }
2240
2241         if (gvcp_telegram_tree != NULL)
2242         {
2243                 /* Subtree initialization for Payload Data: READREG_ACK */
2244                 if (num_registers > 1)
2245                 {
2246                         gvcp_telegram_tree = proto_tree_add_subtree(gvcp_telegram_tree, tvb, offset, length,
2247                                                                                                 ett_gvcp_payload_ack, NULL, "Register Value List");
2248                 }
2249
2250                 for (i = 0; i < num_registers; i++)
2251                 {
2252                         guint32 curr_register = 0;
2253
2254                         if (valid_trans && i < addr_list_size)
2255                         {
2256                                 gint stream_channel_count = 0;
2257                                 curr_register = *((guint32*)wmem_array_index(gvcp_trans->addr_list, i));
2258                                 address_string = get_register_name_from_address(curr_register, gvcp_info, &is_custom_register);
2259                                 for (; stream_channel_count < GVCP_MAX_STREAM_CHANNEL_COUNT; stream_channel_count++)
2260                                 {
2261                                         if (curr_register == (guint32)GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS(stream_channel_count))
2262                                         {
2263                                                 gvcp_info->extended_bootstrap_address[stream_channel_count] = tvb_get_ntohl(tvb, offset);
2264                                                 break;
2265                                         }
2266                                 }
2267
2268                                 if (!is_custom_register) /* bootstrap register */
2269                                 {
2270                                         guint32 extended_bootstrap_address_offset = 0;
2271                                         if (is_extended_bootstrap_address(gvcp_info, curr_register, &extended_bootstrap_address_offset))
2272                                         {
2273                                                 proto_tree_add_uint_format_value(gvcp_telegram_tree, hf_gvcp_readregcmd_extended_bootstrap_register, tvb, offset, 4, curr_register, "%s (0x%08X)", address_string, curr_register);
2274                                                 dissect_extended_bootstrap_register(curr_register - extended_bootstrap_address_offset, gvcp_telegram_tree, tvb, offset, length);
2275                                         }
2276                                         else
2277                                         {
2278                                                 proto_tree_add_uint(gvcp_telegram_tree, hf_gvcp_readregcmd_bootstrap_register, tvb, 0, 4, curr_register);
2279                                                 dissect_register(curr_register, gvcp_telegram_tree, tvb, offset, length);
2280                                         }
2281                                 }
2282                                 else
2283                                 {
2284                                         proto_tree_add_uint_format_value(gvcp_telegram_tree, hf_gvcp_custom_read_register_addr, tvb, offset, 4, curr_register, "%s (0x%08X)", address_string, curr_register);
2285                                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_custom_read_register_value, tvb, offset, 4, ENC_BIG_ENDIAN);
2286                                 }
2287                         }
2288                         else
2289                         {
2290                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_custom_register_value, tvb, offset, 4, ENC_BIG_ENDIAN);
2291                         }
2292
2293                         offset += 4;
2294                 }
2295         }
2296 }
2297
2298
2299 /*
2300 \brief DISSECT: Write register acknowledge
2301 */
2302
2303 static void dissect_writereg_ack(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo, gint startoffset, gvcp_transaction_t* gvcp_trans)
2304 {
2305         proto_item *item = NULL;
2306         guint16 ack_index = 0;
2307
2308         if (gvcp_telegram_tree != NULL)
2309         {
2310                 item = proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_writeregcmd_data_index, tvb, (startoffset + 2), 2, ENC_BIG_ENDIAN);
2311         }
2312
2313         ack_index = tvb_get_ntohs(tvb, 10);
2314
2315         if (gvcp_trans)
2316         {
2317                 gint num_registers = 0;
2318
2319                 num_registers = gvcp_trans->addr_count;
2320                 if (num_registers > 1)
2321                 {
2322                         col_append_fstr(pinfo->cinfo, COL_INFO, "[Multiple WriteReg Ack] (%d/%d) %s ", ack_index, num_registers, (ack_index == num_registers ? "(Success)" : "(Failed)"));
2323                 }
2324                 else
2325                 {
2326                         col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", (ack_index == num_registers ? "(Success)" : "(Failed)"));
2327                 }
2328
2329                 if (gvcp_telegram_tree != NULL)
2330                 {
2331                         proto_item_append_text(item, " %s", (ack_index == num_registers ? "(Success)" : "(Failed)"));
2332                 }
2333         }
2334         else
2335         {
2336                 col_append_str(pinfo->cinfo, COL_INFO, "[Cannot find requesting packet]");
2337         }
2338 }
2339
2340
2341 /*
2342 \brief DISSECT: Read memory acknowledge
2343 */
2344
2345 static void dissect_readmem_ack(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo, gint startoffset, gint length, gvcp_conv_info_t *gvcp_info)
2346 {
2347         guint32 addr = 0;
2348         const gchar *address_string = NULL;
2349         gboolean is_custom_register = FALSE;
2350
2351         addr = tvb_get_ntohl(tvb, startoffset);
2352         address_string = get_register_name_from_address(addr, gvcp_info, &is_custom_register);
2353
2354         /* Fill in Wireshark GUI Info column */
2355         col_append_str(pinfo->cinfo, COL_INFO, address_string);
2356
2357         if (gvcp_telegram_tree != NULL)
2358         {
2359                 gint stream_channel_count = 0;
2360                 guint offset;
2361                 guint byte_count;
2362                 offset = startoffset + 4;
2363                 byte_count = (length - 4);
2364
2365                 for (stream_channel_count = 0; stream_channel_count < GVCP_MAX_STREAM_CHANNEL_COUNT; stream_channel_count++)
2366                 {
2367                         if (startoffset == GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS(stream_channel_count))
2368                         {
2369                                 gvcp_info->extended_bootstrap_address[stream_channel_count] = tvb_get_ntohl(tvb, offset);
2370                                 break;
2371                         }
2372                 }
2373
2374                 /* Bootstrap register known address */
2375                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_readmemcmd_address, tvb, startoffset, 4, ENC_BIG_ENDIAN);
2376
2377                 if (try_val_to_str(addr, bootstrapregisternames) != NULL)
2378                 {
2379                         dissect_register_data(addr, gvcp_telegram_tree, tvb, offset, byte_count);
2380                 }
2381                 else
2382                 {
2383                         guint32 extended_bootstrap_address_offset = 0;
2384                         if (is_extended_bootstrap_address(gvcp_info, addr, &extended_bootstrap_address_offset))
2385                         {
2386                                 dissect_extended_bootstrap_register(addr - extended_bootstrap_address_offset, gvcp_telegram_tree, tvb, offset, byte_count);
2387                         }
2388                         else
2389                         {
2390                                 /* Generic, unknown value */
2391                                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_readmemcmd_data_read, tvb, offset, byte_count, ENC_NA);
2392                         }
2393                 }
2394         }
2395 }
2396
2397
2398 /*
2399 \brief DISSECT: Write memory acknowledge
2400 */
2401
2402 static void dissect_writemem_ack(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo, gint startoffset, gint length, gvcp_conv_info_t *gvcp_info, gvcp_transaction_t* gvcp_trans)
2403 {
2404         if (gvcp_trans && gvcp_trans->addr_list)
2405         {
2406                 if (wmem_array_get_count(gvcp_trans->addr_list) > 0)
2407                 {
2408                         const gchar *address_string = NULL;
2409                         address_string = get_register_name_from_address((*((guint32*)wmem_array_index(gvcp_trans->addr_list, 0))), gvcp_info, NULL);
2410                         col_append_str(pinfo->cinfo, COL_INFO, address_string);
2411                 }
2412         }
2413
2414         if (gvcp_telegram_tree != NULL)
2415         {
2416                 proto_item *item;
2417
2418                 if (gvcp_trans && gvcp_trans->req_frame)
2419                 {
2420                         item = proto_tree_add_uint(gvcp_telegram_tree, hf_gvcp_response_to, tvb, 0, 0, gvcp_trans->req_frame);
2421                         proto_item_set_generated(item);
2422                 }
2423
2424                 gvcp_telegram_tree = proto_tree_add_subtree(gvcp_telegram_tree, tvb, startoffset, length,
2425                                                                                                 ett_gvcp_payload_cmd, NULL, "Payload Data: WRITEMEM_ACK");
2426                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_writememcmd_data_index, tvb, (startoffset +2), 2, ENC_BIG_ENDIAN);
2427         }
2428 }
2429
2430
2431 /*
2432 \brief DISSECT: Pending acknowledge
2433 */
2434
2435 static void dissect_pending_ack(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint startoffset, gint length)
2436 {
2437         if (gvcp_telegram_tree != NULL)
2438         {
2439                 gvcp_telegram_tree = proto_tree_add_subtree(gvcp_telegram_tree, tvb, startoffset, length,
2440                                                                                 ett_gvcp_payload_cmd, NULL, "Payload Data: PENDING_ACK");
2441                 proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_time_to_completion, tvb, (startoffset + 2), 2, ENC_BIG_ENDIAN);
2442         }
2443 }
2444
2445
2446 /*
2447 \brief Point of entry of all GVCP packet dissection
2448 */
2449
2450 static int dissect_gvcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
2451 {
2452         gint offset = 0;
2453         proto_tree *gvcp_tree = NULL;
2454         proto_tree *gvcp_tree_flag = NULL;
2455         proto_tree *gvcp_telegram_tree = NULL;
2456         gint data_length = 0;
2457         gint command = -1;
2458         const gchar* command_string = NULL;
2459         gint status = 0;
2460         gint flags = -1;
2461         gint extendedblockids = -1;
2462         gint scheduledactioncommand = -1;
2463         gint ack_code = -1;
2464         const gchar* ack_string = NULL;
2465         gint request_id = 0;
2466         gchar key_code = 0;
2467         proto_item *ti = NULL;
2468         proto_item *item = NULL;
2469         conversation_t *conversation = 0;
2470         gvcp_conv_info_t *gvcp_info = 0;
2471         gvcp_transaction_t *gvcp_trans = 0;
2472
2473         if (tvb_captured_length(tvb) <  GVCP_MIN_PACKET_SIZE)
2474         {
2475                 return 0;
2476         }
2477
2478         /* check for valid key/ack code */
2479         key_code = (gchar) tvb_get_guint8(tvb, offset);
2480         ack_code = tvb_get_ntohs(tvb, offset+2);
2481         ack_string = try_val_to_str(ack_code, acknowledgenames);
2482
2483         if ((key_code != 0x42) && !ack_string)
2484         {
2485                 return 0;
2486         }
2487
2488         /* Set the protocol column */
2489         col_set_str(pinfo->cinfo, COL_PROTOCOL, "GVCP");
2490
2491         /* Clear out stuff in the info column */
2492         col_clear(pinfo->cinfo, COL_INFO);
2493
2494         /* Adds "Gigabit-Ethernet Control Protocol" heading to protocol tree */
2495         /* We will add fields to this using the gvcp_tree pointer */
2496         ti = proto_tree_add_item(tree, proto_gvcp, tvb, offset, -1, ENC_NA);
2497         gvcp_tree = proto_item_add_subtree(ti, ett_gvcp);
2498
2499         /* Is this a command message? */
2500         if (key_code == 0x42)
2501         {
2502                 command = tvb_get_ntohs(tvb, offset+2);
2503                 command_string = val_to_str(command, commandnames,"Unknown Command (0x%x)");
2504
2505                 /* Add the Command name string to the Info column */
2506                 col_append_fstr(pinfo->cinfo, COL_INFO, "> %s ", command_string);
2507
2508                 gvcp_tree = proto_tree_add_subtree_format(gvcp_tree, tvb, offset, 8,
2509                                                                 ett_gvcp_cmd, NULL, "Command Header: %s", command_string);
2510
2511                 /* Add the message key code: */
2512                 proto_tree_add_item(gvcp_tree, hf_gvcp_message_key_code, tvb, offset, 1, ENC_BIG_ENDIAN);
2513                 offset++;
2514
2515                 /* Add the flags */
2516                 flags = (gchar) tvb_get_guint8(tvb, offset);
2517                 item = proto_tree_add_item(gvcp_tree, hf_gvcp_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
2518                 gvcp_tree_flag  = proto_item_add_subtree(item, ett_gvcp_flags);
2519                 if (command == GVCP_ACTION_CMD)
2520                 {
2521                         proto_tree_add_item(gvcp_tree_flag, hf_gvcp_scheduledactioncommand_flag_v2_0, tvb, offset, 1, ENC_BIG_ENDIAN);
2522                         scheduledactioncommand = (flags & 0x80);
2523                 }
2524                 if ((command == GVCP_EVENTDATA_CMD) ||
2525                         (command == GVCP_EVENT_CMD) ||
2526                         (command == GVCP_PACKETRESEND_CMD))
2527                 {
2528                         proto_tree_add_item(gvcp_tree_flag, hf_gvcp_64bitid_flag_v2_0, tvb, offset, 1, ENC_BIG_ENDIAN);
2529                         flags = (gchar) tvb_get_guint8(tvb, offset );
2530                         extendedblockids = (flags & 0x10);
2531                 }
2532                 if ((command == GVCP_DISCOVERY_CMD) ||
2533                         (command == GVCP_FORCEIP_CMD))
2534                 {
2535                         proto_tree_add_item(gvcp_tree_flag, hf_gvcp_allow_broadcast_acknowledge_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
2536                 }
2537                 proto_tree_add_item(gvcp_tree_flag, hf_gvcp_acknowledge_required_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
2538
2539                 offset++;
2540
2541                 /* Add the command */
2542                 proto_tree_add_item(gvcp_tree, hf_gvcp_command, tvb, offset, 2, ENC_BIG_ENDIAN);
2543                 offset += 2;
2544         }
2545         else /* ... or else it is an acknowledge */
2546         {
2547                 status = tvb_get_ntohs(tvb, offset);
2548                 col_append_fstr(pinfo->cinfo, COL_INFO, "< %s %s",
2549                         ack_string, val_to_str(status, statusnames_short, "Unknown status (0x%04X)"));
2550
2551                 gvcp_tree = proto_tree_add_subtree_format(gvcp_tree, tvb, offset+2, tvb_captured_length(tvb)-2,
2552                                                                                                 ett_gvcp_ack, NULL, "Acknowledge Header: %s", ack_string);
2553
2554                 /* Add the status: */
2555                 proto_tree_add_item(gvcp_tree, hf_gvcp_status, tvb, offset, 2, ENC_BIG_ENDIAN);
2556                 offset += 2;
2557
2558                 /* Add the acknowledge */
2559                 proto_tree_add_item(gvcp_tree, hf_gvcp_acknowledge, tvb, offset, 2, ENC_BIG_ENDIAN);
2560
2561                 offset += 2;
2562         }
2563
2564         /* Parse the second part of both the command and the acknowledge header:
2565         0               15 16            31
2566         -------- -------- -------- --------
2567         |     status      |   acknowledge |
2568         -------- -------- -------- --------
2569         |     length      |      req_id   |
2570         -------- -------- -------- --------
2571
2572         Add the data length
2573         Number of valid data bytes in this message, not including this header. This
2574         represents the number of bytes of payload appended after this header */
2575         proto_tree_add_item(gvcp_tree, hf_gvcp_length, tvb, offset, 2, ENC_BIG_ENDIAN);
2576         data_length = tvb_get_ntohs(tvb, offset);
2577         offset += 2;
2578
2579         /* Add the request ID */
2580         proto_tree_add_item(gvcp_tree, hf_gvcp_request_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2581         request_id = tvb_get_ntohs(tvb, offset);
2582         offset += 2;
2583
2584         conversation = find_or_create_conversation(pinfo);
2585
2586         gvcp_info = (gvcp_conv_info_t*)conversation_get_proto_data(conversation, proto_gvcp);
2587         if (!gvcp_info)
2588         {
2589                 gint stream_channel_count = 0;
2590                 gvcp_info = (gvcp_conv_info_t*)wmem_alloc(wmem_file_scope(), sizeof(gvcp_conv_info_t));
2591                 gvcp_info->pdus = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
2592                 for (; stream_channel_count < GVCP_MAX_STREAM_CHANNEL_COUNT; stream_channel_count++)
2593                 {
2594                         gvcp_info->extended_bootstrap_address[stream_channel_count] = 0;
2595                 }
2596                 conversation_add_proto_data(conversation, proto_gvcp, gvcp_info);
2597         }
2598
2599         if (!pinfo->fd->visited)
2600         {
2601                 if (key_code == 0x42)
2602                 {
2603                         /* This is a request */
2604                         gvcp_trans = (gvcp_transaction_t*)wmem_alloc(wmem_packet_scope(), sizeof(gvcp_transaction_t));
2605                         gvcp_trans->req_frame = pinfo->num;
2606                         gvcp_trans->rep_frame = 0;
2607                         gvcp_trans->addr_list = 0;
2608                         gvcp_trans->addr_count = 0;
2609                 }
2610                 else
2611                 {
2612                         if (ack_string && ( ack_code != GVCP_PENDING_ACK ) )
2613                         {
2614                                 /* this is a response, so update trans info with ack's frame number */
2615                                 /* get list of transactions for given request id */
2616                                 gvcp_trans_array = (wmem_array_t*)wmem_map_lookup(gvcp_info->pdus, GUINT_TO_POINTER(request_id));
2617                                 if (gvcp_trans_array)
2618                                 {
2619                                         gint i;
2620                                         guint array_size = wmem_array_get_count(gvcp_trans_array);
2621                                         for (i = array_size-1; i >= 0; i--)
2622                                         {
2623                                                 gvcp_trans = (gvcp_transaction_t*)wmem_array_index(gvcp_trans_array, i);
2624
2625                                                 if (gvcp_trans && (gvcp_trans->req_frame < pinfo->num))
2626                                                 {
2627                                                         if (gvcp_trans->rep_frame != 0)
2628                                                         {
2629                                                                 gvcp_trans = 0;
2630                                                         }
2631                                                         else
2632                                                         {
2633                                                                 gvcp_trans->rep_frame = pinfo->num;
2634                                                         }
2635
2636                                                         break;
2637                                                 }
2638                                                 gvcp_trans = 0;
2639                                         }
2640                                 }
2641                         }
2642                 }
2643         }
2644         else
2645         {
2646                 gvcp_trans = 0;
2647                 gvcp_trans_array = (wmem_array_t*)wmem_map_lookup(gvcp_info->pdus, GUINT_TO_POINTER(request_id));
2648
2649                 if (gvcp_trans_array)
2650                 {
2651                         guint i;
2652                         guint array_size = wmem_array_get_count(gvcp_trans_array);
2653
2654                         for (i = 0; i < array_size; ++i)
2655                         {
2656                                 gvcp_trans = (gvcp_transaction_t*)wmem_array_index(gvcp_trans_array, i);
2657                                 if (gvcp_trans && (pinfo->num == gvcp_trans->req_frame || pinfo->num == gvcp_trans->rep_frame))
2658                                 {
2659                                         break;
2660                                 }
2661
2662                                 gvcp_trans = 0;
2663                         }
2664                 }
2665         }
2666
2667         if (!gvcp_trans)
2668         {
2669                 gvcp_trans = wmem_new0(wmem_packet_scope(), gvcp_transaction_t);
2670         }
2671
2672         /* Add telegram subtree */
2673         gvcp_telegram_tree = proto_item_add_subtree(gvcp_tree, ett_gvcp);
2674
2675         /* Is this a command? */
2676         if (key_code == 0x42)
2677         {
2678                 if (gvcp_telegram_tree != NULL)
2679                 {
2680                         if (gvcp_trans->rep_frame)
2681                         {
2682                                 item = proto_tree_add_uint(gvcp_telegram_tree, hf_gvcp_response_in, tvb, 0, 0, gvcp_trans->rep_frame);
2683                                 proto_item_set_generated(item);
2684                         }
2685                 }
2686
2687                 switch (command)
2688                 {
2689                 case GVCP_FORCEIP_CMD:
2690                         dissect_forceip_cmd(gvcp_telegram_tree, tvb, pinfo, offset, data_length);
2691                         break;
2692
2693                 case GVCP_PACKETRESEND_CMD:
2694                         dissect_packetresend_cmd(gvcp_telegram_tree, tvb, pinfo, offset, data_length, extendedblockids);
2695                         break;
2696
2697                 case GVCP_READREG_CMD:
2698                         dissect_readreg_cmd(gvcp_telegram_tree, tvb, pinfo, offset, data_length, gvcp_info, gvcp_trans);
2699                         break;
2700
2701                 case GVCP_WRITEREG_CMD:
2702                         dissect_writereg_cmd(gvcp_telegram_tree, tvb, pinfo, offset, data_length, gvcp_info, gvcp_trans);
2703                         break;
2704
2705                 case GVCP_READMEM_CMD:
2706                         dissect_readmem_cmd(gvcp_telegram_tree, tvb, pinfo, offset, gvcp_info);
2707                         break;
2708
2709                 case GVCP_WRITEMEM_CMD:
2710                         dissect_writemem_cmd(gvcp_telegram_tree, tvb, pinfo, offset, data_length, gvcp_info, gvcp_trans);
2711                         break;
2712
2713                 case GVCP_EVENT_CMD:
2714                         dissect_event_cmd(gvcp_telegram_tree, tvb, pinfo, offset, data_length, extendedblockids);
2715                         break;
2716
2717                 case GVCP_EVENTDATA_CMD:
2718                         dissect_eventdata_cmd(gvcp_telegram_tree, tvb, pinfo, offset, extendedblockids);
2719                         break;
2720
2721                 case GVCP_ACTION_CMD:
2722                         dissect_action_cmd(gvcp_telegram_tree, tvb, pinfo, offset, scheduledactioncommand);
2723                         break;
2724
2725                 case GVCP_DISCOVERY_CMD:
2726                 default:
2727                         break;
2728                 }
2729
2730                 if (!pinfo->fd->visited)
2731                 {
2732                         if (key_code == 0x42)
2733                         {
2734                                 gvcp_trans_array = (wmem_array_t*)wmem_map_lookup(gvcp_info->pdus, GUINT_TO_POINTER(request_id));
2735
2736                                 if(gvcp_trans_array)
2737                                 {
2738                                         wmem_array_append(gvcp_trans_array, gvcp_trans, 1);
2739                                 }
2740                                 else
2741                                 {
2742                                         gvcp_trans_array = wmem_array_new(wmem_file_scope(), sizeof(gvcp_transaction_t));
2743                                         wmem_array_append(gvcp_trans_array, gvcp_trans, 1);
2744                                         wmem_map_insert(gvcp_info->pdus, GUINT_TO_POINTER(request_id), (void *)gvcp_trans_array);
2745                                 }
2746                         }
2747                 }
2748         }
2749         else
2750         {
2751                 if (gvcp_telegram_tree != NULL)
2752                 {
2753                         if (gvcp_trans->req_frame)
2754                         {
2755                                 item = proto_tree_add_uint(gvcp_telegram_tree, hf_gvcp_response_to, tvb, 0, 0, gvcp_trans->req_frame);
2756                                 proto_item_set_generated(item);
2757                         }
2758                 }
2759
2760                 switch (ack_code)
2761                 {
2762                 case GVCP_DISCOVERY_ACK:
2763                         dissect_discovery_ack(gvcp_telegram_tree, tvb, pinfo, offset, data_length);
2764                         break;
2765
2766                 case GVCP_READREG_ACK:
2767                         dissect_readreg_ack(gvcp_telegram_tree, tvb, pinfo, offset, data_length, gvcp_info, gvcp_trans);
2768                         break;
2769
2770                 case GVCP_WRITEREG_ACK:
2771                         dissect_writereg_ack(gvcp_telegram_tree, tvb, pinfo, offset, gvcp_trans);
2772                         break;
2773
2774                 case GVCP_READMEM_ACK:
2775                         dissect_readmem_ack(gvcp_telegram_tree, tvb, pinfo, offset, data_length, gvcp_info);
2776                         break;
2777
2778                 case GVCP_WRITEMEM_ACK:
2779                         dissect_writemem_ack(gvcp_telegram_tree, tvb, pinfo, offset, data_length, gvcp_info, gvcp_trans);
2780                         break;
2781
2782                 case GVCP_PENDING_ACK:
2783                         dissect_pending_ack(gvcp_telegram_tree, tvb, pinfo, offset, data_length);
2784                         break;
2785
2786                 case GVCP_FORCEIP_ACK:
2787                         break;
2788                 case GVCP_PACKETRESEND_ACK:
2789                 case GVCP_EVENT_ACK:
2790                 case GVCP_EVENTDATA_ACK:
2791                 case GVCP_ACTION_ACK:
2792                 default:
2793                         proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_payloaddata, tvb, offset, data_length, ENC_NA);
2794                         break;
2795                 }
2796         }
2797         return tvb_captured_length(tvb);
2798 }
2799
2800 void proto_register_gvcp(void)
2801 {
2802         /*
2803         \brief Structures for register dissection
2804         */
2805
2806         static hf_register_info hf[] =
2807         {
2808                 /* Common GVCP data */
2809
2810                 { &hf_gvcp_message_key_code,
2811                 { "Message Key Code", "gvcp.message_key_code",
2812                 FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
2813                 NULL, HFILL }},
2814
2815                 { &hf_gvcp_flag,
2816                 { "Flags", "gvcp.cmd.flags",
2817                 FT_UINT8, BASE_HEX, NULL, 0x0,
2818                 NULL, HFILL }},
2819
2820                 { &hf_gvcp_acknowledge_required_flag,
2821                 { "Acknowledge Required", "gvcp.cmd.flag.acq_required",
2822                 FT_BOOLEAN, 8, NULL, 0x01,
2823                 NULL, HFILL }},
2824
2825                 { &hf_gvcp_scheduledactioncommand_flag_v2_0,
2826                 { "Scheduled Action Command", "gvcp.cmd.flag.scheduledactioncommand",
2827                 FT_BOOLEAN, 8, NULL, 0x80,
2828                 NULL, HFILL }},
2829
2830                 { &hf_gvcp_64bitid_flag_v2_0,
2831                 { "64 bit ID", "gvcp.cmd.flag.64bitid",
2832                 FT_BOOLEAN, 8, NULL, 0x10,
2833                 NULL, HFILL }},
2834
2835                 { &hf_gvcp_allow_broadcast_acknowledge_flag,
2836                 { "Allow Broadcast Acknowledge", "gvcp.cmd.flag.allowbroadcastacq",
2837                 FT_BOOLEAN, 8, NULL, 0x10,
2838                 NULL, HFILL }},
2839
2840                 { &hf_gvcp_command,
2841                 { "Command", "gvcp.cmd.command",
2842                 FT_UINT16, BASE_HEX, VALS(commandnames), 0x0,
2843                 NULL, HFILL }},
2844
2845                 { &hf_gvcp_length,
2846                 { "Payload Length", "gvcp.cmd.payloadlength",
2847                 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
2848                 NULL, HFILL }},
2849
2850                 { &hf_gvcp_request_id,
2851                 { "Request ID", "gvcp.cmd.req_id",
2852                 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
2853                 NULL, HFILL }},
2854
2855                 { &hf_gvcp_payloaddata,
2856                 { "Payload Data", "gvcp.cmd.payloaddata",
2857                 FT_BYTES, BASE_NONE, NULL, 0x0,
2858                 NULL, HFILL }},
2859
2860                 { &hf_gvcp_status,
2861                 { "Status", "gvcp.cmd.status",
2862                 FT_UINT16, BASE_HEX, VALS(statusnames), 0x0,
2863                 NULL, HFILL }},
2864
2865                 { &hf_gvcp_acknowledge,
2866                 { "Acknowledge", "gvcp.ack",
2867                 FT_UINT16, BASE_HEX, VALS(acknowledgenames), 0x0,
2868                 NULL, HFILL }},
2869
2870                 { &hf_gvcp_devicemodediscovery,
2871                 { "Device Mode", "gvcp.ack.discovery.devicemode",
2872                 FT_UINT32, BASE_HEX, NULL, 0x0,
2873                 NULL, HFILL }},
2874
2875                 /* Force IP */
2876
2877                 { &hf_gvcp_forceip_mac_address,
2878                 { "MAC Address", "gvcp.cmd.forceip.macaddress",
2879                 FT_ETHER, BASE_NONE, NULL, 0x0,
2880                 NULL, HFILL }},
2881
2882                 { &hf_gvcp_forceip_static_IP,
2883                 { "IP address", "gvcp.cmd.forceip.ip",
2884                 FT_IPv4, BASE_NONE, NULL, 0x0,
2885                 NULL, HFILL }},
2886
2887                 { &hf_gvcp_forceip_static_subnet_mask,
2888                 { "Subnet Mask", "gvcp.cmd.forceip.subnetmask",
2889                 FT_IPv4, BASE_NONE, NULL, 0x0,
2890                 NULL, HFILL }},
2891
2892                 { &hf_gvcp_forceip_static_default_gateway,
2893                 { "Default Gateway", "gvcp.cmd.forceip.defaultgateway",
2894                 FT_IPv4, BASE_NONE, NULL, 0x0,
2895                 NULL, HFILL }},
2896
2897                 /* Discovery specific */
2898
2899                 { &hf_gvcp_device_mac_address,
2900                 { "Device MAC Address", "gvcp.cmd.discovery.devicemacaddress",
2901                 FT_ETHER, BASE_NONE, NULL, 0x0,
2902                 NULL, HFILL }},
2903
2904                 /* Read register */
2905                 { &hf_gvcp_readregcmd_bootstrap_register,
2906                 { "Bootstrap Register", "gvcp.cmd.readreg.bootstrapregister",
2907                 FT_UINT32, BASE_HEX_DEC, VALS(bootstrapregisternames), 0x0,
2908                 NULL, HFILL }},
2909
2910                 { &hf_gvcp_readregcmd_extended_bootstrap_register,
2911                 { "Extended Bootstrap Register", "gvcp.cmd.readreg.extendedbootstrapregister",
2912                 FT_UINT32, BASE_HEX_DEC, VALS(extendedbootstrapregisternames), 0x0,
2913                 NULL, HFILL } },
2914
2915                 /* Write register */
2916
2917                 { &hf_gvcp_writeregcmd_data,
2918                 { "DataX", "gvcp.cmd.writereg.data",
2919                 FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
2920                 NULL, HFILL }},
2921
2922                 { &hf_gvcp_writeregcmd_bootstrap_register,
2923                 { "Bootstrap Register", "gvcp.cmd.writereg.bootstrapregister",
2924                 FT_UINT32, BASE_HEX_DEC, VALS(bootstrapregisternames), 0x0,
2925                 NULL, HFILL }},
2926
2927                 { &hf_gvcp_writeregcmd_extended_bootstrap_register,
2928                 { "Extended Bootstrap Register", "gvcp.cmd.writereg.extendedbootstrapregister",
2929                 FT_UINT32, BASE_HEX_DEC, VALS(extendedbootstrapregisternames), 0x0,
2930                 NULL, HFILL } },
2931
2932                 { &hf_gvcp_writeregcmd_data_index,
2933                 { "Data Index", "gvcp.cmd.writereg.dataindex",
2934                 FT_UINT16, BASE_HEX, NULL, 0x0,
2935                 NULL, HFILL }},
2936
2937                 /* Read memory */
2938
2939                 { &hf_gvcp_readmemcmd_address,
2940                 { "Register Address", "gvcp.cmd.readmem.address",
2941                 FT_UINT32, BASE_HEX, NULL, 0x0,
2942                 NULL, HFILL }},
2943
2944                 { &hf_gvcp_readmemcmd_bootstrap_register,
2945                 { "Memory Bootstrap Register", "gvcp.cmd.readmem.bootstrapregister",
2946                 FT_UINT32, BASE_HEX_DEC, VALS(bootstrapregisternames), 0x0,
2947                 NULL, HFILL }},
2948
2949                 { &hf_gvcp_readmemcmd_count,
2950                 { "Count", "gvcp.cmd.readmem.count",
2951                 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
2952                 NULL, HFILL }},
2953
2954                 /* Write memory */
2955
2956                 { &hf_gvcp_writememcmd_data,
2957                 { "DataY", "gvcp.cmd.writemem.data",
2958                 FT_BYTES, BASE_NONE, NULL, 0x0,
2959                 NULL, HFILL }},
2960
2961                 { &hf_gvcp_writememcmd_data_index,
2962                 { "Data Index", "gvcp.cmd.writemem.dataindex",
2963                 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
2964                 NULL, HFILL }},
2965
2966                 /* Resend request */
2967
2968                 { &hf_gvcp_resendcmd_stream_channel_index,
2969                 { "Resend Stream Channel Index", "gvcp.cmd.resend.streamchannelindex",
2970                 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
2971                 NULL, HFILL }},
2972
2973                 { &hf_gvcp_resendcmd_block_id,
2974                 { "Resend Block ID 16 bits", "gvcp.cmd.resend.blockid",
2975                 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
2976                 NULL, HFILL }},
2977
2978                 { &hf_gvcp_resendcmd_first_packet_id,
2979                 { "Resend First Packet ID 24 bits", "gvcp.cmd.resend.firstpacketid",
2980                 FT_UINT24, BASE_HEX_DEC, NULL, 0x0,
2981                 NULL, HFILL }},
2982
2983                 { &hf_gvcp_resendcmd_last_packet_id,
2984                 { "Resend Last Packet ID 24 bits", "gvcp.cmd.resend.lastpacketid",
2985                 FT_UINT24, BASE_HEX_DEC, NULL, 0x0,
2986                 NULL, HFILL }},
2987
2988                 { &hf_gvcp_resendcmd_extended_block_id_v2_0,
2989                 { "Resend Block ID 64 bits", "gvcp.cmd.resend.extendedblockid",
2990                 FT_UINT64, BASE_HEX_DEC, NULL, 0x0,
2991                 NULL, HFILL }},
2992
2993                 { &hf_gvcp_resendcmd_extended_first_packet_id_v2_0,
2994                 { "Resend First Packet ID 32 bits", "gvcp.cmd.resend.firstpacketid",
2995                 FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
2996                 NULL, HFILL }},
2997
2998                 { &hf_gvcp_resendcmd_extended_last_packet_id_v2_0,
2999                 { "Resend Last Packet ID 32 bits", "gvcp.cmd.resend.lastpacketid",
3000                 FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
3001                 NULL, HFILL }},
3002
3003                 /* Event */
3004
3005                 { &hf_gvcp_eventcmd_id,
3006                 { "ID", "gvcp.cmd.event.id",
3007                 FT_UINT16, BASE_HEX_DEC, VALS(eventidnames), 0x0,
3008                 NULL, HFILL }},
3009
3010                 { &hf_gvcp_eventcmd_error_id,
3011                 { "Error ID", "gvcp.cmd.event.errorid",
3012                 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
3013                 NULL, HFILL }},
3014
3015                 { &hf_gvcp_eventcmd_extid_length,
3016                 { "Event Size", "gvcp.cmd.event.eventsize",
3017                 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
3018                 NULL, HFILL }},
3019
3020                 { &hf_gvcp_eventcmd_device_specific_id,
3021                 { "Device Specific ID", "gvcp.cmd.event.devicespecificid",
3022                 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
3023                 NULL, HFILL }},
3024
3025                 { &hf_gvcp_eventcmd_stream_channel_index,
3026                 { "Stream Channel Index", "gvcp.cmd.event.streamchannelindex",
3027                 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
3028                 NULL, HFILL }},
3029
3030                 { &hf_gvcp_eventcmd_block_id,
3031                 { "Block ID (16 bit)", "gvcp.cmd.event.blockid",
3032                 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
3033                 NULL, HFILL }},
3034
3035                 { &hf_gvcp_eventcmd_timestamp,
3036                 { "Timestamp", "gvcp.cmd.event.timestamp",
3037                 FT_UINT64, BASE_HEX_DEC, NULL, 0x0,
3038                 NULL, HFILL }},
3039
3040                 { &hf_gvcp_eventcmd_block_id_64bit_v2_0,
3041                 { "Block ID 64 bit", "gvcp.event_timestamp",
3042                 FT_UINT64, BASE_HEX_DEC, NULL, 0x0,
3043                 NULL, HFILL }},
3044
3045                 /* Event data */
3046
3047                 { &hf_gvcp_eventcmd_data,
3048                 { "Event Data", "gvcp.cmd.eventdata.data",
3049                 FT_BYTES, BASE_NONE, NULL, 0x0,
3050                 NULL, HFILL }},
3051
3052                 /* Action */
3053
3054                 { &hf_gvcp_actioncmd_device_key,
3055                 { "Action Device Key", "gvcp.cmd.action.devicekey",
3056                 FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
3057                 NULL, HFILL }},
3058
3059                 { &hf_gvcp_actioncmd_group_key,
3060                 { "Action Group Key", "gvcp.cmd.action.groupkey",
3061                 FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
3062                 NULL, HFILL }},
3063
3064                 { &hf_gvcp_actioncmd_group_mask,
3065                 { "Action Group Mask", "gvcp.cmd.action.groupmask",
3066                 FT_UINT32, BASE_HEX_DEC, NULL, 0xFFFFFFFF,
3067                 NULL, HFILL }},
3068
3069                 { &hf_gvcp_actioncmd_time_v2_0,
3070                 { "Action Scheduled Time", "gvcp.cmd.action.time",
3071                 FT_UINT64, BASE_HEX_DEC, NULL, 0x0,
3072                 NULL, HFILL }},
3073
3074                 /* Pending acknowledge */
3075
3076                 { &hf_gvcp_time_to_completion,
3077                 { "Time to completion", "gvcp.ack.pendingack.timetocompletion",
3078                 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
3079                 NULL, HFILL }},
3080
3081                 /* GVCP_VERSION */
3082
3083                 { &hf_gvcp_spec_version_major,
3084                 { "Version Major", "gvcp.bootstrap.specversion.major",
3085                 FT_UINT32, BASE_HEX, NULL, 0xFFFF0000,
3086                 NULL, HFILL }},
3087
3088                 { &hf_gvcp_spec_version_minor,
3089                 { "Version Minor", "gvcp.bootstrap.specversion.minor",
3090                 FT_UINT32, BASE_HEX, NULL, 0x0000FFFF,
3091                 NULL, HFILL }},
3092
3093                 { &hf_gvcp_spec_version,
3094                 { "Spec Version", "gvcp.bootstrap.specversion",
3095                 FT_UINT32, BASE_HEX, NULL, 0,
3096                 NULL, HFILL }},
3097
3098                 /* GVCP_devicemode */
3099
3100                 { &hf_gvcp_devicemode_endianness,
3101                 { "Endianness", "gvcp.bootstrap.devicemode.endianness",
3102                 FT_BOOLEAN, 32, NULL, 0x80000000,
3103                 NULL, HFILL
3104                 }},
3105
3106                 { &hf_gvcp_devicemode_deviceclass,
3107                 { "Device Class", "gvcp.bootstrap.devicemode.deviceclass",
3108                 FT_UINT32, BASE_HEX, VALS(devicemodenames_class), 0x70000000,
3109                 NULL, HFILL
3110                 }},
3111
3112                 { &hf_gvcp_devicemode_current_link_configuration_v2_0,
3113                 { "Current Link Configuration", "gvcp.bootstrap.devicemode.currentlinkconfiguration",
3114                 FT_UINT32, BASE_HEX, VALS(linkconfiguration_class), 0x03000000,
3115                 NULL, HFILL
3116                 }},
3117
3118                 {& hf_gvcp_devicemode_characterset,
3119                 { "Character Set", "gvcp.bootstrap.devicemode.characterset",
3120                 FT_UINT32, BASE_HEX, VALS(devicemodenames_characterset), 0x0000000F,
3121                 NULL, HFILL
3122                 }},
3123
3124                 /* GVCP_MAC_HIGH_0, 1, 2, 3 */
3125
3126                 { &hf_gvcp_machigh,
3127                 { "MAC High", "gvcp.bootstrap.machigh",
3128                 FT_UINT32, BASE_HEX, NULL, 0x0000FFFF,
3129                 NULL, HFILL
3130                 }},
3131
3132                 /* GVCP_MAC_LOW_0, 1, 2, 3 */
3133
3134                 { &hf_gvcp_maclow,
3135                 { "MAC Low", "gvcp.bootstrap.maclow",
3136                 FT_UINT32, BASE_HEX, NULL, 0,
3137                 NULL, HFILL
3138                 }},
3139
3140                 /* GVCP_SUPPORTED_IP_CONFIGURATION_0, 1, 2, 3 */
3141                 /* GVCP_CURIPCFG_0, 1, 2, 3 */
3142
3143                 { &hf_gvcp_ip_config_can_handle_pause_frames_v2_0,
3144                 { "IP Config Can Handle Pause Frames", "gvcp.bootstrap.ipconfig.canhandlepauseframes",
3145                 FT_BOOLEAN, 32, NULL, 0x80000000,
3146                 NULL, HFILL }},
3147
3148                 { &hf_gvcp_ip_config_can_generate_pause_frames_v2_0,
3149                 { "Can Generate Pause Frames", "gvcp.bootstrap.ipconfig.cangeneratepauseframes",
3150                 FT_BOOLEAN, 32, NULL, 0x40000000,
3151                 NULL, HFILL }},
3152
3153                 { &hf_gvcp_ip_config_lla,
3154                 { "LLA", "gvcp.bootstrap.ipconfig.lla",
3155                 FT_BOOLEAN, 32, NULL, 0x00000004,
3156                 NULL, HFILL }},
3157
3158                 { &hf_gvcp_ip_config_dhcp,
3159                 { "DHCP", "gvcp.bootstrap.ipconfig.dhcp",
3160                 FT_BOOLEAN, 32, NULL, 0x00000002,
3161                 NULL, HFILL }},
3162
3163                 { &hf_gvcp_ip_config_persistent_ip,
3164                 { "Persistent IP", "gvcp.bootstrap.ipconfig.persistentip",
3165                 FT_BOOLEAN, 32, NULL, 0x00000001,
3166                 NULL, HFILL }},
3167
3168                 { &hf_gvcp_supportedipconfig,
3169                 { "Supported IP Configuration", "gvcp.bootstrap.supportedipconfig",
3170                 FT_UINT32, BASE_HEX, NULL, 0,
3171                 NULL, HFILL
3172                 }},
3173
3174                 { &hf_gvcp_currentipconfig,
3175                 { "Current IP Configuration", "gvcp.bootstrap.currentipconfig",
3176                 FT_UINT32, BASE_HEX, NULL, 0,
3177                 NULL, HFILL
3178                 }},
3179
3180                 /* GVCP_CURRENT_IP_ADDRESS_0, 1, 2, 3 */
3181
3182                 { &hf_gvcp_current_IP,
3183                 { "Current IP", "gvcp.bootstrap.currentip",
3184                 FT_IPv4, BASE_NONE, NULL, 0x0,
3185                 NULL, HFILL }},
3186
3187                 /* GVCP_CURRENT_SUBNET_MASK_0, 1, 2, 3 */
3188
3189                 { &hf_gvcp_current_subnet_mask,
3190                 { "Subnet Mask", "gvcp.bootstrap.currentsubnetmask",
3191                 FT_IPv4, BASE_NONE, NULL, 0x0,
3192                 NULL, HFILL }},
3193
3194                 /* GVCP_CURRENT_DEFAULT_GATEWAY_0, 1, 2, 3 */
3195
3196                 { &hf_gvcp_current_default_gateway,
3197                 { "Default Gateway", "gvcp.bootstrap.currentdefaultgateway",
3198                 FT_IPv4, BASE_NONE, NULL, 0x0,
3199                 NULL, HFILL }},
3200
3201                 /* GVCP_MANUFACTURER_NAME */
3202
3203                 { &hf_gvcp_manufacturer_name,
3204                 { "Manufacturer Name", "gvcp.bootstrap.manufacturername",
3205                 FT_STRINGZ, BASE_NONE, NULL, 0x0,
3206                 NULL, HFILL }},
3207
3208                 /* GVCP_MODEL_NAME */
3209
3210                 { &hf_gvcp_model_name,
3211                 { "Model Name", "gvcp.bootstrap.modelname",
3212                 FT_STRINGZ, BASE_NONE, NULL, 0x0,
3213                 NULL, HFILL }},
3214
3215                 /* GVCP_DEVICE_VERSION */
3216
3217                 { &hf_gvcp_device_version,
3218                 { "Device Version", "gvcp.bootstrap.deviceversion",
3219                 FT_STRINGZ, BASE_NONE, NULL, 0x0,
3220                 NULL, HFILL }},
3221
3222                 /* GVCP_MANUFACTURER_INFO */
3223
3224                 { &hf_gvcp_manufacturer_specific_info,
3225                 { "Manufacturer Specific Info", "gvcp.bootstrap.manufacturerspecificinfo",
3226                 FT_STRINGZ, BASE_NONE, NULL, 0x0,
3227                 NULL, HFILL }},
3228
3229                 /* GVCP_SERIAL_NUMBER */
3230
3231                 { &hf_gvcp_serial_number,
3232                 { "Serial Number", "gvcp.bootstrap.serialnumber",
3233                 FT_STRINGZ, BASE_NONE, NULL, 0x0,
3234                 NULL, HFILL }},
3235
3236                 /* GVCP_USER_DEFINED_NAME */
3237
3238                 { &hf_gvcp_user_defined_name,
3239                 { "User-defined Name", "gvcp.bootstrap.userdefinedname",
3240                 FT_STRINGZ, BASE_NONE, NULL, 0x0,
3241                 NULL, HFILL }},
3242
3243                 /* GVCP_FIRST_URL */
3244
3245                 { &hf_gvcp_first_xml_device_description_file,
3246                 { "First URL", "gvcp.bootstrap.firsturl",
3247                 FT_STRINGZ, BASE_NONE, NULL, 0x0,
3248                 NULL, HFILL }},
3249
3250                 /* GVCP_SECOND_URL */
3251
3252                 { &hf_gvcp_second_xml_device_description_file,
3253                 { "Second URL", "gvcp.bootstrap.secondurl",
3254                 FT_STRINGZ, BASE_NONE, NULL, 0x0,
3255                 NULL, HFILL }},
3256
3257                 /* GVCP_NUMBER_OF_NETWORK_INTERFACES */
3258
3259                 {& hf_gvcp_number_interfaces,
3260                 { "Number of Network Interfaces", "gvcp.bootstrap.numberofnetworminterfaces",
3261                 FT_UINT32, BASE_DEC, NULL, 0x0,
3262                 NULL, HFILL
3263                 }},
3264
3265                 /* GVCP_PERSISTENT_IP_ADDRESS_0, 1, 2, 3 */
3266
3267                 {& hf_gvcp_persistent_ip,
3268                 { "Persistent IP", "gvcp.bootstrap.persistentip",
3269                 FT_IPv4, BASE_NONE, NULL, 0x0,
3270                 NULL, HFILL
3271                 }},
3272
3273                 /* GVCP_PERSISTENT_SUBNET_MASK_0, 1, 2, 3 */
3274
3275                 {& hf_gvcp_persistent_subnet,
3276                 { "Persistent Subnet Mask", "gvcp.bootstrap.persistentsubnetmask",
3277                 FT_IPv4, BASE_NONE, NULL, 0x0,
3278                 NULL, HFILL
3279                 }},
3280
3281                 /* GVCP_PERSISTENT_DEFAULT_GATEWAY_0, 1, 2, 3 */
3282
3283                 {& hf_gvcp_persistent_gateway,
3284                 { "Persistent GateWay", "gvcp.bootstrap.persistentgateway",
3285                 FT_IPv4, BASE_NONE, NULL, 0x0,
3286                 NULL, HFILL
3287                 }},
3288
3289                 /* GVCP_LINK_SPEED_0, 1, 2, 3 */
3290
3291                 {& hf_gvcp_link_speed,
3292                 { "Link Speed (in Mbs)", "gvcp.bootstrap.linkspeed",
3293                 FT_UINT32, BASE_DEC, NULL, 0x0,
3294                 NULL, HFILL
3295                 }},
3296
3297                 /* GVCP_NUMBER_OF_MESSAGE_CHANNELS */
3298
3299                 {& hf_gvcp_number_message_channels,
3300                 { "Number of Message Channels", "gvcp.bootstrap.numberofmessagechannels",
3301                 FT_UINT32, BASE_DEC, NULL, 0x0,
3302                 NULL, HFILL
3303                 }},
3304
3305                 /* GVCP_NUMBER_OF_STREAM_CHANNELS */
3306
3307                 {& hf_gvcp_number_stream_channels,
3308                 { "Number of Stream Channels", "gvcp.bootstrap.numberofstreamchannels",
3309                 FT_UINT32, BASE_DEC, NULL, 0x0,
3310                 NULL, HFILL
3311                 }},
3312
3313                 /* GVCP_NUMBER_OF_ACTION_SIGNALS */
3314
3315                 {& hf_gvcp_number_action_signals,
3316                 { "Number of Action Signals", "gvcp.bootstrap.numberofactionsignals",
3317                 FT_UINT32, BASE_DEC, NULL, 0x0,
3318                 NULL, HFILL
3319                 }},
3320
3321                 /* GVCP_NUMBER_OF_ACTIVE_LINKS */
3322
3323                 {& hf_gvcp_number_of_active_links_v2_0,
3324                 { "Number of Active Links", "gvcp.bootstrap.numberofactivelinks",
3325                 FT_UINT32, BASE_DEC, NULL, 0x0000000F,
3326                 NULL, HFILL
3327                 }},
3328
3329                 /* GVCP_IEEE_1588_SELECTED_PROFILE */
3330
3331                 {& hf_gvcp_selected_ieee1588_profile_v2_1,
3332                 { "IEEE 1588 Selected Profile", "gvcp.bootstrap.ieee1588selectedprofile",
3333                 FT_UINT32, BASE_DEC, NULL, 0x0000001F,
3334                 NULL, HFILL
3335                 }},
3336
3337                 /* GVCP_SC_CAPS */
3338
3339                 {& hf_gvcp_sccaps_scspx_register_supported,
3340                 { "SCSPx Register Supported", "gvcp.bootstrap.sccaps.scspxregistersupported",
3341                 FT_BOOLEAN, 32, NULL, 0x80000000,
3342                 NULL, HFILL
3343                 }},
3344
3345                 {& hf_gvcp_sccaps_legacy_16bit_blockid_supported_v2_0,
3346                 { "16 bit Block ID Supported", "gvcp.bootstrap.sccaps.16bitblockidsupported",
3347                 FT_BOOLEAN, 32, NULL, 0x40000000,
3348                 NULL, HFILL
3349                 }},
3350
3351                 { &hf_gvcp_sccaps_scmbsx_supported_v2_2,
3352                 { "Stream Channel Max. Block Size Supported", "gvcp.bootstrap.sccaps.scmbssupported",
3353                 FT_BOOLEAN, 32, NULL, 0x20000000,
3354                 NULL, HFILL
3355                 } },
3356
3357                 { &hf_gvcp_sccaps_scebax_supported_v2_2,
3358                 { "Stream Channel Extended Bootstrap Address Supported", "gvcp.bootstrap.sccaps.scebasupported",
3359                 FT_BOOLEAN, 32, NULL, 0x10000000,
3360                 NULL, HFILL
3361                 } },
3362
3363                 /* GVCP_MESSAGE_CHANNEL_CAPS */
3364
3365                 {& hf_gvcp_mcsp_supported,
3366                 { "MCSP Supported", "gvcp.bootstrap.mccaps.mcspsupported",
3367                 FT_BOOLEAN, 32, NULL, 0x80000000,
3368                 NULL, HFILL
3369                 }},
3370
3371                 { &hf_gvcp_mcc_supported_v2_2,
3372                 { "MCC Supported", "gvcp.bootstrap.mccaps.mccsupported",
3373                 FT_BOOLEAN, 32, NULL, 0x40000000,
3374                 NULL, HFILL
3375                 } },
3376
3377                 { &hf_gvcp_mcec_supported_v2_2,
3378                 { "MCEC Supported", "gvcp.bootstrap.mccaps.mcecsupported",
3379                 FT_BOOLEAN, 32, NULL, 0x20000000,
3380                 NULL, HFILL
3381                 } },
3382
3383                 /* GVCP_IEEE_1588_EXTENDED_CAPABILITY */
3384
3385                 {& hf_gvcp_ieee1588_profile_registers_present_v2_1,
3386                 { "IEEE 1588 Profile Registers Present", "gvcp.bootstrap.ieee1588extendedcapabilities.profileregisterspresent",
3387                 FT_BOOLEAN, 32, NULL, 0x80000000,
3388                 NULL, HFILL
3389                 }},
3390
3391                 /* GVCP_IEEE_1588_SUPPORTED_PROFILES */
3392
3393                 {& hf_gvcp_ieee1588_ptp_profile_supported_v2_1,
3394                 { "IEEE 1588 PTP Profile Supported", "gvcp.bootstrap.ieee1588supportedprofiles.ptp",
3395                 FT_BOOLEAN, 32, NULL, 0x80000000,
3396                 NULL, HFILL
3397                 }},
3398
3399                 {& hf_gvcp_ieee1588_802dot1as_profile_supported_v2_1,
3400                 { "IEEE 1588 802.1as Profile Supported", "gvcp.bootstrap.ieee1588supportedprofiles.802dot1as",
3401                 FT_BOOLEAN, 32, NULL, 0x40000000,
3402                 NULL, HFILL
3403                 }},
3404
3405                 /* GVCP_CAPABILITY */
3406
3407                 {& hf_gvcp_capability_user_defined,
3408                 { "User Defined Name Supported", "gvcp.bootstrap.capability.userdefined",
3409                 FT_BOOLEAN, 32, NULL, 0x80000000,
3410                 NULL, HFILL
3411                 }},
3412
3413                 {& hf_gvcp_capability_serial_number,
3414                 { "Serial Number Supported", "gvcp.bootstrap.capability.serialnumber",
3415                 FT_BOOLEAN, 32, NULL, 0x40000000,
3416                 NULL, HFILL
3417                 }},
3418
3419                 {& hf_gvcp_capability_heartbeat_disable,
3420                 { "Heartbeat Disable Supported", "gvcp.bootstrap.capability.heartbeatdisabled",
3421                 FT_BOOLEAN, 32, NULL, 0x20000000,
3422                 NULL, HFILL
3423                 }},
3424
3425                 {& hf_gvcp_capability_link_speed,
3426                 { "Link Speed Supported", "gvcp.bootstrap.capability.linkspeed",
3427                 FT_BOOLEAN, 32, NULL, 0x10000000,
3428                 NULL, HFILL
3429                 }},
3430
3431                 {& hf_gvcp_capability_ccp_application_portip,
3432                 { "CCP Application Port/IP Supported", "gvcp.bootstrap.capability.ccpapplicationportip",
3433                 FT_BOOLEAN, 32, NULL, 0x08000000,
3434                 NULL, HFILL
3435                 }},
3436
3437                 {& hf_gvcp_capability_manifest_table,
3438                 { "Manifest Table Supported", "gvcp.bootstrap.capability.manifesttable",
3439                 FT_BOOLEAN, 32, NULL, 0x04000000,
3440                 NULL, HFILL
3441                 }},
3442
3443                 {& hf_gvcp_capability_test_data,
3444                 { "Test Data Supported", "gvcp.bootstrap.capability.testdata",
3445                 FT_BOOLEAN, 32, NULL, 0x02000000,
3446                 NULL, HFILL
3447                 }},
3448
3449                 {& hf_gvcp_capability_discovery_ACK_delay,
3450                 { "Discovery ACK Delay Supported", "gvcp.bootstrap.capability.discoveryackdelay",
3451                 FT_BOOLEAN, 32, NULL, 0x01000000,
3452                 NULL, HFILL
3453                 }},
3454
3455                 {& hf_gvcp_capability_writable_discovery_ACK_delay,
3456                 { "Writable Discovery ACK Delay Supported", "gvcp.bootstrap.capability.writablediscoveryackdelay",
3457                 FT_BOOLEAN, 32, NULL, 0x00800000,
3458                 NULL, HFILL
3459                 }},
3460
3461                 {& hf_gvcp_capability_extended_status_code_v1_1,
3462                 { "Extended Status Code Supported (v1.1)", "gvcp.bootstrap.capability.extendedstatuscodesupportedv1_1",
3463                 FT_BOOLEAN, 32, NULL, 0x00400000,
3464                 NULL, HFILL
3465                 }},
3466
3467                 {& hf_gvcp_capability_primary_application_switchover,
3468                 { "Primary Application Switchover Supported", "gvcp.bootstrap.capability.primaryapplicationswitchover",
3469                 FT_BOOLEAN, 32, NULL, 0x00200000,
3470                 NULL, HFILL
3471                 }},
3472
3473                 {& hf_gvcp_capability_unconditional_action_command,
3474                 { "Unconditional Action Command Supported", "gvcp.bootstrap.capability.unconditionalactioncommand",
3475                 FT_BOOLEAN, 32, NULL, 0x00100000,
3476                 NULL, HFILL
3477                 }},
3478
3479                 {& hf_gvcp_capability_1588_v2_0,
3480                 { "Capability 1588", "gvcp.bootstrap.capability.ieee1588",
3481                 FT_BOOLEAN, 32, NULL, 0x00080000,
3482                 NULL, HFILL
3483                 }},
3484
3485                 {& hf_gvcp_capability_extended_status_code_v2_0,
3486                 { "Status Code", "gvcp.bootstrap.capability.pendingextendedstatuscodev2_0",
3487                 FT_BOOLEAN, 32, NULL, 0x00040000,
3488                 NULL, HFILL
3489                 }},
3490
3491                 {& hf_gvcp_capability_scheduled_action_command_v2_0,
3492                 { "Scheduled Action Command", "gvcp.bootstrap.capability.scheduledactioncommand",
3493                 FT_BOOLEAN, 32, NULL, 0x00020000,
3494                 NULL, HFILL
3495                 }},
3496
3497                 {& hf_gvcp_capability_ieee1588_extended_capabilities_v2_1,
3498                 { "IEEE1588 Extended Capabilities", "gvcp.bootstrap.capability.ieee1588extendedcapabilities",
3499                 FT_BOOLEAN, 32, NULL, 0x00010000,
3500                 NULL, HFILL
3501                 }},
3502
3503                 {& hf_gvcp_capability_action_command,
3504                 { "Action Command", "gvcp.bootstrap.capability.actioncommand",
3505                 FT_BOOLEAN, 32, NULL, 0x00000040,
3506                 NULL, HFILL
3507                 }},
3508
3509                 {& hf_gvcp_capability_pending,
3510                 { "Pending ACK Supported", "gvcp.bootstrap.capability.pendingack",
3511                 FT_BOOLEAN, 32, NULL, 0x00000020,
3512                 NULL, HFILL
3513                 }},
3514
3515                 {& hf_gvcp_capability_evendata,
3516                 { "Event Data Supported", "gvcp.bootstrap.capability.eventdata",
3517                 FT_BOOLEAN, 32, NULL, 0x00000010,
3518                 NULL, HFILL
3519                 }},
3520
3521                 {& hf_gvcp_capability_event,
3522                 { "Event Signal Supported", "gvcp.bootstrap.capability.eventsignal",
3523                 FT_BOOLEAN, 32, NULL, 0x00000008,
3524                 NULL, HFILL
3525                 }},
3526
3527                 {& hf_gvcp_capability_packetresend,
3528                 { "Packet Resend CMD Supported", "gvcp.bootstrap.capability.packetresendcmd",
3529                 FT_BOOLEAN, 32, NULL, 0x00000004,
3530                 NULL, HFILL
3531                 }},
3532
3533                 {& hf_gvcp_capability_writemem,
3534                 { "WRITEMEM Supported", "gvcp.bootstrap.capability.writemem",
3535                 FT_BOOLEAN, 32, NULL, 0x00000002,
3536                 NULL, HFILL
3537                 }},
3538
3539                 {& hf_gvcp_capability_concatenation,
3540                 { "Concatenation Supported", "gvcp.bootstrap.capability.concatenation",
3541                 FT_BOOLEAN, 32, NULL, 0x00000001,
3542                 NULL, HFILL
3543                 }},
3544
3545                 /* GVCP_HEARTBEAT_TIMEOUT */
3546
3547                 {& hf_gvcp_heartbeat,
3548                 { "Heartbeat Timeout (in ms)", "gvcp.bootstrap.heartbeattimeout",
3549                 FT_UINT32, BASE_DEC, NULL, 0x0,
3550                 NULL, HFILL
3551                 }},
3552
3553                 /* GVCP_TIMESTAMP_TICK_FREQUENCY_HIGH */
3554
3555                 {& hf_gvcp_high_timestamp_frequency,
3556                 { "Timestamp Tick High Frequency (in Hz)", "gvcp.bootstrap.timestamptickfrequencyhigh",
3557                 FT_UINT32, BASE_DEC, NULL, 0x0,
3558                 NULL, HFILL
3559                 }},
3560
3561                 /* GVCP_TIMESTAMP_TICK_FREQUENCY_LOW */
3562
3563                 {& hf_gvcp_low_timestamp_frequency,
3564                 { "Timestamp Tick Low Frequency (in Hz)", "gvcp.bootstrap.timestamptickfrequencylow",
3565                 FT_UINT32, BASE_DEC, NULL, 0x0,
3566                 NULL, HFILL
3567                 }},
3568
3569                 /* GVCP_TIMESTAMP_CONTROL */
3570
3571                 {& hf_gvcp_timestamp_control_latch,
3572                 { "Timestamp Control Latch", "gvcp.bootstrap.timestampcontrol.latch",
3573                 FT_BOOLEAN, 32, NULL, 0x00000002,
3574                 NULL, HFILL
3575                 }},
3576
3577                 {& hf_gvcp_timestamp_control_reset,
3578                 { "Timestamp Control Reset", "gvcp.bootstrap.timestampcontrol.reset",
3579                 FT_BOOLEAN, 32, NULL, 0x00000001,
3580                 NULL, HFILL
3581                 }},
3582
3583                 /* GVCP_TIMESTAMP_VALUE_HIGH */
3584
3585                 {& hf_gvcp_high_timestamp_value,
3586                 { "Timestamp Value High", "gvcp.bootstrap.timestampvaluehigh",
3587                 FT_UINT32, BASE_DEC, NULL, 0x0,
3588                 NULL, HFILL
3589                 }},
3590
3591                 /* GVCP_TIMESTAMP_VALUE_LOW */
3592
3593                 {& hf_gvcp_low_timestamp_value,
3594                 { "Timestamp Value Low", "gvcp.bootstrap.timestampvaluelow",
3595                 FT_UINT32, BASE_DEC, NULL, 0x0,
3596                 NULL, HFILL
3597                 }},
3598
3599                 /* GVCP_DISCOVERY_ACK_DELAY */
3600
3601                 {& hf_gvcp_discovery_ACK_delay,
3602                 { "Discovery ACK Delay (in ms)", "gvcp.bootstrap.discoveryackdelay",
3603                 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
3604                 NULL, HFILL
3605                 }},
3606
3607                 /* GVCP_CONFIGURATION */
3608
3609                 {& hf_gvcp_configuration_1588_enable_v2_0,
3610                 { "IEEE 1588 Enable", "gvcp.bootstrap.config.ieee1588enable",
3611                 FT_BOOLEAN, 32, NULL, 0x00080000,
3612                 NULL, HFILL
3613                 }},
3614
3615                 {& hf_gvcp_configuration_extended_status_codes_enable_v2_0,
3616                 { "Status Codes v2.0 Enable", "gvcp.bootstrap.config.statuscodesv2_0enable",
3617                 FT_BOOLEAN, 32, NULL, 0x00040000,
3618                 NULL, HFILL
3619                 }},
3620
3621                 {& hf_gvcp_configuration_unconditional_action_command_enable_v2_0,
3622                 { "Unconditional Action Command Enable", "gvcp.bootstrap.config.unconditionalactioncommandenable",
3623                 FT_BOOLEAN, 32, NULL, 0x00000008,
3624                 NULL, HFILL
3625                 }},
3626
3627                 {& hf_gvcp_configuration_extended_status_codes_enable_v1_1,
3628                 { "Status Codes v1.1 Enable", "gvcp.bootstrap.config.statuscodesv1_1enable",
3629                 FT_BOOLEAN, 32, NULL, 0x00000004,
3630                 NULL, HFILL
3631                 }},
3632
3633                 {& hf_gvcp_configuration_pending_ack_enable,
3634                 { "Pending_ACK Enable", "gvcp.bootstrap.config.pendingackenable",
3635                 FT_BOOLEAN, 32, NULL, 0x00000002,
3636                 NULL, HFILL
3637                 }},
3638
3639                 {& hf_gvcp_configuration_heartbeat_disable,
3640                 { "Heartbeat Disable", "gvcp.bootstrap.config.heartbeatdisable",
3641                 FT_BOOLEAN, 32, NULL, 0x00000001,
3642                 NULL, HFILL
3643                 }},
3644
3645                 /* GVCP_PENDING_TIMEOUT */
3646
3647                 {& hf_gvcp_pending_timeout_max_execution,
3648                 { "Pending Timeout (in ms)", "gvcp.bootstrap.pending.timeout",
3649                 FT_UINT32, BASE_DEC, NULL, 0x0,
3650                 NULL, HFILL
3651                 }},
3652
3653                 /* GVCP_CONTROL_SWITCHOVER_KEY */
3654
3655                 {& hf_gvcp_control_switchover_key_register,
3656                 { "Control Switchover Key", "gvcp.bootstrap.controlswitchoverkey",
3657                 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
3658                 NULL, HFILL
3659                 }},
3660
3661                 /* GVCP_GVSCP_CONFIGURATION */
3662
3663                 {& hf_gvcp_gvsp_configuration_64bit_blockid_enable_v2_0,
3664                 { "GVSP Configuration 64 bit Block ID", "gvcp.bootstrap.gvcspconfig.64bitblockidenable",
3665                 FT_BOOLEAN, 32, NULL, 0x40000000,
3666                 NULL, HFILL
3667                 }},
3668
3669                 /* GVCP_PHYSICAL_LINK_CAPABILITY, GVCP_PHYSICAL_LINK_CONFIGURATION */
3670
3671                 {& hf_gvcp_link_dlag_v2_0,
3672                 { "Link dLAG", "gvcp.bootstrap.link.dlag",
3673                 FT_BOOLEAN, 32, NULL, 0x00000008,
3674                 NULL, HFILL
3675                 }},
3676
3677                 {& hf_gvcp_link_slag_v2_0,
3678                 { "Link sLAG", "gvcp.bootstrap.link.slag",
3679                 FT_BOOLEAN, 32, NULL, 0x00000004,
3680                 NULL, HFILL
3681                 }},
3682
3683                 {& hf_gvcp_link_ml_v2_0,
3684                 { "Link ML", "gvcp.bootstrap.link.ml",
3685                 FT_BOOLEAN, 32, NULL, 0x00000002,
3686                 NULL, HFILL
3687                 }},
3688
3689                 {& hf_gvcp_link_sl_v2_0,
3690                 { "Link SL", "gvcp.bootstrap.link.sl",
3691                 FT_BOOLEAN, 32, NULL, 0x00000001,
3692                 NULL, HFILL
3693                 }},
3694
3695                 /* GVCP_IEEE_1588_STATUS */
3696
3697                 {& hf_gvcp_ieee1588_clock_status_v2_0,
3698                 { "IEEE 1588 Clock Status", "gvcp.bootstrap.ieee1588.clockstatus",
3699                 FT_UINT32, BASE_HEX, NULL, 0x0000000F,
3700                 NULL, HFILL
3701                 }},
3702
3703                 /* GVCP_SCHEDULED_ACTION_COMMAND_QUEUE_SIZE */
3704
3705                 {& hf_gvcp_scheduled_action_command_queue_size_v2_0,
3706                 { "Scheduled Action Command Queue Size", "gvcp.bootstrap.scheduledactioncommandqueuesize",
3707                 FT_UINT32, BASE_DEC, NULL, 0,
3708                 NULL, HFILL
3709                 }},
3710
3711                 /* GVCP_CCP */
3712
3713                 {& hf_gvcp_control_switchover_key,
3714                 { "Control Switchover Key", "gvcp.bootstrap.control.switchoverkey",
3715                 FT_UINT32, BASE_HEX, NULL, 0xFFFF0000,
3716                 NULL, HFILL
3717                 }},
3718
3719                 {& hf_gvcp_control_switchover_en,
3720                 { "Control Switchover Enable", "gvcp.bootstrap.control.switchoverenable",
3721                 FT_BOOLEAN, 32, NULL, 0x00000004,
3722                 NULL, HFILL
3723                 }},
3724
3725                 {& hf_gvcp_control_access,
3726                 { "Control Access", "gvcp.bootstrap.control.controlaccess",
3727                 FT_BOOLEAN, 32, NULL, 0x00000002,
3728                 NULL, HFILL
3729                 }},
3730
3731                 {& hf_gvcp_exclusive_access,
3732                 { "Exclusive Access", "gvcp.bootstrap.control.exclusiveaccess",
3733                 FT_BOOLEAN, 32, NULL, 0x00000001,
3734                 NULL, HFILL
3735                 }},
3736
3737                 /* GVCP_PRIMARY_APPLICATION_PORT */
3738
3739                 {& hf_gvcp_primary_application_host_port,
3740                 { "Primary Application Port", "gvcp.bootstrap.primaryapplicationport",
3741                 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
3742                 NULL, HFILL
3743                 }},
3744
3745                 /* GVCP_PRIMARY_APPLICATION_IP_ADDRESS */
3746
3747                 {& hf_gvcp_primary_application_ip_address,
3748                 { "Primary Application IP Address", "gvcp.bootstrap.primaryapplicationipaddress",
3749                 FT_IPv4, BASE_NONE, NULL, 0x0,
3750                 NULL, HFILL
3751                 }},
3752
3753                 /* GVCP_MC_DESTINATION_PORT */
3754
3755                 {& hf_gvcp_network_interface_index,
3756                 { "Network Interface Index", "gvcp.bootstrap.mcp.networkinterfaceindex",
3757                 FT_UINT32, BASE_DEC, NULL, 0x000F0000,
3758                 NULL, HFILL
3759                 }},
3760
3761                 {& hf_gvcp_host_port,
3762                 { "Host Port", "gvcp.bootstrap.mcp.hostport",
3763                 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
3764                 NULL, HFILL
3765                 }},
3766
3767                 /* GVCP_MC_DESTINATION_ADDRESS */
3768
3769                 {& hf_gvcp_channel_destination_ip,
3770                 { "Destination IP Address", "gvcp.bootstrap.mcda",
3771                 FT_IPv4, BASE_NONE, NULL, 0x0,
3772                 NULL, HFILL
3773                 }},
3774
3775                 /* GVCP_MC_TIMEOUT */
3776
3777                 {& hf_gvcp_message_channel_transmission_timeout,
3778                 { "Transmission Timeout (in ms)", "gvcp.bootstrap.mctt",
3779                 FT_UINT32, BASE_DEC, NULL, 0x0,
3780                 NULL, HFILL
3781                 }},
3782
3783                 /* GVCP_MC_RETRY_COUNT */
3784
3785                 {& hf_gvcp_message_channel_retry_count,
3786                 { "Retry Count", "gvcp.bootstrap.mcrc",
3787                 FT_UINT32, BASE_DEC, NULL, 0x0,
3788                 NULL, HFILL
3789                 }},
3790
3791                 /* GVCP_MC_SOURCE_PORT */
3792
3793                 {& hf_gvcp_message_channel_source_port,
3794                 { "Source Port", "gvcp.bootstrap.mcsp",
3795                 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
3796                 NULL, HFILL
3797                 }},
3798
3799                 /* GVCP_MC_CONFIGURATION */
3800
3801                 { &hf_gvcp_mcec_enabled_v2_2,
3802                 { "MCEC Enabled", "gvcp.bootstrap.mcconfig.mcecenabled",
3803                 FT_BOOLEAN, 32, NULL, 0x80000000,
3804                 NULL, HFILL
3805                 } },
3806
3807                 /* GVCP_SC_DESTINATION_PORT(0), 1, 2, 3 */
3808
3809                 {& hf_gvcp_sc_direction,
3810                 { "Direction", "gvcp.bootstrap.scpx.direction",
3811                 FT_BOOLEAN, 32, TFS(&directionnames), 0x80000000,
3812                 NULL, HFILL
3813                 }},
3814
3815                 {& hf_gvcp_sc_ni_index,
3816                 { "Network Interface Index", "gvcp.bootstrap.scpx.networkinterfaceindex",
3817                 FT_UINT32, BASE_DEC, NULL, 0x000F0000,
3818                 NULL, HFILL
3819                 }},
3820
3821                 {& hf_gvcp_sc_host_port,
3822                 { "Host Port", "gvcp.bootstrap.scpx.hostport",
3823                 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
3824                 NULL, HFILL
3825                 }},
3826
3827                 /* GVCP_SC_PACKET_SIZE(0), 1, 2, 3 */
3828
3829                 {& hf_gvcp_sc_fire_test_packet,
3830                 { "Fire Test Packet", "gvcp.bootstrap.scpsx.firetestpacket",
3831                 FT_BOOLEAN, 32, NULL, 0x80000000,
3832                 NULL, HFILL
3833                 }},
3834
3835                 {& hf_gvcp_sc_do_not_fragment,
3836                 { "Do Not Fragment", "gvcp.bootstrap.scpsx.donotfragment",
3837                 FT_BOOLEAN, 32, NULL, 0x40000000,
3838                 NULL, HFILL
3839                 }},
3840
3841                 {& hf_gvcp_sc_pixel_endianness,
3842                 { "Pixel Endianness", "gvcp.bootstrap.scpsx.pixelendianness",
3843                 FT_BOOLEAN, 32, NULL, 0x20000000,
3844                 NULL, HFILL
3845                 }},
3846
3847                 {& hf_gvcp_sc_packet_size,
3848                 { "Packet Size", "gvcp.bootstrap.scpsx.packetsize",
3849                 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
3850                 NULL, HFILL
3851                 }},
3852
3853                 /* GVCP_SC_PACKET_DELAY(0), 1, 2, 3 */
3854
3855                 {& hf_gvcp_sc_packet_delay,
3856                 { "Packet Delay", "gvcp.bootstrap.scpdx",
3857                 FT_UINT32, BASE_DEC, NULL, 0x0,
3858                 NULL, HFILL
3859                 }},
3860
3861                 /* GVCP_SC_DESTINATION_ADDRESS(0), 1, 2, 3 */
3862
3863                 {& hf_gvcp_sc_destination_ip,
3864                 { "Destination Address", "gvcp.bootstrap.scdax",
3865                 FT_IPv4, BASE_NONE, NULL, 0x0,
3866                 NULL, HFILL
3867                 }},
3868
3869                 /* GVCP_SC_SOURCE_PORT(0), 1, 2, 3 */
3870
3871                 {& hf_gvcp_sc_source_port,
3872                 { "Source Port", "gvcp.bootstrap.scspx",
3873                 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
3874                 NULL, HFILL
3875                 }},
3876
3877                 /* GVCP_SC_CAPABILITY(0), 1, 2, 3 */
3878
3879                 {& hf_gvcp_sc_big_little_endian_supported,
3880                 { "Big/Little Endian Supported", "gvcp.bootstrap.sccx.biglittleendiansupported",
3881                 FT_BOOLEAN, 32, NULL, 0x80000000,
3882                 NULL, HFILL
3883                 }},
3884
3885                 {& hf_gvcp_sc_ip_reassembly_supported,
3886                 { "IP Reassembly Supported", "gvcp.bootstrap.sccx.ipreassemblysupported",
3887                 FT_BOOLEAN, 32, NULL, 0x40000000,
3888                 NULL, HFILL
3889                 }},
3890
3891                 { &hf_gvcp_sc_scmpcx_supported_v2_2,
3892                 { "Stream Channel Maximum Packet Count Supported", "gvcp.bootstrap.sccx.scmpcxsupported",
3893                 FT_BOOLEAN, 32, NULL, 0x00000100,
3894                 NULL, HFILL
3895                 } },
3896
3897                 { &hf_gvcp_sc_gendc_supported_v2_2,
3898                 { "GenDC Supported", "gvcp.bootstrap.sccx.gendcsupported",
3899                 FT_BOOLEAN, 32, NULL, 0x00000080,
3900                 NULL, HFILL
3901                 } },
3902
3903                 {& hf_gvcp_sc_multi_part_supported_v2_1,
3904                 { "Multi-part Supported", "gvcp.bootstrap.sccx.multipartsupported",
3905                 FT_BOOLEAN, 32, NULL, 0x00000040,
3906                 NULL, HFILL
3907                 }},
3908
3909                 {& hf_gvcp_sc_large_leader_trailer_supported_v2_1,
3910                 { "Large Leader/Trailer Supported", "gvcp.bootstrap.sccx.largeleadertrailersupported",
3911                 FT_BOOLEAN, 32, NULL, 0x00000020,
3912                 NULL, HFILL
3913                 }},
3914
3915                 {& hf_gvcp_sc_multizone_supported_v2_0,
3916                 { "Multi-zone Supported", "gvcp.bootstrap.sccx.multizonesupported",
3917                 FT_BOOLEAN, 32, NULL, 0x00000010,
3918                 NULL, HFILL
3919                 }},
3920
3921                 {& hf_gvcp_sc_packet_resend_destination_option_supported_v2_0,
3922                 { "Resend Destination Option Supported", "gvcp.bootstrap.sccx.resenddestinationoptionsupported",
3923                 FT_BOOLEAN, 32, NULL, 0x8,
3924                 NULL, HFILL
3925                 }},
3926
3927                 {& hf_gvcp_sc_packet_resend_all_in_transmission_supported_v2_0,
3928                 { "All In Transmission Supported", "gvcp.bootstrap.sccx.allintransmissionsupported",
3929                 FT_BOOLEAN, 32, NULL, 0x4,
3930                 NULL, HFILL
3931                 }},
3932
3933                 {& hf_gvcp_sc_unconditional_streaming_supported,
3934                 { "Unconditional Streaming Supported", "gvcp.bootstrap.sccx.unconditionalstreamingsupported",
3935                 FT_BOOLEAN, 32, NULL, 0x2,
3936                 NULL, HFILL
3937                 }},
3938
3939                 {& hf_gvcp_sc_extended_chunk_data_supported,
3940                 { "Extended Chunk Data Supported", "gvcp.bootstrap.sccx.extendedchunkdatasupported",
3941                 FT_BOOLEAN, 32, NULL, 0x1,
3942                 NULL, HFILL
3943                 }},
3944
3945                 /* GVCP_SC_CONFIGURATION(0), 1, 2, 3 */
3946
3947                 { &hf_gvcp_sc_gendc_enabled_v2_2,
3948                 { "GenDC Enabled", "gvcp.bootstrap.sccfgx.gendcenabled",
3949                 FT_BOOLEAN, 32, NULL, 0x80,
3950                 NULL, HFILL
3951                 } },
3952
3953                 {& hf_gvcp_sc_multi_part_enabled_v2_1,
3954                 { "Multi-part Enabled", "gvcp.bootstrap.sccfgx.multipartenabled",
3955                 FT_BOOLEAN, 32, NULL, 0x40,
3956                 NULL, HFILL
3957                 }},
3958
3959                 {& hf_gvcp_sc_large_leader_trailer_enabled_v2_1,
3960                 { "Large Leader/Trailer Enabled", "gvcp.bootstrap.sccfgx.largeleadertrailerenabled",
3961                 FT_BOOLEAN, 32, NULL, 0x20,
3962                 NULL, HFILL
3963                 }},
3964
3965                 {& hf_gvcp_sc_packet_resend_destination_option_enabled_v2_0,
3966                 { "Resend Destination Option Enabled", "gvcp.bootstrap.sccfgx.resenddestinationoptionenabled",
3967                 FT_BOOLEAN, 32, NULL, 0x8,
3968                 NULL, HFILL
3969                 }},
3970
3971                 {& hf_gvcp_sc_packet_resend_all_in_transmission_enabled_v2_0,
3972                 { "All In Transmission Enabled", "gvcp.bootstrap.sccfgx.allintransmissionenabled",
3973                 FT_BOOLEAN, 32, NULL, 0x4,
3974                 NULL, HFILL
3975                 }},
3976
3977                 {& hf_gvcp_sc_unconditional_streaming_enabled,
3978                 { "Unconditional Streaming Enabled", "gvcp.bootstrap.sccfgx.unconditionalstreamingenabled",
3979                 FT_BOOLEAN, 32, NULL, 0x2,
3980                 NULL, HFILL
3981                 }},
3982
3983                 {& hf_gvcp_sc_extended_chunk_data_enabled,
3984                 { "Extended Chunk Data Enabled", "gvcp.bootstrap.sccfgx.extendedchunkdataenabled",
3985                 FT_BOOLEAN, 32, NULL, 0x1,
3986                 NULL, HFILL
3987                 }},
3988
3989                 /* GVCP_SC_ZONE(0), 1, 2, 3 */
3990
3991                 {& hf_gvcp_sc_additional_zones_v2_0,
3992                 { "Additional Zones", "gvcp.bootstrap.sczx.additionalzones",
3993                 FT_UINT32, BASE_DEC, NULL, 0x0000000F,
3994                 NULL, HFILL
3995                 }},
3996
3997                 /* GVCP_SC_ZONE_DIRECTION(0), 1, 2, 3 */
3998
3999                 {& hf_gvcp_sc_zone0_direction_v2_0,
4000                 { "Zone 0 Direction", "gvcp.bootstrap.sczdx.zone0direction",
4001                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x80000000,
4002                 NULL, HFILL
4003                 }},
4004
4005                 {& hf_gvcp_sc_zone1_direction_v2_0,
4006                 { "Zone 1 Direction", "gvcp.bootstrap.sczdx.zone1direction",
4007                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x40000000,
4008                 NULL, HFILL
4009                 }},
4010
4011                 {& hf_gvcp_sc_zone2_direction_v2_0,
4012                 { "Zone 2 Direction", "gvcp.bootstrap.sczdx.zone2direction",
4013                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x20000000,
4014                 NULL, HFILL
4015                 }},
4016
4017                 {& hf_gvcp_sc_zone3_direction_v2_0,
4018                 { "Zone 3 Direction", "gvcp.bootstrap.sczdx.zone3direction",
4019                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x10000000,
4020                 NULL, HFILL
4021                 }},
4022
4023                 {& hf_gvcp_sc_zone4_direction_v2_0,
4024                 { "Zone 4 Direction", "gvcp.bootstrap.sczdx.zone4direction",
4025                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x08000000,
4026                 NULL, HFILL
4027                 }},
4028
4029                 {& hf_gvcp_sc_zone5_direction_v2_0,
4030                 { "Zone 5 Direction", "gvcp.bootstrap.sczdx.zone5direction",
4031                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x04000000,
4032                 NULL, HFILL
4033                 }},
4034
4035                 {& hf_gvcp_sc_zone6_direction_v2_0,
4036                 { "Zone 6 Direction", "gvcp.bootstrap.sczdx.zone6direction",
4037                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x02000000,
4038                 NULL, HFILL
4039                 }},
4040
4041                 {& hf_gvcp_sc_zone7_direction_v2_0,
4042                 { "Zone 7 Direction", "gvcp.bootstrap.sczdx.zone7direction",
4043                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x01000000,
4044                 NULL, HFILL
4045                 }},
4046
4047                 {& hf_gvcp_sc_zone8_direction_v2_0,
4048                 { "Zone 8 Direction", "gvcp.bootstrap.sczdx.zone8direction",
4049                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00800000,
4050                 NULL, HFILL
4051                 }},
4052
4053                 {& hf_gvcp_sc_zone9_direction_v2_0,
4054                 { "Zone 9 Direction", "gvcp.bootstrap.sczdx.zone9direction",
4055                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00400000,
4056                 NULL, HFILL
4057                 }},
4058
4059                 {& hf_gvcp_sc_zone10_direction_v2_0,
4060                 { "Zone 10 Direction", "gvcp.bootstrap.sczdx.zone10direction",
4061                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00200000,
4062                 NULL, HFILL
4063                 }},
4064
4065                 {& hf_gvcp_sc_zone11_direction_v2_0,
4066                 { "Zone 11 Direction", "gvcp.bootstrap.sczdx.zone1direction",
4067                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00100000,
4068                 NULL, HFILL
4069                 }},
4070
4071                 {& hf_gvcp_sc_zone12_direction_v2_0,
4072                 { "Zone 12 Direction", "gvcp.bootstrap.sczdx.zone12direction",
4073                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00080000,
4074                 NULL, HFILL
4075                 }},
4076
4077                 {& hf_gvcp_sc_zone13_direction_v2_0,
4078                 { "Zone 13 Direction", "gvcp.bootstrap.sczdx.zone13direction",
4079                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00040000,
4080                 NULL, HFILL
4081                 }},
4082
4083                 {& hf_gvcp_sc_zone14_direction_v2_0,
4084                 { "Zone 14 Direction", "gvcp.bootstrap.sczdx.zone14direction",
4085                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00020000,
4086                 NULL, HFILL
4087                 }},
4088
4089                 {& hf_gvcp_sc_zone15_direction_v2_0,
4090                 { "Zone 15 Direction", "gvcp.bootstrap.sczdx.zone15direction",
4091                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00010000,
4092                 NULL, HFILL
4093                 }},
4094
4095                 {& hf_gvcp_sc_zone16_direction_v2_0,
4096                 { "Zone 16 Direction", "gvcp.bootstrap.sczdx.zone16direction",
4097                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00008000,
4098                 NULL, HFILL
4099                 }},
4100
4101                 {& hf_gvcp_sc_zone17_direction_v2_0,
4102                 { "Zone 17 Direction", "gvcp.bootstrap.sczdx.zone17direction",
4103                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00004000,
4104                 NULL, HFILL
4105                 }},
4106
4107                 {& hf_gvcp_sc_zone18_direction_v2_0,
4108                 { "Zone 18 Direction", "gvcp.bootstrap.sczdx.zone18direction",
4109                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00002000,
4110                 NULL, HFILL
4111                 }},
4112
4113                 {& hf_gvcp_sc_zone19_direction_v2_0,
4114                 { "Zone 19 Direction", "gvcp.bootstrap.sczdx.zone19direction",
4115                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00001000,
4116                 NULL, HFILL
4117                 }},
4118
4119                 {& hf_gvcp_sc_zone20_direction_v2_0,
4120                 { "Zone 20 Direction", "gvcp.bootstrap.sczdx.zone20direction",
4121                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000800,
4122                 NULL, HFILL
4123                 }},
4124
4125                 {& hf_gvcp_sc_zone21_direction_v2_0,
4126                 { "Zone 21 Direction", "gvcp.bootstrap.sczdx.zone21direction",
4127                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000400,
4128                 NULL, HFILL
4129                 }},
4130
4131                 {& hf_gvcp_sc_zone22_direction_v2_0,
4132                 { "Zone 22 Direction", "gvcp.bootstrap.sczdx.zone22direction",
4133                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000200,
4134                 NULL, HFILL
4135                 }},
4136
4137                 {& hf_gvcp_sc_zone23_direction_v2_0,
4138                 { "Zone 23 Direction", "gvcp.bootstrap.sczdx.zone23direction",
4139                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000100,
4140                 NULL, HFILL
4141                 }},
4142
4143                 {& hf_gvcp_sc_zone24_direction_v2_0,
4144                 { "Zone 24 Direction", "gvcp.bootstrap.sczdx.zone24direction",
4145                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000080,
4146                 NULL, HFILL
4147                 }},
4148
4149                 {& hf_gvcp_sc_zone25_direction_v2_0,
4150                 { "Zone 25 Direction", "gvcp.bootstrap.sczdx.zone25direction",
4151                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000040,
4152                 NULL, HFILL
4153                 }},
4154
4155                 {& hf_gvcp_sc_zone26_direction_v2_0,
4156                 { "Zone 26 Direction", "gvcp.bootstrap.sczdx.zone26direction",
4157                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000020,
4158                 NULL, HFILL
4159                 }},
4160
4161                 {& hf_gvcp_sc_zone27_direction_v2_0,
4162                 { "Zone 27 Direction", "gvcp.bootstrap.sczdx.zone27direction",
4163                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000010,
4164                 NULL, HFILL
4165                 }},
4166
4167                 {& hf_gvcp_sc_zone28_direction_v2_0,
4168                 { "Zone 28 Direction", "gvcp.bootstrap.sczdx.zone28direction",
4169                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000008,
4170                 NULL, HFILL
4171                 }},
4172
4173                 {& hf_gvcp_sc_zone29_direction_v2_0,
4174                 { "Zone 29 Direction", "gvcp.bootstrap.sczdx.zone29direction",
4175                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000004,
4176                 NULL, HFILL
4177                 }},
4178
4179                 {& hf_gvcp_sc_zone30_direction_v2_0,
4180                 { "Zone 30 Direction", "gvcp.bootstrap.sczdx.zone30direction",
4181                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000002,
4182                 NULL, HFILL
4183                 }},
4184
4185                 {& hf_gvcp_sc_zone31_direction_v2_0,
4186                 { "Zone 31 Direction", "gvcp.bootstrap.sczdx.zone31direction",
4187                 FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000001,
4188                 NULL, HFILL
4189                 }},
4190
4191                 /* GVCP_SC_MAX_PACKET_COUNT(0), 1, 2, 3 */
4192
4193                 { &hf_gvcp_sc_max_packet_count_v2_2,
4194                 { "Max. Packet Count", "gvcp.bootstrap.scmpcx.maxpacketcount",
4195                 FT_UINT32, BASE_DEC, NULL, 0x0,
4196                 NULL, HFILL
4197                 } },
4198
4199                 /* GVCP_SC_MAX_BLOCK_SIZE_HIGH(0), 1, 2, 3 */
4200
4201                 { &hf_gvcp_sc_max_block_size_high_v2_2,
4202                 { "Max. Block Size (High)", "gvcp.bootstrap.maxblocksizehigh",
4203                 FT_UINT32, BASE_DEC_HEX, NULL, 0x0,
4204                 NULL, HFILL
4205                 } },
4206
4207                 /* GVCP_SC_MAX_BLOCK_SIZE_LOW(0), 1, 2, 3 */
4208
4209                 { &hf_gvcp_sc_max_block_size_low_v2_2,
4210                 { "Max. Payload Size (Low)", "gvcp.bootstrap.maxblocksizelow",
4211                 FT_UINT32, BASE_DEC_HEX, NULL, 0x0,
4212                 NULL, HFILL
4213                 } },
4214
4215                 /* GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS(0), 1, 2, 3 */
4216
4217                 { &hf_gvcp_sc_extended_registers_address_v2_2,
4218                 { "Stream Channel Extended Bootstrap Address", "gvcp.bootstrap.extendedbootstrapaddress",
4219                 FT_UINT32, BASE_HEX, NULL, 0x0,
4220                 NULL, HFILL
4221                 } },
4222
4223                 /* GVCP_SC_GENDC_DESCRIPTOR_ADDRESS(0), 1, 2, 3 */
4224
4225                 { &hf_gvcp_sc_gendc_descriptor_address_v2_2,
4226                 { "Stream Channel GenDC Descriptor Address", "gvcp.bootstrap.gendc.descriptoraddress",
4227                 FT_UINT32, BASE_HEX, NULL, 0x0,
4228                 NULL, HFILL
4229                 } },
4230
4231                 /* GVCP_SC_GENDC_DESCRIPTOR_SIZE(0), 1, 2, 3 */
4232
4233                 { &hf_gvcp_sc_gendc_descriptor_size_v2_2,
4234                 { "Stream Channel GenDC Descriptor Size", "gvcp.bootstrap.gedc.descriptorsize",
4235                 FT_UINT32, BASE_HEX, NULL, 0x0,
4236                 NULL, HFILL
4237                 } },
4238
4239                 /* GVCP_SC_GENDC_FLOW_MAPPING_TABLE_ADDRESS(0), 1, 2, 3 */
4240
4241                 { &hf_gvcp_sc_gendc_flow_mapping_table_address_v2_2,
4242                 { "Stream Channel GenDC Flow Mapping Table Address", "gvcp.bootstrap.gendc.flowmappingtablesize",
4243                 FT_UINT32, BASE_HEX, NULL, 0x0,
4244                 NULL, HFILL
4245                 } },
4246
4247                 /* GVCP_SC_GENDC_FLOW_MAPPING_TABLE_SIZE(0), 1, 2, 3 */
4248
4249                 { &hf_gvcp_sc_gendc_flow_mapping_table_size_v2_2,
4250                 { "Stream Channel GenDC Flow Mapping Table Size", "gvcp.bootstrap.gendc.flowmappingtablesize",
4251                 FT_UINT32, BASE_HEX, NULL, 0x0,
4252                 NULL, HFILL
4253                 } },
4254
4255                 /* GVCP_ACTION_GROUP_KEY(0), 1, 2, 3, 4, 5, 6, 7, 8, 9 */
4256
4257                 {& hf_gvcp_action_group_key,
4258                 { "Action Group Key", "gvcp.bootstrap.actiongroupkey",
4259                 FT_UINT32, BASE_DEC, NULL, 0x0,
4260                 NULL, HFILL
4261                 }},
4262
4263                 /* GVCP_ACTION_GROUP_MASK(0), 1, 2, 3, 4, 5, 6, 7, 8, 9 */
4264
4265                 {& hf_gvcp_action_group_mask,
4266                 { "Action Group Mask", "gvcp.bootstrap.actiongroupmask",
4267                 FT_UINT32, BASE_HEX, NULL, 0x0,
4268                 NULL, HFILL
4269                 }},
4270 /*
4271                 {& hf_gvcp_latency,
4272                 { "Latency Value (in us)", "gvcp.bootstrap.latency",
4273                 FT_UINT32, BASE_DEC, NULL, 0x0,
4274                 NULL, HFILL
4275                 }},
4276 */
4277                 {& hf_gvcp_custom_register_addr,
4278                 { "Custom Register Address", "gvcp.bootstrap.custom.register.write",
4279                 FT_UINT32, BASE_HEX, NULL, 0x0,
4280                 NULL, HFILL
4281                 }},
4282
4283                 {& hf_gvcp_custom_memory_addr,
4284                 { "Custom Memory Address", "gvcp.bootstrap.custom.register.write",
4285                 FT_UINT32, BASE_HEX, NULL, 0x0,
4286                 NULL, HFILL
4287                 }},
4288
4289                 /* Request/Response tracking */
4290                 {& hf_gvcp_response_in,
4291                 { "Response In", "gvcp.response_in",
4292                 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
4293                 "The response to this GVCP request is in this frame", HFILL
4294                 }},
4295
4296                 {& hf_gvcp_response_to,
4297                 { "Request In", "gvcp.response_to",
4298                 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
4299                 "This is a response to the GVCP request in this frame", HFILL
4300                 }},
4301
4302                 /* Generated from convert_proto_tree_add_text.pl */
4303                 { &hf_gvcp_reserved_bit, { "Reserved Bit", "gvcp.reserved_bit", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4304                 { &hf_gvcp_manifest_table, { "Manifest Table", "gvcp.manifest_table", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4305                 { &hf_gvcp_custom_register_value, { "Value", "gvcp.bootstrap.custom.register.value", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4306                 { &hf_gvcp_custom_read_register_addr, { "Custom Register Address", "gvcp.bootstrap.custom.register.read", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4307                 { &hf_gvcp_custom_read_register_value, { "Custom Register Value", "gvcp.bootstrap.custom.register.read_value", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4308                 { &hf_gvcp_readmemcmd_data_read, { "Data read", "gvcp.cmd.readmem.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4309         };
4310
4311         static gint *ett[] = {
4312                 &ett_gvcp,
4313                 &ett_gvcp_cmd,
4314                 &ett_gvcp_flags,
4315                 &ett_gvcp_ack,
4316                 &ett_gvcp_payload_cmd,
4317                 &ett_gvcp_payload_ack,
4318                 &ett_gvcp_payload_ack_subtree,
4319                 &ett_gvcp_payload_cmd_subtree,
4320                 &ett_gvcp_bootstrap_fields
4321         };
4322
4323         proto_gvcp = proto_register_protocol("GigE Vision Control Protocol", "GVCP", "gvcp");
4324
4325         gvcp_handle = register_dissector("gvcp", dissect_gvcp, proto_gvcp);
4326
4327         proto_register_field_array(proto_gvcp, hf, array_length(hf));
4328         proto_register_subtree_array(ett, array_length(ett));
4329 }
4330
4331 /* The registration hand-off routing */
4332
4333 void proto_reg_handoff_gvcp(void)
4334 {
4335         dissector_add_uint("udp.port", global_gvcp_port, gvcp_handle);
4336         gvsp_handle = find_dissector("gvsp");
4337 }
4338
4339 /*
4340  * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
4341  *
4342  * Local variables:
4343  * c-basic-offset: 8
4344  * tab-width: 8
4345  * indent-tabs-mode: t
4346  * End:
4347  *
4348  * vi: set shiftwidth=8 tabstop=8 noexpandtab:
4349  * :indentSize=8:tabSize=8:noTabs=false:
4350  */