aboutsummaryrefslogtreecommitdiffstats
path: root/packet-llc.c
diff options
context:
space:
mode:
authorNathan Neulinger <nneul@umr.edu>1999-12-13 21:48:18 +0000
committerNathan Neulinger <nneul@umr.edu>1999-12-13 21:48:18 +0000
commit1b4f9ef2244f3789a52f2546103753831b9b58f5 (patch)
tree15f9e74f476769ff65431a64ce341f094a5ac06c /packet-llc.c
parentac1b0b43e2dd54ec0de488dbe25466d377e976f5 (diff)
Break out IG and CR bits of SSAP and DSAP
Handle figuring out correct dsap/ssap if the last bit is 0/1 svn path=/trunk/; revision=1315
Diffstat (limited to 'packet-llc.c')
-rw-r--r--packet-llc.c69
1 files changed, 45 insertions, 24 deletions
diff --git a/packet-llc.c b/packet-llc.c
index 4e6142f5ec..62d9825c7d 100644
--- a/packet-llc.c
+++ b/packet-llc.c
@@ -2,7 +2,7 @@
* Routines for IEEE 802.2 LLC layer
* Gilbert Ramirez <gramirez@tivoli.com>
*
- * $Id: packet-llc.c,v 1.32 1999/12/05 22:52:00 guy Exp $
+ * $Id: packet-llc.c,v 1.33 1999/12/13 21:48:18 nneul Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -39,6 +39,8 @@
static int proto_llc = -1;
static int hf_llc_dsap = -1;
static int hf_llc_ssap = -1;
+static int hf_llc_dsap_ig = -1;
+static int hf_llc_ssap_cr = -1;
static int hf_llc_ctrl = -1;
static int hf_llc_type = -1;
static int hf_llc_oui = -1;
@@ -59,12 +61,11 @@ struct sap_info {
dissect_func_t *dissect_func;
};
+/* These are for SSAP and DSAP, wth last bit always zero */
static const value_string sap_vals[] = {
{ 0x00, "NULL LSAP" },
- { 0x02, "LLC Sub-Layer Management Individual" },
- { 0x03, "LLC Sub-Layer Management Group" },
- { 0x04, "SNA Path Control Individual" },
- { 0x05, "SNA Path Control Group" },
+ { 0x02, "LLC Sub-Layer Management" },
+ { 0x04, "SNA Path Control" },
{ 0x06, "TCP/IP" },
{ 0x08, "SNA" },
{ 0x0C, "SNA" },
@@ -76,8 +77,7 @@ static const value_string sap_vals[] = {
{ 0xBC, "Banyan Vines" },
{ 0xE0, "NetWare" },
{ 0xF0, "NetBIOS" },
- { 0xF4, "IBM Net Management Individual" },
- { 0xF5, "IBM Net Management Group" },
+ { 0xF4, "IBM Net Management" },
{ 0xF8, "Remote Program Load" },
{ 0xFC, "Remote Program Load" },
{ 0xFE, "ISO Network Layer" },
@@ -282,8 +282,14 @@ dissect_llc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
if (tree) {
ti = proto_tree_add_item(tree, proto_llc, offset, 0, NULL);
llc_tree = proto_item_add_subtree(ti, ett_llc);
- proto_tree_add_item(llc_tree, hf_llc_dsap, offset, 1, pd[offset]);
- proto_tree_add_item(llc_tree, hf_llc_ssap, offset+1, 1, pd[offset+1]);
+ proto_tree_add_item(llc_tree, hf_llc_dsap, offset,
+ 1, pd[offset] & 0xFE);
+ proto_tree_add_item(llc_tree, hf_llc_dsap_ig, offset,
+ 1, pd[offset] & 0x01);
+ proto_tree_add_item(llc_tree, hf_llc_ssap, offset+1,
+ 1, pd[offset+1] & 0xFE);
+ proto_tree_add_item(llc_tree, hf_llc_ssap_cr, offset+1,
+ 1, pd[offset+1] & 0x01);
} else
llc_tree = NULL;
@@ -361,9 +367,13 @@ dissect_llc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
}
else {
if (check_col(fd, COL_INFO)) {
- col_add_fstr(fd, COL_INFO, "DSAP %s, SSAP %s",
- val_to_str(pd[offset], sap_vals, "%02x"),
- val_to_str(pd[offset+1], sap_vals, "%02x"));
+ col_add_fstr(fd, COL_INFO,
+ "DSAP %s %s, SSAP %s %s",
+ val_to_str(pd[offset] & 0xFE, sap_vals, "%02x"),
+ pd[offset] & 0x01 ? "Group" : "Individual",
+ val_to_str(pd[offset+1] & 0xFE, sap_vals, "%02x"),
+ pd[offset+1] & 0x01 ? "Command" : "Response"
+ );
}
if (XDLC_HAS_PAYLOAD(control)) {
@@ -388,31 +398,42 @@ dissect_llc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
void
proto_register_llc(void)
{
+ static struct true_false_string ig_bit = { "Group", "Individual" };
+ static struct true_false_string cr_bit = { "Response", "Command" };
+
static hf_register_info hf[] = {
{ &hf_llc_dsap,
- { "DSAP", "llc.dsap", FT_UINT8, BASE_HEX, VALS(sap_vals), 0x0,
- "" }},
+ { "DSAP", "llc.dsap", FT_UINT8, BASE_HEX,
+ VALS(sap_vals), 0x0, "" }},
+
+ { &hf_llc_dsap_ig,
+ { "IG Bit", "llc.dsap.ig", FT_BOOLEAN, BASE_HEX,
+ &ig_bit, 0x0, "Individual/Group" }},
{ &hf_llc_ssap,
- { "SSAP", "llc.ssap", FT_UINT8, BASE_HEX, VALS(sap_vals), 0x0,
- "" }},
+ { "SSAP", "llc.ssap", FT_UINT8, BASE_HEX,
+ VALS(sap_vals), 0x0, "" }},
+
+ { &hf_llc_ssap_cr,
+ { "CR Bit", "llc.ssap.cr", FT_BOOLEAN, BASE_HEX,
+ &cr_bit, 0x0, "Command/Response" }},
{ &hf_llc_ctrl,
- { "Control", "llc.control", FT_UINT8, BASE_HEX, VALS(llc_ctrl_vals), 0x0,
- "" }},
+ { "Control", "llc.control", FT_UINT8, BASE_HEX,
+ VALS(llc_ctrl_vals), 0x0, "" }},
/* registered here but handled in ethertype.c */
{ &hf_llc_type,
- { "Type", "llc.type", FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
- "" }},
+ { "Type", "llc.type", FT_UINT16, BASE_HEX,
+ VALS(etype_vals), 0x0, "" }},
{ &hf_llc_oui,
- { "Organization Code", "llc.oui", FT_UINT24, BASE_HEX, VALS(llc_oui_vals), 0x0,
- ""}},
+ { "Organization Code", "llc.oui", FT_UINT24, BASE_HEX,
+ VALS(llc_oui_vals), 0x0, ""}},
{ &hf_llc_pid,
- { "Protocol ID", "llc.pid", FT_UINT16, BASE_HEX, NULL, 0x0,
- ""}}
+ { "Protocol ID", "llc.pid", FT_UINT16, BASE_HEX,
+ NULL, 0x0, ""}}
};
static gint *ett[] = {
&ett_llc,