Coverage Report

Created: 2026-11-12 07:01

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-gvsp.c
Line
Count
Source
1
/* packet-gvsp.c
2
 * Routines for AIA GigE Vision (TM) Streaming 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. GVSP stands for GigE Vision (TM) Streaming
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
#include <epan/packet.h>
18
#include <epan/tfs.h>
19
#include <epan/conversation.h>
20
#include <epan/prefs.h>
21
#include <epan/expert.h>
22
23
void proto_register_gvsp(void);
24
void proto_reg_handoff_gvsp(void);
25
26
/*
27
 * For all GenICam standards, including GenDC 1.0 and 1.1:
28
 *
29
 *    https://www.emva.org/standards-technology/genicam/genicam-downloads/
30
 */
31
32
0
#define GVSP_MIN_PACKET_SIZE         8
33
0
#define GVSP_V2_MIN_PACKET_SIZE     20
34
0
#define GVSP_EXTENDED_ID_BIT      0x80
35
#define GVSP_EXTENDED_CHUNK_BIT 0x4000
36
37
0
#define GVSP_SIZE_OF_PART_INFO_LEADER  ( 48 )
38
0
#define GVSP_SIZE_OF_PART_INFO_TRAILER ( 16 )
39
40
/*
41
  Payload types
42
 */
43
44
0
#define GVSP_PAYLOAD_IMAGE                 ( 0x0001 )
45
0
#define GVSP_PAYLOAD_RAWDATA               ( 0x0002 )
46
0
#define GVSP_PAYLOAD_FILE                  ( 0x0003 )
47
0
#define GVSP_PAYLOAD_CHUNKDATA             ( 0x0004 )
48
0
#define GVSP_PAYLOAD_EXTENDEDCHUNKDATA     ( 0x0005 ) /* Deprecated with GEV 2.0 */
49
0
#define GVSP_PAYLOAD_JPEG                  ( 0x0006 ) /* GEV 2.0 */
50
0
#define GVSP_PAYLOAD_JPEG2000              ( 0x0007 ) /* GEV 2.0 */
51
0
#define GVSP_PAYLOAD_H264                  ( 0x0008 ) /* GEV 2.0 */
52
0
#define GVSP_PAYLOAD_MULTIZONEIMAGE        ( 0x0009 ) /* GEV 2.0, deprecated with GEV 2.2 */
53
0
#define GVSP_PAYLOAD_MULTIPART             ( 0x000A ) /* GEV 2.1 */
54
0
#define GVSP_PAYLOAD_GENDC                 ( 0x000B ) /* GEV 2.2 */
55
#define GVSP_PAYLOAD_DEVICE_SPECIFIC_START ( 0x8000 )
56
57
/*
58
  GenDC data flag masks (GEV 2.2)
59
 */
60
61
16
#define GENDC_DESCRIPTOR_FLAG       ( 0xC0 )
62
16
#define GENDC_DESCRIPTOR_START_FLAG ( 0x20 )
63
16
#define GENDC_DESCRIPTOR_END_FLAG   ( 0x10 )
64
65
/*
66
  GenDC header types(GEV 2.2)
67
 */
68
69
#define GENDC_HEADER_TYPE_CONTAINER         ( 0x1000 )
70
#define GENDC_HEADER_TYPE_COMPONENT_HEADER  ( 0x2000 )
71
0
#define GENDC_HEADER_TYPE_PART_CHUNK        ( 0x4000 )
72
0
#define GENDC_HEADER_TYPE_PART_XML          ( 0x4001 ) /* GenDC 1.1 */
73
0
#define GENDC_HEADER_TYPE_PART_1D           ( 0x4100 )
74
0
#define GENDC_HEADER_TYPE_PART_2D           ( 0x4200 )
75
0
#define GENDC_HEADER_TYPE_PART_2D_JPEG      ( 0x4201 )
76
0
#define GENDC_HEADER_TYPE_PART_2D_JPEG2000  ( 0x4202 )
77
0
#define GENDC_HEADER_TYPE_PART_2D_H264      ( 0x4203 )
78
79
80
/*
81
  GenDC component types (GEV 2.2)
82
 */
83
84
#define GENDC_COMPONENT_TYPEID_UNDEFINED      ( 0x0000 )
85
#define GENDC_COMPONENT_TYPEID_INTENSITY      ( 0x0001 )
86
#define GENDC_COMPONENT_TYPEID_INFRARED       ( 0x0002 )
87
#define GENDC_COMPONENT_TYPEID_ULTRAVIOLET    ( 0x0003 )
88
#define GENDC_COMPONENT_TYPEID_RANGE          ( 0x0004 )
89
#define GENDC_COMPONENT_TYPEID_REFLECTANCE    ( 0x0005 )
90
#define GENDC_COMPONENT_TYPEID_CONFIDENCE     ( 0x0006 )
91
#define GENDC_COMPONENT_TYPEID_SCATTER        ( 0x0007 )
92
#define GENDC_COMPONENT_TYPEID_DISPARITY      ( 0x0008 )
93
#define GENDC_COMPONENT_TYPEID_MULTISPECTRAL  ( 0x0009 )
94
#define GENDC_COMPONENT_TYPEID_METADATA       ( 0x8001 )
95
#define GENDC_COMPONENT_TYPEID_RESERVED       ( 0xFFFF )
96
97
/*
98
   GVSP packet types
99
 */
100
101
0
#define GVSP_PACKET_LEADER            ( 1 )
102
0
#define GVSP_PACKET_TRAILER           ( 2 )
103
0
#define GVSP_PACKET_PAYLOAD           ( 3 )
104
0
#define GVSP_PACKET_ALLIN             ( 4 )
105
0
#define GVSP_PACKET_PAYLOAD_H264      ( 5 )
106
0
#define GVSP_PACKET_PAYLOAD_MULTIZONE ( 6 )
107
0
#define GVSP_PACKET_PAYLOAD_MULTIPART ( 7 ) /* GEV 2.1 */
108
0
#define GVSP_PACKET_PAYLOAD_GENDC     ( 8 ) /* GEV 2.2 */
109
0
#define GVSP_PACKET_PAYLOAD_LAST      ( 8 )
110
111
/*
112
   GVSP Multi-Part data types (GEV 2.1)
113
 */
114
115
0
#define GVSP_MULTIPART_DATA_TYPE_2DIMAGE            ( 0x0001 )
116
0
#define GVSP_MULTIPART_DATA_TYPE_2DPLANEBIPLANAR    ( 0x0002 )
117
0
#define GVSP_MULTIPART_DATA_TYPE_2DPLANETRIPLANAR   ( 0x0003 )
118
0
#define GVSP_MULTIPART_DATA_TYPE_2DPLANEQUADPLANAR  ( 0x0004 )
119
0
#define GVSP_MULTIPART_DATA_TYPE_3DIMAGE            ( 0x0005 )
120
0
#define GVSP_MULTIPART_DATA_TYPE_3DPLANEBIPLANAR    ( 0x0006 )
121
0
#define GVSP_MULTIPART_DATA_TYPE_3DPLANETRIPLANAR   ( 0x0007 )
122
0
#define GVSP_MULTIPART_DATA_TYPE_3DPLANEQUADPLANAR  ( 0x0008 )
123
0
#define GVSP_MULTIPART_DATA_TYPE_CONFIDENCEMAP      ( 0x0009 )
124
#define GVSP_MULTIPART_DATA_TYPE_CHUNKDATA          ( 0x000A )
125
0
#define GVSP_MULTIPART_DATA_TYPE_JPEG               ( 0x000B )
126
0
#define GVSP_MULTIPART_DATA_TYPE_JPEG2000           ( 0x000C )
127
#define GVSP_MULTIPART_DATA_TYPE_DEVICESPECIFIC     ( 0x8000 )
128
129
/*
130
   GVSP statuses
131
 */
132
133
0
#define GEV_STATUS_SUCCESS                             ( 0x0000 )
134
0
#define GEV_STATUS_PACKET_RESEND                       ( 0x0100 )
135
0
#define GEV_STATUS_NOT_IMPLEMENTED                     ( 0x8001 )
136
#define GEV_STATUS_INVALID_PARAMETER                   ( 0x8002 )
137
#define GEV_STATUS_INVALID_ADDRESS                     ( 0x8003 )
138
#define GEV_STATUS_WRITE_PROTECT                       ( 0x8004 )
139
#define GEV_STATUS_BAD_ALIGNMENT                       ( 0x8005 )
140
#define GEV_STATUS_ACCESS_DENIED                       ( 0x8006 )
141
#define GEV_STATUS_BUSY                                ( 0x8007 )
142
#define GEV_STATUS_LOCAL_PROBLEM                       ( 0x8008 ) /* deprecated */
143
#define GEV_STATUS_MSG_MISMATCH                        ( 0x8009 ) /* deprecated */
144
#define GEV_STATUS_INVALID_PROTOCOL                    ( 0x800A ) /* deprecated */
145
#define GEV_STATUS_NO_MSG                              ( 0x800B ) /* deprecated */
146
#define GEV_STATUS_PACKET_UNAVAILABLE                  ( 0x800C )
147
#define GEV_STATUS_DATA_OVERRUN                        ( 0x800D )
148
#define GEV_STATUS_INVALID_HEADER                      ( 0x800E )
149
#define GEV_STATUS_WRONG_CONFIG                        ( 0x800F ) /* deprecated */
150
#define GEV_STATUS_PACKET_NOT_YET_AVAILABLE            ( 0x8010 )
151
#define GEV_STATUS_PACKET_AND_PREV_REMOVED_FROM_MEMORY ( 0x8011 )
152
#define GEV_STATUS_PACKET_REMOVED_FROM_MEMORY          ( 0x8012 )
153
#define GEV_STATUS_NO_REF_TIME                         ( 0x8013 ) /* GEV 2.0 */
154
#define GEV_STATUS_PACKET_TEMPORARILY_UNAVAILABLE      ( 0x8014 ) /* GEV 2.0 */
155
#define GEV_STATUS_OVERFLOW                            ( 0x8015 ) /* GEV 2.0 */
156
#define GEV_STATUS_ACTION_LATE                         ( 0x8016 ) /* GEV 2.0 */
157
#define GEV_STATUS_LEADER_TRAILER_OVERFLOW             ( 0x8017 ) /* GEV 2.1 */
158
0
#define GEV_STATUS_LAST                                ( 0x8017 )
159
0
#define GEV_STATUS_ERROR                               ( 0x8FFF )
160
161
/*
162
   Pixel type color
163
 */
164
165
#define GVSP_PIX_MONO             ( 0x01000000 )
166
#define GVSP_PIX_COLOR            ( 0x02000000 )
167
#define GVSP_PIX_CUSTOM           ( 0x80000000 )
168
169
/*
170
   Pixel types
171
 */
