aboutsummaryrefslogtreecommitdiffstats
path: root/packet-irc.c
diff options
context:
space:
mode:
authorNathan Neulinger <nneul@umr.edu>1999-12-07 00:22:11 +0000
committerNathan Neulinger <nneul@umr.edu>1999-12-07 00:22:11 +0000
commitbbce9df3b85e58185ea9d17026ea5222c73d1c70 (patch)
treeff48d6f5b81b6b43a63dc1936a51d81dae60d440 /packet-irc.c
parent163045012ad566cd29595b4afa1283bdb902bc91 (diff)
Fixes to highlighting for irc dissector req/resp lines
Change to dns dissector to display "Domain Name System (request)" instead of "DNS request" in the proto tree, as it is more in keeping with the style of the other proto tree entries. svn path=/trunk/; revision=1233
Diffstat (limited to 'packet-irc.c')
-rw-r--r--packet-irc.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/packet-irc.c b/packet-irc.c
index 3ac3d57839..8f01498872 100644
--- a/packet-irc.c
+++ b/packet-irc.c
@@ -1,7 +1,7 @@
/* packet-irc.c
* Routines for MSX irc packet dissection
*
- * $Id: packet-irc.c,v 1.1 1999/12/06 23:57:51 nneul Exp $
+ * $Id: packet-irc.c,v 1.2 1999/12/07 00:22:11 nneul Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -52,17 +52,17 @@ static gint ett_irc = -1;
void dissect_irc_request(proto_tree *tree, char *line, int offset, int len)
{
proto_tree_add_item_hidden(tree, hf_irc_request,
- offset, END_OF_FRAME, TRUE);
+ offset, len, TRUE);
proto_tree_add_text(tree, offset,
- END_OF_FRAME, "Request Line: %s", line);
+ len, "Request Line: %s", line);
}
void dissect_irc_response(proto_tree *tree, char *line, int offset, int len)
{
proto_tree_add_item_hidden(tree, hf_irc_response,
- offset, END_OF_FRAME, TRUE);
+ offset, len, TRUE);
proto_tree_add_text(tree, offset,
- END_OF_FRAME, "Response Line: %s", line);
+ len, "Response Line: %s", line);
}
void
@@ -71,7 +71,7 @@ dissect_irc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
proto_tree *irc_tree, *ti;
char *tmpline;
int start, cur, len;
- const u_char *i = pd+offset;
+ const u_char *i;
if (check_col(fd, COL_PROTOCOL))
col_add_str(fd, COL_PROTOCOL, "IRC");
@@ -87,19 +87,20 @@ dissect_irc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_irc, offset, END_OF_FRAME, NULL);
irc_tree = proto_item_add_subtree(ti, ett_irc);
- start = 0;
- len = 0;
tmpline = (char *)g_malloc( pi.captured_len );
+ i = pd+offset;
while ( i < pd + pi.captured_len )
{
- start = i-pd;
+ start = i - pd;
cur = 0;
+ len = 0;
tmpline[cur] = 0;
/* copy up to end or cr/nl */
while ( i < pd + pi.captured_len && *i != '\r' && *i != '\n' )
{
tmpline[cur++] = *(i++);
+ len++;
}
tmpline[cur] = 0;
@@ -108,6 +109,7 @@ dissect_irc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
(*i == '\r' || *i == '\n') )
{
i++;
+ len++;
}
if ( strlen(tmpline) > 0 )