DOCSIS: Simplify all MAC Management into a single file.

Removes a bunch of duplication set up because commands were all in
different files.

Change-Id: I950bc70da0edcdef7aaf21a43328cf69267f79af
Reviewed-on: https://code.wireshark.org/review/21613
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Michael Mann 2017-05-10 07:25:15 -04:00
parent 95ec5329a3
commit 572a2e93f4
49 changed files with 7782 additions and 14306 deletions

View File

@ -26,53 +26,9 @@ set_module_info(docsis 0 0 5 0)
# The sources for the plugin
set(DISSECTOR_SRC
packet-bintrngreq.c
packet-bpkmattr.c
packet-bpkmreq.c
packet-bpkmrsp.c
packet-cmctrlreq.c
packet-cmctrlrsp.c
packet-cmstatus.c
packet-intrngreq.c
packet-dbcreq.c
packet-dbcrsp.c
packet-dbcack.c
packet-dccack.c
packet-dccreq.c
packet-dccrsp.c
packet-dcd.c
packet-dpd.c
packet-dpvreq.c
packet-dpvrsp.c
packet-docsis.c
packet-dsaack.c
packet-dsareq.c
packet-dsarsp.c
packet-dscack.c
packet-dscreq.c
packet-dscrsp.c
packet-dsdreq.c
packet-dsdrsp.c
packet-macmgmt.c
packet-map.c
packet-mdd.c
packet-ocd.c
packet-regack.c
packet-regreq.c
packet-regreqmp.c
packet-regrsp.c
packet-regrspmp.c
packet-rngreq.c
packet-rngrsp.c
packet-sync.c
packet-tlv.c
packet-tlv-cmctrl.c
packet-type29ucd.c
packet-type35ucd.c
packet-type51ucd.c
packet-uccreq.c
packet-uccrsp.c
packet-ucd.c
packet-vendor.c
)

View File

@ -26,53 +26,9 @@ PLUGIN_NAME = docsis
# Non-generated sources to be scanned for registration routines
NONGENERATED_REGISTER_C_FILES = \
packet-bintrngreq.c \
packet-bpkmattr.c \
packet-bpkmreq.c \
packet-bpkmrsp.c \
packet-cmctrlreq.c \
packet-cmctrlrsp.c \
packet-cmstatus.c \
packet-intrngreq.c \
packet-dbcreq.c \
packet-dbcrsp.c \
packet-dbcack.c \
packet-dccack.c \
packet-dccreq.c \
packet-dccrsp.c \
packet-dcd.c \
packet-dpd.c \
packet-dpvreq.c \
packet-dpvrsp.c \
packet-docsis.c \
packet-dsaack.c \
packet-dsareq.c \
packet-dsarsp.c \
packet-dscack.c \
packet-dscreq.c \
packet-dscrsp.c \
packet-dsdreq.c \
packet-dsdrsp.c \
packet-macmgmt.c \
packet-map.c \
packet-mdd.c \
packet-ocd.c \
packet-regack.c \
packet-regreq.c \
packet-regreqmp.c \
packet-regrsp.c \
packet-regrspmp.c \
packet-rngreq.c \
packet-rngrsp.c \
packet-sync.c \
packet-tlv.c \
packet-tlv-cmctrl.c \
packet-type29ucd.c \
packet-type35ucd.c \
packet-type51ucd.c \
packet-uccreq.c \
packet-uccrsp.c \
packet-ucd.c \
packet-vendor.c
# Non-generated sources

View File

