/builds/wireshark/wireshark/epan/dissectors/packet 您所在的位置:网站首页 1300xd1 /builds/wireshark/wireshark/epan/dissectors/packet

/builds/wireshark/wireshark/epan/dissectors/packet

2023-04-19 04:14| 来源: 网络整理| 查看: 265

Bug Summary File:builds/wireshark/wireshark/epan/dissectors/packet-dvb-s2-bb.c Warning:line 1316, column 29Access to field 'labeltype' results in a dereference of a null pointer (loaded from variable 'subpacket_data') Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name packet-dvb-s2-bb.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/builds/wireshark/wireshark/build -resource-dir /usr/lib/llvm-15/lib/clang/15.0.7 -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /usr/include/mit-krb5 -isystem /usr/include/libxml2 -isystem /builds/wireshark/wireshark/build/epan/dissectors -isystem /builds/wireshark/wireshark/epan/dissectors -isystem /builds/wireshark/wireshark/epan -D G_DISABLE_DEPRECATED -D G_DISABLE_SINGLE_INCLUDES -D WS_BUILD_DLL -D WS_DEBUG -D WS_DEBUG_UTF_8 -I /builds/wireshark/wireshark/build -I /builds/wireshark/wireshark -I /builds/wireshark/wireshark/include -internal-isystem /usr/lib/llvm-15/lib/clang/15.0.7/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fmacro-prefix-map=/builds/wireshark/wireshark/= -fmacro-prefix-map=/builds/wireshark/wireshark/build/= -fmacro-prefix-map=../= -Wno-error=stringop-overflow= -Wno-error=deprecated-declarations -Wno-format-truncation -Wno-pointer-sign -std=gnu11 -fdebug-compilation-dir=/builds/wireshark/wireshark/build -ferror-limit 19 -fvisibility hidden -fwrapv -fgnuc-version=4.2.1 -fcolor-diagnostics -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /builds/wireshark/wireshark/sbout/2023-04-15-100402-2960-1 -x c /builds/wireshark/wireshark/epan/dissectors/packet-dvb-s2-bb.c

Keyboard shortcuts:

