Tvbuffify the BOOTP/DHCP dissector.
[obnox/wireshark/wip.git] / packet-ncp-int.h
1 /* packet-ncp-int.h
2  * Structures and functions for NetWare Core Protocol.
3  * Gilbert Ramirez <gram@xiexie.org>
4  *
5  * $Id: packet-ncp-int.h,v 1.2 2000/08/11 13:34:06 deniel Exp $
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@zing.org>
9  * Copyright 2000 Gerald Combs
10  *
11  * 
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  * 
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  * 
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25  */
26
27 #ifndef __PACKET_NCP_INT_H__
28 #define __PACKET_NCP_INT_H__
29
30 typedef struct {
31         int             *hf_ptr;
32         gint            length;
33         gboolean        endianness;
34 } ptvc_record;
35
36 typedef struct {
37         guint8          error_in_packet;
38         gint            ncp_error_index;
39 } error_equivalency;
40
41 typedef struct {
42         guint8                  func;
43         guint8                  subfunc;
44         guint8                  submask;
45         gchar*                  name;
46         gint                    group;
47         const ptvc_record       *request_ptvc;
48         void                    *requst_func;
49         const ptvc_record       *reply_ptvc;
50         void                    *reply_func;
51         const error_equivalency *errors;
52 } ncp_record;
53
54
55 void dissect_ncp_request(tvbuff_t*, packet_info*, guint16,
56                 guint8, guint16, proto_tree*, proto_tree*);
57
58 void dissect_ncp_reply(tvbuff_t *, packet_info*, guint16,
59                 guint8, proto_tree*, proto_tree*);
60
61 void ncp_hash_insert(conversation_t *conversation, guint8 nw_sequence,
62                 guint16 ncp_type, const ncp_record *ncp_rec);
63
64 /* Returns TRUE or FALSE. If TRUE, the record was found and
65  * ncp_type and ncp_rec are set. */
66 gboolean ncp_hash_lookup(conversation_t*, guint8 nw_sequence,
67                 guint16 *ncp_type, const ncp_record **ncp_rec);
68
69
70 extern int proto_ncp;
71
72 #endif