aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1999-07-17 04:19:15 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1999-07-17 04:19:15 +0000
commit9612b74c16738b2b79fe6376122909741f836ffa (patch)
tree92c8229461c702ab93c30d50a7481658d805109b
parent0d36ec8de2e587337c8d8bc787e40de23cda644a (diff)
Added just enough fields to TCP to support "Follow TCP Stream". It works now.
Added the protocol IDs for ipx and IGMP, but not their fields. svn path=/trunk/; revision=365
-rw-r--r--Makefile.am3
-rw-r--r--Makefile.in4
-rw-r--r--doc/Makefile4
-rw-r--r--follow.c6
-rw-r--r--menu.c4
-rw-r--r--packet-ip.c45
-rw-r--r--packet-ipx.c30
-rw-r--r--packet-tcp.c53
-rw-r--r--proto.c8
9 files changed, 119 insertions, 38 deletions
diff --git a/Makefile.am b/Makefile.am
index 98ed3fe002..0174688663 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -155,6 +155,3 @@ ethereal.1: doc/ethereal.pod VERSION
(cd doc ; \
make ../ethereal.1 )
-doc/ethereal.pod: doc/ethereal.pod.template ethereal
- (cd doc ; \
- make ethereal.pod )
diff --git a/Makefile.in b/Makefile.in
index 2f520c7b7b..ac7ed79df1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -615,10 +615,6 @@ ethereal.1: doc/ethereal.pod VERSION
(cd doc ; \
make ../ethereal.1 )
-doc/ethereal.pod: doc/ethereal.pod.template ethereal
- (cd doc ; \
- make ethereal.pod )
-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/doc/Makefile b/doc/Makefile
index c9903a0ef6..bebb155d0b 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -4,6 +4,6 @@
--release=`cat ../VERSION` \
> ../ethereal.1
-ethereal.pod: ethereal.pod.template
- cat ../out | ./dfilter2pod ethereal.pod.template > ethereal.pod
+ethereal.pod: ethereal.pod.template ../ethereal
+ ../ethereal -G | ./dfilter2pod ethereal.pod.template > ethereal.pod
diff --git a/follow.c b/follow.c
index ba64ab6dd5..8cb7f5b05b 100644
--- a/follow.c
+++ b/follow.c
@@ -1,6 +1,6 @@
/* follow.c
*
- * $Id: follow.c,v 1.11 1999/07/13 02:52:51 gram Exp $
+ * $Id: follow.c,v 1.12 1999/07/17 04:19:02 gram Exp $
*
* Copyright 1998 Mike Hall <mlh@io.com>
*
@@ -62,8 +62,8 @@ build_follow_filter( packet_info *pi ) {
char* buf = malloc(1024);
if( pi->ipproto == 6 ) {
/* TCP */
- sprintf( buf, "host %s and host %s and (ip proto \\tcp) and (port %d and port %d)",
- pi->srcip, pi->destip, pi->srcport, pi->destport );
+ sprintf( buf, "(ip.addr eq %s and ip.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
+ pi->srcip, pi->destip, pi->srcport, pi->destport );
}
else {
free( buf );
diff --git a/menu.c b/menu.c
index 62f15fddad..b4b94b2fd9 100644
--- a/menu.c
+++ b/menu.c
@@ -1,7 +1,7 @@
/* menu.c
* Menu routines
*
- * $Id: menu.c,v 1.25 1999/07/13 03:08:06 gram Exp $
+ * $Id: menu.c,v 1.26 1999/07/17 04:19:02 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -149,7 +149,7 @@ menus_init(void) {
set_menu_sensitivity("/Tools/Graph", FALSE);
set_menu_sensitivity("/Tools/Summary", FALSE);
- set_menu_sensitivity("/Tools/Follow TCP Stream", FALSE);
+ /*set_menu_sensitivity("/Tools/Follow TCP Stream", FALSE);*/
set_menu_sensitivity("/Display/Match Selected", FALSE);
}
}
diff --git a/packet-ip.c b/packet-ip.c
index 2428294a0b..1ed42f6697 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.29 1999/07/15 15:32:41 gram Exp $
+ * $Id: packet-ip.c,v 1.30 1999/07/17 04:19:03 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -57,6 +57,14 @@ int hf_ip_len = -1;
int hf_ip_id = -1;
int hf_ip_dst = -1;
int hf_ip_src = -1;
+int hf_ip_addr = -1;
+
+int proto_igmp = -1;
+int hf_igmp_version = -1;
+int hf_igmp_type = -1;
+int hf_igmp_unused = -1;
+int hf_igmp_checksum = -1;
+int hf_igmp_group = -1;
/* ICMP structs and definitions */
typedef struct _e_icmp {
@@ -707,6 +715,8 @@ dissect_ip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
proto_tree_add_item(ip_tree, hf_ip_src, offset + 12, 4, iph.ip_src);
proto_tree_add_item(ip_tree, hf_ip_dst, offset + 16, 4, iph.ip_dst);
+ proto_tree_add_item_hidden(ip_tree, hf_ip_addr, offset + 12, 4, iph.ip_src);
+ proto_tree_add_item_hidden(ip_tree, hf_ip_addr, offset + 16, 4, iph.ip_dst);
/* Decode IP options, if any. */
if (hlen > sizeof (e_ip)) {
@@ -1050,8 +1060,7 @@ dissect_igmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
if (check_col(fd, COL_INFO))
col_add_str(fd, COL_INFO, type_str);
if (tree) {
- ti = proto_tree_add_text(tree, offset, 4,
- "Internet Group Management Protocol");
+ ti = proto_tree_add_text(tree, proto_igmp, offset, 4, NULL);
igmp_tree = proto_item_add_subtree(ti, ETT_IGMP);
proto_tree_add_text(igmp_tree, offset, 1, "Version: %d",
hi_nibble(ih.igmp_v_t));
@@ -1067,6 +1076,31 @@ dissect_igmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
}
void
+proto_register_igmp(void)
+{
+ static hf_register_info hf[] = {
+
+ { &hf_igmp_version,
+ { "Version", "igmp.version", FT_UINT8, NULL }},
+
+ { &hf_igmp_type,
+ { "Type", "igmp.type", FT_UINT8, NULL }},
+
+ { &hf_igmp_unused,
+ { "Unused", "igmp.unused", FT_UINT8, NULL }},
+
+ { &hf_igmp_checksum,
+ { "Checksum", "igmp.checksum", FT_UINT16, NULL }},
+
+ { &hf_igmp_group,
+ { "Group address", "igmp.group", FT_IPv4, NULL }}
+ };
+
+ proto_igmp = proto_register_protocol ("Internet Group Management Protocol", "igmp");
+ proto_register_field_array(proto_igmp, hf, array_length(hf));
+}
+
+void
proto_register_ip(void)
{
static hf_register_info hf[] = {
@@ -1093,7 +1127,10 @@ proto_register_ip(void)
{ "Destination", "ip.dst", FT_IPv4, NULL }},
{ &hf_ip_src,
- { "Source", "ip.src", FT_IPv4, NULL }}
+ { "Source", "ip.src", FT_IPv4, NULL }},
+
+ { &hf_ip_addr,
+ { "Source or Destination Address", "ip.addr", FT_IPv4, NULL }}
};
proto_ip = proto_register_protocol ("Internet Protocol", "ip");
diff --git a/packet-ipx.c b/packet-ipx.c
index 3d5d3d5411..cebecddfcf 100644
--- a/packet-ipx.c
+++ b/packet-ipx.c
@@ -2,7 +2,7 @@
* Routines for NetWare's IPX
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
*
- * $Id: packet-ipx.c,v 1.21 1999/07/07 22:51:45 gram Exp $
+ * $Id: packet-ipx.c,v 1.22 1999/07/17 04:19:04 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -48,6 +48,11 @@
And from the ncpfs source code by Volker Lendecke
*/
+
+int proto_ipx = -1;
+int proto_spx = -1;
+int proto_ipxrip = -1;
+int proto_sap = -1;
static void
dissect_spx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int max_data);
@@ -223,8 +228,7 @@ dissect_ipx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
ipx_checksum = pntohs(&pd[offset]);
ipx_hops = pd[offset+4];
- ti = proto_tree_add_text(tree, offset, 30,
- "Internetwork Packet Exchange");
+ ti = proto_tree_add_item(tree, proto_ipx, offset, 30, NULL);
ipx_tree = proto_item_add_subtree(ti, ETT_IPX);
proto_tree_add_text(ipx_tree, offset, 2, "Checksum: 0x%04x",
ipx_checksum);
@@ -346,7 +350,7 @@ dissect_spx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int
col_add_str(fd, COL_INFO, "SPX");
if (tree) {
- ti = proto_tree_add_text(tree, offset, 12, "Sequenced Packet Exchange");
+ ti = proto_tree_add_item(tree, proto_spx, offset, 12, NULL);
spx_tree = proto_item_add_subtree(ti, ETT_SPX);
proto_tree_add_text(spx_tree, offset, 1,
@@ -406,8 +410,7 @@ dissect_ipxrip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, END_OF_FRAME,
- "IPX Routing Information Protocol");
+ ti = proto_tree_add_item(tree, proto_ipxrip, offset, END_OF_FRAME, NULL);
rip_tree = proto_item_add_subtree(ti, ETT_IPXRIP);
if (operation < 2) {
@@ -527,8 +530,7 @@ dissect_sap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, END_OF_FRAME,
- "Service Advertising Protocol");
+ ti = proto_tree_add_text(tree, proto_sap, offset, END_OF_FRAME, NULL);
sap_tree = proto_item_add_subtree(ti, ETT_IPXSAP);
if (query.query_type < 4) {
@@ -574,3 +576,15 @@ dissect_sap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
}
}
+
+void
+proto_register_ipx(void)
+{
+ proto_ipx = proto_register_protocol ("Internetwork Packet eXchange", "ipx");
+
+ proto_spx = proto_register_protocol ("Sequenced Packet eXchange", "spx");
+
+ proto_ipxrip = proto_register_protocol ("IPX Routing Information Protocol", "ipxrip");
+
+ proto_sap = proto_register_protocol ("Service Advertisement Protocol", "sap");
+}
diff --git a/packet-tcp.c b/packet-tcp.c
index 371d9feed3..2df3288128 100644
--- a/packet-tcp.c
+++ b/packet-tcp.c
@@ -1,7 +1,7 @@
/* packet-tcp.c
* Routines for TCP packet disassembly
*
- * $Id: packet-tcp.c,v 1.26 1999/07/07 22:51:55 gram Exp $
+ * $Id: packet-tcp.c,v 1.27 1999/07/17 04:19:04 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -61,6 +61,13 @@ extern packet_info pi;
static gchar info_str[COL_MAX_LEN];
static int info_len;
+int proto_tcp = -1;
+int hf_tcp_srcport = -1;
+int hf_tcp_dstport = -1;
+int hf_tcp_port = -1;
+int hf_tcp_seq = -1;
+int hf_tcp_ack = -1;
+
/* TCP Ports */
#define TCP_PORT_FTPDATA 20
@@ -388,18 +395,17 @@ dissect_tcp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, hlen,
- "Transmission Control Protocol");
+ ti = proto_tree_add_item(tree, proto_tcp, offset, hlen, NULL);
tcp_tree = proto_item_add_subtree(ti, ETT_TCP);
- proto_tree_add_text(tcp_tree, offset, 2, "Source port: %s (%u)",
- get_tcp_port(th.th_sport), th.th_sport);
- proto_tree_add_text(tcp_tree, offset + 2, 2, "Destination port: %s (%u)",
- get_tcp_port(th.th_dport), th.th_dport);
- proto_tree_add_text(tcp_tree, offset + 4, 4, "Sequence number: %u",
- th.th_seq);
+ proto_tree_add_item_format(tcp_tree, hf_tcp_srcport, offset, 2, th.th_sport,
+ "Source port: %s (%u)", get_tcp_port(th.th_sport), th.th_sport);
+ proto_tree_add_item_format(tcp_tree, hf_tcp_dstport, offset + 2, 2, th.th_dport,
+ "Destination port: %s (%u)", get_tcp_port(th.th_dport), th.th_dport);
+ proto_tree_add_item_hidden(tcp_tree, hf_tcp_port, offset, 2, th.th_sport);
+ proto_tree_add_item_hidden(tcp_tree, hf_tcp_port, offset + 2, 2, th.th_dport);
+ proto_tree_add_item(tcp_tree, hf_tcp_seq, offset + 4, 4, th.th_seq);
if (th.th_flags & TH_ACK)
- proto_tree_add_text(tcp_tree, offset + 8, 4, "Acknowledgement number: %u",
- th.th_ack);
+ proto_tree_add_item(tcp_tree, hf_tcp_ack, offset + 8, 4, th.th_ack);
proto_tree_add_text(tcp_tree, offset + 12, 1, "Header length: %u bytes", hlen);
tf = proto_tree_add_text(tcp_tree, offset + 13, 1, "Flags: 0x%x", th.th_flags);
field_tree = proto_item_add_subtree(tf, ETT_TCP_FLAGS);
@@ -503,3 +509,28 @@ dissect_tcp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
pi.ip_src ); /* src ip */
}
}
+
+void
+proto_register_tcp(void)
+{
+ static hf_register_info hf[] = {
+
+ { &hf_tcp_srcport,
+ { "Source Port", "tcp.srcport", FT_UINT16, NULL }},
+
+ { &hf_tcp_dstport,
+ { "Destination Port", "tcp.dstport", FT_UINT16, NULL }},
+
+ { &hf_tcp_port,
+ { "Source or Destination Port", "tcp.port", FT_UINT16, NULL }},
+
+ { &hf_tcp_seq,
+ { "Sequence Number", "tcp.seq", FT_UINT32, NULL }},
+
+ { &hf_tcp_ack,
+ { "Acknowledgement number", "tcp.ack", FT_UINT32, NULL }},
+ };
+
+ proto_tcp = proto_register_protocol ("Transmission Control Protocol", "tcp");
+ proto_register_field_array(proto_tcp, hf, array_length(hf));
+}
diff --git a/proto.c b/proto.c
index 70bd4da9e8..88372d20b9 100644
--- a/proto.c
+++ b/proto.c
@@ -1,7 +1,7 @@
/* proto.c
* Routines for protocol tree
*
- * $Id: proto.c,v 1.2 1999/07/15 15:32:44 gram Exp $
+ * $Id: proto.c,v 1.3 1999/07/17 04:19:05 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -84,9 +84,12 @@ void proto_register_data(void);
void proto_register_eth(void);
void proto_register_fddi(void);
void proto_register_frame(void);
+void proto_register_igmp(void);
void proto_register_ip(void);
+void proto_register_ipx(void);
void proto_register_llc(void);
void proto_register_null(void);
+void proto_register_tcp(void);
void proto_register_tr(void);
/* special-case header field used within proto.c */
@@ -138,10 +141,13 @@ proto_init(void)
proto_register_eth();
proto_register_fddi();
proto_register_frame();
+ proto_register_igmp();
proto_register_ip();
+ proto_register_ipx();
proto_register_llc();
proto_register_null();
proto_register_tr();
+ proto_register_tcp();
/* Register one special-case FT_TEXT_ONLY field for use when
converting ethereal to new-style proto_tree. These fields