aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ipx.c
diff options
context:
space:
mode:
authorEd Warnicke <hagbard@physics.rutgers.edu>2001-04-01 02:47:56 +0000
committerEd Warnicke <hagbard@physics.rutgers.edu>2001-04-01 02:47:56 +0000
commitc17e3b00c6396ec52a6ca39441dabcaa97a4365d (patch)
treeaa445c8e30cfee75054eb46e14d58c1e7789ffd7 /packet-ipx.c
parent3b6554c069c6d607b343415f5e78794e2010d350 (diff)
downloadwireshark-c17e3b00c6396ec52a6ca39441dabcaa97a4365d.tar.gz
wireshark-c17e3b00c6396ec52a6ca39441dabcaa97a4365d.tar.bz2
wireshark-c17e3b00c6396ec52a6ca39441dabcaa97a4365d.zip
Moved various to_str files from packet.{c,h} to a separate
to_str.{c,h}. Resolved strange situation where ipx_addr_to_str was declared in packet.h but defined in packet-ipx.c by moving ipx_addr_to_str, ipxnet_to_str_punct, and ipxnet_to_str from packet-ipx.{c,h} to to_str.{c,h} svn path=/trunk/; revision=3219
Diffstat (limited to 'packet-ipx.c')
-rw-r--r--packet-ipx.c76
1 files changed, 1 insertions, 75 deletions
diff --git a/packet-ipx.c b/packet-ipx.c
index d0b651bbbf..5ce3a01498 100644
--- a/packet-ipx.c
+++ b/packet-ipx.c
@@ -2,7 +2,7 @@
* Routines for NetWare's IPX
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-ipx.c,v 1.80 2001/03/15 09:11:01 guy Exp $
+ * $Id: packet-ipx.c,v 1.81 2001/04/01 02:47:54 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -194,80 +194,6 @@ static const value_string ipxmsg_sigchar_vals[] = {
{ 0, NULL }
};
-gchar*
-ipxnet_to_string(const guint8 *ad)
-{
- guint32 addr = pntohl(ad);
- return ipxnet_to_str_punct(addr, ' ');
-}
-
-/* We use a different representation of hardware addresses
- * than ether_to_str(); we don't put punctuation between the hex
- * digits.
- */
-
-gchar*
-ipx_addr_to_str(guint32 net, const guint8 *ad)
-{
- static gchar str[3][8+1+MAXNAMELEN+1]; /* 8 digits, 1 period, NAME, 1 null */
- static gchar *cur;
- char *name;
-
- if (cur == &str[0][0]) {
- cur = &str[1][0];
- } else if (cur == &str[1][0]) {
- cur = &str[2][0];
- } else {
- cur = &str[0][0];
- }
-
- name = get_ether_name_if_known(ad);
-
- if (name) {
- sprintf(cur, "%s.%s", get_ipxnet_name(net), name);
- }
- else {
- sprintf(cur, "%s.%s", get_ipxnet_name(net), ether_to_str_punct(ad, '\0'));
- }
- return cur;
-}
-
-gchar *
-ipxnet_to_str_punct(const guint32 ad, char punct)
-{
- static gchar str[3][12];
- static gchar *cur;
- gchar *p;
- int i;
- guint32 octet;
- static const gchar hex_digits[16] = "0123456789ABCDEF";
- static const guint32 octet_mask[4] =
- { 0xff000000 , 0x00ff0000, 0x0000ff00, 0x000000ff };
-
- if (cur == &str[0][0]) {
- cur = &str[1][0];
- } else if (cur == &str[1][0]) {
- cur = &str[2][0];
- } else {
- cur = &str[0][0];
- }
- p = &cur[12];
- *--p = '\0';
- i = 3;
- for (;;) {
- octet = (ad & octet_mask[i]) >> ((3 - i) * 8);
- *--p = hex_digits[octet&0xF];
- octet >>= 4;
- *--p = hex_digits[octet&0xF];
- if (i == 0)
- break;
- if (punct)
- *--p = punct;
- i--;
- }
- return p;
-}
-
void
capture_ipx(const u_char *pd, int offset, packet_counts *ld)
{