aboutsummaryrefslogtreecommitdiffstats
path: root/epan/address_to_str.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2011-01-16 04:33:42 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2011-01-16 04:33:42 +0000
commit77b3392e7271abe0a51eedba7ac85494a7615599 (patch)
tree7917b750ae0fe16fd8a26f70af891e7932d27bee /epan/address_to_str.c
parent61876001c35547972282a50854957c7c4deaaccf (diff)
Introduce, and start using, tvb_fc_to_str() and tvb_fcwwm_to_str(): these
functions act like their non-tvb counterparts except that they take a tvb and and offset instead of a pointer to a byte array. This basically saves the dissectors from having to call tvb_get_ptr()--which in this case eliminates a couple of typos in the length given to tvb_get_ptr(). svn path=/trunk/; revision=35549
Diffstat (limited to 'epan/address_to_str.c')
-rw-r--r--epan/address_to_str.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/epan/address_to_str.c b/epan/address_to_str.c
index 7f4691a66a..d3cf15fab3 100644
--- a/epan/address_to_str.c
+++ b/epan/address_to_str.c
@@ -263,6 +263,12 @@ fc_to_str(const guint8 *ad)
return bytestring_to_str (ad, 3, '.');
}
+gchar *
+tvb_fc_to_str(tvbuff_t *tvb, const gint offset)
+{
+ return bytestring_to_str (tvb_get_ptr(tvb, offset, 3), 3, '.');
+}
+
/* FC Network Header Network Address Authority Identifiers */
#define FC_NH_NAA_IEEE 1 /* IEEE 802.1a */
@@ -317,6 +323,12 @@ fcwwn_to_str (const guint8 *ad)
return (ethstr);
}
+gchar *
+tvb_fcwwn_to_str(tvbuff_t *tvb, const gint offset)
+{
+ return fcwwn_to_str (tvb_get_ptr(tvb, offset, 8));
+}
+
/*XXX FIXME the code below may be called very very frequently in the future.
optimize it for speed and get rid of the slow sprintfs */
/* XXX - perhaps we should have individual address types register