172
#define GVSP_PIX_MONO1P 0x01010037
173
#define GVSP_PIX_MONO2P 0x01020038
174
#define GVSP_PIX_MONO4P 0x01040039
175
#define GVSP_PIX_MONO8 0x01080001
176
#define GVSP_PIX_MONO8S 0x01080002
177
#define GVSP_PIX_MONO10 0x01100003
178
#define GVSP_PIX_MONO10P 0x010A0046
179
#define GVSP_PIX_MONO12 0x01100005
180
#define GVSP_PIX_MONO12P 0x010C0047
181
#define GVSP_PIX_MONO14 0x01100025
182
#define GVSP_PIX_MONO14P 0x010E0104
183
#define GVSP_PIX_MONO16 0x01100007
184
#define GVSP_PIX_MONO32 0x01200111
185
#define GVSP_PIX_BAYERBG4P 0x01040110
186
#define GVSP_PIX_BAYERBG8 0x0108000B
187
#define GVSP_PIX_BAYERBG10 0x0110000F
188
#define GVSP_PIX_BAYERBG10P 0x010A0052
189
#define GVSP_PIX_BAYERBG12 0x01100013
190
#define GVSP_PIX_BAYERBG12P 0x010C0053
191
#define GVSP_PIX_BAYERBG14 0x0110010C
192
#define GVSP_PIX_BAYERBG14P 0x010E0108
193
#define GVSP_PIX_BAYERBG16 0x01100031
194
#define GVSP_PIX_BAYERGB4P 0x0104010F
195
#define GVSP_PIX_BAYERGB8 0x0108000A
196
#define GVSP_PIX_BAYERGB10 0x0110000E
197
#define GVSP_PIX_BAYERGB10P 0x010A0054
198
#define GVSP_PIX_BAYERGB12 0x01100012
199
#define GVSP_PIX_BAYERGB12P 0x010C0055
200
#define GVSP_PIX_BAYERGB14 0x0110010B
201
#define GVSP_PIX_BAYERGB14P 0x010E0107
202
#define GVSP_PIX_BAYERGB16 0x01100030
203
#define GVSP_PIX_BAYERGR4P 0x0104010D
204
#define GVSP_PIX_BAYERGR8 0x01080008
205
#define GVSP_PIX_BAYERGR10 0x0110000C
206
#define GVSP_PIX_BAYERGR10P 0x010A0056
207
#define GVSP_PIX_BAYERGR12 0x01100010
208
#define GVSP_PIX_BAYERGR12P 0x010C0057
209
#define GVSP_PIX_BAYERGR14 0x01100109
210
#define GVSP_PIX_BAYERGR14P 0x010E0105
211
#define GVSP_PIX_BAYERGR16 0x0110002E
212
#define GVSP_PIX_BAYERRG4P 0x0104010E
213
#define GVSP_PIX_BAYERRG8 0x01080009
214
#define GVSP_PIX_BAYERRG10 0x0110000D
215
#define GVSP_PIX_BAYERRG10P 0x010A0058
216
#define GVSP_PIX_BAYERRG12 0x01100011
217
#define GVSP_PIX_BAYERRG12P 0x010C0059
218
#define GVSP_PIX_BAYERRG14 0x0110010A
219
#define GVSP_PIX_BAYERRG14P 0x010E0106
220
#define GVSP_PIX_BAYERRG16 0x0110002F
221
#define GVSP_PIX_RGBA8 0x02200016
222
#define GVSP_PIX_RGBA10 0x0240005F
223
#define GVSP_PIX_RGBA10P 0x02280060
224
#define GVSP_PIX_RGBA12 0x02400061
225
#define GVSP_PIX_RGBA12P 0x02300062
226
#define GVSP_PIX_RGBA14 0x02400063
227
#define GVSP_PIX_RGBA16 0x02400064
228
#define GVSP_PIX_RGB8 0x02180014
229
#define GVSP_PIX_RGB8_PLANAR 0x02180021
230
#define GVSP_PIX_RGB10 0x02300018
231
#define GVSP_PIX_RGB10_PLANAR 0x02300022
232
#define GVSP_PIX_RGB10P 0x021E005C
233
#define GVSP_PIX_RGB10P32 0x0220001D
234
#define GVSP_PIX_RGB12 0x0230001A
235
#define GVSP_PIX_RGB12_PLANAR 0x02300023
236
#define GVSP_PIX_RGB12P 0x0224005D
237
#define GVSP_PIX_RGB14 0x0230005E
238
#define GVSP_PIX_RGB16 0x02300033
239
#define GVSP_PIX_RGB16_PLANAR 0x02300024
240
#define GVSP_PIX_RGB565P 0x02100035
241
#define GVSP_PIX_BGRA8 0x02200017
242
#define GVSP_PIX_BGRA10 0x0240004C
243
#define GVSP_PIX_BGRA10P 0x0228004D
244
#define GVSP_PIX_BGRA12 0x0240004E
245
#define GVSP_PIX_BGRA12P 0x0230004F
246
#define GVSP_PIX_BGRA14 0x02400050
247
#define GVSP_PIX_BGRA16 0x02400051
248
#define GVSP_PIX_BGR8 0x02180015
249
#define GVSP_PIX_BGR10 0x02300019
250
#define GVSP_PIX_BGR10P 0x021E0048
251
#define GVSP_PIX_BGR12 0x0230001B
252
#define GVSP_PIX_BGR12P 0x02240049
253
#define GVSP_PIX_BGR14 0x0230004A
254
#define GVSP_PIX_BGR16 0x0230004B
255
#define GVSP_PIX_BGR565P 0x02100036
256
#define GVSP_PIX_R8 0x010800C9
257
#define GVSP_PIX_R10 0x01100120
258
#define GVSP_PIX_R10_DEPRECATED 0x010A00CA
259
#define GVSP_PIX_R12 0x01100121
260
#define GVSP_PIX_R12_DEPRECATED 0x010C00CB
261
#define GVSP_PIX_R16 0x011000CC
262
#define GVSP_PIX_G8 0x010800CD
263
#define GVSP_PIX_G10 0x01100122
264
#define GVSP_PIX_G10_DEPRECATED 0x010A00CE
265
#define GVSP_PIX_G12 0x01100123
266
#define GVSP_PIX_G12_DEPRECATED 0x010C00CF
267
#define GVSP_PIX_G16 0x011000D0
268
#define GVSP_PIX_B8 0x010800D1
269
#define GVSP_PIX_B10 0x01100124
270
#define GVSP_PIX_B10_DEPRECATED 0x010A00D2
271
#define GVSP_PIX_B12 0x01100125
272
#define GVSP_PIX_B12_DEPRECATED 0x010C00D3
273
#define GVSP_PIX_B16 0x011000D4
274
#define GVSP_PIX_COORD3D_ABC8 0x021800B2
275
#define GVSP_PIX_COORD3D_ABC8_PLANAR 0x021800B3
276
#define GVSP_PIX_COORD3D_ABC10P 0x021E00DB
277
#define GVSP_PIX_COORD3D_ABC10P_PLANAR 0x021E00DC
278
#define GVSP_PIX_COORD3D_ABC12P 0x022400DE
279
#define GVSP_PIX_COORD3D_ABC12P_PLANAR 0x022400DF
280
#define GVSP_PIX_COORD3D_ABC16 0x023000B9
281
#define GVSP_PIX_COORD3D_ABC16_PLANAR 0x023000BA
282
#define GVSP_PIX_COORD3D_ABC32F 0x026000C0
283
#define GVSP_PIX_COORD3D_ABC32F_PLANAR 0x026000C1
284
#define GVSP_PIX_COORD3D_AC8 0x021000B4
285
#define GVSP_PIX_COORD3D_AC8_PLANAR 0x021000B5
286
#define GVSP_PIX_COORD3D_AC10P 0x021400F0
287
#define GVSP_PIX_COORD3D_AC10P_PLANAR 0x021400F1
288
#define GVSP_PIX_COORD3D_AC12P 0x021800F2
289
#define GVSP_PIX_COORD3D_AC12P_PLANAR 0x021800F3
290
#define GVSP_PIX_COORD3D_AC16 0x022000BB
291
#define GVSP_PIX_COORD3D_AC16_PLANAR 0x022000BC
292
#define GVSP_PIX_COORD3D_AC32F 0x024000C2
293
#define GVSP_PIX_COORD3D_AC32F_PLANAR 0x024000C3
294
#define GVSP_PIX_COORD3D_A8 0x010800AF
295
#define GVSP_PIX_COORD3D_A10P 0x010A00D5
296
#define GVSP_PIX_COORD3D_A12P 0x010C00D8
297
#define GVSP_PIX_COORD3D_A16 0x011000B6
298
#define GVSP_PIX_COORD3D_A32F 0x012000BD
299
#define GVSP_PIX_COORD3D_B8 0x010800B0
300
#define GVSP_PIX_COORD3D_B10P 0x010A00D6
301
#define GVSP_PIX_COORD3D_B12P 0x010C00D9
302
#define GVSP_PIX_COORD3D_B16 0x011000B7
303
#define GVSP_PIX_COORD3D_B32F 0x012000BE
304
#define GVSP_PIX_COORD3D_C8 0x010800B1
305
#define GVSP_PIX_COORD3D_C10P 0x010A00D7
306
#define GVSP_PIX_COORD3D_C12P 0x010C00DA
307
#define GVSP_PIX_COORD3D_C16 0x011000B8
308
#define GVSP_PIX_COORD3D_C32F 0x012000BF
309
#define GVSP_PIX_CONFIDENCE1 0x010800C4
310
#define GVSP_PIX_CONFIDENCE1P 0x010100C5
311
#define GVSP_PIX_CONFIDENCE8 0x010800C6
312
#define GVSP_PIX_CONFIDENCE16 0x011000C7
313
#define GVSP_PIX_CONFIDENCE32F 0x012000C8
314
#define GVSP_PIX_BICOLORBGRG8 0x021000A6
315
#define GVSP_PIX_BICOLORBGRG10 0x022000A9
316
#define GVSP_PIX_BICOLORBGRG10P 0x021400AA
317
#define GVSP_PIX_BICOLORBGRG12 0x022000AD
318
#define GVSP_PIX_BICOLORBGRG12P 0x021800AE
319
#define GVSP_PIX_BICOLORRGBG8 0x021000A5
320
#define GVSP_PIX_BICOLORRGBG10 0x022000A7
321
#define GVSP_PIX_BICOLORRGBG10P 0x021400A8
322
#define GVSP_PIX_BICOLORRGBG12 0x022000AB
323
#define GVSP_PIX_BICOLORRGBG12P 0x021800AC
324
#define GVSP_PIX_DATA8 0x01080116
325
#define GVSP_PIX_DATA8S 0x01080117
326
#define GVSP_PIX_DATA16 0x01100118
327
#define GVSP_PIX_DATA16S 0x01100119
328
#define GVSP_PIX_DATA32 0x0120011A
329
#define GVSP_PIX_DATA32F 0x0120011C
330
#define GVSP_PIX_DATA32S 0x0120011B
331
#define GVSP_PIX_DATA64 0x0140011D
332
#define GVSP_PIX_DATA64F 0x0140011F
333
#define GVSP_PIX_DATA64S 0x0140011E
334
#define GVSP_PIX_SCF1WBWG8 0x01080067
335
#define GVSP_PIX_SCF1WBWG10 0x01100068
336
#define GVSP_PIX_SCF1WBWG10P 0x010A0069
337
#define GVSP_PIX_SCF1WBWG12 0x0110006A
338
#define GVSP_PIX_SCF1WBWG12P 0x010C006B
339
#define GVSP_PIX_SCF1WBWG14 0x0110006C
340
#define GVSP_PIX_SCF1WBWG16 0x0110006D
341
#define GVSP_PIX_SCF1WGWB8 0x0108006E
342
#define GVSP_PIX_SCF1WGWB10 0x0110006F
343
#define GVSP_PIX_SCF1WGWB10P 0x010A0070
344
#define GVSP_PIX_SCF1WGWB12 0x01100071
345
#define GVSP_PIX_SCF1WGWB12P 0x010C0072
346
#define GVSP_PIX_SCF1WGWB14 0x01100073
347
#define GVSP_PIX_SCF1WGWB16 0x01100074
348
#define GVSP_PIX_SCF1WGWR8 0x01080075
349
#define GVSP_PIX_SCF1WGWR10 0x01100076
350
#define GVSP_PIX_SCF1WGWR10P 0x010A0077
351
#define GVSP_PIX_SCF1WGWR12 0x01100078
352
#define GVSP_PIX_SCF1WGWR12P 0x010C0079
353
#define GVSP_PIX_SCF1WGWR14 0x0110007A
354
#define GVSP_PIX_SCF1WGWR16 0x0110007B
355
#define GVSP_PIX_SCF1WRWG8 0x0108007C
356
#define GVSP_PIX_SCF1WRWG10 0x0110007D
357
#define GVSP_PIX_SCF1WRWG10P 0x010A007E
358
#define GVSP_PIX_SCF1WRWG12 0x0110007F
359
#define GVSP_PIX_SCF1WRWG12P 0x010C0080
360
#define GVSP_PIX_SCF1WRWG14 0x01100081
361
#define GVSP_PIX_SCF1WRWG16 0x01100082
362
#define GVSP_PIX_YCBCR8 0x0218005B
363
#define GVSP_PIX_YCBCR8_CBYCR 0x0218003A
364
#define GVSP_PIX_YCBCR10_CBYCR 0x02300083
365
#define GVSP_PIX_YCBCR10P_CBYCR 0x021E0084
366
#define GVSP_PIX_YCBCR12_CBYCR 0x02300085
367
#define GVSP_PIX_YCBCR12P_CBYCR 0x02240086
368
#define GVSP_PIX_YCBCR411_8 0x020C005A
369
#define GVSP_PIX_YCBCR411_8_CBYYCRYY 0x020C003C
370
#define GVSP_PIX_YCBCR420_8_YY_CBCR_SEMIPLANAR 0x020C0112
371
#define GVSP_PIX_YCBCR420_8_YY_CRCB_SEMIPLANAR 0x020C0114
372
#define GVSP_PIX_YCBCR422_8 0x0210003B
373
#define GVSP_PIX_YCBCR422_8_CBYCRY 0x02100043
374
#define GVSP_PIX_YCBCR422_8_YY_CBCR_SEMIPLANAR 0x02100113
375
#define GVSP_PIX_YCBCR422_8_YY_CRCB_SEMIPLANAR 0x02100115
376
#define GVSP_PIX_YCBCR422_10 0x02200065
377
#define GVSP_PIX_YCBCR422_10_CBYCRY 0x02200099
378
#define GVSP_PIX_YCBCR422_10P 0x02140087
379
#define GVSP_PIX_YCBCR422_10P_CBYCRY 0x0214009A
380
#define GVSP_PIX_YCBCR422_12 0x02200066
381
#define GVSP_PIX_YCBCR422_12_CBYCRY 0x0220009B
382
#define GVSP_PIX_YCBCR422_12P 0x02180088
383
#define GVSP_PIX_YCBCR422_12P_CBYCRY 0x0218009C
384
#define GVSP_PIX_YCBCR601_8_CBYCR 0x0218003D
385
#define GVSP_PIX_YCBCR601_10_CBYCR 0x02300089
386
#define GVSP_PIX_YCBCR601_10P_CBYCR 0x021E008A
387
#define GVSP_PIX_YCBCR601_12_CBYCR 0x0230008B
388
#define GVSP_PIX_YCBCR601_12P_CBYCR 0x0224008C
389
#define GVSP_PIX_YCBCR601_411_8_CBYYCRYY 0x020C003F
390
#define GVSP_PIX_YCBCR601_422_8 0x0210003E
391
#define GVSP_PIX_YCBCR601_422_8_CBYCRY 0x02100044
392
#define GVSP_PIX_YCBCR601_422_10 0x0220008D
393
#define GVSP_PIX_YCBCR601_422_10_CBYCRY 0x0220009D
394
#define GVSP_PIX_YCBCR601_422_10P 0x0214008E
395
#define GVSP_PIX_YCBCR601_422_10P_CBYCRY 0x0214009E
396
#define GVSP_PIX_YCBCR601_422_12 0x0220008F
397
#define GVSP_PIX_YCBCR601_422_12_CBYCRY 0x0220009F
398
#define GVSP_PIX_YCBCR601_422_12P 0x02180090
399
#define GVSP_PIX_YCBCR601_422_12P_CBYCRY 0x021800A0
400
#define GVSP_PIX_YCBCR709_8_CBYCR 0x02180040
401
#define GVSP_PIX_YCBCR709_10_CBYCR 0x02300091
402
#define GVSP_PIX_YCBCR709_10P_CBYCR 0x021E0092
403
#define GVSP_PIX_YCBCR709_12_CBYCR 0x02300093
404
#define GVSP_PIX_YCBCR709_12P_CBYCR 0x02240094
405
#define GVSP_PIX_YCBCR709_411_8_CBYYCRYY 0x020C0042
406
#define GVSP_PIX_YCBCR709_422_8 0x02100041
407
#define GVSP_PIX_YCBCR709_422_8_CBYCRY 0x02100045
408
#define GVSP_PIX_YCBCR709_422_10 0x02200095
409
#define GVSP_PIX_YCBCR709_422_10_CBYCRY 0x022000A1
410
#define GVSP_PIX_YCBCR709_422_10P 0x02140096
411
#define GVSP_PIX_YCBCR709_422_10P_CBYCRY 0x021400A2
412
#define GVSP_PIX_YCBCR709_422_12 0x02200097
413
#define GVSP_PIX_YCBCR709_422_12_CBYCRY 0x022000A3
414
#define GVSP_PIX_YCBCR709_422_12P 0x02180098
415
#define GVSP_PIX_YCBCR709_422_12P_CBYCRY 0x021800A4
416
#define GVSP_PIX_YCBCR2020_8_CBYCR 0x021800F4
417
#define GVSP_PIX_YCBCR2020_10_CBYCR 0x023000F5
418
#define GVSP_PIX_YCBCR2020_10P_CBYCR 0x021E00F6
419
#define GVSP_PIX_YCBCR2020_12_CBYCR 0x023000F7
420
#define GVSP_PIX_YCBCR2020_12P_CBYCR 0x022400F8
421
#define GVSP_PIX_YCBCR2020_411_8_CBYYCRYY 0x020C00F9
422
#define GVSP_PIX_YCBCR2020_422_8 0x021000FA
423
#define GVSP_PIX_YCBCR2020_422_8_CBYCRY 0x021000FB
424
#define GVSP_PIX_YCBCR2020_422_10 0x022000FC
425
#define GVSP_PIX_YCBCR2020_422_10_CBYCRY 0x022000FD
426
#define GVSP_PIX_YCBCR2020_422_10P 0x021400FE
427
#define GVSP_PIX_YCBCR2020_422_10P_CBYCRY 0x021400FF
428
#define GVSP_PIX_YCBCR2020_422_12 0x02200100
429
#define GVSP_PIX_YCBCR2020_422_12_CBYCRY 0x02200101
430
#define GVSP_PIX_YCBCR2020_422_12P 0x02180102
431
#define GVSP_PIX_YCBCR2020_422_12P_CBYCRY 0x02180103
432
#define GVSP_PIX_YUV8_UYV 0x02180020
433
#define GVSP_PIX_YUV411_8_UYYVYY 0x020C001E
434
#define GVSP_PIX_YUV422_8 0x02100032
435
#define GVSP_PIX_YUV422_8_UYVY 0x0210001F
436
#define GVSP_PIX_MONO10PACKED 0x010C0004
437
#define GVSP_PIX_MONO12PACKED 0x010C0006
438
#define GVSP_PIX_BAYERBG10PACKED 0x010C0029
439
#define GVSP_PIX_BAYERBG12PACKED 0x010C002D
440
#define GVSP_PIX_BAYERGB10PACKED 0x010C0028
441
#define GVSP_PIX_BAYERGB12PACKED 0x010C002C
442
#define GVSP_PIX_BAYERGR10PACKED 0x010C0026
443
#define GVSP_PIX_BAYERGR12PACKED 0x010C002A
444
#define GVSP_PIX_BAYERRG10PACKED 0x010C0027
445
#define GVSP_PIX_BAYERRG12PACKED 0x010C002B
446
#define GVSP_PIX_RGB10V1PACKED 0x0220001C
447
#define GVSP_PIX_RGB12V1PACKED 0x02240034
448
449
450
/* Structure to hold GVSP packet information */
451
typedef struct _gvsp_packet_info
452
{
453
    int     chunk;
454
    uint8_t format;
455
    uint16_t status;
456
    uint16_t payloadtype;
457
    uint64_t blockid;
458
    uint32_t packetid;
459
    int     enhanced;
460
    int     flag_resendrangeerror;
461
    int     flag_previousblockdropped;
462
    int     flag_packetresend;
463
} gvsp_packet_info;
464
465
466
/*Define the gvsp proto */
467
static int proto_gvsp;
468
/*static int global_gvsp_port = 20202;*/
469
static dissector_handle_t gvsp_handle;
470
471
472
/* Define the tree for gvsp */
473
static int ett_gvsp;
474
static int ett_gvsp_flags;
475
static int ett_gvsp_header;
476
static int ett_gvsp_payload;
477
static int ett_gvsp_trailer;
478
static int ett_gvsp_pixelformat;
479
static int ett_gvsp_fieldinfo;
480
static int ett_gvsp_cs;
481
static int ett_gvsp_sc_zone_direction;
482
static int ett_gvsp_zoneinfo;
483
static int ett_gvsp_zoneinfo_multipart;
484
static int ett_gvsp_partinfo_leader;
485
static int ett_gvsp_partinfo_trailer;
486
static int ett_gvsp_gendc_leader_flags;
487
static int ett_gvsp_gendc_payload_data_flags;
488
static int ett_gvsp_gendc_payload_flow_flags;
489
static int ett_gvsp_gendc_container_descriptor;
490
static int ett_gvsp_gendc_container_header_flags;
491
static int ett_gvsp_gendc_container_header_variable_fields;
492
static int ett_gvsp_gendc_container_header_component_offsets;
493
static int ett_gvsp_gendc_component_header;
494
static int ett_gvsp_gendc_part_offsets;
495
static int ett_gvsp_gendc_part_header;
496
static int ett_gvsp_gendc_component_header_flags;
497
static int ett_gvsp_gendc_part_header_flags;
498
499
static const value_string statusnames[] = {
500
    { GEV_STATUS_SUCCESS,                             "GEV_STATUS_SUCCESS" },
501
    { GEV_STATUS_PACKET_RESEND,                       "GEV_STATUS_PACKET_RESEND" },
502
    { GEV_STATUS_NOT_IMPLEMENTED,                     "GEV_STATUS_NOT_IMPLEMENTED" },
503
    { GEV_STATUS_INVALID_PARAMETER,                   "GEV_STATUS_INVALID_PARAMETER" },
504
    { GEV_STATUS_INVALID_ADDRESS,                     "GEV_STATUS_INVALID_ADDRESS" },
505
    { GEV_STATUS_WRITE_PROTECT,                       "GEV_STATUS_WRITE_PROTECT" },
506
    { GEV_STATUS_BAD_ALIGNMENT,                       "GEV_STATUS_BAD_ALIGNMENT" },
507
    { GEV_STATUS_ACCESS_DENIED,                       "GEV_STATUS_ACCESS_DENIED" },
508
    { GEV_STATUS_BUSY,                                "GEV_STATUS_BUSY" },
509
    { GEV_STATUS_LOCAL_PROBLEM,                       "GEV_STATUS_LOCAL_PROBLEM (deprecated)" },
510
    { GEV_STATUS_MSG_MISMATCH,                        "GEV_STATUS_MSG_MISMATCH (deprecated)" },
511
    { GEV_STATUS_INVALID_PROTOCOL,                    "GEV_STATUS_INVALID_PROTOCOL (deprecated)" },
512
    { GEV_STATUS_NO_MSG,                              "GEV_STATUS_NO_MSG (deprecated)" },
513
    { GEV_STATUS_PACKET_UNAVAILABLE,                  "GEV_STATUS_PACKET_UNAVAILABLE" },
514
    { GEV_STATUS_DATA_OVERRUN,                        "GEV_STATUS_DATA_OVERRUN" },
515
    { GEV_STATUS_INVALID_HEADER,                      "GEV_STATUS_INVALID_HEADER" },
516
    { GEV_STATUS_WRONG_CONFIG,                        "GEV_STATUS_WRONG_CONFIG (deprecated)" },
517
    { GEV_STATUS_PACKET_NOT_YET_AVAILABLE,            "GEV_STATUS_PACKET_NOT_YET_AVAILABLE" },
518
    { GEV_STATUS_PACKET_AND_PREV_REMOVED_FROM_MEMORY, "GEV_STATUS_PACKET_AND_PREV_REMOVED_FROM_MEMORY" },
519
    { GEV_STATUS_PACKET_REMOVED_FROM_MEMORY,          "GEV_STATUS_PACKET_REMOVED_FROM_MEMORY" },
520
    { GEV_STATUS_NO_REF_TIME,                         "GEV_STATUS_NO_REF_TIME" },
521
    { GEV_STATUS_PACKET_TEMPORARILY_UNAVAILABLE,      "GEV_STATUS_PACKET_TEMPORARILY_UNAVAILABLE" },
522
    { GEV_STATUS_OVERFLOW,                            "GEV_STATUS_OVERFLOW" },
523
    { GEV_STATUS_ACTION_LATE,                         "GEV_STATUS_ACTION_LATE" },
524
    { GEV_STATUS_LEADER_TRAILER_OVERFLOW,             "GEV_STATUS_LEADER_TRAILER_OVERFLOW" },
525
    { GEV_STATUS_ERROR,                               "GEV_STATUS_ERROR" },
526
    { 0, NULL }
527
};
528
529
static value_string_ext statusnames_ext = VALUE_STRING_EXT_INIT(statusnames);
530
531
static const value_string formatnames[] = {
532
    { GVSP_PACKET_LEADER,                                   "LEADER" },
533
    { GVSP_PACKET_TRAILER,                                  "TRAILER" },
534
    { GVSP_PACKET_PAYLOAD,                                  "PAYLOAD" },
535
    { GVSP_PACKET_ALLIN,                                    "ALLIN" },
536
    { GVSP_PACKET_PAYLOAD_H264,                             "H264" },
537
    { GVSP_PACKET_PAYLOAD_MULTIZONE,                        "MULTI-ZONE" },
538
    { GVSP_PACKET_PAYLOAD_MULTIPART,                        "MULTI-PART" },
539
    { GVSP_PACKET_PAYLOAD_GENDC,                            "GENDC" },
540
    { GVSP_EXTENDED_ID_BIT | GVSP_PACKET_LEADER,            "LEADER (ext IDs)" },
541
    { GVSP_EXTENDED_ID_BIT | GVSP_PACKET_TRAILER,           "TRAILER (ext IDs)" },
542
    { GVSP_EXTENDED_ID_BIT | GVSP_PACKET_PAYLOAD,           "PAYLOAD (ext IDs)" },
543
    { GVSP_EXTENDED_ID_BIT | GVSP_PACKET_ALLIN,             "ALL-IN (ext IDs)" },
544
    { GVSP_EXTENDED_ID_BIT | GVSP_PACKET_PAYLOAD_H264,      "H264 (ext IDs)" },
545
    { GVSP_EXTENDED_ID_BIT | GVSP_PACKET_PAYLOAD_MULTIZONE, "MULTI-ZONE (ext IDs)" },
546
    { GVSP_EXTENDED_ID_BIT | GVSP_PACKET_PAYLOAD_MULTIPART, "MULTI-PART (ext IDs)" },
547
    { GVSP_EXTENDED_ID_BIT | GVSP_PACKET_PAYLOAD_GENDC,     "GENDC (ext IDs)" },
548
    { 0, NULL }
549
};
550
551
static const value_string payloadtypenames[] = {
552
    { GVSP_PAYLOAD_IMAGE,                                       "IMAGE" },
553
    { GVSP_PAYLOAD_RAWDATA,                                     "RAW DATA" },
554
    { GVSP_PAYLOAD_FILE,                                        "FILE" },
555
    { GVSP_PAYLOAD_CHUNKDATA,                                   "CHUNK DATA" },
556
    { GVSP_PAYLOAD_EXTENDEDCHUNKDATA,                           "EXTENDED CHUNK DATA (obsolete with v2.0)" },
557
    { GVSP_PAYLOAD_JPEG,                                        "JPEG" },
558
    { GVSP_PAYLOAD_JPEG2000,                                    "JPEG 2000" },
559
    { GVSP_PAYLOAD_H264,                                        "H264" },
560
    { GVSP_PAYLOAD_MULTIZONEIMAGE,                              "MULTI-ZONE IMAGE" },
561
    { GVSP_PAYLOAD_MULTIPART,                                   "MULTI-PART" },
562
    { GVSP_PAYLOAD_GENDC,                                       "GENDC" },
563
    { GVSP_EXTENDED_CHUNK_BIT | GVSP_PAYLOAD_IMAGE,             "IMAGE (v2.0 chunks)" },
564
    { GVSP_EXTENDED_CHUNK_BIT | GVSP_PAYLOAD_RAWDATA,           "RAW DATA (v2.0 Chunks)" },
565
    { GVSP_EXTENDED_CHUNK_BIT | GVSP_PAYLOAD_FILE,              "FILE (v2.0 Chunks)" },
566
    { GVSP_EXTENDED_CHUNK_BIT | GVSP_PAYLOAD_CHUNKDATA,         "CHUNK DATA (v2.0 Chunks)" },
567
    { GVSP_EXTENDED_CHUNK_BIT | GVSP_PAYLOAD_EXTENDEDCHUNKDATA, "EXTENDED CHUNK DATA (v2.0 chunks?)" },
568
    { GVSP_EXTENDED_CHUNK_BIT | GVSP_PAYLOAD_JPEG,              "JPEG (v2.0 Chunks)" },
569
    { GVSP_EXTENDED_CHUNK_BIT | GVSP_PAYLOAD_JPEG2000,          "JPEG 2000 (v2.0 Chunks)" },
570
    { GVSP_EXTENDED_CHUNK_BIT | GVSP_PAYLOAD_H264,              "H264 (v2.0 Chunks)" },
571
    { GVSP_EXTENDED_CHUNK_BIT | GVSP_PAYLOAD_MULTIZONEIMAGE,    "MULTI-ZONE IMAGE (v2.0 Chunks)" },
572
    { GVSP_EXTENDED_CHUNK_BIT | GVSP_PAYLOAD_MULTIPART,         "MULTI-PART (v2.0 Chunks)" },
573
    { 0, NULL }
574
};
575
576
static value_string_ext payloadtypenames_ext = VALUE_STRING_EXT_INIT(payloadtypenames);
577
578
static const value_string multipartdatatypenames[] = {
579
    { GVSP_MULTIPART_DATA_TYPE_2DIMAGE,             "2D IMAGE" },
580
    { GVSP_MULTIPART_DATA_TYPE_2DPLANEBIPLANAR,     "2D PLANE BI-PLANAR" },
581
    { GVSP_MULTIPART_DATA_TYPE_2DPLANETRIPLANAR,    "2D PLANE TRI-PLANAR" },
582
    { GVSP_MULTIPART_DATA_TYPE_2DPLANEQUADPLANAR,   "2D PLANE QUAD-PLANAR" },
583
    { GVSP_MULTIPART_DATA_TYPE_3DIMAGE,             "3D IMAGE" },
584
    { GVSP_MULTIPART_DATA_TYPE_3DPLANEBIPLANAR,     "3D PLANE BI-PLANAR" },
585
    { GVSP_MULTIPART_DATA_TYPE_3DPLANETRIPLANAR,    "3D PLANE TRI-PLANAR" },
586
    { GVSP_MULTIPART_DATA_TYPE_3DPLANEQUADPLANAR,   "3D PLANE QUAD-PLANAR" },
587
    { GVSP_MULTIPART_DATA_TYPE_CONFIDENCEMAP,       "CONFIDENCE MAP" },
588
    { GVSP_MULTIPART_DATA_TYPE_CHUNKDATA,           "CHUNK DATA" },
589
    { GVSP_MULTIPART_DATA_TYPE_JPEG,                "JPEG" },
590
    { GVSP_MULTIPART_DATA_TYPE_JPEG2000,            "JPEG 2000" },
591
    { GVSP_MULTIPART_DATA_TYPE_DEVICESPECIFIC,      "DEVICE SPECIFIC" },
592
    { 0, NULL }
593
};
594
595
static value_string_ext multipartdatatypenames_ext = VALUE_STRING_EXT_INIT(multipartdatatypenames);
596
597
static const value_string pixeltypenames[] =
598
{
599
    { GVSP_PIX_MONO1P, "Mono1p (Monochrome 1-bit packed)" },
600
    { GVSP_PIX_CONFIDENCE1P, "Confidence1p (Confidence 1-bit packed)" },
601
    { GVSP_PIX_MONO2P, "Mono2p (Monochrome 2-bit packed)" },
602
    { GVSP_PIX_MONO4P, "Mono4p (Monochrome 4-bit packed)" },
603
    { GVSP_PIX_BAYERGR4P, "BayerGR4p (Bayer Green-Red 4-bit packed)" },
604
    { GVSP_PIX_BAYERRG4P, "BayerRG4p (Bayer Red-Green 4-bit packed)" },
605
    { GVSP_PIX_BAYERGB4P, "BayerGB4p (Bayer Green-Blue 4-bit packed)" },
606
    { GVSP_PIX_BAYERBG4P, "BayerBG4p (Bayer Blue-Green 4-bit packed)" },
607
    { GVSP_PIX_MONO8, "Mono8 (Monochrome 8-bit)" },
608
    { GVSP_PIX_MONO8S, "Mono8s (Monochrome 8-bit signed)" },
609
    { GVSP_PIX_BAYERGR8, "BayerGR8 (Bayer Green-Red 8-bit)" },
610
    { GVSP_PIX_BAYERRG8, "BayerRG8 (Bayer Red-Green 8-bit)" },
611
    { GVSP_PIX_BAYERGB8, "BayerGB8 (Bayer Green-Blue 8-bit)" },
612
    { GVSP_PIX_BAYERBG8, "BayerBG8 (Bayer Blue-Green 8-bit)" },
613
    { GVSP_PIX_SCF1WBWG8, "SCF1WBWG8 (Sparse Color Filter #1 White-Blue-White-Green 8-bit)" },
614
    { GVSP_PIX_SCF1WGWB8, "SCF1WGWB8 (Sparse Color Filter #1 White-Green-White-Blue 8-bit)" },
615
    { GVSP_PIX_SCF1WGWR8, "SCF1WGWR8 (Sparse Color Filter #1 White-Green-White-Red 8-bit)" },
616
    { GVSP_PIX_SCF1WRWG8, "SCF1WRWG8 (Sparse Color Filter #1 White-Red-White-Green 8-bit)" },
617
    { GVSP_PIX_COORD3D_A8, "Coord3D_A8 (3D coordinate A 8-bit)" },
618
    { GVSP_PIX_COORD3D_B8, "Coord3D_B8 (3D coordinate B 8-bit)" },
619
    { GVSP_PIX_COORD3D_C8, "Coord3D_C8 (3D coordinate C 8-bit)" },
620
    { GVSP_PIX_CONFIDENCE1, "Confidence1 (Confidence 1-bit unpacked)" },
621
    { GVSP_PIX_CONFIDENCE8, "Confidence8 (Confidence 8-bit)" },
622
    { GVSP_PIX_R8, "R8 (Red 8-bit)" },
623
    { GVSP_PIX_G8, "G8 (Green 8-bit)" },
624
    { GVSP_PIX_B8, "B8 (Blue 8-bit)" },
625
    { GVSP_PIX_DATA8, "Data8 (Data 8-bit)" },
626
    { GVSP_PIX_DATA8S, "Data8s (Data 8-bit signed)" },
627
    { GVSP_PIX_MONO10P, "Mono10p (Monochrome 10-bit packed)" },
628
    { GVSP_PIX_BAYERBG10P, "BayerBG10p (Bayer Blue-Green 10-bit packed)" },
629
    { GVSP_PIX_BAYERGB10P, "BayerGB10p (Bayer Green-Blue 10-bit packed)" },
630
    { GVSP_PIX_BAYERGR10P, "BayerGR10p (Bayer Green-Red 10-bit packed)" },
631
    { GVSP_PIX_BAYERRG10P, "BayerRG10p (Bayer Red-Green 10-bit packed)" },
632
    { GVSP_PIX_SCF1WBWG10P, "SCF1WBWG10p (Sparse Color Filter #1 White-Blue-White-Green 10-bit packed)" },
633
    { GVSP_PIX_SCF1WGWB10P, "SCF1WGWB10p (Sparse Color Filter #1 White-Green-White-Blue 10-bit packed)" },
634
    { GVSP_PIX_SCF1WGWR10P, "SCF1WGWR10p (Sparse Color Filter #1 White-Green-White-Red 10-bit packed)" },
635
    { GVSP_PIX_SCF1WRWG10P, "SCF1WRWG10p (Sparse Color Filter #1 White-Red-White-Green 10-bit packed)" },
636
    { GVSP_PIX_R10_DEPRECATED, "R10_Deprecated (Deprecated because size field is wrong)" },
637
    { GVSP_PIX_G10_DEPRECATED, "G10_Deprecated (Deprecated because size field is wrong)" },
638
    { GVSP_PIX_B10_DEPRECATED, "B10_Deprecated (Deprecated because size field is wrong)" },
639
    { GVSP_PIX_COORD3D_A10P, "Coord3D_A10p (3D coordinate A 10-bit packed)" },
640
    { GVSP_PIX_COORD3D_B10P, "Coord3D_B10p (3D coordinate B 10-bit packed)" },
641
    { GVSP_PIX_COORD3D_C10P, "Coord3D_C10p (3D coordinate C 10-bit packed)" },
642
    { GVSP_PIX_MONO10PACKED, "GVSP_Mono10Packed (GigE Vision specific format, Monochrome 10-bit packed)" },
643
    { GVSP_PIX_MONO12PACKED, "GVSP_Mono12Packed (GigE Vision specific format, Monochrome 12-bit packed)" },
644
    { GVSP_PIX_BAYERGR10PACKED, "GVSP_BayerGR10Packed (GigE Vision specific format, Bayer Green-Red 10-bit packed)" },
645
    { GVSP_PIX_BAYERRG10PACKED, "GVSP_BayerRG10Packed (GigE Vision specific format, Bayer Red-Green 10-bit packed)" },
646
    { GVSP_PIX_BAYERGB10PACKED, "GVSP_BayerGB10Packed (GigE Vision specific format, Bayer Green-Blue 10-bit packed)" },
647
    { GVSP_PIX_BAYERBG10PACKED, "GVSP_BayerBG10Packed (GigE Vision specific format, Bayer Blue-Green 10-bit packed)" },
648
    { GVSP_PIX_BAYERGR12PACKED, "GVSP_BayerGR12Packed (GigE Vision specific format, Bayer Green-Red 12-bit packed)" },
649
    { GVSP_PIX_BAYERRG12PACKED, "GVSP_BayerRG12Packed (GigE Vision specific format, Bayer Red-Green 12-bit packed)" },
650
    { GVSP_PIX_BAYERGB12PACKED, "GVSP_BayerGB12Packed (GigE Vision specific format, Bayer Green-Blue 12-bit packed)" },
651
    { GVSP_PIX_BAYERBG12PACKED, "GVSP_BayerBG12Packed (GigE Vision specific format, Bayer Blue-Green 12-bit packed)" },
652
    { GVSP_PIX_MONO12P, "Mono12p (Monochrome 12-bit packed)" },
653
    { GVSP_PIX_BAYERBG12P, "BayerBG12p (Bayer Blue-Green 12-bit packed)" },
654
    { GVSP_PIX_BAYERGB12P, "BayerGB12p (Bayer Green-Blue 12-bit packed)" },
655
    { GVSP_PIX_BAYERGR12P, "BayerGR12p (Bayer Green-Red 12-bit packed)" },
656
    { GVSP_PIX_BAYERRG12P, "BayerRG12p (Bayer Red-Green 12-bit packed)" },
657
    { GVSP_PIX_SCF1WBWG12P, "SCF1WBWG12p (Sparse Color Filter #1 White-Blue-White-Green 12-bit packed)" },
658
    { GVSP_PIX_SCF1WGWB12P, "SCF1WGWB12p (Sparse Color Filter #1 White-Green-White-Blue 12-bit packed)" },
659
    { GVSP_PIX_SCF1WGWR12P, "SCF1WGWR12p (Sparse Color Filter #1 White-Green-White-Red 12-bit packed)" },
660
    { GVSP_PIX_SCF1WRWG12P, "SCF1WRWG12p (Sparse Color Filter #1 White-Red-White-Green 12-bit packed)" },
661
    { GVSP_PIX_R12_DEPRECATED, "R12_Deprecated (Deprecated because size field is wrong)" },
662
    { GVSP_PIX_G12_DEPRECATED, "G12_Deprecated (Deprecated because size field is wrong)" },
663
    { GVSP_PIX_B12_DEPRECATED, "B12_Deprecated (Deprecated because size field is wrong)" },
664
    { GVSP_PIX_COORD3D_A12P, "Coord3D_A12p (3D coordinate A 12-bit packed)" },
665
    { GVSP_PIX_COORD3D_B12P, "Coord3D_B12p (3D coordinate B 12-bit packed)" },
666
    { GVSP_PIX_COORD3D_C12P, "Coord3D_C12p (3D coordinate C 12-bit packed)" },
667
    { GVSP_PIX_MONO14P, "Mono14p (Monochrome 14-bit packed)" },
668
    { GVSP_PIX_BAYERGR14P, "BayerGR14p (Bayer Green-Red 14-bit packed)" },
669
    { GVSP_PIX_BAYERRG14P, "BayerRG14p (Bayer Red-Green 14-bit packed)" },
670
    { GVSP_PIX_BAYERGB14P, "BayerGB14p (Bayer Green-Blue 14-bit packed)" },
671
    { GVSP_PIX_BAYERBG14P, "BayerBG14p (Bayer Blue-Green 14-bit packed)" },
672
    { GVSP_PIX_MONO10, "Mono10 (Monochrome 10-bit unpacked)" },
673
    { GVSP_PIX_MONO12, "Mono12 (Monochrome 12-bit unpacked)" },
674
    { GVSP_PIX_MONO16, "Mono16 (Monochrome 16-bit)" },
675
    { GVSP_PIX_BAYERGR10, "BayerGR10 (Bayer Green-Red 10-bit unpacked)" },
676
    { GVSP_PIX_BAYERRG10, "BayerRG10 (Bayer Red-Green 10-bit unpacked)" },
677
    { GVSP_PIX_BAYERGB10, "BayerGB10 (Bayer Green-Blue 10-bit unpacked)" },
678
    { GVSP_PIX_BAYERBG10, "BayerBG10 (Bayer Blue-Green 10-bit unpacked)" },
679
    { GVSP_PIX_BAYERGR12, "BayerGR12 (Bayer Green-Red 12-bit unpacked)" },
680
    { GVSP_PIX_BAYERRG12, "BayerRG12 (Bayer Red-Green 12-bit unpacked)" },
681
    { GVSP_PIX_BAYERGB12, "BayerGB12 (Bayer Green-Blue 12-bit unpacked)" },
682
    { GVSP_PIX_BAYERBG12, "BayerBG12 (Bayer Blue-Green 12-bit unpacked)" },
683
    { GVSP_PIX_MONO14, "Mono14 (Monochrome 14-bit unpacked)" },
684
    { GVSP_PIX_BAYERGR16, "BayerGR16 (Bayer Green-Red 16-bit)" },
685
    { GVSP_PIX_BAYERRG16, "BayerRG16 (Bayer Red-Green 16-bit)" },
686
    { GVSP_PIX_BAYERGB16, "BayerGB16 (Bayer Green-Blue 16-bit)" },
687
    { GVSP_PIX_BAYERBG16, "BayerBG16 (Bayer Blue-Green 16-bit)" },
688
    { GVSP_PIX_SCF1WBWG10, "SCF1WBWG10 (Sparse Color Filter #1 White-Blue-White-Green 10-bit unpacked)" },
689
    { GVSP_PIX_SCF1WBWG12, "SCF1WBWG12 (Sparse Color Filter #1 White-Blue-White-Green 12-bit unpacked)" },
690
    { GVSP_PIX_SCF1WBWG14, "SCF1WBWG14 (Sparse Color Filter #1 White-Blue-White-Green 14-bit unpacked)" },
691
    { GVSP_PIX_SCF1WBWG16, "SCF1WBWG16 (Sparse Color Filter #1 White-Blue-White-Green 16-bit unpacked)" },
692
    { GVSP_PIX_SCF1WGWB10, "SCF1WGWB10 (Sparse Color Filter #1 White-Green-White-Blue 10-bit unpacked)" },
693
    { GVSP_PIX_SCF1WGWB12, "SCF1WGWB12 (Sparse Color Filter #1 White-Green-White-Blue 12-bit unpacked)" },
694
    { GVSP_PIX_SCF1WGWB14, "SCF1WGWB14 (Sparse Color Filter #1 White-Green-White-Blue 14-bit unpacked)" },
695
    { GVSP_PIX_SCF1WGWB16, "SCF1WGWB16 (Sparse Color Filter #1 White-Green-White-Blue 16-bit)" },
696
    { GVSP_PIX_SCF1WGWR10, "SCF1WGWR10 (Sparse Color Filter #1 White-Green-White-Red 10-bit unpacked)" },
697
    { GVSP_PIX_SCF1WGWR12, "SCF1WGWR12 (Sparse Color Filter #1 White-Green-White-Red 12-bit unpacked)" },
698
    { GVSP_PIX_SCF1WGWR14, "SCF1WGWR14 (Sparse Color Filter #1 White-Green-White-Red 14-bit unpacked)" },
699
    { GVSP_PIX_SCF1WGWR16, "SCF1WGWR16 (Sparse Color Filter #1 White-Green-White-Red 16-bit)" },
700
    { GVSP_PIX_SCF1WRWG10, "SCF1WRWG10 (Sparse Color Filter #1 White-Red-White-Green 10-bit unpacked)" },
701
    { GVSP_PIX_SCF1WRWG12, "SCF1WRWG12 (Sparse Color Filter #1 White-Red-White-Green 12-bit unpacked)" },
702
    { GVSP_PIX_SCF1WRWG14, "SCF1WRWG14 (Sparse Color Filter #1 White-Red-White-Green 14-bit unpacked)" },
703
    { GVSP_PIX_SCF1WRWG16, "SCF1WRWG16 (Sparse Color Filter #1 White-Red-White-Green 16-bit)" },
704
    { GVSP_PIX_COORD3D_A16, "Coord3D_A16 (3D coordinate A 16-bit)" },
705
    { GVSP_PIX_COORD3D_B16, "Coord3D_B16 (3D coordinate B 16-bit)" },
706
    { GVSP_PIX_COORD3D_C16, "Coord3D_C16 (3D coordinate C 16-bit)" },
707
    { GVSP_PIX_CONFIDENCE16, "Confidence16 (Confidence 16-bit)" },
708
    { GVSP_PIX_R16, "R16 (Red 16-bit)" },
709
    { GVSP_PIX_G16, "G16 (Green 16-bit)" },
710
    { GVSP_PIX_B16, "B16 (Blue 16-bit)" },
711
    { GVSP_PIX_BAYERGR14, "BayerGR14 (Bayer Green-Red 14-bit)" },
712
    { GVSP_PIX_BAYERRG14, "BayerRG14 (Bayer Red-Green 14-bit)" },
713
    { GVSP_PIX_BAYERGB14, "BayerGB14 (Bayer Green-Blue 14-bit)" },
714
    { GVSP_PIX_BAYERBG14, "BayerBG14 (Bayer Blue-Green 14-bit)" },
715
    { GVSP_PIX_DATA16, "Data16 (Data 16-bit)" },
716
    { GVSP_PIX_DATA16S, "Data16s (Data 16-bit signed)" },
717
    { GVSP_PIX_R10, "R10 (Red 10-bit)" },
718
    { GVSP_PIX_R12, "R12 (Red 12-bit)" },
719
    { GVSP_PIX_G10, "G10 (Green 10-bit)" },
720
    { GVSP_PIX_G12, "G12 (Green 12-bit)" },
721
    { GVSP_PIX_B10, "B10 (Blue 10-bit)" },
722
    { GVSP_PIX_B12, "B12 (Blue 12-bit)" },
723
    { GVSP_PIX_COORD3D_A32F, "Coord3D_A32f (3D coordinate A 32-bit floating point)" },
724
    { GVSP_PIX_COORD3D_B32F, "Coord3D_B32f (3D coordinate B 32-bit floating point)" },
725
    { GVSP_PIX_COORD3D_C32F, "Coord3D_C32f (3D coordinate C 32-bit floating point)" },
726
    { GVSP_PIX_CONFIDENCE32F, "Confidence32f (Confidence 32-bit floating point)" },
727
    { GVSP_PIX_MONO32, "Mono32 (Monochrome 32-bit)" },
728
    { GVSP_PIX_DATA32, "Data32 (Data 32-bit)" },
729
    { GVSP_PIX_DATA32S, "Data32s (Data 32-bit signed)" },
730
    { GVSP_PIX_DATA32F, "Data32f (Data 32-bit floating point)" },
731
    { GVSP_PIX_DATA64, "Data64 (Data 64-bit)" },
732
    { GVSP_PIX_DATA64S, "Data64s (Data 64-bit signed)" },
733
    { GVSP_PIX_DATA64F, "Data64f (Data 64-bit floating point)" },
734
    { GVSP_PIX_YUV411_8_UYYVYY, "YUV411_8_UYYVYY (YUV 4:1:1 8-bit)" },
735
    { GVSP_PIX_YCBCR411_8_CBYYCRYY, "YCbCr411_8_CbYYCrYY (YCbCr 4:1:1 8-bit)" },
736
    { GVSP_PIX_YCBCR601_411_8_CBYYCRYY, "YCbCr601_411_8_CbYYCrYY (YCbCr 4:1:1 8-bit BT.601)" },
737
    { GVSP_PIX_YCBCR709_411_8_CBYYCRYY, "YCbCr709_411_8_CbYYCrYY (YCbCr 4:1:1 8-bit BT.709)" },
738
    { GVSP_PIX_YCBCR411_8, "YCbCr411_8 (YCbCr 4:1:1 8-bit)" },
739
    { GVSP_PIX_YCBCR2020_411_8_CBYYCRYY, "YCbCr2020_411_8_CbYYCrYY (YCbCr 4:1:1 8-bit BT.2020)" },
740
    { GVSP_PIX_YCBCR420_8_YY_CBCR_SEMIPLANAR, "YCbCr420_8_YY_CbCr_Semiplanar (YCbCr 4:2:0 8-bit YY/CbCr Semiplanar)" },
741
    { GVSP_PIX_YCBCR420_8_YY_CRCB_SEMIPLANAR, "YCbCr420_8_YY_CrCb_Semiplanar (YCbCr 4:2:0 8-bit YY/CrCb Semiplanar)" },
742
    { GVSP_PIX_YUV422_8_UYVY, "YUV422_8_UYVY (YUV 4:2:2 8-bit)" },
743
    { GVSP_PIX_YUV422_8, "YUV422_8 (YUV 4:2:2 8-bit)" },
744
    { GVSP_PIX_RGB565P, "RGB565p (Red-Green-Blue 5/6/5-bit packed)" },
745
    { GVSP_PIX_BGR565P, "BGR565p (Blue-Green-Red 5/6/5-bit packed)" },
746
    { GVSP_PIX_YCBCR422_8, "YCbCr422_8 (YCbCr 4:2:2 8-bit)" },
747
    { GVSP_PIX_YCBCR601_422_8, "YCbCr601_422_8 (YCbCr 4:2:2 8-bit BT.601)" },
748
    { GVSP_PIX_YCBCR709_422_8, "YCbCr709_422_8 (YCbCr 4:2:2 8-bit BT.709)" },
749
    { GVSP_PIX_YCBCR422_8_CBYCRY, "YCbCr422_8_CbYCrY (YCbCr 4:2:2 8-bit)" },
750
    { GVSP_PIX_YCBCR601_422_8_CBYCRY, "YCbCr601_422_8_CbYCrY (YCbCr 4:2:2 8-bit BT.601)" },
751
    { GVSP_PIX_YCBCR709_422_8_CBYCRY, "YCbCr709_422_8_CbYCrY (YCbCr 4:2:2 8-bit BT.709)" },
752
    { GVSP_PIX_BICOLORRGBG8, "BiColorRGBG8 (Bi-color Red/Green - Blue/Green 8-bit)" },
753
    { GVSP_PIX_BICOLORBGRG8, "BiColorBGRG8 (Bi-color Blue/Green - Red/Green 8-bit)" },
754
    { GVSP_PIX_COORD3D_AC8, "Coord3D_AC8 (3D coordinate A-C 8-bit)" },
755
    { GVSP_PIX_COORD3D_AC8_PLANAR, "Coord3D_AC8_Planar (3D coordinate A-C 8-bit planar)" },
756
    { GVSP_PIX_YCBCR2020_422_8, "YCbCr2020_422_8 (YCbCr 4:2:2 8-bit BT.2020)" },
757
    { GVSP_PIX_YCBCR2020_422_8_CBYCRY, "YCbCr2020_422_8_CbYCrY (YCbCr 4:2:2 8-bit BT.2020)" },
758
    { GVSP_PIX_YCBCR422_8_YY_CBCR_SEMIPLANAR, "YCbCr422_8_YY_CbCr_Semiplanar (YCbCr 4:2:2 8-bit YY/CbCr Semiplanar)" },
759
    { GVSP_PIX_YCBCR422_8_YY_CRCB_SEMIPLANAR, "YCbCr422_8_YY_CrCb_Semiplanar (YCbCr 4:2:2 8-bit YY/CrCb Semiplanar)" },
760
    { GVSP_PIX_YCBCR422_10P, "YCbCr422_10p (YCbCr 4:2:2 10-bit packed)" },
761
    { GVSP_PIX_YCBCR601_422_10P, "YCbCr601_422_10p (YCbCr 4:2:2 10-bit packed BT.601)" },
762
    { GVSP_PIX_YCBCR709_422_10P, "YCbCr709_422_10p (YCbCr 4:2:2 10-bit packed BT.709)" },
763
    { GVSP_PIX_YCBCR422_10P_CBYCRY, "YCbCr422_10p_CbYCrY (YCbCr 4:2:2 10-bit packed)" },
764
    { GVSP_PIX_YCBCR601_422_10P_CBYCRY, "YCbCr601_422_10p_CbYCrY (YCbCr 4:2:2 10-bit packed BT.601)" },
765
    { GVSP_PIX_YCBCR709_422_10P_CBYCRY, "YCbCr709_422_10p_CbYCrY (YCbCr 4:2:2 10-bit packed BT.709)" },
766
    { GVSP_PIX_BICOLORRGBG10P, "BiColorRGBG10p (Bi-color Red/Green - Blue/Green 10-bit packed)" },
767
    { GVSP_PIX_BICOLORBGRG10P, "BiColorBGRG10p (Bi-color Blue/Green - Red/Green 10-bit packed)" },
768
    { GVSP_PIX_COORD3D_AC10P, "Coord3D_AC10p (3D coordinate A-C 10-bit packed)" },
769
    { GVSP_PIX_COORD3D_AC10P_PLANAR, "Coord3D_AC10p_Planar (3D coordinate A-C 10-bit packed planar)" },
770
    { GVSP_PIX_YCBCR2020_422_10P, "YCbCr2020_422_10p (YCbCr 4:2:2 10-bit packed BT.2020)" },
771
    { GVSP_PIX_YCBCR2020_422_10P_CBYCRY, "YCbCr2020_422_10p_CbYCrY (YCbCr 4:2:2 10-bit packed BT.2020)" },
772
    { GVSP_PIX_RGB8, "RGB8 (Red-Green-Blue 8-bit)" },
773
    { GVSP_PIX_BGR8, "BGR8 (Blue-Green-Red 8-bit)" },
774
    { GVSP_PIX_YUV8_UYV, "YUV8_UYV (YUV 4:4:4 8-bit)" },
775
    { GVSP_PIX_RGB8_PLANAR, "RGB8_Planar (Red-Green-Blue 8-bit planar)" },
776
    { GVSP_PIX_YCBCR8_CBYCR, "YCbCr8_CbYCr (YCbCr 4:4:4 8-bit)" },
777
    { GVSP_PIX_YCBCR601_8_CBYCR, "YCbCr601_8_CbYCr (YCbCr 4:4:4 8-bit BT.601)" },
778
    { GVSP_PIX_YCBCR709_8_CBYCR, "YCbCr709_8_CbYCr (YCbCr 4:4:4 8-bit BT.709)" },
779
    { GVSP_PIX_YCBCR8, "YCbCr8 (YCbCr 4:4:4 8-bit)" },
780
    { GVSP_PIX_YCBCR422_12P, "YCbCr422_12p (YCbCr 4:2:2 12-bit packed)" },
781
    { GVSP_PIX_YCBCR601_422_12P, "YCbCr601_422_12p (YCbCr 4:2:2 12-bit packed BT.601)" },
782
    { GVSP_PIX_YCBCR709_422_12P, "YCbCr709_422_12p (YCbCr 4:2:2 12-bit packed BT.709)" },
783
    { GVSP_PIX_YCBCR422_12P_CBYCRY, "YCbCr422_12p_CbYCrY (YCbCr 4:2:2 12-bit packed)" },
784
    { GVSP_PIX_YCBCR601_422_12P_CBYCRY, "YCbCr601_422_12p_CbYCrY (YCbCr 4:2:2 12-bit packed BT.601)" },
785
    { GVSP_PIX_YCBCR709_422_12P_CBYCRY, "YCbCr709_422_12p_CbYCrY (YCbCr 4:2:2 12-bit packed BT.709)" },
786
    { GVSP_PIX_BICOLORRGBG12P, "BiColorRGBG12p (Bi-color Red/Green - Blue/Green 12-bit packed)" },
787
    { GVSP_PIX_BICOLORBGRG12P, "BiColorBGRG12p (Bi-color Blue/Green - Red/Green 12-bit packed)" },
788
    { GVSP_PIX_COORD3D_ABC8, "Coord3D_ABC8 (3D coordinate A-B-C 8-bit)" },
789
    { GVSP_PIX_COORD3D_ABC8_PLANAR, "Coord3D_ABC8_Planar (3D coordinate A-B-C 8-bit planar)" },
790
    { GVSP_PIX_COORD3D_AC12P, "Coord3D_AC12p (3D coordinate A-C 12-bit packed)" },
791
    { GVSP_PIX_COORD3D_AC12P_PLANAR, "Coord3D_AC12p_Planar (3D coordinate A-C 12-bit packed planar)" },
792
    { GVSP_PIX_YCBCR2020_8_CBYCR, "YCbCr2020_8_CbYCr (YCbCr 4:4:4 8-bit BT.2020)" },
793
    { GVSP_PIX_YCBCR2020_422_12P, "YCbCr2020_422_12p (YCbCr 4:2:2 12-bit packed BT.2020)" },
794
    { GVSP_PIX_YCBCR2020_422_12P_CBYCRY, "YCbCr2020_422_12p_CbYCrY (YCbCr 4:2:2 12-bit packed BT.2020)" },
795
    { GVSP_PIX_BGR10P, "BGR10p (Blue-Green-Red 10-bit packed)" },
796
    { GVSP_PIX_RGB10P, "RGB10p (Red-Green-Blue 10-bit packed)" },
797
    { GVSP_PIX_YCBCR10P_CBYCR, "YCbCr10p_CbYCr (YCbCr 4:4:4 10-bit packed)" },
798
    { GVSP_PIX_YCBCR601_10P_CBYCR, "YCbCr601_10p_CbYCr (YCbCr 4:4:4 10-bit packed BT.601)" },
799
    { GVSP_PIX_YCBCR709_10P_CBYCR, "YCbCr709_10p_CbYCr (YCbCr 4:4:4 10-bit packed BT.709)" },
800
    { GVSP_PIX_COORD3D_ABC10P, "Coord3D_ABC10p (3D coordinate A-B-C 10-bit packed)" },
801
    { GVSP_PIX_COORD3D_ABC10P_PLANAR, "Coord3D_ABC10p_Planar (3D coordinate A-B-C 10-bit packed planar)" },
802
    { GVSP_PIX_YCBCR2020_10P_CBYCR, "YCbCr2020_10p_CbYCr (YCbCr 4:4:4 10-bit packed BT.2020)" },
803
    { GVSP_PIX_RGBA8, "RGBa8 (Red-Green-Blue-alpha 8-bit)" },
804
    { GVSP_PIX_BGRA8, "BGRa8 (Blue-Green-Red-alpha 8-bit)" },
805
    { GVSP_PIX_RGB10V1PACKED, "GVSP_RGB10V1Packed (GigE Vision specific format, Red-Green-Blue 10-bit packed - variant 1)" },
806
    { GVSP_PIX_RGB10P32, "RGB10p32 (Red-Green-Blue 10-bit packed into 32-bit)" },
807
    { GVSP_PIX_YCBCR422_10, "YCbCr422_10 (YCbCr 4:2:2 10-bit unpacked)" },
808
    { GVSP_PIX_YCBCR422_12, "YCbCr422_12 (YCbCr 4:2:2 12-bit unpacked)" },
809
    { GVSP_PIX_YCBCR601_422_10, "YCbCr601_422_10 (YCbCr 4:2:2 10-bit unpacked BT.601)" },
810
    { GVSP_PIX_YCBCR601_422_12, "YCbCr601_422_12 (YCbCr 4:2:2 12-bit unpacked BT.601)" },
811
    { GVSP_PIX_YCBCR709_422_10, "YCbCr709_422_10 (YCbCr 4:2:2 10-bit unpacked BT.709)" },
812
    { GVSP_PIX_YCBCR709_422_12, "YCbCr709_422_12 (YCbCr 4:2:2 12-bit unpacked BT.709)" },
813
    { GVSP_PIX_YCBCR422_10_CBYCRY, "YCbCr422_10_CbYCrY (YCbCr 4:2:2 10-bit unpacked)" },
814
    { GVSP_PIX_YCBCR422_12_CBYCRY, "YCbCr422_12_CbYCrY (YCbCr 4:2:2 12-bit unpacked)" },
815
    { GVSP_PIX_YCBCR601_422_10_CBYCRY, "YCbCr601_422_10_CbYCrY (YCbCr 4:2:2 10-bit unpacked BT.601)" },
816
    { GVSP_PIX_YCBCR601_422_12_CBYCRY, "YCbCr601_422_12_CbYCrY (YCbCr 4:2:2 12-bit unpacked BT.601)" },
817
    { GVSP_PIX_YCBCR709_422_10_CBYCRY, "YCbCr709_422_10_CbYCrY (YCbCr 4:2:2 10-bit unpacked BT.709)" },
818
    { GVSP_PIX_YCBCR709_422_12_CBYCRY, "YCbCr709_422_12_CbYCrY (YCbCr 4:2:2 12-bit unpacked BT.709)" },
819
    { GVSP_PIX_BICOLORRGBG10, "BiColorRGBG10 (Bi-color Red/Green - Blue/Green 10-bit unpacked)" },
820
    { GVSP_PIX_BICOLORBGRG10, "BiColorBGRG10 (Bi-color Blue/Green - Red/Green 10-bit unpacked)" },
821
    { GVSP_PIX_BICOLORRGBG12, "BiColorRGBG12 (Bi-color Red/Green - Blue/Green 12-bit unpacked)" },
822
    { GVSP_PIX_BICOLORBGRG12, "BiColorBGRG12 (Bi-color Blue/Green - Red/Green 12-bit unpacked)" },
823
    { GVSP_PIX_COORD3D_AC16, "Coord3D_AC16 (3D coordinate A-C 16-bit)" },
824
    { GVSP_PIX_COORD3D_AC16_PLANAR, "Coord3D_AC16_Planar (3D coordinate A-C 16-bit planar)" },
825
    { GVSP_PIX_YCBCR2020_422_10, "YCbCr2020_422_10 (YCbCr 4:2:2 10-bit unpacked BT.2020)" },
826
    { GVSP_PIX_YCBCR2020_422_10_CBYCRY, "YCbCr2020_422_10_CbYCrY (YCbCr 4:2:2 10-bit unpacked BT.2020)" },
827
    { GVSP_PIX_YCBCR2020_422_12, "YCbCr2020_422_12 (YCbCr 4:2:2 12-bit unpacked BT.2020)" },
828
    { GVSP_PIX_YCBCR2020_422_12_CBYCRY, "YCbCr2020_422_12_CbYCrY (YCbCr 4:2:2 12-bit unpacked BT.2020)" },
829
    { GVSP_PIX_RGB12V1PACKED, "GVSP_RGB12V1Packed (GigE Vision specific format, Red-Green-Blue 12-bit packed - variant 1)" },
830
    { GVSP_PIX_BGR12P, "BGR12p (Blue-Green-Red 12-bit packed)" },
831
    { GVSP_PIX_RGB12P, "RGB12p (Red-Green-Blue 12-bit packed)" },
832
    { GVSP_PIX_YCBCR12P_CBYCR, "YCbCr12p_CbYCr (YCbCr 4:4:4 12-bit packed)" },
833
    { GVSP_PIX_YCBCR601_12P_CBYCR, "YCbCr601_12p_CbYCr (YCbCr 4:4:4 12-bit packed BT.601)" },
834
    { GVSP_PIX_YCBCR709_12P_CBYCR, "YCbCr709_12p_CbYCr (YCbCr 4:4:4 12-bit packed BT.709)" },
835
    { GVSP_PIX_COORD3D_ABC12P, "Coord3D_ABC12p (3D coordinate A-B-C 12-bit packed)" },
836
    { GVSP_PIX_COORD3D_ABC12P_PLANAR, "Coord3D_ABC12p_Planar (3D coordinate A-B-C 12-bit packed planar)" },
837
    { GVSP_PIX_YCBCR2020_12P_CBYCR, "YCbCr2020_12p_CbYCr (YCbCr 4:4:4 12-bit packed BT.2020)" },
838
    { GVSP_PIX_BGRA10P, "BGRa10p (Blue-Green-Red-alpha 10-bit packed)" },
839
    { GVSP_PIX_RGBA10P, "RGBa10p (Red-Green-Blue-alpha 10-bit packed)" },
840
    { GVSP_PIX_RGB10, "RGB10 (Red-Green-Blue 10-bit unpacked)" },
841
    { GVSP_PIX_BGR10, "BGR10 (Blue-Green-Red 10-bit unpacked)" },
842
    { GVSP_PIX_RGB12, "RGB12 (Red-Green-Blue 12-bit unpacked)" },
843
    { GVSP_PIX_BGR12, "BGR12 (Blue-Green-Red 12-bit unpacked)" },
844
    { GVSP_PIX_RGB10_PLANAR, "RGB10_Planar (Red-Green-Blue 10-bit unpacked planar)" },
845
    { GVSP_PIX_RGB12_PLANAR, "RGB12_Planar (Red-Green-Blue 12-bit unpacked planar)" },
846
    { GVSP_PIX_RGB16_PLANAR, "RGB16_Planar (Red-Green-Blue 16-bit planar)" },
847
    { GVSP_PIX_RGB16, "RGB16 (Red-Green-Blue 16-bit)" },
848
    { GVSP_PIX_BGR14, "BGR14 (Blue-Green-Red 14-bit unpacked)" },
849
    { GVSP_PIX_BGR16, "BGR16 (Blue-Green-Red 16-bit)" },
850
    { GVSP_PIX_BGRA12P, "BGRa12p (Blue-Green-Red-alpha 12-bit packed)" },
851
    { GVSP_PIX_RGB14, "RGB14 (Red-Green-Blue 14-bit unpacked)" },
852
    { GVSP_PIX_RGBA12P, "RGBa12p (Red-Green-Blue-alpha 12-bit packed)" },
853
    { GVSP_PIX_YCBCR10_CBYCR, "YCbCr10_CbYCr (YCbCr 4:4:4 10-bit unpacked)" },
854
    { GVSP_PIX_YCBCR12_CBYCR, "YCbCr12_CbYCr (YCbCr 4:4:4 12-bit unpacked)" },
855
    { GVSP_PIX_YCBCR601_10_CBYCR, "YCbCr601_10_CbYCr (YCbCr 4:4:4 10-bit unpacked BT.601)" },
856
    { GVSP_PIX_YCBCR601_12_CBYCR, "YCbCr601_12_CbYCr (YCbCr 4:4:4 12-bit unpacked BT.601)" },
857
    { GVSP_PIX_YCBCR709_10_CBYCR, "YCbCr709_10_CbYCr (YCbCr 4:4:4 10-bit unpacked BT.709)" },
858
    { GVSP_PIX_YCBCR709_12_CBYCR, "YCbCr709_12_CbYCr (YCbCr 4:4:4 12-bit unpacked BT.709)" },
859
    { GVSP_PIX_COORD3D_ABC16, "Coord3D_ABC16 (3D coordinate A-B-C 16-bit)" },
860
    { GVSP_PIX_COORD3D_ABC16_PLANAR, "Coord3D_ABC16_Planar (3D coordinate A-B-C 16-bit planar)" },
861
    { GVSP_PIX_YCBCR2020_10_CBYCR, "YCbCr2020_10_CbYCr (YCbCr 4:4:4 10-bit unpacked BT.2020)" },
862
    { GVSP_PIX_YCBCR2020_12_CBYCR, "YCbCr2020_12_CbYCr (YCbCr 4:4:4 12-bit unpacked BT.2020)" },
863
    { GVSP_PIX_BGRA10, "BGRa10 (Blue-Green-Red-alpha 10-bit unpacked)" },
864
    { GVSP_PIX_BGRA12, "BGRa12 (Blue-Green-Red-alpha 12-bit unpacked)" },
865
    { GVSP_PIX_BGRA14, "BGRa14 (Blue-Green-Red-alpha 14-bit unpacked)" },
866
    { GVSP_PIX_BGRA16, "BGRa16 (Blue-Green-Red-alpha 16-bit)" },
867
    { GVSP_PIX_RGBA10, "RGBa10 (Red-Green-Blue-alpha 10-bit unpacked)" },
868
    { GVSP_PIX_RGBA12, "RGBa12 (Red-Green-Blue-alpha 12-bit unpacked)" },
869
    { GVSP_PIX_RGBA14, "RGBa14 (Red-Green-Blue-alpha 14-bit unpacked)" },
870
    { GVSP_PIX_RGBA16, "RGBa16 (Red-Green-Blue-alpha 16-bit)" },
871
    { GVSP_PIX_COORD3D_AC32F, "Coord3D_AC32f (3D coordinate A-C 32-bit floating point)" },
872
    { GVSP_PIX_COORD3D_AC32F_PLANAR, "Coord3D_AC32f_Planar (3D coordinate A-C 32-bit floating point planar)" },
873
    { GVSP_PIX_COORD3D_ABC32F, "Coord3D_ABC32f (3D coordinate A-B-C 32-bit floating point)" },
874
    { GVSP_PIX_COORD3D_ABC32F_PLANAR, "Coord3D_ABC32f_Planar (3D coordinate A-B-C 32-bit floating point planar)" },
875
    { 0, NULL }
876
};
877
878
static value_string_ext pixeltypenames_ext = VALUE_STRING_EXT_INIT(pixeltypenames);
879
880
static const value_string colornames[] = {
881
    { GVSP_PIX_MONO >> 24,   "Mono" },
882
    { GVSP_PIX_COLOR >> 24,  "Color" },
883
    { GVSP_PIX_CUSTOM >> 24, "Custom" },
884
    { 0, NULL }
885
};
886
887
static const true_false_string zonedirectionnames = {
888
    "Bottom Up",
889
    "Top-Down"
890
};
891
892
/* GEV 2.2 */
893
static const value_string gendc_payload_descriptor_flag_values[] = {
894
        { 0, "No Descriptor Data" },
895
        { 1, "Final Descriptor Data" },
896
        { 2, "Final Descriptor Data With Non-Descriptor Data" },
897
        { 3, "Preliminary Descriptor Data" },
898
        { 0, NULL }
899
};
900
901
/* GEV 2.2 */
902
static const value_string gendc_header_type_values[] = {
903
    { GENDC_HEADER_TYPE_CONTAINER , "Container" },
904
    { GENDC_HEADER_TYPE_COMPONENT_HEADER , "Component Header" },
905
    { GENDC_HEADER_TYPE_PART_CHUNK, "Chunk" },
906
    { GENDC_HEADER_TYPE_PART_XML, "GenICam XML" },
907
    { GENDC_HEADER_TYPE_PART_1D, "1D Array" },
908
    { GENDC_HEADER_TYPE_PART_2D, "2D Array" },
909
    { GENDC_HEADER_TYPE_PART_2D_JPEG, "JPEG Image" },
910
    { GENDC_HEADER_TYPE_PART_2D_JPEG2000, "JPEG 2000 Image" },
911
    { GENDC_HEADER_TYPE_PART_2D_H264, "H.264 Image" },
912
    { 0, NULL }
913
};
914
915
/* GEV 2.2 */
916
static const val64_string gendc_component_typeid_values[] = {
917
    { GENDC_COMPONENT_TYPEID_UNDEFINED , "Undefined" },
918
    { GENDC_COMPONENT_TYPEID_INTENSITY , "Intensity" },
919
    { GENDC_COMPONENT_TYPEID_INFRARED , "Infrared" },
920
    { GENDC_COMPONENT_TYPEID_ULTRAVIOLET , "Ultraviolet" },
921
    { GENDC_COMPONENT_TYPEID_RANGE , "Range" },
922
    { GENDC_COMPONENT_TYPEID_REFLECTANCE , "Reflectance" },
923
    { GENDC_COMPONENT_TYPEID_CONFIDENCE , "Confidence" },
924
    { GENDC_COMPONENT_TYPEID_SCATTER , "Scatter" },
925
    { GENDC_COMPONENT_TYPEID_DISPARITY , "Disparity" },
926
    { GENDC_COMPONENT_TYPEID_MULTISPECTRAL , "Multispectral" },
927
    { GENDC_COMPONENT_TYPEID_METADATA , "Metadata" },
928
    { GENDC_COMPONENT_TYPEID_RESERVED , "Reserved" },
929
    { 0, NULL }
930
};
931
932
static int hf_gvsp_status;
933
static int hf_gvsp_blockid16;
934
static int hf_gvsp_flags;
935
static int hf_gvsp_flagdevicespecific0;
936
static int hf_gvsp_flagdevicespecific1;
937
static int hf_gvsp_flagdevicespecific2;
938
static int hf_gvsp_flagdevicespecific3;
939
static int hf_gvsp_flagdevicespecific4;
940
static int hf_gvsp_flagdevicespecific5;
941
static int hf_gvsp_flagdevicespecific6;
942
static int hf_gvsp_flagdevicespecific7;
943
static int hf_gvsp_flagresendrangeerror;
944
static int hf_gvsp_flagpreviousblockdropped;
945
static int hf_gvsp_flagpacketresend;
946
static int hf_gvsp_format;
947
static int hf_gvsp_packetid24;
948
static int hf_gvsp_blockid64;
949
static int hf_gvsp_packetid32;
950
static int hf_gvsp_payloadtype;
951
static int hf_gvsp_payloaddata;
952
static int hf_gvsp_timestamp;
953
static int hf_gvsp_pixelformat;
954
static int hf_gvsp_sizex;
955
static int hf_gvsp_sizey;
956
static int hf_gvsp_offsetx;
957
static int hf_gvsp_offsety;
958
static int hf_gvsp_paddingx;
959
static int hf_gvsp_paddingy;
960
static int hf_gvsp_payloaddatasize;
961
static int hf_gvsp_pixelcolor;
962
static int hf_gvsp_pixeloccupy;
963
static int hf_gvsp_pixelid;
964
static int hf_gvsp_filename;
965
static int hf_gvsp_payloadlength;
966
static int hf_gvsp_fieldinfo;
967
static int hf_gvsp_fieldid;
968
static int hf_gvsp_fieldcount;
969
static int hf_gvsp_genericflags;
970
static int hf_gvsp_timestamptickfrequency;
971
static int hf_gvsp_dataformat;
972
static int hf_gvsp_packetizationmode;
973
static int hf_gvsp_packetsize;
974
static int hf_gvsp_profileidc;
975
static int hf_gvsp_cs;
976
static int hf_gvsp_cs0;
977
static int hf_gvsp_cs1;
978
static int hf_gvsp_cs2;
979
static int hf_gvsp_cs3;
980
static int hf_gvsp_levelidc;
981
static int hf_gvsp_sropinterleavingdepth;
982
static int hf_gvsp_sropmaxdondiff;
983
static int hf_gvsp_sropdeintbufreq;
984
static int hf_gvsp_sropinitbuftime;
985
static int hf_gvsp_add_zones;
986
static int hf_gvsp_zoneinfo;
987
static int hf_gvsp_zoneid;
988
static int hf_gvsp_endofzone;
989
static int hf_gvsp_addressoffset;
990
static int hf_gvsp_sc_zone_direction;
991
static int hf_gvsp_sc_zone0_direction;
992
static int hf_gvsp_sc_zone1_direction;
993
static int hf_gvsp_sc_zone2_direction;
994
static int hf_gvsp_sc_zone3_direction;
995
static int hf_gvsp_sc_zone4_direction;
996
static int hf_gvsp_sc_zone5_direction;
997
static int hf_gvsp_sc_zone6_direction;
998
static int hf_gvsp_sc_zone7_direction;
999
static int hf_gvsp_sc_zone8_direction;
1000
static int hf_gvsp_sc_zone9_direction;
1001
static int hf_gvsp_sc_zone10_direction;
1002
static int hf_gvsp_sc_zone11_direction;
1003
static int hf_gvsp_sc_zone12_direction;
1004
static int hf_gvsp_sc_zone13_direction;
1005
static int hf_gvsp_sc_zone14_direction;
1006
static int hf_gvsp_sc_zone15_direction;
1007
static int hf_gvsp_sc_zone16_direction;
1008
static int hf_gvsp_sc_zone17_direction;
1009
static int hf_gvsp_sc_zone18_direction;
1010
static int hf_gvsp_sc_zone19_direction;
1011
static int hf_gvsp_sc_zone20_direction;
1012
static int hf_gvsp_sc_zone21_direction;
1013
static int hf_gvsp_sc_zone22_direction;
1014
static int hf_gvsp_sc_zone23_direction;
1015
static int hf_gvsp_sc_zone24_direction;
1016
static int hf_gvsp_sc_zone25_direction;
1017
static int hf_gvsp_sc_zone26_direction;
1018
static int hf_gvsp_sc_zone27_direction;
1019
static int hf_gvsp_sc_zone28_direction;
1020
static int hf_gvsp_sc_zone29_direction;
1021
static int hf_gvsp_sc_zone30_direction;
1022
static int hf_gvsp_sc_zone31_direction;
1023
static int hf_gvsp_numparts;
1024
static int hf_gvsp_multipart_data_type;
1025
static int hf_gvsp_partlength;
1026
static int hf_gvsp_multi_part_source_id;
1027
static int hf_gvsp_data_purpose_id;
1028
static int hf_gvsp_region_id;
1029
static int hf_gvsp_endofpart;
1030
static int hf_gvsp_add_zones_multipart;
1031
static int hf_gvsp_zoneinfo_multipart;
1032
static int hf_gvsp_multi_part_part_id;
1033
static int hf_gvsp_data_type_specific;
1034
static int hf_gvsp_chunk_data_payload_length_hex;
1035
static int hf_gvsp_chunk_layout_id_hex;
1036
1037
/* Added for 2.2 support */
1038
static int hf_gvsp_gendc_leader_descriptor_size_v2_2;
1039
static int hf_gvsp_gendc_leader_flags_v2_2;
1040
static int hf_gvsp_gendc_leader_flags_preliminary_descriptor_v2_2;
1041
static int hf_gvsp_gendc_leader_flags_reserved_v2_2;
1042
static int hf_gvsp_gendc_payload_data_size_v2_2;
1043
static int hf_gvsp_gendc_payload_data_destination_offset_v2_2;
1044
static int hf_gvsp_gendc_payload_data_flags_v2_2;
1045
static int hf_gvsp_gendc_payload_data_flag_descriptor_flags_v2_2;
1046
static int hf_gvsp_gendc_payload_data_flag_start_of_descriptor_data_v2_2;
1047
static int hf_gvsp_gendc_payload_data_flag_end_of_descriptor_data_v2_2;
1048
static int hf_gvsp_gendc_payload_data_flags_reserved_v2_2;
1049
static int hf_gvsp_gendc_payload_flow_flags_v2_2;
1050
static int hf_gvsp_gendc_payload_flow_flag_first_packet_v2_2;
1051
static int hf_gvsp_gendc_payload_flow_flag_last_packet_v2_2;
1052
static int hf_gvsp_gendc_payload_flow_id_v2_2;
1053
static int hf_gvsp_gendc_header_size_v2_2;
1054
static int hf_gvsp_gendc_header_type_v2_2;
1055
static int hf_gvsp_gendc_header_reserved_1_byte_v2_2;
1056
static int hf_gvsp_gendc_header_reserved_2_bytes_v2_2;
1057
static int hf_gvsp_gendc_header_reserved_4_bytes_v2_2;
1058
static int hf_gvsp_gendc_container_header_signature_v2_2;
1059
static int hf_gvsp_gendc_container_header_version_major_v2_2;
1060
static int hf_gvsp_gendc_container_header_version_minor_v2_2;
1061
static int hf_gvsp_gendc_container_header_version_sub_minor_v2_2;
1062
static int hf_gvsp_gendc_container_header_flags_v2_2;
1063
static int hf_gvsp_gendc_container_header_flags_timestamp_ptp_v2_2;
1064
static int hf_gvsp_gendc_container_header_flags_component_invalid_v2_2;
1065
static int hf_gvsp_gendc_container_header_flags_reserved_v2_2;
1066
static int hf_gvsp_gendc_container_header_id_v2_2;
1067
static int hf_gvsp_gendc_container_header_variable_fields_v2_2;
1068
static int hf_gvsp_gendc_container_header_variable_fields_data_size_v2_2;
1069
static int hf_gvsp_gendc_container_header_variable_fields_size_x_v2_2;
1070
static int hf_gvsp_gendc_container_header_variable_fields_size_y_v2_2;
1071
static int hf_gvsp_gendc_container_header_variable_fields_region_offset_v2_2;
1072
static int hf_gvsp_gendc_container_header_variable_fields_format_v2_2;
1073
static int hf_gvsp_gendc_container_header_variable_fields_timestamp_v2_2;
1074
static int hf_gvsp_gendc_container_header_variable_fields_component_count_v2_2;
1075
static int hf_gvsp_gendc_container_header_variable_fields_component_invalid_v2_2;
1076
static int hf_gvsp_gendc_container_header_variable_fields_reserved_v2_2;
1077
static int hf_gvsp_gendc_container_header_data_size_v2_2;
1078
static int hf_gvsp_gendc_container_header_data_offset_v2_2;
1079
static int hf_gvsp_gendc_container_header_descriptor_size_v2_2;
1080
static int hf_gvsp_gendc_container_header_component_count_v2_2;
1081
static int hf_gvsp_gendc_container_header_component_offset_v2_2;
1082
static int hf_gvsp_gendc_component_header_flags_v2_2;
1083
static int hf_gvsp_gendc_component_header_flags_invalid_v2_2;
1084
static int hf_gvsp_gendc_component_header_flags_reserved_v2_2;
1085
static int hf_gvsp_gendc_component_header_group_id_v2_2;
1086
static int hf_gvsp_gendc_component_header_source_id_v2_2;
1087
static int hf_gvsp_gendc_component_header_region_id_v2_2;
1088
static int hf_gvsp_gendc_component_header_type_id_v2_2;
1089
static int hf_gvsp_gendc_component_header_part_count_v2_2;
1090
static int hf_gvsp_gendc_component_header_part_offset_v2_2;
1091
static int hf_gvsp_gendc_part_header_flags_xml_reserved1_v2_2;
1092
static int hf_gvsp_gendc_part_header_flags_xml_zip_v2_2;
1093
static int hf_gvsp_gendc_part_header_flags_xml_chunk_v2_2;
1094
static int hf_gvsp_gendc_part_header_flags_xml_reserved2_v2_2;
1095
static int hf_gvsp_gendc_part_header_flags_v2_2;
1096
static int hf_gvsp_gendc_part_header_flow_offset_v2_2;
1097
static int hf_gvsp_gendc_part_header_type_specific_info_v2_2;
1098
static int hf_gvsp_gendc_part_header_1D_size_v2_2;
1099
static int hf_gvsp_gendc_part_header_1D_padding_v2_2;
1100
1101
static int * const pixelformat_fields[] = {
1102
    &hf_gvsp_pixelcolor,
1103
    &hf_gvsp_pixeloccupy,
1104
    &hf_gvsp_pixelid,
1105
    NULL
1106
};
1107
1108
static int * const fieldinfo_fields[] = {
1109
    &hf_gvsp_fieldid,
1110
    &hf_gvsp_fieldcount,
1111
    NULL
1112
};
1113
1114
static int * const cs_fields[] = {
1115
    &hf_gvsp_cs0,
1116
    &hf_gvsp_cs1,
1117
    &hf_gvsp_cs2,
1118
    &hf_gvsp_cs3,
1119
    NULL
1120
};
1121
1122
static int * const sc_zone_direction_fields[] = {
1123
    &hf_gvsp_sc_zone0_direction,
1124
    &hf_gvsp_sc_zone1_direction,
1125
    &hf_gvsp_sc_zone2_direction,
1126
    &hf_gvsp_sc_zone3_direction,
1127
    &hf_gvsp_sc_zone4_direction,
1128
    &hf_gvsp_sc_zone5_direction,
1129
    &hf_gvsp_sc_zone6_direction,
1130
    &hf_gvsp_sc_zone7_direction,
1131
    &hf_gvsp_sc_zone8_direction,
1132
    &hf_gvsp_sc_zone9_direction,
1133
    &hf_gvsp_sc_zone10_direction,
1134
    &hf_gvsp_sc_zone11_direction,
1135
    &hf_gvsp_sc_zone12_direction,
1136
    &hf_gvsp_sc_zone13_direction,
1137
    &hf_gvsp_sc_zone14_direction,
1138
    &hf_gvsp_sc_zone15_direction,
1139
    &hf_gvsp_sc_zone16_direction,
1140
    &hf_gvsp_sc_zone17_direction,
1141
    &hf_gvsp_sc_zone18_direction,
1142
    &hf_gvsp_sc_zone19_direction,
1143
    &hf_gvsp_sc_zone20_direction,
1144
    &hf_gvsp_sc_zone21_direction,
1145
    &hf_gvsp_sc_zone22_direction,
1146
    &hf_gvsp_sc_zone23_direction,
1147
    &hf_gvsp_sc_zone24_direction,
1148
    &hf_gvsp_sc_zone25_direction,
1149
    &hf_gvsp_sc_zone26_direction,
1150
    &hf_gvsp_sc_zone27_direction,
1151
    &hf_gvsp_sc_zone28_direction,
1152
    &hf_gvsp_sc_zone29_direction,
1153
    &hf_gvsp_sc_zone30_direction,
1154
    &hf_gvsp_sc_zone31_direction,
1155
    NULL
1156
};
1157
1158
static int * const zoneinfo_fields[] = {
1159
    &hf_gvsp_zoneid,
1160
    &hf_gvsp_endofzone,
1161
    NULL
1162
};
1163
1164
static int * const zoneinfo_multipart_fields[] = {
1165
    &hf_gvsp_endofpart,
1166
    &hf_gvsp_zoneid,
1167
    &hf_gvsp_endofzone,
1168
    NULL
1169
};
1170
1171
static int * const flags_fields[] = {
1172
    &hf_gvsp_flagdevicespecific0,
1173
    &hf_gvsp_flagdevicespecific1,
1174
    &hf_gvsp_flagdevicespecific2,
1175
    &hf_gvsp_flagdevicespecific3,
1176
    &hf_gvsp_flagdevicespecific4,
1177
    &hf_gvsp_flagdevicespecific5,
1178
    &hf_gvsp_flagdevicespecific6,
1179
    &hf_gvsp_flagdevicespecific7,
1180
    &hf_gvsp_flagresendrangeerror,
1181
    &hf_gvsp_flagpreviousblockdropped,
1182
    &hf_gvsp_flagpacketresend,
1183
    NULL
1184
};
1185
1186
static int * const gendc_leader_flags_fields[] = {
1187
    &hf_gvsp_gendc_leader_flags_reserved_v2_2,
1188
    &hf_gvsp_gendc_leader_flags_preliminary_descriptor_v2_2,
1189
    NULL
1190
};
1191
1192
static int * const gendc_payload_data_flags_fields[] = {
1193
    &hf_gvsp_gendc_payload_data_flag_descriptor_flags_v2_2,
1194
    &hf_gvsp_gendc_payload_data_flag_start_of_descriptor_data_v2_2,
1195
    &hf_gvsp_gendc_payload_data_flag_end_of_descriptor_data_v2_2,
1196
    &hf_gvsp_gendc_payload_data_flags_reserved_v2_2,
1197
    NULL
1198
};
1199
1200
static int * const gendc_payload_flow_flags_fields[] = {
1201
    &hf_gvsp_gendc_payload_flow_flag_first_packet_v2_2,
1202
    &hf_gvsp_gendc_payload_flow_flag_last_packet_v2_2,
1203
    NULL
1204
};
1205
1206
static int * const gendc_container_header_flags_fields[] = {
1207
    &hf_gvsp_gendc_container_header_flags_timestamp_ptp_v2_2,
1208
    &hf_gvsp_gendc_container_header_flags_component_invalid_v2_2,
1209
    &hf_gvsp_gendc_container_header_flags_reserved_v2_2,
1210
    NULL
1211
};
1212
1213
static int * const gendc_container_header_variable_fields_fields[] = {
1214
    &hf_gvsp_gendc_container_header_variable_fields_data_size_v2_2,
1215
    &hf_gvsp_gendc_container_header_variable_fields_size_x_v2_2,
1216
    &hf_gvsp_gendc_container_header_variable_fields_size_y_v2_2,
1217
    &hf_gvsp_gendc_container_header_variable_fields_region_offset_v2_2,
1218
    &hf_gvsp_gendc_container_header_variable_fields_format_v2_2,
1219
    &hf_gvsp_gendc_container_header_variable_fields_timestamp_v2_2,
1220
    &hf_gvsp_gendc_container_header_variable_fields_component_count_v2_2,
1221
    &hf_gvsp_gendc_container_header_variable_fields_component_invalid_v2_2,
1222
    &hf_gvsp_gendc_container_header_variable_fields_reserved_v2_2,
1223
    NULL
1224
};
1225
1226
static int * const gendc_component_header_flags_fields[] = {
1227
    &hf_gvsp_gendc_component_header_flags_invalid_v2_2,
1228
    &hf_gvsp_gendc_component_header_flags_reserved_v2_2,
1229
    NULL
1230
};
1231
1232
static int * const gendc_part_header_flags_fields[] = {
1233
    &hf_gvsp_gendc_part_header_flags_xml_reserved1_v2_2,
1234
    &hf_gvsp_gendc_part_header_flags_xml_zip_v2_2,
1235
    &hf_gvsp_gendc_part_header_flags_xml_chunk_v2_2,
1236
    &hf_gvsp_gendc_part_header_flags_xml_reserved2_v2_2,
1237
    NULL
1238
};
1239
1240
/*
1241
    \brief Dissects the image dimensions
1242
 */
