aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-08-30 10:02:14 +0000
committerGuy Harris <guy@alum.mit.edu>2002-08-30 10:02:14 +0000
commit2ac3b234550d8ccacc1fe154eae15d926f319f3b (patch)
tree63a464f6ea2ea38e35fbbc5835436190cbd7c08e /plugins
parent765bad85dcbf058c7c5ab5d20f34df2823ccd41f (diff)
From Anand Narwani: updates to fix:
- Bug in the dissection of the Request/Transmit policy in packet-tlv.c - Incorrect filter string for docsis.ehdr.ver - Dissection of PHS Upstream/Downstream Extended Header sub-elements - Dissection of Unsolicited Grant Sync sub-element svn path=/trunk/; revision=6141
Diffstat (limited to 'plugins')
-rw-r--r--plugins/docsis/packet-docsis.c56
-rw-r--r--plugins/docsis/packet-tlv.c16
2 files changed, 60 insertions, 12 deletions
diff --git a/plugins/docsis/packet-docsis.c b/plugins/docsis/packet-docsis.c
index cc7ce7d963..a37ade51a0 100644
--- a/plugins/docsis/packet-docsis.c
+++ b/plugins/docsis/packet-docsis.c
@@ -2,7 +2,7 @@
* Routines for docsis dissection
* Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
*
- * $Id: packet-docsis.c,v 1.8 2002/08/28 20:38:59 jmayer Exp $
+ * $Id: packet-docsis.c,v 1.9 2002/08/30 10:02:10 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -109,6 +109,9 @@ static int hf_docsis_toggle_bit = -1;
static int hf_docsis_key_seq = -1;
static int hf_docsis_ehdr_ver = -1;
static int hf_docsis_said = -1;
+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 dissector_handle_t docsis_handle;
@@ -175,6 +178,12 @@ static const value_string true_false_vals[] = {
{ 0x00 , NULL }
};
+static const value_string on_off_vals[] = {
+ { 0x00 , "On"},
+ { 0x01 , "Off" },
+ { 0x00 , NULL }
+};
+
static const value_string ena_dis_vals[] = {
{0, "Disabled"},
{1, "Enabled"},
@@ -197,6 +206,7 @@ dissect_ehdr (tvbuff_t * tvb, proto_tree * tree, gboolean isfrag)
int pos;
guint8 type;
guint8 len;
+ guint8 val;
guint8 mini_slots;
guint16 sid;
@@ -207,10 +217,16 @@ dissect_ehdr (tvbuff_t * tvb, proto_tree * tree, gboolean isfrag)
ehdr_tree = proto_item_add_subtree (it, ett_ehdr);
while (pos < (int)(ehdrlen + 4))
{
- proto_tree_add_item (ehdr_tree, hf_docsis_eh_type, tvb, pos, 1, FALSE);
- proto_tree_add_item (ehdr_tree, hf_docsis_eh_len, tvb, pos, 1, FALSE);
type = (tvb_get_guint8 (tvb, pos) & 0xF0);
len = (tvb_get_guint8 (tvb, pos) & 0x0F);
+ if ((((type >> 4) & 0x0F)== 6) && (len == 2))
+ {
+ proto_tree_add_item_hidden (ehdr_tree, hf_docsis_eh_type, tvb, pos, 1, FALSE);
+ proto_tree_add_text(ehdr_tree, tvb, pos, 1, "0110 .... = Unsolicited Grant Sync EHDR Sub-Element" );
+ }
+ else
+ proto_tree_add_item (ehdr_tree, hf_docsis_eh_type, tvb, pos, 1, FALSE);
+ proto_tree_add_item (ehdr_tree, hf_docsis_eh_len, tvb, pos, 1, FALSE);
switch ((type >> 4) & 0x0F)
{
case EH_REQUEST:
@@ -278,6 +294,23 @@ dissect_ehdr (tvbuff_t * tvb, proto_tree * tree, gboolean isfrag)
proto_tree_add_item (ehdr_tree, hf_docsis_reserved, tvb, pos + 4, 1,
FALSE);
break;
+ case EH_SFLOW_HDR_DOWN:
+ case EH_SFLOW_HDR_UP:
+ val = tvb_get_guint8 (tvb, pos+1);
+ if (val == 0)
+ {
+ proto_tree_add_item_hidden (ehdr_tree, hf_docsis_ehdr_phsi, tvb, pos+1, 1, FALSE);
+ proto_tree_add_text (ehdr_tree, tvb, pos+1, 1, "0000 0000 = No PHS on current packet" );
+ }
+ else
+ proto_tree_add_item(ehdr_tree, hf_docsis_ehdr_phsi, tvb, pos+1, 1, FALSE);
+
+ if (len == 2)
+ {
+ proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_qind, tvb, pos+2, 1, FALSE);
+ proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_grants, tvb, pos+2, 1, FALSE);
+ }
+ break;
default:
if (len > 0)
proto_tree_add_item (ehdr_tree, hf_docsis_eh_val, tvb, pos + 1,
@@ -661,10 +694,25 @@ proto_register_docsis (void)
"Key Sequence", HFILL}
},
{&hf_docsis_ehdr_ver,
- {"Version", "docsis.ehdr.",
+ {"Version", "docsis.ehdr.ver",
FT_UINT8, BASE_DEC, NULL, 0x0F,
"Version", HFILL}
},
+ {&hf_docsis_ehdr_phsi,
+ {"Payload Header Supression Index", "docsis.ehdr.phsi",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ "Payload Header Supression Index", HFILL}
+ },
+ {&hf_docsis_ehdr_qind,
+ {"Queue Indicator", "docsis.ehdr.qind",
+ FT_UINT8, BASE_DEC, VALS(on_off_vals), 0x80,
+ "Queue Indicator", HFILL}
+ },
+ {&hf_docsis_ehdr_grants,
+ {"Active Grants", "docsis.ehdr.act_grants",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ "Active Grants", HFILL}
+ },
{&hf_docsis_hcs,
{"Header check sequence", "docsis.hcs",
FT_UINT16, BASE_HEX, NULL, 0x0,
diff --git a/plugins/docsis/packet-tlv.c b/plugins/docsis/packet-tlv.c
index 5bf4199143..4520d58c48 100644
--- a/plugins/docsis/packet-tlv.c
+++ b/plugins/docsis/packet-tlv.c
@@ -535,31 +535,31 @@ dissect_reqxmit_policy (tvbuff_t * tvb, proto_tree * tree, guint16 start)
FALSE);
pol_tree = proto_item_add_subtree (it, ett_docsis_tlv_reqxmitpol);
- if (value & 0x100)
+ if (value & 0x01)
proto_tree_add_text (pol_tree, tvb, start, 4,
"Service flow MUST NOT use \"all CMs\" broadcast request opportunities");
- if (value & 0x80)
+ if (value & 0x02)
proto_tree_add_text (pol_tree, tvb, start, 4,
"Service flow MUST NOT use priority multicast request opportunities");
- if (value & 0x40)
+ if (value & 0x04)
proto_tree_add_text (pol_tree, tvb, start, 4,
"Service flow MUST NOT use Request/Data opportunities for requests");
- if (value & 0x20)
+ if (value & 0x08)
proto_tree_add_text (pol_tree, tvb, start, 4,
"Service flow MUST NOT use Request/Data opportunities for data");
if (value & 0x10)
proto_tree_add_text (pol_tree, tvb, start, 4,
"Service flow MUST NOT use piggy back requests with data");
- if (value & 0x08)
+ if (value & 0x20)
proto_tree_add_text (pol_tree, tvb, start, 4,
"Service flow MUST NOT concatenate data");
- if (value & 0x04)
+ if (value & 0x40)
proto_tree_add_text (pol_tree, tvb, start, 4,
"Service flow MUST NOT fragment data");
- if (value & 0x02)
+ if (value & 0x80)
proto_tree_add_text (pol_tree, tvb, start, 4,
"Service flow MUST NOT suppress payload headers");
- if (value & 0x01)
+ if (value & 0x100)
proto_tree_add_text (pol_tree, tvb, start, 4,
"Service flow MUST drop packets that do not fit in the UGS size");
}