/* to_str.c
* Routines for utilities to convert various other types to strings.
*
- * $Id: to_str.c,v 1.25 2003/02/12 00:44:04 guy Exp $
+ * $Id: to_str.c,v 1.26 2003/06/23 09:15:08 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
return cur;
}
+
gchar *
fc_to_str(const guint8 *ad)
{
return bytestring_to_str (ad, 3, '.');
}
+/* convert the fc id stored in the three high order bytes of a guint32 into a
+ fc id string*/
+gchar *
+fc32_to_str(const guint32 ad32)
+{
+ const guint8 *ad=(guint8 *)&ad32;
+ return bytestring_to_str (ad, 3, '.');
+}
+
/* FC Network Header Network Address Authority Identifiers */
#define FC_NH_NAA_IEEE 1 /* IEEE 802.1a */
/* to_str.h
* Definitions for utilities to convert various other types to strings.
*
- * $Id: to_str.h,v 1.14 2003/02/12 00:44:04 guy Exp $
+ * $Id: to_str.h,v 1.15 2003/06/23 09:15:08 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
extern gchar* ip_to_str(const guint8 *);
extern void ip_to_str_buf(const guint8 *, gchar *);
extern gchar* fc_to_str(const guint8 *);
+extern gchar* fc32_to_str(guint32);
extern gchar* fcwwn_to_str (const guint8 *);
extern char* ip6_to_str(const struct e_in6_addr *);
extern gchar* ipx_addr_to_str(guint32, const guint8 *);
* Routines for Fibre Channel Decoding (FC Header, Link Ctl & Basic Link Svc)
* Copyright 2001, Dinesh G Dutt <ddutt@cisco.com>
*
- * $Id: packet-fc.c,v 1.6 2003/06/23 08:45:08 sahlberg Exp $
+ * $Id: packet-fc.c,v 1.7 2003/06/23 09:15:08 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
guint16 seqcnt;
guint8 ftype;
gboolean is_ack;
-
+
+ guint32 s_id;
+ guint32 d_id;
+
/* Make entries in Protocol column and Info column on summary display */
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FC");
proto_tree_add_uint_hidden (fc_tree, hf_fc_ftype, tvb, offset, 1,
ftype);
+
+ d_id=tvb_get_letoh24(tvb, offset+1);
proto_tree_add_string (fc_tree, hf_fc_did, tvb, offset+1, 3,
- fc_to_str ((guint8 *)tvb_get_ptr (tvb,
- offset+1, 3)));
+ fc32_to_str (d_id));
proto_tree_add_string_hidden (fc_tree, hf_fc_id, tvb, offset+1, 3,
- fc_to_str ((guint8 *)tvb_get_ptr (tvb,
- offset+1, 3)));
+ fc32_to_str (d_id));
proto_tree_add_item (fc_tree, hf_fc_csctl, tvb, offset+4, 1, FALSE);
+ s_id=tvb_get_letoh24(tvb, offset+5);
proto_tree_add_string (fc_tree, hf_fc_sid, tvb, offset+5, 3,
- fc_to_str ((guint8 *)tvb_get_ptr (tvb,
- offset+5, 3)));
+ fc32_to_str (s_id));
proto_tree_add_string_hidden (fc_tree, hf_fc_id, tvb, offset+5, 3,
- fc_to_str ((guint8 *)tvb_get_ptr (tvb,
- offset+5, 3)));
-
+ fc32_to_str (s_id));
if (ftype == FC_FTYPE_LINKCTL) {
if (((r_ctl & 0x0F) == FC_LCTL_FBSYB) ||