1243
1244
static void dissect_image_dimensions(proto_tree *gvsp_tree, tvbuff_t *tvb, int offset, const unsigned encoding)
1245
0
{
1246
    /* Size X */
1247
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_sizex, tvb, offset, 4, encoding);
1248
1249
    /* Size Y */
1250
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_sizey, tvb, offset + 4, 4, encoding);
1251
1252
    /* Padding X */
1253
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_paddingx, tvb, offset + 8, 2, encoding);
1254
1255
    /* Padding Y */
1256
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_paddingy, tvb, offset + 10, 2, encoding);
1257
0
}
1258
1259
/*
1260
    \brief Dissects the image AOI
1261
 */
1262
1263
static void dissect_image_aoi(proto_tree *gvsp_tree, tvbuff_t *tvb, int offset)
1264
0
{
1265
    /* Size X */
1266
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_sizex, tvb, offset, 4, ENC_BIG_ENDIAN);
1267
1268
    /* Size Y */
1269
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_sizey, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
1270
1271
    /* Offset X */
1272
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_offsetx, tvb, offset + 8, 4, ENC_BIG_ENDIAN);
1273
1274
    /* Offset Y */
1275
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_offsety, tvb, offset + 12, 4, ENC_BIG_ENDIAN);
1276
1277
    /* Padding X */
