aboutsummaryrefslogtreecommitdiffstats
path: root/ipv4.c
diff options
context:
space:
mode:
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>1999-11-19 22:32:00 +0000
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>1999-11-19 22:32:00 +0000
commit81c76afaae05d8e9907329b6758e8c359e4a23e4 (patch)
treef312f65e85f484f6d19d770c6fce9b4d6f000330 /ipv4.c
parent4886b4ee336d4a89808483f8c39deda3dce7e485 (diff)
Change match_selected() to produce a display filter using the selected
field's name, if possible. (If the selected field is not a registered field, then of course, we still have to use the frame[x:y] syntax). tree_selected_start and tree_selected_len are on longer globals variables; finfo_selected has replaced them. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1070 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'ipv4.c')
-rw-r--r--ipv4.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/ipv4.c b/ipv4.c
index f647b154ee..8c45934e54 100644
--- a/ipv4.c
+++ b/ipv4.c
@@ -5,7 +5,7 @@
*
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: ipv4.c,v 1.2 1999/11/15 07:25:31 guy Exp $
+ * $Id: ipv4.c,v 1.3 1999/11/19 22:31:50 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -93,6 +93,20 @@ ipv4_get_host_order_addr(ipv4_addr *ipv4)
return ipv4->addr;
}
+#define OCTET_0(x) ( ( x & 0xff000000 ) >> 24 )
+#define OCTET_1(x) ( ( x & 0x00ff0000 ) >> 16 )
+#define OCTET_2(x) ( ( x & 0x0000ff00 ) >> 8 )
+#define OCTET_3(x) ( x & 0x000000ff )
+
+void
+ipv4_addr_sprintf(ipv4_addr *ipv4, char *target_string)
+{
+ sprintf(target_string, "%d.%d.%d.%d",
+ OCTET_0(ipv4->addr),
+ OCTET_1(ipv4->addr),
+ OCTET_2(ipv4->addr),
+ OCTET_3(ipv4->addr) );
+}
static guint32
create_nmask(gint net_bits)