aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/docsis/packet-macmgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/docsis/packet-macmgmt.c')
-rw-r--r--plugins/docsis/packet-macmgmt.c144
1 files changed, 68 insertions, 76 deletions
diff --git a/plugins/docsis/packet-macmgmt.c b/plugins/docsis/packet-macmgmt.c
index 8537ffbb5a..28b2578c31 100644
--- a/plugins/docsis/packet-macmgmt.c
+++ b/plugins/docsis/packet-macmgmt.c
@@ -93,72 +93,70 @@ static dissector_handle_t data_handle;
static gint ett_docsis_mgmt = -1;
static gint ett_mgmt_pay = -1;
-
static const value_string mgmt_type_vals[] = {
- {MGT_SYNC, "Timing Synchronisation"},
- {MGT_UCD, "Upstream Channel Descriptor"},
- {MGT_TYPE29UCD, "Upstream Channel Descriptor Type 29"},
- {MGT_TYPE35UCD, "Upstream Channel Descriptor Type 35"},
- {MGT_MAP, "Upstream Bandwidth Allocation"},
- {MGT_RNG_REQ, "Ranging Request"},
- {MGT_RNG_RSP, "Ranging Response"},
- {MGT_REG_REQ, "Registration Request"},
- {MGT_REG_RSP, "Registration Response"},
- {MGT_UCC_REQ, "Upstream Channel Change Request"},
- {MGT_UCC_RSP, "Upstream Channel Change Response"},
- {MGT_TRI_TCD, "Telephony Channel Descriptor"},
- {MGT_TRI_TSI, "Termination System Information"},
- {MGT_BPKM_REQ, "Privacy Key Management Request"},
- {MGT_BPKM_RSP, "Privacy Key Management Response"},
- {MGT_REG_ACK, "Registration Acknowledge"},
- {MGT_DSA_REQ, "Dynamic Service Addition Request"},
- {MGT_DSA_RSP, "Dynamic Service Addition Response"},
- {MGT_DSA_ACK, "Dynamic Service Addition Acknowledge"},
- {MGT_DSC_REQ, "Dynamic Service Change Request"},
- {MGT_DSC_RSP, "Dynamic Service Change Response"},
- {MGT_DSC_ACK, "Dynamic Service Change Acknowledge"},
- {MGT_DSD_REQ, "Dynamic Service Delete Request"},
- {MGT_DSD_RSP, "Dynamic Service Delete Response"},
- {MGT_DCC_REQ, "Dynamic Channel Change Request"},
- {MGT_DCC_RSP, "Dynamic Channel Change Response"},
- {MGT_DCC_ACK, "Dynamic Channel Change Acknowledge"},
- {MGT_DCI_REQ, "Device Class Identification Request"},
- {MGT_DCI_RSP, "Device Class Identification Response"},
- {MGT_UP_DIS, "Upstream Channel Disable"},
- {MGT_INIT_RNG_REQ, "Initial Ranging Request"},
- {MGT_TEST_REQ, "Test Request Message"},
- {MGT_DS_CH_DESC, "Downstream Channel Descriptor"},
- {MGT_MDD, "MAC Domain Descriptor"},
+ {MGT_SYNC, "Timing Synchronisation"},
+ {MGT_UCD, "Upstream Channel Descriptor"},
+ {MGT_TYPE29UCD, "Upstream Channel Descriptor Type 29"},
+ {MGT_TYPE35UCD, "Upstream Channel Descriptor Type 35"},
+ {MGT_MAP, "Upstream Bandwidth Allocation"},
+ {MGT_RNG_REQ, "Ranging Request"},
+ {MGT_RNG_RSP, "Ranging Response"},
+ {MGT_REG_REQ, "Registration Request"},
+ {MGT_REG_RSP, "Registration Response"},
+ {MGT_UCC_REQ, "Upstream Channel Change Request"},
+ {MGT_UCC_RSP, "Upstream Channel Change Response"},
+ {MGT_TRI_TCD, "Telephony Channel Descriptor"},
+ {MGT_TRI_TSI, "Termination System Information"},
+ {MGT_BPKM_REQ, "Privacy Key Management Request"},
+ {MGT_BPKM_RSP, "Privacy Key Management Response"},
+ {MGT_REG_ACK, "Registration Acknowledge"},
+ {MGT_DSA_REQ, "Dynamic Service Addition Request"},
+ {MGT_DSA_RSP, "Dynamic Service Addition Response"},
+ {MGT_DSA_ACK, "Dynamic Service Addition Acknowledge"},
+ {MGT_DSC_REQ, "Dynamic Service Change Request"},
+ {MGT_DSC_RSP, "Dynamic Service Change Response"},
+ {MGT_DSC_ACK, "Dynamic Service Change Acknowledge"},
+ {MGT_DSD_REQ, "Dynamic Service Delete Request"},
+ {MGT_DSD_RSP, "Dynamic Service Delete Response"},
+ {MGT_DCC_REQ, "Dynamic Channel Change Request"},
+ {MGT_DCC_RSP, "Dynamic Channel Change Response"},
+ {MGT_DCC_ACK, "Dynamic Channel Change Acknowledge"},
+ {MGT_DCI_REQ, "Device Class Identification Request"},
+ {MGT_DCI_RSP, "Device Class Identification Response"},
+ {MGT_UP_DIS, "Upstream Channel Disable"},
+ {MGT_INIT_RNG_REQ, "Initial Ranging Request"},
+ {MGT_TEST_REQ, "Test Request Message"},
+ {MGT_DS_CH_DESC, "Downstream Channel Descriptor"},
+ {MGT_MDD, "MAC Domain Descriptor"},
{MGT_B_INIT_RNG_REQ, "Bonded Initial Ranging Request"},
- {MGT_DBC_REQ, "Dynamic Bonding Change Request"},
- {MGT_DBC_RSP, "Dynamic Bonding Change Response"},
- {MGT_DBC_ACK, "Dynamic Bonding Change Acknowledge"},
- {MGT_DPV_REQ, "DOCSIS Path Verify Request"},
- {MGT_DPV_RSP, "DOCSIS Path Verify Response"},
- {MGT_CM_STATUS, "CM Status Report"},
- {MGT_CM_CTRL_REQ, "CM Control Request"},
- {MGT_CM_CTRL_RSP, "CM Control Response"},
- {MGT_REG_REQ_MP, "Multipart Registration Request"},
- {MGT_REG_RSP_MP, "Multipart Registration Response"},
+ {MGT_DBC_REQ, "Dynamic Bonding Change Request"},
+ {MGT_DBC_RSP, "Dynamic Bonding Change Response"},
+ {MGT_DBC_ACK, "Dynamic Bonding Change Acknowledge"},
+ {MGT_DPV_REQ, "DOCSIS Path Verify Request"},
+ {MGT_DPV_RSP, "DOCSIS Path Verify Response"},
+ {MGT_CM_STATUS, "CM Status Report"},
+ {MGT_CM_CTRL_REQ, "CM Control Request"},
+ {MGT_CM_CTRL_RSP, "CM Control Response"},
+ {MGT_REG_REQ_MP, "Multipart Registration Request"},
+ {MGT_REG_RSP_MP, "Multipart Registration Response"},
{0, NULL}
};
-/* Code to actually dissect the packets */
+/* Dissection */
static void
dissect_macmgmt (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
-
const guint8 *src, *dst;
guint16 msg_len;
proto_item *mgt_hdr_it;
proto_tree *mgt_hdr_tree;
tvbuff_t *payload_tvb;
guint8 type;
+
col_set_str (pinfo->cinfo, COL_PROTOCOL, "DOCSIS MGMT");
col_clear(pinfo->cinfo, COL_INFO);
-
src = tvb_get_ptr (tvb, 6, 6);
dst = tvb_get_ptr (tvb, 0, 6);
SET_ADDRESS (&pinfo->dl_src, AT_ETHER, 6, src);
@@ -190,7 +188,6 @@ dissect_macmgmt (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
ENC_BIG_ENDIAN);
proto_tree_add_item (mgt_hdr_tree, hf_docsis_mgt_rsvd, tvb, 19, 1,
ENC_BIG_ENDIAN);
-
}
/* Code to Call subdissector */
/* sub-dissectors are based on the type field */
@@ -205,69 +202,58 @@ dissect_macmgmt (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
call_dissector (data_handle, payload_tvb, pinfo, tree);
}
-
/* 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_mgmt (void)
{
-
-/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf[] = {
{&hf_docsis_mgt_dst_addr,
{"Destination Address", "docsis_mgmt.dst",
FT_ETHER, BASE_NONE, NULL, 0x0,
NULL, HFILL}
- },
+ },
{&hf_docsis_mgt_src_addr,
{"Source Address", "docsis_mgmt.src",
FT_ETHER, BASE_NONE, NULL, 0x0,
NULL, HFILL}
- },
+ },
{&hf_docsis_mgt_msg_len,
{"Message Length - DSAP to End (Bytes)", "docsis_mgmt.msglen",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Message Length", HFILL}
- },
+ },
{&hf_docsis_mgt_dsap,
{"DSAP [0x00]", "docsis_mgmt.dsap",
FT_UINT8, BASE_HEX, NULL, 0x0,
"Destination SAP", HFILL}
- },
+ },
{&hf_docsis_mgt_ssap,
{"SSAP [0x00]", "docsis_mgmt.ssap",
FT_UINT8, BASE_HEX, NULL, 0x0,
"Source SAP", HFILL}
- },
+ },
{&hf_docsis_mgt_control,
{"Control [0x03]", "docsis_mgmt.control",
FT_UINT8, BASE_HEX, NULL, 0x0,
"Control", HFILL}
- },
+ },
{&hf_docsis_mgt_version,
{"Version", "docsis_mgmt.version",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
- },
+ },
{&hf_docsis_mgt_type,
{"Type", "docsis_mgmt.type",
FT_UINT8, BASE_DEC, VALS (mgmt_type_vals), 0x0,
NULL, HFILL}
- },
+ },
{&hf_docsis_mgt_rsvd,
{"Reserved [0x00]", "docsis_mgmt.rsvd",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Reserved", HFILL}
- },
-
+ },
};
-/* Setup protocol subtree array */
static gint *ett[] = {
&ett_docsis_mgmt,
&ett_mgmt_pay,
@@ -278,23 +264,16 @@ proto_register_docsis_mgmt (void)
FT_UINT8, BASE_DEC);
-/* Register the protocol name and description */
proto_docsis_mgmt = proto_register_protocol ("DOCSIS Mac Management",
"DOCSIS MAC MGMT",
"docsis_mgmt");
-/* Required function calls to register the header fields and subtrees used */
proto_register_field_array (proto_docsis_mgmt, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
register_dissector ("docsis_mgmt", dissect_macmgmt, proto_docsis_mgmt);
}
-
-/* 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_mgmt (void)
{
@@ -307,3 +286,16 @@ proto_reg_handoff_docsis_mgmt (void)
data_handle = find_dissector ("data");
}
+
+/*
+ * 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:
+ */