@ -1,142 +0,0 @@
/* packet-bintrngreq.c
* Routines for DOCSIS 3.0 Bonded Intial Ranging Request Message dissection.
* Copyright 2009, Geoffrey Kimball <gekimbal[AT]cisco.com>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_bintrngreq(void);
void proto_reg_handoff_docsis_bintrngreq(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_bintrngreq = -1;
static int hf_docsis_bintrngreq_down_chid = -1;
static int hf_docsis_bintrngreq_mddsgid = -1;
static int hf_docsis_bintrngreq_capflags = -1;
static int hf_docsis_bintrngreq_up_chid = -1;
static int hf_docsis_bintrngreq_capflags_frag = -1;
static int hf_docsis_bintrngreq_capflags_encrypt = -1;
/* Initialize the subtree pointers */
static gint ett_docsis_bintrngreq = -1;
static dissector_handle_t docsis_bintrngreq_handle;
/* Dissection */
static int
dissect_bintrngreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *bintrngreq_item;
proto_tree *bintrngreq_tree;
guint16 md_ds_sg_id;
guint16 offset = 0;
md_ds_sg_id = tvb_get_ntohs (tvb, 0);
col_add_fstr (pinfo->cinfo, COL_INFO, "Bonded Ranging Request: MD-DS-SG-ID = %u (0x%X)",
md_ds_sg_id, md_ds_sg_id );
bintrngreq_item = proto_tree_add_item(tree, proto_docsis_bintrngreq, tvb, offset, -1, ENC_NA);
bintrngreq_tree = proto_item_add_subtree (bintrngreq_item, ett_docsis_bintrngreq);
proto_tree_add_item (bintrngreq_tree, hf_docsis_bintrngreq_capflags, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item( bintrngreq_tree, hf_docsis_bintrngreq_capflags_frag, tvb, offset, 1, ENC_BIG_ENDIAN );
proto_tree_add_item( bintrngreq_tree, hf_docsis_bintrngreq_capflags_encrypt, tvb, offset, 1, ENC_BIG_ENDIAN );
offset++;
proto_tree_add_item (bintrngreq_tree, hf_docsis_bintrngreq_mddsgid, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_item (bintrngreq_tree, hf_docsis_bintrngreq_down_chid, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_item (bintrngreq_tree, hf_docsis_bintrngreq_up_chid, tvb, offset, 1, ENC_BIG_ENDIAN);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_bintrngreq (void)
{
static hf_register_info hf[] = {
{&hf_docsis_bintrngreq_capflags,
{"Capability Flags", "docsis_bintrngreq.capflags",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_bintrngreq_capflags_frag,
{"Pre-3.0 Fragmentation", "docsis_bintrngreq.capflags.frag",
FT_BOOLEAN, 8, NULL, (1<<7),
"Pre-3.0 DOCSIS fragmentation is supported prior to registration", HFILL }
},
{&hf_docsis_bintrngreq_capflags_encrypt,
{"Early Auth. & Encrypt", "docsis_bintrngreq.capflags.encrypt",
FT_BOOLEAN, 8, NULL, (1<<6),
"Early Authentication and Encryption supported", HFILL }
},
{&hf_docsis_bintrngreq_mddsgid,
{"MD-DS-SG-ID", "docsis_bintrngreq.mddsgid",
FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
"MAC Domain Downstream Service Group Identifier", HFILL}
},
{&hf_docsis_bintrngreq_down_chid,
{"DS Chan ID", "docsis_bintrngreq.downchid",
FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_bintrngreq_up_chid,
{"US Chan ID", "docsis_bintrngreq.upchid",
FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_bintrngreq,
};
proto_docsis_bintrngreq = proto_register_protocol ("DOCSIS Bonded Initial Ranging Message",
"DOCSIS B-INT-RNG-REQ",
"docsis_bintrngreq");
proto_register_field_array (proto_docsis_bintrngreq, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_bintrngreq_handle = register_dissector ("docsis_bintrngreq", dissect_bintrngreq, proto_docsis_bintrngreq);
}
void
proto_reg_handoff_docsis_bintrngreq (void)
{
dissector_add_uint ("docsis_mgmt", 0x22, docsis_bintrngreq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,574 +0,0 @@
/* packet-bpkmattr.c
* Routines for Baseline Privacy Key Management Attributes dissection
* Copyright 2017, Adrian Simionov <daniel.simionov@gmail.com>
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
/* BPKM Attributes defined in:
* http://www.cablemodem.com/downloads/specs/SP-BPI+_I10-030730.pdf
*/
#define BPKM_RESERVED 0
#define BPKM_SERIAL_NUM 1
#define BPKM_MANUFACTURER_ID 2
#define BPKM_MAC_ADDR 3
#define BPKM_RSA_PUB_KEY 4
#define BPKM_CM_ID 5
#define BPKM_DISPLAY_STR 6
#define BPKM_AUTH_KEY 7
#define BPKM_TEK 8
#define BPKM_KEY_LIFETIME 9
#define BPKM_KEY_SEQ_NUM 10
#define BPKM_HMAC_DIGEST 11
#define BPKM_SAID 12
#define BPKM_TEK_PARAM 13
#define BPKM_OBSOLETED 14
#define BPKM_CBC_IV 15
#define BPKM_ERROR_CODE 16
#define BPKM_CA_CERT 17
#define BPKM_CM_CERT 18
#define BPKM_SEC_CAPABILITIES 19
#define BPKM_CRYPTO_SUITE 20
#define BPKM_CRYPTO_SUITE_LIST 21
#define BPKM_BPI_VERSION 22
#define BPKM_SA_DESCRIPTOR 23
#define BPKM_SA_TYPE 24
#define BPKM_SA_QUERY 25
#define BPKM_SA_QUERY_TYPE 26
#define BPKM_IP_ADDRESS 27
#define BPKM_DNLD_PARAMS 28
#define BPKM_VENDOR_DEFINED 127
void proto_register_docsis_bpkmattr(void);
void proto_reg_handoff_docsis_bpkmattr(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_bpkmattr = -1;
static int hf_docsis_bpkmattr_serial_num = -1;
static int hf_docsis_bpkmattr_manf_id = -1;
static int hf_docsis_bpkmattr_mac_addr = -1;
static int hf_docsis_bpkmattr_rsa_pub_key = -1;
/* static int hf_docsis_bpkmattr_cm_id = -1; */
static int hf_docsis_bpkmattr_display_str = -1;
static int hf_docsis_bpkmattr_auth_key = -1;
static int hf_docsis_bpkmattr_tek = -1;
static int hf_docsis_bpkmattr_key_life = -1;
static int hf_docsis_bpkmattr_key_seq = -1;
static int hf_docsis_bpkmattr_hmac_digest = -1;
static int hf_docsis_bpkmattr_said = -1;
/* static int hf_docsis_bpkmattr_tek_params = -1; */
static int hf_docsis_bpkmattr_cbc_iv = -1;
static int hf_docsis_bpkmattr_error_code = -1;
static int hf_docsis_bpkmattr_vendor_def = -1;
static int hf_docsis_bpkmattr_ca_cert = -1;
static int hf_docsis_bpkmattr_cm_cert = -1;
/* static int hf_docsis_bpkmattr_security_cap = -1; */
static int hf_docsis_bpkmattr_crypto_suite = -1;
static int hf_docsis_bpkmattr_crypto_suite_list = -1;
static int hf_docsis_bpkmattr_bpi_version = -1;
/* static int hf_docsis_bpkmattr_sa_descr = -1; */
static int hf_docsis_bpkmattr_sa_type = -1;
/* static int hf_docsis_bpkmattr_sa_query = -1; */
static int hf_docsis_bpkmattr_sa_query_type = -1;
static int hf_docsis_bpkmattr_ip_address = -1;
/* static int hf_docsis_bpkmattr_download_param = -1; */
/* Initialize the subtree pointers */
static gint ett_docsis_bpkmattr = -1;
static gint ett_docsis_bpkmattr_cmid = -1;
static gint ett_docsis_bpkmattr_scap = -1;
static gint ett_docsis_bpkmattr_tekp = -1;
static gint ett_docsis_bpkmattr_sadsc = -1;
static gint ett_docsis_bpkmattr_saqry = -1;
static gint ett_docsis_bpkmattr_dnld = -1;
static expert_field ei_docsis_bpkmattr_tlvlen_bad = EI_INIT;
static const value_string error_code_vals[] = {
{0, "No Information"},
{1, "Unauthorized CM"},
{2, "Unauthorized SAID"},
{3, "Unsolicited"},
{4, "Invalid Key Sequence Number"},
{5, "Message (Key Request) authentication failure"},
{6, "Permanent Authorization Failure"},
{7, "Not authorized for requested downstream traffic flow"},
{8, "Downstream traffic flow not mapped to SAID"},
{9, "Time of day not acquired"},
{10, "EAE Disabled"},
{0, NULL},
};
static const value_string crypto_suite_attr_vals[] = {
{0x0100, "CBC-Mode 56-bit DES, no data authentication"},
{0x0200, "CBC-Mode 40-bit DES, no data authentication"},
{0x0300, "CBC-Mode 128-bit AES, no data authentication"},
{0, NULL},
};
static const value_string bpi_ver_vals[] = {
{0, "Reserved"},
{1, "BPI+"},
{0, NULL},
};
/* The dissect_attrs() function does the actual work to dissect the
* attributes. It's called recursively, to dissect embedded attributes
*/
static void
dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, proto_item* item)
{
guint8 type;
guint16 length;
int pos = 0;
gint total_len;
proto_tree *cmid_tree, *tekp_tree, *scap_tree;
proto_tree *saqry_tree, *dnld_tree, *sadsc_tree;
proto_item *ti;
tvbuff_t *cmid_tvb, *tekp_tvb, *scap_tvb;
tvbuff_t *saqry_tvb, *dnld_tvb, *sadsc_tvb;
total_len = tvb_reported_length_remaining (tvb, 0);
while (pos < total_len)
{
type = tvb_get_guint8 (tvb, pos++);
length = tvb_get_ntohs (tvb, pos);
pos += 2;
switch (type)
{
case BPKM_RESERVED:
break;
case BPKM_SERIAL_NUM:
proto_tree_add_item (tree, hf_docsis_bpkmattr_serial_num, tvb, pos,
length, ENC_ASCII|ENC_NA);
break;
case BPKM_MANUFACTURER_ID:
if (length == 3)
proto_tree_add_item (tree, hf_docsis_bpkmattr_manf_id, tvb, pos,
length, ENC_NA);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_MAC_ADDR:
if (length == 6)
proto_tree_add_item (tree, hf_docsis_bpkmattr_mac_addr, tvb, pos,
length, ENC_NA);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_RSA_PUB_KEY:
proto_tree_add_item (tree, hf_docsis_bpkmattr_rsa_pub_key, tvb, pos,
length, ENC_NA);
break;
case BPKM_CM_ID:
cmid_tree =
proto_tree_add_subtree(tree, tvb, pos, length,
ett_docsis_bpkmattr_cmid, &ti, "5 CM Identification");
cmid_tvb = tvb_new_subset_length (tvb, pos, length);
dissect_attrs (cmid_tvb, pinfo, cmid_tree, ti);
break;
case BPKM_DISPLAY_STR:
proto_tree_add_item (tree, hf_docsis_bpkmattr_display_str, tvb, pos,
length, ENC_ASCII|ENC_NA);
break;
case BPKM_AUTH_KEY:
if ((length == 96) || (length == 128) || (length == 256))
proto_tree_add_item (tree, hf_docsis_bpkmattr_auth_key, tvb, pos,
length, ENC_NA);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_TEK:
if (length == 8 || length == 16)
proto_tree_add_item (tree, hf_docsis_bpkmattr_tek, tvb, pos,
length, ENC_NA);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_KEY_LIFETIME:
if (length == 4)
proto_tree_add_item (tree, hf_docsis_bpkmattr_key_life, tvb, pos,
length, ENC_BIG_ENDIAN);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_KEY_SEQ_NUM:
if (length == 1)
proto_tree_add_item (tree, hf_docsis_bpkmattr_key_seq, tvb, pos,
length, ENC_BIG_ENDIAN);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_HMAC_DIGEST:
if (length == 20)
proto_tree_add_item (tree, hf_docsis_bpkmattr_hmac_digest, tvb,
pos, length, ENC_NA);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_SAID:
if (length == 2)
proto_tree_add_item (tree, hf_docsis_bpkmattr_said, tvb, pos,
length, ENC_BIG_ENDIAN);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_TEK_PARAM:
tekp_tree =
proto_tree_add_subtree(tree, tvb, pos, length, ett_docsis_bpkmattr_tekp, &ti, "13 TEK Parameters");
tekp_tvb = tvb_new_subset_length (tvb, pos, length);
dissect_attrs (tekp_tvb, pinfo, tekp_tree, ti);
break;
case BPKM_OBSOLETED:
break;
case BPKM_CBC_IV:
if (length == 8 || length == 16)
proto_tree_add_item (tree, hf_docsis_bpkmattr_cbc_iv, tvb, pos,
length, ENC_NA);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_ERROR_CODE:
if (length == 1)
proto_tree_add_item (tree, hf_docsis_bpkmattr_error_code, tvb,
pos, length, ENC_BIG_ENDIAN);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_CA_CERT:
proto_tree_add_item (tree, hf_docsis_bpkmattr_ca_cert, tvb, pos,
length, ENC_NA);
break;
case BPKM_CM_CERT:
proto_tree_add_item (tree, hf_docsis_bpkmattr_cm_cert, tvb, pos,
length, ENC_NA);
break;
case BPKM_SEC_CAPABILITIES:
scap_tree =
proto_tree_add_subtree(tree, tvb, pos, length,
ett_docsis_bpkmattr_scap, &ti, "19 Security Capabilities");
scap_tvb = tvb_new_subset_length (tvb, pos, length);
dissect_attrs (scap_tvb, pinfo, scap_tree, ti);
break;
case BPKM_CRYPTO_SUITE:
if (length == 2)
proto_tree_add_item (tree, hf_docsis_bpkmattr_crypto_suite, tvb,
pos, length, ENC_BIG_ENDIAN);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_CRYPTO_SUITE_LIST:
proto_tree_add_item (tree, hf_docsis_bpkmattr_crypto_suite_list,
tvb, pos, length, ENC_NA);
break;
case BPKM_BPI_VERSION:
if (length == 1)
proto_tree_add_item (tree, hf_docsis_bpkmattr_bpi_version, tvb,
pos, length, ENC_BIG_ENDIAN);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_SA_DESCRIPTOR:
sadsc_tree =
proto_tree_add_subtree(tree, tvb, pos, length, ett_docsis_bpkmattr_sadsc, &ti, "23 SA Descriptor");
sadsc_tvb = tvb_new_subset_length (tvb, pos, length);
dissect_attrs (sadsc_tvb, pinfo, sadsc_tree, ti);
break;
case BPKM_SA_TYPE:
if (length == 1)
proto_tree_add_item (tree, hf_docsis_bpkmattr_sa_type, tvb, pos,
length, ENC_BIG_ENDIAN);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_SA_QUERY:
saqry_tree =
proto_tree_add_subtree(tree, tvb, pos, length, ett_docsis_bpkmattr_saqry, &ti, "25 SA Query");
saqry_tvb = tvb_new_subset_length (tvb, pos, length);
dissect_attrs (saqry_tvb, pinfo, saqry_tree, ti);
break;
case BPKM_SA_QUERY_TYPE:
if (length == 1)
proto_tree_add_item (tree, hf_docsis_bpkmattr_sa_query_type, tvb,
pos, length, ENC_BIG_ENDIAN);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_IP_ADDRESS:
if (length == 4)
proto_tree_add_item (tree, hf_docsis_bpkmattr_ip_address, tvb,
pos, length, ENC_BIG_ENDIAN);
else
expert_add_info_format(pinfo, item, &ei_docsis_bpkmattr_tlvlen_bad, "Wrong TLV length: %u", length);
break;
case BPKM_VENDOR_DEFINED:
proto_tree_add_item (tree, hf_docsis_bpkmattr_vendor_def, tvb, pos,
length, ENC_NA);
break;
case BPKM_DNLD_PARAMS:
dnld_tree =
proto_tree_add_subtree(tree, tvb, pos, length,
ett_docsis_bpkmattr_dnld, &ti, "28 Download Parameters");
dnld_tvb = tvb_new_subset_length (tvb, pos, length);
dissect_attrs (dnld_tvb, pinfo, dnld_tree, ti);
break;
default:
proto_tree_add_item (tree, hf_docsis_bpkmattr_vendor_def, tvb, pos,
length, ENC_NA);
break;
}
pos += length; /* switch */
} /* while */
}
static int
dissect_bpkmattr (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *bpkmattr_tree;
it = proto_tree_add_protocol_format (tree, proto_docsis_bpkmattr, tvb, 0, -1,
"BPKM Attributes");
bpkmattr_tree = proto_item_add_subtree (it, ett_docsis_bpkmattr);
dissect_attrs (tvb, pinfo, bpkmattr_tree, it);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_bpkmattr (void)
{
static hf_register_info hf[] = {
{&hf_docsis_bpkmattr_serial_num,
{"1 Serial Number", "docsis_bpkmattr.serialnum",
FT_STRING, BASE_NONE, NULL, 0x0,
"Serial Number", HFILL}
},
{&hf_docsis_bpkmattr_manf_id,
{"2 Manufacturer Id", "docsis_bpkmattr.manfid",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Manufacturer Id", HFILL}
},
{&hf_docsis_bpkmattr_mac_addr,
{"3 Mac Address", "docsis_bpkmattr.macaddr",
FT_ETHER, BASE_NONE, NULL, 0x0,
"Mac Address", HFILL}
},
{&hf_docsis_bpkmattr_rsa_pub_key,
{"4 RSA Public Key", "docsis_bpkmattr.rsa_pub_key",
FT_BYTES, BASE_NONE, NULL, 0x0,
"RSA Public Key", HFILL}
},
#if 0
{&hf_docsis_bpkmattr_cm_id,
{"5 CM Identification", "docsis_bpkmattr.cmid",
FT_BYTES, BASE_NONE, NULL, 0x0,
"CM Identification", HFILL}
},
#endif
{&hf_docsis_bpkmattr_display_str,
{"6 Display String", "docsis_bpkmattr.dispstr",
FT_STRING, BASE_NONE, NULL, 0x0,
"Display String", HFILL}
},
{&hf_docsis_bpkmattr_auth_key,
{"7 Auth Key", "docsis_bpkmattr.auth_key",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Auth Key", HFILL}
},
{&hf_docsis_bpkmattr_tek,
{"8 Traffic Encryption Key", "docsis_bpkmattr.tek",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Traffic Encryption Key", HFILL}
},
{&hf_docsis_bpkmattr_key_life,
{"9 Key Lifetime (s)", "docsis_bpkmattr.keylife",
FT_UINT32, BASE_DEC, NULL, 0x0,
"Key Lifetime (s)", HFILL}
},
{&hf_docsis_bpkmattr_key_seq,
{"10 Key Sequence Number", "docsis_bpkmattr.keyseq",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Key Sequence Number", HFILL}
},
{&hf_docsis_bpkmattr_hmac_digest,
{"11 HMAC Digest", "docsis_bpkmattr.hmacdigest",
FT_BYTES, BASE_NONE, NULL, 0x0,
"HMAC Digest", HFILL}
},
{&hf_docsis_bpkmattr_said,
{"12 SAID", "docsis_bpkmattr.said",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Security Association ID", HFILL}
},
#if 0
{&hf_docsis_bpkmattr_tek_params,
{"13 TEK Parameters", "docsis_bpkmattr.tekparams",
FT_BYTES, BASE_NONE, NULL, 0x0,
"TEK Parameters", HFILL}
},
#endif
{&hf_docsis_bpkmattr_cbc_iv,
{"15 CBC IV", "docsis_bpkmattr.cbciv",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Cypher Block Chaining", HFILL}
},
{&hf_docsis_bpkmattr_error_code,
{"16 Error Code", "docsis_bpkmattr.errcode",
FT_UINT8, BASE_DEC, VALS (error_code_vals), 0x0,
"Error Code", HFILL}
},
{&hf_docsis_bpkmattr_vendor_def,
{"127 Vendor Defined", "docsis_bpkmattr.vendordef",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Vendor Defined", HFILL}
},
{&hf_docsis_bpkmattr_ca_cert,
{"17 CA Certificate", "docsis_bpkmattr.cacert",
FT_BYTES, BASE_NONE, NULL, 0x0,
"CA Certificate", HFILL}
},
{&hf_docsis_bpkmattr_cm_cert,
{"18 CM Certificate", "docsis_bpkmattr.cmcert",
FT_BYTES, BASE_NONE, NULL, 0x0,
"CM Certificate", HFILL}
},
#if 0
{&hf_docsis_bpkmattr_security_cap,
{"19 Security Capabilities", "docsis_bpkmattr.seccap",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Security Capabilities", HFILL}
},
#endif
{&hf_docsis_bpkmattr_crypto_suite,
{"20 Cryptographic Suite", "docsis_bpkmattr.cryptosuite",
FT_UINT16, BASE_HEX, VALS(crypto_suite_attr_vals), 0x0,
"Cryptographic Suite", HFILL}
},
{&hf_docsis_bpkmattr_crypto_suite_list,
{"21 Cryptographic Suite List", "docsis_bpkmattr.crypto_suite_lst",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Cryptographic Suite", HFILL}
},
{&hf_docsis_bpkmattr_bpi_version,
{"22 BPI Version", "docsis_bpkmattr.bpiver",
FT_UINT8, BASE_DEC, VALS (bpi_ver_vals), 0x0,
"BPKM Attributes", HFILL}
},
#if 0
{&hf_docsis_bpkmattr_sa_descr,
{"23 SA Descriptor", "docsis_bpkmattr.sadescr",
FT_BYTES, BASE_NONE, NULL, 0x0,
"SA Descriptor", HFILL}
},
#endif
{&hf_docsis_bpkmattr_sa_type,
{"24 SA Type", "docsis_bpkmattr.satype",
FT_UINT8, BASE_DEC, NULL, 0x0,
"SA Type", HFILL}
},
#if 0
{&hf_docsis_bpkmattr_sa_query,
{"25 SA Query", "docsis_bpkmattr.saquery",
FT_BYTES, BASE_NONE, NULL, 0x0,
"SA Query", HFILL}
},
#endif
{&hf_docsis_bpkmattr_sa_query_type,
{"26 SA Query Type", "docsis_bpkmattr.saquery_type",
FT_UINT8, BASE_HEX, NULL, 0x0,
"SA Query Type", HFILL}
},
{&hf_docsis_bpkmattr_ip_address,
{"27 IP Address", "docsis_bpkmattr.ipaddr",
FT_IPv4, BASE_NONE, NULL, 0x0,
"IP Address", HFILL}
},
#if 0
{&hf_docsis_bpkmattr_download_param,
{"28 Download Parameters", "docsis_bpkmattr.dnld_params",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Download Parameters", HFILL}
},
#endif
};
static gint *ett[] = {
&ett_docsis_bpkmattr,
&ett_docsis_bpkmattr_cmid,
&ett_docsis_bpkmattr_scap,
&ett_docsis_bpkmattr_tekp,
&ett_docsis_bpkmattr_sadsc,
&ett_docsis_bpkmattr_saqry,
&ett_docsis_bpkmattr_dnld
};
static ei_register_info ei[] = {
{&ei_docsis_bpkmattr_tlvlen_bad, { "docsis_bpkmattr.tlvlenbad", PI_MALFORMED, PI_ERROR, "Bad TLV length", EXPFILL}},
};
expert_module_t* expert_docsis_bpkmattr;
proto_docsis_bpkmattr =
proto_register_protocol
("DOCSIS Baseline Privacy Key Management Attributes", "DOCSIS BPKM-ATTR",
"docsis_bpkmattr");
proto_register_field_array (proto_docsis_bpkmattr, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
expert_docsis_bpkmattr = expert_register_protocol(proto_docsis_bpkmattr);
expert_register_field_array(expert_docsis_bpkmattr, ei, array_length(ei));
register_dissector ("docsis_bpkmattr", dissect_bpkmattr,
proto_docsis_bpkmattr);
}
void
proto_reg_handoff_docsis_bpkmattr (void)
{
#if 0
dissector_handle_t docsis_bpkmattr_handle;
docsis_bpkmattr_handle = find_dissector ("docsis_bpkmattr");
dissector_add_uint ("docsis", 0xFE, docsis_bpkmattr_handle);
#endif
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,144 +0,0 @@
/* packet-bpkmreq.c
* Routines for Baseline Privacy Key Management Request dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_bpkmreq(void);
void proto_reg_handoff_docsis_bpkmreq(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_bpkmreq = -1;
static int hf_docsis_bpkmreq_code = -1;
static int hf_docsis_bpkmreq_length = -1;
static int hf_docsis_bpkmreq_ident = -1;
static const value_string code_field_vals[] = {
{ 0, "Reserved"},
{ 1, "Reserved"},
{ 2, "Reserved"},
{ 3, "Reserved"},
{ 4, "Auth Request"},
{ 5, "Auth Reply"},
{ 6, "Auth Reject"},
{ 7, "Key Request"},
{ 8, "Key Reply"},
{ 9, "Key Reject"},
{10, "Auth Invalid"},
{11, "TEK Invalid"},
{12, "Authent Info"},
{13, "Map Request"},
{14, "Map Reply"},
{15, "Map Reject"},
{0, NULL},
};
/* Initialize the subtree pointers */
static gint ett_docsis_bpkmreq = -1;
static dissector_handle_t attrs_handle;
static dissector_handle_t docsis_bpkmreq_handle;
/* Dissection */
static int
dissect_bpkmreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *bpkmreq_tree;
guint32 code;
tvbuff_t *attrs_tvb;
it = proto_tree_add_item(tree, proto_docsis_bpkmreq, tvb, 0, -1, ENC_NA);
bpkmreq_tree = proto_item_add_subtree (it, ett_docsis_bpkmreq);
proto_tree_add_item_ret_uint (bpkmreq_tree, hf_docsis_bpkmreq_code, tvb, 0, 1,
ENC_BIG_ENDIAN, &code);
col_add_fstr (pinfo->cinfo, COL_INFO, "BPKM Request (%s)",
val_to_str (code, code_field_vals, "%d"));
proto_tree_add_item (bpkmreq_tree, hf_docsis_bpkmreq_ident, tvb, 1, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (bpkmreq_tree, hf_docsis_bpkmreq_length, tvb, 2, 2, ENC_BIG_ENDIAN);
attrs_tvb = tvb_new_subset_remaining (tvb, 4);
call_dissector (attrs_handle, attrs_tvb, pinfo, tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_bpkmreq (void)
{
static hf_register_info hf[] = {
{&hf_docsis_bpkmreq_code,
{"BPKM Code", "docsis_bpkmreq.code",
FT_UINT8, BASE_DEC, VALS (code_field_vals), 0x0,
"BPKM Request Message", HFILL}
},
{&hf_docsis_bpkmreq_ident,
{"BPKM Identifier", "docsis_bpkmreq.ident",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_bpkmreq_length,
{"BPKM Length", "docsis_bpkmreq.length",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_bpkmreq,
};
proto_docsis_bpkmreq =
proto_register_protocol ("DOCSIS Baseline Privacy Key Management Request",
"DOCSIS BPKM-REQ", "docsis_bpkmreq");
proto_register_field_array (proto_docsis_bpkmreq, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_bpkmreq_handle = register_dissector ("docsis_bpkmreq", dissect_bpkmreq,
proto_docsis_bpkmreq);
}
void
proto_reg_handoff_docsis_bpkmreq (void)
{
attrs_handle = find_dissector ("docsis_bpkmattr");
dissector_add_uint ("docsis_mgmt", 0x0C, docsis_bpkmreq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,145 +0,0 @@
/* packet-bpkmrsp.c
* Routines for Baseline Privacy Key Management Response dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_bpkmrsp(void);
void proto_reg_handoff_docsis_bpkmrsp(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_bpkmrsp = -1;
static int hf_docsis_bpkmrsp_code = -1;
static int hf_docsis_bpkmrsp_length = -1;
static int hf_docsis_bpkmrsp_ident = -1;
static const value_string code_field_vals[] = {
{ 0, "Reserved"},
{ 1, "Reserved"},
{ 2, "Reserved"},
{ 3, "Reserved"},
{ 4, "Auth Response"},
{ 5, "Auth Reply"},
{ 6, "Auth Reject"},
{ 7, "Key Response"},
{ 8, "Key Reply"},
{ 9, "Key Reject"},
{10, "Auth Invalid"},
{11, "TEK Invalid"},
{12, "Authent Info"},
{13, "Map Response"},
{14, "Map Reply"},
{15, "Map Reject"},
{0, NULL},
};
/* Initialize the subtree pointers */
static gint ett_docsis_bpkmrsp = -1;
static dissector_handle_t attrs_handle;
static dissector_handle_t docsis_bpkmrsp_handle;
/* Dissection */
static int
dissect_bpkmrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *bpkmrsp_tree;
guint32 code;
tvbuff_t *attrs_tvb;
it = proto_tree_add_item(tree, proto_docsis_bpkmrsp, tvb, 0, -1, ENC_NA);
bpkmrsp_tree = proto_item_add_subtree (it, ett_docsis_bpkmrsp);
proto_tree_add_item_ret_uint (bpkmrsp_tree, hf_docsis_bpkmrsp_code, tvb, 0, 1, ENC_BIG_ENDIAN, &code);
col_add_fstr (pinfo->cinfo, COL_INFO, "BPKM Response (%s)",
val_to_str (code, code_field_vals, "Unknown code %u"));
proto_tree_add_item (bpkmrsp_tree, hf_docsis_bpkmrsp_ident, tvb, 1, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (bpkmrsp_tree, hf_docsis_bpkmrsp_length, tvb, 2, 2, ENC_BIG_ENDIAN);
/* Code to Call subdissector */
attrs_tvb = tvb_new_subset_remaining (tvb, 4);
call_dissector (attrs_handle, attrs_tvb, pinfo, tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_bpkmrsp (void)
{
static hf_register_info hf[] = {
{&hf_docsis_bpkmrsp_code,
{"BPKM Code", "docsis_bpkmrsp.code",
FT_UINT8, BASE_DEC, VALS (code_field_vals), 0x0,
"BPKM Response Message", HFILL}
},
{&hf_docsis_bpkmrsp_ident,
{"BPKM Identifier", "docsis_bpkmrsp.ident",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_bpkmrsp_length,
{"BPKM Length", "docsis_bpkmrsp.length",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_bpkmrsp,
};
proto_docsis_bpkmrsp =
proto_register_protocol
("DOCSIS Baseline Privacy Key Management Response", "DOCSIS BPKM-RSP",
"docsis_bpkmrsp");
proto_register_field_array (proto_docsis_bpkmrsp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_bpkmrsp_handle = register_dissector ("docsis_bpkmrsp", dissect_bpkmrsp,
proto_docsis_bpkmrsp);
}
void
proto_reg_handoff_docsis_bpkmrsp (void)
{
attrs_handle = find_dissector ("docsis_bpkmattr");
dissector_add_uint ("docsis_mgmt", 0x0D, docsis_bpkmrsp_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,107 +0,0 @@
/* packet-cmctrlreq.c
* Routines for DOCSIS 3.0 CM Control Request Message dissection.
* Copyright 2010, Guido Reismueller <g.reismueller[AT]avm.de>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_cmctrlreq(void);
void proto_reg_handoff_docsis_cmctrlreq(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_cmctrlreq = -1;
static int hf_docsis_cmctrlreq_tranid = -1;
static dissector_handle_t cmctrl_tlv_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_cmctrlreq = -1;
static dissector_handle_t docsis_cmctrlreq_handle;
/* Dissection */
static int
dissect_cmctrlreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *cmctrlreq_tree;
guint32 transid;
tvbuff_t *next_tvb;
it = proto_tree_add_item (tree, proto_docsis_cmctrlreq, tvb, 0, -1, ENC_NA);
cmctrlreq_tree = proto_item_add_subtree (it, ett_docsis_cmctrlreq);
proto_tree_add_item_ret_uint (cmctrlreq_tree, hf_docsis_cmctrlreq_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid);
col_add_fstr (pinfo->cinfo, COL_INFO,
"CM Control Request: Transaction-Id = %u", transid);
/* Call Dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 2);
call_dissector (cmctrl_tlv_handle, next_tvb, pinfo, cmctrlreq_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_cmctrlreq (void)
{
static hf_register_info hf[] = {
{&hf_docsis_cmctrlreq_tranid,
{"Transaction Id", "docsis_cmctrlreq.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_cmctrlreq,
};
proto_docsis_cmctrlreq =
proto_register_protocol ("DOCSIS CM Control Request",
"DOCSIS CM-CTRL-REQ", "docsis_cmctrlreq");
proto_register_field_array (proto_docsis_cmctrlreq, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_cmctrlreq_handle = register_dissector ("docsis_cmctrlreq", dissect_cmctrlreq, proto_docsis_cmctrlreq);
}
void
proto_reg_handoff_docsis_cmctrlreq (void)
{
cmctrl_tlv_handle = find_dissector ("cmctrl_tlv");
dissector_add_uint ("docsis_mgmt", 0x2A, docsis_cmctrlreq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,115 +0,0 @@
/* packet-cmctrlrsp.c
* Routines for DOCSIS 3.0 CM Control Response Message dissection.
* Copyright 2010, Guido Reismueller <g.reismueller[AT]avm.de>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#define RNGRSP_TIMING 1
#define RNGRSP_PWR_LEVEL_ADJ 2
#define RNGRSP_OFFSET_FREQ_ADJ 3
#define RNGRSP_TRANSMIT_EQ_ADJ 4
#define RNGRSP_RANGING_STATUS 5
#define RNGRSP_DOWN_FREQ_OVER 6
#define RNGRSP_UP_CHID_OVER 7
void proto_register_docsis_cmctrlrsp(void);
void proto_reg_handoff_docsis_cmctrlrsp(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_cmctrlrsp = -1;
static int hf_docsis_cmctrlrsp_tranid = -1;
static dissector_handle_t cmctrl_tlv_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_cmctrlrsp = -1;
static dissector_handle_t docsis_cmctrlrsp_handle;
/* Dissection */
static int
dissect_cmctrlrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *cmctrlrsp_tree;
guint32 transid;
tvbuff_t *next_tvb;
it = proto_tree_add_item(tree, proto_docsis_cmctrlrsp, tvb, 0, -1, ENC_NA);
cmctrlrsp_tree = proto_item_add_subtree (it, ett_docsis_cmctrlrsp);
proto_tree_add_item_ret_uint (cmctrlrsp_tree, hf_docsis_cmctrlrsp_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid);
col_add_fstr (pinfo->cinfo, COL_INFO,
"CM Control Response: Transaction-Id = %u", transid);
/* Call Dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 2);
call_dissector (cmctrl_tlv_handle, next_tvb, pinfo, cmctrlrsp_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_cmctrlrsp (void)
{
static hf_register_info hf[] = {
{&hf_docsis_cmctrlrsp_tranid,
{"Transaction Id", "docsis_cmctrlrsp.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_cmctrlrsp,
};
proto_docsis_cmctrlrsp =
proto_register_protocol ("DOCSIS CM Control Response",
"DOCSIS CM-CTRL-RSP", "docsis_cmctrlrsp");
proto_register_field_array (proto_docsis_cmctrlrsp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_cmctrlrsp_handle = register_dissector ("docsis_cmctrlrsp", dissect_cmctrlrsp, proto_docsis_cmctrlrsp);
}
void
proto_reg_handoff_docsis_cmctrlrsp (void)
{
cmctrl_tlv_handle = find_dissector ("cmctrl_tlv");
dissector_add_uint ("docsis_mgmt", 0x2B, docsis_cmctrlrsp_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,330 +0,0 @@
/* packet-cmstatus.c
* Routines for DOCSIS 3.0 CM-STATUS Report Message dissection.
* Copyright 2011, Hendrik Robbel <hendrik.robbel[AT]kabeldeutschland.de>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#define SEC_CH_MDD_TIMEOUT 1
#define QAM_FEC_LOCK_FAILURE 2
#define SEQ_OUT_OF_RANGE 3
#define SEC_CH_MDD_RECOVERY 4
#define QAM_FEC_LOCK_RECOVERY 5
#define T4_TIMEOUT 6
#define T3_RETRIES_EXCEEDED 7
#define SUCCESS_RANGING_AFTER_T3_RETRIES_EXCEEDED 8
#define CM_ON_BATTERY 9
#define CM_ON_AC_POWER 10
#define EVENT_DESCR 2
#define EVENT_DS_CH_ID 4
#define EVENT_US_CH_ID 5
#define EVENT_DSID 6
static const value_string cmstatus_tlv_vals[] = {
{EVENT_DS_CH_ID, "Downstream Channel ID"},
{EVENT_US_CH_ID, "Upstream Channel ID"},
{EVENT_DSID, "DSID"},
{EVENT_DESCR, "Description"},
{0, NULL}
};
void proto_register_docsis_cmstatus(void);
void proto_reg_handoff_docsis_cmstatus(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_cmstatus = -1;
static int hf_docsis_cmstatus_tranid = -1;
static int hf_docsis_cmstatus_e_t_mdd_t = -1;
static int hf_docsis_cmstatus_e_t_qfl_f = -1;
static int hf_docsis_cmstatus_e_t_s_o = -1;
static int hf_docsis_cmstatus_e_t_mdd_r = -1;
static int hf_docsis_cmstatus_e_t_qfl_r = -1;
static int hf_docsis_cmstatus_e_t_t4_t = -1;
static int hf_docsis_cmstatus_e_t_t3_e = -1;
static int hf_docsis_cmstatus_e_t_rng_s = -1;
static int hf_docsis_cmstatus_e_t_cm_b = -1;
static int hf_docsis_cmstatus_e_t_cm_a = -1;
static int hf_docsis_cmstatus_ds_ch_id = -1;
static int hf_docsis_cmstatus_us_ch_id = -1;
static int hf_docsis_cmstatus_dsid = -1;
static int hf_docsis_cmstatus_descr = -1;
static int hf_docsis_cmstatus_tlv_data = -1;
static int hf_docsis_cmstatus_type = -1;
static int hf_docsis_cmstatus_length = -1;
/* Initialize the subtree pointers */
static gint ett_docsis_cmstatus = -1;
static gint ett_docsis_cmstatus_tlv = -1;
static gint ett_docsis_cmstatus_tlvtlv = -1;
static expert_field ei_docsis_cmstatus_tlvlen_bad = EI_INIT;
static dissector_handle_t docsis_cmstatus_handle;
/* Dissection */
/* See Table 6-52 in CM-SP-MULPIv3.0-I14-101008 */
static void
dissect_cmstatus_tlv (tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree)
{
proto_item *it, *tlv_item, *tlv_len_item;
proto_tree *tlv_tree;
guint16 pos = 0;
guint8 type;
guint32 length;
it = proto_tree_add_item(tree, hf_docsis_cmstatus_tlv_data, tvb, 0, tvb_reported_length(tvb), ENC_NA);
tlv_tree = proto_item_add_subtree (it, ett_docsis_cmstatus_tlv);
while (tvb_reported_length_remaining(tvb, pos) > 0)
{
type = tvb_get_guint8 (tvb, pos);
tlv_tree = proto_tree_add_subtree(tlv_tree, tvb, pos, -1,
ett_docsis_cmstatus_tlvtlv, &tlv_item,
val_to_str(type, cmstatus_tlv_vals,
"Unknown TLV (%u)"));
proto_tree_add_uint (tlv_tree, hf_docsis_cmstatus_type, tvb, pos, 1, type);
pos++;
tlv_len_item = proto_tree_add_item_ret_uint (tlv_tree, hf_docsis_cmstatus_length, tvb, pos, 1, ENC_NA, &length);
pos++;
proto_item_set_len(tlv_item, length + 2);
switch (type)
{
case EVENT_DS_CH_ID:
if (length == 3)
{
proto_tree_add_item (tlv_tree, hf_docsis_cmstatus_ds_ch_id, tvb, pos + 1, 1, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_cmstatus_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case EVENT_US_CH_ID:
if (length == 3)
{
proto_tree_add_item (tlv_tree, hf_docsis_cmstatus_us_ch_id, tvb, pos + 1, 1, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_cmstatus_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case EVENT_DSID:
if (length == 5)
{
proto_tree_add_item (tlv_tree, hf_docsis_cmstatus_dsid, tvb, pos + 1, 3, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_cmstatus_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case EVENT_DESCR:
if (length >= 3 && length <= 82)
{
proto_tree_add_item (tlv_tree, hf_docsis_cmstatus_descr, tvb, pos + 1, length - 2, ENC_NA);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_cmstatus_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
} /* switch */
pos += length;
} /* while */
}
static int
dissect_cmstatus (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *cmstatus_tree = NULL;
guint32 transid;
guint8 event_type;
tvbuff_t* next_tvb;
it = proto_tree_add_protocol_format (tree, proto_docsis_cmstatus, tvb, 0, -1, "CM-STATUS Report");
cmstatus_tree = proto_item_add_subtree (it, ett_docsis_cmstatus);
proto_tree_add_item_ret_uint (cmstatus_tree, hf_docsis_cmstatus_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid);
col_add_fstr (pinfo->cinfo, COL_INFO, "CM-STATUS Report: Transaction ID = %u", transid);
event_type = tvb_get_guint8 (tvb, 2);
switch (event_type)
{
case SEC_CH_MDD_TIMEOUT:
proto_tree_add_item (cmstatus_tree, hf_docsis_cmstatus_e_t_mdd_t, tvb, 2, 1, ENC_BIG_ENDIAN);
break;
case QAM_FEC_LOCK_FAILURE:
proto_tree_add_item (cmstatus_tree, hf_docsis_cmstatus_e_t_qfl_f, tvb, 2, 1, ENC_BIG_ENDIAN);
break;
case SEQ_OUT_OF_RANGE:
proto_tree_add_item (cmstatus_tree, hf_docsis_cmstatus_e_t_s_o, tvb, 2, 1, ENC_BIG_ENDIAN);
break;
case SEC_CH_MDD_RECOVERY:
proto_tree_add_item (cmstatus_tree, hf_docsis_cmstatus_e_t_mdd_r, tvb, 2, 1, ENC_BIG_ENDIAN);
break;
case QAM_FEC_LOCK_RECOVERY:
proto_tree_add_item (cmstatus_tree, hf_docsis_cmstatus_e_t_qfl_r, tvb, 2, 1, ENC_BIG_ENDIAN);
break;
case T4_TIMEOUT:
proto_tree_add_item (cmstatus_tree, hf_docsis_cmstatus_e_t_t4_t, tvb, 2, 1, ENC_BIG_ENDIAN);
break;
case T3_RETRIES_EXCEEDED:
proto_tree_add_item (cmstatus_tree, hf_docsis_cmstatus_e_t_t3_e, tvb, 2, 1, ENC_BIG_ENDIAN);
break;
case SUCCESS_RANGING_AFTER_T3_RETRIES_EXCEEDED:
proto_tree_add_item (cmstatus_tree, hf_docsis_cmstatus_e_t_rng_s, tvb, 2, 1, ENC_BIG_ENDIAN);
break;
case CM_ON_BATTERY:
proto_tree_add_item (cmstatus_tree, hf_docsis_cmstatus_e_t_cm_b, tvb, 2, 1, ENC_BIG_ENDIAN);
break;
case CM_ON_AC_POWER:
proto_tree_add_item (cmstatus_tree, hf_docsis_cmstatus_e_t_cm_a, tvb, 2, 1, ENC_BIG_ENDIAN);
break;
} /* switch */
/* Call Dissector TLV's */
next_tvb = tvb_new_subset_remaining(tvb, 3);
dissect_cmstatus_tlv(next_tvb, pinfo, cmstatus_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_cmstatus (void)
{
static hf_register_info hf[] = {
{&hf_docsis_cmstatus_tranid,
{"Transaction ID", "docsis_cmstatus.tranid",FT_UINT16, BASE_DEC, NULL, 0x0,NULL, HFILL}
},
/* See Table 10-3 in CM-SP-MULPIv3.0-I14-101008 */
{&hf_docsis_cmstatus_e_t_mdd_t,
{"Secondary Channel MDD timeout", "docsis_cmstatus.mdd_timeout", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_e_t_qfl_f,
{"QAM/FEC lock failure", "docsis_cmstatus.qam_fec_lock_failure", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_e_t_s_o,
{"Sequence out-of-range", "docsis_cmstatus.sequence_out_of_range", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_e_t_mdd_r,
{"Secondary Channel MDD Recovery", "docsis_cmstatus.mdd_recovery", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_e_t_qfl_r,
{"QAM/FEC Lock Recovery", "docsis_cmstatus.qam_fec_lock_recovery", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_e_t_t4_t,
{"T4 timeout", "docsis_cmstatus.t4_timeout", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_e_t_t3_e,
{"T3 retries exceeded", "docsis_cmstatus.t3_retries_exceeded", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_e_t_rng_s,
{"Successful ranging after T3 retries exceeded", "docsis_cmstatus.successful_ranging_after_t3_retries_exceeded", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_e_t_cm_b,
{"CM operating on battery backup", "docsis_cmstatus.cm_on_battery", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_e_t_cm_a,
{"CM returned to A/C power", "docsis_cmstatus.cm_on_ac_power", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_descr,
{"Description", "docsis_cmstatus.description",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_ds_ch_id,
{"Downstream Channel ID", "docsis_cmstatus.ds_chid",FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_us_ch_id,
{"Upstream Channel ID", "docsis_cmstatus.us_chid",FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_dsid,
{"DSID", "docsis_cmstatus.dsid", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_tlv_data,
{"TLV Data", "docsis_cmstatus.tlv_data", FT_BYTES, BASE_NO_DISPLAY_VALUE, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_type,
{"Type", "docsis_cmstatus.type",FT_UINT8, BASE_DEC, VALS(cmstatus_tlv_vals), 0x0, NULL, HFILL}
},
{&hf_docsis_cmstatus_length,
{"Length", "docsis_cmstatus.length",FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_cmstatus,
&ett_docsis_cmstatus_tlv,
&ett_docsis_cmstatus_tlvtlv,
};
static ei_register_info ei[] = {
{&ei_docsis_cmstatus_tlvlen_bad, { "docsis_cmstatus.tlvlenbad", PI_MALFORMED, PI_ERROR, "Bad TLV length", EXPFILL}},
};
expert_module_t* expert_docsis_cmstatus;
proto_docsis_cmstatus = proto_register_protocol ("DOCSIS CM-STATUS Report", "DOCSIS CM-STATUS", "docsis_cmstatus");
proto_register_field_array (proto_docsis_cmstatus, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
expert_docsis_cmstatus = expert_register_protocol(proto_docsis_cmstatus);
expert_register_field_array(expert_docsis_cmstatus, ei, array_length(ei));
docsis_cmstatus_handle = register_dissector ("docsis_cmstatus", dissect_cmstatus, proto_docsis_cmstatus);
}
void
proto_reg_handoff_docsis_cmstatus (void)
{
dissector_add_uint ("docsis_mgmt", 0x29, docsis_cmstatus_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,114 +0,0 @@
/* packet-dbcack.c
* Routines for DOCSIS 3.0 Dynamic Bonding Change Acknowledge Message dissection.
* Copyright 2010, Guido Reismueller <g.reismueller[AT]avm.de>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_dbcack(void);
void proto_reg_handoff_docsis_dbcack(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dbcack = -1;
static int hf_docsis_dbcack_tranid = -1;
static dissector_handle_t docsis_tlv_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_dbcack = -1;
static dissector_handle_t docsis_dbcack_handle;
/* Dissection */
static int
dissect_dbcack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *dbcack_item;
proto_tree *dbcack_tree = NULL;
guint16 transid;
tvbuff_t *next_tvb;
transid = tvb_get_ntohs (tvb, 0);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Dynamic Bonding Change Acknowledge: Tran-Id = %u", transid);
if (tree)
{
dbcack_item = proto_tree_add_protocol_format (tree, proto_docsis_dbcack,
tvb, 0, -1,
"Dynamic Bonding Change Acknowledge");
dbcack_tree = proto_item_add_subtree (dbcack_item, ett_docsis_dbcack);
proto_tree_add_item (dbcack_tree, hf_docsis_dbcack_tranid,
tvb, 0, 2, ENC_BIG_ENDIAN);
}
/* Call Dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 2);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dbcack_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dbcack (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dbcack_tranid,
{"Transaction Id", "docsis_dbcack.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_dbcack,
};
proto_docsis_dbcack = proto_register_protocol ("DOCSIS Dynamic Bonding Change Acknowledge",
"DOCSIS DBC-ACK",
"docsis_dbcack");
proto_register_field_array (proto_docsis_dbcack, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_dbcack_handle = register_dissector ("docsis_dbcack", dissect_dbcack, proto_docsis_dbcack);
}
void
proto_reg_handoff_docsis_dbcack (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 0x26, docsis_dbcack_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,121 +0,0 @@
/* packet-dbcreq.c
* Routines for DOCSIS 3.0 Dynamic Bonding Change Request Message dissection.
* Copyright 2010, Guido Reismueller <g.reismueller[AT]avm.de>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_dbcreq(void);
void proto_reg_handoff_docsis_dbcreq(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dbcreq = -1;
static int hf_docsis_dbcreq_tranid = -1;
static int hf_docsis_dbcreq_number_of_fragments = -1;
static int hf_docsis_dbcreq_fragment_sequence_number = -1;
static dissector_handle_t docsis_tlv_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_dbcreq = -1;
static dissector_handle_t docsis_dbcreq_handle;
/* Dissection */
static int
dissect_dbcreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *dbcreq_item;
proto_tree *dbcreq_tree;
guint32 transid;
tvbuff_t *next_tvb;
dbcreq_item = proto_tree_add_item(tree, proto_docsis_dbcreq, tvb, 0, -1, ENC_NA);
dbcreq_tree = proto_item_add_subtree (dbcreq_item, ett_docsis_dbcreq);
proto_tree_add_item_ret_uint(dbcreq_tree, hf_docsis_dbcreq_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid);
proto_tree_add_item( dbcreq_tree, hf_docsis_dbcreq_number_of_fragments, tvb, 2, 1, ENC_BIG_ENDIAN );
proto_tree_add_item( dbcreq_tree, hf_docsis_dbcreq_fragment_sequence_number, tvb, 3, 1, ENC_BIG_ENDIAN );
col_add_fstr (pinfo->cinfo, COL_INFO,
"Dynamic Bonding Change Request: Tran-Id = %u", transid);
/* Call Dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 4);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dbcreq_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dbcreq (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dbcreq_tranid,
{"Transaction Id", "docsis_dbcreq.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dbcreq_number_of_fragments,
{"Number of Fragments", "docsis_dbcreq.number_of_fragments",
FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dbcreq_fragment_sequence_number,
{"Fragment Seq No", "docsis_dbcreq.fragment_sequence_number",
FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_dbcreq,
};
proto_docsis_dbcreq = proto_register_protocol ("DOCSIS Dynamic Bonding Change Request",
"DOCSIS DBC-REQ",
"docsis_dbcreq");
proto_register_field_array (proto_docsis_dbcreq, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_dbcreq_handle = register_dissector ("docsis_dbcreq", dissect_dbcreq, proto_docsis_dbcreq);
}
void
proto_reg_handoff_docsis_dbcreq (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 0x24, docsis_dbcreq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,118 +0,0 @@
/* packet-dbcrsp.c
* Routines for DOCSIS 3.0 Dynamic Bonding Change Response Message dissection.
* Copyright 2010, Guido Reismueller <g.reismueller[AT]avm.de>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
extern value_string docsis_conf_code[];
void proto_register_docsis_dbcrsp(void);
void proto_reg_handoff_docsis_dbcrsp(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dbcrsp = -1;
static int hf_docsis_dbcrsp_tranid = -1;
static int hf_docsis_dbcrsp_conf_code = -1;
static dissector_handle_t docsis_tlv_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_dbcrsp = -1;
static dissector_handle_t docsis_dbcrsp_handle;
/* Dissection */
static int
dissect_dbcrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *dbcrsp_item;
proto_tree *dbcrsp_tree;
guint32 transid, confcode;
tvbuff_t *next_tvb;
dbcrsp_item = proto_tree_add_item(tree, proto_docsis_dbcrsp, tvb, 0, -1, ENC_NA);
dbcrsp_tree = proto_item_add_subtree (dbcrsp_item, ett_docsis_dbcrsp);
proto_tree_add_item_ret_uint(dbcrsp_tree, hf_docsis_dbcrsp_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid);
proto_tree_add_item_ret_uint( dbcrsp_tree, hf_docsis_dbcrsp_conf_code, tvb, 2, 1, ENC_BIG_ENDIAN, &confcode);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Dynamic Bonding Change Response: Tran-Id = %u (%s)", transid,
val_to_str (confcode, docsis_conf_code, "%d"));
/* Call Dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 3);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dbcrsp_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dbcrsp (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dbcrsp_tranid,
{"Transaction Id", "docsis_dbcrsp.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dbcrsp_conf_code,
{"Confirmation Code", "docsis_dbcrsp.conf_code",
FT_UINT8, BASE_DEC, VALS (docsis_conf_code), 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_dbcrsp,
};
proto_docsis_dbcrsp = proto_register_protocol ("DOCSIS Dynamic Bonding Change Response",
"DOCSIS DBC-RSP",
"docsis_dbcrsp");
proto_register_field_array (proto_docsis_dbcrsp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_dbcrsp_handle = register_dissector ("docsis_dbcrsp", dissect_dbcrsp, proto_docsis_dbcrsp);
}
void
proto_reg_handoff_docsis_dbcrsp (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 0x25, docsis_dbcrsp_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,212 +0,0 @@
/* packet-dccack.c
* Routines for DCC Acknowledge Message dissection
* Copyright 2004, Darryl Hymel <darryl.hymel[AT]arrisi.com>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
void proto_register_docsis_dccack(void);
void proto_reg_handoff_docsis_dccack(void);
#define DCCACK_KEY_SEQ_NUM 31
#define DCCACK_HMAC_DIGEST 27
/* Initialize the protocol and registered fields */
static int proto_docsis_dccack = -1;
static int hf_docsis_dcc_type = -1;
static int hf_docsis_dcc_length = -1;
static int hf_docsis_dccack_tran_id = -1;
static int hf_docsis_dccack_key_seq_num = -1;
static int hf_docsis_dccack_hmac_digest = -1;
/* Initialize the subtree pointers */
static gint ett_docsis_dccack = -1;
static gint ett_docsis_dccack_tlv = -1;
static const value_string dccack_tlv_vals[] = {
{DCCACK_HMAC_DIGEST, "HMAC-DigestNumber"},
{DCCACK_KEY_SEQ_NUM, "Auth Key Sequence Number"},
{0, NULL}
};
static expert_field ei_docsis_dccack_tlvlen_bad = EI_INIT;
static dissector_handle_t docsis_dccack_handle;
/* Dissection */
static int
dissect_dccack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
guint16 pos;
guint8 type;
guint32 length;
proto_tree *dcc_tree, *tlv_tree;
proto_item *dcc_item, *tlv_item, *tlv_len_item;
col_set_str(pinfo->cinfo, COL_INFO, "DCC-ACK Message");
dcc_item = proto_tree_add_item(tree, proto_docsis_dccack, tvb, 0, -1, ENC_NA);
dcc_tree = proto_item_add_subtree (dcc_item, ett_docsis_dccack);
proto_tree_add_item (dcc_tree, hf_docsis_dccack_tran_id, tvb, 0, 2, ENC_BIG_ENDIAN);
pos = 2;
while (tvb_reported_length_remaining(tvb, pos) > 0)
{
type = tvb_get_guint8 (tvb, pos);
tlv_tree = proto_tree_add_subtree(dcc_tree, tvb, pos, -1,
ett_docsis_dccack_tlv, &tlv_item,
val_to_str(type, dccack_tlv_vals,
"Unknown TLV (%u)"));
proto_tree_add_uint (tlv_tree, hf_docsis_dcc_type, tvb, pos, 1, type);
pos++;
tlv_len_item = proto_tree_add_item_ret_uint (tlv_tree, hf_docsis_dcc_length, tvb, pos, 1, ENC_NA, &length);
pos++;
proto_item_set_len(tlv_item, length + 2);
switch (type)
{
case DCCACK_KEY_SEQ_NUM:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_docsis_dccack_key_seq_num, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccack_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCACK_HMAC_DIGEST:
if (length == 20)
{
proto_tree_add_item (tlv_tree, hf_docsis_dccack_hmac_digest, tvb, pos, length, ENC_NA);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccack_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
} /* switch(type) */
pos += length;
} /* while (tvb_reported_length_remaining(tvb, pos) > 0) */
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dccack (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dcc_type,
{
"Type",
"docsis_dccack.tlvtype",
FT_UINT8, BASE_DEC, VALS(dccack_tlv_vals), 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dcc_length,
{
"Length",
"docsis_dccack.tlvlen",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccack_tran_id ,
{
"Transaction ID",
"docsis_dccack.tran_id",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccack_key_seq_num ,
{
"Auth Key Sequence Number",
"docsis_dccack.key_seq_num",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccack_hmac_digest ,
{
"HMAC-DigestNumber",
"docsis_dccack.hmac_digest",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL,
HFILL
}
},
};
static gint *ett[] = {
&ett_docsis_dccack,
&ett_docsis_dccack_tlv,
};
static ei_register_info ei[] = {
{&ei_docsis_dccack_tlvlen_bad, { "docsis_dccack.tlvlenbad", PI_MALFORMED, PI_ERROR, "Bad TLV length", EXPFILL}},
};
expert_module_t* expert_docsis_dccack;
proto_docsis_dccack =
proto_register_protocol ("DOCSIS Downstream Channel Change Acknowledge",
"DOCSIS DCC-ACK", "docsis_dccack");
proto_register_field_array (proto_docsis_dccack, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
expert_docsis_dccack = expert_register_protocol(proto_docsis_dccack);
expert_register_field_array(expert_docsis_dccack, ei, array_length(ei));
docsis_dccack_handle = register_dissector ("docsis_dccack", dissect_dccack, proto_docsis_dccack);
}
void
proto_reg_handoff_docsis_dccack (void)
{
dissector_add_uint ("docsis_mgmt", 0x19, docsis_dccack_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,733 +0,0 @@
/* packet-dccreq.c
* Routines for DCC Request Message dissection
* Copyright 2004, Darryl Hymel <darryl.hymel[AT]arrisi.com>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
void proto_register_docsis_dccreq(void);
void proto_reg_handoff_docsis_dccreq(void);
#define DCCREQ_UP_CHAN_ID 1
#define DCCREQ_DS_PARAMS 2
#define DCCREQ_INIT_TECH 3
#define DCCREQ_UCD_SUB 4
#define DCCREQ_SAID_SUB 6
#define DCCREQ_SF_SUB 7
#define DCCREQ_CMTS_MAC_ADDR 8
#define DCCREQ_KEY_SEQ_NUM 31
#define DCCREQ_HMAC_DIGEST 27
/* Define Downstrean Parameters subtypes
* These are subtype of DCCREQ_DS_PARAMS (2)
*/
#define DCCREQ_DS_FREQ 1
#define DCCREQ_DS_MOD_TYPE 2
#define DCCREQ_DS_SYM_RATE 3
#define DCCREQ_DS_INTLV_DEPTH 4
#define DCCREQ_DS_CHAN_ID 5
#define DCCREQ_DS_SYNC_SUB 6
#define DCCREQ_DS_OFDM_BLOCK_FREQ 7
/* Define Service Flow Substitution subtypes
* These are subtypes of DCCREQ_SF_SUB (7)
*/
#define DCCREQ_SF_SFID 1
#define DCCREQ_SF_SID 2
#define DCCREQ_SF_UNSOL_GRANT_TREF 5
/* Initialize the protocol and registered fields */
static int proto_docsis_dccreq = -1;
static int hf_docsis_dcc_type = -1;
static int hf_docsis_dcc_length = -1;
static int hf_docsis_dccreq_tran_id = -1;
static int hf_docsis_dccreq_up_chan_id = -1;
static int hf_docsis_dcc_ds_params_subtype = -1;
static int hf_docsis_dcc_ds_params_length = -1;
static int hf_docsis_dccreq_ds_freq = -1;
static int hf_docsis_dccreq_ds_mod_type = -1;
static int hf_docsis_dccreq_ds_sym_rate = -1;
static int hf_docsis_dccreq_ds_intlv_depth_i = -1;
static int hf_docsis_dccreq_ds_intlv_depth_j = -1;
static int hf_docsis_dccreq_ds_chan_id = -1;
static int hf_docsis_dccreq_ds_sync_sub = -1;
static int hf_docsis_dccreq_ds_ofdm_block_freq = -1;
static int hf_docsis_dccreq_init_tech = -1;
static int hf_docsis_dccreq_ucd_sub = -1;
static int hf_docsis_dccreq_said_sub_cur = -1;
static int hf_docsis_dccreq_said_sub_new = -1;
static int hf_docsis_dcc_sf_sub_subtype = -1;
static int hf_docsis_dcc_sf_sub_length = -1;
static int hf_docsis_dccreq_sf_sfid_cur = -1;
static int hf_docsis_dccreq_sf_sfid_new = -1;
static int hf_docsis_dccreq_sf_sid_cur = -1;
static int hf_docsis_dccreq_sf_sid_new = -1;
static int hf_docsis_dccreq_sf_unsol_grant_tref = -1;
static int hf_docsis_dccreq_cmts_mac_addr = -1;
static int hf_docsis_dccreq_key_seq_num = -1;
static int hf_docsis_dccreq_hmac_digest = -1;
/* Initialize the subtree pointers */
static gint ett_docsis_dccreq = -1;
static gint ett_docsis_dccreq_tlv = -1;
static gint ett_docsis_dccreq_ds_params = -1;
static gint ett_docsis_dccreq_sf_sub = -1;
static expert_field ei_docsis_dccreq_tlvlen_bad = EI_INIT;
static dissector_handle_t docsis_dccreq_handle;
static const value_string ds_mod_type_vals[] = {
{0 , "64 QAM"},
{1 , "256 QAM"},
{0, NULL}
};
static const value_string ds_sym_rate_vals[] = {
{0 , "5.056941 Msym/sec"},
{1 , "5.360537 Msym/sec"},
{2 , "6.952 Msym/sec"},
{0, NULL}
};
static const value_string init_tech_vals[] = {
{0 , "Reinitialize MAC"},
{1 , "Broadcast Init RNG on new chanbefore normal op"},
{2 , "Unicast RNG on new chan before normal op"},
{3 , "Either Unicast or broadcast RNG on new chan before normal op"},
{4 , "Use new chan directly without re-init or RNG"},
{0, NULL}
};
static const value_string dcc_tlv_vals[] = {
{DCCREQ_UP_CHAN_ID, "Up Channel ID"},
{DCCREQ_DS_PARAMS, "Downstream Params Encodings"},
{DCCREQ_INIT_TECH, "Initialization Technique"},
{DCCREQ_UCD_SUB, "UCD Substitution"},
{DCCREQ_SAID_SUB, "SAID Sub"},
{DCCREQ_SF_SUB, "Service Flow Substitution Encodings"},
{DCCREQ_CMTS_MAC_ADDR, "CMTS Mac Address"},
{DCCREQ_KEY_SEQ_NUM, "Auth Key Sequence Number"},
{DCCREQ_HMAC_DIGEST, "HMAC-DigestNumber"},
{0, NULL}
};
static const value_string ds_param_subtlv_vals[] = {
{DCCREQ_DS_FREQ, "Frequency"},
{DCCREQ_DS_MOD_TYPE, "Modulation Type"},
{DCCREQ_DS_SYM_RATE, "Symbol Rate"},
{DCCREQ_DS_INTLV_DEPTH, "Interleaver Depth"},
{DCCREQ_DS_CHAN_ID, "Downstream Channel ID"},
{DCCREQ_DS_SYNC_SUB, "SYNC Substitution"},
{DCCREQ_DS_OFDM_BLOCK_FREQ, "OFDM Block Frequency"},
{0, NULL}
};
static const value_string sf_sub_subtlv_vals[] = {
{DCCREQ_SF_SFID, "SFID"},
{DCCREQ_SF_SID, "SID"},
{DCCREQ_SF_UNSOL_GRANT_TREF, "Unsolicited Grant Time Reference"},
{0, NULL}
};
static const unit_name_string local_units_hz = { "Hz", NULL };
/* Dissection */
static void
dissect_dccreq_ds_params (tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, int start, guint16 len)
{
guint8 type;
guint32 length;
proto_tree *dcc_tree;
proto_item *dcc_item, *tlv_len_item;
int pos;
pos = start;
while ( pos < ( start + len) )
{
type = tvb_get_guint8 (tvb, pos);
dcc_tree = proto_tree_add_subtree(tree, tvb, pos, -1,
ett_docsis_dccreq_ds_params, &dcc_item,
val_to_str(type, ds_param_subtlv_vals,
"Unknown TLV (%u)"));
proto_tree_add_uint (dcc_tree, hf_docsis_dcc_ds_params_subtype, tvb, pos, 1, type);
pos++;
tlv_len_item = proto_tree_add_item_ret_uint (dcc_tree, hf_docsis_dcc_ds_params_length, tvb, pos, 1, ENC_NA, &length);
pos++;
proto_item_set_len(dcc_item, length + 2);
switch (type)
{
case DCCREQ_DS_FREQ:
if (length == 4)
{
proto_tree_add_item (dcc_tree, hf_docsis_dccreq_ds_freq, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCREQ_DS_MOD_TYPE:
if (length == 1)
{
proto_tree_add_item (dcc_tree, hf_docsis_dccreq_ds_mod_type, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCREQ_DS_SYM_RATE:
if (length == 1)
{
proto_tree_add_item (dcc_tree, hf_docsis_dccreq_ds_sym_rate, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCREQ_DS_INTLV_DEPTH:
if (length == 2)
{
proto_tree_add_item (dcc_tree, hf_docsis_dccreq_ds_intlv_depth_i, tvb, pos, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (dcc_tree, hf_docsis_dccreq_ds_intlv_depth_j, tvb, pos + 1, 1, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCREQ_DS_CHAN_ID:
if (length == 1)
{
proto_tree_add_item (dcc_tree, hf_docsis_dccreq_ds_chan_id, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCREQ_DS_SYNC_SUB:
if (length == 1)
{
proto_tree_add_item (dcc_tree, hf_docsis_dccreq_ds_sync_sub, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCREQ_DS_OFDM_BLOCK_FREQ:
if (length == 4)
{
proto_tree_add_item (dcc_tree, hf_docsis_dccreq_ds_ofdm_block_freq, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
}
pos += length;
}
}
static void
dissect_dccreq_sf_sub (tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, int start, guint16 len)
{
guint8 type;
guint32 length;
proto_tree *dcc_tree;
proto_item *dcc_item, *tlv_len_item;
int pos;
pos = start;
while ( pos < ( start + len) )
{
type = tvb_get_guint8 (tvb, pos);
dcc_tree = proto_tree_add_subtree(tree, tvb, pos, -1,
ett_docsis_dccreq_sf_sub, &dcc_item,
val_to_str(type, sf_sub_subtlv_vals,
"Unknown TLV (%u)"));
proto_tree_add_uint (dcc_tree, hf_docsis_dcc_sf_sub_subtype, tvb, pos, 1, type);
pos++;
tlv_len_item = proto_tree_add_item_ret_uint (dcc_tree, hf_docsis_dcc_sf_sub_length, tvb, pos, 1, ENC_NA, &length);
pos++;
proto_item_set_len(dcc_item, length + 2);
switch (type)
{
case DCCREQ_SF_SFID:
if (length == 8)
{
proto_tree_add_item (dcc_tree, hf_docsis_dccreq_sf_sfid_cur, tvb, pos, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (dcc_tree, hf_docsis_dccreq_sf_sfid_new, tvb, pos + 4, 4, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCREQ_SF_SID:
if (length == 4)
{
proto_tree_add_item (dcc_tree, hf_docsis_dccreq_sf_sid_cur, tvb, pos, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (dcc_tree, hf_docsis_dccreq_sf_sid_new, tvb, pos + 2, 2, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCREQ_SF_UNSOL_GRANT_TREF:
if (length == 4)
{
proto_tree_add_item (dcc_tree, hf_docsis_dccreq_sf_unsol_grant_tref, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
}
pos += length;
}
}
static int
dissect_dccreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
guint16 pos;
guint8 type;
guint32 length;
proto_tree *dcc_tree, *tlv_tree;
proto_item *dcc_item, *tlv_item, *tlv_len_item;
col_set_str(pinfo->cinfo, COL_INFO, "DCC-REQ Message");
dcc_item = proto_tree_add_item (tree, proto_docsis_dccreq, tvb, 0, -1, ENC_NA);
dcc_tree = proto_item_add_subtree (dcc_item, ett_docsis_dccreq);
proto_tree_add_item (dcc_tree, hf_docsis_dccreq_tran_id, tvb, 0, 2, ENC_BIG_ENDIAN);
pos = 2;
while (tvb_reported_length_remaining(tvb, pos) > 0)
{
type = tvb_get_guint8 (tvb, pos);
tlv_tree = proto_tree_add_subtree(dcc_tree, tvb, pos, -1,
ett_docsis_dccreq_tlv, &tlv_item,
val_to_str(type, dcc_tlv_vals,
"Unknown TLV (%u)"));
proto_tree_add_uint (tlv_tree, hf_docsis_dcc_type, tvb, pos, 1, type);
pos++;
tlv_len_item = proto_tree_add_item_ret_uint (tlv_tree, hf_docsis_dcc_length, tvb, pos, 1, ENC_NA, &length);
pos++;
proto_item_set_len(tlv_item, length + 2);
switch (type)
{
case DCCREQ_UP_CHAN_ID:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_docsis_dccreq_up_chan_id, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCREQ_DS_PARAMS:
dissect_dccreq_ds_params (tvb, pinfo, tlv_tree, pos, length);
break;
case DCCREQ_INIT_TECH:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_docsis_dccreq_init_tech, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCREQ_UCD_SUB:
proto_tree_add_item (tlv_tree, hf_docsis_dccreq_ucd_sub, tvb, pos, length, ENC_NA);
break;
case DCCREQ_SAID_SUB:
if (length == 4)
{
proto_tree_add_item (tlv_tree, hf_docsis_dccreq_said_sub_cur, tvb, pos, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (tlv_tree, hf_docsis_dccreq_said_sub_new, tvb, pos + 2, 2, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCREQ_SF_SUB:
dissect_dccreq_sf_sub (tvb, pinfo, tlv_tree, pos, length );
break;
case DCCREQ_CMTS_MAC_ADDR:
if (length == 6)
{
proto_tree_add_item (tlv_tree, hf_docsis_dccreq_cmts_mac_addr, tvb, pos, length, ENC_NA);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCREQ_KEY_SEQ_NUM:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_docsis_dccreq_key_seq_num, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCREQ_HMAC_DIGEST:
if (length == 20)
{
proto_tree_add_item (tlv_tree, hf_docsis_dccreq_hmac_digest, tvb, pos, length, ENC_NA);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccreq_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
} /* switch(type) */
pos += length;
} /* (tvb_reported_length_remaining(tvb, pos) > 0) */
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dccreq (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dcc_type,
{
"Type",
"docsis_dccreq.tlvtype",
FT_UINT8, BASE_DEC, VALS(dcc_tlv_vals), 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dcc_length,
{
"Length",
"docsis_dccreq.tlvlen",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_tran_id ,
{
"Transaction ID",
"docsis_dccreq.tran_id",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_up_chan_id ,
{
"Up Channel ID",
"docsis_dccreq.up_chan_id",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dcc_ds_params_subtype,
{
"Type",
"docsis_dccreq.ds_tlvtype",
FT_UINT8, BASE_DEC, VALS(ds_param_subtlv_vals), 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dcc_ds_params_length,
{
"Length",
"docsis_dccreq.ds_tlvlen",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_ds_freq ,
{
"Frequency",
"docsis_dccreq.ds_freq",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_ds_mod_type ,
{
"Modulation Type",
"docsis_dccreq.ds_mod_type",
FT_UINT8, BASE_DEC, VALS (ds_mod_type_vals), 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_ds_sym_rate ,
{
"Symbol Rate",
"docsis_dccreq.ds_sym_rate",
FT_UINT8, BASE_DEC, VALS (ds_sym_rate_vals), 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_ds_intlv_depth_i ,
{
"Interleaver Depth I Value",
"docsis_dccreq.ds_intlv_depth_i",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_ds_intlv_depth_j ,
{
"Interleaver Depth J Value",
"docsis_dccreq.ds_intlv_depth_j",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_ds_chan_id ,
{
"Downstream Channel ID",
"docsis_dccreq.ds_chan_id",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_ds_sync_sub ,
{
"SYNC Substitution",
"docsis_dccreq.ds_sync_sub",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_ds_ofdm_block_freq ,
{
"OFDM Block Frequency",
"docsis_dccreq.ds_ofdm_block_freq",
FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &local_units_hz, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_init_tech ,
{
"Initialization Technique",
"docsis_dccreq.init_tech",
FT_UINT8, BASE_DEC, VALS (init_tech_vals), 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_ucd_sub ,
{
"UCD Substitution",
"docsis_dccreq.ucd_sub",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_said_sub_cur ,
{
"SAID Sub - Current Value",
"docsis_dccreq.said_sub_cur",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_said_sub_new ,
{
"SAID Sub - New Value",
"docsis_dccreq.said_sub_new",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dcc_sf_sub_subtype,
{
"Type",
"docsis_dccreq.sf_tlvtype",
FT_UINT8, BASE_DEC, VALS(sf_sub_subtlv_vals), 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dcc_sf_sub_length,
{
"Length",
"docsis_dccreq.sf_tlvlen",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_sf_sfid_cur ,
{
"SF Sub - SFID Current Value",
"docsis_dccreq.sf_sfid_cur",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_sf_sfid_new ,
{
"SF Sub - SFID New Value",
"docsis_dccreq.sf_sfid_new",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_sf_sid_cur ,
{
"SF Sub - SID Current Value",
"docsis_dccreq.sf_sid_cur",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_sf_sid_new ,
{
"SF Sub - SID New Value",
"docsis_dccreq.sf_sid_new",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_sf_unsol_grant_tref ,
{
"SF Sub - Unsolicited Grant Time Reference",
"docsis_dccreq.sf_unsol_grant_tref",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_cmts_mac_addr ,
{
"CMTS Mac Address",
"docsis_dccreq.cmts_mac_addr",
FT_ETHER, BASE_NONE, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_key_seq_num ,
{
"Auth Key Sequence Number",
"docsis_dccreq.key_seq_num",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccreq_hmac_digest ,
{
"HMAC-DigestNumber",
"docsis_dccreq.hmac_digest",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL,
HFILL
}
},
};
static gint *ett[] = {
&ett_docsis_dccreq,
&ett_docsis_dccreq_sf_sub,
&ett_docsis_dccreq_ds_params,
&ett_docsis_dccreq_tlv,
};
static ei_register_info ei[] = {
{&ei_docsis_dccreq_tlvlen_bad, { "docsis_dccreq.tlvlenbad", PI_MALFORMED, PI_ERROR, "Bad TLV length", EXPFILL}},
};
expert_module_t* expert_docsis_dccreq;
proto_docsis_dccreq =
proto_register_protocol ("DOCSIS Downstream Channel Change Request",
"DOCSIS DCC-REQ", "docsis_dccreq");
proto_register_field_array (proto_docsis_dccreq, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
expert_docsis_dccreq = expert_register_protocol(proto_docsis_dccreq);
expert_register_field_array(expert_docsis_dccreq, ei, array_length(ei));
docsis_dccreq_handle = register_dissector ("docsis_dccreq", dissect_dccreq, proto_docsis_dccreq);
}
void
proto_reg_handoff_docsis_dccreq (void)
{
dissector_add_uint ("docsis_mgmt", 0x17, docsis_dccreq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,336 +0,0 @@
/* packet-dccrsp.c
* Routines for DCC Response Message dissection
* Copyright 2004, Darryl Hymel <darryl.hymel[AT]arrisi.com>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
void proto_register_docsis_dccrsp(void);
void proto_reg_handoff_docsis_dccrsp(void);
#define DCCRSP_CM_JUMP_TIME 1
#define DCCRSP_KEY_SEQ_NUM 31
#define DCCRSP_HMAC_DIGEST 27
/* Define DCC-RSP CM Jump Time subtypes
* These are subtype of DCCRSP_CM_JUMP_TIME (1)
*/
#define DCCRSP_CM_JUMP_TIME_LENGTH 1
#define DCCRSP_CM_JUMP_TIME_START 2
/* Initialize the protocol and registered fields */
static int proto_docsis_dccrsp = -1;
static int hf_docsis_dccrsp_tran_id = -1;
static int hf_docsis_dccrsp_conf_code = -1;
static int hf_docsis_dcc_type = -1;
static int hf_docsis_dcc_length = -1;
static int hf_docsis_dcc_cm_jump_subtype = -1;
static int hf_docsis_dcc_cm_jump_length = -1;
static int hf_docsis_dccrsp_cm_jump_time_length = -1;
static int hf_docsis_dccrsp_cm_jump_time_start = -1;
static int hf_docsis_dccrsp_key_seq_num = -1;
static int hf_docsis_dccrsp_hmac_digest = -1;
/* Initialize the subtree pointers */
static gint ett_docsis_dccrsp = -1;
static gint ett_docsis_dccrsp_cm_jump_time = -1;
static gint ett_docsis_dccrsp_tlv = -1;
static expert_field ei_docsis_dccrsp_tlvlen_bad = EI_INIT;
static dissector_handle_t docsis_dccrsp_handle;
/* Defined in packet-tlv.c */
extern value_string docsis_conf_code[];
static const value_string dccrsp_tlv_vals[] = {
{DCCRSP_CM_JUMP_TIME, "CM Jump Time Encodings"},
{DCCRSP_KEY_SEQ_NUM, "Auth Key Sequence Number"},
{DCCRSP_HMAC_DIGEST, "HMAC-Digest Number"},
{0, NULL}
};
static const value_string cm_jump_subtlv_vals[] = {
{DCCRSP_CM_JUMP_TIME_LENGTH, "Length of Jump"},
{DCCRSP_CM_JUMP_TIME_START, "Start Time of Jump"},
{0, NULL}
};
/* Dissection */
static void
dissect_dccrsp_cm_jump_time (tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, int start, guint16 len)
{
guint8 type;
guint32 length;
proto_tree *dcc_tree;
proto_item *dcc_item, *tlv_len_item;
int pos;
pos = start;
while ( pos < ( start + len) )
{
type = tvb_get_guint8 (tvb, pos);
dcc_tree = proto_tree_add_subtree(tree, tvb, pos, -1,
ett_docsis_dccrsp_cm_jump_time, &dcc_item,
val_to_str(type, cm_jump_subtlv_vals,
"Unknown TLV (%u)"));
proto_tree_add_uint (dcc_tree, hf_docsis_dcc_cm_jump_subtype, tvb, pos, 1, type);
pos++;
tlv_len_item = proto_tree_add_item_ret_uint (dcc_tree, hf_docsis_dcc_cm_jump_length, tvb, pos, 1, ENC_NA, &length);
pos++;
proto_item_set_len(dcc_item, length + 2);
switch (type)
{
case DCCRSP_CM_JUMP_TIME_LENGTH:
if (length == 4)
{
proto_tree_add_item (dcc_tree, hf_docsis_dccrsp_cm_jump_time_length, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccrsp_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCRSP_CM_JUMP_TIME_START:
if (length == 8)
{
proto_tree_add_item (dcc_tree, hf_docsis_dccrsp_cm_jump_time_start, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccrsp_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
}
pos += length;
}
}
static int
dissect_dccrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
guint16 pos;
guint8 type;
guint32 length;
proto_tree *dcc_tree, *tlv_tree;
proto_item *dcc_item, *tlv_item, *tlv_len_item;
col_set_str(pinfo->cinfo, COL_INFO, "DCC-RSP Message");
dcc_item = proto_tree_add_item (tree, proto_docsis_dccrsp, tvb, 0, -1, ENC_NA);
dcc_tree = proto_item_add_subtree (dcc_item, ett_docsis_dccrsp);
proto_tree_add_item (dcc_tree, hf_docsis_dccrsp_tran_id, tvb, 0, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (dcc_tree, hf_docsis_dccrsp_conf_code, tvb, 2, 1, ENC_BIG_ENDIAN);
pos = 3;
while (tvb_reported_length_remaining(tvb, pos) > 0)
{
type = tvb_get_guint8 (tvb, pos);
tlv_tree = proto_tree_add_subtree(dcc_tree, tvb, pos, -1,
ett_docsis_dccrsp_tlv, &tlv_item,
val_to_str(type, dccrsp_tlv_vals,
"Unknown TLV (%u)"));
proto_tree_add_uint (tlv_tree, hf_docsis_dcc_type, tvb, pos, 1, type);
pos++;
tlv_len_item = proto_tree_add_item_ret_uint (tlv_tree, hf_docsis_dcc_length, tvb, pos, 1, ENC_NA, &length);
pos++;
proto_item_set_len(tlv_item, length + 2);
switch (type)
{
case DCCRSP_CM_JUMP_TIME:
dissect_dccrsp_cm_jump_time (tvb, pinfo, tlv_tree, pos, length );
break;
case DCCRSP_KEY_SEQ_NUM:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_docsis_dccrsp_key_seq_num, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccrsp_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DCCRSP_HMAC_DIGEST:
if (length == 20)
{
proto_tree_add_item (tlv_tree, hf_docsis_dccrsp_hmac_digest, tvb, pos, length, ENC_NA);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dccrsp_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
} /* switch(type) */
pos += length;
} /* while (tvb_reported_length_remaining(tvb, pos) > 0) */
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dccrsp (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dccrsp_tran_id ,
{
"Transaction ID",
"docsis_dccrsp.tran_id",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccrsp_conf_code ,
{
"Confirmation Code",
"docsis_dccrsp.conf_code",
FT_UINT8, BASE_DEC, VALS (docsis_conf_code), 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dcc_type,
{
"Type",
"docsis_dccrsp.tlvtype",
FT_UINT8, BASE_DEC, VALS(dccrsp_tlv_vals), 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dcc_length,
{
"Length",
"docsis_dccrsp.tlvlen",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dcc_cm_jump_subtype,
{
"Type",
"docsis_dccrsp.cm_jump_tlvtype",
FT_UINT8, BASE_DEC, VALS(cm_jump_subtlv_vals), 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dcc_cm_jump_length,
{
"Length",
"docsis_dccrsp.cm_jump_tlvlen",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccrsp_cm_jump_time_length ,
{
"Length of Jump",
"docsis_dccrsp.cm_jump_time_length",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccrsp_cm_jump_time_start ,
{
"Start Time of Jump",
"docsis_dccrsp.cm_jump_time_start",
FT_UINT64, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccrsp_key_seq_num ,
{
"Auth Key Sequence Number",
"docsis_dccrsp.key_seq_num",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL,
HFILL
}
},
{&hf_docsis_dccrsp_hmac_digest ,
{
"HMAC-Digest Number",
"docsis_dccrsp.hmac_digest",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL,
HFILL
}
},
};
static gint *ett[] = {
&ett_docsis_dccrsp,
&ett_docsis_dccrsp_cm_jump_time,
&ett_docsis_dccrsp_tlv,
};
static ei_register_info ei[] = {
{&ei_docsis_dccrsp_tlvlen_bad, { "docsis_dccrsp.tlvlenbad", PI_MALFORMED, PI_ERROR, "Bad TLV length", EXPFILL}},
};
expert_module_t* expert_docsis_dccrsp;
proto_docsis_dccrsp =
proto_register_protocol ("DOCSIS Downstream Channel Change Response",
"DOCSIS DCC-RSP", "docsis_dccrsp");
proto_register_field_array (proto_docsis_dccrsp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
expert_docsis_dccrsp = expert_register_protocol(proto_docsis_dccrsp);
expert_register_field_array(expert_docsis_dccrsp, ei, array_length(ei));
docsis_dccrsp_handle = register_dissector ("docsis_dccrsp", dissect_dccrsp, proto_docsis_dccrsp);
}
void
proto_reg_handoff_docsis_dccrsp (void)
{
dissector_add_uint ("docsis_mgmt", 0x18, docsis_dccrsp_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

File diff suppressed because it is too large Load Diff

View File

@ -1,400 +0,0 @@
/* packet-dpd.c
* Routines for DOCSIS 3.1 Downstream Profile Descriptor dissection.
* Copyright 2016, Bruno Verstuyft <bruno.verstuyft@excentis.com>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#define SUBCARRIER_ASSIGNMENT_RANGE_LIST 5
#define SUBCARRIER_ASSIGNMENT_VECTOR 6
#define SUBCARRIER_ASSIGNMENT_RANGE_CONT 0
#define SUBCARRIER_ASSIGNMENT_RANGE_SKIPBY1 1
#define SUBCARRIER_ASSIGNMENT_LIST 2
void proto_register_docsis_dpd(void);
void proto_reg_handoff_docsis_dpd(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dpd = -1;
static int hf_docsis_dpd_tlv_unknown = -1;
static int hf_docsis_dpd_dschid = -1;
static int hf_docsis_dpd_prof_id = -1;
static int hf_docsis_dpd_ccc = -1;
static int hf_docsis_dpd_tlv_subc_assign_type = -1;
static int hf_docsis_dpd_tlv_subc_assign_value = -1;
static int hf_docsis_dpd_subc_assign_range = -1;
static int hf_docsis_dpd_tlv_subc_assign_reserved = -1;
static int hf_docsis_dpd_tlv_subc_assign_modulation = -1;
static int hf_docsis_dpd_subc_assign_index = -1;
static int hf_docsis_dpd_tlv_subc_assign_vector_oddness = -1;
static int hf_docsis_dpd_tlv_subc_assign_vector_reserved = -1;
static int hf_docsis_dpd_tlv_subc_assign_vector_subc_start = -1;
static int hf_docsis_dpd_tlv_subc_assign_vector_modulation_odd = -1;
static int hf_docsis_dpd_tlv_subc_assign_vector_modulation_even = -1;
static int hf_docsis_dpd_tlv_data = -1;
static int hf_docsis_dpd_type = -1;
static int hf_docsis_dpd_length = -1;
static expert_field ei_docsis_dpd_tlvlen_bad = EI_INIT;
static expert_field ei_docsis_dpd_value_unknown = EI_INIT;
/* Initialize the subtree pointers */
static gint ett_docsis_dpd = -1;
static gint ett_docsis_dpd_tlv = -1;
static gint ett_docsis_dpd_tlvtlv = -1;
static gint ett_docsis_dpd_tlv_subcarrier_assignment = -1;
static gint ett_docsis_dpd_tlv_subcarrier_assignment_vector = -1;
static dissector_handle_t docsis_dpd_handle;
/*BASE_CUSTOM function for subcarrier range*/
static void
subc_assign_range(
char *buf,
guint32 value)
{
g_snprintf(buf, ITEM_LABEL_LENGTH,
"%u - %u",
value >> 16, value &0xFFFF);
}
static const value_string docsis_dpd_subc_assign_type_str[] = {
{0, "range, continuous"},
{1, "range, skip by 1"},
{2, "list"},
{3, "reserved"},
{0, NULL}
};
static const value_string docsis_dpd_subc_assign_value_str[] = {
{0, "specific value"},
{1, "default value"},
{0, NULL}
};
static const value_string docsis_dpd_subc_assign_modulation_str[] = {
{0, "zero-bit loaded"},
{1, "reserved"},
{2, "QPSK (for NPC profile only)"},
{3, "reserved"},
{4, "16-QAM"},
{5, "reserved"},
{6, "64-QAM"},
{7, "128-QAM"},
{8, "256-QAM"},
{9, "512-QAM"},
{10, "1024-QAM"},
{11, "2048-QAM"},
{12, "4096-QAM"},
{13, "8192-QAM"},
{14, "16384-QAM"},
{15, "reserved"},
{0, NULL}
};
static const value_string docsis_dpd_tlv_subc_assign_vector_oddness_str[] = {
{0, "N is even"},
{1, "N is odd"},
{0, NULL}
};
static const value_string docsis_dpd_tlv_subc_assign_vector_modulation_str[] = {
{0, "zero-bit loaded"},
{1, "continuous pilot"},
{2, "QPSK (for NPC profile only)"},
{3, "reserved"},
{4, "16-QAM"},
{5, "reserved"},
{6, "64-QAM"},
{7, "128-QAM"},
{8, "256-QAM"},
{9, "512-QAM"},
{10, "1024-QAM"},
{11, "2048-QAM"},
{12, "4096-QAM"},
{13, "8192-QAM"},
{14, "16384-QAM"},
{15, "reserved"},
{0, NULL}
};
static const value_string dpd_tlv_vals[] = {
{SUBCARRIER_ASSIGNMENT_RANGE_LIST, "Subcarrier Assignment Range/List"},
{SUBCARRIER_ASSIGNMENT_VECTOR, "Subcarrier Assignment Vector"},
{0, NULL}
};
/* Dissection */
static void
dissect_dpd_subcarrier_assignment_range_list(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, guint pos, guint len)
{
guint32 i, subcarrier_assignment_type;
proto_item* type_item;
type_item = proto_tree_add_item_ret_uint (tree, hf_docsis_dpd_tlv_subc_assign_type, tvb, pos, 1, ENC_BIG_ENDIAN, &subcarrier_assignment_type);
proto_tree_add_item (tree, hf_docsis_dpd_tlv_subc_assign_value, tvb, pos, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_docsis_dpd_tlv_subc_assign_reserved, tvb, pos, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_docsis_dpd_tlv_subc_assign_modulation, tvb, pos, 1, ENC_BIG_ENDIAN);
pos++;
switch (subcarrier_assignment_type)
{
case SUBCARRIER_ASSIGNMENT_RANGE_CONT:
case SUBCARRIER_ASSIGNMENT_RANGE_SKIPBY1:
proto_tree_add_item (tree, hf_docsis_dpd_subc_assign_range, tvb, pos, 4, ENC_BIG_ENDIAN);
break;
case SUBCARRIER_ASSIGNMENT_LIST:
for (i = 0; i < len/2; ++i) {
proto_tree_add_item (tree, hf_docsis_dpd_subc_assign_index, tvb, pos, 2, ENC_BIG_ENDIAN);
pos += 2;
}
break;
default:
expert_add_info_format(pinfo, type_item, &ei_docsis_dpd_value_unknown, "Unknown subcarrier assignment type: %u", subcarrier_assignment_type);
break;
}
}
static void
dissect_dpd_subcarrier_assignment_vector(tvbuff_t * tvb, proto_tree * tree, guint start, guint len)
{
guint32 subcarrier_assignment_vector_oddness;
guint vector_index;
proto_tree_add_item_ret_uint (tree, hf_docsis_dpd_tlv_subc_assign_vector_oddness, tvb, start, 1, ENC_BIG_ENDIAN, &subcarrier_assignment_vector_oddness);
proto_tree_add_item (tree, hf_docsis_dpd_tlv_subc_assign_vector_reserved, tvb, start, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_docsis_dpd_tlv_subc_assign_vector_subc_start, tvb, start, 2, ENC_BIG_ENDIAN);
for(vector_index = 0; vector_index < len; ++vector_index)
{
proto_tree_add_item (tree, hf_docsis_dpd_tlv_subc_assign_vector_modulation_odd, tvb, start + 2 + vector_index, 1, ENC_BIG_ENDIAN);
if (!((vector_index == len -1) && subcarrier_assignment_vector_oddness))
{
proto_tree_add_item (tree, hf_docsis_dpd_tlv_subc_assign_vector_modulation_even, tvb, start + 2 + vector_index, 1, ENC_BIG_ENDIAN);
}
}
}
static void
dissect_dpd_tlv (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
proto_item *it, *tlv_item, *tlv_len_item;
proto_tree *tlv_tree;
guint pos = 0;
guint length;
guint8 type;
it = proto_tree_add_item(tree, hf_docsis_dpd_tlv_data, tvb, 0, tvb_reported_length(tvb), ENC_NA);
tlv_tree = proto_item_add_subtree (it, ett_docsis_dpd_tlv);
while (tvb_reported_length_remaining(tvb, pos) > 0)
{
type = tvb_get_guint8 (tvb, pos);
tlv_tree = proto_tree_add_subtree(tlv_tree, tvb, pos, -1,
ett_docsis_dpd_tlvtlv, &tlv_item,
val_to_str(type, dpd_tlv_vals,
"Unknown TLV (%u)"));
proto_tree_add_uint (tlv_tree, hf_docsis_dpd_type, tvb, pos, 1, type);
pos++;
if (type != SUBCARRIER_ASSIGNMENT_VECTOR)
{
tlv_len_item = proto_tree_add_item_ret_uint (tlv_tree, hf_docsis_dpd_length, tvb, pos, 1, ENC_NA, &length);
pos++;
proto_item_set_len(tlv_item, length + 2);
}
switch (type)
{
case SUBCARRIER_ASSIGNMENT_RANGE_LIST:
if (length >= 5)
{
dissect_dpd_subcarrier_assignment_range_list(tvb, pinfo, tlv_tree, pos, length);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dpd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case SUBCARRIER_ASSIGNMENT_VECTOR:
/*FOR THIS TYPE, LENGTH IS 2 BYTES INSTEAD OF 1 */
tlv_len_item = proto_tree_add_item_ret_uint (tlv_tree, hf_docsis_dpd_length, tvb, pos, 2, ENC_BIG_ENDIAN, &length);
pos += 2;
proto_item_set_len(tlv_item, length + 2);
if (length >=2)
{
dissect_dpd_subcarrier_assignment_vector(tvb, tlv_tree, pos, length);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_dpd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
default:
proto_tree_add_item (tlv_tree, hf_docsis_dpd_tlv_unknown, tvb, pos - 2, length+2, ENC_NA);
expert_add_info_format(pinfo, tlv_item, &ei_docsis_dpd_value_unknown, "Unknown TLV: %u", type);
break;
} /* switch */
pos += length;
} /* while */
}
static int
dissect_dpd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *dpd_tree;
tvbuff_t *next_tvb;
guint32 downstream_channel_id, profile_identifier, configuration_change_count;
it = proto_tree_add_item(tree, proto_docsis_dpd, tvb, 0, -1, ENC_NA);
dpd_tree = proto_item_add_subtree (it, ett_docsis_dpd);
proto_tree_add_item_ret_uint (dpd_tree, hf_docsis_dpd_dschid, tvb, 0, 1, ENC_BIG_ENDIAN, &downstream_channel_id);
proto_tree_add_item_ret_uint (dpd_tree, hf_docsis_dpd_prof_id, tvb, 1, 1, ENC_BIG_ENDIAN, &profile_identifier);
proto_tree_add_item_ret_uint (dpd_tree, hf_docsis_dpd_ccc, tvb, 2, 1, ENC_BIG_ENDIAN, &configuration_change_count);
col_add_fstr (pinfo->cinfo, COL_INFO, "DPD: DS CH ID: %u, Profile ID: %u, CCC: %u", downstream_channel_id, profile_identifier, configuration_change_count);
/* Call Dissector TLV's */
next_tvb = tvb_new_subset_remaining(tvb, 3);
dissect_dpd_tlv(next_tvb, pinfo, dpd_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dpd(void)
{
static hf_register_info hf[] = {
{&hf_docsis_dpd_tlv_unknown,
{"Unknown TLV", "docsis_dpd.unknown_tlv",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpd_dschid,
{"Downstream Channel ID", "docsis_dpd.dschid", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_dpd_prof_id,
{"Profile Identifier", "docsis_dpd.prof_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_dpd_ccc,
{"Configuration Change Count", "docsis_dpd.ccc", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_dpd_tlv_subc_assign_type,
{"Subcarrier Assignment Type", "docsis_dpd.tlv.subc_assign.type", FT_UINT8, BASE_DEC, VALS(docsis_dpd_subc_assign_type_str), 0xC0, NULL, HFILL}
},
{&hf_docsis_dpd_tlv_subc_assign_value,
{"Subcarrier Assignment Value", "docsis_dpd.tlv.subc_assign.value", FT_UINT8, BASE_DEC, VALS(docsis_dpd_subc_assign_value_str), 0x20, NULL, HFILL}
},
{&hf_docsis_dpd_tlv_subc_assign_reserved,
{"reserved", "docsis_dpd.tlv.subc_assign.reserved", FT_UINT8, BASE_DEC, NULL, 0x10, NULL, HFILL}
},
{&hf_docsis_dpd_tlv_subc_assign_modulation,
{"Subcarrier Assignment Modulation", "docsis_dpd.tlv.subc_assign.modulation", FT_UINT8, BASE_DEC, VALS(docsis_dpd_subc_assign_modulation_str), 0x0F, NULL, HFILL}
},
{&hf_docsis_dpd_subc_assign_range,
{"Subcarrier index range", "docsis_dpd.tlv.subc_assign.range", FT_UINT32, BASE_CUSTOM, CF_FUNC(subc_assign_range), 0x00, NULL, HFILL}
},
{&hf_docsis_dpd_subc_assign_index,
{"Subcarrier index", "docsis_dpd.tlv.subc_assign.index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL}
},
{&hf_docsis_dpd_tlv_subc_assign_vector_oddness,
{"Odd or even", "docsis_dpd.tlv.subc_assign_vect.oddness", FT_UINT8, BASE_DEC, VALS(docsis_dpd_tlv_subc_assign_vector_oddness_str), 0x80, NULL, HFILL}
},
{&hf_docsis_dpd_tlv_subc_assign_vector_reserved,
{"Reserved", "docsis_dpd.tlv.subc_assign_vect.reserved", FT_UINT8, BASE_DEC, NULL, 0x60, NULL, HFILL}
},
{&hf_docsis_dpd_tlv_subc_assign_vector_subc_start,
{"Subcarrier start", "docsis_dpd.tlv.subc_assign_vect.subc_start", FT_UINT16, BASE_DEC, NULL, 0x1FFF, NULL, HFILL}
},
{&hf_docsis_dpd_tlv_subc_assign_vector_modulation_odd,
{"Modulation", "docsis_dpd.tlv.subc_assign_vect.modulation", FT_UINT8, BASE_DEC, VALS(docsis_dpd_tlv_subc_assign_vector_modulation_str), 0xF0, NULL, HFILL}
},
{&hf_docsis_dpd_tlv_subc_assign_vector_modulation_even,
{"Modulation", "docsis_dpd.tlv.subc_assign_vect.modulation", FT_UINT8, BASE_DEC, VALS(docsis_dpd_tlv_subc_assign_vector_modulation_str), 0x0F, NULL, HFILL}
},
{&hf_docsis_dpd_tlv_data,
{"TLV Data", "docsis_dpd.tlv_data", FT_BYTES, BASE_NO_DISPLAY_VALUE, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_dpd_type,
{"Type", "docsis_dpd.type",FT_UINT8, BASE_DEC, VALS(dpd_tlv_vals), 0x0, NULL, HFILL}
},
{&hf_docsis_dpd_length,
{"Length", "docsis_dpd.length",FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
};
static ei_register_info ei[] = {
{&ei_docsis_dpd_tlvlen_bad, { "docsis_dpd.tlvlenbad", PI_MALFORMED, PI_ERROR, "Bad TLV length", EXPFILL}},
{&ei_docsis_dpd_value_unknown, { "docsis_dpd.valueunknown", PI_PROTOCOL, PI_WARN, "Unknown value", EXPFILL}}
};
static gint *ett[] = {
&ett_docsis_dpd,
&ett_docsis_dpd_tlv,
&ett_docsis_dpd_tlvtlv,
&ett_docsis_dpd_tlv_subcarrier_assignment,
&ett_docsis_dpd_tlv_subcarrier_assignment_vector
};
expert_module_t* expert_docsis_dpd;
proto_docsis_dpd = proto_register_protocol ("DOCSIS Downstream Profile Descriptor", "DOCSIS DPD", "docsis_dpd");
proto_register_field_array (proto_docsis_dpd, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
expert_docsis_dpd = expert_register_protocol(proto_docsis_dpd);
expert_register_field_array(expert_docsis_dpd, ei, array_length(ei));
docsis_dpd_handle = register_dissector ("docsis_dpd", dissect_dpd, proto_docsis_dpd);
}
void
proto_reg_handoff_docsis_dpd (void)
{
dissector_add_uint ("docsis_mgmt", 0x32, docsis_dpd_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,159 +0,0 @@
/* packet-dpvreq.c
* Routines for DOCSIS 3.0 DOCSIS Path Verify Response Message dissection.
* Copyright 2010, Guido Reismueller <g.reismueller[AT]avm.de>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_dpvreq(void);
void proto_reg_handoff_docsis_dpvreq(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dpvreq = -1;
static int hf_docsis_dpvreq_tranid = -1;
static int hf_docsis_dpvreq_dschan = -1;
static int hf_docsis_dpvreq_flags = -1;
static int hf_docsis_dpvreq_us_sf = -1;
static int hf_docsis_dpvreq_n = -1;
static int hf_docsis_dpvreq_start = -1;
static int hf_docsis_dpvreq_end = -1;
static int hf_docsis_dpvreq_ts_start = -1;
static int hf_docsis_dpvreq_ts_end = -1;
/* Initialize the subtree pointers */
static gint ett_docsis_dpvreq = -1;
static dissector_handle_t docsis_dpvreq_handle;
/* Dissection */
static int
dissect_dpvreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *dpvreq_tree;
guint32 transid, dschan;
it = proto_tree_add_item(tree, proto_docsis_dpvreq, tvb, 0, -1, ENC_NA);
dpvreq_tree = proto_item_add_subtree (it, ett_docsis_dpvreq);
proto_tree_add_item_ret_uint (dpvreq_tree, hf_docsis_dpvreq_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid);
proto_tree_add_item_ret_uint (dpvreq_tree, hf_docsis_dpvreq_dschan, tvb, 2, 1, ENC_BIG_ENDIAN, &dschan);
col_add_fstr (pinfo->cinfo, COL_INFO,
"DOCSIS Path Verify Request: Transaction-Id = %u DS-Ch %d",
transid, dschan);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_flags, tvb, 3, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_us_sf, tvb, 4, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_n, tvb, 8, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_start, tvb, 10, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_end, tvb, 11, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_ts_start, tvb, 12, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_ts_end, tvb, 16, 4, ENC_BIG_ENDIAN);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dpvreq (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dpvreq_tranid,
{"Transaction Id", "docsis_dpvreq.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_dschan,
{"Downstream Channel ID", "docsis_dpvreq.dschan",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_flags,
{"Flags", "docsis_dpvreq.flags",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_us_sf,
{"Upstream Service Flow ID", "docsis_dpvreq.us_sf",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_n,
{"N (Measurement avaraging factor)", "docsis_dpvreq.n",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_start,
{"Start Reference Point", "docsis_dpvreq.start",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_end,
{"End Reference Point", "docsis_dpvreq.end",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_ts_start,
{"Timestamp Start", "docsis_dpvreq.ts_start",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_ts_end,
{"Timestamp End", "docsis_dpvreq.ts_end",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_dpvreq,
};
proto_docsis_dpvreq =
proto_register_protocol ("DOCSIS Path Verify Request",
"DOCSIS DPV-REQ", "docsis_dpvreq");
proto_register_field_array (proto_docsis_dpvreq, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_dpvreq_handle = register_dissector ("docsis_dpvreq", dissect_dpvreq, proto_docsis_dpvreq);
}
void
proto_reg_handoff_docsis_dpvreq (void)
{
dissector_add_uint ("docsis_mgmt", 0x27, docsis_dpvreq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,159 +0,0 @@
/* packet-dpvrsp.c
* Routines for DOCSIS 3.0 DOCSIS Path Verify Request Message dissection.
* Copyright 2010, Guido Reismueller <g.reismueller[AT]avm.de>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_dpvrsp(void);
void proto_reg_handoff_docsis_dpvrsp(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dpvrsp = -1;
static int hf_docsis_dpvrsp_tranid = -1;
static int hf_docsis_dpvrsp_dschan = -1;
static int hf_docsis_dpvrsp_flags = -1;
static int hf_docsis_dpvrsp_us_sf = -1;
static int hf_docsis_dpvrsp_n = -1;
static int hf_docsis_dpvrsp_start = -1;
static int hf_docsis_dpvrsp_end = -1;
static int hf_docsis_dpvrsp_ts_start = -1;
static int hf_docsis_dpvrsp_ts_end = -1;
/* Initialize the subtree pointers */
static gint ett_docsis_dpvrsp = -1;
static dissector_handle_t docsis_dpvrsp_handle;
/* Dissection */
static int
dissect_dpvrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *dpvrsp_tree = NULL;
guint32 transid, dschan;
it = proto_tree_add_item (tree, proto_docsis_dpvrsp, tvb, 0, -1, ENC_NA);
dpvrsp_tree = proto_item_add_subtree (it, ett_docsis_dpvrsp);
proto_tree_add_item_ret_uint (dpvrsp_tree, hf_docsis_dpvrsp_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid);
proto_tree_add_item_ret_uint (dpvrsp_tree, hf_docsis_dpvrsp_dschan, tvb, 2, 1, ENC_BIG_ENDIAN, &dschan);
col_add_fstr (pinfo->cinfo, COL_INFO,
"DOCSIS Path Verify Response: Transaction-Id = %u DS-Ch %d",
transid, dschan);
proto_tree_add_item (dpvrsp_tree, hf_docsis_dpvrsp_flags, tvb, 3, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvrsp_tree, hf_docsis_dpvrsp_us_sf, tvb, 4, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvrsp_tree, hf_docsis_dpvrsp_n, tvb, 8, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvrsp_tree, hf_docsis_dpvrsp_start, tvb, 10, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvrsp_tree, hf_docsis_dpvrsp_end, tvb, 11, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvrsp_tree, hf_docsis_dpvrsp_ts_start, tvb, 12, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvrsp_tree, hf_docsis_dpvrsp_ts_end, tvb, 16, 4, ENC_BIG_ENDIAN);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dpvrsp (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dpvrsp_tranid,
{"Transaction Id", "docsis_dpvrsp.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvrsp_dschan,
{"Downstream Channel ID", "docsis_dpvrsp.dschan",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvrsp_flags,
{"Flags", "docsis_dpvrsp.flags",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvrsp_us_sf,
{"Upstream Service Flow ID", "docsis_dpvrsp.us_sf",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvrsp_n,
{"N (Measurement avaraging factor)", "docsis_dpvrsp.n",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvrsp_start,
{"Start Reference Point", "docsis_dpvrsp.start",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvrsp_end,
{"End Reference Point", "docsis_dpvrsp.end",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvrsp_ts_start,
{"Timestamp Start", "docsis_dpvrsp.ts_start",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvrsp_ts_end,
{"Timestamp End", "docsis_dpvrsp.ts_end",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_dpvrsp,
};
proto_docsis_dpvrsp =
proto_register_protocol ("DOCSIS Path Verify Response",
"DOCSIS DPV-RSP", "docsis_dpvrsp");
proto_register_field_array (proto_docsis_dpvrsp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_dpvrsp_handle = register_dissector ("docsis_dpvrsp", dissect_dpvrsp, proto_docsis_dpvrsp);
}
void
proto_reg_handoff_docsis_dpvrsp (void)
{
dissector_add_uint ("docsis_mgmt", 0x28, docsis_dpvrsp_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,117 +0,0 @@
/* packet-dsaack.c
* Routines for Dynamic Service Addition Acknowledge dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_dsaack(void);
void proto_reg_handoff_docsis_dsaack(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dsaack = -1;
static int hf_docsis_dsaack_tranid = -1;
static int hf_docsis_dsaack_response = -1;
static dissector_handle_t docsis_tlv_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_dsaack = -1;
extern value_string docsis_conf_code[];
static dissector_handle_t docsis_dsaack_handle;
/* Dissection */
static int
dissect_dsaack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *dsaack_tree;
guint32 transid, response;
tvbuff_t *next_tvb;
it = proto_tree_add_item (tree, proto_docsis_dsaack, tvb, 0, -1, ENC_NA);
dsaack_tree = proto_item_add_subtree (it, ett_docsis_dsaack);
proto_tree_add_item_ret_uint (dsaack_tree, hf_docsis_dsaack_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid);
proto_tree_add_item_ret_uint (dsaack_tree, hf_docsis_dsaack_response, tvb, 2, 1, ENC_BIG_ENDIAN, &response);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Dynamic Service Add Ack ID = %u (%s)", transid,
val_to_str (response, docsis_conf_code, "%d"));
/* Call Dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 3);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsaack_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dsaack (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dsaack_tranid,
{"Transaction Id", "docsis_dsaack.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Service Identifier", HFILL}
},
{&hf_docsis_dsaack_response,
{"Confirmation Code", "docsis_dsaack.confcode",
FT_UINT8, BASE_DEC, VALS (docsis_conf_code), 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_dsaack,
};
proto_docsis_dsaack =
proto_register_protocol ("DOCSIS Dynamic Service Addition Acknowledge",
"DOCSIS DSA-ACK", "docsis_dsaack");
proto_register_field_array (proto_docsis_dsaack, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_dsaack_handle = register_dissector ("docsis_dsaack", dissect_dsaack, proto_docsis_dsaack);
}
void
proto_reg_handoff_docsis_dsaack (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 0x11, docsis_dsaack_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,108 +0,0 @@
/* packet-dsareq.c
* Routines for Dynamic Service Addition Request dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_dsareq(void);
void proto_reg_handoff_docsis_dsareq(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dsareq = -1;
static int hf_docsis_dsareq_tranid = -1;
static dissector_handle_t docsis_tlv_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_dsareq = -1;
static dissector_handle_t docsis_dsareq_handle;
/* Dissection */
static int
dissect_dsareq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *dsareq_tree;
guint32 transid;
tvbuff_t *next_tvb;
it = proto_tree_add_item(tree, proto_docsis_dsareq, tvb, 0, -1, ENC_NA);
dsareq_tree = proto_item_add_subtree (it, ett_docsis_dsareq);
proto_tree_add_item_ret_uint (dsareq_tree, hf_docsis_dsareq_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Dynamic Service Addition Request Tran-id = %u", transid);
/* Call Dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 2);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsareq_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dsareq (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dsareq_tranid,
{"Transaction Id", "docsis_dsareq.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_dsareq,
};
proto_docsis_dsareq =
proto_register_protocol ("DOCSIS Dynamic Service Addition Request",
"DOCSIS DSA-REQ", "docsis_dsareq");
proto_register_field_array (proto_docsis_dsareq, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_dsareq_handle = register_dissector ("docsis_dsareq", dissect_dsareq, proto_docsis_dsareq);
}
void
proto_reg_handoff_docsis_dsareq (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 0x0F, docsis_dsareq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,118 +0,0 @@
/* packet-dsarsp.c
* Routines for Dynamic Service Addition Response dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_dsarsp(void);
void proto_reg_handoff_docsis_dsarsp(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dsarsp = -1;
static int hf_docsis_dsarsp_tranid = -1;
static int hf_docsis_dsarsp_response = -1;
static dissector_handle_t docsis_tlv_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_dsarsp = -1;
static dissector_handle_t docsis_dsarsp_handle;
extern value_string docsis_conf_code[];
/* Dissection */
static int
dissect_dsarsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *dsarsp_tree;
guint32 transid, response;
tvbuff_t *next_tvb;
it = proto_tree_add_item (tree, proto_docsis_dsarsp, tvb, 0, -1, ENC_NA);
dsarsp_tree = proto_item_add_subtree (it, ett_docsis_dsarsp);
proto_tree_add_item_ret_uint (dsarsp_tree, hf_docsis_dsarsp_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid);
proto_tree_add_item_ret_uint (dsarsp_tree, hf_docsis_dsarsp_response, tvb, 2, 1, ENC_BIG_ENDIAN, &response);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Dynamic Service Add Response ID = %u (%s)", transid,
val_to_str (response, docsis_conf_code, "%d"));
/* Call dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 3);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsarsp_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dsarsp (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dsarsp_tranid,
{"Transaction Id", "docsis_dsarsp.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Service Identifier", HFILL}
},
{&hf_docsis_dsarsp_response,
{"Confirmation Code", "docsis_dsarsp.confcode",
FT_UINT8, BASE_DEC, VALS (docsis_conf_code), 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_dsarsp,
};
proto_docsis_dsarsp =
proto_register_protocol ("DOCSIS Dynamic Service Addition Response",
"DOCSIS DSA-RSP", "docsis_dsarsp");
proto_register_field_array (proto_docsis_dsarsp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_dsarsp_handle = register_dissector ("docsis_dsarsp", dissect_dsarsp, proto_docsis_dsarsp);
}
void
proto_reg_handoff_docsis_dsarsp (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 0x10, docsis_dsarsp_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,118 +0,0 @@
/* packet-dscack.c
* Routines for Dynamic Service Change Acknowledge dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_dscack(void);
void proto_reg_handoff_docsis_dscack(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dscack = -1;
static int hf_docsis_dscack_tranid = -1;
static int hf_docsis_dscack_response = -1;
static dissector_handle_t docsis_tlv_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_dscack = -1;
extern value_string docsis_conf_code[];
static dissector_handle_t docsis_dscack_handle;
/* Dissection */
static int
dissect_dscack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *dscack_tree;
guint32 transid, response;
tvbuff_t *next_tvb;
it = proto_tree_add_item(tree, proto_docsis_dscack, tvb, 0, -1, ENC_NA);
dscack_tree = proto_item_add_subtree (it, ett_docsis_dscack);
proto_tree_add_item_ret_uint (dscack_tree, hf_docsis_dscack_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid);
proto_tree_add_item_ret_uint (dscack_tree, hf_docsis_dscack_response, tvb, 2, 1, ENC_BIG_ENDIAN, &response);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Dynamic Service Change Ack ID = %u (%s)", transid,
val_to_str (response, docsis_conf_code, "%d"));
/* Call Dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 3);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscack_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dscack (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dscack_tranid,
{"Transaction Id", "docsis_dscack.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Service Identifier", HFILL}
},
{&hf_docsis_dscack_response,
{"Confirmation Code", "docsis_dscack.confcode",
FT_UINT8, BASE_DEC, VALS (docsis_conf_code), 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_dscack,
};
proto_docsis_dscack =
proto_register_protocol ("DOCSIS Dynamic Service Change Acknowledgement",
"DOCSIS DSC-ACK", "docsis_dscack");
proto_register_field_array (proto_docsis_dscack, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_dscack_handle = register_dissector ("docsis_dscack", dissect_dscack, proto_docsis_dscack);
}
void
proto_reg_handoff_docsis_dscack (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 0x14, docsis_dscack_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,108 +0,0 @@
/* packet-dscreq.c
* Routines for Dynamic Service Change Request dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_dscreq(void);
void proto_reg_handoff_docsis_dscreq(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dscreq = -1;
static int hf_docsis_dscreq_tranid = -1;
static dissector_handle_t docsis_tlv_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_dscreq = -1;
static dissector_handle_t docsis_dscreq_handle;
/* Dissection */
static int
dissect_dscreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *dscreq_tree;
guint32 transid;
tvbuff_t *next_tvb;
it = proto_tree_add_item (tree, proto_docsis_dscreq, tvb, 0, -1, ENC_NA);
dscreq_tree = proto_item_add_subtree (it, ett_docsis_dscreq);
proto_tree_add_item_ret_uint (dscreq_tree, hf_docsis_dscreq_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Dynamic Service Change Request Tran-id = %u", transid);
/* Call dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 2);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscreq_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dscreq (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dscreq_tranid,
{"Transaction Id", "docsis_dscreq.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_dscreq,
};
proto_docsis_dscreq =
proto_register_protocol ("DOCSIS Dynamic Service Change Request",
"DOCSIS DSC-REQ", "docsis_dscreq");
proto_register_field_array (proto_docsis_dscreq, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_dscreq_handle = register_dissector ("docsis_dscreq", dissect_dscreq, proto_docsis_dscreq);
}
void
proto_reg_handoff_docsis_dscreq (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 0x12, docsis_dscreq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,118 +0,0 @@
/* packet-dscrsp.c
* Routines for Dynamic Service Change Response dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_dscrsp(void);
void proto_reg_handoff_docsis_dscrsp(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dscrsp = -1;
static int hf_docsis_dscrsp_tranid = -1;
static int hf_docsis_dscrsp_response = -1;
static dissector_handle_t docsis_tlv_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_dscrsp = -1;
extern value_string docsis_conf_code[];
static dissector_handle_t docsis_dscrsp_handle;
/* Dissection */
static int
dissect_dscrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *dscrsp_tree;
guint32 transid, response;
tvbuff_t *next_tvb;
it = proto_tree_add_item(tree, proto_docsis_dscrsp, tvb, 0, -1, ENC_NA);
dscrsp_tree = proto_item_add_subtree (it, ett_docsis_dscrsp);
proto_tree_add_item_ret_uint (dscrsp_tree, hf_docsis_dscrsp_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid);
proto_tree_add_item_ret_uint (dscrsp_tree, hf_docsis_dscrsp_response, tvb, 2, 1, ENC_BIG_ENDIAN, &response);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Dynamic Service Change Response ID = %u (%s)", transid,
val_to_str (response, docsis_conf_code, "%d"));
/* Call Dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 3);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscrsp_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dscrsp (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dscrsp_tranid,
{"Transaction Id", "docsis_dscrsp.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Service Identifier", HFILL}
},
{&hf_docsis_dscrsp_response,
{"Confirmation Code", "docsis_dscrsp.confcode",
FT_UINT8, BASE_DEC, VALS (docsis_conf_code), 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_dscrsp,
};
proto_docsis_dscrsp =
proto_register_protocol ("DOCSIS Dynamic Service Change Response",
"DOCSIS DSC-RSP", "docsis_dscrsp");
proto_register_field_array (proto_docsis_dscrsp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_dscrsp_handle = register_dissector ("docsis_dscrsp", dissect_dscrsp, proto_docsis_dscrsp);
}
void
proto_reg_handoff_docsis_dscrsp (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 0x13, docsis_dscrsp_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,124 +0,0 @@
/* packet-dsdreq.c
* Routines for Dynamic Service Delete Request dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_dsdreq(void);
void proto_reg_handoff_docsis_dsdreq(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dsdreq = -1;
static int hf_docsis_dsdreq_tranid = -1;
static int hf_docsis_dsdreq_rsvd = -1;
static int hf_docsis_dsdreq_sfid = -1;
static dissector_handle_t docsis_tlv_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_dsdreq = -1;
static dissector_handle_t docsis_dsdreq_handle;
/* Dissection */
static int
dissect_dsdreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *dsdreq_tree;
guint32 transid;
tvbuff_t *next_tvb;
it = proto_tree_add_item (tree, proto_docsis_dsdreq, tvb, 0, -1, ENC_NA);
dsdreq_tree = proto_item_add_subtree (it, ett_docsis_dsdreq);
proto_tree_add_item_ret_uint (dsdreq_tree, hf_docsis_dsdreq_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Dynamic Service Delete Request Tran-id = %u", transid);
proto_tree_add_item (dsdreq_tree, hf_docsis_dsdreq_rsvd, tvb, 2, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (dsdreq_tree, hf_docsis_dsdreq_sfid, tvb, 4, 4, ENC_BIG_ENDIAN);
/* Call Dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 8);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsdreq_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dsdreq (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dsdreq_tranid,
{"Transaction Id", "docsis_dsdreq.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dsdreq_rsvd,
{"Reserved", "docsis_dsdreq.rsvd",
FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dsdreq_sfid,
{"Service Flow ID", "docsis_dsdreq.sfid",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_dsdreq,
};
proto_docsis_dsdreq =
proto_register_protocol ("DOCSIS Dynamic Service Delete Request",
"DOCSIS DSD-REQ", "docsis_dsdreq");
proto_register_field_array (proto_docsis_dsdreq, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_dsdreq_handle = register_dissector ("docsis_dsdreq", dissect_dsdreq, proto_docsis_dsdreq);
}
void
proto_reg_handoff_docsis_dsdreq (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 0x15, docsis_dsdreq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,118 +0,0 @@
/* packet-dsdrsp.c
* Routines for Dynamic Service Delete Response dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_dsdrsp(void);
void proto_reg_handoff_docsis_dsdrsp(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dsdrsp = -1;
static int hf_docsis_dsdrsp_tranid = -1;
static int hf_docsis_dsdrsp_confcode = -1;
static int hf_docsis_dsdrsp_rsvd = -1;
extern value_string docsis_conf_code[];
/* Initialize the subtree pointers */
static gint ett_docsis_dsdrsp = -1;
static dissector_handle_t docsis_dsdrsp_handle;
/* Dissection */
static int
dissect_dsdrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *dsdrsp_tree;
guint32 tranid, confcode;
it = proto_tree_add_item(tree, proto_docsis_dsdrsp, tvb, 0, -1, ENC_NA);
dsdrsp_tree = proto_item_add_subtree (it, ett_docsis_dsdrsp);
proto_tree_add_item_ret_uint (dsdrsp_tree, hf_docsis_dsdrsp_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &tranid);
proto_tree_add_item_ret_uint (dsdrsp_tree, hf_docsis_dsdrsp_confcode, tvb, 2, 1, ENC_BIG_ENDIAN, &confcode);
proto_tree_add_item (dsdrsp_tree, hf_docsis_dsdrsp_rsvd, tvb, 3, 1, ENC_BIG_ENDIAN);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Dynamic Service Delete Response Tran id = %u (%s)",
tranid, val_to_str (confcode, docsis_conf_code, "%d"));
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dsdrsp (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dsdrsp_tranid,
{"Transaction Id", "docsis_dsdrsp.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dsdrsp_confcode,
{"Confirmation Code", "docsis_dsdrsp.confcode",
FT_UINT8, BASE_DEC, VALS (docsis_conf_code), 0x0,
NULL, HFILL}
},
{&hf_docsis_dsdrsp_rsvd,
{"Reserved", "docsis_dsdrsp.rsvd",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_dsdrsp,
};
proto_docsis_dsdrsp =
proto_register_protocol ("DOCSIS Dynamic Service Delete Response",
"DOCSIS DSD-RSP", "docsis_dsdrsp");
proto_register_field_array (proto_docsis_dsdrsp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_dsdrsp_handle = register_dissector ("docsis_dsdrsp", dissect_dsdrsp, proto_docsis_dsdrsp);
}
void
proto_reg_handoff_docsis_dsdrsp (void)
{
dissector_add_uint ("docsis_mgmt", 0x16, docsis_dsdrsp_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,116 +0,0 @@
/* packet-intrngreq.c
* Routines for Intial Ranging Request Message dissection
* Copyright 2003, Brian Wheeler <brian.wheeler[AT]arrisi.com>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
/* Initialize the protocol and registered fields */
static int proto_docsis_intrngreq = -1;
static int hf_docsis_intrngreq_down_chid = -1;
static int hf_docsis_intrngreq_sid = -1;
static int hf_docsis_intrngreq_up_chid = -1;
void proto_register_docsis_intrngreq(void);
void proto_reg_handoff_docsis_intrngreq(void);
/* Initialize the subtree pointers */
static gint ett_docsis_intrngreq = -1;
static dissector_handle_t docsis_intrngreq_handle;
/* Dissection */
static int
dissect_intrngreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *intrngreq_item;
proto_tree *intrngreq_tree;
guint32 sid;
intrngreq_item = proto_tree_add_item(tree, proto_docsis_intrngreq, tvb, 0, -1, ENC_NA);
intrngreq_tree = proto_item_add_subtree (intrngreq_item, ett_docsis_intrngreq);
proto_tree_add_item_ret_uint (intrngreq_tree, hf_docsis_intrngreq_sid, tvb, 0, 2, ENC_BIG_ENDIAN, &sid);
col_add_fstr (pinfo->cinfo, COL_INFO, "Initial Ranging Request: SID = %u",sid);
proto_tree_add_item (intrngreq_tree, hf_docsis_intrngreq_down_chid, tvb, 2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (intrngreq_tree, hf_docsis_intrngreq_up_chid, tvb, 3, 1, ENC_BIG_ENDIAN);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_intrngreq (void)
{
static hf_register_info hf[] = {
{&hf_docsis_intrngreq_sid,
{"Service Identifier", "docsis_intrngreq.sid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_intrngreq_down_chid,
{"Downstream Channel ID", "docsis_intrngreq.downchid",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_intrngreq_up_chid,
{"Upstream Channel ID", "docsis_intrngreq.upchid",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_intrngreq,
};
proto_docsis_intrngreq = proto_register_protocol ("DOCSIS Initial Ranging Message",
"DOCSIS INT-RNG-REQ",
"docsis_intrngreq");
proto_register_field_array (proto_docsis_intrngreq, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_intrngreq_handle = register_dissector ("docsis_intrngreq", dissect_intrngreq, proto_docsis_intrngreq);
}
void
proto_reg_handoff_docsis_intrngreq (void)
{
dissector_add_uint ("docsis_mgmt", 0x1E, docsis_intrngreq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

File diff suppressed because it is too large Load Diff

View File

@ -1,246 +0,0 @@
/* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#define IUC_REQUEST 1
#define IUC_REQ_DATA 2
#define IUC_INIT_MAINT 3
#define IUC_STATION_MAINT 4
#define IUC_SHORT_DATA_GRANT 5
#define IUC_LONG_DATA_GRANT 6
#define IUC_NULL_IE 7
#define IUC_DATA_ACK 8
#define IUC_ADV_PHY_SHORT_DATA_GRANT 9
#define IUC_ADV_PHY_LONG_DATA_GRANT 10
#define IUC_ADV_PHY_UGS 11
#define IUC_RESERVED12 12
#define IUC_RESERVED13 13
#define IUC_RESERVED14 14
#define IUC_EXPANSION 15
void proto_register_docsis_map(void);
void proto_reg_handoff_docsis_map(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_map = -1;
static int hf_docsis_map_upstream_chid = -1;
static int hf_docsis_map_ucd_count = -1;
static int hf_docsis_map_numie = -1;
static int hf_docsis_map_alloc_start = -1;
static int hf_docsis_map_ack_time = -1;
static int hf_docsis_map_rng_start = -1;
static int hf_docsis_map_rng_end = -1;
static int hf_docsis_map_data_start = -1;
static int hf_docsis_map_data_end = -1;
static int hf_docsis_map_ie = -1;
static int hf_docsis_map_rsvd = -1;
static int hf_docsis_map_sid = -1;
static int hf_docsis_map_iuc = -1;
static int hf_docsis_map_offset = -1;
/* Initialize the subtree pointers */
static gint ett_docsis_map = -1;
static gint ett_docsis_map_ie = -1;
static dissector_handle_t docsis_map_handle;
static const value_string iuc_vals[] = {
{IUC_REQUEST, "Request"},
{IUC_REQ_DATA, "REQ/Data"},
{IUC_INIT_MAINT, "Initial Maintenance"},
{IUC_STATION_MAINT, "Station Maintenance"},
{IUC_SHORT_DATA_GRANT, "Short Data Grant"},
{IUC_LONG_DATA_GRANT, "Long Data Grant"},
{IUC_NULL_IE, "NULL IE"},
{IUC_DATA_ACK, "Data Ack"},
{IUC_ADV_PHY_SHORT_DATA_GRANT, "Advanced Phy Short Data Grant"},
{IUC_ADV_PHY_LONG_DATA_GRANT, "Advanced Phy Long Data Grant"},
{IUC_ADV_PHY_UGS, "Advanced Phy UGS"},
{IUC_RESERVED12, "Reserved"},
{IUC_RESERVED13, "Reserved"},
{IUC_RESERVED14, "Reserved"},
{IUC_EXPANSION, "Expanded IUC"},
{0, NULL}
};
/* Code to actually dissect the packets */
static int
dissect_map (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
guint32 i, numie, upchid, ucd_count;
int pos;
proto_item *it;
proto_tree *map_tree;
static const int * ies[] = {
&hf_docsis_map_sid,
&hf_docsis_map_iuc,
&hf_docsis_map_offset,
NULL
};
it = proto_tree_add_item(tree, proto_docsis_map, tvb, 0, -1, ENC_NA);
map_tree = proto_item_add_subtree (it, ett_docsis_map);
proto_tree_add_item_ret_uint (map_tree, hf_docsis_map_upstream_chid, tvb, 0, 1, ENC_BIG_ENDIAN, &upchid);
proto_tree_add_item_ret_uint (map_tree, hf_docsis_map_ucd_count, tvb, 1, 1, ENC_BIG_ENDIAN, &ucd_count);
proto_tree_add_item_ret_uint (map_tree, hf_docsis_map_numie, tvb, 2, 1, ENC_BIG_ENDIAN, &numie);
if (upchid > 0)
col_add_fstr (pinfo->cinfo, COL_INFO,
"Map Message: Channel ID = %u (U%u), UCD Count = %u, # IE's = %u",
upchid, upchid - 1, ucd_count, numie);
else
col_add_fstr (pinfo->cinfo, COL_INFO,
"Map Message: Channel ID = %u (Telephony Return), UCD Count = %u, # IE's = %u",
upchid, ucd_count, numie);
proto_tree_add_item (map_tree, hf_docsis_map_rsvd, tvb, 3, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (map_tree, hf_docsis_map_alloc_start, tvb, 4, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (map_tree, hf_docsis_map_ack_time, tvb, 8, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (map_tree, hf_docsis_map_rng_start, tvb, 12, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (map_tree, hf_docsis_map_rng_end, tvb, 13, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (map_tree, hf_docsis_map_data_start, tvb, 14, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (map_tree, hf_docsis_map_data_end, tvb, 15, 1, ENC_BIG_ENDIAN);
pos = 16;
for (i = 0; i < numie; i++)
{
proto_tree_add_bitmask_with_flags(map_tree, tvb, pos, hf_docsis_map_ie, ett_docsis_map_ie, ies, ENC_BIG_ENDIAN, BMT_NO_FLAGS);
pos = pos + 4;
}
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_map (void)
{
static hf_register_info hf[] = {
{&hf_docsis_map_ucd_count,
{"UCD Count", "docsis_map.ucdcount",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Map UCD Count", HFILL}
},
{&hf_docsis_map_upstream_chid,
{"Upstream Channel ID", "docsis_map.upchid",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_map_numie,
{"Number of IE's", "docsis_map.numie",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Number of Information Elements", HFILL}
},
{&hf_docsis_map_alloc_start,
{"Alloc Start Time (minislots)", "docsis_map.allocstart",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_map_ack_time,
{"ACK Time (minislots)", "docsis_map.acktime",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_map_rng_start,
{"Ranging Backoff Start", "docsis_map.rng_start",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_map_rng_end,
{"Ranging Backoff End", "docsis_map.rng_end",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_map_data_start,
{"Data Backoff Start", "docsis_map.data_start",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_map_data_end,
{"Data Backoff End", "docsis_map.data_end",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_map_ie,
{"Information Element", "docsis_map.ie",
FT_UINT32, BASE_HEX, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_map_rsvd,
{"Reserved", "docsis_map.rsvd",
FT_UINT8, BASE_HEX, NULL, 0x0,
"Reserved Byte", HFILL}
},
{&hf_docsis_map_sid,
{"Service Identifier", "docsis_map.sid",
FT_UINT32, BASE_DEC, NULL, 0xFFFC0000,
NULL, HFILL}
},
{&hf_docsis_map_iuc,
{"Interval Usage Code", "docsis_map.iuc",
FT_UINT32, BASE_DEC, VALS(iuc_vals), 0x0003c000,
NULL, HFILL}
},
{&hf_docsis_map_offset,
{"Offset", "docsis_map.offset",
FT_UINT32, BASE_DEC, NULL, 0x00003fff,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_map,
&ett_docsis_map_ie,
};
proto_docsis_map =
proto_register_protocol ("DOCSIS Upstream Bandwidth Allocation", "DOCSIS MAP", "docsis_map");
proto_register_field_array (proto_docsis_map, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_map_handle = register_dissector ("docsis_map", dissect_map, proto_docsis_map);
}
void
proto_reg_handoff_docsis_map (void)
{
dissector_add_uint ("docsis_mgmt", 0x03, docsis_map_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

File diff suppressed because it is too large Load Diff

View File

@ -1,410 +0,0 @@
/* packet-ocd.c
* Routines for DOCSIS 3.1 OFDM Channel Descriptor dissection.
* Copyright 2016, Bruno Verstuyft <bruno.verstuyft@excentis.com>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#include <wsutil/utf8_entities.h>
#define DISCRETE_FOURIER_TRANSFORM_SIZE 0
#define CYCLIC_PREFIX 1
#define ROLL_OFF 2
#define OFDM_SPECTRUM_LOCATION 3
#define TIME_INTERLEAVING_DEPTH 4
#define SUBCARRIER_ASSIGNMENT_RANGE_LIST 5
#define PRIMARY_CAPABILITY_INDICATOR 6
#define SUBCARRIER_ASSIGNMENT_RANGE_CONT 0
#define SUBCARRIER_ASSIGNMENT_RANGE_SKIPBY1 1
#define SUBCARRIER_ASSIGNMENT_LIST 2
void proto_register_docsis_ocd(void);
void proto_reg_handoff_docsis_ocd(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_ocd = -1;
static int hf_docsis_ocd_tlv_unknown = -1;
static int hf_docsis_ocd_dschid = -1;
static int hf_docsis_ocd_ccc = -1;
static int hf_docsis_ocd_tlv_four_trans_size = -1;
static int hf_docsis_ocd_tlv_cycl_pref = -1;
static int hf_docsis_ocd_tlv_roll_off = -1;
static int hf_docsis_ocd_tlv_ofdm_spec_loc = -1;
static int hf_docsis_ocd_tlv_time_int_depth = -1;
static int hf_docsis_ocd_tlv_prim_cap_ind = -1;
static int hf_docsis_ocd_tlv_subc_assign_type = -1;
static int hf_docsis_ocd_tlv_subc_assign_value = -1;
static int hf_docsis_ocd_subc_assign_subc_type = -1;
static int hf_docsis_ocd_subc_assign_range = -1;
static int hf_docsis_ocd_subc_assign_index = -1;
static int hf_docsis_ocd_tlv_data = -1;
static int hf_docsis_ocd_type = -1;
static int hf_docsis_ocd_length = -1;
/* Initialize the subtree pointers */
static gint ett_docsis_ocd = -1;
static gint ett_docsis_ocd_tlv = -1;
static gint ett_docsis_ocd_tlvtlv = -1;
static expert_field ei_docsis_ocd_tlvlen_bad = EI_INIT;
static expert_field ei_docsis_ocd_value_unknown = EI_INIT;
static dissector_handle_t docsis_ocd_handle;
static const value_string docsis_ocd_four_trans_size[] = {
{0, "4096 subcarriers at 50 kHz spacing"},
{1, "8192 subcarriers at 25 kHz spacing"},
{0, NULL}
};
static const value_string docsis_ocd_cyc_prefix[] = {
{0, "0.9375 "UTF8_MICRO_SIGN"s with 192 samples"},
{1, "1.25 "UTF8_MICRO_SIGN"s with 256 samples"},
{2, "2.5 "UTF8_MICRO_SIGN"s with 512 samples"},
{3, "3.75 "UTF8_MICRO_SIGN"s with 768 samples"},
{4, "5.0 "UTF8_MICRO_SIGN"s with 1024 samples"},
{0, NULL}
};
static const value_string docsis_ocd_roll_off[] = {
{0, "0 "UTF8_MICRO_SIGN"s with 0 samples"},
{1, "0.3125 "UTF8_MICRO_SIGN"s with 64 samples"},
{2, "0.625 "UTF8_MICRO_SIGN"s with 128 samples"},
{3, "0.9375 "UTF8_MICRO_SIGN"s with 192 samples"},
{4, "1.25 "UTF8_MICRO_SIGN"s with 256 samples"},
{0, NULL}
};
static const value_string docsis_ocd_prim_cap_ind_str[] = {
{0, "channel is not primary capable"},
{1, "channel is primary capable"},
{0, NULL}
};
static const value_string ocd_tlv_vals[] = {
{DISCRETE_FOURIER_TRANSFORM_SIZE, "Discrete Fourier Transform Size"},
{CYCLIC_PREFIX, "Cylic Prefix"},
{ROLL_OFF, "Roll Off"},
{OFDM_SPECTRUM_LOCATION, "OFDM Spectrum Location"},
{TIME_INTERLEAVING_DEPTH, "Time Interleaving Depth"},
{SUBCARRIER_ASSIGNMENT_RANGE_LIST, "Subcarrier Assignment Range/List"},
{PRIMARY_CAPABILITY_INDICATOR, "Primary Capable Indicator"},
{0, NULL}
};
/** BASE_CUSTOM formatter for the OFDM spectrum location
*/
static void
subc_assign_range(
char *buf,
guint32 value)
{
g_snprintf(buf, ITEM_LABEL_LENGTH,
"%u - %u",
value >> 16, value &0xFFFF);
}
static const value_string docsis_ocd_subc_assign_type_str[] = {
{0, "range, continuous"},
{1, "range, skip by 1"},
{2, "list"},
{3, "reserved"},
{0, NULL}
};
static const value_string docsis_ocd_subc_assign_value_str[] = {
{0, "specific value"},
{1, "default value"},
{0, NULL}
};
static const value_string docsis_ocd_subc_assign_subc_type_str[] = {
{1, "continuous pilot"},
{16, "excluded subcarriers"},
{20, "PLC, 16-QAM"},
{0, NULL}
};
static const unit_name_string local_units_hz = { "Hz", NULL };
/* Dissection */
static void
dissect_subcarrier_assignment_range_list(tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree, guint16 pos, guint32 len)
{
proto_item* type_item;
guint32 i, subcarrier_assignment_type;
type_item = proto_tree_add_item_ret_uint (tree, hf_docsis_ocd_tlv_subc_assign_type, tvb, pos, 1, ENC_BIG_ENDIAN, &subcarrier_assignment_type);
proto_tree_add_item (tree, hf_docsis_ocd_tlv_subc_assign_value, tvb, pos, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_docsis_ocd_subc_assign_subc_type, tvb, pos, 1, ENC_BIG_ENDIAN);
pos++;
switch (subcarrier_assignment_type) {
case SUBCARRIER_ASSIGNMENT_RANGE_CONT:
case SUBCARRIER_ASSIGNMENT_RANGE_SKIPBY1:
proto_tree_add_item (tree, hf_docsis_ocd_subc_assign_range, tvb, pos, 4, ENC_BIG_ENDIAN);
break;
case SUBCARRIER_ASSIGNMENT_LIST:
for (i = 0; i < len/2; ++i) {
proto_tree_add_item (tree, hf_docsis_ocd_subc_assign_index, tvb, pos, 2, ENC_BIG_ENDIAN);
pos += 2;
}
break;
default:
expert_add_info_format(pinfo, type_item, &ei_docsis_ocd_value_unknown, "Unknown subcarrier assignment type %d", subcarrier_assignment_type);
break;
}
}
static void
dissect_ocd_tlv (tvbuff_t * tvb, packet_info* pinfo, proto_tree * tree)
{
proto_item *it, *tlv_item, *tlv_len_item;
proto_tree *tlv_tree;
guint16 pos = 0;
guint8 type;
guint32 length;
it = proto_tree_add_item(tree, hf_docsis_ocd_tlv_data, tvb, 0, tvb_reported_length(tvb), ENC_NA);
tlv_tree = proto_item_add_subtree (it, ett_docsis_ocd_tlv);
while (tvb_reported_length_remaining(tvb, pos) > 0)
{
type = tvb_get_guint8 (tvb, pos);
tlv_tree = proto_tree_add_subtree(tlv_tree, tvb, pos, -1,
ett_docsis_ocd_tlvtlv, &tlv_item,
val_to_str(type, ocd_tlv_vals,
"Unknown TLV (%u)"));
proto_tree_add_uint (tlv_tree, hf_docsis_ocd_type, tvb, pos, 1, type);
pos++;
tlv_len_item = proto_tree_add_item_ret_uint (tlv_tree, hf_docsis_ocd_length, tvb, pos, 1, ENC_NA, &length);
pos++;
proto_item_set_len(tlv_item, length + 2);
switch (type)
{
case DISCRETE_FOURIER_TRANSFORM_SIZE:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_docsis_ocd_tlv_four_trans_size, tvb, pos, 1, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_ocd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case CYCLIC_PREFIX:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_docsis_ocd_tlv_cycl_pref, tvb, pos, 1, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_ocd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case ROLL_OFF:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_docsis_ocd_tlv_roll_off, tvb, pos, 1, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_ocd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case OFDM_SPECTRUM_LOCATION:
if (length == 4)
{
proto_tree_add_item (tlv_tree, hf_docsis_ocd_tlv_ofdm_spec_loc, tvb, pos, 4, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_ocd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case TIME_INTERLEAVING_DEPTH:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_docsis_ocd_tlv_time_int_depth, tvb, pos, 1, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_ocd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case SUBCARRIER_ASSIGNMENT_RANGE_LIST:
if (length >= 5)
{
dissect_subcarrier_assignment_range_list(tvb, pinfo, tlv_tree, pos, length);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_ocd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case PRIMARY_CAPABILITY_INDICATOR:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_docsis_ocd_tlv_prim_cap_ind, tvb, pos, 1, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_ocd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
default:
proto_tree_add_item (tlv_tree, hf_docsis_ocd_tlv_unknown, tvb, pos - 2, length+2, ENC_NA);
break;
} /* switch */
pos += length;
} /* while */
}
static int
dissect_ocd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *ocd_tree;
tvbuff_t *next_tvb;
guint32 downstream_channel_id, configuration_change_count;
it = proto_tree_add_item(tree, proto_docsis_ocd, tvb, 0, -1, ENC_NA);
ocd_tree = proto_item_add_subtree (it, ett_docsis_ocd);
proto_tree_add_item_ret_uint (ocd_tree, hf_docsis_ocd_dschid, tvb, 0, 1, ENC_BIG_ENDIAN, &downstream_channel_id);
proto_tree_add_item_ret_uint (ocd_tree, hf_docsis_ocd_ccc, tvb, 1, 1, ENC_BIG_ENDIAN, &configuration_change_count);
col_add_fstr (pinfo->cinfo, COL_INFO, "OCD: DS CH ID: %u, CCC: %u", downstream_channel_id, configuration_change_count);
/* Call Dissector TLV's */
next_tvb = tvb_new_subset_remaining(tvb, 2);
dissect_ocd_tlv(next_tvb, pinfo, ocd_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_ocd(void)
{
static hf_register_info hf[] = {
{&hf_docsis_ocd_tlv_unknown,
{"Unknown TLV", "docsis_ocd.unknown_tlv", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_ocd_dschid,
{"Downstream Channel ID", "docsis_ocd.dschid", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_ocd_ccc,
{"Configuration Change Count", "docsis_ocd.ccc", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_ocd_tlv_four_trans_size,
{"Discrete Fourier Transform Size", "docsis_ocd.tlv.four_trans_size", FT_UINT8, BASE_DEC, VALS (docsis_ocd_four_trans_size), 0x0, NULL, HFILL}
},
{&hf_docsis_ocd_tlv_cycl_pref,
{"Cylic Prefix", "docsis_ocd.tlv.cyc_pref", FT_UINT8, BASE_DEC, VALS (docsis_ocd_cyc_prefix), 0x0, NULL, HFILL}
},
{&hf_docsis_ocd_tlv_roll_off,
{"Roll Off", "docsis_ocd.tlv.roll_off", FT_UINT8, BASE_DEC, VALS (docsis_ocd_roll_off), 0x0, NULL, HFILL}
},
{&hf_docsis_ocd_tlv_ofdm_spec_loc,
{"OFDM Spectrum Location", "docsis_ocd.tlv.ofdm_spec_loc", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &local_units_hz, 0x0, NULL, HFILL}
},
{&hf_docsis_ocd_tlv_time_int_depth,
{"Time Interleaving Depth", "docsis_ocd.tlv.time_int_depth", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_ocd_tlv_prim_cap_ind,
{"Primary Capable Indicator", "docsis_ocd.tlv.prim_cap_ind", FT_UINT8, BASE_DEC, VALS(docsis_ocd_prim_cap_ind_str), 0x0, NULL, HFILL}
},
{&hf_docsis_ocd_tlv_subc_assign_type,
{"Assignment type", "docsis_ocd.tlv.subc_assign.type", FT_UINT8, BASE_DEC, VALS(docsis_ocd_subc_assign_type_str), 0xC0, NULL, HFILL}
},
{&hf_docsis_ocd_tlv_subc_assign_value,
{"Assignment value", "docsis_ocd.tlv.subc_assign.value", FT_UINT8, BASE_DEC, VALS(docsis_ocd_subc_assign_value_str), 0x20, NULL, HFILL}
},
{&hf_docsis_ocd_subc_assign_subc_type,
{"Subcarrier Type", "docsis_ocd.tlv.subc_assign.subc_type", FT_UINT8, BASE_DEC, VALS(docsis_ocd_subc_assign_subc_type_str), 0x1F, NULL, HFILL}
},
{&hf_docsis_ocd_subc_assign_range,
{"Subcarrier index range", "docsis_ocd.tlv.subc_assign.range", FT_UINT32, BASE_CUSTOM, CF_FUNC(subc_assign_range), 0x00, NULL, HFILL}
},
{&hf_docsis_ocd_subc_assign_index,
{"Subcarrier index", "docsis_ocd.tlv.subc_assign.index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL}
},
{&hf_docsis_ocd_tlv_data,
{"TLV Data", "docsis_ocd.tlv_data", FT_BYTES, BASE_NO_DISPLAY_VALUE, NULL, 0x0, NULL, HFILL}
},
{&hf_docsis_ocd_type,
{"Type", "docsis_ocd.type",FT_UINT8, BASE_DEC, VALS(ocd_tlv_vals), 0x0, NULL, HFILL}
},
{&hf_docsis_ocd_length,
{"Length", "docsis_ocd.length",FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
};
static ei_register_info ei[] = {
{&ei_docsis_ocd_tlvlen_bad, { "docsis_ocd.tlvlenbad", PI_MALFORMED, PI_ERROR, "Bad TLV length", EXPFILL}},
{&ei_docsis_ocd_value_unknown, { "docsis_ocd.valueunknown", PI_PROTOCOL, PI_WARN, "Unknown value", EXPFILL}}
};
static gint *ett[] = {
&ett_docsis_ocd,
&ett_docsis_ocd_tlv,
&ett_docsis_ocd_tlvtlv,
};
expert_module_t* expert_docsis_ocd;
proto_docsis_ocd = proto_register_protocol ("DOCSIS OFDM Channel Descriptor", "DOCSIS OCD", "docsis_ocd");
proto_register_field_array (proto_docsis_ocd, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
expert_docsis_ocd = expert_register_protocol(proto_docsis_ocd);
expert_register_field_array(expert_docsis_ocd, ei, array_length(ei));
docsis_ocd_handle = register_dissector ("docsis_ocd", dissect_ocd, proto_docsis_ocd);
}
void
proto_reg_handoff_docsis_ocd (void)
{
dissector_add_uint ("docsis_mgmt", 0x31, docsis_ocd_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,119 +0,0 @@
/* packet-regack.c
* Routines for Registration Acknowledge Message dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_regack(void);
void proto_reg_handoff_docsis_regack(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_regack = -1;
static int hf_docsis_regack_sid = -1;
static int hf_docsis_regack_response = -1;
static dissector_handle_t docsis_tlv_handle;
/* Defined in packet-tlv.c */
extern value_string docsis_conf_code[];
/* Initialize the subtree pointers */
static gint ett_docsis_regack = -1;
static dissector_handle_t docsis_regack_handle;
/* Dissection */
static int
dissect_regack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *regack_tree;
guint32 sid, response;
tvbuff_t *next_tvb;
it = proto_tree_add_item (tree, proto_docsis_regack, tvb, 0, -1, ENC_NA);
regack_tree = proto_item_add_subtree (it, ett_docsis_regack);
proto_tree_add_item_ret_uint (regack_tree, hf_docsis_regack_sid, tvb, 0, 2, ENC_BIG_ENDIAN, &sid);
proto_tree_add_item_ret_uint (regack_tree, hf_docsis_regack_response, tvb, 2, 1, ENC_BIG_ENDIAN, &response);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Registration Acknowledge SID = %u (%s)", sid,
val_to_str (response, docsis_conf_code, "%d"));
/* Call Dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 3);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, regack_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_regack (void)
{
static hf_register_info hf[] = {
{&hf_docsis_regack_sid,
{"Service Identifier", "docsis_regack.sid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_regack_response,
{"Response Code", "docsis_regack.respnse",
FT_UINT8, BASE_DEC, VALS (docsis_conf_code), 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_regack,
};
proto_docsis_regack =
proto_register_protocol ("DOCSIS Registration Acknowledge",
"DOCSIS REG-ACK", "docsis_regack");
proto_register_field_array (proto_docsis_regack, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_regack_handle = register_dissector ("docsis_regack", dissect_regack, proto_docsis_regack);
}
void
proto_reg_handoff_docsis_regack (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 0x0e, docsis_regack_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,109 +0,0 @@
/* packet-regreq.c
* Routines for Registration Request dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_regreq(void);
void proto_reg_handoff_docsis_regreq(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_regreq = -1;
static int hf_docsis_regreq_sid = -1;
/* Initialize the subtree pointers */
static gint ett_docsis_regreq = -1;
static dissector_handle_t docsis_tlv_handle;
static dissector_handle_t docsis_regreq_handle;
/* Code to actually dissect the packets */
static int
dissect_regreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *regreq_tree;
guint32 sid;
tvbuff_t *next_tvb;
it = proto_tree_add_item(tree, proto_docsis_regreq, tvb, 0, -1, ENC_NA);
regreq_tree = proto_item_add_subtree (it, ett_docsis_regreq);
proto_tree_add_item_ret_uint (regreq_tree, hf_docsis_regreq_sid, tvb, 0, 2, ENC_BIG_ENDIAN, &sid);
col_add_fstr (pinfo->cinfo, COL_INFO, "Registration Request SID = %u", sid);
/* Call Dissector for Appendix C TlV's */
next_tvb = tvb_new_subset_remaining (tvb, 2);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, regreq_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_regreq (void)
{
static hf_register_info hf[] = {
{&hf_docsis_regreq_sid,
{"Service Identifier", "docsis_regreq.sid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_regreq,
};
proto_docsis_regreq =
proto_register_protocol ("DOCSIS Registration Requests", "DOCSIS REG-REQ",
"docsis_regreq");
proto_register_field_array (proto_docsis_regreq, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_regreq_handle = register_dissector ("docsis_regreq", dissect_regreq, proto_docsis_regreq);
}
void
proto_reg_handoff_docsis_regreq (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 0x06, docsis_regreq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,124 +0,0 @@
/* packet-regreqmp.c
* Routines for REG-REQ-MP Message dissection
* Copyright 2007, Bruno Verstuyft <bruno.verstuyft@excentis.com>
*
* Based on packet-regreq.c (by Anand V. Narwani <anand[AT]narwani.org>)
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_regreqmp(void);
void proto_reg_handoff_docsis_regreqmp(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_regreqmp = -1;
static int hf_docsis_regreqmp_sid = -1;
static int hf_docsis_regreqmp_number_of_fragments = -1;
static int hf_docsis_regreqmp_fragment_sequence_number = -1;
static dissector_handle_t docsis_tlv_handle;
static dissector_handle_t docsis_regreqmp_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_regreqmp = -1;
/* Dissection */
static int
dissect_regreqmp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *regreqmp_tree;
tvbuff_t *next_tvb;
col_set_str(pinfo->cinfo, COL_INFO, "REG-REQ-MP Message:");
it = proto_tree_add_item(tree, proto_docsis_regreqmp, tvb, 0, -1, ENC_NA);
regreqmp_tree = proto_item_add_subtree (it, ett_docsis_regreqmp);
proto_tree_add_item (regreqmp_tree, hf_docsis_regreqmp_sid, tvb, 0, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (regreqmp_tree, hf_docsis_regreqmp_number_of_fragments, tvb, 2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (regreqmp_tree, hf_docsis_regreqmp_fragment_sequence_number, tvb, 3, 1, ENC_BIG_ENDIAN);
/* Call Dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 4);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, regreqmp_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_regreqmp (void)
{
static hf_register_info hf[] = {
{&hf_docsis_regreqmp_sid,
{"Sid", "docsis_regreqmp.sid",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Reg-Req-Mp Sid", HFILL}
},
{&hf_docsis_regreqmp_number_of_fragments,
{"Number of Fragments", "docsis_regreqmp.number_of_fragments",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Reg-Req-Mp Number of Fragments", HFILL}
},
{&hf_docsis_regreqmp_fragment_sequence_number,
{"Fragment Sequence Number", "docsis_regreqmp.fragment_sequence_number",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Reg-Req-Mp Fragment Sequence Number", HFILL}
},
};
static gint *ett[] = {
&ett_docsis_regreqmp,
};
proto_docsis_regreqmp =
proto_register_protocol ("DOCSIS Registration Request Multipart",
"DOCSIS Reg-Req-Mp", "docsis_regreqmp");
proto_register_field_array (proto_docsis_regreqmp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_regreqmp_handle = register_dissector ("docsis_regreqmp", dissect_regreqmp, proto_docsis_regreqmp);
}
void
proto_reg_handoff_docsis_regreqmp (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 44, docsis_regreqmp_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,118 +0,0 @@
/* packet-regrsp.c
* Routines for Registration Response Message dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_regrsp(void);
void proto_reg_handoff_docsis_regrsp(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_regrsp = -1;
static int hf_docsis_regrsp_sid = -1;
static int hf_docsis_regrsp_response = -1;
static dissector_handle_t docsis_tlv_handle;
/* Defined in packet-tlv.c */
extern value_string docsis_conf_code[];
/* Initialize the subtree pointers */
static gint ett_docsis_regrsp = -1;
static dissector_handle_t docsis_regrsp_handle;
/* Dissection */
static int
dissect_regrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *regrsp_tree;
guint32 sid, response;
tvbuff_t *next_tvb;
it = proto_tree_add_item(tree, proto_docsis_regrsp, tvb, 0, -1, ENC_NA);
regrsp_tree = proto_item_add_subtree (it, ett_docsis_regrsp);
proto_tree_add_item_ret_uint (regrsp_tree, hf_docsis_regrsp_sid, tvb, 0, 2, ENC_BIG_ENDIAN, &sid);
proto_tree_add_item_ret_uint (regrsp_tree, hf_docsis_regrsp_response, tvb, 2, 1, ENC_BIG_ENDIAN, &response);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Registration Response SID = %u (%s)", sid,
val_to_str (response, docsis_conf_code, "%d"));
/* Call Dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 3);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, regrsp_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_regrsp (void)
{
static hf_register_info hf[] = {
{&hf_docsis_regrsp_sid,
{"Service Identifier", "docsis_regrsp.sid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_regrsp_response,
{"Response Code", "docsis_regrsp.respnse",
FT_UINT8, BASE_DEC, VALS (docsis_conf_code), 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_regrsp,
};
proto_docsis_regrsp =
proto_register_protocol ("DOCSIS Registration Responses", "DOCSIS REG-RSP",
"docsis_regrsp");
proto_register_field_array (proto_docsis_regrsp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_regrsp_handle = register_dissector ("docsis_regrsp", dissect_regrsp, proto_docsis_regrsp);
}
void
proto_reg_handoff_docsis_regrsp (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 0x07, docsis_regrsp_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,133 +0,0 @@
/* packet-regrspmp.c
* Routines for REG-RSP-MP Message dissection
* Copyright 2007, Bruno Verstuyft <bruno.verstuyft@excentis.com>
*
* Based on packet-regrsp.c (by Anand V. Narwani <anand[AT]narwani.org>)
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_regrspmp(void);
void proto_reg_handoff_docsis_regrspmp(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_regrspmp = -1;
static int hf_docsis_regrspmp_sid = -1;
static int hf_docsis_regrspmp_response = -1;
static int hf_docsis_regrspmp_number_of_fragments = -1;
static int hf_docsis_regrspmp_fragment_sequence_number = -1;
static dissector_handle_t docsis_tlv_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_regrspmp = -1;
static dissector_handle_t docsis_regrspmp_handle;
/* Dissection */
static int
dissect_regrspmp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *regrspmp_tree;
tvbuff_t *next_tvb;
col_set_str(pinfo->cinfo, COL_INFO, "REG-RSP-MP Message:");
it = proto_tree_add_item(tree, proto_docsis_regrspmp, tvb, 0, -1, ENC_NA);
regrspmp_tree = proto_item_add_subtree (it, ett_docsis_regrspmp);
proto_tree_add_item (regrspmp_tree, hf_docsis_regrspmp_sid, tvb, 0, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (regrspmp_tree, hf_docsis_regrspmp_response, tvb, 2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (regrspmp_tree, hf_docsis_regrspmp_number_of_fragments, tvb, 3, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (regrspmp_tree, hf_docsis_regrspmp_fragment_sequence_number, tvb, 4, 1, ENC_BIG_ENDIAN);
/* Call Dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 5);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, regrspmp_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_regrspmp (void)
{
static hf_register_info hf[] = {
{&hf_docsis_regrspmp_sid,
{"Sid", "docsis_regrspmp.sid",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Reg-Rsp-Mp Sid", HFILL}
},
{&hf_docsis_regrspmp_response,
{"Response", "docsis_regrspmp.response",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Reg-Rsp-Mp Response", HFILL}
},
{&hf_docsis_regrspmp_number_of_fragments,
{"Number of Fragments", "docsis_regrspmp.number_of_fragments",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Reg-Rsp-Mp Number of Fragments", HFILL}
},
{&hf_docsis_regrspmp_fragment_sequence_number,
{"Fragment Sequence Number", "docsis_regrspmp.fragment_sequence_number",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Reg-Rsp-Mp Fragment Sequence Number", HFILL}
},
};
static gint *ett[] = {
&ett_docsis_regrspmp,
};
proto_docsis_regrspmp =
proto_register_protocol ("DOCSIS Registration Response Multipart",
"DOCSIS Reg-Rsp-Mp", "docsis_regrspmp");
proto_register_field_array (proto_docsis_regrspmp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_regrspmp_handle = register_dissector ("docsis_regrspmp", dissect_regrspmp, proto_docsis_regrspmp);
}
void
proto_reg_handoff_docsis_regrspmp (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 45, docsis_regrspmp_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,120 +0,0 @@
/* packet-rngreq.c
* Routines for Ranging Request Message dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_rngreq(void);
void proto_reg_handoff_docsis_rngreq(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_rngreq = -1;
static int hf_docsis_rngreq_down_chid = -1;
static int hf_docsis_rngreq_sid = -1;
static int hf_docsis_rngreq_pend_compl = -1;
/* Initialize the subtree pointers */
static gint ett_docsis_rngreq = -1;
static dissector_handle_t docsis_rngreq_handle;
/* Dissection */
static int
dissect_rngreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *rngreq_tree;
guint32 sid;
it = proto_tree_add_item(tree, proto_docsis_rngreq, tvb, 0, -1, ENC_NA);
rngreq_tree = proto_item_add_subtree (it, ett_docsis_rngreq);
proto_tree_add_item_ret_uint (rngreq_tree, hf_docsis_rngreq_sid, tvb, 0, 2, ENC_BIG_ENDIAN, &sid);
if (sid > 0)
col_add_fstr (pinfo->cinfo, COL_INFO, "Ranging Request: SID = %u",
sid);
else
col_set_str(pinfo->cinfo, COL_INFO, "Initial Ranging Request SID = 0");
proto_tree_add_item (rngreq_tree, hf_docsis_rngreq_down_chid, tvb, 2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (rngreq_tree, hf_docsis_rngreq_pend_compl, tvb, 3, 1, ENC_BIG_ENDIAN);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_rngreq (void)
{
static hf_register_info hf[] = {
{&hf_docsis_rngreq_sid,
{"Service Identifier", "docsis_rngreq.sid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_rngreq_down_chid,
{"Downstream Channel ID", "docsis_rngreq.downchid",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_rngreq_pend_compl,
{"Pending Till Complete", "docsis_rngreq.pendcomp",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Upstream Channel ID", HFILL}
},
};
static gint *ett[] = {
&ett_docsis_rngreq,
};
proto_docsis_rngreq = proto_register_protocol ("DOCSIS Range Request Message",
"DOCSIS RNG-REQ",
"docsis_rngreq");
proto_register_field_array (proto_docsis_rngreq, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_rngreq_handle = register_dissector ("docsis_rngreq", dissect_rngreq, proto_docsis_rngreq);
}
void
proto_reg_handoff_docsis_rngreq (void)
{
dissector_add_uint ("docsis_mgmt", 0x04, docsis_rngreq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,278 +0,0 @@
/* packet-rngrsp.c
* Routines for Ranging Response Message dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/exceptions.h>
#define RNGRSP_TIMING 1
#define RNGRSP_PWR_LEVEL_ADJ 2
#define RNGRSP_OFFSET_FREQ_ADJ 3
#define RNGRSP_TRANSMIT_EQ_ADJ 4
#define RNGRSP_RANGING_STATUS 5
#define RNGRSP_DOWN_FREQ_OVER 6
#define RNGRSP_UP_CHID_OVER 7
void proto_register_docsis_rngrsp(void);
void proto_reg_handoff_docsis_rngrsp(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_rngrsp = -1;
static int hf_docsis_rngrsp_type = -1;
static int hf_docsis_rngrsp_length = -1;
static int hf_docsis_rngrsp_upstream_chid = -1;
static int hf_docsis_rngrsp_sid = -1;
static int hf_docsis_rngrsp_timing_adj = -1;
static int hf_docsis_rngrsp_power_adj = -1;
static int hf_docsis_rngrsp_freq_adj = -1;
static int hf_docsis_rngrsp_xmit_eq_adj = -1;
static int hf_docsis_rngrsp_ranging_status = -1;
static int hf_docsis_rngrsp_down_freq_over = -1;
static int hf_docsis_rngrsp_upstream_ch_over = -1;
static const value_string rng_stat_vals[] = {
{1, "Continue"},
{2, "Abort"},
{3, "Success"},
{0, NULL}
};
/* Initialize the subtree pointers */
static gint ett_docsis_rngrsp = -1;
static gint ett_docsis_rngrsptlv = -1;
static dissector_handle_t docsis_rngrsp_handle;
static const value_string rngrsp_tlv_vals[] = {
{RNGRSP_TIMING, "Timing Adjust (6.25us/64)"},
{RNGRSP_PWR_LEVEL_ADJ, "Power Level Adjust (0.25dB units)"},
{RNGRSP_OFFSET_FREQ_ADJ, "Offset Freq Adjust (Hz)"},
{RNGRSP_TRANSMIT_EQ_ADJ, "Transmit Equalisation Adjust"},
{RNGRSP_RANGING_STATUS, "Ranging Status"},
{RNGRSP_DOWN_FREQ_OVER, "Downstream Frequency Override (Hz)"},
{RNGRSP_UP_CHID_OVER, "Upstream Channel ID Override"},
{0, NULL}
};
/* Code to actually dissect the packets */
static int
dissect_rngrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *rngrsp_tree;
proto_item *rngrsptlv_item;
proto_tree *rngrsptlv_tree;
guint8 tlvtype;
int pos;
guint tlvlen;
guint32 sid, upchid;
it = proto_tree_add_item(tree, proto_docsis_rngrsp, tvb, 0, -1, ENC_NA);
rngrsp_tree = proto_item_add_subtree (it, ett_docsis_rngrsp);
proto_tree_add_item_ret_uint (rngrsp_tree, hf_docsis_rngrsp_sid, tvb, 0, 2, ENC_BIG_ENDIAN, &sid);
proto_tree_add_item_ret_uint (rngrsp_tree, hf_docsis_rngrsp_upstream_chid, tvb, 2, 1, ENC_BIG_ENDIAN, &upchid);
if (upchid > 0)
col_add_fstr (pinfo->cinfo, COL_INFO,
"Ranging Response: SID = %u, Upstream Channel = %u (U%u)",
sid, upchid, upchid - 1);
else
col_add_fstr (pinfo->cinfo, COL_INFO,
"Ranging Response: SID = %u, Telephony Return", sid);
pos = 3;
while (tvb_reported_length_remaining(tvb, pos) > 0)
{
tlvtype = tvb_get_guint8 (tvb, pos);
rngrsptlv_tree = proto_tree_add_subtree(rngrsp_tree, tvb, pos, -1,
ett_docsis_rngrsptlv, &rngrsptlv_item,
val_to_str(tlvtype, rngrsp_tlv_vals,
"Unknown TLV (%u)"));
proto_tree_add_uint (rngrsptlv_tree, hf_docsis_rngrsp_type, tvb, pos, 1, tlvtype);
pos++;
proto_tree_add_item_ret_uint (rngrsptlv_tree, hf_docsis_rngrsp_length,
tvb, pos, 1, ENC_NA, &tlvlen);
pos++;
proto_item_set_len(rngrsptlv_item, tlvlen + 2);
switch (tlvtype)
{
case RNGRSP_TIMING:
if (tlvlen == 4)
{
proto_tree_add_item (rngrsptlv_tree, hf_docsis_rngrsp_timing_adj, tvb, pos, tlvlen, ENC_BIG_ENDIAN);
}
break;
case RNGRSP_PWR_LEVEL_ADJ:
if (tlvlen == 1)
{
proto_tree_add_item (rngrsptlv_tree, hf_docsis_rngrsp_power_adj, tvb, pos, tlvlen, ENC_NA);
}
break;
case RNGRSP_OFFSET_FREQ_ADJ:
if (tlvlen == 2)
{
proto_tree_add_item (rngrsptlv_tree, hf_docsis_rngrsp_freq_adj, tvb, pos, tlvlen, ENC_BIG_ENDIAN);
}
break;
case RNGRSP_TRANSMIT_EQ_ADJ:
proto_tree_add_item (rngrsptlv_tree, hf_docsis_rngrsp_xmit_eq_adj, tvb, pos, tlvlen, ENC_NA);
break;
case RNGRSP_RANGING_STATUS:
if (tlvlen == 1)
{
proto_tree_add_item (rngrsptlv_tree, hf_docsis_rngrsp_ranging_status, tvb, pos, tlvlen, ENC_BIG_ENDIAN);
}
break;
case RNGRSP_DOWN_FREQ_OVER:
if (tlvlen == 4)
{
proto_tree_add_item (rngrsptlv_tree, hf_docsis_rngrsp_down_freq_over, tvb, pos, tlvlen, ENC_BIG_ENDIAN);
}
break;
case RNGRSP_UP_CHID_OVER:
if (tlvlen == 1)
{
proto_tree_add_item (rngrsptlv_tree, hf_docsis_rngrsp_upstream_ch_over, tvb, pos, tlvlen, ENC_BIG_ENDIAN);
}
break;
default:
;
} /* switch(tlvtype) */
pos += tlvlen;
} /* while (tvb_reported_length_remaining(tvb, pos) > 0) */
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
/* this format is require because a script is used to build the C function
that calls all the protocol registration.
*/
void
proto_register_docsis_rngrsp (void)
{
/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf[] = {
{&hf_docsis_rngrsp_type,
{"Type", "docsis_rngrsp.type",
FT_UINT8, BASE_DEC, VALS(rngrsp_tlv_vals), 0x0,
"TLV Type", HFILL}
},
{&hf_docsis_rngrsp_length,
{"Length", "docsis_rngrsp.length",
FT_UINT8, BASE_DEC, NULL, 0x0,
"TLV Length", HFILL}
},
{&hf_docsis_rngrsp_sid,
{"Service Identifier", "docsis_rngrsp.sid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_rngrsp_upstream_chid,
{"Upstream Channel ID", "docsis_rngrsp.upchid",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_rngrsp_timing_adj,
{"Timing Adjust (6.25us/64)", "docsis_rngrsp.timingadj",
FT_INT32, BASE_DEC, NULL, 0x0,
"Timing Adjust", HFILL}
},
{&hf_docsis_rngrsp_power_adj,
{"Power Level Adjust (0.25dB units)", "docsis_rngrsp.poweradj",
FT_INT8, BASE_DEC, NULL, 0x0,
"Power Level Adjust", HFILL}
},
{&hf_docsis_rngrsp_freq_adj,
{"Offset Freq Adjust (Hz)", "docsis_rngrsp.freqadj",
FT_INT16, BASE_DEC, NULL, 0x0,
"Frequency Adjust", HFILL}
},
{&hf_docsis_rngrsp_xmit_eq_adj,
{"Transmit Equalisation Adjust", "docsis_rngrsp.xmit_eq_adj",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Timing Equalisation Adjust", HFILL}
},
{&hf_docsis_rngrsp_ranging_status,
{"Ranging Status", "docsis_rngrsp.rng_stat",
FT_UINT8, BASE_DEC, VALS (rng_stat_vals), 0x0,
NULL, HFILL}
},
{&hf_docsis_rngrsp_down_freq_over,
{"Downstream Frequency Override (Hz)", "docsis_rngrsp.freq_over",
FT_UINT32, BASE_DEC, NULL, 0x0,
"Downstream Frequency Override", HFILL}
},
{&hf_docsis_rngrsp_upstream_ch_over,
{"Upstream Channel ID Override", "docsis_rngrsp.chid_override",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_docsis_rngrsp,
&ett_docsis_rngrsptlv,
};
/* Register the protocol name and description */
proto_docsis_rngrsp = proto_register_protocol ("DOCSIS Ranging Response",
"DOCSIS RNG-RSP",
"docsis_rngrsp");
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array (proto_docsis_rngrsp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_rngrsp_handle = register_dissector ("docsis_rngrsp", dissect_rngrsp, proto_docsis_rngrsp);
}
/* If this dissector uses sub-dissector registration add a registration routine.
This format is required because a script is used to find these routines and
create the code that calls these routines.
*/
void
proto_reg_handoff_docsis_rngrsp (void)
{
dissector_add_uint ("docsis_mgmt", 0x05, docsis_rngrsp_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,101 +0,0 @@
/* packet-sync.c
* Routines for Sync Message dissection
* Copyright 2007, Bruno Verstuyft <bruno.verstuyft@excentis.com>
*
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_sync(void);
void proto_reg_handoff_docsis_sync(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_sync = -1;
static int hf_docsis_sync_cmts_timestamp = -1;
/* Initialize the subtree pointers */
static gint ett_docsis_sync = -1;
static dissector_handle_t docsis_sync_handle;
/* Dissection */
static int
dissect_sync (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *sync_tree;
col_set_str(pinfo->cinfo, COL_INFO, "Sync Message");
it = proto_tree_add_item(tree, proto_docsis_sync, tvb, 0, -1, ENC_NA);
sync_tree = proto_item_add_subtree (it, ett_docsis_sync);
proto_tree_add_item (sync_tree, hf_docsis_sync_cmts_timestamp, tvb, 0, 4, ENC_BIG_ENDIAN);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_sync (void)
{
/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf[] = {
{&hf_docsis_sync_cmts_timestamp,
{"CMTS Timestamp", "docsis_sync.cmts_timestamp",
FT_UINT32, BASE_DEC, NULL, 0x0,
"Sync CMTS Timestamp", HFILL}
},
};
static gint *ett[] = {
&ett_docsis_sync,
};
proto_docsis_sync =
proto_register_protocol ("DOCSIS Synchronisation Message", "SYNC Message", "docsis_sync");
proto_register_field_array (proto_docsis_sync, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_sync_handle = register_dissector ("docsis_sync", dissect_sync, proto_docsis_sync);
}
void
proto_reg_handoff_docsis_sync (void)
{
dissector_add_uint ("docsis_mgmt", 1, docsis_sync_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,368 +0,0 @@
/* packet-tlv-cmctrl.c
* Routines to Dissect TLV's for CM-Control Messages
* Copyright 2010, Guido Reismueller <g.reismueller[AT]avm.de>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#define CM_CTRL_MUTE 1
#define CM_CTRL_MUTE_TIMEOUT 2
#define CM_CTRL_REINIT 3
#define CM_CTRL_DISABLE_FWD 4
#define CM_CTRL_DS_EVENT 5
#define CM_CTRL_US_EVENT 6
#define CM_CTRL_EVENT 7
#define DS_EVENT_CH_ID 1
#define DS_EVENT_MASK 2
#define US_EVENT_CH_ID 1
#define US_EVENT_MASK 2
void proto_register_cmctrl_tlv(void);
void proto_reg_handoff_cmctrl_tlv(void);
/* Initialize the protocol and registered fields */
static int proto_cmctrl_tlv = -1;
static int hf_cmctrl_tlv_mute = -1;
static int hf_cmctrl_tlv_mute_timeout = -1;
static int hf_cmctrl_tlv_reinit = -1;
static int hf_cmctrl_tlv_disable_fwd = -1;
static int hf_cmctrl_tlv_ds_event = -1;
/* static int hf_cmctrl_tlv_us_event = -1; */
static int hf_cmctrl_tlv_event = -1;
static int hf_ds_event_ch_id = -1;
static int hf_ds_event_mask = -1;
static int hf_us_event_ch_id = -1;
static int hf_us_event_mask = -1;
/* Initialize the subtree pointers */
static gint ett_cmctrl_tlv = -1;
static gint ett_cmctrl_tlv_ds_event = -1;
static gint ett_cmctrl_tlv_us_event = -1;
static expert_field ei_docsis_cmctrl_tlv_tlvlen_bad = EI_INIT;
/* Dissection */
static void
dissect_ds_event(tvbuff_t * tvb, packet_info* pinfo, proto_tree *tree, int start, guint16 len)
{
guint8 type, length;
proto_tree *event_tree;
proto_item *event_item;
int pos = start;
event_tree =
proto_tree_add_subtree_format(tree, tvb, start, len, ett_cmctrl_tlv_ds_event, &event_item,
"Override Downstream Status Event Event Mask (Length = %u)", len);
while (pos < (start + len))
{
type = tvb_get_guint8 (tvb, pos++);
length = tvb_get_guint8 (tvb, pos++);
switch (type)
{
case DS_EVENT_CH_ID:
if (length == 1)
{
proto_tree_add_item (event_tree, hf_ds_event_ch_id,
tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, event_item, &ei_docsis_cmctrl_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case DS_EVENT_MASK:
if (length == 2)
{
proto_tree_add_item (event_tree, hf_ds_event_mask,
tvb, pos, length, ENC_NA);
}
else
{
expert_add_info_format(pinfo, event_item, &ei_docsis_cmctrl_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
} /* switch */
pos = pos + length;
} /* while */
}
static void
dissect_us_event(tvbuff_t * tvb, packet_info* pinfo, proto_tree *tree, int start, guint16 len)
{
guint8 type, length;
proto_tree *event_tree;
proto_item *event_item;
int pos = start;
event_tree =
proto_tree_add_subtree_format(tree, tvb, start, len, ett_cmctrl_tlv_us_event, &event_item,
"Override Upstream Status Enable Event Mask (Length = %u)", len);
while (pos < (start + len))
{
type = tvb_get_guint8 (tvb, pos++);
length = tvb_get_guint8 (tvb, pos++);
switch (type)
{
case US_EVENT_CH_ID:
if (length == 1)
{
proto_tree_add_item (event_tree, hf_us_event_ch_id,
tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, event_item, &ei_docsis_cmctrl_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case US_EVENT_MASK:
if (length == 2)
{
proto_tree_add_item (event_tree, hf_us_event_mask,
tvb, pos, length, ENC_NA);
}
else
{
expert_add_info_format(pinfo, event_item, &ei_docsis_cmctrl_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
} /* switch */
pos = pos + length;
} /* while */
}
static int
dissect_cmctrl_tlv (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *tlv_tree;
int pos = 0;
gint total_len;
guint8 type, length;
total_len = tvb_reported_length_remaining (tvb, 0);
it =
proto_tree_add_protocol_format (tree, proto_cmctrl_tlv, tvb, 0,
total_len, "TLV Data");
tlv_tree = proto_item_add_subtree (it, ett_cmctrl_tlv);
while (pos < total_len)
{
type = tvb_get_guint8 (tvb, pos++);
length = tvb_get_guint8 (tvb, pos++);
switch (type)
{
case CM_CTRL_MUTE:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_cmctrl_tlv_mute,
tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, it, &ei_docsis_cmctrl_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case CM_CTRL_MUTE_TIMEOUT:
if (length == 4 || length == 1) /* response TLV always with len 1 */
{
proto_tree_add_item (tlv_tree, hf_cmctrl_tlv_mute_timeout,
tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, it, &ei_docsis_cmctrl_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case CM_CTRL_REINIT:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_cmctrl_tlv_reinit,
tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, it, &ei_docsis_cmctrl_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case CM_CTRL_DISABLE_FWD:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_cmctrl_tlv_disable_fwd,
tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, it, &ei_docsis_cmctrl_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case CM_CTRL_DS_EVENT:
if (length == 1)
proto_tree_add_item (tlv_tree, hf_cmctrl_tlv_ds_event,
tvb, pos, length, ENC_NA);
else
dissect_ds_event(tvb, pinfo, tlv_tree, pos, length);
break;
case CM_CTRL_US_EVENT:
if (length == 1)
proto_tree_add_item (tlv_tree, hf_cmctrl_tlv_ds_event,
tvb, pos, length, ENC_NA);
else
dissect_us_event(tvb, pinfo, tlv_tree, pos, length);
break;
case CM_CTRL_EVENT:
if (length == 2 || length == 1) /* response TLV always with len 1 */
{
proto_tree_add_item (tlv_tree, hf_cmctrl_tlv_event,
tvb, pos, length, ENC_NA);
}
else
{
expert_add_info_format(pinfo, it, &ei_docsis_cmctrl_tlv_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
} /* switch */
pos = pos + length;
} /* while */
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_cmctrl_tlv (void)
{
static hf_register_info hf[] = {
{&hf_cmctrl_tlv_mute,
{"1 Upstream Channel RF Mute", "cmctrl_tlv.mute",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Upstream Channel RF Mute", HFILL}
},
{&hf_cmctrl_tlv_mute_timeout,
{"2 RF Mute Timeout Interval", "cmctrl_tlv.mute_timeout",
FT_UINT32, BASE_DEC, NULL, 0x0,
"RF Mute Timeout Interval", HFILL}
},
{&hf_cmctrl_tlv_reinit,
{"3 CM Reinitialize", "cmctrl_tlv.reinit",
FT_UINT8, BASE_DEC, NULL, 0x0,
"CM Reinitialize", HFILL}
},
{&hf_cmctrl_tlv_disable_fwd,
{"4 Disable Forwarding", "cmctrl_tlv.disable_fwd",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Disable Forwarding", HFILL}
},
{&hf_cmctrl_tlv_ds_event,
{"5 Override Downstream Events", "cmctrl_tlv.ds_event",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Override Downstream Events", HFILL}
},
{&hf_ds_event_ch_id,
{".1 Downstream Channel ID", "cmctrl_tlv.ds_event.chid",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Downstream Channel ID", HFILL}
},
{&hf_ds_event_mask,
{".2 Downstream Status Event Enable Bitmask", "cmctrl_tlv.ds_event.mask",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Downstream Status Event Enable Bitmask", HFILL}
},
#if 0
{&hf_cmctrl_tlv_us_event,
{"6 Override Upstream Events", "cmctrl_tlv.us_event",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Override Downstream Events", HFILL}
},
#endif
{&hf_us_event_ch_id,
{".1 Upstream Channel ID", "cmctrl_tlv.us_event.chid",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Upstream Channel ID", HFILL}
},
{&hf_us_event_mask,
{".2 Upstream Status Event Enable Bitmask", "cmctrl_tlv.us_event.mask",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Upstream Status Event Enable Bitmask", HFILL}
},
{&hf_cmctrl_tlv_event,
{"7 Override Non-Channel-Specific Events", "cmctrl_tlv.event",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Override Non-Channel-Specific Events", HFILL}
},
};
static gint *ett[] = {
&ett_cmctrl_tlv,
&ett_cmctrl_tlv_ds_event,
&ett_cmctrl_tlv_us_event,
};
static ei_register_info ei[] = {
{&ei_docsis_cmctrl_tlv_tlvlen_bad, { "cmctrl_tlv.tlvlenbad", PI_MALFORMED, PI_ERROR, "Bad TLV length", EXPFILL}},
};
expert_module_t* expert_docsis_cmctrl_tlv;
proto_cmctrl_tlv = proto_register_protocol ("DOCSIS CM-CTRL TLV's",
"DOCSIS CM-CTRL TLVs", "cmctrl_tlv");
proto_register_field_array (proto_cmctrl_tlv, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
expert_docsis_cmctrl_tlv = expert_register_protocol(proto_cmctrl_tlv);
expert_register_field_array(expert_docsis_cmctrl_tlv, ei, array_length(ei));
register_dissector ("cmctrl_tlv", dissect_cmctrl_tlv, proto_cmctrl_tlv);
}
void
proto_reg_handoff_cmctrl_tlv (void)
{
#if 0
dissector_handle_t cmctrl_tlv_handle;
cmctrl_tlv_handle = find_dissector ("cmctrl_tlv");
dissector_add_uint ("docsis", 0xFE, cmctrl_tlv_handle);
#endif
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -622,6 +622,8 @@ const value_string docsis_conf_code[] = {
{0, NULL}
};
value_string_ext docsis_conf_code_ext = VALUE_STRING_EXT_INIT(docsis_conf_code);
static const value_string us_ch_action_vals[] = {
{0, "No Action"},
{1, "Add"},
@ -4751,7 +4753,7 @@ proto_register_docsis_tlv (void)
},
{&hf_docsis_tlv_svc_unavail_code,
{"Service Not Available (Code)", "docsis_tlv.svcunavail.code",
FT_UINT8, BASE_DEC, VALS(docsis_conf_code), 0x0,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &docsis_conf_code_ext, 0x0,
NULL, HFILL}
},
{&hf_docsis_tlv_cpe_ethernet,
@ -4845,7 +4847,7 @@ proto_register_docsis_tlv (void)
},
{&hf_docsis_tlv_clsfr_err_code,
{"..2 Error Code", "docsis_tlv.clsfr.err.code",
FT_UINT8, BASE_DEC, VALS(docsis_conf_code), 0x0,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &docsis_conf_code_ext, 0x0,
"TCP/UDP Destination Port End", HFILL}
},
{&hf_docsis_tlv_clsfr_err_msg,
@ -5005,7 +5007,7 @@ proto_register_docsis_tlv (void)
},
{&hf_docsis_tlv_sflow_err_code,
{"..2 Error Code", "docsis_tlv.sflow.err.code",
FT_UINT8, BASE_DEC, VALS(docsis_conf_code), 0x0,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &docsis_conf_code_ext, 0x0,
"Error Code", HFILL}
},
{&hf_docsis_tlv_sflow_err_msg,
@ -5517,7 +5519,7 @@ proto_register_docsis_tlv (void)
},
{&hf_docsis_tcc_err_code,
{"..2 Error Code", "docsis_tlv.tcc.err.code",
FT_UINT8, BASE_DEC, VALS(docsis_conf_code), 0x0,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &docsis_conf_code_ext, 0x0,
"Error Code", HFILL}
},
{&hf_docsis_tcc_err_msg,
@ -5801,7 +5803,7 @@ proto_register_docsis_tlv (void)
},
{&hf_docsis_tlv_rcc_err_code,
{".4 Error Code", "docsis_tlv.rcc.err.code",
FT_UINT8, BASE_DEC, VALS (docsis_conf_code), 0x0,
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &docsis_conf_code_ext, 0x0,
"Error Code", HFILL}
},
{&hf_docsis_tlv_rcc_err_msg,

View File

@ -462,4 +462,6 @@
#define CMTS_MC_SESS_ENC_GRP 1
#define CMTS_MC_SESS_ENC_SRC 2
extern value_string_ext docsis_conf_code_ext;
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,109 +0,0 @@
/* packet-uccreq.c
* Routines for Upstream Channel Change Request dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_uccreq(void);
void proto_reg_handoff_docsis_uccreq(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_uccreq = -1;
static int hf_docsis_uccreq_upchid = -1;
static dissector_handle_t docsis_tlv_handle;
/* Initialize the subtree pointers */
static gint ett_docsis_uccreq = -1;
static dissector_handle_t docsis_uccreq_handle;
/* Dissection */
static int
dissect_uccreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *uccreq_tree;
guint32 chid;
tvbuff_t *next_tvb;
it = proto_tree_add_item (tree, proto_docsis_uccreq, tvb, 0, -1, ENC_NA);
uccreq_tree = proto_item_add_subtree (it, ett_docsis_uccreq);
proto_tree_add_item_ret_uint (uccreq_tree, hf_docsis_uccreq_upchid, tvb, 0, 1, ENC_BIG_ENDIAN, &chid);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Upstream Channel Change request Channel ID = %u (U%u)",
chid, (chid > 0 ? chid - 1 : chid));
/* call dissector for Appendix C TLV's */
next_tvb = tvb_new_subset_remaining (tvb, 1);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, uccreq_tree);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_uccreq (void)
{
static hf_register_info hf[] = {
{&hf_docsis_uccreq_upchid,
{"Upstream Channel Id", "docsis_uccreq.upchid",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_uccreq,
};
proto_docsis_uccreq =
proto_register_protocol ("DOCSIS Upstream Channel Change Request",
"DOCSIS UCC-REQ", "docsis_uccreq");
proto_register_field_array (proto_docsis_uccreq, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_uccreq_handle = register_dissector ("docsis_uccreq", dissect_uccreq, proto_docsis_uccreq);
}
void
proto_reg_handoff_docsis_uccreq (void)
{
docsis_tlv_handle = find_dissector ("docsis_tlv");
dissector_add_uint ("docsis_mgmt", 0x08, docsis_uccreq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,103 +0,0 @@
/* packet-uccrsp.c
* Routines for Upstream Channel Change Response dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_uccrsp(void);
void proto_reg_handoff_docsis_uccrsp(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_uccrsp = -1;
static int hf_docsis_uccrsp_upchid = -1;
/* Initialize the subtree pointers */
static gint ett_docsis_uccrsp = -1;
static dissector_handle_t docsis_uccrsp_handle;
/* Dissection */
static int
dissect_uccrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *uccrsp_tree;
guint32 chid;
it = proto_tree_add_item(tree, proto_docsis_uccrsp, tvb, 0, -1, ENC_NA);
uccrsp_tree = proto_item_add_subtree (it, ett_docsis_uccrsp);
proto_tree_add_item_ret_uint (uccrsp_tree, hf_docsis_uccrsp_upchid, tvb, 0, 1, ENC_BIG_ENDIAN, &chid);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Upstream Channel Change response Channel ID = %u (U%u)",
chid, (chid > 0 ? chid - 1 : chid));
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_uccrsp (void)
{
static hf_register_info hf[] = {
{&hf_docsis_uccrsp_upchid,
{"Upstream Channel Id", "docsis_uccrsp.upchid",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_uccrsp,
};
proto_docsis_uccrsp =
proto_register_protocol ("DOCSIS Upstream Channel Change Response",
"DOCSIS UCC-RSP", "docsis_uccrsp");
proto_register_field_array (proto_docsis_uccrsp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
docsis_uccrsp_handle = register_dissector ("docsis_uccrsp", dissect_uccrsp, proto_docsis_uccrsp);
}
void
proto_reg_handoff_docsis_uccrsp (void)
{
dissector_add_uint ("docsis_mgmt", 0x09, docsis_uccrsp_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/

View File

@ -1,931 +0,0 @@
/* packet-ucd.c
* Routines for Type 2 UCD Message dissection
* Copyright 2015, Adrian Simionov <daniel.simionov@gmail.com>
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#define UCD_SYMBOL_RATE 1
#define UCD_FREQUENCY 2
#define UCD_PREAMBLE 3
#define UCD_BURST_DESCR 4
#define UCD_BURST_DESCR5 5
#define UCD_EXT_PREAMBLE 6
#define UCD_SCDMA_MODE_ENABLED 7
#define UCD_MAINTAIN_POWER_SPECTRAL_DENSITY 15
#define UCD_RANGING_REQUIRED 16
#define UCD_RANGING_HOLD_OFF_PRIORITY_FIELD 18
#define UCD_RANGING_CHANNEL_CLASS_ID 19
#define UCD_MODULATION 1
#define UCD_DIFF_ENCODING 2
#define UCD_PREAMBLE_LEN 3
#define UCD_PREAMBLE_VAL_OFF 4
#define UCD_FEC 5
#define UCD_FEC_CODEWORD 6
#define UCD_SCRAMBLER_SEED 7
#define UCD_MAX_BURST 8
#define UCD_GUARD_TIME 9
#define UCD_LAST_CW_LEN 10
#define UCD_SCRAMBLER_ONOFF 11
#define UCD_RS_INT_DEPTH 12
#define UCD_RS_INT_BLOCK 13
#define UCD_PREAMBLE_TYPE 14
#define IUC_REQUEST 1
#define IUC_REQ_DATA 2
#define IUC_INIT_MAINT 3
#define IUC_STATION_MAINT 4
#define IUC_SHORT_DATA_GRANT 5
#define IUC_LONG_DATA_GRANT 6
#define IUC_NULL_IE 7
#define IUC_DATA_ACK 8
#define IUC_ADV_PHY_SHORT_DATA_GRANT 9
#define IUC_ADV_PHY_LONG_DATA_GRANT 10
#define IUC_ADV_PHY_UGS 11
#define IUC_RESERVED12 12
#define IUC_RESERVED13 13
#define IUC_RESERVED14 14
#define IUC_EXPANSION 15
void proto_register_docsis_ucd(void);
void proto_reg_handoff_docsis_ucd(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_ucd = -1;
static int hf_docsis_ucd_upstream_chid = -1;
static int hf_docsis_ucd_config_ch_cnt = -1;
static int hf_docsis_ucd_mini_slot_size = -1;
static int hf_docsis_ucd_down_chid = -1;
static int hf_docsis_ucd_type = -1;
static int hf_docsis_ucd_length = -1;
static int hf_docsis_ucd_burst_type = -1;
static int hf_docsis_ucd_burst_length = -1;
static int hf_docsis_ucd_symbol_rate = -1;
static int hf_docsis_ucd_frequency = -1;
static int hf_docsis_ucd_preamble_pat = -1;
static int hf_docsis_ucd_ext_preamble_pat = -1;
static int hf_docsis_ucd_scdma_mode_enabled = -1;
static int hf_docsis_ucd_maintain_power_spectral_density = -1;
static int hf_docsis_ucd_ranging_required = -1;
static int hf_docsis_ucd_rnghoff_cm = -1;
static int hf_docsis_ucd_rnghoff_erouter = -1;
static int hf_docsis_ucd_rnghoff_emta = -1;
static int hf_docsis_ucd_rnghoff_estb = -1;
static int hf_docsis_ucd_rnghoff_rsvd = -1;
static int hf_docsis_ucd_rnghoff_id_ext = -1;
static int hf_docsis_ucd_chan_class_id_cm = -1;
static int hf_docsis_ucd_chan_class_id_erouter = -1;
static int hf_docsis_ucd_chan_class_id_emta = -1;
static int hf_docsis_ucd_chan_class_id_estb = -1;
static int hf_docsis_ucd_chan_class_id_rsvd = -1;
static int hf_docsis_ucd_chan_class_id_id_ext = -1;
static int hf_docsis_ucd_iuc = -1;
static int hf_docsis_burst_mod_type = -1;
static int hf_docsis_burst_diff_encoding = -1;
static int hf_docsis_burst_preamble_len = -1;
static int hf_docsis_burst_preamble_val_off = -1;
static int hf_docsis_burst_fec = -1;
static int hf_docsis_burst_fec_codeword = -1;
static int hf_docsis_burst_scrambler_seed = -1;
static int hf_docsis_burst_max_burst = -1;
static int hf_docsis_burst_guard_time = -1;
static int hf_docsis_burst_last_cw_len = -1;
static int hf_docsis_burst_scrambler_onoff = -1;
static int hf_docsis_rs_int_depth = -1;
static int hf_docsis_rs_int_block = -1;
static int hf_docsis_preamble_type = -1;
static expert_field ei_docsis_ucd_tlvlen_bad = EI_INIT;
/* Initialize the subtree pointers */
static gint ett_docsis_ucd = -1;
static gint ett_docsis_tlv = -1;
static gint ett_docsis_burst_tlv = -1;
static dissector_handle_t docsis_ucd_handle;
static const value_string channel_tlv_vals[] = {
{UCD_SYMBOL_RATE, "Symbol Rate"},
{UCD_FREQUENCY, "Frequency"},
{UCD_PREAMBLE, "Preamble Pattern"},
{UCD_BURST_DESCR, "Burst Descriptor Type 4"},
{UCD_BURST_DESCR5, "Burst Descriptor Type 5"},
{UCD_EXT_PREAMBLE, "Extended Preamble Pattern"},
{UCD_SCDMA_MODE_ENABLED, "S-CDMA Mode Enabled"},
{UCD_MAINTAIN_POWER_SPECTRAL_DENSITY, "Maintain Power Spectral Density"},
{UCD_RANGING_REQUIRED, "Ranging Required"},
{UCD_RANGING_HOLD_OFF_PRIORITY_FIELD, "Ranging Hold-Off Priority Field"},
{UCD_RANGING_CHANNEL_CLASS_ID, "Ranging Channel Class ID"},
{0, NULL}
};
static const value_string burst_tlv_vals[] = {
{UCD_MODULATION, "Modulation Type"},
{UCD_DIFF_ENCODING, "Differential Encoding"},
{UCD_PREAMBLE_LEN, "Preamble Length"},
{UCD_PREAMBLE_VAL_OFF, "Preamble Value Offset"},
{UCD_FEC, "FEC Error Correction (T)"},
{UCD_FEC_CODEWORD, "FEC Codeword Information Bytes (k)"},
{UCD_SCRAMBLER_SEED, "Scrambler Seed"},
{UCD_MAX_BURST, "Maximum Burst Size"},
{UCD_GUARD_TIME, "Guard Time Size"},
{UCD_LAST_CW_LEN, "Last Codeword Length"},
{UCD_SCRAMBLER_ONOFF, "Scrambler on/off"},
{UCD_RS_INT_DEPTH, "R-S Interleaver Depth (Ir)"},
{UCD_RS_INT_BLOCK, "R-S Interleaver Block Size (Br)"},
{UCD_PREAMBLE_TYPE, "Preamble Type"},
{0, NULL}
};
static const value_string on_off_vals[] = {
{1, "On"},
{2, "Off"},
{0, NULL}
};
static const true_false_string tfs_allow_inhibit = { "Inhibit Initial Ranging", "Ranging Allowed" };
static const value_string inhibit_allow_vals[] = {
{0, "Inhibit Initial Ranging"},
{1, "Ranging Allowed"},
{0, NULL},
};
static const value_string mod_vals[] = {
{1, "QPSK"},
{2, "16-QAM"},
{3, "8-QAM"},
{4, "32-QAM"},
{5, "64-QAM"},
{6, "128-QAM (SCDMA-only)"},
{7, "Reserved for C-DOCSIS"},
{0, NULL}
};
static const value_string iuc_vals[] = {
{IUC_REQUEST, "Request"},
{IUC_REQ_DATA, "REQ/Data"},
{IUC_INIT_MAINT, "Initial Maintenance"},
{IUC_STATION_MAINT, "Station Maintenance"},
{IUC_SHORT_DATA_GRANT, "Short Data Grant"},
{IUC_LONG_DATA_GRANT, "Long Data Grant"},
{IUC_NULL_IE, "NULL IE"},
{IUC_DATA_ACK, "Data Ack"},
{IUC_ADV_PHY_SHORT_DATA_GRANT, "Advanced Phy Short Data Grant"},
{IUC_ADV_PHY_LONG_DATA_GRANT, "Advanced Phy Long Data Grant"},
{IUC_ADV_PHY_UGS, "Advanced Phy UGS"},
{IUC_RESERVED12, "Reserved"},
{IUC_RESERVED13, "Reserved"},
{IUC_RESERVED14, "Reserved"},
{IUC_EXPANSION, "Expanded IUC"},
{0, NULL}
};
static const value_string last_cw_len_vals[] = {
{1, "Fixed"},
{2, "Shortened"},
{0, NULL}
};
static const value_string ranging_req_vals[] = {
{0, "No ranging required"},
{1, "Unicast initial ranging required"},
{2, "Broadcast initial ranging required"},
{0, NULL}
};
/* Dissection */
static int
dissect_ucd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
int pos, tlvpos, endtlvpos;
guint32 length, tlvlen;
guint8 type, tlvtype;
proto_tree *ucd_tree, *tlv_tree, *burst_tree;
proto_item *ucd_item, *tlv_item, *tlv_len_item, *burst_item, *burst_len_item;
guint8 upchid, symrate;
upchid = tvb_get_guint8 (tvb, 0);
/* if the upstream Channel ID is 0 then this is for Telephony Return) */
if (upchid > 0)
col_add_fstr (pinfo->cinfo, COL_INFO,
"Type 2 UCD Message: Channel ID = %u (U%u)", upchid,
upchid - 1);
else
col_add_fstr (pinfo->cinfo, COL_INFO,
"Type 2 UCD Message: Channel ID = %u (Telephony Return)",
upchid);
ucd_item = proto_tree_add_item(tree, proto_docsis_ucd, tvb, 0, -1, ENC_NA);
ucd_tree = proto_item_add_subtree (ucd_item, ett_docsis_ucd);
proto_tree_add_item (ucd_tree, hf_docsis_ucd_upstream_chid, tvb, 0, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (ucd_tree, hf_docsis_ucd_config_ch_cnt, tvb, 1, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (ucd_tree, hf_docsis_ucd_mini_slot_size, tvb, 2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (ucd_tree, hf_docsis_ucd_down_chid, tvb, 3, 1, ENC_BIG_ENDIAN);
pos = 4;
while (tvb_reported_length_remaining(tvb, pos) > 0)
{
type = tvb_get_guint8 (tvb, pos);
tlv_tree = proto_tree_add_subtree(ucd_tree, tvb, pos, -1,
ett_docsis_tlv, &tlv_item,
val_to_str(type, channel_tlv_vals,
"Unknown TLV (%u)"));
proto_tree_add_uint (tlv_tree, hf_docsis_ucd_type, tvb, pos, 1, type);
pos++;
tlv_len_item = proto_tree_add_item_ret_uint (tlv_tree, hf_docsis_ucd_length, tvb, pos, 1, ENC_NA, &length);
pos++;
proto_item_set_len(tlv_item, length + 2);
switch (type)
{
case UCD_SYMBOL_RATE:
if (length == 1)
{
symrate = tvb_get_guint8 (tvb, pos);
proto_tree_add_uint (tlv_tree, hf_docsis_ucd_symbol_rate, tvb, pos, length, symrate * 160);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_FREQUENCY:
if (length == 4)
{
proto_tree_add_item (tlv_tree, hf_docsis_ucd_frequency, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_PREAMBLE:
proto_tree_add_item (tlv_tree, hf_docsis_ucd_preamble_pat, tvb, pos, length, ENC_NA);
break;
case UCD_EXT_PREAMBLE:
proto_tree_add_item (tlv_tree, hf_docsis_ucd_ext_preamble_pat, tvb, pos, length, ENC_NA);
break;
case UCD_SCDMA_MODE_ENABLED:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_docsis_ucd_scdma_mode_enabled, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_MAINTAIN_POWER_SPECTRAL_DENSITY:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_docsis_ucd_maintain_power_spectral_density, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_RANGING_REQUIRED:
if (length == 1)
{
proto_tree_add_item (tlv_tree, hf_docsis_ucd_ranging_required, tvb, pos, length, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_RANGING_HOLD_OFF_PRIORITY_FIELD:
if (length == 4)
{
static const int * ucd_rnghoff[] = {
&hf_docsis_ucd_rnghoff_cm,
&hf_docsis_ucd_rnghoff_erouter,
&hf_docsis_ucd_rnghoff_emta,
&hf_docsis_ucd_rnghoff_estb,
&hf_docsis_ucd_rnghoff_rsvd,
&hf_docsis_ucd_rnghoff_id_ext,
NULL
};
proto_tree_add_bitmask_list(tlv_tree, tvb, pos, length, ucd_rnghoff, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_RANGING_CHANNEL_CLASS_ID:
if (length == 4)
{
static const int * ucd_chan_class_id[] = {
&hf_docsis_ucd_chan_class_id_cm,
&hf_docsis_ucd_chan_class_id_erouter,
&hf_docsis_ucd_chan_class_id_emta,
&hf_docsis_ucd_chan_class_id_estb,
&hf_docsis_ucd_chan_class_id_rsvd,
&hf_docsis_ucd_chan_class_id_id_ext,
NULL
};
proto_tree_add_bitmask_list(tlv_tree, tvb, pos, length, ucd_chan_class_id, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, tlv_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_BURST_DESCR:
tlvpos = pos;
endtlvpos = tlvpos + length;
proto_tree_add_item (tlv_tree, hf_docsis_ucd_iuc, tvb, tlvpos++, 1, ENC_BIG_ENDIAN);
while (tlvpos < endtlvpos)
{
tlvtype = tvb_get_guint8 (tvb, tlvpos);
burst_tree = proto_tree_add_subtree (tlv_tree, tvb, tlvpos, -1,
ett_docsis_burst_tlv, &burst_item,
val_to_str(tlvtype, burst_tlv_vals,
"Unknown TLV (%u)"));
proto_tree_add_uint (burst_tree, hf_docsis_ucd_burst_type, tvb, tlvpos++, 1, tlvtype);
burst_len_item = proto_tree_add_item_ret_uint (burst_tree, hf_docsis_ucd_burst_length, tvb, tlvpos++, 1, ENC_NA, &tlvlen);
proto_item_set_len(burst_item, tlvlen + 2);
switch (tlvtype)
{
case UCD_MODULATION:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_mod_type, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_DIFF_ENCODING:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_diff_encoding, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_PREAMBLE_LEN:
if (tlvlen == 2)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_preamble_len, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_PREAMBLE_VAL_OFF:
if (tlvlen == 2)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_preamble_val_off, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_FEC:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_fec, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_FEC_CODEWORD:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_fec_codeword, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_SCRAMBLER_SEED:
if (tlvlen == 2)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_scrambler_seed, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_MAX_BURST:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_max_burst, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_GUARD_TIME:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_guard_time, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_LAST_CW_LEN:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_last_cw_len, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_SCRAMBLER_ONOFF:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_scrambler_onoff, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
} /* switch(tlvtype) */
tlvpos += tlvlen;
} /* while (tlvpos < endtlvpos) */
break;
case UCD_BURST_DESCR5:
/* DOCSIS 2.0 Upstream Channel Descriptor */
tlvpos = pos;
endtlvpos = tlvpos + length;
proto_tree_add_item (tlv_tree, hf_docsis_ucd_iuc, tvb, tlvpos++, 1, ENC_BIG_ENDIAN);
while (tlvpos < endtlvpos)
{
tlvtype = tvb_get_guint8 (tvb, tlvpos);
burst_tree = proto_tree_add_subtree (tlv_tree, tvb, tlvpos, -1,
ett_docsis_burst_tlv, &burst_item,
val_to_str(tlvtype, burst_tlv_vals,
"Unknown TLV (%u)"));
proto_tree_add_uint (burst_tree, hf_docsis_ucd_burst_type, tvb, tlvpos++, 1, tlvtype);
burst_len_item = proto_tree_add_item_ret_uint (burst_tree, hf_docsis_ucd_burst_length, tvb, tlvpos++, 1, ENC_NA, &tlvlen);
proto_item_set_len(burst_item, tlvlen + 2);
switch (tlvtype)
{
case UCD_MODULATION:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_mod_type, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_DIFF_ENCODING:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_diff_encoding, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_PREAMBLE_LEN:
if (tlvlen == 2)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_preamble_len, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_PREAMBLE_VAL_OFF:
if (tlvlen == 2)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_preamble_val_off, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_FEC:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_fec, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_FEC_CODEWORD:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_fec_codeword, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_SCRAMBLER_SEED:
if (tlvlen == 2)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_scrambler_seed, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_MAX_BURST:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_max_burst, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_GUARD_TIME:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_guard_time, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_LAST_CW_LEN:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_last_cw_len, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_SCRAMBLER_ONOFF:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_burst_scrambler_onoff, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_RS_INT_DEPTH:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_rs_int_depth, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_RS_INT_BLOCK:
if (tlvlen == 2)
{
proto_tree_add_item (burst_tree, hf_docsis_rs_int_block, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
case UCD_PREAMBLE_TYPE:
if (tlvlen == 1)
{
proto_tree_add_item (burst_tree, hf_docsis_preamble_type, tvb, tlvpos, tlvlen, ENC_BIG_ENDIAN);
}
else
{
expert_add_info_format(pinfo, burst_len_item, &ei_docsis_ucd_tlvlen_bad, "Wrong TLV length: %u", length);
}
break;
} /* switch(tlvtype) */
tlvpos += tlvlen;
} /* while (tlvpos < endtlvpos) */
break;
} /* switch(type) */
pos += length;
} /* tvb_reported_length_remaining(tvb, pos) > 0 */
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_ucd (void)
{
static hf_register_info hf[] = {
{&hf_docsis_ucd_upstream_chid,
{"Upstream Channel ID", "docsis_ucd.upchid",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_ucd_config_ch_cnt,
{"Config Change Count", "docsis_ucd.confcngcnt",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Configuration Change Count", HFILL}
},
{&hf_docsis_ucd_mini_slot_size,
{"Mini Slot Size (6.25us TimeTicks)", "docsis_ucd.mslotsize",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_ucd_down_chid,
{"Downstream Channel ID", "docsis_ucd.downchid",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Management Message", HFILL}
},
{&hf_docsis_ucd_type,
{"Type", "docsis_ucd.type",
FT_UINT8, BASE_DEC, VALS(channel_tlv_vals), 0x0,
"Channel TLV type", HFILL}
},
{&hf_docsis_ucd_length,
{"Length", "docsis_ucd.length",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Channel TLV length", HFILL}
},
{&hf_docsis_ucd_burst_type,
{"Type", "docsis_ucd.burst.tlvtype",
FT_UINT8, BASE_DEC, VALS(burst_tlv_vals), 0x0,
"Burst TLV type", HFILL}
},
{&hf_docsis_ucd_burst_length,
{"Length", "docsis_ucd.burst.tlvlen",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Burst TLV length", HFILL}
},
{&hf_docsis_ucd_symbol_rate,
{"Symbol Rate (ksym/sec)", "docsis_ucd.symrate",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Symbol Rate", HFILL}
},
{&hf_docsis_ucd_frequency,
{"Frequency (Hz)", "docsis_ucd.freq",
FT_UINT32, BASE_DEC, NULL, 0x0,
"Upstream Center Frequency", HFILL}
},
{&hf_docsis_ucd_preamble_pat,
{"Preamble Pattern", "docsis_ucd.preamble",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Preamble Superstring", HFILL}
},
{&hf_docsis_ucd_ext_preamble_pat,
{"Extended Preamble Pattern", "docsis_ucd.extpreamble",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Extended Preamble Superstring", HFILL}
},
{&hf_docsis_ucd_scdma_mode_enabled,
{"S-CDMA Mode Enabled", "docsis_ucd.scdma",
FT_UINT8, BASE_DEC, VALS (on_off_vals), 0x0,
NULL, HFILL}
},
{&hf_docsis_ucd_maintain_power_spectral_density,
{"Maintain Power Spectral Density", "docsis_ucd.maintpower",
FT_UINT8, BASE_DEC, VALS (on_off_vals), 0x0,
NULL, HFILL}
},
{&hf_docsis_ucd_ranging_required,
{"Ranging Required", "docsis_ucd.rangingreq",
FT_UINT8, BASE_DEC, VALS (ranging_req_vals), 0x0,
NULL, HFILL}
},
{&hf_docsis_ucd_rnghoff_cm,
{"Ranging Hold-Off (CM)","docsis_ucd.rnghoffcm",
FT_BOOLEAN, 32, TFS(&tfs_allow_inhibit), 0x1,
NULL, HFILL}
},
{&hf_docsis_ucd_rnghoff_erouter,
{"Ranging Hold-Off (eRouter)",
"docsis_ucd.rnghofferouter",
FT_BOOLEAN, 32, TFS(&tfs_allow_inhibit), 0x2,
NULL, HFILL}
},
{&hf_docsis_ucd_rnghoff_emta,
{"Ranging Hold-Off (eMTA or EDVA)",
"docsis_ucd.rnghoffemta",
FT_BOOLEAN, 32, TFS(&tfs_allow_inhibit), 0x4,
NULL, HFILL}
},
{&hf_docsis_ucd_rnghoff_estb,
{"Ranging Hold-Off (DSG/eSTB)",
"docsis_ucd.rnghoffestb",
FT_BOOLEAN, 32, TFS(&tfs_allow_inhibit), 0x8,
NULL, HFILL}
},
{&hf_docsis_ucd_rnghoff_rsvd,
{"Reserved",
"docsis_ucd.rnghoffrsvd",
FT_UINT32, BASE_HEX, NULL, 0xFFF0,
NULL, HFILL}
},
{&hf_docsis_ucd_rnghoff_id_ext,
{"CM Ranging Class ID Extension",
"docsis_ucd.rngidext",
FT_UINT32, BASE_HEX, NULL, 0xFFFF0000,
NULL, HFILL}
},
{&hf_docsis_ucd_chan_class_id_cm,
{"Channel Class ID (CM)","docsis_ucd.classidcm",
FT_UINT32, BASE_DEC, VALS (inhibit_allow_vals), 0x1,
NULL, HFILL}
},
{&hf_docsis_ucd_chan_class_id_erouter,
{"Channel Class ID (eRouter)",
"docsis_ucd.classiderouter",
FT_UINT32, BASE_DEC, VALS (inhibit_allow_vals), 0x2,
NULL, HFILL}
},
{&hf_docsis_ucd_chan_class_id_emta,
{"Channel Class ID (eMTA or EDVA)",
"docsis_ucd.classidemta",
FT_UINT32, BASE_DEC, VALS (inhibit_allow_vals), 0x4,
NULL, HFILL}
},
{&hf_docsis_ucd_chan_class_id_estb,
{"Channel Class ID (DSG/eSTB)",
"docsis_ucd.classidestb",
FT_UINT32, BASE_DEC, VALS (inhibit_allow_vals), 0x8,
NULL, HFILL}
},
{&hf_docsis_ucd_chan_class_id_rsvd,
{"Reserved",
"docsis_ucd.classidrsvd",
FT_UINT32, BASE_HEX, NULL, 0xFFF0,
NULL, HFILL}
},
{&hf_docsis_ucd_chan_class_id_id_ext,
{"CM Ranging Class ID Extension",
"docsis_ucd.classidext",
FT_UINT32, BASE_HEX, NULL, 0xFFFF0000,
NULL, HFILL}
},
{&hf_docsis_ucd_iuc,
{"Interval Usage Code", "docsis_ucd.iuc",
FT_UINT8, BASE_DEC, VALS (iuc_vals), 0x0,
NULL, HFILL}
},
{&hf_docsis_burst_mod_type,
{"Modulation Type", "docsis_ucd.burst.modtype",
FT_UINT8, BASE_DEC, VALS (mod_vals), 0x0,
NULL, HFILL}
},
{&hf_docsis_burst_diff_encoding,
{"Differential Encoding", "docsis_ucd.burst.diffenc",
FT_UINT8, BASE_DEC, VALS (on_off_vals), 0x0,
NULL, HFILL}
},
{&hf_docsis_burst_preamble_len,
{"Preamble Length (Bits)", "docsis_ucd.burst.preamble_len",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_burst_preamble_val_off,
{"Preamble Offset (Bits)", "docsis_ucd.burst.preamble_off",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_burst_fec,
{"FEC (T)", "docsis_ucd.burst.fec",
FT_UINT8, BASE_DEC, NULL, 0x0,
"FEC (T) Codeword Parity Bits = 2^T", HFILL}
},
{&hf_docsis_burst_fec_codeword,
{"FEC Codeword Info bytes (k)", "docsis_ucd.burst.fec_codeword",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_burst_scrambler_seed,
{"Scrambler Seed", "docsis_ucd.burst.scrambler_seed",
FT_UINT16, BASE_HEX, NULL, 0x0,
"Burst Descriptor", HFILL}
},
{&hf_docsis_burst_max_burst,
{"Max Burst Size (Minislots)", "docsis_ucd.burst.maxburst",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_burst_guard_time,
{"Guard Time Size (Symbol Times)", "docsis_ucd.burst.guardtime",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Guard Time Size", HFILL}
},
{&hf_docsis_burst_last_cw_len,
{"Last Codeword Length", "docsis_ucd.burst.last_cw_len",
FT_UINT8, BASE_DEC, VALS (last_cw_len_vals), 0x0,
NULL, HFILL}
},
{&hf_docsis_burst_scrambler_onoff,
{"Scrambler On/Off", "docsis_ucd.burst.scrambleronoff",
FT_UINT8, BASE_DEC, VALS (on_off_vals), 0x0,
NULL, HFILL}
},
{&hf_docsis_rs_int_depth,
{"RS Interleaver Depth", "docsis_ucd.burst.rsintdepth",
FT_UINT8, BASE_DEC, NULL, 0x0,
"R-S Interleaver Depth", HFILL}
},
{&hf_docsis_rs_int_block,
{"RS Interleaver Block Size", "docsis_ucd.burst.rsintblock",
FT_UINT8, BASE_DEC, NULL, 0x0,
"R-S Interleaver Block", HFILL}
},
{&hf_docsis_preamble_type,
{"Preamble Type", "docsis_ucd.burst.preambletype",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static ei_register_info ei[] = {
{&ei_docsis_ucd_tlvlen_bad, {"docsis_ucd.tlvlenbad", PI_MALFORMED, PI_ERROR, "Bad TLV length", EXPFILL}},
};
static gint *ett[] = {
&ett_docsis_ucd,
&ett_docsis_tlv,
&ett_docsis_burst_tlv,
};
expert_module_t* expert_docsis_ucd;
proto_docsis_ucd =
proto_register_protocol ("DOCSIS Upstream Channel Descriptor", "DOCSIS UCD", "docsis_ucd");
proto_register_field_array (proto_docsis_ucd, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
expert_docsis_ucd = expert_register_protocol(proto_docsis_ucd);
expert_register_field_array(expert_docsis_ucd, ei, array_length(ei));
docsis_ucd_handle = register_dissector ("docsis_ucd", dissect_ucd, proto_docsis_ucd);
}
void
proto_reg_handoff_docsis_ucd (void)
{
dissector_add_uint ("docsis_mgmt", 0x02, docsis_ucd_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/