| File: | builds/wireshark/wireshark/epan/dissectors/packet-smpte-2038.c |
| Warning: | line 127, column 17 Value stored to 'bit_offset' is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
| 1 | /* packet-smpte-2038.c |
| 2 | * SMPTE ST 2038:2021, "Carriage of Ancillary Data Packets in an MPEG-2 Transport Stream." |
| 3 | * |
| 4 | * Copyright (c) 2026, Devin Heitmueller <dheitmueller@ltnglobal.com> |
| 5 | * |
| 6 | * Wireshark - Network traffic analyzer |
| 7 | * By Gerald Combs <gerald@wireshark.org> |
| 8 | * Copyright 1998 Gerald Combs |
| 9 | * |
| 10 | * |
| 11 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 12 | */ |
| 13 | |
| 14 | #include "config.h" |
| 15 | |
| 16 | #include <epan/expert.h> |
| 17 | #include <epan/packet.h> |
| 18 | #include <epan/tfs.h> |
| 19 | #include <wsutil/array.h> |
| 20 | |
| 21 | #include "packet-smpte-291-vanc.h" |
| 22 | |
| 23 | #define ST2038_REGISTRATION_ID0x56414e43U 0x56414e43U /* "VANC" */ |
| 24 | |
| 25 | void proto_register_st2038(void); |
| 26 | void proto_reg_handoff_st2038(void); |
| 27 | |
| 28 | static int proto_st2038; |
| 29 | static dissector_handle_t st2038_handle; |
| 30 | |
| 31 | static int hf_st2038_anc_packet; |
| 32 | static int hf_st2038_anc_count; |
| 33 | static int hf_st2038_reserved; |
| 34 | static int hf_st2038_c_not_y; |
| 35 | static int hf_st2038_line_number; |
| 36 | static int hf_st2038_horizontal_offset; |
| 37 | static int hf_st2038_data_count; |
| 38 | static int hf_st2038_udw_bytes; |
| 39 | static int hf_st2038_udw_array; |
| 40 | static int hf_st2038_checksum; |
| 41 | static int hf_st2038_checksum_calculated; |
| 42 | static int hf_st2038_alignment_bits; |
| 43 | static int hf_st2038_stuffing_bytes; |
| 44 | |
| 45 | static int ett_st2038; |
| 46 | static int ett_st2038_anc_packet; |
| 47 | static int ett_st2038_udw; |
| 48 | |
| 49 | static expert_field ei_st2038_reserved; |
| 50 | static expert_field ei_st2038_bad_parity; |
| 51 | static expert_field ei_st2038_bad_checksum; |
| 52 | static expert_field ei_st2038_bad_alignment; |
| 53 | static expert_field ei_st2038_nonstandard_stuffing; |
| 54 | static expert_field ei_st2038_multiple_lines; |
| 55 | static expert_field ei_st2038_truncated; |
| 56 | |
| 57 | static const struct true_false_string tfs_c_not_y = { |
| 58 | "Color-difference channel (C)", |
| 59 | "Luminance channel (Y)" |
| 60 | }; |
| 61 | |
| 62 | static bool_Bool |
| 63 | all_remaining_bytes_ff(tvbuff_t *tvb, unsigned byte_offset) |
| 64 | { |
| 65 | unsigned len = tvb_captured_length(tvb); |
| 66 | |
| 67 | for (unsigned i = byte_offset; i < len; i++) { |
| 68 | if (tvb_get_uint8(tvb, i) != 0xff) |
| 69 | return false0; |
| 70 | } |
| 71 | return true1; |
| 72 | } |
| 73 | |
| 74 | /* SMPTE ST 2038:2021, Sec. 4.2, Table 2 -- ANC data PES payload record syntax. */ |
| 75 | static int |
| 76 | dissect_st2038(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U___attribute__((unused))) |
| 77 | { |
| 78 | unsigned captured_length = tvb_captured_length(tvb); |
| 79 | unsigned reported_length = tvb_reported_length(tvb); |
| 80 | unsigned total_bits = captured_length * 8U; |
| 81 | unsigned bit_offset = 0; |
| 82 | unsigned packet_index = 0; |
| 83 | int first_line = -1; |
| 84 | proto_item *root_ti; |
| 85 | proto_item *ti; |
| 86 | proto_tree *root; |
| 87 | |
| 88 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "ST 2038"); |
| 89 | col_set_str(pinfo->cinfo, COL_INFO, "SMPTE ST 2038 ANC Data"); |
| 90 | |
| 91 | root_ti = proto_tree_add_item(tree, proto_st2038, tvb, 0, -1, ENC_NA0x00000000); |
| 92 | root = proto_item_add_subtree(root_ti, ett_st2038); |
| 93 | |
| 94 | if (captured_length < reported_length) { |
| 95 | expert_add_info_format(pinfo, root_ti, &ei_st2038_truncated, |
| 96 | "ST 2038 payload reports %u bytes, but only %u were captured", |
| 97 | reported_length, captured_length); |
| 98 | } |
| 99 | |
| 100 | while (bit_offset < total_bits) { |
| 101 | unsigned start_bit; |
| 102 | unsigned reserved; |
| 103 | unsigned line_number; |
| 104 | uint16_t did_word, second_word, dc_word; |
| 105 | uint8_t did, sdid_or_dbn; |
| 106 | bool_Bool type1; |
| 107 | unsigned data_count; |
| 108 | unsigned required_bits; |
| 109 | unsigned align_bits; |
| 110 | unsigned udw_start_bit; |
| 111 | unsigned udw_start_byte; |
| 112 | unsigned udw_octet_length; |
| 113 | uint16_t cs_calc; |
| 114 | st291_vanc_packet_t anc; |
| 115 | proto_item *packet_ti, *cs_ti, *udw_ti; |
| 116 | proto_tree *packet_tree, *udw_tree; |
| 117 | |
| 118 | /* At a compliant record boundary, 0xff can only be trailing stuffing. */ |
| 119 | if ((bit_offset & 7U) == 0 && bit_offset + 8 <= total_bits && |
| 120 | tvb_get_uint8(tvb, bit_offset / 8) == 0xff) { |
| 121 | unsigned byte_offset = bit_offset / 8; |
| 122 | unsigned remaining = captured_length - byte_offset; |
| 123 | |
| 124 | if (all_remaining_bytes_ff(tvb, byte_offset)) { |
| 125 | proto_tree_add_item(root, hf_st2038_stuffing_bytes, tvb, |
| 126 | byte_offset, remaining, ENC_NA0x00000000); |
| 127 | bit_offset = total_bits; |
Value stored to 'bit_offset' is never read | |
| 128 | break; |
| 129 | } |
| 130 | |
| 131 | /* |
| 132 | * Interoperability workaround also used by libklvanc: some |
| 133 | * encoders insert extra '1' bits between ANC records even when |
| 134 | * Table 2 requires no alignment bits at an already byte-aligned |
| 135 | * boundary. Skip them until the next record's leading zero and |
| 136 | * flag the stream as non-conformant. |
| 137 | */ |
| 138 | { |
| 139 | unsigned stuff_start = bit_offset; |
| 140 | while (bit_offset < total_bits && |
| 141 | tvb_get_bits8(tvb, bit_offset, 1) == 1) |
| 142 | bit_offset++; |
| 143 | |
| 144 | if (bit_offset > stuff_start) { |
| 145 | unsigned skipped = bit_offset - stuff_start; |
| 146 | unsigned shown = MIN(skipped, 64U)(((skipped) < (64U)) ? (skipped) : (64U)); |
| 147 | ti = proto_tree_add_bits_item(root, |
| 148 | hf_st2038_alignment_bits, tvb, stuff_start, |
| 149 | shown, ENC_BIG_ENDIAN0x00000000); |
| 150 | if (skipped > shown) |
| 151 | proto_item_append_text(ti, " (showing first %u of %u bits)", |
| 152 | shown, skipped); |
| 153 | expert_add_info(pinfo, ti, &ei_st2038_nonstandard_stuffing); |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | if (bit_offset >= total_bits) |
| 158 | break; |
| 159 | } |
| 160 | |
| 161 | start_bit = bit_offset; |
| 162 | required_bits = 6 + 1 + 11 + 12 + 10 + 10 + 10 + 10; |
| 163 | if (total_bits - bit_offset < required_bits) { |
| 164 | expert_add_info(pinfo, root_ti, &ei_st2038_truncated); |
| 165 | break; |
| 166 | } |
| 167 | |
| 168 | reserved = tvb_get_bits8(tvb, bit_offset, 6); |
| 169 | bit_offset += 6; |
| 170 | bit_offset += 1; |
| 171 | line_number = tvb_get_bits16(tvb, bit_offset, 11, ENC_BIG_ENDIAN0x00000000); |
| 172 | bit_offset += 11; |
| 173 | bit_offset += 12; |
| 174 | if (!st291_vanc_packet_from_packed(tvb, pinfo, bit_offset, |
| 175 | total_bits - bit_offset, &anc)) { |
| 176 | expert_add_info(pinfo, root_ti, &ei_st2038_truncated); |
| 177 | break; |
| 178 | } |
| 179 | |
| 180 | did_word = anc.words[0]; |
| 181 | second_word = anc.words[1]; |
| 182 | dc_word = anc.words[2]; |
| 183 | did = anc.did; |
| 184 | sdid_or_dbn = anc.sdid_or_dbn; |
| 185 | type1 = (did & 0x80U) != 0; |
| 186 | data_count = anc.data_count; |
| 187 | |
| 188 | packet_ti = proto_tree_add_none_format(root, hf_st2038_anc_packet, |
| 189 | tvb, start_bit / 8, |
| 190 | (70U + data_count * 10U + 7U) / 8U, |
| 191 | "ANC Packet %u: line %u, DID 0x%02x, %s 0x%02x", |
| 192 | packet_index + 1, line_number, did, |
| 193 | type1 ? "DBN" : "SDID", sdid_or_dbn); |
| 194 | st291_append_packet_description(packet_ti, did, sdid_or_dbn); |
| 195 | packet_tree = proto_item_add_subtree(packet_ti, ett_st2038_anc_packet); |
| 196 | |
| 197 | proto_tree_add_bits_item(packet_tree, hf_st2038_reserved, tvb, |
| 198 | start_bit, 6, ENC_BIG_ENDIAN0x00000000); |
| 199 | proto_tree_add_bits_item(packet_tree, hf_st2038_c_not_y, tvb, |
| 200 | start_bit + 6, 1, ENC_BIG_ENDIAN0x00000000); |
| 201 | proto_tree_add_bits_item(packet_tree, hf_st2038_line_number, tvb, |
| 202 | start_bit + 7, 11, ENC_BIG_ENDIAN0x00000000); |
| 203 | proto_tree_add_bits_item(packet_tree, hf_st2038_horizontal_offset, tvb, |
| 204 | start_bit + 18, 12, ENC_BIG_ENDIAN0x00000000); |
| 205 | |
| 206 | st291_tree_add_did(packet_tree, tvb, (start_bit + 30) / 8, 2, did); |
| 207 | if (type1) |
| 208 | st291_tree_add_dbn(packet_tree, tvb, (start_bit + 40) / 8, 2, sdid_or_dbn); |
| 209 | else |
| 210 | st291_tree_add_sdid(packet_tree, tvb, (start_bit + 40) / 8, 2, did, sdid_or_dbn); |
| 211 | |
| 212 | proto_tree_add_bits_item(packet_tree, hf_st2038_data_count, tvb, |
| 213 | start_bit + 50, 10, ENC_BIG_ENDIAN0x00000000); |
| 214 | |
| 215 | if (reserved != 0) |
| 216 | expert_add_info_format(pinfo, packet_ti, &ei_st2038_reserved, |
| 217 | "Reserved six-bit field is 0x%x, expected 0", reserved); |
| 218 | |
| 219 | if (!anc.did_parity_ok) |
| 220 | expert_add_info_format(pinfo, packet_ti, &ei_st2038_bad_parity, |
| 221 | "Invalid ST 291 DID parity/inverse bits (raw word 0x%03x); decoding bits 7..0", |
| 222 | did_word); |
| 223 | if (!anc.second_word_parity_ok) |
| 224 | expert_add_info_format(pinfo, packet_ti, &ei_st2038_bad_parity, |
| 225 | "Invalid ST 291 %s parity/inverse bits (raw word 0x%03x); decoding bits 7..0", |
| 226 | type1 ? "DBN" : "SDID", second_word); |
| 227 | if (!anc.data_count_parity_ok) |
| 228 | expert_add_info_format(pinfo, packet_ti, &ei_st2038_bad_parity, |
| 229 | "Invalid ST 291 data-count parity/inverse bits (raw word 0x%03x); decoding bits 7..0", |
| 230 | dc_word); |
| 231 | |
| 232 | if (first_line < 0) |
| 233 | first_line = (int)line_number; |
| 234 | else if ((unsigned)first_line != line_number) |
| 235 | expert_add_info_format(pinfo, packet_ti, &ei_st2038_multiple_lines, |
| 236 | "ST 2038 requires one raster line per PES packet; first ANC packet used line %d", |
| 237 | first_line); |
| 238 | |
| 239 | /* |
| 240 | * Mirror the ST 2110-40 presentation: show the octets touched by |
| 241 | * the packed 10-bit UDW bitstream as one item, rather than adding |
| 242 | * one protocol-tree row for every individual UDW. The generated |
| 243 | * byte-oriented UDW Array below remains the public subdissector |
| 244 | * payload (bits b7..b0 from each 10-bit word). |
| 245 | */ |
| 246 | udw_start_bit = start_bit + 60U; |
| 247 | if (data_count > 0) { |
| 248 | udw_start_byte = udw_start_bit / 8U; |
| 249 | udw_octet_length = ((udw_start_bit & 7U) + data_count * 10U + 7U) / 8U; |
| 250 | ti = proto_tree_add_item(packet_tree, hf_st2038_udw_bytes, tvb, |
| 251 | udw_start_byte, udw_octet_length, ENC_NA0x00000000); |
| 252 | proto_item_set_hidden(ti); |
| 253 | } |
| 254 | |
| 255 | bit_offset = start_bit + 30U + (3U + data_count) * 10U; |
| 256 | cs_ti = proto_tree_add_bits_item(packet_tree, hf_st2038_checksum, tvb, |
| 257 | bit_offset, 10, ENC_BIG_ENDIAN0x00000000); |
| 258 | bit_offset += 10; |
| 259 | |
| 260 | cs_calc = anc.checksum_calculated; |
| 261 | |
| 262 | ti = proto_tree_add_uint(packet_tree, |
| 263 | hf_st2038_checksum_calculated, tvb, 0, 0, cs_calc); |
| 264 | proto_item_set_generated(ti); |
| 265 | |
| 266 | if (!anc.checksum_ok) |
| 267 | expert_add_info(pinfo, cs_ti, &ei_st2038_bad_checksum); |
| 268 | |
| 269 | /* Table 2 requires '1' bits until the next byte boundary. */ |
| 270 | align_bits = (8U - (bit_offset & 7U)) & 7U; |
| 271 | if (align_bits != 0) { |
| 272 | uint8_t alignment; |
| 273 | |
| 274 | if (total_bits - bit_offset < align_bits) { |
| 275 | expert_add_info(pinfo, packet_ti, &ei_st2038_truncated); |
| 276 | break; |
| 277 | } |
| 278 | |
| 279 | alignment = tvb_get_bits8(tvb, bit_offset, align_bits); |
| 280 | ti = proto_tree_add_bits_item(packet_tree, |
| 281 | hf_st2038_alignment_bits, tvb, bit_offset, align_bits, |
| 282 | ENC_BIG_ENDIAN0x00000000); |
| 283 | if (alignment != ((1U << align_bits) - 1U)) |
| 284 | expert_add_info(pinfo, ti, &ei_st2038_bad_alignment); |
| 285 | bit_offset += align_bits; |
| 286 | } |
| 287 | |
| 288 | if (data_count > 0) { |
| 289 | udw_ti = proto_tree_add_item(packet_tree, hf_st2038_udw_array, |
| 290 | anc.packed_udw_tvb, 0, |
| 291 | tvb_captured_length(anc.packed_udw_tvb), |
| 292 | ENC_NA0x00000000); |
| 293 | } else { |
| 294 | udw_ti = proto_tree_add_item(packet_tree, hf_st2038_udw_array, |
| 295 | tvb, bit_offset / 8U, 0, ENC_NA0x00000000); |
| 296 | proto_item_set_generated(udw_ti); |
| 297 | } |
| 298 | udw_tree = proto_item_add_subtree(udw_ti, ett_st2038_udw); |
| 299 | |
| 300 | { |
| 301 | st291_vanc_dissector_data_t st291_data = { |
| 302 | .top_tree = tree, |
| 303 | .payload_index = packet_index, |
| 304 | }; |
| 305 | st291_vanc_dissect_packet(&anc, pinfo, udw_tree, udw_ti, |
| 306 | &st291_data); |
| 307 | } |
| 308 | |
| 309 | packet_index++; |
| 310 | } |
| 311 | |
| 312 | /* |
| 313 | * Generated convenience field: number of complete ANC records parsed |
| 314 | * from this ST 2038 PES payload. This is not an on-wire ST 2038 field. |
| 315 | * Keeping the field present even when the value is zero makes filters |
| 316 | * such as "st2038.anc_count == 0" useful. |
| 317 | */ |
| 318 | ti = proto_tree_add_uint(root, hf_st2038_anc_count, tvb, 0, 0, packet_index); |
| 319 | proto_item_set_generated(ti); |
| 320 | |
| 321 | col_add_fstr(pinfo->cinfo, COL_INFO, "SMPTE ST 2038 ANC Data, %u ANC packet%s", |
| 322 | packet_index, packet_index == 1 ? "" : "s"); |
| 323 | |
| 324 | return tvb_captured_length(tvb); |
| 325 | } |
| 326 | |
| 327 | void |
| 328 | proto_register_st2038(void) |
| 329 | { |
| 330 | static hf_register_info hf[] = { |
| 331 | { &hf_st2038_anc_packet, |
| 332 | { "ANC Packet", "st2038.anc_packet", FT_NONE, BASE_NONE, |
| 333 | NULL((void*)0), 0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, |
| 334 | { &hf_st2038_anc_count, |
| 335 | { "ANC Packet Count", "st2038.anc_count", FT_UINT32, BASE_DEC, |
| 336 | NULL((void*)0), 0, "Number of complete ANC packets in this PES payload", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, |
| 337 | { &hf_st2038_reserved, |
| 338 | { "Reserved", "st2038.reserved", FT_UINT8, BASE_HEX, |
| 339 | NULL((void*)0), 0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, |
| 340 | { &hf_st2038_c_not_y, |
| 341 | { "C/Y Channel", "st2038.c_not_y", FT_BOOLEAN, BASE_NONE, |
| 342 | TFS(&tfs_c_not_y)((0 ? (const struct true_false_string*)0 : ((&tfs_c_not_y )))), 0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, |
| 343 | { &hf_st2038_line_number, |
| 344 | { "Line Number", "st2038.line_number", FT_UINT16, BASE_DEC, |
| 345 | NULL((void*)0), 0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, |
| 346 | { &hf_st2038_horizontal_offset, |
| 347 | { "Horizontal Offset", "st2038.horizontal_offset", FT_UINT16, BASE_DEC, |
| 348 | NULL((void*)0), 0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, |
| 349 | { &hf_st2038_data_count, |
| 350 | { "Data Count Word", "st2038.data_count", FT_UINT16, BASE_HEX, |
| 351 | NULL((void*)0), 0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, |
| 352 | { &hf_st2038_udw_bytes, |
| 353 | { "UDW Bytes", "st2038.udw", FT_BYTES, BASE_NONE, |
| 354 | NULL((void*)0), 0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, |
| 355 | { &hf_st2038_udw_array, |
| 356 | { "User Data Words", "st2038.udw_array", FT_BYTES, BASE_NONE, |
| 357 | NULL((void*)0), 0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, |
| 358 | { &hf_st2038_checksum, |
| 359 | { "Checksum Word", "st2038.checksum", FT_UINT16, BASE_HEX, |
| 360 | NULL((void*)0), 0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, |
| 361 | { &hf_st2038_checksum_calculated, |
| 362 | { "Calculated Checksum", "st2038.checksum_calculated", FT_UINT16, BASE_HEX, |
| 363 | NULL((void*)0), 0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, |
| 364 | { &hf_st2038_alignment_bits, |
| 365 | { "Alignment / Stuffing Bits", "st2038.alignment_bits", FT_UINT64, BASE_HEX, |
| 366 | NULL((void*)0), 0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, |
| 367 | { &hf_st2038_stuffing_bytes, |
| 368 | { "Stuffing Bytes", "st2038.stuffing_bytes", FT_BYTES, BASE_NONE, |
| 369 | NULL((void*)0), 0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, |
| 370 | }; |
| 371 | |
| 372 | static int *ett[] = { |
| 373 | &ett_st2038, |
| 374 | &ett_st2038_anc_packet, |
| 375 | &ett_st2038_udw, |
| 376 | }; |
| 377 | |
| 378 | static ei_register_info ei[] = { |
| 379 | { &ei_st2038_reserved, |
| 380 | { "st2038.reserved.nonzero", PI_PROTOCOL0x09000000, PI_WARN0x00600000, |
| 381 | "Reserved bits are non-zero", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, |
| 382 | { &ei_st2038_bad_parity, |
| 383 | { "st2038.st291_parity_bad", PI_CHECKSUM0x01000000, PI_WARN0x00600000, |
| 384 | "Invalid ST 291 parity/inverse bits", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, |
| 385 | { &ei_st2038_bad_checksum, |
| 386 | { "st2038.checksum.bad", PI_CHECKSUM0x01000000, PI_WARN0x00600000, |
| 387 | "ST 291 checksum does not match", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, |
| 388 | { &ei_st2038_bad_alignment, |
| 389 | { "st2038.alignment.bad", PI_MALFORMED0x07000000, PI_WARN0x00600000, |
| 390 | "ST 2038 alignment bits must be one", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, |
| 391 | { &ei_st2038_nonstandard_stuffing, |
| 392 | { "st2038.inter_record_stuffing", PI_PROTOCOL0x09000000, PI_WARN0x00600000, |
| 393 | "Non-standard inter-record stuffing bits accepted for interoperability", |
| 394 | EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, |
| 395 | { &ei_st2038_multiple_lines, |
| 396 | { "st2038.multiple_lines", PI_PROTOCOL0x09000000, PI_WARN0x00600000, |
| 397 | "One ST 2038 PES packet contains ANC data from multiple raster lines", |
| 398 | EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, |
| 399 | { &ei_st2038_truncated, |
| 400 | { "st2038.truncated", PI_MALFORMED0x07000000, PI_WARN0x00600000, |
| 401 | "Truncated ST 2038 ANC record", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, |
| 402 | }; |
| 403 | |
| 404 | expert_module_t *expert; |
| 405 | |
| 406 | proto_st2038 = proto_register_protocol( |
| 407 | "SMPTE ST 2038 Ancillary Data in MPEG-2 TS", "ST 2038", "st2038"); |
| 408 | proto_register_field_array(proto_st2038, hf, array_length(hf)(sizeof (hf) / sizeof (hf)[0])); |
| 409 | proto_register_subtree_array(ett, array_length(ett)(sizeof (ett) / sizeof (ett)[0])); |
| 410 | |
| 411 | expert = expert_register_protocol(proto_st2038); |
| 412 | expert_register_field_array(expert, ei, array_length(ei)(sizeof (ei) / sizeof (ei)[0])); |
| 413 | |
| 414 | st2038_handle = register_dissector("st2038", dissect_st2038, proto_st2038); |
| 415 | } |
| 416 | |
| 417 | void |
| 418 | proto_reg_handoff_st2038(void) |
| 419 | { |
| 420 | dissector_add_uint("mpeg-pes.registration", ST2038_REGISTRATION_ID0x56414e43U, |
| 421 | st2038_handle); |
| 422 | } |
| 423 | |
| 424 | /* |
| 425 | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
| 426 | * |
| 427 | * Local variables: |
| 428 | * c-basic-offset: 4 |
| 429 | * tab-width: 8 |
| 430 | * indent-tabs-mode: nil |
| 431 | * End: |
| 432 | * |
| 433 | * vi: set shiftwidth=4 tabstop=8 expandtab: |
| 434 | * :indentSize=4:tabSize=8:noTabs=true: |
| 435 | */ |