1278
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_paddingx, tvb, offset + 16, 2, ENC_BIG_ENDIAN);
1279
1280
    /* Padding Y */
1281
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_paddingy, tvb, offset + 18, 2, ENC_BIG_ENDIAN);
1282
0
}
1283
1284
/*
1285
    \brief Dissects the image leader
1286
 */
1287
1288
static int dissect_image_leader(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1289
0
{
1290
    /* Field info */
1291
0
    proto_tree_add_bitmask(gvsp_tree, tvb, offset, hf_gvsp_fieldinfo,
1292
0
                           ett_gvsp_fieldinfo, fieldinfo_fields, ENC_BIG_ENDIAN);
1293
1294
    /* Payload type */
1295
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1296
1297
    /* Timestamp */
1298
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_timestamp, tvb, offset + 4, 8, ENC_BIG_ENDIAN);
1299
1300
    /* Pixel format */
1301
0
    proto_tree_add_bitmask(gvsp_tree, tvb, offset + 12, hf_gvsp_pixelformat, ett_gvsp_pixelformat,
1302
0
                                  pixelformat_fields, ENC_BIG_ENDIAN);
1303
1304
    /* AOI */
1305
0
    dissect_image_aoi(gvsp_tree, tvb, offset + 16);
1306
1307
    /* Return dissected byte count (for all-in dissection) */
1308
0
    return 36;
1309
0
}
1310
1311
1312
/*
1313
    \brief Dissects the image trailer
1314
 */
1315
1316
static int dissect_image_trailer(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1317
0
{
1318
    /* Payload type */
1319
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1320
1321
    /* Size Y */
1322
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_sizey, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
1323
1324
    /* Return dissected byte count (for all-in and extended chunk mode dissection) */
1325
0
    return 8;
1326
0
}
1327
1328
1329
/*
1330
    \brief Dissects the multi-part trailer
1331
 */
1332
1333
static int dissect_multi_part_trailer(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1334
0
{
1335
0
    int part_count = tvb_reported_length_remaining(tvb, offset + 4) / GVSP_SIZE_OF_PART_INFO_TRAILER;
1336
0
    int i = 0;
1337
0
    int j = 0;
1338
1339
    /* Payload type */
1340
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1341
1342
0
    for (i = 0; i < part_count; i++)
1343
0
    {
1344
0
        uint16_t multi_part_data_type = tvb_get_ntohs(tvb, offset + 4 + i * GVSP_SIZE_OF_PART_INFO_TRAILER);
1345
1346
        /* Add a tree per part */
1347
0
        proto_tree* gvsp_part_tree = proto_tree_add_subtree(gvsp_tree, tvb, offset + 4 + i * GVSP_SIZE_OF_PART_INFO_TRAILER, GVSP_SIZE_OF_PART_INFO_TRAILER, ett_gvsp_partinfo_trailer, NULL, "Part Specific Data");
1348
1349
        /* Multi-Part data type */
1350
0
        proto_tree_add_item(gvsp_part_tree, hf_gvsp_multipart_data_type, tvb, offset + 4 + i * GVSP_SIZE_OF_PART_INFO_TRAILER, 2, ENC_BIG_ENDIAN);
1351
1352
        /* Part Length */
1353
0
        proto_tree_add_item(gvsp_part_tree, hf_gvsp_partlength, tvb, offset + 6 + i * GVSP_SIZE_OF_PART_INFO_TRAILER, 6, ENC_BIG_ENDIAN);
1354
1355
0
        switch( multi_part_data_type )
1356
0
        {
1357
0
        case GVSP_MULTIPART_DATA_TYPE_2DIMAGE:
1358
0
        case GVSP_MULTIPART_DATA_TYPE_2DPLANEBIPLANAR:
1359
0
        case GVSP_MULTIPART_DATA_TYPE_2DPLANETRIPLANAR:
1360
0
        case GVSP_MULTIPART_DATA_TYPE_2DPLANEQUADPLANAR:
1361
0
        case GVSP_MULTIPART_DATA_TYPE_3DIMAGE:
1362
0
        case GVSP_MULTIPART_DATA_TYPE_3DPLANEBIPLANAR:
1363
0
        case GVSP_MULTIPART_DATA_TYPE_3DPLANETRIPLANAR:
1364
0
        case GVSP_MULTIPART_DATA_TYPE_3DPLANEQUADPLANAR:
1365
0
        case GVSP_MULTIPART_DATA_TYPE_CONFIDENCEMAP:
1366
            /* Size Y */
1367
0
            proto_tree_add_item(gvsp_part_tree, hf_gvsp_sizey, tvb, offset + 12 + i * GVSP_SIZE_OF_PART_INFO_TRAILER, 4, ENC_BIG_ENDIAN);
1368
0
            break;
1369
0
        default:
1370
            /* 2 DWORDS of data type specific data */
1371
0
            for (j = 0; j < 2; j++)
1372
0
            {
1373
0
                proto_tree_add_item(gvsp_part_tree, hf_gvsp_data_type_specific, tvb, offset + 12 + i * GVSP_SIZE_OF_PART_INFO_TRAILER + 4 * j, 4, ENC_BIG_ENDIAN);
1374
0
            }
1375
0
            break;
1376
0
        }
1377
0
    }
1378
1379
    /* Return dissected byte count (for all-in and extended chunk mode dissection) */
1380
0
    return 4 + part_count * GVSP_SIZE_OF_PART_INFO_TRAILER;
1381
0
}
1382
1383
1384
/*
1385
    \brief Dissects the raw data leader
1386
 */
1387
1388
static int dissect_raw_data_leader(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1389
0
{
1390
    /* Payload type */
1391
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1392
1393
    /* Timestamp */
1394
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_timestamp, tvb, offset + 4, 8, ENC_BIG_ENDIAN);
1395
1396
    /* Payload data size */
1397
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloaddatasize, tvb, offset + 12, 8, ENC_BIG_ENDIAN);
1398
1399
    /* Return dissected byte count (for all-in dissection) */
1400
0
    return 20;
1401
0
}
1402
1403
1404
/*
1405
    \brief Dissects a file leader
1406
 */
1407
1408
static int dissect_file_leader(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1409
0
{
1410
0
    unsigned file_length = 0;
1411
1412
    /* Payload type */
1413
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1414
1415
    /* Timestamp */
1416
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_timestamp, tvb, offset + 4, 8, ENC_BIG_ENDIAN);
1417
1418
    /* Payload data size */
1419
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloaddatasize, tvb, offset + 12, 8, ENC_BIG_ENDIAN);
1420
1421
    /* Filename */
1422
0
    file_length = tvb_strsize(tvb, offset + 20);
1423
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_filename, tvb, offset + 20, file_length, ENC_ASCII);
1424
1425
0
    if (20 + file_length > INT_MAX)
1426
0
        return -1;
1427
1428
    /* Return dissected byte count (for all-in dissection) */
1429
0
    return (int)(20 + file_length);
1430
0
}
1431
1432
1433
/*
1434
    \brief Dissects a chunk data leader
1435
 */
1436
1437
static int dissect_chunk_data_leader(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1438
0
{
1439
    /* Payload type */
1440
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1441
1442
    /* Timestamp */
1443
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_timestamp, tvb, offset + 4, 8, ENC_BIG_ENDIAN);
1444
1445
    /* Return dissected byte count (for all-in dissection) */
1446
0
    return 12;
1447
0
}
1448
1449
1450
/*
1451
    \brief Dissects a chunk data trailer
1452
 */
