2000-07-28 20:03:59 +00:00
|
|
|
/* packet-ncp-int.h
|
|
|
|
* Structures and functions for NetWare Core Protocol.
|
2001-11-13 23:55:44 +00:00
|
|
|
* Gilbert Ramirez <gram@alumni.rice.edu>
|
2003-04-08 00:40:37 +00:00
|
|
|
* Modified for NDS support by Greg Morris (gmorris@novell.com)
|
2000-07-28 20:03:59 +00:00
|
|
|
*
|
2003-04-08 00:40:37 +00:00
|
|
|
* Portions Copyright (c) Gilbert Ramirez 2000-2002
|
|
|
|
* Portions Copyright (c) Novell, Inc. 2000-2003
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2000-07-28 20:03:59 +00:00
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
2002-05-16 09:59:52 +00:00
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
2000-07-28 20:03:59 +00:00
|
|
|
* Copyright 2000 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-07-28 20:03:59 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-07-28 20:03:59 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-07-28 20:03:59 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2000-08-11 13:37:21 +00:00
|
|
|
#ifndef __PACKET_NCP_INT_H__
|
|
|
|
#define __PACKET_NCP_INT_H__
|
|
|
|
|
2002-01-10 04:44:34 +00:00
|
|
|
typedef struct _ptvc_record ptvc_record;
|
|
|
|
typedef struct _sub_ptvc_record sub_ptvc_record;
|
|
|
|
|
|
|
|
struct _ptvc_record {
|
|
|
|
int *hf_ptr;
|
|
|
|
gint length;
|
|
|
|
const sub_ptvc_record *sub_ptvc_rec;
|
2002-05-09 23:50:34 +00:00
|
|
|
unsigned int endianness : 1; /* 0=BE, 1=LE */
|
|
|
|
unsigned int var_index : 2;
|
|
|
|
unsigned int repeat_index : 2;
|
2002-05-17 23:17:22 +00:00
|
|
|
unsigned int req_cond_index : 8;
|
2002-05-09 23:50:34 +00:00
|
|
|
unsigned int special_fmt : 2;
|
2002-01-10 04:44:34 +00:00
|
|
|
};
|
|
|
|
|
2002-05-09 23:50:34 +00:00
|
|
|
#define NCP_FMT_NONE 0
|
|
|
|
#define NCP_FMT_NW_DATE 1
|
|
|
|
#define NCP_FMT_NW_TIME 2
|
2002-08-23 17:47:31 +00:00
|
|
|
#define NCP_FMT_UNICODE 3
|
2002-05-09 23:50:34 +00:00
|
|
|
|
2003-08-25 22:16:57 +00:00
|
|
|
extern gboolean nds_defragment;
|
|
|
|
|
2002-01-10 04:44:34 +00:00
|
|
|
struct _sub_ptvc_record {
|
|
|
|
gint *ett;
|
2002-05-09 23:50:34 +00:00
|
|
|
const char *descr;
|
2002-01-10 04:44:34 +00:00
|
|
|
const ptvc_record *ptvc_rec;
|
|
|
|
};
|
2000-07-28 20:03:59 +00:00
|
|
|
|
2002-05-09 23:50:34 +00:00
|
|
|
typedef struct {
|
|
|
|
const char *dfilter_text;
|
|
|
|
dfilter_t *dfilter;
|
|
|
|
} conditional_record;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int *hf_ptr;
|
|
|
|
const char *first_string;
|
|
|
|
const char *repeat_string;
|
|
|
|
} info_string_t;
|
|
|
|
|
2000-07-28 20:03:59 +00:00
|
|
|
typedef struct {
|
|
|
|
guint8 error_in_packet;
|
|
|
|
gint ncp_error_index;
|
|
|
|
} error_equivalency;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
guint8 func;
|
|
|
|
guint8 subfunc;
|
2001-06-28 02:42:48 +00:00
|
|
|
guint8 has_subfunc;
|
2000-07-28 20:03:59 +00:00
|
|
|
gchar* name;
|
|
|
|
gint group;
|
|
|
|
const ptvc_record *request_ptvc;
|
|
|
|
const ptvc_record *reply_ptvc;
|
|
|
|
const error_equivalency *errors;
|
2002-05-09 23:50:34 +00:00
|
|
|
const int *req_cond_indexes;
|
|
|
|
unsigned int req_cond_size_type;
|
|
|
|
const info_string_t *req_info_str;
|
2000-07-28 20:03:59 +00:00
|
|
|
} ncp_record;
|
|
|
|
|
2003-04-25 20:36:29 +00:00
|
|
|
typedef struct {
|
|
|
|
const ncp_record *ncp_rec;
|
|
|
|
gboolean *req_cond_results;
|
|
|
|
guint32 req_frame_num;
|
|
|
|
nstime_t req_frame_time;
|
|
|
|
guint32 req_nds_flags;
|
|
|
|
guint8 nds_request_verb;
|
|
|
|
guint8 nds_version;
|
|
|
|
char object_name[256];
|
2003-08-25 22:16:57 +00:00
|
|
|
gboolean nds_frag;
|
|
|
|
guint32 nds_end_frag;
|
2004-06-15 09:23:59 +00:00
|
|
|
guint32 nds_frag_num;
|
2003-04-25 20:36:29 +00:00
|
|
|
} ncp_req_hash_value;
|
|
|
|
|
2000-07-28 20:03:59 +00:00
|
|
|
void dissect_ncp_request(tvbuff_t*, packet_info*, guint16,
|
2002-05-09 23:50:34 +00:00
|
|
|
guint8, guint16, proto_tree*);
|
2000-07-28 20:03:59 +00:00
|
|
|
|
2002-05-16 09:59:52 +00:00
|
|
|
void dissect_ncp_reply(tvbuff_t *, packet_info*, guint16, guint8,
|
|
|
|
guint16, proto_tree*);
|
2000-07-28 20:03:59 +00:00
|
|
|
|
2002-09-22 15:46:42 +00:00
|
|
|
void dissect_ping_req(tvbuff_t *, packet_info*, guint16, guint8,
|
|
|
|
guint16, proto_tree*);
|
|
|
|
|
2002-08-23 17:47:31 +00:00
|
|
|
void dissect_nds_request(tvbuff_t*, packet_info*, guint16,
|
|
|
|
guint8, guint16, proto_tree*);
|
|
|
|
|
2003-08-25 22:16:57 +00:00
|
|
|
void nds_defrag(tvbuff_t*, packet_info*, guint16,
|
|
|
|
guint8, guint16, proto_tree*);
|
2003-04-25 20:36:29 +00:00
|
|
|
|
2000-07-28 20:03:59 +00:00
|
|
|
extern int proto_ncp;
|
2002-05-09 23:50:34 +00:00
|
|
|
extern gint ett_ncp;
|
2002-09-22 15:46:42 +00:00
|
|
|
extern gint ett_nds;
|
2003-08-25 22:16:57 +00:00
|
|
|
extern gint ett_nds_segments;
|
|
|
|
extern gint ett_nds_segment;
|
|
|
|
|
2000-08-11 13:37:21 +00:00
|
|
|
|
2003-08-25 22:16:57 +00:00
|
|
|
extern GHashTable *nds_fragment_table;
|
|
|
|
extern GHashTable *nds_reassembled_table;
|
|
|
|
extern dissector_handle_t nds_data_handle;
|
2002-05-16 09:59:52 +00:00
|
|
|
/*
|
|
|
|
* NCP packet types.
|
|
|
|
*/
|
|
|
|
#define NCP_ALLOCATE_SLOT 0x1111
|
|
|
|
#define NCP_SERVICE_REQUEST 0x2222
|
|
|
|
#define NCP_SERVICE_REPLY 0x3333
|
|
|
|
#define NCP_WATCHDOG 0x3e3e
|
|
|
|
#define NCP_DEALLOCATE_SLOT 0x5555
|
|
|
|
#define NCP_BURST_MODE_XFER 0x7777
|
|
|
|
#define NCP_POSITIVE_ACK 0x9999
|
2003-04-25 20:36:29 +00:00
|
|
|
#define NCP_BROADCAST_SLOT 0xbbbb
|
|
|
|
#define NCP_LIP_ECHO 0x4c69
|
2002-05-16 09:59:52 +00:00
|
|
|
|
2000-08-11 13:37:21 +00:00
|
|
|
#endif
|