aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Deniel <laurent.deniel@free.fr>1999-10-17 11:40:14 +0000
committerLaurent Deniel <laurent.deniel@free.fr>1999-10-17 11:40:14 +0000
commit616e64c212801861420fa9b226733b552141105b (patch)
treed8b4543067050e59b59bb19f73f6729b17d15579
parentd5d120c0a4facf03816d11eac5ae3bf777ddb7a7 (diff)
- add lpd protocol registration
- add display filters svn path=/trunk/; revision=872
-rw-r--r--packet-lpd.c40
-rw-r--r--proto.c4
2 files changed, 38 insertions, 6 deletions
diff --git a/packet-lpd.c b/packet-lpd.c
index c5fb8aa031..dd62ce34cf 100644
--- a/packet-lpd.c
+++ b/packet-lpd.c
@@ -1,8 +1,8 @@
-/* packet-lpr.c
+/* packet-lpd.c
* Routines for LPR and LPRng packet disassembly
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
*
- * $Id: packet-lpd.c,v 1.10 1999/09/17 05:56:55 guy Exp $
+ * $Id: packet-lpd.c,v 1.11 1999/10/17 11:40:13 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -37,6 +37,10 @@
#include <glib.h>
#include "packet.h"
+static int proto_lpd = -1;
+static int hf_lpd_response = -1;
+static int hf_lpd_request = -1;
+
enum lpr_type { request, response };
void
@@ -80,7 +84,6 @@ dissect_lpd(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
lpr_packet_type = response;
}
-
if (check_col(fd, COL_PROTOCOL))
col_add_str(fd, COL_PROTOCOL, "LPD");
if (check_col(fd, COL_INFO)) {
@@ -93,10 +96,18 @@ dissect_lpd(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, END_OF_FRAME,
- "Line Printer Daemon Protocol");
+ ti = proto_tree_add_text(tree, proto_lpd, offset,
+ END_OF_FRAME, NULL);
lpd_tree = proto_item_add_subtree(ti, ETT_LPD);
+ if (lpr_packet_type == response) {
+ proto_tree_add_item_hidden(lpd_tree, hf_lpd_response,
+ 0, 0, TRUE);
+ } else {
+ proto_tree_add_item_hidden(lpd_tree, hf_lpd_request,
+ 0, 0, TRUE);
+ }
+
if (lpr_packet_type == request) {
if (pd[offset] <= 9) {
proto_tree_add_text(lpd_tree, offset, 1,
@@ -146,3 +157,22 @@ dissect_lpd(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
}
}
+void
+proto_register_lpd(void)
+{
+ static hf_register_info hf[] = {
+ { &hf_lpd_response,
+ { "Response", "lpd.response",
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+ "TRUE if LPD response" }},
+
+ { &hf_lpd_request,
+ { "Request", "lpd.request",
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+ "TRUE if LPD request" }}
+ };
+
+ proto_lpd = proto_register_protocol("Line Printer Daemon Protocol", "lpd");
+ proto_register_field_array(proto_lpd, hf, array_length(hf));
+
+}
diff --git a/proto.c b/proto.c
index 4d52a8ddff..c6abec679b 100644
--- a/proto.c
+++ b/proto.c
@@ -1,7 +1,7 @@
/* proto.c
* Routines for protocol tree
*
- * $Id: proto.c,v 1.44 1999/10/16 15:46:01 gram Exp $
+ * $Id: proto.c,v 1.45 1999/10/17 11:40:14 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -133,6 +133,7 @@ void proto_register_ipx(void);
void proto_register_isakmp(void);
void proto_register_lapb(void);
void proto_register_llc(void);
+void proto_register_lpd(void);
void proto_register_mp(void);
void proto_register_nbipx(void);
void proto_register_nbt(void);
@@ -253,6 +254,7 @@ proto_init(void)
proto_register_isakmp();
proto_register_lapb();
proto_register_llc();
+ proto_register_lpd();
proto_register_mp();
proto_register_nbipx();
proto_register_nbt();