1453
1454
static int dissect_chunk_data_trailer(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1455
0
{
1456
    /* Payload type */
1457
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1458
1459
    /* Payload data length */
1460
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadlength, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
1461
1462
    /* Return dissected byte count (for all-in dissection) */
1463
0
    return 8;
1464
0
}
1465
1466
1467
/*
1468
    \brief Dissects extended chunk data leader
1469
 */
1470
1471
static int dissect_extended_chunk_data_leader(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1472
0
{
1473
    /* Field info */
1474
0
    proto_tree_add_bitmask(gvsp_tree, tvb, offset, hf_gvsp_fieldinfo,
1475
0
                                  ett_gvsp_fieldinfo, fieldinfo_fields, ENC_BIG_ENDIAN);
1476
    /* Generic flags */
1477
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_genericflags, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
1478
1479
    /* Payload type */
1480
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1481
1482
    /* Timestamp */
1483
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_timestamp, tvb, offset + 4, 8, ENC_BIG_ENDIAN);
1484
1485
    /* Pixel format */
1486
0
    proto_tree_add_bitmask(gvsp_tree, tvb, offset + 12, hf_gvsp_pixelformat, ett_gvsp_pixelformat,
1487
0
                                  pixelformat_fields, ENC_BIG_ENDIAN);
1488
1489
    /* AOI */
1490
0
    dissect_image_aoi(gvsp_tree, tvb, offset + 16);
1491
1492
    /* Return dissected byte count (for all-in dissection) */
1493
0
    return 36;
1494
0
}
1495
1496
1497
/*
1498
    \brief Dissects extended chunk data trailer
1499
 */
1500
1501
static int dissect_extended_chunk_data_trailer(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1502
0
{
1503
    /* Payload type */
1504
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1505
1506
    /* Payload data length */
1507
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadlength, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
1508
1509
    /* Size Y */
1510
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_sizey, tvb, offset + 8, 4, ENC_BIG_ENDIAN);
1511
1512
    /* Chunk layout ID */
1513
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_chunk_layout_id_hex, tvb, offset + 12, 4, ENC_BIG_ENDIAN);
1514
1515
    /* Return dissected byte count (for all-in dissection) */
1516
0
    return 16;
1517
0
}
1518
1519
1520
/*
1521
    \brief Dissects a JPEG leader
1522
 */
1523
1524
static int dissect_jpeg_leader(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1525
0
{
1526
    /* Field info */
1527
0
    proto_tree_add_bitmask(gvsp_tree, tvb, offset, hf_gvsp_fieldinfo,
1528
0
                                  ett_gvsp_fieldinfo, fieldinfo_fields, ENC_BIG_ENDIAN);
1529
1530
    /* Generic flags */
1531
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_genericflags, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
1532
1533
    /* Payload type */
1534
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1535
1536
    /* Timestamp */
1537
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_timestamp, tvb, offset + 4, 8, ENC_BIG_ENDIAN);
1538
1539
    /* Payload data size */
1540
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloaddatasize, tvb, offset + 12, 8, ENC_BIG_ENDIAN);
1541
1542
    /* Timestamp tick frequency */
1543
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_timestamptickfrequency, tvb, offset + 20, 8, ENC_BIG_ENDIAN);
1544
1545
    /* Data format */
1546
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_dataformat, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
1547
1548
    /* Return dissected byte count (for all-in dissection) */
1549
0
    return 32;
1550
0
}
1551
1552
1553
/*
1554
 \brief Dissects a H264 leader
1555
 */
1556
1557
static void dissect_h264_leader_common(proto_tree *gvsp_tree, tvbuff_t *tvb, int offset, const unsigned encoding)
1558
0
{
1559
    /* profile_idc */
1560
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_profileidc, tvb, offset, 1, encoding);
1561
1562
    /* cs0, 1, 2 ,3 */
1563
0
    proto_tree_add_bitmask(gvsp_tree, tvb, offset + 1, hf_gvsp_cs, ett_gvsp_cs,
1564
0
        cs_fields, encoding);
1565
1566
    /* level_idc */
1567
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_levelidc, tvb, offset + 2, 1, encoding);
1568
1569
    /* srop_interleaving_depth */
1570
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_sropinterleavingdepth, tvb, offset + 3, 2, encoding);
1571
1572
    /* srop_max_don_diff */
1573
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_sropmaxdondiff, tvb, offset + 5, 2, encoding);
1574
1575
    /* srop_deint_buf_req */
1576
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_sropdeintbufreq, tvb, offset + 7, 4, encoding);
1577
1578
    /* srop_init_buf_time */
1579
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_sropinitbuftime, tvb, offset + 11, 4, encoding);
1580
0
}
1581
1582
static int dissect_h264_leader(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1583
0
{
1584
    /* Field info */
1585
0
    proto_tree_add_bitmask(gvsp_tree, tvb, offset, hf_gvsp_fieldinfo,
1586
0
                                  ett_gvsp_fieldinfo, fieldinfo_fields, ENC_BIG_ENDIAN);
1587
1588
    /* Payload type */
1589
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1590
1591
    /* Payload data size */
1592
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloaddatasize, tvb, offset + 4, 8, ENC_BIG_ENDIAN);
1593
1594
    /* packetization_mode */
1595
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_packetizationmode, tvb, offset + 13, 1, ENC_BIG_ENDIAN);
1596
1597
    /* packet_size */
1598
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_packetsize, tvb, offset + 14, 2, ENC_BIG_ENDIAN);
1599
1600
0
    dissect_h264_leader_common(gvsp_tree, tvb, offset + 17, ENC_BIG_ENDIAN);
1601
1602
    /* Return dissected byte count (for all-in dissection) */
1603
0
    return 32;
1604
0
}
1605
1606
1607
/*
1608
    \brief Dissects the multi-zone image leader
1609
 */
1610
1611
static int dissect_multizone_image_leader(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1612
0
{
1613
    /* Field info */
1614
0
    proto_tree_add_bitmask(gvsp_tree, tvb, offset, hf_gvsp_fieldinfo,
1615
0
                                  ett_gvsp_fieldinfo, fieldinfo_fields, ENC_BIG_ENDIAN);
1616
    /* Payload type */
1617
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1618
1619
    /* Timestamp */
1620
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_timestamp, tvb, offset + 4, 8, ENC_BIG_ENDIAN);
1621
1622
    /* Zone direction */
1623
0
    proto_tree_add_bitmask(gvsp_tree, tvb, offset + 12, hf_gvsp_sc_zone_direction,
1624
0
                           ett_gvsp_sc_zone_direction, sc_zone_direction_fields, ENC_BIG_ENDIAN);
1625
1626
    /* Pixel format */
1627
0
    proto_tree_add_bitmask(gvsp_tree, tvb, offset + 16, hf_gvsp_pixelformat, ett_gvsp_pixelformat,
1628
0
                                  pixelformat_fields, ENC_BIG_ENDIAN);
1629
1630
    /* AOI */
1631
0
    dissect_image_aoi(gvsp_tree, tvb, offset + 20);
1632
1633
    /* Return dissected byte count (for all-in dissection) */
1634
0
    return 40;
1635
0
}
1636
1637
1638
/*
1639
    \brief Dissects the multi-part leader
1640
 */
1641
1642
static int dissect_multi_part_leader(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1643
0
{
1644
    /* Get the number of parts from the header. As we are already looking at the beginning of the sixth DWORD here we must step back */
1645
0
    int part_count_from_leader = tvb_get_uint8(tvb, offset - 13);
1646
0
    int part_count_from_remaining_bytes = tvb_reported_length_remaining(tvb, offset + 12) / GVSP_SIZE_OF_PART_INFO_LEADER;
1647
    /* In case the leader contains incorrect data rely on the number of reported bytes instead */
1648
0
    int part_count = part_count_from_leader <= part_count_from_remaining_bytes ? part_count_from_leader : part_count_from_remaining_bytes;
1649
0
    int i = 0;
1650
0
    int j = 0;
1651
1652
    /* Payload type */
1653
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1654
1655
    /* Timestamp */
1656
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_timestamp, tvb, offset + 4, 8, ENC_BIG_ENDIAN);
1657
1658
0
    for (i = 0; i < part_count; i++)
1659
0
    {
1660
0
        uint16_t multi_part_data_type = tvb_get_ntohs(tvb, offset + 12 + i * GVSP_SIZE_OF_PART_INFO_LEADER);
1661
        /* Add a tree per part */
1662
0
        proto_tree* gvsp_part_tree = proto_tree_add_subtree(gvsp_tree, tvb, offset + 12 + i * GVSP_SIZE_OF_PART_INFO_LEADER, GVSP_SIZE_OF_PART_INFO_LEADER,
1663
0
            ett_gvsp_partinfo_leader, NULL, "Part Specific Data");
1664
1665
        /* Multi-Part data type */
1666
0
        proto_tree_add_item(gvsp_part_tree, hf_gvsp_multipart_data_type, tvb, offset + 12 + i * GVSP_SIZE_OF_PART_INFO_LEADER, 2, ENC_BIG_ENDIAN);
1667
1668
        /* Part Length */
1669
0
        proto_tree_add_item(gvsp_part_tree, hf_gvsp_partlength, tvb, offset + 14 + i * GVSP_SIZE_OF_PART_INFO_LEADER, 6, ENC_BIG_ENDIAN);
1670
1671
0
        switch( multi_part_data_type )
1672
0
        {
1673
0
        case GVSP_MULTIPART_DATA_TYPE_2DIMAGE:
1674
0
        case GVSP_MULTIPART_DATA_TYPE_2DPLANEBIPLANAR:
1675
0
        case GVSP_MULTIPART_DATA_TYPE_2DPLANETRIPLANAR:
1676
0
        case GVSP_MULTIPART_DATA_TYPE_2DPLANEQUADPLANAR:
1677
0
        case GVSP_MULTIPART_DATA_TYPE_3DIMAGE:
1678
0
        case GVSP_MULTIPART_DATA_TYPE_3DPLANEBIPLANAR:
1679
0
        case GVSP_MULTIPART_DATA_TYPE_3DPLANETRIPLANAR:
1680
0
        case GVSP_MULTIPART_DATA_TYPE_3DPLANEQUADPLANAR:
1681
0
        case GVSP_MULTIPART_DATA_TYPE_CONFIDENCEMAP:
1682
            /* Pixel format */
1683
0
            proto_tree_add_bitmask(gvsp_part_tree, tvb, offset + 20 + i * GVSP_SIZE_OF_PART_INFO_LEADER, hf_gvsp_pixelformat, ett_gvsp_pixelformat, pixelformat_fields, ENC_BIG_ENDIAN);
1684
0
            break;
1685
0
        case GVSP_MULTIPART_DATA_TYPE_JPEG:
1686
0
        case GVSP_MULTIPART_DATA_TYPE_JPEG2000:
1687
0
        default:
1688
            /* Data Format */
1689
0
            proto_tree_add_item(gvsp_part_tree, hf_gvsp_dataformat, tvb, offset + 20 + i * GVSP_SIZE_OF_PART_INFO_LEADER, 4, ENC_BIG_ENDIAN);
1690
0
            break;
1691
0
        }
1692
1693
        /* Source ID */
1694
0
        proto_tree_add_item(gvsp_part_tree, hf_gvsp_multi_part_source_id, tvb, offset + 26 + i * GVSP_SIZE_OF_PART_INFO_LEADER, 1, ENC_BIG_ENDIAN);
1695
1696
        /* Additional Zones */
1697
0
        proto_tree_add_item(gvsp_part_tree, hf_gvsp_add_zones_multipart, tvb, offset + 27 + i * GVSP_SIZE_OF_PART_INFO_LEADER, 1, ENC_BIG_ENDIAN);
1698
1699
        /* Zone direction */
1700
0
        proto_tree_add_bitmask(gvsp_part_tree, tvb, offset + 28 + i * GVSP_SIZE_OF_PART_INFO_LEADER, hf_gvsp_sc_zone_direction,
1701
0
                               ett_gvsp_sc_zone_direction, sc_zone_direction_fields, ENC_BIG_ENDIAN);
1702
1703
        /* Data Purpose */
1704
0
        proto_tree_add_item(gvsp_part_tree, hf_gvsp_data_purpose_id, tvb, offset + 32 + i * GVSP_SIZE_OF_PART_INFO_LEADER, 2, ENC_BIG_ENDIAN);
1705
1706
        /* Region ID */
1707
0
        proto_tree_add_item(gvsp_part_tree, hf_gvsp_region_id, tvb, offset + 34 + i * GVSP_SIZE_OF_PART_INFO_LEADER, 2, ENC_BIG_ENDIAN);
1708
1709
0
        switch( multi_part_data_type )
1710
0
        {
1711
0
        case GVSP_MULTIPART_DATA_TYPE_2DIMAGE:
1712
0
        case GVSP_MULTIPART_DATA_TYPE_2DPLANEBIPLANAR:
1713
0
        case GVSP_MULTIPART_DATA_TYPE_2DPLANETRIPLANAR:
1714
0
        case GVSP_MULTIPART_DATA_TYPE_2DPLANEQUADPLANAR:
1715
0
        case GVSP_MULTIPART_DATA_TYPE_3DIMAGE:
1716
0
        case GVSP_MULTIPART_DATA_TYPE_3DPLANEBIPLANAR:
1717
0
        case GVSP_MULTIPART_DATA_TYPE_3DPLANETRIPLANAR:
1718
0
        case GVSP_MULTIPART_DATA_TYPE_3DPLANEQUADPLANAR:
1719
0
        case GVSP_MULTIPART_DATA_TYPE_CONFIDENCEMAP:
1720
0
            dissect_image_aoi(gvsp_part_tree, tvb, offset + 36 + i * GVSP_SIZE_OF_PART_INFO_LEADER);
1721
0
            break;
1722
0
        case GVSP_MULTIPART_DATA_TYPE_JPEG:
1723
0
        case GVSP_MULTIPART_DATA_TYPE_JPEG2000:
1724
            /* Generic flags */
1725
0
            proto_tree_add_item(gvsp_part_tree, hf_gvsp_genericflags, tvb, offset + 36 + i * GVSP_SIZE_OF_PART_INFO_LEADER, 1, ENC_BIG_ENDIAN);
1726
1727
            /* Timestamp tick frequency */
1728
0
            proto_tree_add_item(gvsp_part_tree, hf_gvsp_timestamptickfrequency, tvb, offset + 36 + i * GVSP_SIZE_OF_PART_INFO_LEADER + 4, 8, ENC_BIG_ENDIAN);
1729
1730
            /* Data format */
1731
0
            proto_tree_add_item(gvsp_part_tree, hf_gvsp_dataformat, tvb, offset + 36 + i * GVSP_SIZE_OF_PART_INFO_LEADER + 12, 4, ENC_BIG_ENDIAN);
1732
0
            break;
1733
0
        default:
1734
            /* 6 DWORDS of data type specific data */
1735
0
            for (j = 0; j < 6; j++)
1736
0
            {
1737
0
                proto_tree_add_item(gvsp_part_tree, hf_gvsp_data_type_specific, tvb, offset + 36 + i * GVSP_SIZE_OF_PART_INFO_LEADER + 4 * j, 4, ENC_BIG_ENDIAN);
1738
0
            }
1739
0
            break;
1740
0
        }
1741
0
    }
1742
1743
    /* Return dissected byte count (for all-in dissection) */
1744
0
    return 12 + part_count * GVSP_SIZE_OF_PART_INFO_LEADER;
1745
0
}
1746
1747
/*
1748
    \brief Dissects the GenDC leader
1749
 */
1750
1751
static int dissect_gendc_leader(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1752
0
{
1753
    /* Payload type */
1754
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1755
1756
    /* Timestamp */
1757
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_timestamp, tvb, offset + 4, 8, ENC_BIG_ENDIAN);
1758
1759
    /* Payload data size */
1760
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloaddatasize, tvb, offset + 12, 8, ENC_BIG_ENDIAN);
1761
1762
    /* Payload specific flags */
1763
0
    proto_tree_add_bitmask(gvsp_tree, tvb, offset + 20, hf_gvsp_gendc_leader_flags_v2_2,
1764
0
        ett_gvsp_gendc_leader_flags, gendc_leader_flags_fields, ENC_BIG_ENDIAN);
1765
1766
    /* GenDC descriptor size */
1767
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_gendc_leader_descriptor_size_v2_2, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
1768
1769
    /* Return dissected byte count (for all-in dissection) */
1770
0
    return 28;
1771
0
}
1772
1773
1774
/*
1775
    \brief Dissects a generic trailer (contains just the payload type)
1776
 */
1777
1778
static int dissect_generic_trailer(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1779
0
{
1780
    /* Payload type */
1781
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_payloadtype, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
1782
1783
    /* Return dissected byte count (for all-in dissection) */
1784
0
    return 4;
1785
0
}
1786
1787
1788
/*
1789
    \brief Dissects a generic trailer (contains just the payload type)
1790
 */
1791
1792
static int dissect_extra_chunk_info(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
1793
0
{
1794
    /* Chunk data payload length */
1795
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_chunk_data_payload_length_hex, tvb, offset, 4, ENC_BIG_ENDIAN);
1796
1797
    /* Chunk layout id */
1798
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_chunk_layout_id_hex, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
1799
1800
    /* Return dissected byte count (for all-in dissection) */
1801
0
    return 8;
1802
0
}
1803
1804
1805
/*
1806
    \brief Check if a packet with given status has payload
1807
 */
1808
0
static bool status_with_payload(gvsp_packet_info *info){
1809
0
    return info->status == GEV_STATUS_SUCCESS || ( info->enhanced && info->status == GEV_STATUS_PACKET_RESEND);
1810
0
}
1811
1812
/*
1813
    \brief Dissects a packet payload
1814
 */
1815
1816
static void dissect_packet_payload(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset, gvsp_packet_info *info)
1817
0
{
1818
0
    if (status_with_payload(info) && tvb_reported_length_remaining(tvb, offset))
1819
0
    {
1820
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_payloaddata, tvb, offset, -1, ENC_NA);
1821
0
    }
1822
0
}
1823
1824
1825
/*
1826
    \brief Dissects a packet payload for H264
1827
 */
1828
1829
static void dissect_packet_payload_h264(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset, gvsp_packet_info *info)
1830
0
{
1831
0
    if (status_with_payload(info) && tvb_reported_length_remaining(tvb, offset))
1832
0
    {
1833
        /* Timestamp */
1834
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_timestamp, tvb, offset, 8, ENC_BIG_ENDIAN);
1835
1836
        /* Data */
1837
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_payloaddata, tvb, offset + 8, -1, ENC_NA);
1838
0
    }
1839
0
}
1840
1841
1842
/*
1843
    \brief Dissects a packet payload for multi-zone
1844
 */
1845
1846
static void dissect_packet_payload_multizone(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset, gvsp_packet_info *info)
1847
0
{
1848
0
    if (status_with_payload(info) && tvb_reported_length_remaining(tvb, offset))
1849
0
    {
1850
        /* Zone information */
1851
0
        proto_tree_add_bitmask(gvsp_tree, tvb, offset + 1, hf_gvsp_zoneinfo,
1852
0
                               ett_gvsp_zoneinfo, zoneinfo_fields, ENC_BIG_ENDIAN);
1853
1854
        /* Address offset */
1855
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_addressoffset, tvb, offset + 2, 6, ENC_BIG_ENDIAN);
1856
1857
        /* Data */
1858
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_payloaddata, tvb, offset + 8, -1, ENC_NA);
1859
0
    }
1860
0
}
1861
1862
1863
/*
1864
    \brief Dissects a packet payload for multi-part
1865
 */
1866
1867
static void dissect_packet_payload_multipart(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset, gvsp_packet_info *info)
1868
0
{
1869
0
    if (status_with_payload(info) && tvb_reported_length_remaining(tvb, offset))
1870
0
    {
1871
        /* Part ID */
1872
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_multi_part_part_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1873
1874
        /* Zone information */
1875
0
        proto_tree_add_bitmask(gvsp_tree, tvb, offset + 1, hf_gvsp_zoneinfo_multipart,
1876
0
                               ett_gvsp_zoneinfo_multipart, zoneinfo_multipart_fields, ENC_BIG_ENDIAN);
1877
1878
        /* Address offset */
1879
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_addressoffset, tvb, offset + 2, 6, ENC_BIG_ENDIAN);
1880
1881
        /* Data */
1882
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_payloaddata, tvb, offset + 8, -1, ENC_NA);
1883
0
    }
1884
0
}
1885
1886
/*
1887
    \brief Dissects a payload packet for GenDC
1888
 */
1889
1890
0
#define GVSP_GENDC_MAX_PARTS 1024
1891
1892
static expert_field ei_gvsp_gendc_offsets;
1893
1894
static void dissect_packet_payload_gendc(proto_tree *gvsp_tree, tvbuff_t *tvb, packet_info *pinfo, int offset, gvsp_packet_info *info)
1895
0
{
1896
0
    if (status_with_payload(info) && tvb_reported_length_remaining(tvb, offset))
1897
0
    {
1898
0
        const uint8_t data_flags = tvb_get_uint8(tvb, offset + 12);
1899
1900
        /* Data size */
1901
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_gendc_payload_data_size_v2_2, tvb, offset, 4, ENC_BIG_ENDIAN);
1902
1903
        /* Data destination offset */
1904
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_gendc_payload_data_destination_offset_v2_2, tvb, offset + 4, 8, ENC_BIG_ENDIAN);
1905
1906
        /* Data flags */
1907
0
        proto_tree_add_bitmask(gvsp_tree, tvb, offset + 12, hf_gvsp_gendc_payload_data_flags_v2_2,
1908
0
            ett_gvsp_gendc_payload_data_flags, gendc_payload_data_flags_fields, ENC_BIG_ENDIAN);
1909
1910
        /* Flow flags */
1911
0
        proto_tree_add_bitmask(gvsp_tree, tvb, offset + 13, hf_gvsp_gendc_payload_flow_flags_v2_2,
1912
0
            ett_gvsp_gendc_payload_flow_flags, gendc_payload_flow_flags_fields, ENC_BIG_ENDIAN);
1913
1914
        /* Flow ID */
1915
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_gendc_payload_flow_id_v2_2, tvb, offset + 14, 2, ENC_BIG_ENDIAN);
1916
1917
0
        if ((data_flags & GENDC_DESCRIPTOR_FLAG) && (data_flags & GENDC_DESCRIPTOR_START_FLAG))
