From ef3dfe2077c3fd49997b7d9f3c31ba9f65ff27e2 Mon Sep 17 00:00:00 2001 From: Gilbert Ramirez Date: Tue, 23 Mar 1999 03:14:46 +0000 Subject: Removed all references to gtk objects from packet*.[ch] files. They now reference the protocol tree with struct proto_tree and struct proto_item objects. That way, the packet decoding source code file can be used with non-gtk packet decoders, like a curses-based ethereal, e.g. I also re-arranged some of the information in packet.h to more appropriate places (like other packet-*.[ch] files). svn path=/trunk/; revision=223 --- packet-http.c | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'packet-http.c') diff --git a/packet-http.c b/packet-http.c index 86a5ae9cc7..df15ced11d 100644 --- a/packet-http.c +++ b/packet-http.c @@ -3,7 +3,7 @@ * * Guy Harris * - * $Id: packet-http.c,v 1.1 1999/02/12 09:03:40 guy Exp $ + * $Id: packet-http.c,v 1.2 1999/03/23 03:14:37 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -29,28 +29,22 @@ #include "config.h" -#include - -#include -#include -#include - #ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +#include +#include -#include "ethereal.h" +#include #include "packet.h" static int is_http_request_or_reply(const u_char *data, int linelen); -void dissect_http(const u_char *pd, int offset, frame_data *fd, GtkTree *tree) +void dissect_http(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { - GtkWidget *http_tree, *ti; + proto_tree *http_tree; + proto_item *ti; const u_char *data, *dataend; const u_char *linep, *lineend; int linelen; @@ -76,11 +70,10 @@ void dissect_http(const u_char *pd, int offset, frame_data *fd, GtkTree *tree) } if (tree) { - ti = add_item_to_tree(GTK_WIDGET(tree), offset, - END_OF_FRAME, + ti = proto_tree_add_item(tree, offset, END_OF_FRAME, "Hypertext Transfer Protocol"); - http_tree = gtk_tree_new(); - add_subtree(ti, http_tree, ETT_HTTP); + http_tree = proto_tree_new(); + proto_item_add_subtree(ti, http_tree, ETT_HTTP); while (data < dataend) { /* @@ -167,14 +160,14 @@ void dissect_http(const u_char *pd, int offset, frame_data *fd, GtkTree *tree) /* * Put this line. */ - add_item_to_tree(http_tree, offset, linelen, "%s", + proto_tree_add_item(http_tree, offset, linelen, "%s", format_line(data, linelen)); offset += linelen; data = lineend; } if (data < dataend) { - add_item_to_tree(http_tree, offset, END_OF_FRAME, + proto_tree_add_item(http_tree, offset, END_OF_FRAME, "Data (%d bytes)", END_OF_FRAME); } } -- cgit v1.2.3