Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-ncp-int.h
blob3259b7be9dd570808634bcb32e0d12712b87ce20
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)
6 * Portions Copyright (c) Gilbert Ramirez 2000-2002
7 * Portions Copyright (c) Novell, Inc. 2000-2003
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 2000 Gerald Combs
13 * SPDX-License-Identifier: GPL-2.0-or-later
16 #ifndef __PACKET_NCP_INT_H__
17 #define __PACKET_NCP_INT_H__
19 #include <epan/expert.h>
20 #include <epan/ptvcursor.h>
22 typedef struct _ptvc_record ptvc_record;
23 typedef struct _sub_ptvc_record sub_ptvc_record;
25 typedef struct {
26 int *hf_ptr;
27 const char *first_string;
28 const char *repeat_string;
29 } info_string_t;
31 struct _ptvc_record {
32 int *hf_ptr;
33 int 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;
43 * Every NCP packet has this common header (except for burst packets).
45 struct ncp_common_header {
46 uint16_t type;
47 uint8_t sequence;
48 uint8_t conn_low;
49 uint8_t task;
50 uint8_t conn_high; /* type=0x5555 doesn't have this */
53 extern bool nds_defragment;
54 extern bool nds_echo_eid;
55 extern bool ncp_echo_err;
56 extern bool ncp_echo_conn;
57 extern bool ncp_echo_server;
58 extern bool ncp_echo_file;
59 extern bool ncp_newstyle;
61 struct _sub_ptvc_record {
62 int *ett;
63 const char *descr;
64 const ptvc_record *ptvc_rec;
67 typedef struct {
68 const char *dfilter_text;
69 struct epan_dfilter *dfilter;
70 } conditional_record;
72 struct novell_tap {
73 int stat;
74 int hdr;
77 typedef struct novell_tap _novell_tap;
79 typedef struct {
80 uint8_t error_in_packet;
81 int ncp_error_index;
82 } error_equivalency;
84 struct _ncp_record;
85 typedef void (ncp_expert_handler)(ptvcursor_t *ptvc, packet_info *pinfo, const struct _ncp_record *ncp_rec, bool request);
87 typedef struct _ncp_record {
88 uint8_t func;
89 uint8_t subfunc;
90 uint8_t has_subfunc;
91 const char* name;
92 int 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;
102 * XXX - should the object_name be a pointer, initialized to null,
103 * and set to a wmem-allocated copy of the full string?
105 typedef struct {
106 const ncp_record *ncp_rec;
107 bool *req_cond_results;
108 uint32_t req_frame_num;
109 nstime_t req_frame_time;
110 uint16_t length;
111 uint32_t req_nds_flags;
112 uint32_t req_nds_prot_flags;
113 uint8_t nds_request_verb;
114 uint8_t nds_version;
115 char object_name[256];
116 bool nds_frag;
117 uint32_t nds_end_frag;
118 uint32_t nds_frag_num;
119 uint16_t req_mask;
120 uint16_t req_mask_ext;
121 uint32_t nds_frag_flags;
122 } ncp_req_hash_value;
124 WS_DLL_PUBLIC const value_string sss_verb_enum[];
125 WS_DLL_PUBLIC const value_string nmas_subverb_enum[];
126 WS_DLL_PUBLIC const value_string ncp_nds_verb_vals[];
128 void dissect_ncp_request(tvbuff_t*, packet_info*, uint32_t,
129 uint8_t, uint16_t, bool, proto_tree *volatile);
131 void dissect_ncp_reply(tvbuff_t *, packet_info*, uint32_t, uint8_t,
132 uint16_t, proto_tree*, struct novell_tap*);
134 void dissect_ping_req(tvbuff_t *, packet_info*, uint32_t, uint8_t,
135 uint16_t, proto_tree*);
137 void dissect_nds_request(tvbuff_t*, packet_info*, uint32_t,
138 uint8_t, uint16_t, proto_tree*);
140 void nds_defrag(tvbuff_t*, packet_info*, uint32_t,
141 uint8_t, uint16_t, proto_tree*, struct novell_tap*);
143 extern int proto_ncp;
144 extern int ett_ncp;
145 extern int ett_nds;
146 extern int ett_nds_segments;
147 extern int ett_nds_segment;
149 /*extern dissector_handle_t nds_data_handle;*/
152 * NCP packet types.
154 #define NCP_ALLOCATE_SLOT 0x1111
155 #define NCP_SERVICE_REQUEST 0x2222
156 #define NCP_SERVICE_REPLY 0x3333
157 #define NCP_WATCHDOG 0x3e3e
158 #define NCP_DEALLOCATE_SLOT 0x5555
159 #define NCP_BURST_MODE_XFER 0x7777
160 #define NCP_POSITIVE_ACK 0x9999
161 #define NCP_BROADCAST_SLOT 0xbbbb
162 #define NCP_LIP_ECHO 0x4c69
164 #endif