1918
0
        {
1919
0
            const uint32_t component_count = tvb_get_uint32(tvb, offset + 68, ENC_LITTLE_ENDIAN);
1920
0
            proto_tree* gvsp_gendc_container_descriptor_tree = proto_tree_add_subtree(gvsp_tree, tvb, offset + 16, -1, ett_gvsp_gendc_container_descriptor, NULL, "GenDC Container Descriptor");
1921
0
            proto_tree* gvsp_gendc_container_header_component_offsets_tree = 0;
1922
1923
            /* GenDC container header signature */
1924
0
            proto_tree_add_item(gvsp_gendc_container_descriptor_tree, hf_gvsp_gendc_container_header_signature_v2_2, tvb, offset + 16, 4, ENC_ASCII);
1925
1926
            /* GenDC container header major version */
1927
0
            proto_tree_add_item(gvsp_gendc_container_descriptor_tree, hf_gvsp_gendc_container_header_version_major_v2_2, tvb, offset + 20, 1, ENC_LITTLE_ENDIAN);
1928
1929
            /* GenDC container header minor version */
1930
0
            proto_tree_add_item(gvsp_gendc_container_descriptor_tree, hf_gvsp_gendc_container_header_version_minor_v2_2, tvb, offset + 21, 1, ENC_LITTLE_ENDIAN);
1931
1932
            /* GenDC container header sub minor version */
1933
0
            proto_tree_add_item(gvsp_gendc_container_descriptor_tree, hf_gvsp_gendc_container_header_version_sub_minor_v2_2, tvb, offset + 22, 1, ENC_LITTLE_ENDIAN);
1934
1935
            /* GenDC 1 reserved byte */
1936
0
            proto_tree_add_item(gvsp_gendc_container_descriptor_tree, hf_gvsp_gendc_header_reserved_1_byte_v2_2, tvb, offset + 23, 1, ENC_LITTLE_ENDIAN);
1937
1938
            /* GenDC container header type */
1939
0
            proto_tree_add_item(gvsp_gendc_container_descriptor_tree, hf_gvsp_gendc_header_type_v2_2, tvb, offset + 24, 2, ENC_LITTLE_ENDIAN);
1940
1941
            /* GenDC container header flags */
1942
0
            proto_tree_add_bitmask(gvsp_gendc_container_descriptor_tree, tvb, offset + 26, hf_gvsp_gendc_container_header_flags_v2_2,
1943
0
                ett_gvsp_gendc_container_header_flags, gendc_container_header_flags_fields, ENC_LITTLE_ENDIAN);
1944
1945
            /* GenDC container header size */
1946
0
            proto_tree_add_item(gvsp_gendc_container_descriptor_tree, hf_gvsp_gendc_header_size_v2_2, tvb, offset + 28, 4, ENC_LITTLE_ENDIAN);
1947
1948
            /* GenDC container header id */
1949
0
            proto_tree_add_item(gvsp_gendc_container_descriptor_tree, hf_gvsp_gendc_container_header_id_v2_2, tvb, offset + 32, 8, ENC_LITTLE_ENDIAN);
1950
1951
            /* GenDC container header variable fields */
1952
0
            proto_tree_add_bitmask(gvsp_gendc_container_descriptor_tree, tvb, offset + 40, hf_gvsp_gendc_container_header_variable_fields_v2_2,
1953
0
                ett_gvsp_gendc_container_header_variable_fields, gendc_container_header_variable_fields_fields, ENC_LITTLE_ENDIAN);
1954
1955
            /* GenDC 2 reserved bytes */
1956
0
            proto_tree_add_item(gvsp_gendc_container_descriptor_tree, hf_gvsp_gendc_header_reserved_2_bytes_v2_2, tvb, offset + 42, 2, ENC_LITTLE_ENDIAN);
1957
1958
            /* GenDC 4 reserved bytes */
1959
0
            proto_tree_add_item(gvsp_gendc_container_descriptor_tree, hf_gvsp_gendc_header_reserved_4_bytes_v2_2, tvb, offset + 44, 4, ENC_LITTLE_ENDIAN);
1960
1961
            /* GenDC container header data size */
1962
0
            proto_tree_add_item(gvsp_gendc_container_descriptor_tree, hf_gvsp_gendc_container_header_data_size_v2_2, tvb, offset + 48, 8, ENC_LITTLE_ENDIAN);
1963
1964
            /* GenDC container header data offset */
1965
0
            proto_tree_add_item(gvsp_gendc_container_descriptor_tree, hf_gvsp_gendc_container_header_data_offset_v2_2, tvb, offset + 56, 8, ENC_LITTLE_ENDIAN);
1966
1967
            /* GenDC container header descriptor size */
1968
0
            proto_tree_add_item(gvsp_gendc_container_descriptor_tree, hf_gvsp_gendc_container_header_descriptor_size_v2_2, tvb, offset + 64, 4, ENC_LITTLE_ENDIAN);
1969
1970
            /* GenDC container header component count */
1971
0
            proto_tree_add_item(gvsp_gendc_container_descriptor_tree, hf_gvsp_gendc_container_header_component_count_v2_2, tvb, offset + 68, 4, ENC_LITTLE_ENDIAN);
1972
1973
0
            gvsp_gendc_container_header_component_offsets_tree = proto_tree_add_subtree(gvsp_gendc_container_descriptor_tree, tvb, offset + 72, 8 * component_count, ett_gvsp_gendc_container_header_component_offsets, NULL, "Component Offsets");
1974
1975
            /* Component and part offsets must increase, and the total number
1976
               of part headers is limited, so that repeated offsets cannot
1977
               multiply the work */
1978
0
            uint64_t prev_component_raw = 0;
1979
0
            unsigned total_parts = 0;
1980
0
            bool gendc_stop = false;
1981
1982
0
            for (uint32_t i = 0; i < component_count && !gendc_stop; i++)
1983
0
            {
1984
0
                uint64_t component_raw = tvb_get_uint64(tvb, offset + 72 + 8 * i, ENC_LITTLE_ENDIAN);
1985
0
                if (i > 0 && component_raw <= prev_component_raw) {
1986
0
                    expert_add_info(pinfo, gvsp_gendc_container_header_component_offsets_tree, &ei_gvsp_gendc_offsets);
1987
0
                    break;
1988
0
                }
1989
0
                prev_component_raw = component_raw;
1990
0
                unsigned component_offset = offset + 16 + (int)component_raw;
1991
0
                uint16_t part_count = tvb_get_uint16(tvb, component_offset + 46, ENC_LITTLE_ENDIAN);
1992
1993
0
                proto_tree* gvsp_gendc_component_header_tree = proto_tree_add_subtree(gvsp_gendc_container_descriptor_tree, tvb, component_offset, -1, ett_gvsp_gendc_component_header, NULL, "Component Header");
1994
0
                proto_tree* gvsp_gendc_component_header_part_offsets_tree = 0;
1995
1996
                /* GenDC container header component offset */
1997
0
                proto_tree_add_item(gvsp_gendc_container_header_component_offsets_tree, hf_gvsp_gendc_container_header_component_offset_v2_2, tvb, offset + 72 + 8 * i, 8, ENC_LITTLE_ENDIAN);
1998
1999
                /* component layout (size:offset)
2000
                    2 :  0 type
2001
                    2 :  2 flags
2002
                    4 :  4 header size
2003
                    2 :  8 reserved
2004
                    2 : 10 group id
2005
                    2 : 12 source id
2006
                    2 : 14 region id
2007
                    4 : 16 region offset x
2008
                    4 : 20 region offset y
2009
                    8 : 24 timestamp
2010
                    8 : 32 type id
2011
                    4 : 40 format
2012
                    2 : 44 reserved
2013
                    2 : 46 part count
2014
                */
2015
2016
                /* GenDC component header type */
2017
0
                proto_tree_add_item(gvsp_gendc_component_header_tree, hf_gvsp_gendc_header_type_v2_2, tvb, component_offset, 2, ENC_LITTLE_ENDIAN);
2018
2019
                /* GenDC component header flags */
2020
0
                proto_tree_add_bitmask(gvsp_gendc_component_header_tree, tvb, component_offset + 2, hf_gvsp_gendc_component_header_flags_v2_2,
2021
0
                    ett_gvsp_gendc_component_header_flags, gendc_component_header_flags_fields, ENC_LITTLE_ENDIAN);
2022
2023
                /* GenDC component header size */
2024
0
                proto_tree_add_item(gvsp_gendc_component_header_tree, hf_gvsp_gendc_header_size_v2_2, tvb, component_offset + 4, 4, ENC_LITTLE_ENDIAN);
2025
2026
                /* GenDC 2 reserved bytes */
2027
0
                proto_tree_add_item(gvsp_gendc_component_header_tree, hf_gvsp_gendc_header_reserved_2_bytes_v2_2, tvb, component_offset + 8, 2, ENC_LITTLE_ENDIAN);
2028
2029
                /* GenDC component header group id */
2030
0
                proto_tree_add_item(gvsp_gendc_component_header_tree, hf_gvsp_gendc_component_header_group_id_v2_2, tvb, component_offset + 10, 2, ENC_LITTLE_ENDIAN);
2031
2032
                /* GenDC component header source id */
2033
0
                proto_tree_add_item(gvsp_gendc_component_header_tree, hf_gvsp_gendc_component_header_source_id_v2_2, tvb, component_offset + 12, 2, ENC_LITTLE_ENDIAN);
2034
2035
                /* GenDC component header region id */
2036
0
                proto_tree_add_item(gvsp_gendc_component_header_tree, hf_gvsp_gendc_component_header_region_id_v2_2, tvb, component_offset + 14, 2, ENC_LITTLE_ENDIAN);
2037
2038
                /* GenDC component header offset X */
2039
0
                proto_tree_add_item(gvsp_gendc_component_header_tree, hf_gvsp_offsetx, tvb, component_offset + 16, 4, ENC_LITTLE_ENDIAN);
2040
2041
                /* GenDC component header offset Y */
2042
0
                proto_tree_add_item(gvsp_gendc_component_header_tree, hf_gvsp_offsety, tvb, component_offset + 20, 4, ENC_LITTLE_ENDIAN);
2043
2044
                /* Timestamp */
2045
0
                proto_tree_add_item(gvsp_gendc_component_header_tree, hf_gvsp_timestamp, tvb, component_offset + 24, 8, ENC_LITTLE_ENDIAN);
2046
2047
                /* GenDC component header type id */
2048
0
                proto_tree_add_item(gvsp_gendc_component_header_tree, hf_gvsp_gendc_component_header_type_id_v2_2, tvb, component_offset + 32, 8, ENC_LITTLE_ENDIAN);
2049
2050
                /* GenDC component header format */
2051
0
                proto_tree_add_bitmask(gvsp_gendc_component_header_tree, tvb, component_offset + 40, hf_gvsp_pixelformat, ett_gvsp_pixelformat,
2052
0
                    pixelformat_fields, ENC_LITTLE_ENDIAN);
2053
2054
                /* GenDC 2 reserved bytes */
2055
0
                proto_tree_add_item(gvsp_gendc_component_header_tree, hf_gvsp_gendc_header_reserved_2_bytes_v2_2, tvb, component_offset + 44, 2, ENC_LITTLE_ENDIAN);
2056
2057
                /* GenDC component header part count */
2058
0
                proto_tree_add_item(gvsp_gendc_component_header_tree, hf_gvsp_gendc_component_header_part_count_v2_2, tvb, component_offset + 46, 2, ENC_LITTLE_ENDIAN);
2059
2060
0
                gvsp_gendc_component_header_part_offsets_tree = proto_tree_add_subtree(gvsp_gendc_component_header_tree, tvb, component_offset + 48, 8 * part_count, ett_gvsp_gendc_part_offsets, NULL, "Part Offsets");
2061
2062
0
                uint64_t prev_part_raw = 0;
2063
0
                for (uint16_t j = 0; j < part_count; j++)
2064
0
                {
2065
0
                    uint64_t part_raw = tvb_get_uint64(tvb, component_offset + 48 + 8 * j, ENC_LITTLE_ENDIAN);
2066
0
                    if ((j > 0 && part_raw <= prev_part_raw) || ++total_parts > GVSP_GENDC_MAX_PARTS) {
2067
0
                        expert_add_info(pinfo, gvsp_gendc_component_header_part_offsets_tree, &ei_gvsp_gendc_offsets);
2068
0
                        gendc_stop = true;
2069
0
                        break;
2070
0
                    }
2071
0
                    prev_part_raw = part_raw;
2072
0
                    unsigned part_offset = offset + 16 + (int)part_raw;
2073
0
                    uint16_t part_type = tvb_get_uint16(tvb, part_offset, ENC_LITTLE_ENDIAN);
2074
2075
0
                    proto_tree* gvsp_gendc_part_header_tree = proto_tree_add_subtree(gvsp_gendc_component_header_tree, tvb, part_offset, -1, ett_gvsp_gendc_part_header, NULL, "Part Header");
2076
2077
                    /* GenDC component header part offset */
2078
0
                    proto_tree_add_item(gvsp_gendc_component_header_part_offsets_tree, hf_gvsp_gendc_component_header_part_offset_v2_2, tvb, component_offset + 48 + 8 * j, 8, ENC_LITTLE_ENDIAN);
2079
2080
                    /* common part layout (size:offset)
2081
                        2:0 type
2082
                        2:2 flags
2083
                        4:4 header size
2084
                        4:8 format
2085
                        2:12 reserved
2086
                        2:14 flow id
2087
                        8:16 flow offset
2088
                        8:24 data size
2089
                        8:32 data offset
2090
                    */
2091
2092
                    /* GenDC part header type */
2093
0
                    proto_tree_add_item(gvsp_gendc_part_header_tree, hf_gvsp_gendc_header_type_v2_2, tvb, part_offset, 2, ENC_LITTLE_ENDIAN);
2094
2095
                    /* GenDC part header flags */
2096
0
                    if( part_type == GENDC_HEADER_TYPE_PART_XML )
2097
0
                    {
2098
0
                        proto_tree_add_bitmask(gvsp_gendc_part_header_tree, tvb, part_offset + 2, hf_gvsp_gendc_part_header_flags_v2_2,
2099
0
                            ett_gvsp_gendc_part_header_flags, gendc_part_header_flags_fields, ENC_LITTLE_ENDIAN);
2100
0
                    }
2101
0
                    else
2102
0
                    {
2103
0
                        proto_tree_add_item(gvsp_gendc_part_header_tree, hf_gvsp_gendc_part_header_flags_v2_2, tvb, part_offset + 2, 2, ENC_LITTLE_ENDIAN);
2104
0
                    }
2105
2106
                    /* GenDC part header size */
2107
0
                    proto_tree_add_item(gvsp_gendc_part_header_tree, hf_gvsp_gendc_header_size_v2_2, tvb, part_offset + 4, 4, ENC_LITTLE_ENDIAN);
2108
2109
                    /* GenDC part header format */
2110
0
                    proto_tree_add_bitmask(gvsp_gendc_part_header_tree, tvb, part_offset + 8, hf_gvsp_pixelformat, ett_gvsp_pixelformat, pixelformat_fields, ENC_LITTLE_ENDIAN);
2111
2112
                    /* GenDC 2 reserved bytes */
2113
0
                    proto_tree_add_item(gvsp_gendc_part_header_tree, hf_gvsp_gendc_header_reserved_2_bytes_v2_2, tvb, part_offset + 12, 2, ENC_LITTLE_ENDIAN);
2114
2115
                    /* Flow ID */
2116
0
                    proto_tree_add_item(gvsp_gendc_part_header_tree, hf_gvsp_gendc_payload_flow_id_v2_2, tvb, part_offset + 14, 2, ENC_LITTLE_ENDIAN);
2117
2118
                    /* GenDC container header data offset */
2119
0
                    proto_tree_add_item(gvsp_gendc_part_header_tree, hf_gvsp_gendc_part_header_flow_offset_v2_2, tvb, part_offset + 16, 8, ENC_LITTLE_ENDIAN);
2120
2121
                    /* GenDC part header data size */
2122
0
                    proto_tree_add_item(gvsp_gendc_part_header_tree, hf_gvsp_gendc_container_header_data_size_v2_2, tvb, part_offset + 24, 8, ENC_LITTLE_ENDIAN);
2123
2124
                    /* GenDC part header data offset */
2125
0
                    proto_tree_add_item(gvsp_gendc_part_header_tree, hf_gvsp_gendc_container_header_data_offset_v2_2, tvb, part_offset + 32, 8, ENC_LITTLE_ENDIAN);
2126
2127
0
                    switch (part_type)
2128
0
                    {
2129
0
                        case GENDC_HEADER_TYPE_PART_CHUNK:
2130
0
                        case GENDC_HEADER_TYPE_PART_XML:
2131
0
                        case GENDC_HEADER_TYPE_PART_1D:
2132
                            /* GenDC part header size */
2133
0
                            proto_tree_add_item(gvsp_gendc_part_header_tree, hf_gvsp_gendc_part_header_1D_size_v2_2, tvb, part_offset + 40, 8, ENC_LITTLE_ENDIAN);
2134
2135
                            /* GenDC part header padding */
2136
0
                            proto_tree_add_item(gvsp_gendc_part_header_tree, hf_gvsp_gendc_part_header_1D_padding_v2_2, tvb, part_offset + 48, 4, ENC_LITTLE_ENDIAN);
2137
2138
                            /* GenDC 4 reserved bytes */
2139
0
                            proto_tree_add_item(gvsp_gendc_part_header_tree, hf_gvsp_gendc_header_reserved_4_bytes_v2_2, tvb, part_offset + 52, 4, ENC_LITTLE_ENDIAN);
2140
2141
                            /* GenDC part header type specific */
2142
0
                            proto_tree_add_item(gvsp_gendc_part_header_tree, hf_gvsp_gendc_part_header_type_specific_info_v2_2, tvb, part_offset + 56, 8, ENC_LITTLE_ENDIAN);
2143
0
                            break;
2144
0
                        case GENDC_HEADER_TYPE_PART_2D:
2145
0
                        case GENDC_HEADER_TYPE_PART_2D_JPEG:
2146
0
                        case GENDC_HEADER_TYPE_PART_2D_JPEG2000:
2147
0
                            dissect_image_dimensions(gvsp_gendc_part_header_tree, tvb, part_offset + 40, ENC_LITTLE_ENDIAN);
2148
0
                            break;
2149
0
                        case GENDC_HEADER_TYPE_PART_2D_H264:
2150
0
                            dissect_image_dimensions(gvsp_gendc_part_header_tree, tvb, part_offset + 40, ENC_LITTLE_ENDIAN);
2151
0
                            dissect_h264_leader_common(gvsp_gendc_part_header_tree, tvb, part_offset + 52, ENC_LITTLE_ENDIAN);
2152
0
                            break;
2153
0
                    }
2154
0
                }
2155
0
            }
2156
0
        }
2157
0
        else
2158
0
        {
2159
            /* Data */
2160
0
            proto_tree_add_item(gvsp_tree, hf_gvsp_payloaddata, tvb, offset + 16, -1, ENC_NA);
2161
0
        }
2162
0
    }
2163
0
}
2164
2165
/*
2166
    \brief Dissects an all in packet
2167
 */
2168
2169
static void dissect_packet_all_in(proto_tree *gvsp_tree, tvbuff_t *tvb, int offset, packet_info *pinfo, gvsp_packet_info *info)
2170
0
{
2171
0
    int ret;
2172
2173
0
    switch (info->payloadtype)
2174
0
    {
2175
0
    case GVSP_PAYLOAD_IMAGE:
2176
0
        offset += dissect_image_leader(gvsp_tree, tvb, pinfo, offset);
2177
0
        offset += dissect_image_trailer(gvsp_tree, tvb, pinfo, offset);
2178
0
        if (info->chunk != 0)
2179
0
        {
2180
0
            offset += dissect_extra_chunk_info(gvsp_tree, tvb, pinfo, offset);
2181
0
        }
2182
0
        dissect_packet_payload(gvsp_tree, tvb, pinfo, offset, info);
2183
0
        break;
2184
2185
0
    case GVSP_PAYLOAD_RAWDATA:
2186
0
        offset += dissect_raw_data_leader(gvsp_tree, tvb, pinfo, offset);
2187
0
        offset += dissect_generic_trailer(gvsp_tree, tvb, pinfo, offset);
2188
0
        if (info->chunk != 0)
2189
0
        {
2190
0
            offset += dissect_extra_chunk_info(gvsp_tree, tvb, pinfo, offset);
2191
0
        }
2192
0
        dissect_packet_payload(gvsp_tree, tvb, pinfo, offset, info);
2193
0
        break;
2194
2195
0
    case GVSP_PAYLOAD_FILE:
2196
0
        ret = dissect_file_leader(gvsp_tree, tvb, pinfo, offset);
2197
0
        if (ret < 0)
2198
0
            break;
2199
0
        offset += ret;
2200
0
        offset += dissect_generic_trailer(gvsp_tree, tvb, pinfo, offset);
2201
0
        if (info->chunk != 0)
2202
0
        {
2203
0
            offset += dissect_extra_chunk_info(gvsp_tree, tvb, pinfo, offset);
2204
0
        }
2205
0
        dissect_packet_payload(gvsp_tree, tvb, pinfo, offset, info);
2206
0
        break;
2207
2208
0
    case GVSP_PAYLOAD_CHUNKDATA:
2209
0
        offset += dissect_chunk_data_leader(gvsp_tree, tvb, pinfo, offset);
2210
0
        offset += dissect_chunk_data_trailer(gvsp_tree, tvb, pinfo, offset);
2211
0
        if (info->chunk != 0)
2212
0
        {
2213
0
            offset += dissect_extra_chunk_info(gvsp_tree, tvb, pinfo, offset);
2214
0
        }
2215
0
        dissect_packet_payload(gvsp_tree, tvb, pinfo, offset, info);
2216
0
        break;
2217
2218
0
    case GVSP_PAYLOAD_EXTENDEDCHUNKDATA:
2219
0
        offset += dissect_extended_chunk_data_leader(gvsp_tree, tvb, pinfo, offset);
2220
0
        offset += dissect_extended_chunk_data_trailer(gvsp_tree, tvb, pinfo, offset);
2221
0
        if (info->chunk != 0)
2222
0
        {
2223
0
            offset += dissect_extra_chunk_info(gvsp_tree, tvb, pinfo, offset);
2224
0
        }
2225
0
        dissect_packet_payload(gvsp_tree, tvb, pinfo, offset, info);
2226
0
        break;
2227
2228
0
    case GVSP_PAYLOAD_JPEG:
2229
0
    case GVSP_PAYLOAD_JPEG2000:
2230
0
        offset += dissect_jpeg_leader(gvsp_tree, tvb, pinfo, offset);
2231
0
        offset += dissect_generic_trailer(gvsp_tree, tvb, pinfo, offset);
2232
0
        if (info->chunk != 0)
2233
0
        {
2234
0
            offset += dissect_extra_chunk_info(gvsp_tree, tvb, pinfo, offset);
2235
0
        }
2236
0
        dissect_packet_payload(gvsp_tree, tvb, pinfo, offset, info);
2237
0
        break;
2238
2239
0
    case GVSP_PAYLOAD_H264:
2240
0
        offset += dissect_h264_leader(gvsp_tree, tvb, pinfo, offset);
2241
0
        offset += dissect_generic_trailer(gvsp_tree, tvb, pinfo, offset);
2242
0
        if (info->chunk != 0)
2243
0
        {
2244
0
            offset += dissect_extra_chunk_info(gvsp_tree, tvb, pinfo, offset);
2245
0
        }
2246
0
        dissect_packet_payload_h264(gvsp_tree, tvb, pinfo, offset, info);
2247
0
        break;
2248
2249
0
    case GVSP_PAYLOAD_MULTIZONEIMAGE:
2250
0
        offset += dissect_multizone_image_leader(gvsp_tree, tvb, pinfo, offset);
2251
0
        offset += dissect_image_trailer(gvsp_tree, tvb, pinfo, offset);
2252
0
        if (info->chunk != 0)
2253
0
        {
2254
0
            offset += dissect_extra_chunk_info(gvsp_tree, tvb, pinfo, offset);
2255
0
        }
2256
0
        dissect_packet_payload_multizone(gvsp_tree, tvb, pinfo, offset, info);
2257
0
        break;
2258
2259
    /* case GVSP_PAYLOAD_MULTIPART: */
2260
    /* By definition, Multi-part cannot support the all-in packet since it requires at least one data packet per part. */
2261
    /* Therefore, it is not possible to use all-in transmission mode for the multi-part payload type. */
2262
2263
    /* case GVSP_PAYLOAD_GENDC: */
2264
    /* By definition, GenDC cannot support the all-in packet since it requires at least one data packet containing the GenDC descriptor. */
2265
    /* Therefore, it is not possible to use all-in transmission mode for the GenDC payload type. */
2266
2267
0
    }
2268
0
}
2269
2270
2271
/*
2272
    \brief Dissects a leader packet
2273
 */
2274
2275
static void dissect_packet_leader(proto_tree *gvsp_tree, tvbuff_t *tvb, int offset, packet_info *pinfo, gvsp_packet_info *info)
2276
0
{
2277
0
    switch (info->payloadtype)
2278
0
    {
2279
0
    case GVSP_PAYLOAD_IMAGE:
2280
0
        dissect_image_leader(gvsp_tree, tvb, pinfo, offset);
2281
0
        break;
2282
2283
0
    case GVSP_PAYLOAD_RAWDATA:
2284
0
        dissect_raw_data_leader(gvsp_tree, tvb, pinfo, offset);
2285
0
        break;
2286
2287
0
    case GVSP_PAYLOAD_FILE:
2288
0
        dissect_file_leader(gvsp_tree, tvb, pinfo, offset);
2289
0
        break;
2290
2291
0
    case GVSP_PAYLOAD_CHUNKDATA:
2292
0
        dissect_chunk_data_leader(gvsp_tree, tvb, pinfo, offset);
2293
0
        break;
2294
2295
0
    case GVSP_PAYLOAD_EXTENDEDCHUNKDATA:
2296
0
        dissect_extended_chunk_data_leader(gvsp_tree, tvb, pinfo, offset);
2297
0
        break;
2298
2299
0
    case GVSP_PAYLOAD_JPEG:
2300
0
    case GVSP_PAYLOAD_JPEG2000:
2301
0
        dissect_jpeg_leader(gvsp_tree, tvb, pinfo, offset);
2302
0
        break;
2303
2304
0
    case GVSP_PAYLOAD_H264:
2305
0
        dissect_h264_leader(gvsp_tree, tvb, pinfo, offset);
2306
0
        break;
2307
2308
0
    case GVSP_PAYLOAD_MULTIZONEIMAGE:
2309
0
        dissect_multizone_image_leader(gvsp_tree, tvb, pinfo, offset);
2310
0
        break;
2311
2312
0
    case GVSP_PAYLOAD_MULTIPART:
2313
0
        dissect_multi_part_leader(gvsp_tree, tvb, pinfo, offset);
2314
0
        break;
2315
2316
0
    case GVSP_PAYLOAD_GENDC:
2317
0
        dissect_gendc_leader(gvsp_tree, tvb, pinfo, offset);
2318
0
        break;
2319
2320
0
    default:
2321
0
        break;
2322
0
    }
2323
0
}
2324
2325
2326
/*
2327
    \brief Dissects a trailer packet
2328
 */
2329
2330
static void dissect_packet_trailer(proto_tree *gvsp_tree, tvbuff_t *tvb, int offset, packet_info *pinfo, gvsp_packet_info *info)
2331
0
{
2332
0
    switch (info->payloadtype)
2333
0
    {
2334
0
    case GVSP_PAYLOAD_IMAGE:
2335
0
    case GVSP_PAYLOAD_MULTIZONEIMAGE:
2336
0
        offset += dissect_image_trailer(gvsp_tree, tvb, pinfo, offset);
2337
0
        break;
2338
2339
0
    case GVSP_PAYLOAD_CHUNKDATA:
2340
0
        offset += dissect_chunk_data_trailer(gvsp_tree, tvb, pinfo, offset);
2341
0
        break;
2342
2343
0
    case GVSP_PAYLOAD_EXTENDEDCHUNKDATA:
2344
0
        offset += dissect_extended_chunk_data_trailer(gvsp_tree, tvb, pinfo, offset);
2345
0
        break;
2346
2347
0
    case GVSP_PAYLOAD_RAWDATA:
2348
0
    case GVSP_PAYLOAD_FILE:
2349
0
    case GVSP_PAYLOAD_JPEG:
2350
0
    case GVSP_PAYLOAD_JPEG2000:
2351
0
    case GVSP_PAYLOAD_H264:
2352
0
    case GVSP_PAYLOAD_GENDC:
2353
0
        offset += dissect_generic_trailer(gvsp_tree, tvb, pinfo, offset);
2354
0
        break;
2355
2356
0
    case GVSP_PAYLOAD_MULTIPART:
2357
0
        offset += dissect_multi_part_trailer(gvsp_tree, tvb, pinfo, offset);
2358
0
        break;
2359
2360
0
    default:
2361
0
        break;
2362
0
    }
2363
2364
0
    if (info->chunk != 0)
2365
0
    {
2366
0
        dissect_extra_chunk_info(gvsp_tree, tvb, pinfo, offset);
2367
0
    }
2368
0
}
2369
2370
2371
/*
2372
    \brief Point of entry of all GVSP dissection
2373
 */
2374
2375
static int dissect_gvsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
2376
0
{
2377
0
    proto_item *ti = NULL;
2378
0
    unsigned offset = 0;
2379
0
    proto_tree *gvsp_tree = NULL;
2380
0
    gvsp_packet_info info;
2381
2382
0
    if ((tvb_reported_length(tvb) < GVSP_MIN_PACKET_SIZE) ||
2383
0
        (tvb_captured_length(tvb) < 5))
2384
0
    {
2385
0
        return 0;
2386
0
    }
2387
2388
0
    memset(&info, 0x00, sizeof(info));
2389
2390
0
    info.format = tvb_get_uint8(tvb, 4);
2391
2392
0
    if ((info.format & GVSP_EXTENDED_ID_BIT) && tvb_reported_length(tvb) < GVSP_V2_MIN_PACKET_SIZE)
2393
0
    {
2394
0
        return 0;
2395
0
    }
2396
2397
    /* Set the protocol column */
2398
0
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "GVSP");
2399
2400
    /* Clear out stuff in the info column */
2401
0
    col_clear(pinfo->cinfo, COL_INFO);
2402
2403
    /* Adds "Gigabit-Ethernet Streaming Protocol" heading to protocol tree */
2404
    /* We will add fields to this using the gvsp_tree pointer */
2405
0
    ti = proto_tree_add_item(tree, proto_gvsp, tvb, offset, -1, ENC_NA);
2406
0
    gvsp_tree = proto_item_add_subtree(ti, ett_gvsp);
2407
2408
    /* Look for extended ID flag and then clear it */
2409
0
    info.enhanced = info.format & GVSP_EXTENDED_ID_BIT;
2410
0
    info.format &= 0x7F;
2411
2412
    /* Add packet format to info string */
2413
0
    col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(pinfo->pool, info.format, formatnames, "Unknown Format (0x%x)"));
2414
2415
    /* Dissect status */
2416
0
    info.status = tvb_get_ntohs(tvb, offset);
2417
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_status, tvb, offset, 2, ENC_BIG_ENDIAN);
2418
0
    offset += 2;
2419
2420
0
    if (info.enhanced == 0)
2421
0
    {
2422
0
        info.blockid = tvb_get_ntohs(tvb, offset);
2423
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_blockid16, tvb, offset, 2, ENC_BIG_ENDIAN);
2424
0
    }
2425
0
    else
2426
0
    {
2427
0
        uint8_t flags;
2428
0
        flags = tvb_get_uint8(tvb, offset + 1);
2429
0
        info.flag_resendrangeerror = flags & 0x04;
2430
0
        info.flag_previousblockdropped = flags & 0x02;
2431
0
        info.flag_packetresend = flags & 0x01;
2432
2433
0
        proto_tree_add_bitmask(gvsp_tree, tvb, offset, hf_gvsp_flags,
2434
0
                               ett_gvsp_flags, flags_fields, ENC_BIG_ENDIAN);
2435
0
    }
2436
2437
0
    offset += 2;
2438
2439
0
    proto_tree_add_item(gvsp_tree, hf_gvsp_format, tvb, offset, 1, ENC_BIG_ENDIAN);
2440
0
    offset++;
2441
2442
0
    info.packetid = tvb_get_ntohl(tvb, offset - 1);
2443
0
    info.packetid &= 0x00FFFFFF;
2444
0
    if (info.enhanced == 0)
2445
0
    {
2446
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_packetid24, tvb, offset, 3, ENC_BIG_ENDIAN);
2447
0
        offset += 3;
2448
0
    }
2449
0
    else
2450
0
    {
2451
0
        offset += 2;
2452
0
        if (info.format == GVSP_PACKET_LEADER)
2453
0
        {
2454
0
            if (tvb_get_uint8(tvb, 23) == GVSP_PAYLOAD_MULTIZONEIMAGE)
2455
0
            {
2456
                /* packet id contains the number of additional zones for multi-zone */
2457
0
                proto_tree_add_item(gvsp_tree, hf_gvsp_add_zones, tvb, offset, 1, ENC_BIG_ENDIAN);
2458
0
            }
2459
0
            else if (tvb_get_uint8(tvb, 23) == GVSP_PAYLOAD_MULTIPART)
2460
0
            {
2461
                /* packet id contains the number of parts for multi-part */
2462
0
                proto_tree_add_item(gvsp_tree, hf_gvsp_numparts, tvb, offset, 1, ENC_BIG_ENDIAN);
2463
0
            }
2464
0
        }
2465
0
        offset += 1;
2466
0
    }
2467
2468
0
    if (info.enhanced != 0)
2469
0
    {
2470
0
        info.blockid = tvb_get_ntoh64(tvb, offset);
2471
2472
        /* Dissect 64 bit block ID */
2473
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_blockid64, tvb, offset, 8, ENC_BIG_ENDIAN);
2474
0
        offset += 8;
2475
2476
        /* Dissect 32 bit packet ID */
2477
0
        info.packetid = tvb_get_ntohl(tvb, offset);
2478
0
        proto_tree_add_item(gvsp_tree, hf_gvsp_packetid32, tvb, offset, 4, ENC_BIG_ENDIAN);
2479
0
        offset += 4;
2480
0
    }
2481
2482
    /* At this point offset is pointing to end of packet */
