aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ip.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>1999-02-09 00:35:38 +0000
committerGuy Harris <guy@alum.mit.edu>1999-02-09 00:35:38 +0000
commit75305346b532da113629c21311817099305762f3 (patch)
tree80d9f3e8a36588385000c9c9e0ffd34ab77c7629 /packet-ip.c
parentfacb50396007c70e5616ff61a4aa22ff43e44001 (diff)
When doing a capture, decode enough of the incoming packets to correctly
update the packet counts and percentages in the dialog box popped up during a capture, even for non-Ethernet captures. svn path=/trunk/; revision=184
Diffstat (limited to 'packet-ip.c')
-rw-r--r--packet-ip.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/packet-ip.c b/packet-ip.c
index 53c9d1c8ac..34a0aed0bd 100644
--- a/packet-ip.c
+++ b/packet-ip.c
@@ -1,7 +1,7 @@
/* packet-ip.c
* Routines for IP and miscellaneous IP protocol packet disassembly
*
- * $Id: packet-ip.c,v 1.14 1999/02/08 20:02:34 gram Exp $
+ * $Id: packet-ip.c,v 1.15 1999/02/09 00:35:37 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -47,6 +47,23 @@
extern packet_info pi;
+void
+capture_ip(const u_char *pd, int offset, guint32 cap_len, packet_counts *ld) {
+ switch (pd[offset + 9]) {
+ case IP_PROTO_TCP:
+ ld->tcp++;
+ break;
+ case IP_PROTO_UDP:
+ ld->udp++;
+ break;
+ case IP_PROTO_OSPF:
+ ld->ospf++;
+ break;
+ default:
+ ld->other++;
+ }
+}
+
static void
dissect_ipopt_security(GtkWidget *opt_tree, const char *name,
const u_char *opd, int offset, guint optlen)