Add the 0.9.5 release information.
[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@alumni.rice.edu>
4  *
5  * $Id: packet-ncp-int.h,v 1.9 2002/05/17 23:17:22 gram Exp $
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@ethereal.com>
9  * Copyright 2000 Gerald Combs
10  * 
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  * 
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  * 
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 #ifndef __PACKET_NCP_INT_H__
27 #define __PACKET_NCP_INT_H__
28
29 typedef struct _ptvc_record ptvc_record;
30 typedef struct _sub_ptvc_record sub_ptvc_record;
31
32 struct _ptvc_record {
33         int                     *hf_ptr;
34         gint                    length;
35         const sub_ptvc_record   *sub_ptvc_rec;
36         unsigned int    endianness      : 1; /* 0=BE, 1=LE */
37         unsigned int    var_index       : 2;
38         unsigned int    repeat_index    : 2;
39         unsigned int    req_cond_index  : 8;
40         unsigned int    special_fmt     : 2;
41 };
42
43 #define NCP_FMT_NONE                    0
44 #define NCP_FMT_NW_DATE                 1
45 #define NCP_FMT_NW_TIME                 2
46
47 struct _sub_ptvc_record {
48         gint                    *ett;
49         const char              *descr;
50         const ptvc_record       *ptvc_rec;
51 };
52
53 typedef struct {
54         const char              *dfilter_text;
55         dfilter_t               *dfilter;
56 } conditional_record;
57
58 typedef struct {
59         int                     *hf_ptr;
60         const char              *first_string;
61         const char              *repeat_string;
62 } info_string_t;
63
64 typedef struct {
65         guint8          error_in_packet;
66         gint            ncp_error_index;
67 } error_equivalency;
68
69 typedef struct {
70         guint8                  func;
71         guint8                  subfunc;
72         guint8                  has_subfunc;
73         gchar*                  name;
74         gint                    group;
75         const ptvc_record       *request_ptvc;
76         const ptvc_record       *reply_ptvc;
77         const error_equivalency *errors;
78         const int               *req_cond_indexes;
79         unsigned int            req_cond_size_type;
80         const info_string_t     *req_info_str;
81 } ncp_record;
82
83
84 void dissect_ncp_request(tvbuff_t*, packet_info*, guint16,
85                 guint8, guint16, proto_tree*);
86
87 void dissect_ncp_reply(tvbuff_t *, packet_info*, guint16, guint8,
88                 guint16, proto_tree*);
89
90 extern int proto_ncp;
91 extern gint ett_ncp;
92
93 /*
94  * NCP packet types.
95  */
96 #define NCP_ALLOCATE_SLOT       0x1111
97 #define NCP_SERVICE_REQUEST     0x2222
98 #define NCP_SERVICE_REPLY       0x3333
99 #define NCP_WATCHDOG            0x3e3e
100 #define NCP_DEALLOCATE_SLOT     0x5555
101 #define NCP_BURST_MODE_XFER     0x7777
102 #define NCP_POSITIVE_ACK        0x9999
103
104 #endif