Use 'j/k' keys for keyboard navigation Use 'Shift+S' to show/hide relevant lines Use '?' to toggle this window Close 1/* packet-dvb-s2-bb.c 2 * Routines for DVB Dynamic Mode Adaptation dissection 3 * refer to 4 * https://web.archive.org/web/20170226064346/http://satlabs.org/pdf/sl_561_Mode_Adaptation_Input_and_Output_Interfaces_for_DVB-S2_Equipment_v1.3.pdf 5 * 6 * (http://satlabs.org/pdf/sl_561_Mode_Adaptation_Input_and_Output_Interfaces_for_DVB-S2_Equipment_v1.3.pdf 7 * is no longer available) 8 * 9 * Standards: 10 * ETSI EN 302 307-1 - Digital Video Broadcasting (DVB) - Framing Structure Part 1: DVB-S2 11 * ETSI EN 302 307-2 - Digital Video Broadcasting (DVB) - Framing Structure Part 2: DVB-S2X 12 * ETSI TS 102 606-1 - Digital Video Broadcasting (DVB) - Generic Stream Encapsulation (GSE) Part 1: Protocol 13 * ETSI TS 102 771 - Digital Video Broadcasting (DVB) - GSE implementation guidelines 14 * SatLabs sl_561 - Mode Adaptation Interfaces for DVB-S2 equipment 15 * ETSI EN 302 769 - Digital Video Broadcasting (DVB) - Framing Structure DVB-C2 16 * ETSI EN 302 755 - Digital Video Broadcasting (DVB) - Framing Structure DVB-T2 17 * ETSI EN 301 545 - Digital Video Broadcasting (DVB) - Second Generation DVB Interactive Satellite System (DVB-RCS2) 18 * RFC 4326 - Unidirectional Lightweight Encapsulation (ULE) for Transmission of IP Datagrams over an MPEG-2 Transport Stream (TS) 19 * IANA registries: 20 * 21 * Mandatory Extension Headers (or link-dependent type fields) for ULE (Range 0-255 decimal): 22 * 23 * https://www.iana.org/assignments/ule-next-headers/ule-next-headers.xhtml#ule-next-headers-1 24 * 25 * and 26 * 27 * Optional Extension Headers for ULE (Range 256-511 decimal): 28 * 29 * https://www.iana.org/assignments/ule-next-headers/ule-next-headers.xhtml#ule-next-headers-2 30 * 31 * Copyright 2012, Tobias Rutz 32 * Copyright 2013-2020, Thales Alenia Space 33 * Copyright 2013-2021, Viveris Technologies 34 * Copyright 2021, John Thacker 35 * 36 * Wireshark - Network traffic analyzer 37 * By Gerald Combs 38 * Copyright 1998 Gerald Combs 39 * 40 * SPDX-License-Identifier: GPL-2.0-or-later 41 */ 42 43#include "config.h" 44 45#include 46#include 47#include 48#include 49#include 50#include 51#include 52#include 53#include 54#include 55#include 56 57#include "packet-mp2t.h" 58 59#define BIT_IS_SET(var, bit)((var) & (1 num, fragid, TRUE(!(0))); 1285 subpacket_data->labeltype = frag_data->labeltype; 1286 } else { 1287 frag_data = get_gse_frag_data(gse_data, fragid, FALSE(0)); 1288 /* ETSI TS 102 601-1 A.2 Reassembly 1289 * Discard the packet if no buffer is in the re-assembly 1290 * state for the Frag ID (check with fragment_get). 1291 */ 1292 if (frag_data33.1'frag_data' is null && fragment_get(&dvb_s2_gse_reassembly_table, pinfo, fragid, NULL((void*)0))) { 1293 subpacket_data = get_gse_subpacket_data(gse_data, pinfo->num, fragid, TRUE(!(0))); 1294 subpacket_data->labeltype = frag_data->labeltype; 1295 } 1296 } 1297 } else { 1298 subpacket_data = get_gse_subpacket_data(gse_data, pinfo->num, fragid, FALSE(0)); 1299 } 1300 fragment_head *dvbs2_frag_head = NULL((void*)0); 1301 if (BIT_IS_SET(gse_hdr, DVB_S2_GSE_HDR_STOP_POS)((gse_hdr) & (1 ptype = save_ptype; 1401 pinfo->srcport = save_srcport; 1402 pinfo->destport = save_destport; 1403 1404 if (complete) { 1405 switch (gse_proto) { 1406 case ETHERTYPE_IP0x0800: 1407 if (dvb_s2_full_dissection) 1408 { 1409 call_dissector(ip_handle, data_tvb, pinfo, tree); 1410 dissected = TRUE(!(0)); 1411 } 1412 break; 1413 1414 case ETHERTYPE_IPv60x86DD: 1415 if (dvb_s2_full_dissection) 1416 { 1417 call_dissector(ipv6_handle, data_tvb, pinfo, tree); 1418 dissected = TRUE(!(0)); 1419 } 1420 break; 1421 1422 case ETHERTYPE_VLAN0x8100: 1423 if (dvb_s2_full_dissection) 1424 { 1425 call_dissector(eth_withoutfcs_handle, data_tvb, pinfo, tree); 1426 dissected = TRUE(!(0)); 1427 } 1428 break; 1429 1430 case DVB_RCS2_SIGNAL_TABLE0x0082: 1431 call_dissector(dvb_s2_table_handle, data_tvb, pinfo, tree); 1432 dissected = TRUE(!(0)); 1433 break; 1434 1435 case DVB_RCS2_NCR0x0081: 1436 ttf = proto_tree_add_item(dvb_s2_gse_tree, hf_dvb_s2_gse_ncr, data_tvb, 0, -1, ENC_NA0x00000000); 1437 dvb_s2_gse_ncr_tree = proto_item_add_subtree(ttf, ett_dvb_s2_gse_ncr); 1438 proto_tree_add_item(dvb_s2_gse_ncr_tree, hf_dvb_s2_gse_data, data_tvb, 0, -1, ENC_NA0x00000000); 1439 dissected = TRUE(!(0)); 1440 break; 1441 1442 default: 1443 /* Not handled! TODO: expert info? */ 1444 break; 1445 } 1446 } 1447 1448 if (!dissected) { 1449 proto_tree_add_item(dvb_s2_gse_tree, hf_dvb_s2_gse_data, data_tvb, 0, -1, ENC_NA0x00000000); 1450 } 1451 1452 /* add crc32 if last fragment */ 1453 if (BIT_IS_CLEAR(gse_hdr, DVB_S2_GSE_HDR_START_POS)!((gse_hdr) & (1 cinfo, COL_INFO, "Baseband "); 1531 1532 /* create display subtree for the protocol */ 1533 ti = proto_tree_add_item(tree, proto_dvb_s2_bb, tvb, 0, DVB_S2_BB_HEADER_LEN((guint)10), ENC_NA0x00000000); 1534 dvb_s2_bb_tree = proto_item_add_subtree(ti, ett_dvb_s2_bb); 1535 1536 matype1 = tvb_get_guint8(tvb, DVB_S2_BB_OFFS_MATYPE10); 1537 new_off += 1; 1538 1539 if (BIT_IS_CLEAR(matype1, DVB_S2_BB_MIS_POS)!((matype1) & (1 > DVB_S2_BB_ISSYI_POS3; 1543 npd = (matype1 & DVB_S2_BB_NPD_MASK0x04) >> DVB_S2_BB_NPD_POS2; 1544 1545 conv_data = get_dvbs2_bb_conv_data(conv); 1546 1547 if (((matype1 & DVB_S2_BB_RO_MASK0x03) == 3) && !conv_data->use_low_ro) { 3←Assuming the condition is false→ 1548 conv_data->use_low_ro = pinfo->num; 1549 } 1550 if (conv_data->use_low_ro && pinfo->num >= conv_data->use_low_ro) { 4←Assuming field 'use_low_ro' is 0→ 1551 proto_tree_add_bitmask_with_flags(dvb_s2_bb_tree, tvb, DVB_S2_BB_OFFS_MATYPE10, hf_dvb_s2_bb_matype1, 1552 ett_dvb_s2_bb_matype1, bb_header_bitfields_low_ro, ENC_BIG_ENDIAN0x00000000, BMT_NO_FLAGS0x00); 1553 } else { 1554 proto_tree_add_bitmask_with_flags(dvb_s2_bb_tree, tvb, DVB_S2_BB_OFFS_MATYPE10, hf_dvb_s2_bb_matype1, 1555 ett_dvb_s2_bb_matype1, bb_header_bitfields_high_ro, ENC_BIG_ENDIAN0x00000000, BMT_NO_FLAGS0x00); 1556 } 1557 1558 input8 = tvb_get_guint8(tvb, DVB_S2_BB_OFFS_MATYPE21); 1559 new_off += 1; 1560 if (flag_is_ms4.1'flag_is_ms' is 0) { 5←Taking false branch→ 1561 proto_tree_add_uint_format_value(dvb_s2_bb_tree, hf_dvb_s2_bb_matype2, tvb, 1562 DVB_S2_BB_OFFS_MATYPE21, 1, input8, "Input Stream Identifier (ISI): %d", 1563 input8); 1564 isi = input8; 1565 } else { 1566 proto_tree_add_uint_format_value(dvb_s2_bb_tree, hf_dvb_s2_bb_matype2, tvb, 1567 DVB_S2_BB_OFFS_MATYPE21, 1, input8, "reserved"); 1568 } 1569 1570 user_packet_length = input16 = tvb_get_ntohs(tvb, DVB_S2_BB_OFFS_UPL2); 1571 new_off += 2; 1572 1573 proto_tree_add_uint_format(dvb_s2_bb_tree, hf_dvb_s2_bb_upl, tvb, 1574 DVB_S2_BB_OFFS_UPL2, 2, input16, "User Packet Length: %d bits (%d bytes)", 1575 (guint16) input16, (guint16) input16 / 8); 1576 1577 new_off += 2; 1578 bb_data_len = input16 = tvb_get_ntohs(tvb, DVB_S2_BB_OFFS_DFL4); 1579 bb_data_len /= 8; 1580 if (bb_data_len + DVB_S2_BB_HEADER_LEN((guint)10) > tvb_reported_length(tvb)) { 6←Assuming the condition is false→ 7←Taking false branch→ 1581 /* DFL can be less than the length of the BBFrame (zero padding is 1582 * applied, see ETSI EN 302 307-1 5.2.1), but cannot be greater 1583 * than the frame length (minus 10 bytes of header). 1584 */ 1585 expert_add_info(pinfo, ti, &ei_dvb_s2_bb_dfl_invalid); 1586 bb_data_len = tvb_reported_length_remaining(tvb, DVB_S2_BB_HEADER_LEN((guint)10)); 1587 } 1588 1589 proto_tree_add_uint_format_value(dvb_s2_bb_tree, hf_dvb_s2_bb_dfl, tvb, 1590 DVB_S2_BB_OFFS_DFL4, 2, input16, "%d bits (%d bytes)", input16, input16 / 8); 1591 1592 new_off += 1; 1593 sync_flag = tvb_get_guint8(tvb, DVB_S2_BB_OFFS_SYNC6); 1594 proto_tree_add_item(dvb_s2_bb_tree, hf_dvb_s2_bb_sync, tvb, DVB_S2_BB_OFFS_SYNC6, 1, ENC_BIG_ENDIAN0x00000000); 1595 1596 new_off += 2; 1597 syncd = tvb_get_ntohs(tvb, DVB_S2_BB_OFFS_SYNCD7); 1598 proto_tree_add_uint_format_value(dvb_s2_bb_tree, hf_dvb_s2_bb_syncd, tvb, 1599 DVB_S2_BB_OFFS_SYNCD7, 2, syncd, "%d bits (%d bytes)", syncd, syncd >> 3); 1600 1601 new_off += 1; 1602 proto_tree_add_checksum(dvb_s2_bb_tree, tvb, DVB_S2_BB_OFFS_CRC9, hf_dvb_s2_bb_crc, hf_dvb_s2_bb_crc_status, &ei_dvb_s2_bb_crc, pinfo, 1603 compute_crc8(tvb, DVB_S2_BB_HEADER_LEN((guint)10) - 1, 0), ENC_NA0x00000000, PROTO_CHECKSUM_VERIFY0x01); 1604 1605 /* The Base-Band Frame can have multiple GSE (or TS, which can have ULE 1606 * or MPE) packets that are concatenated, can be fragmented, and can call 1607 * subdissectors including IP (which itself can be fragmented) that 1608 * overwrite the pinfo addresses & ports, which are used as keys for 1609 * reassembly tables, conversations, and other purposes. 1610 * 1611 * Thus, we need to save the current values before any subdissectors 1612 * are run, and restore them each time before each subpacket. 1613 * 1614 * When BBFrames are carried over UDP or RTP we can't necessarily rely on 1615 * the ISI being unique - a capture might include different streams sent 1616 * as single input streams or with the same ISI over different UDP 1617 * endpoints and we don't want to mix data when defragmenting. So we 1618 * create a virtual ISI. 1619 */ 1620 1621 /* UDP and RTP both always create conversations. If we later have 1622 * support for DVB Base Band Frames as the link-layer of a capture file, 1623 * we'll need to handle it differently. In that case just use the 1624 * ISI directly in conversation_new_by_id() instead of creating a 1625 * virtual stream identifier. 1626 */ 1627 1628 if (conv7.1'conv' is non-null) { 8←Taking true branch→ 1629 virtual_id = virtual_stream_lookup(conv, isi); 1630 /* DVB Base Band streams are unidirectional. Differentiate by direction 1631 * for the unlikely case of two streams between the same endpointss in 1632 * the opposite direction. 1633 */ 1634 if (addresses_equal(&pinfo->src, conversation_key_addr1(conv->key_ptr))) { 9←Taking false branch→ 1635 pinfo->p2p_dir = P2P_DIR_SENT0; 1636 } else { 1637 pinfo->p2p_dir = P2P_DIR_RECV1; 1638 } 1639 1640 } else { 1641 virtual_id = isi; 1642 pinfo->p2p_dir = P2P_DIR_SENT0; 1643 } 1644 subcircuit = find_conversation_by_id(pinfo->num, CONVERSATION_DVBBBF, virtual_id); 1645 if (subcircuit == NULL((void*)0)) { 10←Assuming 'subcircuit' is not equal to NULL→ 11←Taking false branch→ 1646 subcircuit = conversation_new_by_id(pinfo->num, CONVERSATION_DVBBBF, virtual_id); 1647 } 1648 1649 /* conversation_set_conv_addr_port_endpoints() could be useful for the subdissectors 1650 * this calls (whether GSE or TS, and replace passing the packet data 1651 * below), but it could cause problems when the subdissectors of those 1652 * subdissectors try and call find_or_create_conversation(). 1653 * pinfo->use_conv_addr_port_endpoints doesn't affect reassembly tables 1654 * in the default reassembly functions, either. So maybe the eventual 1655 * approach is to create a conversation key but set 1656 * pinfo->use_conv_addr_port_endpoints back to FALSE, and also make the 1657 * GSE and MP2T dissectors more (DVB BBF) conversation key aware, 1658 * including in their reassembly functions. 1659 */ 1660 1661 pdata = wmem_new0(pinfo->pool, dvbs2_bb_data)((dvbs2_bb_data*)wmem_alloc0((pinfo->pool), sizeof(dvbs2_bb_data))); 1662 copy_address_shallow(&pdata->src, &pinfo->src); 1663 copy_address_shallow(&pdata->dst, &pinfo->dst); 1664 pdata->ptype = pinfo->ptype; 1665 pdata->srcport = pinfo->srcport; 1666 pdata->destport = pinfo->destport; 1667 pdata->isi = isi; 1668 1669 switch (matype1 & DVB_S2_BB_TSGS_MASK0xC0) { 12←Control jumps to 'case 64:' at line 1670→ 1670 case DVB_S2_BB_TSGS_GENERIC_CONTINUOUS0x40: 1671 /* Check GSE constraints on the BB header per 9.2.1 of ETSI TS 102 771 */ 1672 if (issyi) { 13←Assuming 'issyi' is 0→ 14←Taking false branch→ 1673 expert_add_info(pinfo, ti, &ei_dvb_s2_bb_issy_invalid); 1674 } 1675 if (npd) { 15←Assuming 'npd' is 0→ 16←Taking false branch→ 1676 expert_add_info(pinfo, ti, &ei_dvb_s2_bb_npd_invalid); 1677 } 1678 if (user_packet_length != 0x0000) { 17←Assuming 'user_packet_length' is equal to 0→ 18←Taking false branch→ 1679 expert_add_info_format(pinfo, ti, &ei_dvb_s2_bb_upl_invalid, 1680 "UPL is 0x%04x. It must be 0x0000 for GSE packets.", user_packet_length); 1681 } 1682 1683 1684 if (dvb_s2_df_dissection) { 19←Assuming 'dvb_s2_df_dissection' is not equal to 0→ 20←Taking true branch→ 1685 while (bb_data_len) { 1686 if (sync_flag == DVB_S2_BB_SYNC_EIP_CRC321 && bb_data_len == DVB_S2_BB_EIP_CRC32_LEN4) { 21←Assuming 'sync_flag' is equal to DVB_S2_BB_SYNC_EIP_CRC32→ 22←Assuming 'bb_data_len' is not equal to DVB_S2_BB_EIP_CRC32_LEN→ 23←Taking false branch→ 1687 proto_tree_add_checksum(dvb_s2_bb_tree, tvb, new_off, hf_dvb_s2_bb_eip_crc32, hf_dvb_s2_bb_eip_crc32_status, &ei_dvb_s2_bb_crc, pinfo, crc32_mpeg2_tvb_offset(tvb, DVB_S2_BB_HEADER_LEN((guint)10), new_off - DVB_S2_BB_HEADER_LEN((guint)10)), ENC_BIG_ENDIAN0x00000000, PROTO_CHECKSUM_VERIFY0x01); 1688 bb_data_len = 0; 1689 new_off += DVB_S2_BB_EIP_CRC32_LEN4; 1690 } else { 1691 /* start DVB-GSE dissector */ 1692 sub_dissected = dissect_dvb_s2_gse(tvb_new_subset_length(tvb, new_off, bb_data_len), pinfo, tree, pdata); 24←Calling 'dissect_dvb_s2_gse'→ 1693 new_off += sub_dissected; 1694 1695 if ((sub_dissected = DVB_S2_GSE_MINSIZE2)) { 1696 bb_data_len -= sub_dissected; 1697 if (bb_data_len < DVB_S2_GSE_MINSIZE2) 1698 bb_data_len = 0; 1699 } else { 1700 bb_data_len = 0; 1701 } 1702 } 1703 } 1704 } else { 1705 proto_tree_add_item(dvb_s2_bb_tree, hf_dvb_s2_bb_df, tvb, new_off, bb_data_len, ENC_NA0x00000000); 1706 new_off += bb_data_len; 1707 } 1708 break; 1709 1710 case DVB_S2_BB_TSGS_GENERIC_PACKETIZED0x00: 1711 proto_tree_add_item(tree, hf_dvb_s2_bb_packetized, tvb, new_off, bb_data_len, ENC_NA0x00000000); 1712 new_off += bb_data_len; 1713 break; 1714 1715 case DVB_S2_BB_TSGS_TRANSPORT_STREAM0xC0: 1716 crc8 = 0; 1717 // TODO: Save from frame to frame to test the first TSP when syncd == 0? 1718 flags = PROTO_CHECKSUM_NO_FLAGS0x00; 1719 /* Check TS constraints on the BB header per 5.1 of ETSI EN 302 307 */ 1720 if (sync_flag != MP2T_SYNC_BYTE0x47) { 1721 expert_add_info_format(pinfo, ti, &ei_dvb_s2_bb_sync_invalid, 1722 "Copy of User Packet Sync is 0x%02x. It must be 0x%02x for TS packets.", sync_flag, MP2T_SYNC_BYTE0x47); 1723 } 1724 /* ETSI 302 307-1 5.1.6: SYNCD == 0xFFFF -> "no UP starts in the 1725 * DATA FIELD"; otherwise it should not point past the UPL. 1726 */ 1727 if (syncd != 0xFFFF && (syncd >> 3) >= bb_data_len) { 1728 expert_add_info_format(pinfo, ti, &ei_dvb_s2_bb_syncd_invalid, 1729 "SYNCD >= DFL (points past the end of the Data Field)"); 1730 syncd = 0xFFFF; 1731 } 1732 /* Assume byte aligned. */ 1733 user_packet_length >>= 3; 1734 /* UPL should be *at least* MP2T_PACKET_SIZE, depending on npd (1 byte) 1735 * and issy (2 or 3 bytes). The fields are overdetermined (something 1736 * addressed in -C2 and -T2's High Efficency Mode for TS), so how to 1737 * process in the case of inconsistency is a judgment call. The 1738 * approach here is to disable anything for which there is insufficent 1739 * room, but not to enable anything marked as inactive. 1740 */ 1741 switch (user_packet_length) { 1742 case MP2T_PACKET_SIZE188: 1743 if (issyi) { 1744 expert_add_info_format(pinfo, ti, &ei_dvb_s2_bb_issy_invalid, 1745 "ISSYI is active on TS but UPL is only %d bytes", 1746 user_packet_length); 1747 issyi = 0; 1748 } 1749 if (npd) { 1750 expert_add_info_format(pinfo, ti, &ei_dvb_s2_bb_npd_invalid, 1751 "NPD is active on TS but UPL is only %d bytes", 1752 user_packet_length); 1753 npd = FALSE(0); 1754 } 1755 break; 1756 case MP2T_PACKET_SIZE188 + 1: 1757 if (issyi) { 1758 expert_add_info_format(pinfo, ti, &ei_dvb_s2_bb_issy_invalid, 1759 "ISSYI is active on TS but UPL is only %d bytes", 1760 user_packet_length); 1761 issyi = 0; 1762 } 1763 if (!npd) { 1764 expert_add_info_format(pinfo, ti, &ei_dvb_s2_bb_npd_invalid, 1765 "NPD is inactive on TS but UPL is %d bytes", 1766 user_packet_length); 1767 } 1768 break; 1769 case MP2T_PACKET_SIZE188 + 2: 1770 if (!issyi) { 1771 expert_add_info_format(pinfo, ti, &ei_dvb_s2_bb_issy_invalid, 1772 "ISSYI is inactive on TS but UPL is %d bytes", 1773 user_packet_length); 1774 } else { 1775 issyi = 2; 1776 } 1777 if (npd) { 1778 expert_add_info_format(pinfo, ti, &ei_dvb_s2_bb_npd_invalid, 1779 "NPD is active on TS but UPL is %d bytes", 1780 user_packet_length); 1781 npd = FALSE(0); 1782 } 1783 break; 1784 case MP2T_PACKET_SIZE188 + 3: 1785 if (npd) { 1786 if (!issyi) { 1787 expert_add_info_format(pinfo, ti, &ei_dvb_s2_bb_issy_invalid, 1788 "ISSYI is inactive on TS with NPD active but UPL is %d bytes", 1789 user_packet_length); 1790 } else { 1791 issyi = 2; 1792 } 1793 } else { 1794 if (!issyi) { 1795 expert_add_info_format(pinfo, ti, &ei_dvb_s2_bb_issy_invalid, 1796 "ISSYI is inactive on TS with NPD inactive but UPL is %d bytes", 1797 user_packet_length); 1798 } else { 1799 issyi = 3; 1800 } 1801 } 1802 break; 1803 case MP2T_PACKET_SIZE188 + 4: 1804 if (!issyi) { 1805 expert_add_info_format(pinfo, ti, &ei_dvb_s2_bb_issy_invalid, 1806 "ISSYI is inactive on TS but UPL is %d bytes", 1807 user_packet_length); 1808 } else { 1809 issyi = 3; 1810 } 1811 if (!npd) { 1812 expert_add_info_format(pinfo, ti, &ei_dvb_s2_bb_npd_invalid, 1813 "NPD is inactive on TS but UPL is %d bytes", 1814 user_packet_length); 1815 } 1816 break; 1817 default: 1818 expert_add_info_format(pinfo, ti, &ei_dvb_s2_bb_upl_invalid, 1819 "UPL is %d byte%s. It must be between %d and %d bytes for TS packets.", 1820 user_packet_length, plurality(user_packet_length, "", "s")((user_packet_length) == 1 ? ("") : ("s")), 1821 MP2T_PACKET_SIZE188, MP2T_PACKET_SIZE188+4); 1822 if (user_packet_length < MP2T_PACKET_SIZE188) { 1823 user_packet_length = 0; 1824 } 1825 break; 1826 } 1827 if (dvb_s2_df_dissection && user_packet_length) { 1828 sync_tvb = tvb_new_subset_length(tvb, DVB_S2_BB_OFFS_SYNC6, 1); 1829 ts_stream = find_stream(subcircuit, pinfo->p2p_dir); 1830 if (ts_stream == NULL((void*)0)) { 1831 ts_stream = stream_new(subcircuit, pinfo->p2p_dir); 1832 } 1833 if (syncd == 0xFFFF) { 1834 /* Largely theoretical for TS (cf. Generic Packetized, GSE-HEM) 1835 * due to the small size of TSPs versus transmitted BBFrames. 1836 */ 1837 next_tvb = tvb_new_subset_length(tvb, new_off, bb_data_len); 1838 ts_frag = stream_find_frag(ts_stream, pinfo->num, new_off); 1839 if (ts_frag == NULL((void*)0)) { 1840 ts_frag = stream_add_frag(ts_stream, pinfo->num, new_off, 1841 next_tvb, pinfo, TRUE(!(0))); 1842 } 1843 stream_process_reassembled(next_tvb, 0, pinfo, 1844 "Reassembled TSP", ts_frag, &dvbs2_frag_items, NULL((void*)0), 1845 tree); 1846 new_off += bb_data_len; 1847 } else { 1848 syncd >>= 3; 1849 /* Do this even if syncd is zero just to clear out a partial 1850 * fragment from before in the case of drops or out of order. */ 1851 next_tvb = tvb_new_subset_length(tvb, new_off, syncd); 1852 ts_frag = stream_find_frag(ts_stream, pinfo->num, new_off); 1853 if (ts_frag == NULL((void*)0)) { 1854 ts_frag = stream_add_frag(ts_stream, pinfo->num, new_off, 1855 next_tvb, pinfo, FALSE(0)); 1856 } 1857 fd_head = stream_get_frag_data(ts_frag); 1858 /* Don't put anything in the tree when SYNCD is 0 and there was 1859 * no earlier fragment (i.e., zero length reassembly) 1860 */ 1861 if (syncd || (fd_head && fd_head->datalen)) { 1862 next_tvb = stream_process_reassembled(next_tvb, 0, pinfo, 1863 "Reassembled TSP", ts_frag, &dvbs2_frag_items, NULL((void*)0), 1864 tree); 1865 if (next_tvb && tvb_reported_length(next_tvb) == user_packet_length) { 1866 tsp_tvb = tvb_new_composite(); 1867 composite_init = TRUE(!(0)); 1868 tvb_composite_append(tsp_tvb, sync_tvb); 1869 proto_tree_add_checksum(dvb_s2_bb_tree, next_tvb, 0, 1870 hf_dvb_s2_bb_up_crc, hf_dvb_s2_bb_up_crc_status, 1871 &ei_dvb_s2_bb_crc, pinfo, crc8, ENC_NA0x00000000, flags); 1872 crc8 = compute_crc8(next_tvb, user_packet_length - 1, 1); 1873 flags = PROTO_CHECKSUM_VERIFY0x01; 1874 tvb_composite_append(tsp_tvb, tvb_new_subset_length(next_tvb, 1, MP2T_PACKET_SIZE188 - 1)); 1875 /* XXX: ISSY is not fully dissected */ 1876 if (issyi == 2) { 1877 proto_tree_add_item(dvb_s2_bb_tree, hf_dvb_s2_bb_issy_short, 1878 next_tvb, MP2T_PACKET_SIZE188, issyi, ENC_BIG_ENDIAN0x00000000); 1879 } else if (issyi == 3) { 1880 proto_tree_add_item(dvb_s2_bb_tree, hf_dvb_s2_bb_issy_short, 1881 next_tvb, MP2T_PACKET_SIZE188, issyi, ENC_BIG_ENDIAN0x00000000); 1882 } 1883 if (npd) { 1884 proto_tree_add_item(dvb_s2_bb_tree, hf_dvb_s2_bb_dnp, 1885 next_tvb, MP2T_PACKET_SIZE188 + issyi, 1, ENC_NA0x00000000); 1886 } 1887 } else if (pinfo->num != subcircuit->setup_frame) { 1888 /* Bad reassembly due to a dropped or out of order 1889 * packet, or maybe the previous packet cut short. 1890 */ 1891 expert_add_info(pinfo, ti, &ei_dvb_s2_bb_up_reassembly_invalid); 1892 } 1893 new_off += syncd; 1894 } 1895 } 1896 while ((bb_data_len + DVB_S2_BB_HEADER_LEN((guint)10) - new_off) >= user_packet_length) { 1897 proto_tree_add_checksum(dvb_s2_bb_tree, tvb, new_off, 1898 hf_dvb_s2_bb_up_crc, hf_dvb_s2_bb_up_crc_status, 1899 &ei_dvb_s2_bb_crc, pinfo, crc8, ENC_NA0x00000000, flags); 1900 if (!composite_init) { 1901 tsp_tvb = tvb_new_composite(); 1902 composite_init = TRUE(!(0)); 1903 } 1904 tvb_composite_append(tsp_tvb, sync_tvb); 1905 new_off++; 1906 crc8 = compute_crc8(tvb, user_packet_length - 1, new_off); 1907 flags = PROTO_CHECKSUM_VERIFY0x01; 1908 tvb_composite_append(tsp_tvb, tvb_new_subset_length(tvb, new_off, MP2T_PACKET_SIZE188 - 1)); 1909 new_off += MP2T_PACKET_SIZE188 - 1; 1910 /* XXX: ISSY is not fully dissected */ 1911 if (issyi == 2) { 1912 proto_tree_add_item(dvb_s2_bb_tree, hf_dvb_s2_bb_issy_short, 1913 tvb, new_off, issyi, ENC_BIG_ENDIAN0x00000000); 1914 } else if (issyi == 3) { 1915 proto_tree_add_item(dvb_s2_bb_tree, hf_dvb_s2_bb_issy_long, 1916 tvb, new_off, issyi, ENC_BIG_ENDIAN0x00000000); 1917 } 1918 if (npd) { 1919 proto_tree_add_item(dvb_s2_bb_tree, hf_dvb_s2_bb_dnp, 1920 tvb, new_off + issyi, 1, ENC_NA0x00000000); 1921 } 1922 new_off += user_packet_length - MP2T_PACKET_SIZE188; 1923 } 1924 if (bb_data_len + DVB_S2_BB_HEADER_LEN((guint)10) - new_off) { 1925 next_tvb = tvb_new_subset_length(tvb, new_off, bb_data_len + DVB_S2_BB_HEADER_LEN((guint)10) - new_off); 1926 ts_frag = stream_find_frag(ts_stream, pinfo->num, new_off); 1927 if (ts_frag == NULL((void*)0)) { 1928 ts_frag = stream_add_frag(ts_stream, pinfo->num, new_off, 1929 next_tvb, pinfo, TRUE(!(0))); 1930 } 1931 stream_process_reassembled(next_tvb, 0, pinfo, 1932 "Reassembled TSP", ts_frag, &dvbs2_frag_items, NULL((void*)0), tree); 1933 } 1934 if (composite_init) { 1935 tvb_composite_finalize(tsp_tvb); 1936 add_new_data_source(pinfo, tsp_tvb, "Sync-swapped TS"); 1937 /* The way the MP2T dissector handles reassembly (using the 1938 * offsets into the TVB to store per-packet information), it 1939 * needs the entire composite TVB at once rather than be passed 1940 * one TSP at a time. That's why bb_data_len is limited to the 1941 * reported frame length, to avoid throwing an exception running 1942 * off the end before processing the TSPs that are present. 1943 */ 1944 call_dissector(mp2t_handle, tsp_tvb, pinfo, tree); 1945 } 1946 } else { 1947 proto_tree_add_item(tree, hf_dvb_s2_bb_transport, tvb, new_off, bb_data_len, ENC_NA0x00000000); 1948 new_off += bb_data_len; 1949 } 1950 break; 1951 1952 default: 1953 proto_tree_add_item(tree, hf_dvb_s2_bb_reserved, tvb, new_off, bb_data_len, ENC_NA0x00000000); 1954 new_off += bb_data_len; 1955 expert_add_info(pinfo, ti, &ei_dvb_s2_bb_reserved); 1956 break; 1957 } 1958 1959 return new_off; 1960} 1961 1962static int detect_dvb_s2_modeadapt(tvbuff_t *tvb) 1963{ 1964 int matched_headers = 0; 1965 1966 /* Check that there's enough data */ 1967 if (tvb_captured_length(tvb) < DVB_S2_MODEADAPT_MINSIZE(9 + 1)) 1968 return 0; 1969 1970 /* There are four different mode adaptation formats, with different 1971 length headers. Two of them have a sync byte at the beginning, but 1972 the other two do not. In every case, the mode adaptation header is 1973 followed by the baseband header, which is protected by a CRC-8. 1974 The CRC-8 is weak protection, so it can match by accident, leading 1975 to an ambiguity in identifying which format is in use. We will 1976 check for ambiguity and report it. */ 1977 /* Try L.1 format: no header. */ 1978 if (test_dvb_s2_crc(tvb, DVB_S2_MODEADAPT_L1SIZE0)) { 1979 matched_headers |= (1 0) { 2057 dvb_s2_modeadapt_tree = proto_item_add_subtree(ti, ett_dvb_s2_modeadapt); 2058 2059 /* SYNC byte if used in this header format; value has already been checked */ 2060 if (modeadapt_type == DVB_S2_MODEADAPT_TYPE_L22 || 2061 modeadapt_type == DVB_S2_MODEADAPT_TYPE_L33) { 2062 proto_tree_add_item(dvb_s2_modeadapt_tree, hf_dvb_s2_modeadapt_sync, tvb, cur_off, 1, ENC_BIG_ENDIAN0x00000000); 2063 cur_off++; 2064 } 2065 2066 /* ACM byte and subfields if used in this header format */ 2067 if (modeadapt_type == DVB_S2_MODEADAPT_TYPE_L22 || 2068 modeadapt_type == DVB_S2_MODEADAPT_TYPE_L33 || 2069 modeadapt_type == DVB_S2_MODEADAPT_TYPE_L44) { 2070 mc = tvb_get_guint8(tvb, cur_off); 2071 if (mc & 0x80) { 2072 modcod = 0x80; 2073 modcod |= ((mc & 0x1F) > 5); 2075 tf = proto_tree_add_item(dvb_s2_modeadapt_tree, hf_dvb_s2_modeadapt_acm, tvb, 2076 cur_off, 1, ENC_BIG_ENDIAN0x00000000); 2077 2078 dvb_s2_modeadapt_acm_tree = proto_item_add_subtree(tf, ett_dvb_s2_modeadapt_acm); 2079 2080 proto_tree_add_item(dvb_s2_modeadapt_acm_tree, hf_dvb_s2_modeadapt_acm_pilot, tvb, 2081 cur_off, 1, ENC_BIG_ENDIAN0x00000000); 2082 proto_tree_add_uint_format_value(dvb_s2_modeadapt_acm_tree, hf_dvb_s2_modeadapt_acm_modcod_s2x, tvb, 2083 cur_off, 1, mc, "DVBS2X %s(%d)", modeadapt_modcods[modcod].strptr, modcod); 2084 } else { 2085 proto_tree_add_bitmask_with_flags(dvb_s2_modeadapt_tree, tvb, cur_off, hf_dvb_s2_modeadapt_acm, 2086 ett_dvb_s2_modeadapt_acm, modeadapt_acm_bitfields, ENC_BIG_ENDIAN0x00000000, BMT_NO_FLAGS0x00); 2087 } 2088 cur_off++; 2089 } 2090 2091 /* CNI and Frame No if used in this header format */ 2092 if (modeadapt_type == DVB_S2_MODEADAPT_TYPE_L33 || 2093 modeadapt_type == DVB_S2_MODEADAPT_TYPE_L44) { 2094 proto_tree_add_item(dvb_s2_modeadapt_tree, hf_dvb_s2_modeadapt_cni, tvb, cur_off, 1, ENC_BIG_ENDIAN0x00000000); 2095 cur_off++; 2096 2097 proto_tree_add_item(dvb_s2_modeadapt_tree, hf_dvb_s2_modeadapt_frameno, tvb, cur_off, 1, ENC_BIG_ENDIAN0x00000000); 2098 cur_off++; 2099 } 2100 } 2101 2102 /* start DVB-BB dissector */ 2103 cur_off += dissect_dvb_s2_bb(tvb_new_subset_remaining(tvb, cur_off), pinfo, tree, NULL((void*)0)); 2104 2105 return cur_off; 2106} 2107 2108static gboolean dissect_dvb_s2_modeadapt_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U___attribute__((unused))) 2109{ 2110 int matched_headers = detect_dvb_s2_modeadapt(tvb); 2111 if (dvb_s2_try_all_modeadapt) { 2112 if (matched_headers == 0) { 2113 /* This does not look like a DVB-S2-BB frame at all. We are a 2114 heuristic dissector, so we should just punt and let another 2115 dissector have a try at this one. */ 2116 return FALSE(0); 2117 } 2118 } else if (! (matched_headers & (1 0) { 2125 return TRUE(!(0)); 2126 } else { 2127 return FALSE(0); 2128 } 2129} 2130 2131/* Register the protocol with Wireshark */ 2132void proto_register_dvb_s2_modeadapt(void) 2133{ 2134 module_t *dvb_s2_modeadapt_module; 2135 2136 static hf_register_info hf_modeadapt[] = { 2137 {&hf_dvb_s2_modeadapt_sync, { 2138 "Sync Byte", "dvb-s2_modeadapt.sync", 2139 FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, 2140 "Das Sync Byte", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2141 }, 2142 {&hf_dvb_s2_modeadapt_acm, { 2143 "ACM command", "dvb-s2_modeadapt.acmcmd", 2144 FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, 2145 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2146 }, 2147 {&hf_dvb_s2_modeadapt_acm_fecframe, { 2148 "FEC frame size", "dvb-s2_modeadapt.acmcmd.fecframe", 2149 FT_BOOLEAN, 8, TFS(&tfs_modeadapt_fecframe)((0 ? (const struct true_false_string*)0 : ((&tfs_modeadapt_fecframe)))), DVB_S2_MODEADAPT_FECFRAME_MASK0x40, 2150 "FEC", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2151 }, 2152 {&hf_dvb_s2_modeadapt_acm_pilot, { 2153 "Pilots configuration", "dvb-s2_modeadapt.acmcmd.pilots", 2154 FT_BOOLEAN, 8, TFS(&tfs_on_off)((0 ? (const struct true_false_string*)0 : ((&tfs_on_off)))), DVB_S2_MODEADAPT_PILOTS_MASK0x20, 2155 "Pilots", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2156 }, 2157 {&hf_dvb_s2_modeadapt_acm_modcod, { 2158 "Modcod indicator", "dvb-s2_modeadapt.acmcmd.modcod", 2159 FT_UINT8, BASE_DEC|BASE_EXT_STRING0x00000200, &modeadapt_modcods_ext, DVB_S2_MODEADAPT_MODCODS_MASK0x1F, 2160 "Modcod", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2161 }, 2162 {&hf_dvb_s2_modeadapt_acm_modcod_s2x, { 2163 "Modcod indicator", "dvb-s2_modeadapt.acmcmd.modcod", 2164 FT_UINT8, BASE_DEC|BASE_EXT_STRING0x00000200, &modeadapt_modcods_ext, DVB_S2_MODEADAPT_MODCODS_S2X_MASK0xDF, 2165 "Modcod S2X", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2166 }, 2167 {&hf_dvb_s2_modeadapt_cni, { 2168 "Carrier to Noise [dB]", "dvb-s2_modeadapt.cni", 2169 FT_UINT8, BASE_DEC|BASE_EXT_STRING0x00000200, &modeadapt_esno_ext, 0x0, 2170 "CNI", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2171 }, 2172 {&hf_dvb_s2_modeadapt_frameno, { 2173 "Frame number", "dvb-s2_modeadapt.frameno", 2174 FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, 2175 "fno", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2176 } 2177 }; 2178 2179/* Setup protocol subtree array */ 2180 static gint *ett_modeadapt[] = { 2181 &ett_dvb_s2_modeadapt, 2182 &ett_dvb_s2_modeadapt_acm 2183 }; 2184 2185 static hf_register_info hf_bb[] = { 2186 {&hf_dvb_s2_bb_matype1, { 2187 "MATYPE1", "dvb-s2_bb.matype1", 2188 FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, 2189 "MATYPE1 Header Field", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2190 }, 2191 {&hf_dvb_s2_bb_matype1_gs, { 2192 "TS/GS Stream Input", "dvb-s2_bb.matype1.tsgs", 2193 FT_UINT8, BASE_DEC, VALS(bb_tsgs)((0 ? (const struct _value_string*)0 : ((bb_tsgs)))), DVB_S2_BB_TSGS_MASK0xC0, 2194 "Transport Stream Input or Generic Stream Input", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2195 }, 2196 {&hf_dvb_s2_bb_matype1_mis, { 2197 "Input Stream", "dvb-s2_bb.matype1.mis", 2198 FT_BOOLEAN, 8, TFS(&tfs_bb_mis)((0 ? (const struct true_false_string*)0 : ((&tfs_bb_mis)))), DVB_S2_BB_MIS_MASK0x20, 2199 "Single Input Stream or Multiple Input Stream", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2200 }, 2201 {&hf_dvb_s2_bb_matype1_acm, { 2202 "Coding and Modulation", "dvb-s2_bb.matype1.acm", 2203 FT_BOOLEAN, 8, TFS(&tfs_bb_acm)((0 ? (const struct true_false_string*)0 : ((&tfs_bb_acm)))), DVB_S2_BB_ACM_MASK0x10, 2204 "Constant Coding and Modulation or Adaptive Coding and Modulation", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2205 }, 2206 {&hf_dvb_s2_bb_matype1_issyi, { 2207 "ISSYI", "dvb-s2_bb.matype1.issyi", 2208 FT_BOOLEAN, 8, TFS(&tfs_active_inactive)((0 ? (const struct true_false_string*)0 : ((&tfs_active_inactive)))), DVB_S2_BB_ISSYI_MASK0x08, 2209 "Input Stream Synchronization Indicator", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2210 }, 2211 {&hf_dvb_s2_bb_matype1_npd, { 2212 "NPD", "dvb-s2_bb.matype1.npd", 2213 FT_BOOLEAN, 8, TFS(&tfs_active_inactive)((0 ? (const struct true_false_string*)0 : ((&tfs_active_inactive)))), DVB_S2_BB_NPD_MASK0x04, 2214 "Null-packet deletion enabled", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2215 }, 2216 {&hf_dvb_s2_bb_matype1_high_ro, { 2217 "RO", "dvb-s2_bb.matype1.ro", 2218 FT_UINT8, BASE_DEC, VALS(bb_high_ro)((0 ? (const struct _value_string*)0 : ((bb_high_ro)))), DVB_S2_BB_RO_MASK0x03, 2219 "Transmission Roll-off factor", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2220 }, 2221 {&hf_dvb_s2_bb_matype1_low_ro, { 2222 "RO", "dvb-s2_bb.matype1.ro", 2223 FT_UINT8, BASE_DEC, VALS(bb_low_ro)((0 ? (const struct _value_string*)0 : ((bb_low_ro)))), DVB_S2_BB_RO_MASK0x03, 2224 "Transmission Roll-off factor", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2225 }, 2226 {&hf_dvb_s2_bb_matype2, { 2227 "MATYPE2", "dvb-s2_bb.matype2", 2228 FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, 2229 "MATYPE2 Header Field", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2230 }, 2231 {&hf_dvb_s2_bb_upl, { 2232 "UPL", "dvb-s2_bb.upl", 2233 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, 2234 "User Packet Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2235 }, 2236 {&hf_dvb_s2_bb_dfl, { 2237 "DFL", "dvb-s2_bb.dfl", 2238 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, 2239 "Data Field Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2240 }, 2241 {&hf_dvb_s2_bb_sync, { 2242 "SYNC", "dvb-s2_bb.sync", 2243 FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, 2244 "Copy of the User Packet Sync-byte", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2245 }, 2246 {&hf_dvb_s2_bb_syncd, { 2247 "SYNCD", "dvb-s2_bb.syncd", 2248 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, 2249 "Distance to first user packet", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2250 }, 2251 {&hf_dvb_s2_bb_crc, { 2252 "Checksum", "dvb-s2_bb.crc", 2253 FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, 2254 "BB Header CRC-8", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2255 }, 2256 {&hf_dvb_s2_bb_crc_status, { 2257 "Checksum Status", "dvb-s2_bb.crc.status", 2258 FT_UINT8, BASE_NONE, VALS(proto_checksum_vals)((0 ? (const struct _value_string*)0 : ((proto_checksum_vals)))), 0x0, 2259 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2260 }, 2261 {&hf_dvb_s2_bb_packetized, { 2262 "Packetized Generic Stream Data", "dvb-s2_bb.packetized", 2263 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, 2264 "Packetized Generic Stream (non-TS) Data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2265 }, 2266 {&hf_dvb_s2_bb_transport, { 2267 "Transport Stream Data", "dvb-s2_bb.transport", 2268 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, 2269 "Transport Stream (TS) Data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2270 }, 2271 {&hf_dvb_s2_bb_reserved, { 2272 "GSE High Efficiency Mode Data", "dvb-s2_bb.reserved", 2273 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, 2274 "GSE High Efficiency Mode (GSE-HEM) Data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2275 }, 2276 {&hf_dvb_s2_bb_df, { 2277 "BBFrame user data", "dvb-s2_bb.df", 2278 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, 2279 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2280 }, 2281 {&hf_dvb_s2_bb_issy_short, { 2282 "ISSY (short)", "dvb-s2_bb.issy.short", 2283 FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, 2284 "Input stream synchronizer (2 octet version)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2285 }, 2286 {&hf_dvb_s2_bb_issy_long, { 2287 "ISSY (long)", "dvb-s2_bb.issy.long", 2288 FT_UINT24, BASE_HEX, NULL((void*)0), 0x0, 2289 "Input stream synchronizer (3 octet version)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2290 }, 2291 {&hf_dvb_s2_bb_dnp, { 2292 "DNP", "dvb-s2_bb.dnp", 2293 FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, 2294 "Deleted Null-Packets counter", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2295 }, 2296 {&hf_dvb_s2_bb_eip_crc32, { 2297 "EIP CRC32", "dvb-s2_bb.eip_crc32", 2298 FT_UINT32, BASE_HEX, NULL((void*)0), 0x0, 2299 "Explicit Integrity Protection CRC32", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2300 }, 2301 {&hf_dvb_s2_bb_eip_crc32_status, { 2302 "EIP CRC32 Status", "dvb-s2_bb.eip_crc32.status", 2303 FT_UINT8, BASE_NONE, VALS(proto_checksum_vals)((0 ? (const struct _value_string*)0 : ((proto_checksum_vals)))), 0x0, 2304 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2305 }, 2306 {&hf_dvb_s2_bb_up_crc, { 2307 "UP Checksum", "dvb-s2_bb.up.crc", 2308 FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, 2309 "User Packet CRC-8", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2310 }, 2311 {&hf_dvb_s2_bb_up_crc_status, { 2312 "UP Checksum Status", "dvb-s2_bb.up.crc.status", 2313 FT_UINT8, BASE_NONE, VALS(proto_checksum_vals)((0 ? (const struct _value_string*)0 : ((proto_checksum_vals)))), 0x0, 2314 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2315 }, 2316 { &hf_dvbs2_fragment_overlap, 2317 { "Fragment overlap", "dvb-s2_bb.fragment.overlap", FT_BOOLEAN, BASE_NONE, 2318 NULL((void*)0), 0x0, "Fragment overlaps with other fragments", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2319 { &hf_dvbs2_fragment_overlap_conflict, 2320 { "Conflicting data in fragment overlap", "dvb-s2_bb.fragment.overlap.conflict", 2321 FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, 2322 "Overlapping fragments contained conflicting data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2323 { &hf_dvbs2_fragment_multiple_tails, 2324 { "Multiple tail fragments found", "dvb-s2_bb.fragment.multipletails", 2325 FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, 2326 "Several tails were found when defragmenting the packet", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2327 { &hf_dvbs2_fragment_too_long_fragment, 2328 { "Fragment too long", "dvb-s2_bb.fragment.toolongfragment", 2329 FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, 2330 "Fragment contained data past end of packet", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2331 { &hf_dvbs2_fragment_error, 2332 { "Defragmentation error", "dvb-s2_bb.fragment.error", FT_FRAMENUM, BASE_NONE, 2333 NULL((void*)0), 0x0, "Defragmentation error due to illegal fragments", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2334 { &hf_dvbs2_fragment_count, 2335 { "Fragment count", "dvb-s2_bb.fragment.count", FT_UINT32, BASE_DEC, 2336 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2337 { &hf_dvbs2_fragment, 2338 { "DVB-S2 UP Fragment", "dvb-s2_bb.fragment", FT_FRAMENUM, BASE_NONE, 2339 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2340 { &hf_dvbs2_fragments, 2341 { "DVB-S2 UP Fragments", "dvb-s2_bb.fragments", FT_BYTES, BASE_NONE, 2342 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2343 { &hf_dvbs2_reassembled_in, 2344 { "Reassembled DVB-S2 UP in frame", "dvb-s2_bb.reassembled_in", FT_FRAMENUM, BASE_NONE, 2345 NULL((void*)0), 0x0, "This User Packet is reassembled in this frame", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2346 2347 { &hf_dvbs2_reassembled_length, 2348 { "Reassembled DVB-S2 UP length", "dvb-s2_bb.reassembled.length", FT_UINT32, BASE_DEC, 2349 NULL((void*)0), 0x0, "The total length of the reassembled payload", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2350 2351 { &hf_dvbs2_reassembled_data, 2352 { "Reassembled DVB-S2 UP data", "dvb-s2_bb.reassembled.data", FT_BYTES, BASE_NONE, 2353 NULL((void*)0), 0x0, "The reassembled payload", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }} 2354 }; 2355 2356 static gint *ett_bb[] = { 2357 &ett_dvb_s2_bb, 2358 &ett_dvb_s2_bb_matype1, 2359 &ett_dvbs2_fragments, 2360 &ett_dvbs2_fragment, 2361 }; 2362 2363 /* DVB-S2 GSE Frame */ 2364 static hf_register_info hf_gse[] = { 2365 {&hf_dvb_s2_gse_hdr, { 2366 "GSE header", "dvb-s2_gse.hdr", 2367 FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, 2368 "GSE Header (start/stop/length)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2369 }, 2370 {&hf_dvb_s2_gse_hdr_start, { 2371 "Start", "dvb-s2_gse.hdr.start", 2372 FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled)((0 ? (const struct true_false_string*)0 : ((&tfs_enabled_disabled)))), DVB_S2_GSE_HDR_START_MASK0x8000, 2373 "Start Indicator", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2374 }, 2375 {&hf_dvb_s2_gse_hdr_stop, { 2376 "Stop", "dvb-s2_gse.hdr.stop", 2377 FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled)((0 ? (const struct true_false_string*)0 : ((&tfs_enabled_disabled)))), DVB_S2_GSE_HDR_STOP_MASK0x4000, 2378 "Stop Indicator", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2379 }, 2380 {&hf_dvb_s2_gse_hdr_labeltype, { 2381 "Label Type", "dvb-s2_gse.hdr.labeltype", 2382 FT_UINT16, BASE_HEX, VALS(gse_labeltype)((0 ? (const struct _value_string*)0 : ((gse_labeltype)))), DVB_S2_GSE_HDR_LABELTYPE_MASK0x3000, 2383 "Label Type Indicator", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2384 }, 2385 {&hf_dvb_s2_gse_hdr_length, { 2386 "Length", "dvb-s2_gse.hdr.length", 2387 FT_UINT16, BASE_DEC, NULL((void*)0), DVB_S2_GSE_HDR_LENGTH_MASK0x0FFF, 2388 "GSE Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2389 }, 2390 {&hf_dvb_s2_gse_padding, { 2391 "GSE Padding", "dvb-s2_gse.padding", 2392 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, 2393 "GSE Padding Bytes", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2394 }, 2395 {&hf_dvb_s2_gse_proto_next_header, { 2396 "Protocol", "dvb-s2_gse.proto", 2397 FT_UINT16, BASE_HEX, VALS(gse_proto_next_header_str)((0 ? (const struct _value_string*)0 : ((gse_proto_next_header_str)))), 0x0, 2398 "Protocol Type", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2399 }, 2400 {&hf_dvb_s2_gse_proto_ethertype, { 2401 "Protocol", "dvb-s2_gse.proto", 2402 FT_UINT16, BASE_HEX, VALS(etype_vals)((0 ? (const struct _value_string*)0 : ((etype_vals)))), 0x0, 2403 "Protocol Type", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2404 }, 2405 {&hf_dvb_s2_gse_label6, { 2406 "Label", "dvb-s2_gse.label_ether", 2407 FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, 2408 "Label Field", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2409 }, 2410 {&hf_dvb_s2_gse_label3, { 2411 "Label", "dvb-s2_gse.label", 2412 FT_UINT24, BASE_HEX, NULL((void*)0), 0x0, 2413 "Label Field", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2414 }, 2415 {&hf_dvb_s2_gse_fragid, { 2416 "Frag ID", "dvb-s2_gse.fragid", 2417 FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, 2418 "Fragment ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2419 }, 2420 {&hf_dvb_s2_gse_totlength, { 2421 "Total Length", "dvb-s2_gse.totlength", 2422 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, 2423 "GSE Total Frame Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2424 }, 2425 {&hf_dvb_s2_gse_exthdr, { 2426 "Extension Header", "dvb-s2_gse.exthdr", 2427 FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, 2428 "optional Extension Header", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2429 }, 2430 {&hf_dvb_s2_gse_ncr, { 2431 "NCR Packet", "dvb-s2_gse.ncr", 2432 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, 2433 "GSE NCR PAcket", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2434 }, 2435 {&hf_dvb_s2_gse_data, { 2436 "PDU Data", "dvb-s2_gse.data", 2437 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, 2438 "GSE Frame User Data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2439 }, 2440 {&hf_dvb_s2_gse_crc32, { 2441 "CRC", "dvb-s2_gse.crc", 2442 FT_UINT32, BASE_HEX, NULL((void*)0), 0x0, 2443 "CRC-32", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2444 }, 2445 {&hf_dvb_s2_gse_crc32_status, { 2446 "CRC Status", "dvb-s2_gse.crc.status", 2447 FT_UINT8, BASE_NONE, VALS(proto_checksum_vals)((0 ? (const struct _value_string*)0 : ((proto_checksum_vals)))), 0x0, 2448 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} 2449 }, 2450 { &hf_dvb_s2_gse_fragment_overlap, 2451 { "Fragment overlap", "dvb-s2_gse.fragment.overlap", FT_BOOLEAN, BASE_NONE, 2452 NULL((void*)0), 0x0, "Fragment overlaps with other fragments", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2453 2454 { &hf_dvb_s2_gse_fragment_overlap_conflict, 2455 { "Conflicting data in fragment overlap", "dvb-s2_gse.fragment.overlap.conflict", 2456 FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, 2457 "Overlapping fragments contained conflicting data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2458 2459 { &hf_dvb_s2_gse_fragment_multiple_tails, 2460 { "Multiple tail fragments found", "dvb-s2_gse.fragment.multipletails", 2461 FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, 2462 "Several tails were found when defragmenting the packet", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2463 2464 { &hf_dvb_s2_gse_fragment_too_long_fragment, 2465 { "Fragment too long", "dvb-s2_gse.fragment.toolongfragment", 2466 FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, 2467 "Fragment contained data past end of packet", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2468 2469 { &hf_dvb_s2_gse_fragment_error, 2470 { "Defragmentation error", "dvb-s2_gse.fragment.error", FT_FRAMENUM, BASE_NONE, 2471 NULL((void*)0), 0x0, "Defragmentation error due to illegal fragments", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2472 2473 { &hf_dvb_s2_gse_fragment_count, 2474 { "Fragment count", "dvb-s2_gse.fragment.count", FT_UINT32, BASE_DEC, 2475 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2476 2477 { &hf_dvb_s2_gse_fragment, 2478 { "DVB-S2 GSE Fragment", "dvb-s2_gse.fragment", FT_FRAMENUM, BASE_NONE, 2479 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2480 2481 { &hf_dvb_s2_gse_fragments, 2482 { "DVB-S2 GSE Fragments", "dvb-s2_gse.fragments", FT_BYTES, BASE_NONE, 2483 NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2484 2485 { &hf_dvb_s2_gse_reassembled_in, 2486 { "Reassembled DVB-S2 GSE in frame", "dvb-s2_gse.reassembled_in", FT_FRAMENUM, BASE_NONE, 2487 NULL((void*)0), 0x0, "This GSE packet is reassembled in this frame", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2488 2489 { &hf_dvb_s2_gse_reassembled_length, 2490 { "Reassembled DVB-S2 GSE length", "dvb-s2_gse.reassembled.length", FT_UINT32, BASE_DEC, 2491 NULL((void*)0), 0x0, "The total length of the reassembled payload", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, 2492 2493 { &hf_dvb_s2_gse_reassembled_data, 2494 { "Reassembled DVB-S2 GSE data", "dvb-s2_gse.reassembled.data", FT_BYTES, BASE_NONE, 2495 NULL((void*)0), 0x0, "The reassembled payload", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }} 2496 }; 2497 2498 static gint *ett_gse[] = { 2499 &ett_dvb_s2_gse, 2500 &ett_dvb_s2_gse_hdr, 2501 &ett_dvb_s2_gse_ncr, 2502 &ett_dvb_s2_gse_fragments, 2503 &ett_dvb_s2_gse_fragment, 2504 }; 2505 2506 static ei_register_info ei[] = { 2507 { &ei_dvb_s2_bb_crc, { "dvb-s2_bb.bad_checksum", PI_CHECKSUM0x01000000, PI_ERROR0x00800000, "Bad checksum", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}} }}, 2508 { &ei_dvb_s2_bb_issy_invalid, {"dvb-s2_bb.issy_invalid", PI_PROTOCOL0x09000000, PI_WARN0x00600000, "ISSY is active, which is not allowed for GSE packets", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}} }}, 2509 { &ei_dvb_s2_bb_npd_invalid, {"dvb-s2_bb.npd_invalid", PI_PROTOCOL0x09000000, PI_WARN0x00600000, "NPD is active, which is not allowed for GSE packets", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}} }}, 2510 { &ei_dvb_s2_bb_upl_invalid, {"dvb-s2_bb.upl_invalid", PI_PROTOCOL0x09000000, PI_WARN0x00600000, "User Packet Length non-zero, which is not allowed for GSE packets", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}} }}, 2511 { &ei_dvb_s2_bb_dfl_invalid, {"dvb-s2_bb.dfl_invalid", PI_PROTOCOL0x09000000, PI_WARN0x00600000, "Data Field Length greater than reported frame length", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}} }}, 2512 { &ei_dvb_s2_bb_sync_invalid, {"dvb-s2_bb.sync_invalid", PI_PROTOCOL0x09000000, PI_WARN0x00600000, "User Packet Sync-byte not 0x47, which is not allowed for TS packets", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}} }}, 2513 { &ei_dvb_s2_bb_syncd_invalid, {"dvb-s2_bb.syncd_invalid", PI_PROTOCOL0x09000000, PI_WARN0x00600000, "Sync Distance is invalid", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}} }}, 2514 { &ei_dvb_s2_bb_up_reassembly_invalid, {"dvb-s2_bb.up_reassembly_invalid", PI_REASSEMBLE0x06000000, PI_ERROR0x00800000, "Reassembled User Packet has invalid length (dropped or out of order frames)", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}} }}, 2515 { &ei_dvb_s2_bb_reserved, {"dvb-s2_bb.reserved_frame_format", PI_UNDECODED0x05000000, PI_WARN0x00600000, "Dissection of GSE-HEM is not (yet) supported", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}} }}, 2516 { &ei_dvb_s2_bb_header_ambiguous, { "dvb-s2_bb.header_ambiguous", PI_ASSUMPTION0x0d000000, PI_WARN0x00600000, "Mode Adaptation header ambiguous", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}} }}, 2517 }; 2518 2519 expert_module_t* expert_dvb_s2_bb; 2520 2521 static ei_register_info ei_gse[] = { 2522 { &ei_dvb_s2_gse_length_invalid, {"dvb-s2_gse.hdr.length_invalid", PI_PROTOCOL0x09000000, PI_ERROR0x00800000, "Length field in header exceeds available bytes in frame", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}} }}, 2523 { &ei_dvb_s2_gse_totlength_invalid, {"dvb-s2_gse.totlength_invalid", PI_REASSEMBLE0x06000000, PI_ERROR0x00800000, "Length of reassembled packet does not equal total length field (missing fragments?)", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}} }}, 2524 { &ei_dvb_s2_gse_crc32, { "dvb-s2_gse.bad_checksum", PI_CHECKSUM0x01000000, PI_ERROR0x00800000, "Bad checksum", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}} }}, 2525 }; 2526 2527 expert_module_t* expert_dvb_s2_gse; 2528 2529 proto_dvb_s2_modeadapt = proto_register_protocol("DVB-S2 Mode Adaptation Header", "DVB-S2", "dvb-s2_modeadapt"); 2530 2531 proto_dvb_s2_bb = proto_register_protocol("DVB-S2 Baseband Frame", "DVB-S2-BB", "dvb-s2_bb"); 2532 2533 proto_dvb_s2_gse = proto_register_protocol("DVB-S2 GSE Packet", "DVB-S2-GSE", "dvb-s2_gse"); 2534 2535 proto_register_field_array(proto_dvb_s2_modeadapt, hf_modeadapt, array_length(hf_modeadapt)(sizeof hf_modeadapt / sizeof hf_modeadapt[0])); 2536 proto_register_subtree_array(ett_modeadapt, array_length(ett_modeadapt)(sizeof ett_modeadapt / sizeof ett_modeadapt[0])); 2537 2538 proto_register_field_array(proto_dvb_s2_bb, hf_bb, array_length(hf_bb)(sizeof hf_bb / sizeof hf_bb[0])); 2539 proto_register_subtree_array(ett_bb, array_length(ett_bb)(sizeof ett_bb / sizeof ett_bb[0])); 2540 expert_dvb_s2_bb = expert_register_protocol(proto_dvb_s2_bb); 2541 expert_register_field_array(expert_dvb_s2_bb, ei, array_length(ei)(sizeof ei / sizeof ei[0])); 2542 2543 proto_register_field_array(proto_dvb_s2_gse, hf_gse, array_length(hf_gse)(sizeof hf_gse / sizeof hf_gse[0])); 2544 proto_register_subtree_array(ett_gse, array_length(ett_gse)(sizeof ett_gse / sizeof ett_gse[0])); 2545 expert_dvb_s2_gse = expert_register_protocol(proto_dvb_s2_gse); 2546 expert_register_field_array(expert_dvb_s2_gse, ei_gse, array_length(ei_gse)(sizeof ei_gse / sizeof ei_gse[0])); 2547 2548 dvb_s2_modeadapt_module = prefs_register_protocol(proto_dvb_s2_modeadapt, NULL((void*)0)); 2549 2550 prefs_register_obsolete_preference(dvb_s2_modeadapt_module, "enable"); 2551 2552 prefs_register_bool_preference(dvb_s2_modeadapt_module, "decode_df", 2553 "Enable dissection of DATA FIELD", 2554 "Check this to enable full protocol dissection of data above BBHeader", 2555 &dvb_s2_df_dissection); 2556 2557 prefs_register_bool_preference(dvb_s2_modeadapt_module, "full_decode", 2558 "Enable dissection of GSE data", 2559 "Check this to enable full protocol dissection of data above GSE Layer", 2560 &dvb_s2_full_dissection); 2561 2562 prefs_register_enum_preference(dvb_s2_modeadapt_module, "default_modeadapt", 2563 "Preferred Mode Adaptation Interface", 2564 "The preferred Mode Adaptation Interface", 2565 &dvb_s2_default_modeadapt, dvb_s2_modeadapt_enum, FALSE(0)); 2566 2567 prefs_register_bool_preference(dvb_s2_modeadapt_module, "try_all_modeadapt", 2568 "Try all Mode Adaptation Interface Types", 2569 "Try all supported Mode Adaptation Interface Types, using the preferred" 2570 " value in the case of ambiguity; if unset, only look for Base Band" 2571 " Frames with the preferred type", 2572 &dvb_s2_try_all_modeadapt); 2573 2574 prefs_register_obsolete_preference(dvb_s2_modeadapt_module, "dynamic.payload.type"); 2575 2576 register_init_routine(dvb_s2_gse_defragment_init); 2577 register_init_routine(&virtual_stream_init); 2578 2579 virtual_stream_hashtable = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), virtual_stream_hash, virtual_stream_equal); 2580 2581 dvb_s2_modeadapt_handle = register_dissector_with_description("dvb-s2_modeadapt", "DVB-S2 Mode adaptation header", dissect_dvb_s2_modeadapt, proto_dvb_s2_modeadapt); 2582} 2583 2584void proto_reg_handoff_dvb_s2_modeadapt(void) 2585{ 2586 heur_dissector_add("udp", dissect_dvb_s2_modeadapt_heur, "DVB-S2 over UDP", "dvb_s2_udp", proto_dvb_s2_modeadapt, HEURISTIC_DISABLE); 2587 dissector_add_for_decode_as("udp.port", dvb_s2_modeadapt_handle); 2588 ip_handle = find_dissector_add_dependency("ip", proto_dvb_s2_bb); 2589 ipv6_handle = find_dissector_add_dependency("ipv6", proto_dvb_s2_bb); 2590 dvb_s2_table_handle = find_dissector("dvb-s2_table"); 2591 eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); 2592 data_handle = find_dissector("data"); 2593 mp2t_handle = find_dissector_add_dependency("mp2t", proto_dvb_s2_bb); 2594 2595 dissector_add_string("rtp_dyn_payload_type","DVB-S2", dvb_s2_modeadapt_handle); 2596 dissector_add_uint_range_with_preference("rtp.pt", "", dvb_s2_modeadapt_handle); 2597} 2598 2599/* 2600 * Editor modelines - https://www.wireshark.org/tools/modelines.html 2601 * 2602 * Local variables: 2603 * c-basic-offset: 4 2604 * tab-width: 8 2605 * indent-tabs-mode: nil 2606 * End: 2607 * 2608 * vi: set shiftwidth=4 tabstop=8 expandtab: 2609 * :indentSize=4:tabSize=8:noTabs=true: 2610 */


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有