2483
2484
0
    col_append_fstr(pinfo->cinfo, COL_INFO, "[Block ID: %" PRIu64 " Packet ID: %d] ", (uint64_t)info.blockid, info.packetid);
2485
2486
0
    if (info.flag_resendrangeerror != 0)
2487
0
    {
2488
        /* Add range error to info string */
2489
0
        col_append_str(pinfo->cinfo, COL_INFO, "[RANGE_ERROR] ");
2490
0
    }
2491
2492
0
    if (info.flag_previousblockdropped != 0)
2493
0
    {
2494
        /* Add block dropped to info string */
2495
0
        col_append_str(pinfo->cinfo, COL_INFO, "[BLOCK_DROPPED] ");
2496
0
    }
2497
2498
0
    if (info.flag_packetresend != 0)
2499
0
    {
2500
        /* Add packet resend to info string */
2501
0
        col_append_str(pinfo->cinfo, COL_INFO, "[PACKET_RESEND] ");
2502
0
    }
2503
2504
    /* Process packet types that are payload agnostic */
2505
0
    switch (info.format)
2506
0
    {
2507
0
    case GVSP_PACKET_PAYLOAD:
2508
0
        dissect_packet_payload(gvsp_tree, tvb, pinfo, offset, &info);
2509
0
        return tvb_captured_length(tvb);
2510
2511
0
    case GVSP_PACKET_PAYLOAD_H264:
2512
0
        dissect_packet_payload_h264(gvsp_tree, tvb, pinfo, offset, &info);
2513
0
        return tvb_captured_length(tvb);
2514
2515
0
    case GVSP_PACKET_PAYLOAD_MULTIZONE:
2516
0
        dissect_packet_payload_multizone(gvsp_tree, tvb, pinfo, offset, &info);
2517
0
        return tvb_captured_length(tvb);
2518
2519
0
    case GVSP_PACKET_PAYLOAD_MULTIPART:
2520
0
        dissect_packet_payload_multipart(gvsp_tree, tvb, pinfo, offset, &info);
2521
0
        return tvb_captured_length(tvb);
2522
2523
0
    case GVSP_PACKET_PAYLOAD_GENDC:
2524
0
        dissect_packet_payload_gendc(gvsp_tree, tvb, pinfo, offset, &info);
2525
0
        return tvb_captured_length(tvb);
2526
2527
0
    default:
2528
0
        break;
2529
0
    }
2530
2531
    /* Get payload type, clear chunk bit */
2532
0
    if (tvb_captured_length_remaining(tvb, offset) >= 2)
2533
0
    {
2534
0
        info.payloadtype = tvb_get_ntohs(tvb, offset + 2);
2535
0
    }
2536
2537
0
    info.chunk = info.payloadtype & 0x4000;
2538
0
    info.payloadtype &= 0x3FFF;
2539
2540
2541
    /* Add payload type to information string */
2542
0
    col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_ext(pinfo->pool, info.payloadtype, &payloadtypenames_ext, "Unknown Payload Type (0x%x)"));
2543
2544
    /* Process packet types for specific payload types */
2545
0
    switch (info.format)
2546
0
    {
2547
0
    case GVSP_PACKET_ALLIN:
2548
0
        dissect_packet_all_in(gvsp_tree, tvb, offset, pinfo, &info);
2549
0
        break;
2550
0
    case GVSP_PACKET_LEADER:
2551
0
        dissect_packet_leader(gvsp_tree, tvb, offset, pinfo, &info);
2552
0
        break;
2553
0
    case GVSP_PACKET_TRAILER:
2554
0
        dissect_packet_trailer(gvsp_tree, tvb, offset, pinfo, &info);
2555
0
        break;
2556
0
    default:
2557
0
        break;
2558
0
    }
2559
0
    return tvb_captured_length(tvb);
2560
0
}
2561
2562
static bool dissect_gvsp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
2563
0
{
2564
0
    conversation_t *conversation = NULL;
2565
0
    uint16_t status_code = 0;
2566
0
    uint8_t format = 0;
2567
2568
    /* Verify packet size */
2569
0
    if ((tvb_reported_length(tvb) <  GVSP_MIN_PACKET_SIZE) ||
2570
0
        (tvb_captured_length(tvb) < 5))
2571
0
    {
2572
0
        return false;
2573
0
    }
2574
2575
    /* Larger packet size if Extended ID flag is set */
2576
0
    format = tvb_get_uint8(tvb, 4);
2577
2578
0
    if ((format & GVSP_EXTENDED_ID_BIT) && tvb_reported_length(tvb) < GVSP_V2_MIN_PACKET_SIZE)
2579
0
    {
2580
0
        return false;
2581
0
    }
2582
2583
    /* Check for valid status codes */
2584
0
    status_code = tvb_get_ntohs(tvb, 0);
2585
2586
0
    if (status_code == GEV_STATUS_SUCCESS ||
2587
0
        status_code == GEV_STATUS_PACKET_RESEND ||
2588
0
        (status_code >= GEV_STATUS_NOT_IMPLEMENTED && status_code <= GEV_STATUS_LAST) ||
2589
0
        status_code == GEV_STATUS_ERROR)
2590
0
    {
2591
0
        format &= 0x7F;
2592
2593
        /* Check for valid format types */
2594
0
        if (format >= GVSP_PACKET_LEADER && format <= GVSP_PACKET_PAYLOAD_LAST)
2595
0
        {
2596
0
            if(format == GVSP_PACKET_LEADER && tvb_captured_length_remaining(tvb, 8) >= 2)
2597
0
            {
2598
0
                uint32_t payloadtype;
2599
0
                payloadtype = tvb_get_ntohs(tvb, 8);
2600
0
                payloadtype &= 0x3FFF;
2601
0
                if (try_val_to_str_ext(payloadtype, &payloadtypenames_ext) == NULL ){
2602
0
                    return false;
2603
0
                }
2604
0
            }
2605
2606
0
            conversation = find_or_create_conversation(pinfo);
2607
0
            conversation_set_dissector(conversation, gvsp_handle);
2608
0
            dissect_gvsp(tvb, pinfo, tree, data);
2609
0
            return true;
2610
0
        }
2611
0
    }
2612
2613
0
    return false;
2614
0
}
2615
2616
/*
2617
    \brief Registers the dissector. Invoked at program startup.
2618
 */
