aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorEd Warnicke <hagbard@physics.rutgers.edu>2001-04-01 06:32:10 +0000
committerEd Warnicke <hagbard@physics.rutgers.edu>2001-04-01 06:32:10 +0000
commit1d4e8478376b520cba2007c777999652247a7ae4 (patch)
tree94f192318e93c5cf8a5e9a187572e7f4f8bac59a /epan
parent48421be1d29b8aa633ed711f83312bfdadcace1c (diff)
Moved vines_addr_to_str() from packet-vines.{h,c} to epan/to_str.{c,h}.
svn path=/trunk/; revision=3229
Diffstat (limited to 'epan')
-rw-r--r--epan/to_str.c19
-rw-r--r--epan/to_str.h3
2 files changed, 20 insertions, 2 deletions
diff --git a/epan/to_str.c b/epan/to_str.c
index 111a06265a..a3d087288c 100644
--- a/epan/to_str.c
+++ b/epan/to_str.c
@@ -1,7 +1,7 @@
/* to_str.h
* Routines for utilities to convert various other types to strings.
*
- * $Id: to_str.c,v 1.1 2001/04/01 02:47:55 hagbard Exp $
+ * $Id: to_str.c,v 1.2 2001/04/01 06:32:10 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -229,6 +229,23 @@ ipxnet_to_str_punct(const guint32 ad, char punct)
return p;
}
+gchar *
+vines_addr_to_str(const guint8 *addrp)
+{
+ static gchar str[3][214];
+ static gchar *cur;
+
+ if (cur == &str[0][0]) {
+ cur = &str[1][0];
+ } else if (cur == &str[1][0]) {
+ cur = &str[2][0];
+ } else {
+ cur = &str[0][0];
+ }
+
+ sprintf(cur, "%08x.%04x", pntohl(&addrp[0]), pntohs(&addrp[4]));
+ return cur;
+}
#define PLURALIZE(n) (((n) > 1) ? "s" : "")
#define COMMA(do_it) ((do_it) ? ", " : "")
diff --git a/epan/to_str.h b/epan/to_str.h
index a9fcbb8cf2..077635438a 100644
--- a/epan/to_str.h
+++ b/epan/to_str.h
@@ -1,7 +1,7 @@
/* to_str.h
* Definitions for utilities to convert various other types to strings.
*
- * $Id: to_str.h,v 1.1 2001/04/01 02:47:56 hagbard Exp $
+ * $Id: to_str.h,v 1.2 2001/04/01 06:32:10 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -50,6 +50,7 @@ gchar* ip6_to_str(struct e_in6_addr *);
gchar* ipx_addr_to_str(guint32, const guint8 *);
gchar* ipxnet_to_string(const guint8 *ad);
gchar* ipxnet_to_str_punct(const guint32 ad, char punct);
+gchar* vines_addr_to_str(const guint8 *addrp);
gchar* time_secs_to_str(guint32);
gchar* abs_time_to_str(struct timeval*);
void display_signed_time(gchar *, int, gint32, gint32);