diff options
author | Michael Mann <mmann78@netscape.net> | 2013-09-20 19:02:15 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-09-20 19:02:15 +0000 |
commit | a92dd77e6e70cb2e047eae30d2471e75c98a71b5 (patch) | |
tree | ea32ab85fcc1beb6a1c6b3f3640fe9bcba17c247 /plugins/docsis/packet-docsis.c | |
parent | 61c9a77cd9245a3c50b66818c4bcd9024a6b297c (diff) |
Enhance DOCSIS dissector with new fields. Bug 9149 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9149)
From Jerry Negele
svn path=/trunk/; revision=52158
Diffstat (limited to 'plugins/docsis/packet-docsis.c')
-rw-r--r-- | plugins/docsis/packet-docsis.c | 91 |
1 files changed, 86 insertions, 5 deletions
diff --git a/plugins/docsis/packet-docsis.c b/plugins/docsis/packet-docsis.c index 918d7cf62f..d6e709a893 100644 --- a/plugins/docsis/packet-docsis.c +++ b/plugins/docsis/packet-docsis.c @@ -61,8 +61,8 @@ #define EH_BP_DOWN 4 #define EH_SFLOW_HDR_DOWN 5 #define EH_SFLOW_HDR_UP 6 -#define EH_RESERVED_7 7 -#define EH_RESERVED_8 8 +#define EH_BP_UP2 7 +#define EH_DS_SERVICE 8 #define EH_RESERVED_9 9 #define EH_RESERVED_10 10 #define EH_RESERVED_11 11 @@ -100,7 +100,15 @@ static int hf_docsis_ehdr_phsi = -1; static int hf_docsis_ehdr_qind = -1; static int hf_docsis_ehdr_grants = -1; static int hf_docsis_reserved = -1; - +static int hf_docsis_ehdr_ds_traffic_pri = -1; +static int hf_docsis_ehdr_ds_seq_chg_cnt = -1; +static int hf_docsis_ehdr_ds_dsid = -1; +static int hf_docsis_ehdr_ds_pkt_seq_num = -1; +static int hf_docsis_ehdr_bpup2_bpi_en = -1; +static int hf_docsis_ehdr_bpup2_toggle_bit = -1; +static int hf_docsis_ehdr_bpup2_key_seq = -1; +static int hf_docsis_ehdr_bpup2_ver = -1; +static int hf_docsis_ehdr_bpup2_sid = -1; static dissector_handle_t docsis_handle; static dissector_handle_t eth_withoutfcs_handle; static dissector_handle_t data_handle; @@ -129,8 +137,8 @@ static const value_string eh_type_vals[] = { {EH_BP_DOWN, "Downstream Privacy Element"}, {EH_SFLOW_HDR_UP, "Service Flow EH; PHS Header Upstream"}, {EH_SFLOW_HDR_DOWN, "Service Flow EH; PHS Header Downstream"}, - {EH_RESERVED_7, "Reserved"}, - {EH_RESERVED_8, "Reserved"}, + {EH_BP_UP2, "Upstream Privacy with Multi Channel"}, + {EH_DS_SERVICE, "Downstream Service"}, {EH_RESERVED_9, "Reserved"}, {EH_RESERVED_10, "Reserved"}, {EH_RESERVED_10, "Reserved"}, @@ -289,6 +297,34 @@ dissect_ehdr (tvbuff_t * tvb, proto_tree * tree, gboolean isfrag) proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_grants, tvb, pos+2, 1, ENC_BIG_ENDIAN); } break; + case EH_BP_UP2: + proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_bpup2_key_seq, tvb, pos + 1, 1, + ENC_BIG_ENDIAN); + proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_bpup2_ver, tvb, pos + 1, 1, + ENC_BIG_ENDIAN); + proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_bpup2_bpi_en, tvb, pos + 2, 1, + ENC_BIG_ENDIAN); + proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_bpup2_toggle_bit, tvb, pos + 2, + 1, ENC_BIG_ENDIAN); + proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_bpup2_sid, tvb, pos + 2, 2, + ENC_BIG_ENDIAN); + break; + case EH_DS_SERVICE: + proto_tree_add_item(ehdr_tree, hf_docsis_ehdr_ds_traffic_pri, tvb, pos+1, 1, FALSE); + + if (len == 3) + { + proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_ds_dsid, tvb, pos+1, 3, FALSE); + } + + if (len == 5) + { + proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_ds_seq_chg_cnt, tvb, pos+1, 1, FALSE); + proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_ds_dsid, tvb, pos+1, 3, FALSE); + proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_ds_pkt_seq_num, tvb, pos+4, 2, FALSE); + } + + break; default: if (len > 0) proto_tree_add_item (ehdr_tree, hf_docsis_eh_val, tvb, pos + 1, @@ -696,6 +732,51 @@ proto_register_docsis (void) FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL} }, + {&hf_docsis_ehdr_bpup2_key_seq, + {"Key Sequence", "docsis.ehdr.bpup2_keyseq", + FT_UINT8, BASE_DEC, NULL, 0xF0, + "NULL", HFILL} + }, + {&hf_docsis_ehdr_bpup2_ver, + {"Version", "docsis.ehdr.bpup2_ver", + FT_UINT8, BASE_DEC, NULL, 0x0F, + "NULL", HFILL} + }, + {&hf_docsis_ehdr_bpup2_bpi_en, + {"Encryption", "docsis.ehdr.bpup2_bpi_en", + FT_BOOLEAN, 8, TFS (&ena_dis_tfs), 0x80, + "BPI Enable", HFILL}, + }, + {&hf_docsis_ehdr_bpup2_toggle_bit, + {"Toggle", "docsis.ehdr.bpup2_toggle_bit", + FT_BOOLEAN, 8, TFS (&odd_even_tfs), 0x40, + "NULL", HFILL}, + }, + {&hf_docsis_ehdr_bpup2_sid, + {"SID", "docsis.ehdr.bpup2_sid", + FT_UINT16, BASE_DEC, NULL, 0x3FFF, + "Service Identifier", HFILL} + }, + {&hf_docsis_ehdr_ds_traffic_pri, + {"DS Traffic Priority", "docsis.ehdr.ds_traffic_pri", + FT_UINT8, BASE_DEC, NULL, 0xE0, + "NULL", HFILL} + }, + {&hf_docsis_ehdr_ds_seq_chg_cnt, + {"DS Sequence Change Count", "docsis.ehdr.ds_seq_chg_cnt", + FT_UINT8, BASE_DEC, NULL, 0x10, + "NULL", HFILL} + }, + {&hf_docsis_ehdr_ds_dsid, + {"DS DSID", "docsis.ehdr.ds_dsid", + FT_UINT32, BASE_DEC, NULL, 0x0FFFFF, + "NULL", HFILL} + }, + {&hf_docsis_ehdr_ds_pkt_seq_num, + {"DS Packet Sequence Number", "docsis.ehdr.ds_pkt_seq_num", + FT_UINT16, BASE_DEC, NULL, 0x0, + "NULL", HFILL} + }, {&hf_docsis_hcs, {"Header check sequence", "docsis.hcs", FT_UINT16, BASE_HEX, NULL, 0x0, |