aboutsummaryrefslogtreecommitdiffstats
path: root/epan/to_str.c
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/to_str.c
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/to_str.c')
-rw-r--r--epan/to_str.c19
1 files changed, 18 insertions, 1 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) ? ", " : "")