aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/to_str.c19
-rw-r--r--epan/to_str.h3
-rw-r--r--packet-vines.c20
-rw-r--r--packet-vines.h9
4 files changed, 24 insertions, 27 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);
diff --git a/packet-vines.c b/packet-vines.c
index 31dc1fa5f5..d63222aef8 100644
--- a/packet-vines.c
+++ b/packet-vines.c
@@ -1,7 +1,7 @@
/* packet-vines.c
* Routines for Banyan VINES protocol packet disassembly
*
- * $Id: packet-vines.c,v 1.25 2001/03/13 21:34:24 gram Exp $
+ * $Id: packet-vines.c,v 1.26 2001/04/01 06:32:09 hagbard Exp $
*
* Don Lafontaine <lafont02@cn.ca>
*
@@ -173,24 +173,6 @@ proto_reg_handoff_vines_frp(void)
proto_vines_frp);
}
-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;
-}
-
static void
dissect_vines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
diff --git a/packet-vines.h b/packet-vines.h
index c4236b2747..95aef36696 100644
--- a/packet-vines.h
+++ b/packet-vines.h
@@ -1,7 +1,7 @@
/* packet-vines.h
* Definitions for packet disassembly structures and routines
*
- * $Id: packet-vines.h,v 1.7 2001/01/06 08:44:03 guy Exp $
+ * $Id: packet-vines.h,v 1.8 2001/04/01 06:32:09 hagbard Exp $
*
* Don Lafontaine <lafont02@cn.ca>
*
@@ -38,6 +38,8 @@
#ifndef __PACKETVINES_H__
#define __PACKETVINES_H__
+#include "to_str.h"
+
#define VINES_ADDR_LEN 6
/* VINES IP structs and definitions */
@@ -109,9 +111,4 @@ typedef struct _e_vsmb {
void capture_vines(const u_char *, int, packet_counts *);
-/*
- * Routine to take a Vines address and generate a string.
- */
-extern gchar *vines_addr_to_str(const guint8 *addrp);
-
#endif /* packet-vines.h */