Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-h224.c
blobc76d8f06a595344fd51b1b80d45e520ce1e76561
1 /* packet-h224.c
2 * Routines for H.224 dissection
3 * Copyright 2022, Anders Broman <anders.broman@ericsson.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
13 RFC description H.224 in SDP: RFC4573 https://www.rfc-editor.org/rfc/rfc4573.html
14 H.281 - FECC protocol H.281 https://www.itu.int/rec/T-REC-H.281/en
15 H.224 - transport encapsulation for FECC H.224 https://www.itu.int/rec/T-REC-H.224-200501-I/en
16 H.323 Annex Q - packing description H.224 in RTP H.323 https://www.itu.int/rec/T-REC-H.323-202203-I
19 #include <config.h>
21 #include <wsutil/array.h>
22 #include <epan/packet.h>
23 #include <epan/proto.h>
24 #include <epan/t35.h>
25 #include <epan/tfs.h>
26 //#include <epan/expert.h>
27 //#include <epan/prefs.h>
29 /* Prototypes */
30 void proto_reg_handoff_h224(void);
31 void proto_register_h224(void);
33 /* Initialize the protocol and registered fields */
34 static int proto_h224;
35 static int hf_h224_q922_dlci_priority;
36 static int hf_h224_q922_ctl;
37 static int hf_h224_dta;
38 static int hf_h224_sta;
39 static int hf_h224_reserved;
40 static int hf_h224_standard_client_id;
41 static int hf_h224_extended_client_id_list;
42 static int hf_h224_non_standard_client;
43 static int hf_h224_extended_client_id;
44 static int hf_h224_country_code;
45 static int hf_h224_extension;
46 static int hf_h224_manufacturer_code;
47 static int hf_h224_client_id_manufacturer;
49 static int hf_h224_es_b7;
50 static int hf_h224_bs_b6;
51 static int hf_h224_c1_b5;
52 static int hf_h224_c2_b4;
53 static int hf_h224_seg_b3b0;
54 static int hf_h224_other_client_data;
56 static int hf_h224_client_list_code;
57 static int hf_h224_extra_caps_code;
58 static int hf_h224_response_code;
59 static int hf_h224_number_of_clients;
60 static int hf_h224_ex_caps_bit;
61 static int hf_h224_caps_reserved;
62 static int hf_h224_brd_svs;
63 static int hf_h224_number_of_presets;
64 static int hf_h224_vs_id;
65 static int hf_h224_vs_reserved_b3;
66 static int hf_h224_vs_reserved_b3b0;
67 static int hf_h224_motion_video;
68 static int hf_h224_norm_res_si;
69 static int hf_h224_dbl_res_si;
70 static int hf_h224_pan_cap;
71 static int hf_h224_tilt_cap;
72 static int hf_h224_zoom_cap;
73 static int hf_h224_focus_cap;
74 static int hf_h224_encoded_characters;
75 static int hf_h224_end_octet;
76 static int hf_h224_command_code;
77 static int hf_h224_message_pan;
78 static int hf_h224_message_pan_dir;
79 static int hf_h224_message_tilt;
80 static int hf_h224_message_tilt_dir;
81 static int hf_h224_message_zoom;
82 static int hf_h224_message_zoom_dir;
83 static int hf_h224_message_focus;
84 static int hf_h224_message_focus_dir;
85 static int hf_h224_message_reserved_b7b4;
86 static int hf_h224_message_reserved_b3b2;
87 static int hf_h224_message_reserved_b3b0;
88 static int hf_h224_message_vs_m1;
89 static int hf_h224_message_vs_m0;
90 static int hf_h224_message_timeout;
91 static int hf_h224_message_preset_number;
93 //static expert_field ei_h224_EXPERTABBREV;
95 static dissector_handle_t h224_handle;
97 /* Initialize the subtree pointers */
98 static int ett_h224;
100 /* Definition of DLCI data priority's masks */
101 #define H224_DATA_PRI_MASK 0xFCF0
103 #define FECC_MAX_LENGTH_ASCII_STR 16
104 #define TIMEOUT_INTERVALS 50
105 #define MAX_TIMEOUT_VALUE 800
107 /* Definition of Standard Client IDs */
108 #define H224_CME_CLIENT_ID 0x00
109 #define H224_FECC_CLIENT_ID 0x01
110 #define H224_EXTENED_CLIENT_ID 0x7E
111 #define H224_NON_STANDARD_CLIENT_ID 0x7F
113 /* definitions of CME messages type */
114 #define CME_MSG_Client_List_Message 0x0100
115 #define CME_MSG_Client_List_Command 0x01FF
116 #define CME_MSG_Extra_Capabilities_Message 0x0200
117 #define CME_MSG_Extra_Capabilities_Command 0x02FF
119 /* definitions of FECC messages type */
120 #define FECC_MSG_START_ACTION_REQ 0x01
121 #define FECC_MSG_CONTINUE_ACTION_REQ 0x02
122 #define FECC_MSG_STOP_ACTION_REQ 0x03
123 #define FECC_MSG_SELECT_VIDEO_SOURCE_REQ 0x04
124 #define FECC_MSG_VIDEO_SOURCE_SWITCHED_IND 0x05
125 #define FECC_MSG_STORE_AS_PRESET_REQ 0x06
126 #define FECC_MSG_ACTIVATE_PRESET_REQ 0x07
128 static unsigned dissect_h224_cme_client_data(tvbuff_t* tvb, proto_tree* tree, unsigned offset);
129 static unsigned dissect_h224_fecc_client_data(tvbuff_t* tvb, proto_tree* tree, unsigned offset);
130 static unsigned dissect_h224_extended_client_data(tvbuff_t* tvb, proto_tree* tree, unsigned offset);
131 static unsigned dissect_h224_non_standard_client_data(tvbuff_t* tvb, proto_tree* tree, unsigned offset);
133 typedef struct {
134 int optcode;
135 unsigned (*decode) (tvbuff_t*, proto_tree*, unsigned);
136 } h224_opt_t;
138 static const h224_opt_t h224opt[] = {
139 /* CME */ {H224_CME_CLIENT_ID, dissect_h224_cme_client_data},
140 /* FECC */ {H224_FECC_CLIENT_ID, dissect_h224_fecc_client_data},
141 /* EXTENED */ {H224_EXTENED_CLIENT_ID, dissect_h224_extended_client_data},
142 /* NON_STANDARD */ {H224_NON_STANDARD_CLIENT_ID, dissect_h224_non_standard_client_data},
143 {0, NULL}
146 /* DLCI address for data priority */
147 static const value_string h224_data_priority[] =
149 { 6, "Low Priority Data" },
150 { 7, "High Priority Data" },
151 { 0, NULL },
154 static const value_string h224_client_data_type[] =
156 { H224_CME_CLIENT_ID, "Client Data For CME(Client Management Entity)" },
157 { H224_FECC_CLIENT_ID, "Client Data For FECC(Far-End Camera Control)" },
158 { H224_EXTENED_CLIENT_ID, "Client Data For Extended Client ID list" },
159 { H224_NON_STANDARD_CLIENT_ID, "Client Data For Non-standard client" },
160 { 0, NULL}
163 static const value_string h224_fecc_message_type[] =
165 { FECC_MSG_START_ACTION_REQ, "START ACTION Request" },
166 { FECC_MSG_CONTINUE_ACTION_REQ, "CONTINUE ACTION Request" },
167 { FECC_MSG_STOP_ACTION_REQ, "STOP ACTION Request" },
168 { FECC_MSG_SELECT_VIDEO_SOURCE_REQ, "SELECT VIDEO SOURCE Request" },
169 { FECC_MSG_VIDEO_SOURCE_SWITCHED_IND, "VIDEO SOURCE SWITCHED indication" },
170 { FECC_MSG_STORE_AS_PRESET_REQ, "STORE AS PRESET Request" },
171 { FECC_MSG_ACTIVATE_PRESET_REQ, "ACTIVATE PRESET Request" },
172 { 0, NULL },
175 static const true_false_string tfs_right_left = { "Right", "Left" };
176 static const true_false_string tfs_in_out = { "In", "Out" };
178 static value_string_ext h224_client_data_ext = VALUE_STRING_EXT_INIT(h224_client_data_type);
180 static unsigned
181 dissect_h224_standard_clients_ids(tvbuff_t* tvb, proto_tree* tree, unsigned offset, uint8_t client_id)
183 uint32_t manufacturer_code;
185 if (client_id == H224_EXTENED_CLIENT_ID) {
186 proto_tree_add_item(tree, hf_h224_extended_client_id_list, tvb, offset, 1, ENC_NA);
187 offset++;
188 proto_tree_add_item(tree, hf_h224_extended_client_id, tvb, offset, 1, ENC_NA);
189 offset++;
190 } else if (client_id == H224_NON_STANDARD_CLIENT_ID){
191 proto_tree_add_item(tree, hf_h224_non_standard_client, tvb, offset, 1, ENC_NA);
192 offset++;
193 manufacturer_code = tvb_get_uint32(tvb, offset, ENC_BIG_ENDIAN);
194 proto_tree_add_item(tree, hf_h224_country_code, tvb, offset, 1, ENC_BIG_ENDIAN);
195 offset += 1;
196 proto_tree_add_item(tree, hf_h224_extension, tvb, offset, 1, ENC_BIG_ENDIAN);
197 offset += 1;
198 proto_tree_add_uint(tree, hf_h224_manufacturer_code, tvb, offset - 2, 4, manufacturer_code);
199 offset += 2;
200 proto_tree_add_item(tree, hf_h224_client_id_manufacturer, tvb, offset, 1, ENC_NA);
201 offset++;
202 } else {
203 proto_tree_add_item(tree, hf_h224_standard_client_id, tvb, offset, 1, ENC_NA);
204 offset++;
206 return offset;
209 static unsigned
210 dissect_h224_cme_client_data(tvbuff_t* tvb, proto_tree* tree, unsigned offset)
212 uint16_t type;
213 uint8_t num;
214 uint8_t oct;
215 uint8_t source_id;
216 uint8_t zero_offset;
217 proto_tree *ext_tree;
219 ext_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_h224, NULL,
220 val_to_str_ext_const(H224_CME_CLIENT_ID, &h224_client_data_ext, "Unknown field"));
221 type = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
222 switch (type) {
223 case CME_MSG_Client_List_Message:
224 proto_tree_add_item(ext_tree, hf_h224_client_list_code, tvb, offset, 1, ENC_BIG_ENDIAN);
225 offset++;
226 proto_tree_add_item(ext_tree, hf_h224_response_code, tvb, offset, 1, ENC_BIG_ENDIAN);
227 offset++;
228 proto_tree_add_item(ext_tree, hf_h224_number_of_clients, tvb, offset, 1, ENC_BIG_ENDIAN);
229 num = tvb_get_uint8(tvb, offset);
230 offset++;
231 proto_tree_add_item(ext_tree, hf_h224_ex_caps_bit, tvb, offset, 1, ENC_BIG_ENDIAN);
232 for (int i = 0; i < num; i++) {
233 oct = tvb_get_uint8(tvb, offset);
234 offset = dissect_h224_standard_clients_ids(tvb, ext_tree, offset, (oct & 0x7f));
236 break;
237 case CME_MSG_Client_List_Command:
238 proto_tree_add_item(ext_tree, hf_h224_client_list_code, tvb, offset, 1, ENC_BIG_ENDIAN);
239 offset++;
240 proto_tree_add_item(ext_tree, hf_h224_response_code, tvb, offset, 1, ENC_BIG_ENDIAN);
241 offset++;
242 break;
243 case CME_MSG_Extra_Capabilities_Message:
244 proto_tree_add_item(ext_tree, hf_h224_extra_caps_code, tvb, offset, 1, ENC_BIG_ENDIAN);
245 offset++;
246 proto_tree_add_item(ext_tree, hf_h224_response_code, tvb, offset, 1, ENC_BIG_ENDIAN);
247 offset++;
248 proto_tree_add_item(ext_tree, hf_h224_ex_caps_bit, tvb, offset, 1, ENC_BIG_ENDIAN);
249 oct = tvb_get_uint8(tvb, offset);
250 offset = dissect_h224_standard_clients_ids(tvb, ext_tree, offset, oct);
251 if ((oct & 0x7f) == 0x01) {
252 static int* const fecc_number_of_presets[] = {
253 &hf_h224_caps_reserved,
254 &hf_h224_brd_svs,
255 &hf_h224_number_of_presets,
256 NULL
258 proto_tree_add_bitmask_list(ext_tree, tvb, offset, 1, fecc_number_of_presets, ENC_BIG_ENDIAN);
259 offset++;
260 oct = tvb_get_uint8(tvb, offset);
261 static int* const fecc_vrs_capabilities[] = {
262 &hf_h224_vs_id,
263 &hf_h224_vs_reserved_b3,
264 &hf_h224_motion_video,
265 &hf_h224_norm_res_si,
266 &hf_h224_dbl_res_si,
267 NULL
269 proto_tree_add_bitmask_list(ext_tree, tvb, offset, 1, fecc_vrs_capabilities, ENC_BIG_ENDIAN);
270 offset++;
271 source_id = (oct & 0xf0) >> 4;
272 if (source_id > 5) {
273 zero_offset = tvb_find_uint8(tvb, offset, FECC_MAX_LENGTH_ASCII_STR, 0);
274 if (zero_offset > offset) {
275 proto_tree_add_item(ext_tree, hf_h224_encoded_characters, tvb, offset, zero_offset - offset, ENC_ASCII);
276 offset = zero_offset;
277 proto_tree_add_item(ext_tree, hf_h224_end_octet, tvb, offset, 1, ENC_NA);
278 offset++;
281 static int* const fecc_caps_ability[] = {
282 &hf_h224_pan_cap,
283 &hf_h224_tilt_cap,
284 &hf_h224_zoom_cap,
285 &hf_h224_focus_cap,
286 &hf_h224_vs_reserved_b3b0,
287 NULL
289 proto_tree_add_bitmask_list(ext_tree, tvb, offset, 1, fecc_caps_ability, ENC_BIG_ENDIAN);
290 offset++;
292 break;
293 case CME_MSG_Extra_Capabilities_Command:
294 proto_tree_add_item(ext_tree, hf_h224_extra_caps_code, tvb, offset, 1, ENC_BIG_ENDIAN);
295 offset++;
296 proto_tree_add_item(ext_tree, hf_h224_response_code, tvb, offset, 1, ENC_BIG_ENDIAN);
297 offset++;
298 proto_tree_add_item(ext_tree, hf_h224_ex_caps_bit, tvb, offset, 1, ENC_BIG_ENDIAN);
299 oct = tvb_get_uint8(tvb, offset);
300 offset = dissect_h224_standard_clients_ids(tvb, ext_tree, offset, oct);
301 break;
302 default:
303 break;
305 return offset;
308 static unsigned
309 dissect_h224_fecc_client_data(tvbuff_t* tvb, proto_tree* tree, unsigned offset)
311 uint8_t oct;
312 proto_tree *ext_tree;
314 ext_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_h224, NULL,
315 val_to_str_ext_const(H224_FECC_CLIENT_ID, &h224_client_data_ext, "Unknown field"));
316 oct = tvb_get_uint8(tvb, offset);
317 proto_tree_add_item(ext_tree, hf_h224_command_code, tvb, offset, 1, ENC_BIG_ENDIAN);
318 offset++;
319 static int* const fecc_message_action[] = {
320 &hf_h224_message_pan,
321 &hf_h224_message_pan_dir,
322 &hf_h224_message_tilt,
323 &hf_h224_message_tilt_dir,
324 &hf_h224_message_zoom,
325 &hf_h224_message_zoom_dir,
326 &hf_h224_message_focus,
327 &hf_h224_message_focus_dir,
328 NULL
330 switch(oct) {
331 case FECC_MSG_START_ACTION_REQ:
333 uint16_t timeout;
334 proto_tree_add_bitmask_list(ext_tree, tvb, offset, 1, fecc_message_action, ENC_BIG_ENDIAN);
335 offset++;
336 proto_tree_add_item(ext_tree, hf_h224_message_reserved_b7b4, tvb, offset, 1, ENC_BIG_ENDIAN);
337 oct = tvb_get_uint8(tvb, offset);
338 timeout = (oct & 0x0f) ? (oct * TIMEOUT_INTERVALS) : MAX_TIMEOUT_VALUE;
339 proto_tree_add_uint_format(ext_tree, hf_h224_message_timeout, tvb, offset, 1, oct,"%u (%u milliseconds)", oct, timeout);
340 offset++;
341 break;
343 case FECC_MSG_CONTINUE_ACTION_REQ:
344 case FECC_MSG_STOP_ACTION_REQ:
345 proto_tree_add_bitmask_list(ext_tree, tvb, offset, 1, fecc_message_action, ENC_BIG_ENDIAN);
346 offset++;
347 break;
348 case FECC_MSG_SELECT_VIDEO_SOURCE_REQ:
349 case FECC_MSG_VIDEO_SOURCE_SWITCHED_IND:
351 static int* const fecc_message_m1m0[] = {
352 &hf_h224_vs_id,
353 &hf_h224_message_reserved_b3b2,
354 &hf_h224_message_vs_m1,
355 &hf_h224_message_vs_m0,
356 NULL
358 proto_tree_add_bitmask_list(ext_tree, tvb, offset, 1, fecc_message_m1m0, ENC_BIG_ENDIAN);
359 offset++;
360 break;
362 case FECC_MSG_STORE_AS_PRESET_REQ:
363 case FECC_MSG_ACTIVATE_PRESET_REQ:
365 static int* const fecc_message_preset_num[] = {
366 &hf_h224_message_preset_number,
367 &hf_h224_message_reserved_b3b0,
368 NULL
370 proto_tree_add_bitmask_list(ext_tree, tvb, offset, 1, fecc_message_preset_num, ENC_BIG_ENDIAN);
371 offset++;
372 break;
374 default:
375 break;
377 return offset;
380 static unsigned dissect_h224_extended_client_data(tvbuff_t* tvb, proto_tree* tree, unsigned offset) {
381 proto_tree *ext_tree;
383 ext_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_h224, NULL,
384 val_to_str_ext_const(H224_EXTENED_CLIENT_ID, &h224_client_data_ext, "Unknown field"));
385 proto_tree_add_item(ext_tree, hf_h224_other_client_data, tvb, offset, -1, ENC_NA);
386 offset++;
387 return offset;
390 static unsigned dissect_h224_non_standard_client_data(tvbuff_t* tvb, proto_tree* tree, unsigned offset) {
391 proto_tree *ext_tree;
393 ext_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_h224, NULL,
394 val_to_str_ext_const(H224_NON_STANDARD_CLIENT_ID, &h224_client_data_ext, "Unknown field"));
395 proto_tree_add_item(ext_tree, hf_h224_other_client_data, tvb, offset, -1, ENC_NA);
396 offset++;
397 return offset;
399 /* Code to actually dissect the packets */
400 static int
401 dissect_h224(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_)
403 proto_item* ti;
404 proto_tree* h224_tree;
405 unsigned offset = 0;
406 uint8_t oct;
409 /* Set the Protocol column in the summary display */
410 col_set_str(pinfo->cinfo, COL_PROTOCOL, "H.224");
412 ti = proto_tree_add_item(tree, proto_h224, tvb, offset, -1, ENC_NA);
413 h224_tree = proto_item_add_subtree(ti, ett_h224);
415 /* On IP transport networks, the H.224 protocol octet structure shall be the same as Figure 2/H.224
416 * except that the HDLC bit stuffing, HDLC flags and HDLC Frame Check Sequence shall be omitted.
418 /* The 10-bit DLCI address for data priority */
419 proto_tree_add_item(h224_tree, hf_h224_q922_dlci_priority, tvb, offset, 2, ENC_BIG_ENDIAN);
420 offset += 2;
421 /* Q.922 UI-Mode format 1 octets */
422 proto_tree_add_item(h224_tree, hf_h224_q922_ctl, tvb, offset, 1, ENC_BIG_ENDIAN);
423 offset += 1;
424 /* Destination terminal address 2 octets */
425 proto_tree_add_item(h224_tree, hf_h224_dta, tvb, offset, 2, ENC_BIG_ENDIAN);
426 offset += 2;
427 /* Source terminal address 2 octets */
428 proto_tree_add_item(h224_tree, hf_h224_sta, tvb, offset, 2, ENC_BIG_ENDIAN);
429 offset += 2;
430 proto_tree_add_item(h224_tree, hf_h224_reserved, tvb, offset, 1, ENC_NA);
433 * CLIENT ID: The client to receive the contents of the datagram. The Client ID may be any
434 * of the following formats:
435 * - Standard Client ID - Single octet.
436 * - Extended Client ID - Two octets (0x7E, extended Client ID).
437 * - Non-standard Client ID - Six octets (0x7F, country, manufacturer code, ID)
439 oct = tvb_get_uint8(tvb, offset);
440 offset = dissect_h224_standard_clients_ids(tvb, h224_tree, offset, oct);
442 static int* const h224_flags[] = {
443 &hf_h224_es_b7,
444 &hf_h224_bs_b6,
445 &hf_h224_c1_b5,
446 &hf_h224_c2_b4,
447 &hf_h224_seg_b3b0,
448 NULL
451 proto_tree_add_bitmask_list(h224_tree, tvb, offset, 1, h224_flags, ENC_BIG_ENDIAN);
452 offset++;
454 /* Data */
455 int i = -1;
456 while (h224opt[++i].decode) {
457 if (h224opt[i].optcode == oct) {
458 h224opt[i].decode(tvb, h224_tree, offset);
459 break;
462 return tvb_reported_length(tvb);
465 /* Register the protocol with Wireshark. */
466 void
467 proto_register_h224(void)
469 //module_t *h224_module;
470 //expert_module_t *expert_h224;
472 static hf_register_info hf[] = {
473 { &hf_h224_q922_dlci_priority,
474 { "Q.922 DLCI Priority", "h224.q922_dlci_pri",
475 FT_UINT16, BASE_HEX, VALS(h224_data_priority), H224_DATA_PRI_MASK,
476 NULL, HFILL }
478 { &hf_h224_q922_ctl,
479 { "Q.922 Control Octet", "h224.q922_ctl",
480 FT_UINT8, BASE_HEX, NULL, 0x0,
481 NULL, HFILL }
483 { &hf_h224_dta,
484 { "Destination Terminal Address", "h224.dta",
485 FT_UINT16, BASE_DEC, NULL, 0x0,
486 NULL, HFILL }
488 { &hf_h224_sta,
489 { "Source Terminal Address", "h224.sta",
490 FT_UINT16, BASE_DEC, NULL, 0x0,
491 NULL, HFILL }
493 { &hf_h224_reserved,
494 { "Reserved", "h224.reserved",
495 FT_UINT8, BASE_DEC, NULL, 0x80,
496 NULL, HFILL }
498 { &hf_h224_standard_client_id,
499 { "Standard Client ID", "h224.standard_client_id",
500 FT_UINT8, BASE_HEX, NULL, 0x7f,
501 NULL, HFILL }
503 { &hf_h224_extended_client_id_list,
504 { "Extended Client ID List", "h224.extended_client_id_list",
505 FT_UINT8, BASE_HEX, NULL, 0x7f,
506 NULL, HFILL }
508 { &hf_h224_non_standard_client,
509 { "Non-standard Client", "h224.non_standard_client",
510 FT_UINT8, BASE_HEX, NULL, 0x7f,
511 NULL, HFILL }
513 { &hf_h224_extended_client_id,
514 { "Extended Client ID", "h224.extended_client_id",
515 FT_UINT8, BASE_HEX, NULL, 0x0,
516 NULL, HFILL }
518 { &hf_h224_country_code,
519 { "Country code", "h224.country_code",
520 FT_UINT8, BASE_HEX, VALS(T35CountryCode_vals), 0x0,
521 NULL, HFILL }
523 { &hf_h224_extension,
524 { "Extension", "h224.Extension",
525 FT_UINT8, BASE_HEX, NULL, 0x0,
526 NULL, HFILL }
528 { &hf_h224_manufacturer_code,
529 { "Manufacturer code", "h224.manufacturer_code",
530 FT_UINT32, BASE_HEX, VALS(H221ManufacturerCode_vals), 0x0,
531 NULL, HFILL }
533 { &hf_h224_client_id_manufacturer,
534 { "Manufacturer Client ID", "h224.manufacturer_client_id",
535 FT_UINT8, BASE_HEX, NULL, 0x0,
536 NULL, HFILL }
538 { &hf_h224_es_b7,
539 { "Ending Segment(ES)", "h224.flag.es",
540 FT_BOOLEAN, 8, NULL, 0x80,
541 NULL, HFILL }
543 { &hf_h224_bs_b6,
544 { "Beginning Segment(BS)", "h224.flag.bs",
545 FT_BOOLEAN, 8, NULL, 0x40,
546 NULL, HFILL }
548 { &hf_h224_c1_b5,
549 { "C1", "h224.flag.c1",
550 FT_BOOLEAN, 8, NULL, 0x20,
551 NULL, HFILL }
553 { &hf_h224_c2_b4,
554 { "C0", "h224.flag.c0",
555 FT_BOOLEAN, 8, NULL, 0x10,
556 NULL, HFILL }
558 { &hf_h224_seg_b3b0,
559 { "Segment number", "h224.flags_seg",
560 FT_UINT8, BASE_DEC, NULL, 0x0f,
561 NULL, HFILL }
563 { &hf_h224_client_list_code,
564 { "Client List code", "h224.client_list_code",
565 FT_UINT8, BASE_HEX, NULL, 0x0,
566 NULL, HFILL }
568 { &hf_h224_extra_caps_code,
569 { "Extra Capabilities code", "h224.ex_caps_code",
570 FT_UINT8, BASE_HEX, NULL, 0x0,
571 NULL, HFILL }
573 { &hf_h224_response_code,
574 { "Response Code", "h224.response_code",
575 FT_UINT8, BASE_HEX, NULL, 0x0,
576 NULL, HFILL }
578 { &hf_h224_number_of_clients,
579 { "Number of clients", "h224.number_of_clients",
580 FT_UINT8, BASE_DEC, NULL, 0x0,
581 NULL, HFILL }
583 { &hf_h224_ex_caps_bit,
584 { "Extra Capabilities bit", "h224.ex_caps_bit",
585 FT_BOOLEAN, 8, NULL, 0x80,
586 NULL, HFILL }
588 { &hf_h224_caps_reserved,
589 { "Preset reserved", "h224.preset_reserved",
590 FT_UINT8, BASE_DEC, NULL, 0xe0,
591 NULL, HFILL }
593 { &hf_h224_brd_svs,
594 { "Broadcast switch video sources", "h224.brd_svs",
595 FT_BOOLEAN, 8, NULL, 0x10,
596 NULL, HFILL }
598 { &hf_h224_number_of_presets,
599 { "Number of presets", "h224.number_of_presets",
600 FT_UINT8, BASE_DEC, NULL, 0x0f,
601 NULL, HFILL }
603 { &hf_h224_vs_id,
604 { "Video source id", "h224.vs_id",
605 FT_UINT8, BASE_DEC, NULL, 0xf0,
606 NULL, HFILL }
608 { &hf_h224_vs_reserved_b3,
609 { "Reserved type", "h224.reserved_type",
610 FT_UINT8, BASE_DEC, NULL, 0x08,
611 NULL, HFILL }
613 { &hf_h224_vs_reserved_b3b0,
614 { "Reserved Capabilities", "h224.reserved_caps",
615 FT_UINT8, BASE_DEC, NULL, 0x0f,
616 NULL, HFILL }
618 { &hf_h224_motion_video,
619 { "Motion video", "h224.motion_video",
620 FT_BOOLEAN, 8, NULL, 0x04,
621 NULL, HFILL }
623 { &hf_h224_norm_res_si,
624 { "Normal resolution still image", "h224.norm_res_si",
625 FT_BOOLEAN, 8, NULL, 0x02,
626 NULL, HFILL }
628 { &hf_h224_dbl_res_si,
629 { "Double resolution still image", "h224.dbl_res_si",
630 FT_BOOLEAN, 8, NULL, 0x01,
631 NULL, HFILL }
633 { &hf_h224_pan_cap,
634 { "Pan Capability", "h224.pan_cap",
635 FT_BOOLEAN, 8, NULL, 0x80,
636 NULL, HFILL }
638 { &hf_h224_tilt_cap,
639 { "Tilt Capability", "h224.tilt_cap",
640 FT_BOOLEAN, 8, NULL, 0x40,
641 NULL, HFILL }
643 { &hf_h224_zoom_cap,
644 { "Zoom Capability", "h224.zoom_cap",
645 FT_BOOLEAN, 8, NULL, 0x20,
646 NULL, HFILL }
648 { &hf_h224_focus_cap,
649 { "Focus Capability", "h224.focus_cap",
650 FT_BOOLEAN, 8, NULL, 0x10,
651 NULL, HFILL }
653 { &hf_h224_encoded_characters,
654 { "Ascii String", "h224.ascii_str",
655 FT_STRING, BASE_NONE, NULL, 0,
656 NULL, HFILL }
658 { &hf_h224_end_octet,
659 { "End octet", "h224.end_oct",
660 FT_UINT8, BASE_DEC, NULL, 0,
661 NULL, HFILL }
663 { &hf_h224_command_code,
664 { "FECC Message Code", "h224.fecc_message_code",
665 FT_UINT8, BASE_HEX, VALS(h224_fecc_message_type), 0,
666 NULL, HFILL }
668 { &hf_h224_message_pan,
669 { "Pan action", "h224.pan_action",
670 FT_BOOLEAN, 8, NULL, 0x80,
671 NULL, HFILL }
673 { &hf_h224_message_pan_dir,
674 { "Pan direction", "h224.pan_dir",
675 FT_BOOLEAN, 8, TFS(&tfs_right_left), 0x40,
676 NULL, HFILL }
678 { &hf_h224_message_tilt,
679 { "Tilt action", "h224.tilt_action",
680 FT_BOOLEAN, 8, NULL, 0x20,
681 NULL, HFILL }
683 { &hf_h224_message_tilt_dir,
684 { "Tilt direction", "h224.tilt_dir",
685 FT_BOOLEAN, 8, TFS(&tfs_up_down), 0x10,
686 NULL, HFILL }
688 { &hf_h224_message_zoom,
689 { "Zoom action", "h224.zoom_action",
690 FT_BOOLEAN, 8, NULL, 0x08,
691 NULL, HFILL }
693 { &hf_h224_message_zoom_dir,
694 { "Zoom direction", "h224.zoom_dir",
695 FT_BOOLEAN, 8, TFS(&tfs_in_out), 0x04,
696 NULL, HFILL }
698 { &hf_h224_message_focus,
699 { "Focus action", "h224.focus_action",
700 FT_BOOLEAN, 8, NULL, 0x02,
701 NULL, HFILL }
703 { &hf_h224_message_focus_dir,
704 { "Focus direction", "h224.focus_dir",
705 FT_BOOLEAN, 8, TFS(&tfs_in_out), 0x01,
706 NULL, HFILL }
708 { &hf_h224_message_reserved_b7b4,
709 { "Action Reserved", "h224.act_reserved",
710 FT_UINT8, BASE_DEC, NULL, 0xf0,
711 NULL, HFILL }
713 { &hf_h224_message_reserved_b3b2,
714 { "Mode Reserved", "h224.mode_reserved",
715 FT_UINT8, BASE_DEC, NULL, 0x0c,
716 NULL, HFILL }
718 { &hf_h224_message_reserved_b3b0,
719 { "Activate Preset Reserved", "h224.ap_reserved",
720 FT_UINT8, BASE_DEC, NULL, 0x0f,
721 NULL, HFILL }
723 { &hf_h224_message_vs_m1,
724 { "M1", "h224.vs_m1",
725 FT_UINT8, BASE_DEC, NULL, 0x02,
726 NULL, HFILL }
728 { &hf_h224_message_vs_m0,
729 { "M0", "h224.vs_m0",
730 FT_UINT8, BASE_DEC, NULL, 0x01,
731 NULL, HFILL }
733 { &hf_h224_message_timeout,
734 { "Timeout", "h224.timeout",
735 FT_UINT8, BASE_DEC, NULL, 0x0f,
736 NULL, HFILL }
738 { &hf_h224_message_preset_number,
739 { "Preset Number", "h224.preset_number",
740 FT_UINT8, BASE_DEC, NULL, 0xf0,
741 NULL, HFILL }
743 { &hf_h224_other_client_data,
744 { "Client data", "h224.client_data",
745 FT_BYTES, BASE_NONE, NULL, 0x0,
746 NULL, HFILL }
749 static int *ett[] = {
750 &ett_h224
753 /* Setup protocol expert items */
754 //static ei_register_info ei[] = {
755 // { &ei_h224_EXPERTABBREV,
756 // { "h224.EXPERTABBREV", PI_GROUP, PI_SEVERITY,
757 // "EXPERTDESCR", EXPFILL }
758 // }
759 //};
761 /* Register the protocol name and description */
762 proto_h224 = proto_register_protocol("H.224", "H.224", "h224");
764 /* Register the header fields and subtrees */
765 proto_register_field_array(proto_h224, hf, array_length(hf));
766 proto_register_subtree_array(ett, array_length(ett));
768 /* Register expert items */
769 // expert_h224 = expert_register_protocol(proto_h224);
770 // expert_register_field_array(expert_h224, ei, array_length(ei));
772 h224_handle = register_dissector("h224", dissect_h224, proto_h224);
777 void
778 proto_reg_handoff_h224(void)
780 dissector_add_string("rtp_dyn_payload_type", "H224", h224_handle);
781 dissector_add_for_decode_as("rtp.pt", h224_handle);
785 * Editor modelines - https://www.wireshark.org/tools/modelines.html
787 * Local variables:
788 * c-basic-offset: 4
789 * tab-width: 8
790 * indent-tabs-mode: nil
791 * End:
793 * vi: set shiftwidth=4 tabstop=8 expandtab:
794 * :indentSize=4:tabSize=8:noTabs=true: