Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet-smpte-291-vanc.h
1/* packet-smpte-291-vanc.h
2 * Shared SMPTE ST 291 ancillary-data fields and subdissector table.
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef __PACKET_SMPTE_291_VANC_H__
8#define __PACKET_SMPTE_291_VANC_H__
9
10#include <epan/packet.h>
11
12/*
13 * Context passed by an ST 291 ANC/VANC transport to a DID/SDID subdissector.
14 * The interface is transport-independent and is shared by transports such as
15 * ST 2110-40 and ST 2038.
16 * top_tree lets an application payload promote its decode to packet level,
17 * while payload_index uniquely identifies this ANC payload within the frame.
18 */
19typedef struct {
20 proto_tree *top_tree;
21 uint32_t payload_index;
22 /* The canonical full-width UDW TVB supplied by the shared dispatcher. */
23 tvbuff_t *full_udw_tvb;
25
26/* A transport-independent ST 291 packet. words contains DID, SDID/DBN,
27 * DC, the UDW values, and checksum in that order. The source members describe
28 * a contiguous packed representation when one exists; transports such as raw
29 * SDI can instead normalize their channel-specific storage and call the word
30 * entry point. */
31typedef struct {
32 tvbuff_t *parent_tvb;
33 const uint16_t *words;
34 unsigned word_count;
35 uint8_t did;
36 uint8_t sdid_or_dbn;
37 unsigned data_count;
38 uint16_t checksum;
39 uint16_t checksum_calculated;
40 bool did_parity_ok;
41 bool second_word_parity_ok;
42 bool data_count_parity_ok;
43 bool checksum_ok;
44 tvbuff_t *packed_udw_tvb;
45 unsigned packed_udw_bit_offset;
47
48/* Extract an ST 291 DID-through-checksum sequence from a contiguous MSB-first
49 * 10-bit stream. available_bits bounds this packet within its transport. */
50bool st291_vanc_packet_from_packed(tvbuff_t *tvb, packet_info *pinfo,
51 unsigned bit_offset, unsigned available_bits,
52 st291_vanc_packet_t *packet);
53
54/* Normalize an ST 291 DID-through-checksum sequence already extracted by a
55 * transport. This is the entry point for channel-aware transports such as raw
56 * SDI, where successive logical words need not be contiguous in the TVB. */
57bool st291_vanc_packet_from_words(tvbuff_t *parent_tvb, packet_info *pinfo,
58 const uint16_t *words, unsigned word_count,
59 st291_vanc_packet_t *packet);
60
61/* Render and dispatch a normalized ST 291 packet. payload_item identifies the
62 * transport-owned User Data Words field used to scope Packet Bytes sources.
63 * The public table TVB remains byte-oriented, while C subdissectors obtain all
64 * ten bits per word from data->full_udw_tvb. */
65bool st291_vanc_dissect_packet(const st291_vanc_packet_t *packet,
66 packet_info *pinfo, proto_tree *tree,
67 proto_item *payload_item,
68 const st291_vanc_dissector_data_t *data);
69
70proto_item *st291_tree_add_did(proto_tree *tree, tvbuff_t *tvb,
71 int offset, int length, uint8_t did);
72proto_item *st291_tree_add_sdid(proto_tree *tree, tvbuff_t *tvb,
73 int offset, int length, uint8_t did, uint8_t sdid);
74proto_item *st291_tree_add_dbn(proto_tree *tree, tvbuff_t *tvb,
75 int offset, int length, uint8_t dbn);
76void st291_append_packet_description(proto_item *item, uint8_t did,
77 uint8_t sdid_or_dbn);
78
79#endif /* __PACKET_SMPTE_291_VANC_H__ */
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
proto_node proto_item
Definition proto.h:927
Definition packet-smpte-291-vanc.h:19
Definition packet-smpte-291-vanc.h:31