Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
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  * Modified for NDS support by Greg Morris (gmorris@novell.com)
5  *
6  * Portions Copyright (c) Gilbert Ramirez 2000-2002
7  * Portions Copyright (c) Novell, Inc. 2000-2003
8  *
9  * Wireshark - Network traffic analyzer
10  * By Gerald Combs <gerald@wireshark.org>
11  * Copyright 2000 Gerald Combs
12  *
13  * SPDX-License-Identifier: GPL-2.0-or-later
14  */
15 
16 #ifndef __PACKET_NCP_INT_H__
17 #define __PACKET_NCP_INT_H__
18 
19 #include <epan/expert.h>
20 #include <epan/ptvcursor.h>
21 
22 typedef struct _ptvc_record ptvc_record;
23 typedef struct _sub_ptvc_record sub_ptvc_record;
24 
25 typedef struct {
26  int *hf_ptr;
27  const char *first_string;
28  const char *repeat_string;
30 
31 struct _ptvc_record {
32  int *hf_ptr;
33  gint length;
34  const sub_ptvc_record *sub_ptvc_rec;
35  const info_string_t *req_info_str;
36  unsigned int endianness;
37  unsigned int var_index : 2;
38  unsigned int repeat_index : 2;
39  unsigned int req_cond_index : 8;
40 };
41 
42 /*
43  * Every NCP packet has this common header (except for burst packets).
44  */
46  guint16 type;
47  guint8 sequence;
48  guint8 conn_low;
49  guint8 task;
50  guint8 conn_high; /* type=0x5555 doesn't have this */
51 };
52 
53 extern gboolean nds_defragment;
54 extern gboolean nds_echo_eid;
55 extern gboolean ncp_echo_err;
56 extern gboolean ncp_echo_conn;
57 extern gboolean ncp_echo_server;
58 extern gboolean ncp_echo_file;
59 extern gboolean ncp_newstyle;
60 
62  gint *ett;
63  const char *descr;
64  const ptvc_record *ptvc_rec;
65 };
66 
67 typedef struct {
68  const char *dfilter_text;
69  struct epan_dfilter *dfilter;
71 
72 struct novell_tap {
73  int stat;
74  int hdr;
75 };
76 
77 typedef struct novell_tap _novell_tap;
78 
79 typedef struct {
80  guint8 error_in_packet;
81  gint ncp_error_index;
83 
84 struct _ncp_record;
85 typedef void (ncp_expert_handler)(ptvcursor_t *ptvc, packet_info *pinfo, const struct _ncp_record *ncp_rec, gboolean request);
86 
87 typedef struct _ncp_record {
88  guint8 func;
89  guint8 subfunc;
90  guint8 has_subfunc;
91  const gchar* name;
92  gint group;
93  const ptvc_record *request_ptvc;
94  const ptvc_record *reply_ptvc;
95  const error_equivalency *errors;
96  const int *req_cond_indexes;
97  unsigned int req_cond_size_type;
98  ncp_expert_handler *expert_handler_func;
99 } ncp_record;
100 
101 typedef struct {
102  const ncp_record *ncp_rec;
103  gboolean *req_cond_results;
104  guint32 req_frame_num;
105  nstime_t req_frame_time;
106  guint16 length;
107  guint32 req_nds_flags;
108  guint32 req_nds_prot_flags;
109  guint8 nds_request_verb;
110  guint8 nds_version;
111  char object_name[256];
112  gboolean nds_frag;
113  guint32 nds_end_frag;
114  guint32 nds_frag_num;
115  guint16 req_mask;
116  guint16 req_mask_ext;
117  guint32 nds_frag_flags;
119 
120 WS_DLL_PUBLIC const value_string sss_verb_enum[];
121 WS_DLL_PUBLIC const value_string nmas_subverb_enum[];
122 WS_DLL_PUBLIC const value_string ncp_nds_verb_vals[];
123 
124 void dissect_ncp_request(tvbuff_t*, packet_info*, guint32,
125  guint8, guint16, proto_tree *volatile);
126 
127 void dissect_ncp_reply(tvbuff_t *, packet_info*, guint32, guint8,
128  guint16, proto_tree*, struct novell_tap*);
129 
130 void dissect_ping_req(tvbuff_t *, packet_info*, guint32, guint8,
131  guint16, proto_tree*);
132 
133 void dissect_nds_request(tvbuff_t*, packet_info*, guint32,
134  guint8, guint16, proto_tree*);
135 
136 void nds_defrag(tvbuff_t*, packet_info*, guint32,
137  guint8, guint16, proto_tree*, struct novell_tap*);
138 
139 extern int proto_ncp;
140 extern gint ett_ncp;
141 extern gint ett_nds;
142 extern gint ett_nds_segments;
143 extern gint ett_nds_segment;
144 
145 /*extern dissector_handle_t nds_data_handle;*/
146 
147 /*
148  * NCP packet types.
149  */
150 #define NCP_ALLOCATE_SLOT 0x1111
151 #define NCP_SERVICE_REQUEST 0x2222
152 #define NCP_SERVICE_REPLY 0x3333
153 #define NCP_WATCHDOG 0x3e3e
154 #define NCP_DEALLOCATE_SLOT 0x5555
155 #define NCP_BURST_MODE_XFER 0x7777
156 #define NCP_POSITIVE_ACK 0x9999
157 #define NCP_BROADCAST_SLOT 0xbbbb
158 #define NCP_LIP_ECHO 0x4c69
159 
160 #endif
Definition: packet-ncp-int.h:45
Definition: packet-ncp-int.h:61
Definition: packet_info.h:44
Definition: packet-ncp-int.h:67
Definition: tvbuff-int.h:35
Definition: nstime.h:27
Definition: packet-ncp-int.h:72
Definition: dfilter-int.h:19
Definition: packet-ncp-int.h:79
Definition: packet-ncp-int.h:31
Definition: value_string.h:24
Definition: proto.h:759
Definition: proto.c:68
Definition: packet-ncp-int.h:87
Definition: packet-ncp-int.h:101
Definition: packet-ncp-int.h:25