2619
2620
void proto_register_gvsp(void)
2621
16
{
2622
16
    module_t *gvsp_module;
2623
2624
16
    static hf_register_info hfgvsp[] =
2625
16
    {
2626
16
        {&hf_gvsp_status,
2627
16
        { "Status", "gvsp.status",
2628
16
        FT_UINT16, BASE_HEX|BASE_EXT_STRING, &statusnames_ext, 0x0,
2629
16
        NULL, HFILL
2630
16
        }},
2631
2632
16
        {&hf_gvsp_blockid16,
2633
16
        { "Block ID (16 bits)", "gvsp.blockid16",
2634
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
2635
16
        NULL, HFILL
2636
16
        }},
2637
2638
16
        {&hf_gvsp_flags,
2639
16
        { "Flags", "gvsp.flags",
2640
16
        FT_UINT16, BASE_HEX, NULL, 0,
2641
16
        NULL, HFILL
2642
16
        }},
2643
2644
16
        {&hf_gvsp_flagdevicespecific0,
2645
16
        { "Flag Device Specific 0", "gvsp.flag.devicespecific0",
2646
16
        FT_UINT16, BASE_HEX, NULL, 0x8000,
2647
16
        NULL, HFILL
2648
16
        }},
2649
2650
16
        {&hf_gvsp_flagdevicespecific1,
2651
16
        { "Flag Device Specific 1", "gvsp.flag.devicespecific1",
2652
16
        FT_UINT16, BASE_HEX, NULL, 0x4000,
2653
16
        NULL, HFILL
2654
16
        }},
2655
2656
16
        {&hf_gvsp_flagdevicespecific2,
2657
16
        { "Flag Device Specific 2", "gvsp.flag.devicespecific2",
2658
16
        FT_UINT16, BASE_HEX, NULL, 0x2000,
2659
16
        NULL, HFILL
2660
16
        }},
2661
2662
16
        {&hf_gvsp_flagdevicespecific3,
2663
16
        { "Flag Device Specific 3", "gvsp.flag.devicespecific3",
2664
16
        FT_UINT16, BASE_HEX, NULL, 0x1000,
2665
16
        NULL, HFILL
2666
16
        }},
2667
2668
16
        {&hf_gvsp_flagdevicespecific4,
2669
16
        { "Flag Device Specific 4", "gvsp.flag.devicespecific4",
2670
16
        FT_UINT16, BASE_HEX, NULL, 0x0800,
2671
16
        NULL, HFILL
2672
16
        }},
2673
2674
16
        {&hf_gvsp_flagdevicespecific5,
2675
16
        { "Flag Device Specific 5", "gvsp.flag.devicespecific5",
2676
16
        FT_UINT16, BASE_HEX, NULL, 0x0400,
2677
16
        NULL, HFILL
2678
16
        }},
2679
2680
16
        {&hf_gvsp_flagdevicespecific6,
2681
16
        { "Flag Device Specific 6", "gvsp.flag.devicespecific6",
2682
16
        FT_UINT16, BASE_HEX, NULL, 0x0200,
2683
16
        NULL, HFILL
2684
16
        }},
2685
2686
16
        {&hf_gvsp_flagdevicespecific7,
2687
16
        { "Flag Device Specific 7", "gvsp.flag.devicespecific7",
2688
16
        FT_UINT16, BASE_HEX, NULL, 0x0100,
2689
16
        NULL, HFILL
2690
16
        }},
2691
2692
16
        {&hf_gvsp_flagresendrangeerror,
2693
16
        { "Flag Resend Range Error", "gvsp.flag.resendrangeerror",
2694
16
        FT_UINT16, BASE_HEX, NULL, 0x0004,
2695
16
        NULL, HFILL
2696
16
        }},
2697
2698
16
        {&hf_gvsp_flagpreviousblockdropped,
2699
16
        { "Flag Previous Block Dropped", "gvsp.flag.previousblockdropped",
2700
16
        FT_UINT16, BASE_HEX, NULL, 0x0002,
2701
16
        NULL, HFILL
2702
16
        }},
2703
2704
16
        {&hf_gvsp_flagpacketresend,
2705
16
        { "Flag Packet Resend", "gvsp.flag.packetresend",
2706
16
        FT_UINT16, BASE_HEX, NULL, 0x0001,
2707
16
        NULL, HFILL
2708
16
        }},
2709
2710
16
        {&hf_gvsp_format,
2711
16
        { "Format", "gvsp.format",
2712
16
        FT_UINT8, BASE_HEX, VALS(formatnames), 0,
2713
16
        NULL, HFILL
2714
16
        }},
2715
2716
16
        {&hf_gvsp_packetid24,
2717
16
        { "Packet ID (24 bits)", "gvsp.packetid24",
2718
16
        FT_UINT32, BASE_DEC, NULL, 0,
2719
16
        NULL, HFILL
2720
16
        }},
2721
2722
16
        {&hf_gvsp_blockid64,
2723
16
        { "Block ID (64 bits v2.0)", "gvsp.blockid64",
2724
16
        FT_UINT64, BASE_DEC, NULL, 0x0,
2725
16
        NULL, HFILL
2726
16
        }},
2727
2728
16
        {&hf_gvsp_packetid32,
2729
16
        { "Packet ID (32 bits v2.0)", "gvsp.packetid32",
2730
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
2731
16
        NULL, HFILL
2732
16
        }},
2733
2734
16
        {&hf_gvsp_payloadtype,
2735
16
        { "Payload Type", "gvsp.payloadtype",
2736
16
        FT_UINT16, BASE_HEX|BASE_EXT_STRING, &payloadtypenames_ext, 0x0,
2737
16
        NULL, HFILL
2738
16
        }},
2739
2740
16
        {&hf_gvsp_payloaddata,
2741
16
        { "Payload Data", "gvsp.payloaddata",
2742
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
2743
16
        NULL, HFILL
2744
16
        }},
2745
2746
16
        {&hf_gvsp_timestamp,
2747
16
        { "Timestamp", "gvsp.timestamp",
2748
16
        FT_UINT64, BASE_HEX, NULL, 0x0,
2749
16
        NULL, HFILL
2750
16
        }},
2751
2752
16
        {&hf_gvsp_pixelformat,
2753
16
        { "Pixel Format", "gvsp.pixel",
2754
16
        FT_UINT32, BASE_HEX|BASE_EXT_STRING, &pixeltypenames_ext, 0x0,
2755
16
        NULL, HFILL
2756
16
        }},
2757
2758
16
        {&hf_gvsp_sizex,
2759
16
        { "Size X", "gvsp.sizex",
2760
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
2761
16
        NULL, HFILL
2762
16
        }},
2763
2764
16
        {&hf_gvsp_sizey,
2765
16
        { "Size Y", "gvsp.sizey",
2766
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
2767
16
        NULL, HFILL
2768
16
        }},
2769
2770
16
        {&hf_gvsp_offsetx,
2771
16
        { "Offset X", "gvsp.offsetx",
2772
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
2773
16
        NULL, HFILL
2774
16
        }},
2775
2776
16
        {&hf_gvsp_offsety,
2777
16
        { "Offset Y", "gvsp.offsety",
2778
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
2779
16
        NULL, HFILL
2780
16
        }},
2781
2782
16
        {&hf_gvsp_paddingx,
2783
16
        { "Padding X", "gvsp.paddingx",
2784
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
2785
16
        NULL, HFILL
2786
16
        }},
2787
2788
16
        {&hf_gvsp_paddingy,
2789
16
        { "Padding Y", "gvsp.paddingy",
2790
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
2791
16
        NULL, HFILL
2792
16
        }},
2793
2794
16
        {&hf_gvsp_payloaddatasize,
2795
16
        { "Payload Data Size", "gvsp.payloaddatasize",
2796
16
        FT_UINT64, BASE_DEC, NULL, 0x0,
2797
16
        NULL, HFILL
2798
16
        }},
2799
2800
16
        {&hf_gvsp_pixelcolor,
2801
16
        { "Monochrome or Color", "gvsp.pixel.color",
2802
16
        FT_UINT32, BASE_HEX, VALS(colornames), 0xFF000000,
2803
16
        NULL, HFILL
2804
16
        }},
2805
2806
16
        {&hf_gvsp_pixeloccupy,
2807
16
        { "Occupy Bits", "gvsp.pixel.occupy",
2808
16
        FT_UINT32, BASE_DEC, NULL, 0x00FF0000,
2809
16
        NULL, HFILL
2810
16
        }},
2811
2812
16
        {&hf_gvsp_pixelid,
2813
16
        { "ID", "gvsp.pixel.id",
2814
16
        FT_UINT32, BASE_HEX, NULL, 0x0000FFFF,
2815
16
        NULL, HFILL
2816
16
        }},
2817
2818
16
        {&hf_gvsp_filename,
2819
16
        { "Filename", "gvsp.filename",
2820
16
        FT_STRINGZ, BASE_NONE, NULL, 0,
2821
16
        NULL, HFILL
2822
16
        }},
2823
2824
16
        {&hf_gvsp_payloadlength,
2825
16
        { "Payload Length", "gvsp.payloadlength",
2826
16
        FT_UINT32, BASE_DEC, NULL, 0,
2827
16
        NULL, HFILL
2828
16
        }},
2829
2830
16
        {&hf_gvsp_fieldinfo,
2831
16
        { "Field Info", "gvsp.fieldinfo",
2832
16
        FT_UINT8, BASE_HEX, NULL, 0,
2833
16
        NULL, HFILL
2834
16
        }},
2835
2836
16
        {&hf_gvsp_fieldid,
2837
16
        { "Field ID", "gvsp.fieldid",
2838
16
        FT_UINT8, BASE_HEX, NULL, 0xF0,
2839
16
        NULL, HFILL
2840
16
        }},
2841
2842
16
        {&hf_gvsp_fieldcount,
2843
16
        { "Field Count", "gvsp.fieldcount",
2844
16
        FT_UINT8, BASE_HEX, NULL, 0x0F,
2845
16
        NULL, HFILL
2846
16
        }},
2847
2848
16
        {&hf_gvsp_genericflags,
2849
16
        { "Generic Flag", "gvsp.genericflag",
2850
16
        FT_UINT8, BASE_HEX, NULL, 0,
2851
16
        NULL, HFILL
2852
16
        }},
2853
2854
16
        {&hf_gvsp_timestamptickfrequency ,
2855
16
        { "Timestamp Tick Frequency", "gvsp.timestamptickfrequency",
2856
16
        FT_UINT64, BASE_HEX_DEC, NULL, 0x0,
2857
16
        NULL, HFILL
2858
16
        }},
2859
2860
16
        {&hf_gvsp_dataformat,
2861
16
        { "Data Format", "gvsp.dataformat",
2862
16
        FT_UINT32, BASE_HEX, NULL, 0,
2863
16
        NULL, HFILL
2864
16
        }},
2865
2866
16
        {&hf_gvsp_packetizationmode,
2867
16
        { "packetization_mode", "gvsp.packetizationmode",
2868
16
        FT_UINT8, BASE_HEX, NULL, 0,
2869
16
        NULL, HFILL
2870
16
        }},
2871
2872
16
        {&hf_gvsp_packetsize,
2873
16
        { "packet_size", "gvsp.packetsize",
2874
16
        FT_UINT16, BASE_DEC, NULL, 0,
2875
16
        NULL, HFILL
2876
16
        }},
2877
2878
16
        {&hf_gvsp_profileidc,
2879
16
        { "profile_idc", "gvsp.profileidc",
2880
16
        FT_UINT8, BASE_HEX, NULL, 0,
2881
16
        NULL, HFILL
2882
16
        }},
2883
2884
16
        {&hf_gvsp_cs,
2885
16
        { "cs", "gvsp.cs",
2886
16
        FT_UINT8, BASE_HEX, NULL, 0,
2887
16
        NULL, HFILL
2888
16
        }},
2889
2890
16
        {&hf_gvsp_cs0,
2891
16
        { "cs0", "gvsp.cs0",
2892
16
        FT_UINT8, BASE_HEX, NULL, 0x80,
2893
16
        NULL, HFILL
2894
16
        }},
2895
2896
16
        {&hf_gvsp_cs1,
2897
16
        { "cs1", "gvsp.cs1",
2898
16
        FT_UINT8, BASE_HEX, NULL, 0x40,
2899
16
        NULL, HFILL
2900
16
        }},
2901
2902
16
        {&hf_gvsp_cs2,
2903
16
        { "cs2", "gvsp.cs2",
2904
16
        FT_UINT8, BASE_HEX, NULL, 0x20,
2905
16
        NULL, HFILL
2906
16
        }},
2907
2908
16
        {&hf_gvsp_cs3,
2909
16
        { "cs3", "gvsp.cs3",
2910
16
        FT_UINT8, BASE_HEX, NULL, 0x10,
2911
16
        NULL, HFILL
2912
16
        }},
2913
2914
16
        {&hf_gvsp_levelidc,
2915
16
        { "level_idc", "gvsp.levelidc",
2916
16
        FT_UINT8, BASE_HEX, NULL, 0,
2917
16
        NULL, HFILL
2918
16
        }},
2919
2920
16
        {&hf_gvsp_sropinterleavingdepth,
2921
16
        { "srop_interleaving_depth", "gvsp.sropinterleavingdepth",
2922
16
        FT_UINT16, BASE_HEX, NULL, 0,
2923
16
        NULL, HFILL
2924
16
        }},
2925
2926
16
        {&hf_gvsp_sropmaxdondiff,
2927
16
        { "srop_max_don_diff", "gvsp.sropmaxdondiff",
2928
16
        FT_UINT16, BASE_HEX, NULL, 0,
2929
16
        NULL, HFILL
2930
16
        }},
2931
2932
16
        {&hf_gvsp_sropdeintbufreq,
2933
16
        { "srop_deint_buf_req", "gvsp.sropdeintbufreq",
2934
16
        FT_UINT32, BASE_HEX, NULL, 0,
2935
16
        NULL, HFILL
2936
16
        }},
2937
2938
16
        {&hf_gvsp_sropinitbuftime,
2939
16
        { "srop_init_buf_time", "gvsp.sropinitbuftime",
2940
16
        FT_UINT32, BASE_HEX, NULL, 0,
2941
16
        NULL, HFILL
2942
16
        }},
2943
2944
16
        {&hf_gvsp_add_zones,
2945
16
        { "Additional Zones (Multi-Zone)", "gvsp.addzones",
2946
16
        FT_UINT8, BASE_HEX, NULL, 0x1F,
2947
16
        NULL, HFILL
2948
16
        }},
2949
2950
16
        {&hf_gvsp_zoneinfo,
2951
16
        { "Zone Info (Multi-Zone)", "gvsp.multizoneinfo",
2952
16
        FT_UINT8, BASE_HEX, NULL, 0,
2953
16
        NULL, HFILL
2954
16
        }},
2955
2956
16
        {&hf_gvsp_zoneid,
2957
16
        { "Zone ID", "gvsp.zoneid",
2958
16
        FT_UINT8, BASE_HEX, NULL, 0x3E,
2959
16
        NULL, HFILL
2960
16
        }},
2961
2962
16
        {&hf_gvsp_endofzone,
2963
16
        { "End of Zone", "gvsp.endofzone",
2964
16
        FT_BOOLEAN, 8, NULL, 0x01,
2965
16
        NULL, HFILL
2966
16
        }},
2967
2968
16
        {&hf_gvsp_addressoffset,
2969
16
        { "Address Offset", "gvsp.addressoffset",
2970
16
        FT_UINT64, BASE_HEX_DEC, NULL, 0,
2971
16
        NULL, HFILL
2972
16
        }},
2973
2974
16
        {&hf_gvsp_sc_zone_direction,
2975
16
        { "Zone Directions Mask", "gvsp.zonedirection",
2976
16
        FT_UINT32, BASE_HEX_DEC, NULL, 0,
2977
16
        NULL, HFILL
2978
16
        }},
2979
2980
16
        {&hf_gvsp_sc_zone0_direction,
2981
16
        { "Zone 0 Direction", "gvsp.zone0direction",
2982
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x80000000,
2983
16
        NULL, HFILL
2984
16
        }},
2985
2986
16
        {&hf_gvsp_sc_zone1_direction,
2987
16
        { "Zone 1 Direction", "gvsp.zone1direction",
2988
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x40000000,
2989
16
        NULL, HFILL
2990
16
        }},
2991
2992
16
        {&hf_gvsp_sc_zone2_direction,
2993
16
        { "Zone 2 Direction", "gvsp.zone2direction",
2994
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x20000000,
2995
16
        NULL, HFILL
2996
16
        }},
2997
2998
16
        {&hf_gvsp_sc_zone3_direction,
2999
16
        { "Zone 3 Direction", "gvsp.zone3direction",
3000
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x10000000,
3001
16
        NULL, HFILL
3002
16
        }},
3003
3004
16
        {&hf_gvsp_sc_zone4_direction,
3005
16
        { "Zone 4 Direction", "gvsp.zone4direction",
3006
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x08000000,
3007
16
        NULL, HFILL
3008
16
        }},
3009
3010
16
        {&hf_gvsp_sc_zone5_direction,
3011
16
        { "Zone 5 Direction", "gvsp.zone5direction",
3012
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x04000000,
3013
16
        NULL, HFILL
3014
16
        }},
3015
3016
16
        {&hf_gvsp_sc_zone6_direction,
3017
16
        { "Zone 6 Direction", "gvsp.zone6direction",
3018
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x02000000,
3019
16
        NULL, HFILL
3020
16
        }},
3021
3022
16
        {&hf_gvsp_sc_zone7_direction,
3023
16
        { "Zone 7 Direction", "gvsp.zone7direction",
3024
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x01000000,
3025
16
        NULL, HFILL
3026
16
        }},
3027
3028
16
        {&hf_gvsp_sc_zone8_direction,
3029
16
        { "Zone 8 Direction", "gvsp.zone8direction",
3030
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00800000,
3031
16
        NULL, HFILL
3032
16
        }},
3033
3034
16
        {&hf_gvsp_sc_zone9_direction,
3035
16
        { "Zone 9 Direction", "gvsp.zone9direction",
3036
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00400000,
3037
16
        NULL, HFILL
3038
16
        }},
3039
3040
16
        {&hf_gvsp_sc_zone10_direction,
3041
16
        { "Zone 10 Direction", "gvsp.zone10direction",
3042
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00200000,
3043
16
        NULL, HFILL
3044
16
        }},
3045
3046
16
        {&hf_gvsp_sc_zone11_direction,
3047
16
        { "Zone 11 Direction", "gvsp.zone11direction",
3048
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00100000,
3049
16
        NULL, HFILL
3050
16
        }},
3051
3052
16
        {&hf_gvsp_sc_zone12_direction,
3053
16
        { "Zone 12 Direction", "gvsp.zone12direction",
3054
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00080000,
3055
16
        NULL, HFILL
3056
16
        }},
3057
3058
16
        {&hf_gvsp_sc_zone13_direction,
3059
16
        { "Zone 13 Direction", "gvsp.zone13direction",
3060
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00040000,
3061
16
        NULL, HFILL
3062
16
        }},
3063
3064
16
        {&hf_gvsp_sc_zone14_direction,
3065
16
        { "Zone 14 Direction", "gvsp.zone14direction",
3066
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00020000,
3067
16
        NULL, HFILL
3068
16
        }},
3069
3070
16
        {&hf_gvsp_sc_zone15_direction,
3071
16
        { "Zone 15 Direction", "gvsp.zone15direction",
3072
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00010000,
3073
16
        NULL, HFILL
3074
16
        }},
3075
3076
16
        {&hf_gvsp_sc_zone16_direction,
3077
16
        { "Zone 16 Direction", "gvsp.zone16direction",
3078
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00008000,
3079
16
        NULL, HFILL
3080
16
        }},
3081
3082
16
        {&hf_gvsp_sc_zone17_direction,
3083
16
        { "Zone 17 Direction", "gvsp.zone17direction",
3084
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00004000,
3085
16
        NULL, HFILL
3086
16
        }},
3087
3088
16
        {&hf_gvsp_sc_zone18_direction,
3089
16
        { "Zone 18 Direction", "gvsp.zone18direction",
3090
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00002000,
3091
16
        NULL, HFILL
3092
16
        }},
3093
3094
16
        {&hf_gvsp_sc_zone19_direction,
3095
16
        { "Zone 19 Direction", "gvsp.zone19direction",
3096
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00001000,
3097
16
        NULL, HFILL
3098
16
        }},
3099
3100
16
        {&hf_gvsp_sc_zone20_direction,
3101
16
        { "Zone 20 Direction", "gvsp.zone20direction",
3102
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000800,
3103
16
        NULL, HFILL
3104
16
        }},
3105
3106
16
        {&hf_gvsp_sc_zone21_direction,
3107
16
        { "Zone 21 Direction", "gvsp.zone21direction",
3108
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000400,
3109
16
        NULL, HFILL
3110
16
        }},
3111
3112
16
        {&hf_gvsp_sc_zone22_direction,
3113
16
        { "Zone 22 Direction", "gvsp.zone22direction",
3114
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000200,
3115
16
        NULL, HFILL
3116
16
        }},
3117
3118
16
        {&hf_gvsp_sc_zone23_direction,
3119
16
        { "Zone 23 Direction", "gvsp.zone23direction",
3120
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000100,
3121
16
        NULL, HFILL
3122
16
        }},
3123
3124
16
        {&hf_gvsp_sc_zone24_direction,
3125
16
        { "Zone 24 Direction", "gvsp.zone24direction",
3126
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000080,
3127
16
        NULL, HFILL
3128
16
        }},
3129
3130
16
        {&hf_gvsp_sc_zone25_direction,
3131
16
        { "Zone 25 Direction", "gvsp.zone25direction",
3132
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000040,
3133
16
        NULL, HFILL
3134
16
        }},
3135
3136
16
        {&hf_gvsp_sc_zone26_direction,
3137
16
        { "Zone 26 Direction", "gvsp.zone26direction",
3138
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000020,
3139
16
        NULL, HFILL
3140
16
        }},
3141
3142
16
        {&hf_gvsp_sc_zone27_direction,
3143
16
        { "Zone 27 Direction", "gvsp.zone27direction",
3144
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000010,
3145
16
        NULL, HFILL
3146
16
        }},
3147
3148
16
        {&hf_gvsp_sc_zone28_direction,
3149
16
        { "Zone 28 Direction", "gvsp.zone28direction",
3150
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000008,
3151
16
        NULL, HFILL
3152
16
        }},
3153
3154
16
        {&hf_gvsp_sc_zone29_direction,
3155
16
        { "Zone 29 Direction", "gvsp.zone29direction",
3156
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000004,
3157
16
        NULL, HFILL
3158
16
        }},
3159
3160
16
        {&hf_gvsp_sc_zone30_direction,
3161
16
        { "Zone 30 Direction", "gvsp.zone30direction",
3162
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000002,
3163
16
        NULL, HFILL
3164
16
        }},
3165
3166
16
        {&hf_gvsp_sc_zone31_direction,
3167
16
        { "Zone 31 Direction", "gvsp.zone31direction",
3168
16
        FT_BOOLEAN, 32, TFS(&zonedirectionnames), 0x00000001,
3169
16
        NULL, HFILL
3170
16
        }},
3171
3172
16
        {&hf_gvsp_numparts,
3173
16
        { "Multi-part number of parts", "gvsp.numparts",
3174
16
        FT_UINT8, BASE_DEC, NULL, 0,
3175
16
        NULL, HFILL
3176
16
        }},
3177
3178
16
        {&hf_gvsp_multipart_data_type,
3179
16
        { "Data Type", "gvsp.multipartdatatype",
3180
16
        FT_UINT16, BASE_HEX|BASE_EXT_STRING, &multipartdatatypenames_ext, 0,
3181
16
        NULL, HFILL
3182
16
        }},
3183
3184
16
        {&hf_gvsp_partlength,
3185
16
        { "Part Length", "gvsp.partlength",
3186
16
        FT_UINT64, BASE_HEX_DEC, NULL, 0,
3187
16
        NULL, HFILL
3188
16
        }},
3189
3190
16
        {&hf_gvsp_multi_part_source_id,
3191
16
        { "Source ID", "gvsp.sourceid",
3192
16
        FT_UINT8, BASE_HEX_DEC, NULL, 0,
3193
16
        NULL, HFILL
3194
16
        }},
3195
3196
16
        {&hf_gvsp_data_purpose_id,
3197
16
        { "Data Purpose ID", "gvsp.datapurposeid",
3198
16
        FT_UINT16, BASE_HEX_DEC, NULL, 0,
3199
16
        NULL, HFILL
3200
16
        }},
3201
3202
16
        {&hf_gvsp_region_id,
3203
16
        { "Region ID", "gvsp.regionid",
3204
16
        FT_UINT16, BASE_HEX_DEC, NULL, 0,
3205
16
        NULL, HFILL
3206
16
        }},
3207
3208
16
        {&hf_gvsp_data_type_specific,
3209
16
        { "Data Type Specific", "gvsp.datatypespecific",
3210
16
        FT_UINT32, BASE_HEX_DEC, NULL, 0,
3211
16
        NULL, HFILL
3212
16
        }},
3213
3214
16
        {&hf_gvsp_endofpart,
3215
16
        { "End of Part", "gvsp.endofpart",
3216
16
        FT_BOOLEAN, 8, NULL, 0x40,
3217
16
        NULL, HFILL
3218
16
        }},
3219
3220
16
        {&hf_gvsp_add_zones_multipart,
3221
16
        { "Additional Zones (Multi-Part)", "gvsp.multipartaddzones",
3222
16
        FT_UINT8, BASE_HEX, NULL, 0x1F,
3223
16
        NULL, HFILL
3224
16
        }},
3225
3226
16
        {&hf_gvsp_zoneinfo_multipart,
3227
16
        { "Zone Info (Multi-Part)", "gvsp.multipartzoneinfo",
3228
16
        FT_UINT8, BASE_HEX, NULL, 0,
3229
16
        NULL, HFILL
3230
16
        }},
3231
3232
16
        {&hf_gvsp_multi_part_part_id,
3233
16
        { "Part ID", "gvsp.partid",
3234
16
        FT_UINT8, BASE_HEX_DEC, NULL, 0,
3235
16
        NULL, HFILL
3236
16
        }},
3237
3238
16
        {&hf_gvsp_chunk_data_payload_length_hex,
3239
16
        { "Chunk Data Payload Length", "gvsp.chunkdatapayloadlengthhex",
3240
16
        FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
3241
16
        NULL, HFILL
3242
16
        }},
3243
3244
16
        {&hf_gvsp_chunk_layout_id_hex,
3245
16
        { "Chunk Layout ID", "gvsp.chunklayoutidhex",
3246
16
        FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
3247
16
        NULL, HFILL
3248
16
        }},
3249
3250
        /* GEV 2.2 */
3251
16
        { &hf_gvsp_gendc_leader_descriptor_size_v2_2,
3252
16
        { "GenDC Descriptor Size", "gvsp.gendcdescriptorsize",
3253
16
        FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
3254
16
        NULL, HFILL
3255
16
        } },
3256
3257
16
        { &hf_gvsp_gendc_leader_flags_v2_2,
3258
16
        { "Flags", "gvsp.gendc.leader.flags",
3259
16
        FT_UINT8, BASE_HEX, NULL, 0,
3260
16
        NULL, HFILL
3261
16
        } },
3262
3263
16
        { &hf_gvsp_gendc_leader_flags_preliminary_descriptor_v2_2,
3264
16
        { "Preliminary Descriptor", "gvsp.gendc.leader.flags.preliminarydescriptor",
3265
16
        FT_UINT8, BASE_HEX, NULL, 0x80,
3266
16
        NULL, HFILL
3267
16
        } },
3268
3269
16
        { &hf_gvsp_gendc_leader_flags_reserved_v2_2,
3270
16
        { "Reserved", "gvsp.gendc.leader.flags.reserved",
3271
16
        FT_UINT8, BASE_HEX, NULL, 0x7F,
3272
16
        NULL, HFILL
3273
16
        } },
3274
3275
16
        { &hf_gvsp_gendc_payload_data_size_v2_2,
3276
16
        { "Data Size", "gvsp.gendc.payload.datasize",
3277
16
        FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
3278
16
        NULL, HFILL
3279
16
        } },
3280
3281
16
        { &hf_gvsp_gendc_payload_data_destination_offset_v2_2,
3282
16
        { "Data Destination Offset", "gvsp.gendc.payload.datadestinationoffset",
3283
16
        FT_UINT64, BASE_HEX_DEC, NULL, 0x0,
3284
16
        NULL, HFILL
3285
16
        } },
3286
3287
16
        { &hf_gvsp_gendc_payload_data_flags_v2_2,
3288
16
        { "Data Flags", "gvsp.gendc.payload.dataflags",
3289
16
        FT_UINT8, BASE_HEX, NULL, 0xFF,
3290
16
        NULL, HFILL
3291
16
        } },
3292
3293
16
        { &hf_gvsp_gendc_payload_data_flag_descriptor_flags_v2_2,
3294
16
        { "Descriptor Data Present", "gvsp.gendc.payload.dataflags.descriptordatapresent",
3295
16
        FT_UINT8, BASE_HEX, VALS(gendc_payload_descriptor_flag_values), GENDC_DESCRIPTOR_FLAG,
3296
16
        NULL, HFILL
3297
16
        } },
3298
3299
16
        { &hf_gvsp_gendc_payload_data_flag_start_of_descriptor_data_v2_2,
3300
16
        { "Start Of Descriptor Data", "gvsp.gendc.payload.dataflags.startofdescriptordata",
3301
16
        FT_UINT8, BASE_HEX, NULL, GENDC_DESCRIPTOR_START_FLAG,
3302
16
        NULL, HFILL
3303
16
        } },
3304
3305
16
        { &hf_gvsp_gendc_payload_data_flag_end_of_descriptor_data_v2_2,
3306
16
        { "End Of Descriptor Data", "gvsp.gendc.payload.dataflags.endofdescriptordata",
3307
16
        FT_UINT8, BASE_HEX, NULL, GENDC_DESCRIPTOR_END_FLAG,
3308
16
        NULL, HFILL
3309
16
        } },
3310
3311
16
        { &hf_gvsp_gendc_payload_data_flags_reserved_v2_2,
3312
16
        { "Reserved", "gvsp.gendc.payload.dataflags.reserved",
3313
16
        FT_UINT8, BASE_HEX, NULL, 0x0F,
3314
16
        NULL, HFILL
3315
16
        } },
3316
3317
16
        { &hf_gvsp_gendc_payload_flow_flags_v2_2,
3318
16
        { "Flow Flags", "gvsp.gendc.payload.flowflags",
3319
16
        FT_UINT8, BASE_HEX, NULL, 0xFF,
3320
16
        NULL, HFILL
3321
16
        } },
3322
3323
16
        { &hf_gvsp_gendc_payload_flow_flag_first_packet_v2_2,
3324
16
        { "First Packet With Current Flow ID", "gvsp.gendc.payload.flowflags.firstpacketwithcurrentflow",
3325
16
        FT_UINT8, BASE_HEX, NULL, 0x80,
3326
16
        NULL, HFILL
3327
16
        } },
3328
3329
16
        { &hf_gvsp_gendc_payload_flow_flag_last_packet_v2_2,
3330
16
        { "Last Packet With Current Flow ID", "gvsp.gendc.payload.flowflags.lastpacketwithcurrentflow",
3331
16
        FT_UINT8, BASE_HEX, NULL, 0x40,
3332
16
        NULL, HFILL
3333
16
        } },
3334
3335
16
        { &hf_gvsp_gendc_payload_flow_id_v2_2,
3336
16
        { "Flow ID", "gvsp.gendc.payload.flowid",
3337
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
3338
16
        NULL, HFILL
3339
16
        } },
3340
3341
16
        { &hf_gvsp_gendc_header_type_v2_2,
3342
16
        { "Header Type", "gvsp.gendc.header.type",
3343
16
        FT_UINT16, BASE_HEX, VALS(gendc_header_type_values), 0x0,
3344
16
        NULL, HFILL
3345
16
        } },
3346
3347
16
        { &hf_gvsp_gendc_header_size_v2_2,
3348
16
        { "Size", "gvsp.gendc.header.size",
3349
16
        FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
3350
16
        NULL, HFILL
3351
16
        } },
3352
3353
16
        { &hf_gvsp_gendc_header_reserved_1_byte_v2_2,
3354
16
        { "Reserved (1 Byte)", "gvsp.gendc.header.reserved1",
3355
16
        FT_UINT8, BASE_HEX, NULL, 0x0,
3356
16
        NULL, HFILL
3357
16
        } },
3358
3359
16
        { &hf_gvsp_gendc_header_reserved_2_bytes_v2_2,
3360
16
        { "Reserved (2 Bytes)", "gvsp.gendc.header.reserved2",
3361
16
        FT_UINT16, BASE_HEX, NULL, 0x0,
3362
16
        NULL, HFILL
3363
16
        } },
3364
3365
16
        { &hf_gvsp_gendc_header_reserved_4_bytes_v2_2,
3366
16
        { "Reserved (4 Bytes)", "gvsp.gendc.header.reserved4",
3367
16
        FT_UINT32, BASE_HEX, NULL, 0x0,
3368
16
        NULL, HFILL
3369
16
        } },
3370
3371
16
        { &hf_gvsp_gendc_container_header_signature_v2_2,
3372
16
        { "Signature", "gvsp.gendc.container.header.signature",
3373
16
        FT_STRING, BASE_NONE, NULL, 0x0,
3374
16
        NULL, HFILL
3375
16
        } },
3376
3377
16
        { &hf_gvsp_gendc_container_header_version_major_v2_2,
3378
16
        { "Major Version", "gvsp.gendc.container.header.majorversion",
3379
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
3380
16
        NULL, HFILL
3381
16
        } },
3382
3383
16
        { &hf_gvsp_gendc_container_header_version_minor_v2_2,
3384
16
        { "Minor Version", "gvsp.gendc.container.header.minorversion",
3385
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
3386
16
        NULL, HFILL
3387
16
        } },
3388
3389
16
        { &hf_gvsp_gendc_container_header_version_sub_minor_v2_2,
3390
16
        { "Sub Minor Version", "gvsp.gendc.container.header.subminorversion",
3391
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
3392
16
        NULL, HFILL
3393
16
        } },
3394
3395
16
        { &hf_gvsp_gendc_container_header_flags_v2_2,
3396
16
        { "Flags", "gvsp.gendc.container.header.flags",
3397
16
        FT_UINT16, BASE_HEX, NULL, 0x0,
3398
16
        NULL, HFILL
3399
16
        } },
3400
3401
16
        { &hf_gvsp_gendc_container_header_flags_timestamp_ptp_v2_2,
3402
16
        { "Timestamp PTP", "gvsp.gendc.container.header.flags.timestampptp",
3403
16
        FT_UINT16, BASE_HEX, NULL, 0x0001,
3404
16
        NULL, HFILL
3405
16
        } },
3406
3407
16
        { &hf_gvsp_gendc_container_header_flags_component_invalid_v2_2,
3408
16
        { "Component Invalid", "gvsp.gendc.container.header.flags.componentinvalid",
3409
16
        FT_UINT16, BASE_HEX, NULL, 0x0002,
3410
16
        NULL, HFILL
3411
16
        } },
3412
3413
16
        { &hf_gvsp_gendc_container_header_flags_reserved_v2_2,
3414
16
        { "Reserved", "gvsp.gendc.container.header.flags.reserved",
3415
16
        FT_UINT16, BASE_HEX, NULL, 0xFFFC,
3416
16
        NULL, HFILL
3417
16
        } },
3418
3419
16
        { &hf_gvsp_gendc_container_header_id_v2_2,
3420
16
        { "ID", "gvsp.gendc.container.header.id",
3421
16
        FT_UINT64, BASE_HEX_DEC, NULL, 0x0,
3422
16
        NULL, HFILL
3423
16
        } },
3424
3425
16
        { &hf_gvsp_gendc_container_header_variable_fields_v2_2,
3426
16
        { "Variable Fields", "gvsp.gendc.container.header.variablefields",
3427
16
        FT_UINT16, BASE_HEX, NULL, 0x0,
3428
16
        NULL, HFILL
3429
16
        } },
3430
3431
16
        { &hf_gvsp_gendc_container_header_variable_fields_data_size_v2_2,
3432
16
        { "Data Size", "gvsp.gendc.container.header.variablefields.datasize",
3433
16
        FT_UINT16, BASE_HEX, NULL, 0x0001,
3434
16
        NULL, HFILL
3435
16
        } },
3436
3437
16
        { &hf_gvsp_gendc_container_header_variable_fields_size_x_v2_2,
3438
16
        { "Size X", "gvsp.gendc.container.header.variablefields.sizex",
3439
16
        FT_UINT16, BASE_HEX, NULL, 0x0002,
3440
16
        NULL, HFILL
3441
16
        } },
3442
3443
16
        { &hf_gvsp_gendc_container_header_variable_fields_size_y_v2_2,
3444
16
        { "Size Y", "gvsp.gendc.container.header.variablefields.sizey",
3445
16
        FT_UINT16, BASE_HEX, NULL, 0x0004,
3446
16
        NULL, HFILL
3447
16
        } },
3448
3449
16
        { &hf_gvsp_gendc_container_header_variable_fields_region_offset_v2_2,
3450
16
        { "Region Offset", "gvsp.gendc.container.header.variablefields.regionoffset",
3451
16
        FT_UINT16, BASE_HEX, NULL, 0x0008,
3452
16
        NULL, HFILL
3453
16
        } },
3454
3455
16
        { &hf_gvsp_gendc_container_header_variable_fields_format_v2_2,
3456
16
        { "Format", "gvsp.gendc.container.header.variablefields.format",
3457
16
        FT_UINT16, BASE_HEX, NULL, 0x0010,
3458
16
        NULL, HFILL
3459
16
        } },
3460
3461
16
        { &hf_gvsp_gendc_container_header_variable_fields_timestamp_v2_2,
3462
16
        { "Timestamp", "gvsp.gendc.container.header.variablefields.timestamp",
3463
16
        FT_UINT16, BASE_HEX, NULL, 0x0020,
3464
16
        NULL, HFILL
3465
16
        } },
3466
3467
16
        { &hf_gvsp_gendc_container_header_variable_fields_component_count_v2_2,
3468
16
        { "Component Count", "gvsp.gendc.container.header.variablefields.componentcount",
3469
16
        FT_UINT16, BASE_HEX, NULL, 0x0040,
3470
16
        NULL, HFILL
3471
16
        } },
3472
3473
16
        { &hf_gvsp_gendc_container_header_variable_fields_component_invalid_v2_2,
3474
16
        { "Component Invalid", "gvsp.gendc.container.header.variablefields.componentinvalid",
3475
16
        FT_UINT16, BASE_HEX, NULL, 0x0080,
3476
16
        NULL, HFILL
3477
16
        } },
3478
3479
16
        { &hf_gvsp_gendc_container_header_variable_fields_reserved_v2_2,
3480
16
        { "Reserved", "gvsp.gendc.container.header.variablefields.reserved",
3481
16
        FT_UINT16, BASE_HEX, NULL, 0xFF00,
3482
16
        NULL, HFILL
3483
16
        } },
3484
3485
16
        { &hf_gvsp_gendc_container_header_data_size_v2_2,
3486
16
        { "Data Size", "gvsp.gendc.container.header.datasize",
3487
16
        FT_UINT64, BASE_HEX_DEC, NULL, 0x0,
3488
16
        NULL, HFILL
3489
16
        } },
3490
3491
16
        { &hf_gvsp_gendc_container_header_data_offset_v2_2,
3492
16
        { "Data Offset", "gvsp.gendc.container.header.dataoffset",
3493
16
        FT_UINT64, BASE_HEX_DEC, NULL, 0x0,
3494
16
        NULL, HFILL
3495
16
        } },
3496
3497
16
        { &hf_gvsp_gendc_container_header_descriptor_size_v2_2,
3498
16
        { "Descriptor Size", "gvsp.gendc.container.header.descriptorsize",
3499
16
        FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
3500
16
        NULL, HFILL
3501
16
        } },
3502
3503
16
        { &hf_gvsp_gendc_container_header_component_count_v2_2,
3504
16
        { "Component Count", "gvsp.gendc.container.header.componentcount",
3505
16
        FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
3506
16
        NULL, HFILL
3507
16
        } },
3508
3509
16
        { &hf_gvsp_gendc_container_header_component_offset_v2_2,
3510
16
        { "Component Offset", "gvsp.gendc.container.header.componentoffset",
3511
16
        FT_UINT64, BASE_HEX_DEC, NULL, 0x0,
3512
16
        NULL, HFILL
3513
16
        } },
3514
3515
16
        { &hf_gvsp_gendc_component_header_flags_v2_2,
3516
16
        { "Flags", "gvsp.gendc.component.header.flags",
3517
16
        FT_UINT16, BASE_HEX, NULL, 0x0,
3518
16
        NULL, HFILL
3519
16
        } },
3520
3521
16
        { &hf_gvsp_gendc_component_header_flags_invalid_v2_2,
3522
16
        { "Invalid", "gvsp.gendc.container.header.flags.invalid",
3523
16
        FT_UINT16, BASE_HEX, NULL, 0x0001,
3524
16
        NULL, HFILL
3525
16
        } },
3526
3527
16
        { &hf_gvsp_gendc_component_header_flags_reserved_v2_2,
3528
16
        { "Reserved", "gvsp.gendc.component.header.flags.reserved",
3529
16
        FT_UINT16, BASE_HEX, NULL, 0xFFFE,
3530
16
        NULL, HFILL
3531
16
        } },
3532
3533
16
        { &hf_gvsp_gendc_component_header_group_id_v2_2,
3534
16
        { "Group ID", "gvsp.gendc.component.header.groupid",
3535
16
        FT_UINT16, BASE_HEX_DEC, NULL, 0,
3536
16
        NULL, HFILL
3537
16
        } },
3538
3539
16
        { &hf_gvsp_gendc_component_header_source_id_v2_2,
3540
16
        { "Source ID", "gvsp.gendc.component.header.sourceid",
3541
16
        FT_UINT16, BASE_HEX_DEC, NULL, 0,
3542
16
        NULL, HFILL
3543
16
        } },
3544
3545
16
        { &hf_gvsp_gendc_component_header_region_id_v2_2,
3546
16
        { "Region ID", "gvsp.gendc.component.header.regionid",
3547
16
        FT_UINT16, BASE_HEX_DEC, NULL, 0,
3548
16
        NULL, HFILL
3549
16
        } },
3550
3551
16
        { &hf_gvsp_gendc_component_header_type_id_v2_2,
3552
16
        { "Type ID", "gvsp.gendc.component.header.typeid",
3553
16
        FT_UINT64, BASE_HEX | BASE_VAL64_STRING, VALS64(gendc_component_typeid_values), 0x0,
3554
16
        NULL, HFILL
3555
16
        } },
3556
3557
16
        { &hf_gvsp_gendc_component_header_part_count_v2_2,
3558
16
        { "Part Count", "gvsp.gendc.component.header.partcount",
3559
16
        FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
3560
16
        NULL, HFILL
3561
16
        } },
3562
3563
16
        { &hf_gvsp_gendc_component_header_part_offset_v2_2,
3564
16
        { "Part Offset", "gvsp.gendc.container.header.partoffset",
3565
16
        FT_UINT64, BASE_HEX_DEC, NULL, 0x0,
3566
16
        NULL, HFILL
3567
16
        } },
3568
3569
16
        { &hf_gvsp_gendc_part_header_flags_xml_reserved1_v2_2,
3570
16
        { "Reserved", "gvsp.gendc.part.header.flags.xml.reserved1",
3571
16
        FT_UINT16, BASE_HEX, NULL, 0x00FF,
3572
16
        NULL, HFILL
3573
16
        } },
3574
3575
16
        { &hf_gvsp_gendc_part_header_flags_xml_zip_v2_2,
3576
16
        { "ZIP", "gvsp.gendc.part.header.flags.xml.zip",
3577
16
        FT_UINT16, BASE_HEX, NULL, 0x0100,
3578
16
        NULL, HFILL
3579
16
        } },
3580
3581
16
        { &hf_gvsp_gendc_part_header_flags_xml_chunk_v2_2,
3582
16
        { "Chunk", "gvsp.gendc.part.header.flags.xml.chunk",
3583
16
        FT_UINT16, BASE_HEX, NULL, 0x0200,
3584
16
        NULL, HFILL
3585
16
        } },
3586
3587
16
        { &hf_gvsp_gendc_part_header_flags_xml_reserved2_v2_2,
3588
16
        { "Reserved", "gvsp.gendc.part.header.flags.xml.reserved2",
3589
16
        FT_UINT16, BASE_HEX, NULL, 0xFC00,
3590
16
        NULL, HFILL
3591
16
        } },
3592
3593
16
        { &hf_gvsp_gendc_part_header_flags_v2_2,
3594
16
        { "Flags", "gvsp.gendc.part.header.flags",
3595
16
        FT_UINT16, BASE_HEX, NULL, 0x0,
3596
16
        NULL, HFILL
3597
16
        } },
3598
3599
16
        { &hf_gvsp_gendc_part_header_flow_offset_v2_2,
3600
16
        { "Flow Offset", "gvsp.gendc.part.header.flowoffset",
3601
16
        FT_UINT64, BASE_HEX_DEC, NULL, 0x0,
3602
16
        NULL, HFILL
3603
16
        } },
3604
3605
16
        { &hf_gvsp_gendc_part_header_type_specific_info_v2_2,
3606
16
        { "Type Specific Info", "gvsp.gendc.part.header.typespecificinfo",
3607
16
        FT_UINT64, BASE_HEX_DEC, NULL, 0x0,
3608
16
        NULL, HFILL
3609
16
        } },
3610
3611
16
        { &hf_gvsp_gendc_part_header_1D_size_v2_2,
3612
16
        { "Size (1D Data)", "gvsp.gendc.part.header.1d.size",
3613
16
        FT_UINT64, BASE_HEX_DEC, NULL, 0x0,
3614
16
        NULL, HFILL
3615
16
        } },
3616
3617
16
        { &hf_gvsp_gendc_part_header_1D_padding_v2_2,
3618
16
        { "Padding (1D Data)", "gvsp.gendc.part.header.1d.padding",
3619
16
        FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
3620
16
        NULL, HFILL
3621
16
        } },
3622
16
    };
3623
3624
16
    static int *ett[] = {
3625
16
        &ett_gvsp,
3626
16
        &ett_gvsp_flags,
3627
16
        &ett_gvsp_header,
3628
16
        &ett_gvsp_payload,
3629
16
        &ett_gvsp_trailer,
3630
16
        &ett_gvsp_pixelformat,
3631
16
        &ett_gvsp_fieldinfo,
3632
16
        &ett_gvsp_cs,
3633
16
        &ett_gvsp_sc_zone_direction,
3634
16
        &ett_gvsp_zoneinfo,
3635
16
        &ett_gvsp_zoneinfo_multipart,
3636
16
        &ett_gvsp_partinfo_leader,
3637
16
        &ett_gvsp_partinfo_trailer,
3638
16
        &ett_gvsp_gendc_leader_flags,
3639
16
        &ett_gvsp_gendc_payload_data_flags,
3640
16
        &ett_gvsp_gendc_payload_flow_flags,
3641
16
        &ett_gvsp_gendc_container_descriptor,
3642
16
        &ett_gvsp_gendc_container_header_flags,
3643
16
        &ett_gvsp_gendc_container_header_variable_fields,
3644
16
        &ett_gvsp_gendc_container_header_component_offsets,
3645
16
        &ett_gvsp_gendc_component_header,
3646
16
        &ett_gvsp_gendc_component_header_flags,
3647
16
        &ett_gvsp_gendc_part_offsets,
3648
16
        &ett_gvsp_gendc_part_header,
3649
16
        &ett_gvsp_gendc_part_header_flags
3650
16
    };
3651
3652
16
    proto_gvsp = proto_register_protocol("GigE Vision Streaming Protocol", "GVSP", "gvsp");
3653
3654
16
    gvsp_handle = register_dissector("gvsp", dissect_gvsp, proto_gvsp);
3655
3656
16
    static ei_register_info ei[] = {
3657
16
        { &ei_gvsp_gendc_offsets, { "gvsp.gendc.offsets_invalid", PI_MALFORMED, PI_ERROR, "GenDC offsets do not increase or too many parts", EXPFILL }},
3658
16
    };
3659
16
    expert_module_t *expert_gvsp;
3660
3661
16
    proto_register_field_array(proto_gvsp, hfgvsp, array_length(hfgvsp));
3662
16
    proto_register_subtree_array(ett, array_length(ett));
3663
16
    expert_gvsp = expert_register_protocol(proto_gvsp);
3664
16
    expert_register_field_array(expert_gvsp, ei, array_length(ei));
3665
3666
16
    gvsp_module = prefs_register_protocol(proto_gvsp, NULL);
3667
16
    prefs_register_obsolete_preference(gvsp_module, "enable_heuristic");
3668
16
}
3669
3670
void proto_reg_handoff_gvsp(void)
3671
16
{
3672
16
    dissector_add_for_decode_as_with_preference("udp.port", gvsp_handle);
3673
16
    heur_dissector_add("udp", dissect_gvsp_heur, "GigE Vision over UDP", "gvsp_udp", proto_gvsp, HEURISTIC_DISABLE);
3674
16
}
3675
3676
/*
3677
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
3678
 *
3679
 * Local variables:
3680
 * c-basic-offset: 4
3681
 * tab-width: 8
3682
 * indent-tabs-mode: nil
3683
 * End:
3684
 *
3685
 * vi: set shiftwidth=4 tabstop=8 expandtab:
3686
 * :indentSize=4:tabSize=8:noTabs=true:
3687
 */