From 292e38e2c61edcd14bfa30ca3c72bacda1bcbe32 Mon Sep 17 00:00:00 2001 From: Gilbert Ramirez Date: Thu, 11 May 2000 08:18:09 +0000 Subject: Add tvbuff class. Add exceptions routines. Convert proto_tree_add_*() routines to require tvbuff_t* argument. Convert all dissectors to pass NULL argument ("NullTVB" macro == NULL) as the tvbuff_t* argument to proto_tree_add_*() routines. dissect_packet() creates a tvbuff_t, wraps the next dissect call in a TRY block, will print "Short Frame" on the proto_tree if a BoundsError exception is caught. The FDDI dissector is converted to use tvbuff's. svn path=/trunk/; revision=1939 --- packet-lpd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'packet-lpd.c') diff --git a/packet-lpd.c b/packet-lpd.c index 63f2009c5d..f354757101 100644 --- a/packet-lpd.c +++ b/packet-lpd.c @@ -2,7 +2,7 @@ * Routines for LPR and LPRng packet disassembly * Gilbert Ramirez * - * $Id: packet-lpd.c,v 1.18 2000/04/20 15:24:41 gram Exp $ + * $Id: packet-lpd.c,v 1.19 2000/05/11 08:15:23 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -104,23 +104,23 @@ dissect_lpd(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } if (tree) { - ti = proto_tree_add_item(tree, proto_lpd, offset, + ti = proto_tree_add_item(tree, proto_lpd, NullTVB, 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); + proto_tree_add_item_hidden(lpd_tree, hf_lpd_response, NullTVB, 0, 0, TRUE); } else { - proto_tree_add_item_hidden(lpd_tree, hf_lpd_request, 0, 0, TRUE); + proto_tree_add_item_hidden(lpd_tree, hf_lpd_request, NullTVB, 0, 0, TRUE); } if (lpr_packet_type == request) { printer = find_printer_string(pd, offset+1, END_OF_FRAME); if (pd[offset] <= 9 && printer) { - proto_tree_add_text(lpd_tree, offset, 1, + proto_tree_add_text(lpd_tree, NullTVB, offset, 1, lpd_client_code[pd[offset]]); - proto_tree_add_text(lpd_tree, offset+1, + proto_tree_add_text(lpd_tree, NullTVB, offset+1, strlen(printer), "Printer/options: %s", printer); } else { @@ -134,7 +134,7 @@ dissect_lpd(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) int response = pd[offset]; if (response <= 3) { - proto_tree_add_text(lpd_tree, offset, 1, "Response: %s", + proto_tree_add_text(lpd_tree, NullTVB, offset, 1, "Response: %s", lpd_server_code[response]); } else { -- cgit v1.2.3