diff options
author | Laurent Deniel <laurent.deniel@free.fr> | 1999-10-17 14:46:40 +0000 |
---|---|---|
committer | Laurent Deniel <laurent.deniel@free.fr> | 1999-10-17 14:46:40 +0000 |
commit | c68b5aa64e1f253733e6620ff075591865383a70 (patch) | |
tree | 6915cc168dfdca672946d7f0751e14d5b14809cd /packet-nntp.c | |
parent | 6b297846bbde55c1aff30395a78236166673e6e3 (diff) |
Add display filters.
svn path=/trunk/; revision=876
Diffstat (limited to 'packet-nntp.c')
-rw-r--r-- | packet-nntp.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/packet-nntp.c b/packet-nntp.c index 06af7db8d1..aa20363bc7 100644 --- a/packet-nntp.c +++ b/packet-nntp.c @@ -2,7 +2,7 @@ * Routines for nntp packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-nntp.c,v 1.4 1999/08/18 00:57:52 guy Exp $ + * $Id: packet-nntp.c,v 1.5 1999/10/17 14:46:40 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -42,6 +42,8 @@ #include "packet.h" static int proto_nntp = -1; +static int hf_nntp_response = -1; +static int hf_nntp_request = -1; void dissect_nntp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) @@ -81,6 +83,12 @@ dissect_nntp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) ti = proto_tree_add_item(tree, proto_nntp, offset, END_OF_FRAME, NULL); nntp_tree = proto_item_add_subtree(ti, ETT_NNTP); + if (pi.match_port == pi.destport) { + proto_tree_add_item_hidden(nntp_tree, hf_nntp_request, 0, 0, TRUE); + } else { + proto_tree_add_item_hidden(nntp_tree, hf_nntp_response, 0, 0, TRUE); + } + /* * Show the request or response as text, a line at a time. * XXX - for requests, we could display the stuff after the @@ -110,11 +118,21 @@ dissect_nntp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) void proto_register_nntp(void) { -/* static hf_register_info hf[] = { - { &variable, - { "Name", "nntp.abbreviation", TYPE, VALS_POINTER }}, - };*/ + + static hf_register_info hf[] = { + { &hf_nntp_response, + { "Response", "nntp.response", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "TRUE if NNTP response" }}, + + { &hf_nntp_request, + { "Request", "nntp.request", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "TRUE if NNTP request" }} + }; + + proto_nntp = proto_register_protocol("Network News Transfer Protocol", + "nntp"); + proto_register_field_array(proto_nntp, hf, array_length(hf)); - proto_nntp = proto_register_protocol("Network News Transfer Protocol", "nntp"); - /* proto_register_field_array(proto_nntp, hf, array_length(hf));*/ } |