1999-11-15 14:17:20 +00:00
|
|
|
/* packet-nlm.c
|
|
|
|
* Routines for nlm dissection
|
|
|
|
*
|
2002-08-02 23:36:07 +00:00
|
|
|
* $Id: packet-nlm.c,v 1.28 2002/08/02 23:35:55 jmayer Exp $
|
1999-11-15 14:17:20 +00:00
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
2001-05-30 06:01:02 +00:00
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
1999-11-15 14:17:20 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* Copied from packet-mount.c
|
|
|
|
*
|
2001-12-23 21:36:58 +00:00
|
|
|
* 2001-JAN Ronnie Sahlberg <See AUTHORS for email>
|
2001-01-16 20:56:14 +00:00
|
|
|
* Updates to version 1 of the protocol.
|
|
|
|
* Added version 3 of the protocol.
|
|
|
|
* Added version 4 of the protocol.
|
|
|
|
*
|
|
|
|
*
|
1999-11-15 14:17:20 +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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "packet-rpc.h"
|
2000-08-08 06:22:08 +00:00
|
|
|
#include "packet-nfs.h"
|
1999-11-15 14:17:20 +00:00
|
|
|
#include "packet-nlm.h"
|
2002-05-08 12:51:45 +00:00
|
|
|
#include "prefs.h"
|
|
|
|
#include <string.h>
|
1999-11-15 14:17:20 +00:00
|
|
|
|
2000-08-08 06:22:08 +00:00
|
|
|
/*
|
|
|
|
* NFS Lock Manager protocol specs can only be found in actual
|
|
|
|
* implementations or in the nice book:
|
|
|
|
* Brent Callaghan: "NFS Illustrated", Addison-Wesley, ISBN 0-201-32570-5
|
|
|
|
* which I use here as reference (BC).
|
2001-01-18 09:44:51 +00:00
|
|
|
*
|
|
|
|
* They can also be found if you go to
|
|
|
|
*
|
|
|
|
* http://www.opengroup.org/publications/catalog/c702.htm
|
|
|
|
*
|
|
|
|
* and follow the links to the HTML version of the document.
|
2000-08-08 06:22:08 +00:00
|
|
|
*/
|
1999-11-15 14:17:20 +00:00
|
|
|
|
|
|
|
static int proto_nlm = -1;
|
|
|
|
|
2000-08-08 06:22:08 +00:00
|
|
|
static int hf_nlm_cookie = -1;
|
|
|
|
static int hf_nlm_block = -1;
|
|
|
|
static int hf_nlm_exclusive = -1;
|
|
|
|
static int hf_nlm_lock = -1;
|
|
|
|
static int hf_nlm_lock_caller_name = -1;
|
|
|
|
static int hf_nlm_lock_owner = -1;
|
|
|
|
static int hf_nlm_lock_svid = -1;
|
|
|
|
static int hf_nlm_lock_l_offset = -1;
|
2001-10-29 21:13:13 +00:00
|
|
|
static int hf_nlm_lock_l_offset64 = -1;
|
2000-08-08 06:22:08 +00:00
|
|
|
static int hf_nlm_lock_l_len = -1;
|
2001-10-29 21:13:13 +00:00
|
|
|
static int hf_nlm_lock_l_len64 = -1;
|
2000-08-08 06:22:08 +00:00
|
|
|
static int hf_nlm_reclaim = -1;
|
2001-09-13 08:02:11 +00:00
|
|
|
static int hf_nlm_stat = -1;
|
2001-09-14 06:48:30 +00:00
|
|
|
static int hf_nlm_state = -1;
|
2001-01-16 20:56:14 +00:00
|
|
|
static int hf_nlm_test_stat = -1;
|
|
|
|
static int hf_nlm_test_stat_stat = -1;
|
|
|
|
static int hf_nlm_holder = -1;
|
|
|
|
static int hf_nlm_share = -1;
|
|
|
|
static int hf_nlm_share_mode = -1;
|
|
|
|
static int hf_nlm_share_access = -1;
|
|
|
|
static int hf_nlm_share_name = -1;
|
2001-02-04 09:04:11 +00:00
|
|
|
static int hf_nlm_sequence = -1;
|
2002-05-08 12:51:45 +00:00
|
|
|
static int hf_nlm_request_in = -1;
|
|
|
|
static int hf_nlm_reply_in = -1;
|
|
|
|
static int hf_nlm_time = -1;
|
2000-08-08 06:22:08 +00:00
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint ett_nlm = -1;
|
2000-08-08 06:22:08 +00:00
|
|
|
static gint ett_nlm_lock = -1;
|
|
|
|
|
|
|
|
|
2002-05-08 12:51:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* stuff to match MSG and RES packets for async NLM
|
|
|
|
*/
|
|
|
|
|
|
|
|
static gboolean nlm_match_msgres = FALSE;
|
|
|
|
static GHashTable *nlm_msg_res_unmatched = NULL;
|
|
|
|
static GHashTable *nlm_msg_res_matched = NULL;
|
|
|
|
|
|
|
|
/* XXX when matching the packets we should really check the conversation (only address
|
|
|
|
NOT ports) and command type as well. I am lazy and thinks the cookie itself is
|
|
|
|
good enough for now
|
|
|
|
*/
|
|
|
|
typedef struct _nlm_msg_res_unmatched_data {
|
|
|
|
int req_frame;
|
|
|
|
nstime_t ns;
|
|
|
|
int cookie_len;
|
|
|
|
char *cookie;
|
|
|
|
} nlm_msg_res_unmatched_data;
|
|
|
|
|
|
|
|
typedef struct _nlm_msg_res_matched_data {
|
|
|
|
int req_frame;
|
|
|
|
int rep_frame;
|
|
|
|
nstime_t ns;
|
|
|
|
} nlm_msg_res_matched_data;
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
nlm_msg_res_unmatched_free_all(gpointer key_arg _U_, gpointer value, gpointer user_data _U_)
|
|
|
|
{
|
|
|
|
nlm_msg_res_unmatched_data *umd = (nlm_msg_res_unmatched_data *)value;
|
|
|
|
|
|
|
|
g_free(umd->cookie);
|
|
|
|
g_free(umd);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
static gboolean
|
|
|
|
nlm_msg_res_matched_free_all(gpointer key_arg _U_, gpointer value, gpointer user_data _U_)
|
|
|
|
{
|
|
|
|
nlm_msg_res_matched_data *md = (nlm_msg_res_matched_data *)value;
|
|
|
|
|
|
|
|
g_free(md);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static guint
|
|
|
|
nlm_msg_res_unmatched_hash(gconstpointer k)
|
|
|
|
{
|
|
|
|
nlm_msg_res_unmatched_data *umd = (nlm_msg_res_unmatched_data *)k;
|
|
|
|
guint8 hash=0;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for(i=0;i<umd->cookie_len;i++){
|
|
|
|
hash^=umd->cookie[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
return hash;
|
|
|
|
}
|
|
|
|
static guint
|
|
|
|
nlm_msg_res_matched_hash(gconstpointer k)
|
|
|
|
{
|
|
|
|
guint hash = (guint)k;
|
|
|
|
|
|
|
|
return hash;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
nlm_msg_res_unmatched_equal(gconstpointer k1, gconstpointer k2)
|
|
|
|
{
|
|
|
|
nlm_msg_res_unmatched_data *umd1 = (nlm_msg_res_unmatched_data *)k1;
|
|
|
|
nlm_msg_res_unmatched_data *umd2 = (nlm_msg_res_unmatched_data *)k2;
|
|
|
|
|
|
|
|
if(umd1->cookie_len!=umd2->cookie_len){
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return( !memcmp(umd1->cookie, umd2->cookie, umd1->cookie_len));
|
|
|
|
}
|
|
|
|
static gint
|
|
|
|
nlm_msg_res_matched_equal(gconstpointer k1, gconstpointer k2)
|
|
|
|
{
|
|
|
|
guint mk1 = (guint)k1;
|
|
|
|
guint mk2 = (guint)k2;
|
|
|
|
|
|
|
|
return( mk1==mk2 );
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
nlm_msg_res_match_init(void)
|
|
|
|
{
|
|
|
|
if(nlm_msg_res_unmatched != NULL){
|
|
|
|
g_hash_table_foreach_remove(nlm_msg_res_unmatched,
|
|
|
|
nlm_msg_res_unmatched_free_all, NULL);
|
|
|
|
} else {
|
|
|
|
nlm_msg_res_unmatched=g_hash_table_new(nlm_msg_res_unmatched_hash,
|
|
|
|
nlm_msg_res_unmatched_equal);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(nlm_msg_res_matched != NULL){
|
|
|
|
g_hash_table_foreach_remove(nlm_msg_res_matched,
|
|
|
|
nlm_msg_res_matched_free_all, NULL);
|
|
|
|
} else {
|
|
|
|
nlm_msg_res_matched=g_hash_table_new(nlm_msg_res_matched_hash,
|
|
|
|
nlm_msg_res_matched_equal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
nlm_print_msgres_reply(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb)
|
|
|
|
{
|
|
|
|
nlm_msg_res_matched_data *md;
|
|
|
|
|
|
|
|
md=g_hash_table_lookup(nlm_msg_res_matched, (gconstpointer)pinfo->fd->num);
|
|
|
|
if(md){
|
|
|
|
nstime_t ns;
|
|
|
|
proto_tree_add_uint(tree, hf_nlm_request_in, tvb, 0, 0, md->req_frame);
|
|
|
|
ns.secs= pinfo->fd->abs_secs-md->ns.secs;
|
|
|
|
ns.nsecs=pinfo->fd->abs_usecs*1000-md->ns.nsecs;
|
|
|
|
if(ns.nsecs<0){
|
|
|
|
ns.nsecs+=1000000000;
|
|
|
|
ns.secs--;
|
|
|
|
}
|
|
|
|
proto_tree_add_time(tree, hf_nlm_time, tvb, 0, 0, &ns);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
nlm_print_msgres_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb)
|
|
|
|
{
|
|
|
|
nlm_msg_res_matched_data *md;
|
|
|
|
|
|
|
|
md=g_hash_table_lookup(nlm_msg_res_matched, (gconstpointer)pinfo->fd->num);
|
|
|
|
if(md){
|
|
|
|
proto_tree_add_uint(tree, hf_nlm_reply_in, tvb, 0, 0, md->rep_frame);
|
|
|
|
}
|
|
|
|
}
|
2002-05-21 10:17:30 +00:00
|
|
|
static void
|
|
|
|
nlm_match_fhandle_reply(packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
nlm_msg_res_matched_data *md;
|
|
|
|
|
|
|
|
md=g_hash_table_lookup(nlm_msg_res_matched, (gconstpointer)pinfo->fd->num);
|
|
|
|
if(md && md->rep_frame){
|
|
|
|
nfs_fhandle_data_t *fhd;
|
|
|
|
fhd=(nfs_fhandle_data_t *)g_hash_table_lookup(
|
|
|
|
nfs_fhandle_frame_table,
|
|
|
|
(gconstpointer)md->req_frame);
|
|
|
|
if(fhd){
|
|
|
|
dissect_fhandle_hidden(pinfo,
|
|
|
|
tree, fhd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static void
|
|
|
|
nlm_match_fhandle_request(packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
nlm_msg_res_matched_data *md;
|
|
|
|
|
|
|
|
md=g_hash_table_lookup(nlm_msg_res_matched, (gconstpointer)pinfo->fd->num);
|
|
|
|
if(md && md->rep_frame){
|
|
|
|
nfs_fhandle_data_t *fhd;
|
|
|
|
fhd=(nfs_fhandle_data_t *)g_hash_table_lookup(
|
|
|
|
nfs_fhandle_frame_table,
|
|
|
|
(gconstpointer)md->rep_frame);
|
|
|
|
if(fhd){
|
|
|
|
dissect_fhandle_hidden(pinfo,
|
|
|
|
tree, fhd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2002-05-08 12:51:45 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
nlm_register_unmatched_res(packet_info *pinfo, tvbuff_t *tvb, int offset)
|
|
|
|
{
|
|
|
|
nlm_msg_res_unmatched_data umd;
|
|
|
|
nlm_msg_res_unmatched_data *old_umd;
|
|
|
|
|
|
|
|
umd.cookie_len=tvb_get_ntohl(tvb, offset);
|
|
|
|
umd.cookie=(char *)tvb_get_ptr(tvb, offset+4, -1);
|
|
|
|
|
|
|
|
/* have we seen this cookie before? */
|
|
|
|
old_umd=g_hash_table_lookup(nlm_msg_res_unmatched, (gconstpointer)&umd);
|
|
|
|
if(old_umd){
|
|
|
|
nlm_msg_res_matched_data *md;
|
|
|
|
|
|
|
|
md=g_malloc(sizeof(nlm_msg_res_matched_data));
|
|
|
|
md->req_frame=old_umd->req_frame;
|
|
|
|
md->rep_frame=pinfo->fd->num;
|
|
|
|
md->ns=old_umd->ns;
|
|
|
|
g_hash_table_insert(nlm_msg_res_matched, (gpointer)md->req_frame, (gpointer)md);
|
|
|
|
g_hash_table_insert(nlm_msg_res_matched, (gpointer)md->rep_frame, (gpointer)md);
|
|
|
|
|
|
|
|
g_hash_table_remove(nlm_msg_res_unmatched, (gconstpointer)old_umd);
|
|
|
|
g_free(old_umd->cookie);
|
|
|
|
g_free(old_umd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
nlm_register_unmatched_msg(packet_info *pinfo, tvbuff_t *tvb, int offset)
|
|
|
|
{
|
|
|
|
nlm_msg_res_unmatched_data *umd;
|
|
|
|
nlm_msg_res_unmatched_data *old_umd;
|
|
|
|
|
|
|
|
/* allocate and build the unmatched structure for this request */
|
|
|
|
umd=g_malloc(sizeof(nlm_msg_res_unmatched_data));
|
|
|
|
umd->req_frame=pinfo->fd->num;
|
|
|
|
umd->ns.secs=pinfo->fd->abs_secs;
|
|
|
|
umd->ns.nsecs=pinfo->fd->abs_usecs*1000;
|
|
|
|
umd->cookie_len=tvb_get_ntohl(tvb, offset);
|
|
|
|
umd->cookie=g_malloc(umd->cookie_len);
|
|
|
|
tvb_memcpy(tvb, (guint8 *)umd->cookie, offset+4, umd->cookie_len);
|
|
|
|
|
|
|
|
/* remove any old duplicates */
|
|
|
|
old_umd=g_hash_table_lookup(nlm_msg_res_unmatched, (gconstpointer)umd);
|
|
|
|
if(old_umd){
|
|
|
|
g_hash_table_remove(nlm_msg_res_unmatched, (gconstpointer)old_umd);
|
|
|
|
g_free(old_umd->cookie);
|
|
|
|
g_free(old_umd);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* add new one */
|
|
|
|
g_hash_table_insert(nlm_msg_res_unmatched, (gpointer)umd, (gpointer)umd);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-04-14 23:04:04 +00:00
|
|
|
static const value_string names_nlm_stats[] =
|
2000-08-08 06:22:08 +00:00
|
|
|
{
|
|
|
|
/* NLM_GRANTED is the function number 5 and the state code 0.
|
|
|
|
* So we use for the state the postfix _S.
|
|
|
|
*/
|
|
|
|
#define NLM_GRANTED_S 0
|
|
|
|
{ NLM_GRANTED_S, "NLM_GRANTED" },
|
|
|
|
#define NLM_DENIED 1
|
|
|
|
{ NLM_DENIED, "NLM_DENIED" },
|
|
|
|
#define NLM_DENIED_NOLOCKS 2
|
|
|
|
{ NLM_DENIED_NOLOCKS, "NLM_DENIED_NOLOCKS" },
|
|
|
|
#define NLM_BLOCKED 3
|
|
|
|
{ NLM_BLOCKED, "NLM_BLOCKED" },
|
|
|
|
#define NLM_DENIED_GRACE_PERIOD 4
|
|
|
|
{ NLM_DENIED_GRACE_PERIOD, "NLM_DENIED_GRACE_PERIOD" },
|
|
|
|
#define NLM_DEADLCK 5
|
|
|
|
{ NLM_DEADLCK, "NLM_DEADLCK" },
|
|
|
|
#define NLM_ROFS 6
|
|
|
|
{ NLM_ROFS, "NLM_ROFS" },
|
|
|
|
#define NLM_STALE_FH 7
|
|
|
|
{ NLM_STALE_FH, "NLM_STALE_FH" },
|
|
|
|
#define NLM_BIG 8
|
|
|
|
{ NLM_BIG, "NLM_BIG" },
|
|
|
|
#define NLM_FAILED 9
|
|
|
|
{ NLM_FAILED, "NLM_FAILED" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-04-14 23:04:04 +00:00
|
|
|
static const value_string names_fsh_mode[] =
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
|
|
|
#define FSM_DN 0
|
|
|
|
{ FSM_DN, "deny none" },
|
|
|
|
#define FSM_DR 1
|
|
|
|
{ FSM_DR, "deny read" },
|
|
|
|
#define FSM_DW 2
|
|
|
|
{ FSM_DW, "deny write" },
|
|
|
|
#define FSM_DRW 3
|
|
|
|
{ FSM_DRW, "deny read/write" },
|
|
|
|
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-04-14 23:04:04 +00:00
|
|
|
static const value_string names_fsh_access[] =
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
|
|
|
#define FSA_NONE 0
|
|
|
|
{ FSA_NONE, "no access" },
|
|
|
|
#define FSA_R 1
|
|
|
|
{ FSA_R, "read-only" },
|
|
|
|
#define FSA_W 2
|
|
|
|
{ FSA_W, "write-only" },
|
|
|
|
#define FSA_RW 3
|
|
|
|
{ FSA_RW, "read/write" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-08-08 06:22:08 +00:00
|
|
|
|
2001-01-16 20:56:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* **************************** */
|
|
|
|
/* generic dissecting functions */
|
|
|
|
/* **************************** */
|
2000-08-08 06:22:08 +00:00
|
|
|
static int
|
2001-01-16 20:56:14 +00:00
|
|
|
dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int version, int offset)
|
2000-08-08 06:22:08 +00:00
|
|
|
{
|
|
|
|
proto_item* lock_item = NULL;
|
|
|
|
proto_tree* lock_tree = NULL;
|
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
lock_item = proto_tree_add_item(tree, hf_nlm_lock, tvb,
|
2002-01-24 09:20:54 +00:00
|
|
|
offset, -1, FALSE);
|
2000-08-08 06:22:08 +00:00
|
|
|
if (lock_item)
|
|
|
|
lock_tree = proto_item_add_subtree(lock_item, ett_nlm_lock);
|
|
|
|
}
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb,lock_tree,
|
2000-08-08 06:22:08 +00:00
|
|
|
hf_nlm_lock_caller_name, offset, NULL);
|
2001-01-28 03:39:48 +00:00
|
|
|
offset = dissect_nfs_fh3(tvb, offset, pinfo, lock_tree,"fh");
|
2000-08-08 06:22:08 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_data(tvb, lock_tree, hf_nlm_lock_owner, offset);
|
2000-08-08 06:22:08 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_lock_svid, offset);
|
2000-08-08 06:22:08 +00:00
|
|
|
|
|
|
|
if (version == 4) {
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint64(tvb, lock_tree, hf_nlm_lock_l_offset64, offset);
|
|
|
|
offset = dissect_rpc_uint64(tvb, lock_tree, hf_nlm_lock_l_len64, offset);
|
2000-08-08 06:22:08 +00:00
|
|
|
}
|
|
|
|
else {
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_lock_l_offset, offset);
|
|
|
|
offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_lock_l_len, offset);
|
2000-08-08 06:22:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-01-16 20:56:14 +00:00
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree, int version)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2002-05-08 12:51:45 +00:00
|
|
|
if(nlm_match_msgres){
|
|
|
|
rpc_call_info_value *rpc_call=pinfo->private_data;
|
|
|
|
if(rpc_call->proc==6){ /* NLM_TEST_MSG */
|
|
|
|
if( (!pinfo->fd->flags.visited) ){
|
|
|
|
nlm_register_unmatched_msg(pinfo, tvb, offset);
|
|
|
|
} else {
|
|
|
|
nlm_print_msgres_request(pinfo, tree, tvb);
|
|
|
|
}
|
2002-05-21 10:17:30 +00:00
|
|
|
/* for the fhandle matching that finds both request and
|
|
|
|
response packet */
|
|
|
|
if(nfs_fhandle_reqrep_matching){
|
|
|
|
nlm_match_fhandle_request(pinfo, tree);
|
|
|
|
}
|
2002-05-08 12:51:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
|
|
|
|
dissect_rpc_bool(tvb, tree, hf_nlm_exclusive, offset);
|
2001-01-28 03:39:48 +00:00
|
|
|
offset += 4;
|
|
|
|
offset = dissect_lock(tvb, pinfo, tree, version, offset);
|
|
|
|
return offset;
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree,int version)
|
|
|
|
{
|
2002-05-08 12:51:45 +00:00
|
|
|
if(nlm_match_msgres){
|
|
|
|
rpc_call_info_value *rpc_call=pinfo->private_data;
|
|
|
|
if(rpc_call->proc==7){ /* NLM_LOCK_MSG */
|
|
|
|
if( (!pinfo->fd->flags.visited) ){
|
|
|
|
nlm_register_unmatched_msg(pinfo, tvb, offset);
|
|
|
|
} else {
|
|
|
|
nlm_print_msgres_request(pinfo, tree, tvb);
|
|
|
|
}
|
2002-05-21 10:17:30 +00:00
|
|
|
/* for the fhandle matching that finds both request and
|
|
|
|
response packet */
|
|
|
|
if(nfs_fhandle_reqrep_matching){
|
|
|
|
nlm_match_fhandle_request(pinfo, tree);
|
|
|
|
}
|
2002-05-08 12:51:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
|
|
|
|
offset = dissect_rpc_bool(tvb, tree, hf_nlm_block, offset);
|
|
|
|
offset = dissect_rpc_bool(tvb, tree, hf_nlm_exclusive, offset);
|
2001-01-28 03:39:48 +00:00
|
|
|
offset = dissect_lock(tvb, pinfo, tree, version, offset);
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_bool(tvb, tree, hf_nlm_reclaim, offset);
|
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_nlm_state, offset);
|
2001-01-28 03:39:48 +00:00
|
|
|
return offset;
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree,int version)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2002-05-08 12:51:45 +00:00
|
|
|
if(nlm_match_msgres){
|
|
|
|
rpc_call_info_value *rpc_call=pinfo->private_data;
|
|
|
|
if(rpc_call->proc==8){ /* NLM_CANCEL_MSG */
|
|
|
|
if( (!pinfo->fd->flags.visited) ){
|
|
|
|
nlm_register_unmatched_msg(pinfo, tvb, offset);
|
|
|
|
} else {
|
|
|
|
nlm_print_msgres_request(pinfo, tree, tvb);
|
|
|
|
}
|
2002-05-21 10:17:30 +00:00
|
|
|
/* for the fhandle matching that finds both request and
|
|
|
|
response packet */
|
|
|
|
if(nfs_fhandle_reqrep_matching){
|
|
|
|
nlm_match_fhandle_request(pinfo, tree);
|
|
|
|
}
|
2002-05-08 12:51:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
|
|
|
|
offset = dissect_rpc_bool(tvb, tree, hf_nlm_block, offset);
|
|
|
|
offset = dissect_rpc_bool(tvb, tree, hf_nlm_exclusive, offset);
|
2001-01-28 03:39:48 +00:00
|
|
|
offset = dissect_lock(tvb, pinfo, tree, version, offset);
|
|
|
|
return offset;
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree,int version)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2002-05-08 12:51:45 +00:00
|
|
|
if(nlm_match_msgres){
|
|
|
|
rpc_call_info_value *rpc_call=pinfo->private_data;
|
|
|
|
if(rpc_call->proc==9){ /* NLM_UNLOCK_MSG */
|
|
|
|
if( (!pinfo->fd->flags.visited) ){
|
|
|
|
nlm_register_unmatched_msg(pinfo, tvb, offset);
|
|
|
|
} else {
|
|
|
|
nlm_print_msgres_request(pinfo, tree, tvb);
|
|
|
|
}
|
2002-05-21 10:17:30 +00:00
|
|
|
/* for the fhandle matching that finds both request and
|
|
|
|
response packet */
|
|
|
|
if(nfs_fhandle_reqrep_matching){
|
|
|
|
nlm_match_fhandle_request(pinfo, tree);
|
|
|
|
}
|
2002-05-08 12:51:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
|
2001-01-28 03:39:48 +00:00
|
|
|
offset = dissect_lock(tvb, pinfo, tree, version, offset);
|
|
|
|
return offset;
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree,int version)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2002-05-08 12:51:45 +00:00
|
|
|
if(nlm_match_msgres){
|
|
|
|
rpc_call_info_value *rpc_call=pinfo->private_data;
|
|
|
|
if(rpc_call->proc==10){ /* NLM_GRANTED_MSG */
|
|
|
|
if( (!pinfo->fd->flags.visited) ){
|
|
|
|
nlm_register_unmatched_msg(pinfo, tvb, offset);
|
|
|
|
} else {
|
|
|
|
nlm_print_msgres_request(pinfo, tree, tvb);
|
|
|
|
}
|
2002-05-21 10:17:30 +00:00
|
|
|
/* for the fhandle matching that finds both request and
|
|
|
|
response packet */
|
|
|
|
if(nfs_fhandle_reqrep_matching){
|
|
|
|
nlm_match_fhandle_request(pinfo, tree);
|
|
|
|
}
|
2002-05-08 12:51:45 +00:00
|
|
|
}
|
|
|
|
}
|
2002-05-21 10:17:30 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
|
|
|
|
offset = dissect_rpc_bool(tvb, tree, hf_nlm_exclusive, offset);
|
2001-01-28 03:39:48 +00:00
|
|
|
offset = dissect_lock(tvb, pinfo, tree, version, offset);
|
|
|
|
return offset;
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_nlm_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
|
2001-01-28 03:39:48 +00:00
|
|
|
proto_tree *tree,int version)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
|
|
|
proto_item* lock_item = NULL;
|
|
|
|
proto_tree* lock_tree = NULL;
|
|
|
|
|
2002-05-08 12:51:45 +00:00
|
|
|
if(nlm_match_msgres){
|
|
|
|
rpc_call_info_value *rpc_call=pinfo->private_data;
|
|
|
|
if(rpc_call->proc==11){ /* NLM_TEST_RES */
|
|
|
|
if( (!pinfo->fd->flags.visited) ){
|
|
|
|
nlm_register_unmatched_res(pinfo, tvb, offset);
|
|
|
|
} else {
|
|
|
|
nlm_print_msgres_reply(pinfo, tree, tvb);
|
|
|
|
}
|
2002-05-21 10:17:30 +00:00
|
|
|
/* for the fhandle matching that finds both request and
|
|
|
|
response packet */
|
|
|
|
if(nfs_fhandle_reqrep_matching){
|
|
|
|
nlm_match_fhandle_reply(pinfo, tree);
|
|
|
|
}
|
2002-05-08 12:51:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
|
2001-01-16 20:56:14 +00:00
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
lock_item = proto_tree_add_item(tree, hf_nlm_test_stat, tvb,
|
2002-01-24 09:20:54 +00:00
|
|
|
offset, -1, FALSE);
|
2001-01-16 20:56:14 +00:00
|
|
|
if (lock_item)
|
|
|
|
lock_tree = proto_item_add_subtree(lock_item,
|
|
|
|
ett_nlm_lock);
|
|
|
|
}
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_test_stat_stat,
|
2001-01-28 03:39:48 +00:00
|
|
|
offset);
|
2001-01-16 20:56:14 +00:00
|
|
|
|
|
|
|
/* last structure is optional, only supplied for stat==1 (LOCKED) */
|
2002-01-24 09:20:54 +00:00
|
|
|
if(tvb_reported_length_remaining(tvb, offset) == 0){
|
2001-01-28 03:39:48 +00:00
|
|
|
return offset;
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
lock_item = proto_tree_add_item(lock_tree, hf_nlm_holder, tvb,
|
2002-01-24 09:20:54 +00:00
|
|
|
offset, -1, FALSE);
|
2001-01-16 20:56:14 +00:00
|
|
|
if (lock_item)
|
|
|
|
lock_tree = proto_item_add_subtree(lock_item,
|
|
|
|
ett_nlm_lock);
|
|
|
|
}
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_bool(tvb, lock_tree, hf_nlm_exclusive,
|
2001-01-28 03:39:48 +00:00
|
|
|
offset);
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_lock_svid,
|
2001-01-28 03:39:48 +00:00
|
|
|
offset);
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_data(tvb, lock_tree, hf_nlm_lock_owner,
|
2001-01-28 03:39:48 +00:00
|
|
|
offset);
|
2001-01-16 20:56:14 +00:00
|
|
|
|
|
|
|
if (version == 4) {
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint64(tvb, lock_tree,
|
2001-10-29 21:13:13 +00:00
|
|
|
hf_nlm_lock_l_offset64, offset);
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint64(tvb, lock_tree,
|
2001-10-29 21:13:13 +00:00
|
|
|
hf_nlm_lock_l_len64, offset);
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
else {
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, lock_tree,
|
2001-01-28 03:39:48 +00:00
|
|
|
hf_nlm_lock_l_offset, offset);
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, lock_tree,
|
2001-01-28 03:39:48 +00:00
|
|
|
hf_nlm_lock_l_len, offset);
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
2001-01-28 03:39:48 +00:00
|
|
|
return offset;
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
2002-04-03 13:24:13 +00:00
|
|
|
proto_tree *tree,int version _U_)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
|
|
|
proto_item* lock_item = NULL;
|
|
|
|
proto_tree* lock_tree = NULL;
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
|
2001-01-16 20:56:14 +00:00
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
lock_item = proto_tree_add_item(tree, hf_nlm_share, tvb,
|
2002-01-24 09:20:54 +00:00
|
|
|
offset, -1, FALSE);
|
2001-01-16 20:56:14 +00:00
|
|
|
if (lock_item)
|
|
|
|
lock_tree = proto_item_add_subtree(lock_item,
|
|
|
|
ett_nlm_lock);
|
|
|
|
}
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb,lock_tree,
|
2001-01-28 03:39:48 +00:00
|
|
|
hf_nlm_lock_caller_name, offset, NULL);
|
2001-01-16 20:56:14 +00:00
|
|
|
|
2001-01-28 03:39:48 +00:00
|
|
|
offset = dissect_nfs_fh3(tvb, offset, pinfo, lock_tree, "fh");
|
2001-01-16 20:56:14 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_data(tvb, lock_tree, hf_nlm_lock_owner, offset);
|
2001-01-16 20:56:14 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_share_mode, offset);
|
|
|
|
offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_share_access, offset);
|
2001-01-16 20:56:14 +00:00
|
|
|
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_bool(tvb, tree, hf_nlm_reclaim, offset);
|
2001-01-28 03:39:48 +00:00
|
|
|
return offset;
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
2001-02-04 09:04:11 +00:00
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_nlm_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
|
|
|
|
proto_tree *tree, int version _U_)
|
2001-02-04 09:04:11 +00:00
|
|
|
{
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
|
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_nlm_stat, offset);
|
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_nlm_sequence, offset);
|
2001-02-04 09:04:11 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2001-01-16 20:56:14 +00:00
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_nlm_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
|
|
|
|
proto_tree *tree,int version _U_)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb,tree,
|
2001-01-28 03:39:48 +00:00
|
|
|
hf_nlm_share_name, offset, NULL);
|
2001-01-16 20:56:14 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_nlm_stat, offset);
|
2001-01-16 20:56:14 +00:00
|
|
|
|
2001-01-28 03:39:48 +00:00
|
|
|
return offset;
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-08 06:22:08 +00:00
|
|
|
/* RPC functions */
|
|
|
|
|
2001-01-16 20:56:14 +00:00
|
|
|
|
|
|
|
/* This function is identical for all NLM protocol versions (1-4)*/
|
2000-08-08 06:22:08 +00:00
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_nlm_gen_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
|
2001-01-28 03:39:48 +00:00
|
|
|
proto_tree *tree)
|
2000-08-08 06:22:08 +00:00
|
|
|
{
|
2002-05-08 12:51:45 +00:00
|
|
|
if(nlm_match_msgres){
|
|
|
|
rpc_call_info_value *rpc_call=pinfo->private_data;
|
|
|
|
if((rpc_call->proc==12) /* NLM_LOCK_RES */
|
|
|
|
|| (rpc_call->proc==13) /* NLM_CANCEL_RES */
|
|
|
|
|| (rpc_call->proc==14) /* NLM_UNLOCK_RES */
|
|
|
|
|| (rpc_call->proc==15) ){ /* NLM_GRENTED_RES */
|
|
|
|
if( (!pinfo->fd->flags.visited) ){
|
|
|
|
nlm_register_unmatched_res(pinfo, tvb, offset);
|
|
|
|
} else {
|
|
|
|
nlm_print_msgres_reply(pinfo, tree, tvb);
|
|
|
|
}
|
2002-05-21 10:17:30 +00:00
|
|
|
/* for the fhandle matching that finds both request and
|
|
|
|
response packet */
|
|
|
|
if(nfs_fhandle_reqrep_matching){
|
|
|
|
nlm_match_fhandle_reply(pinfo, tree);
|
|
|
|
}
|
2002-05-08 12:51:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
|
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_nlm_stat, offset);
|
2001-01-28 03:39:48 +00:00
|
|
|
return offset;
|
2000-08-08 06:22:08 +00:00
|
|
|
}
|
|
|
|
|
2001-01-16 20:56:14 +00:00
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm1_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2001-01-28 03:39:48 +00:00
|
|
|
return dissect_nlm_test(tvb,offset,pinfo,tree,1);
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
2000-08-08 06:22:08 +00:00
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm4_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
2000-08-08 06:22:08 +00:00
|
|
|
{
|
2001-01-28 03:39:48 +00:00
|
|
|
return dissect_nlm_test(tvb,offset,pinfo,tree,4);
|
2000-08-08 06:22:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm1_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
2000-08-08 06:22:08 +00:00
|
|
|
{
|
2001-01-28 03:39:48 +00:00
|
|
|
return dissect_nlm_lock(tvb,offset,pinfo,tree,1);
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm4_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2001-01-28 03:39:48 +00:00
|
|
|
return dissect_nlm_lock(tvb,offset,pinfo,tree,4);
|
2000-08-08 06:22:08 +00:00
|
|
|
}
|
|
|
|
|
1999-11-15 14:17:20 +00:00
|
|
|
|
2001-01-16 20:56:14 +00:00
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm1_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2001-01-28 03:39:48 +00:00
|
|
|
return dissect_nlm_cancel(tvb,offset,pinfo,tree,1);
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm4_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2001-01-28 03:39:48 +00:00
|
|
|
return dissect_nlm_cancel(tvb,offset,pinfo,tree,4);
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm1_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2001-01-28 03:39:48 +00:00
|
|
|
return dissect_nlm_unlock(tvb,offset,pinfo,tree,1);
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm4_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2001-01-28 03:39:48 +00:00
|
|
|
return dissect_nlm_unlock(tvb,offset,pinfo,tree,4);
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm1_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2001-01-28 03:39:48 +00:00
|
|
|
return dissect_nlm_granted(tvb,offset,pinfo,tree,1);
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm4_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2001-01-28 03:39:48 +00:00
|
|
|
return dissect_nlm_granted(tvb,offset,pinfo,tree,4);
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm1_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2001-01-28 03:39:48 +00:00
|
|
|
return dissect_nlm_test_res(tvb,offset,pinfo,tree,1);
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm4_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2001-01-28 03:39:48 +00:00
|
|
|
return dissect_nlm_test_res(tvb,offset,pinfo,tree,4);
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm3_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2001-01-28 03:39:48 +00:00
|
|
|
return dissect_nlm_share(tvb,offset,pinfo,tree,3);
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
2001-02-04 09:04:11 +00:00
|
|
|
static int
|
|
|
|
dissect_nlm4_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
return dissect_nlm_share(tvb,offset,pinfo,tree,4);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_nlm3_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
return dissect_nlm_shareres(tvb,offset,pinfo,tree,3);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_nlm4_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
return dissect_nlm_shareres(tvb,offset,pinfo,tree,4);
|
|
|
|
}
|
|
|
|
|
2001-01-16 20:56:14 +00:00
|
|
|
static int
|
2001-01-28 03:39:48 +00:00
|
|
|
dissect_nlm3_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
2001-01-16 20:56:14 +00:00
|
|
|
{
|
2001-01-28 03:39:48 +00:00
|
|
|
return dissect_nlm_freeall(tvb,offset,pinfo,tree,3);
|
2001-01-16 20:56:14 +00:00
|
|
|
}
|
|
|
|
|
2001-02-04 09:04:11 +00:00
|
|
|
static int
|
|
|
|
dissect_nlm4_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree)
|
|
|
|
{
|
|
|
|
return dissect_nlm_freeall(tvb,offset,pinfo,tree,4);
|
|
|
|
}
|
|
|
|
|
2001-01-16 20:56:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
1999-11-15 14:17:20 +00:00
|
|
|
/* proc number, "proc name", dissect_request, dissect_reply */
|
2001-01-18 09:44:51 +00:00
|
|
|
/* NULL as function pointer means: type of arguments is "void". */
|
2000-08-02 11:36:18 +00:00
|
|
|
/* NLM protocol version 1 */
|
2001-01-18 09:44:51 +00:00
|
|
|
static const vsff nlm1_proc[] = {
|
2001-01-16 20:56:14 +00:00
|
|
|
{ NLM_NULL, "NULL",
|
|
|
|
NULL, NULL },
|
2000-08-08 06:22:08 +00:00
|
|
|
{ NLM_TEST, "TEST",
|
2001-01-18 09:44:51 +00:00
|
|
|
dissect_nlm1_test, dissect_nlm1_test_res },
|
2001-01-16 20:56:14 +00:00
|
|
|
{ NLM_LOCK, "LOCK",
|
2001-01-18 09:44:51 +00:00
|
|
|
dissect_nlm1_lock, dissect_nlm_gen_reply },
|
2000-08-08 06:22:08 +00:00
|
|
|
{ NLM_CANCEL, "CANCEL",
|
2001-01-18 09:44:51 +00:00
|
|
|
dissect_nlm1_cancel, dissect_nlm_gen_reply },
|
2001-01-16 20:56:14 +00:00
|
|
|
{ NLM_UNLOCK, "UNLOCK",
|
2001-01-18 09:44:51 +00:00
|
|
|
dissect_nlm1_unlock, dissect_nlm_gen_reply },
|
2000-08-08 06:22:08 +00:00
|
|
|
{ NLM_GRANTED, "GRANTED",
|
2001-01-18 09:44:51 +00:00
|
|
|
dissect_nlm1_granted, dissect_nlm_gen_reply },
|
2000-08-08 06:22:08 +00:00
|
|
|
{ NLM_TEST_MSG, "TEST_MSG",
|
2001-01-16 20:56:14 +00:00
|
|
|
dissect_nlm1_test, NULL },
|
|
|
|
{ NLM_LOCK_MSG, "LOCK_MSG",
|
|
|
|
dissect_nlm1_lock, NULL },
|
2000-08-08 06:22:08 +00:00
|
|
|
{ NLM_CANCEL_MSG, "CANCEL_MSG",
|
2001-01-16 20:56:14 +00:00
|
|
|
dissect_nlm1_cancel, NULL },
|
|
|
|
{ NLM_UNLOCK_MSG, "UNLOCK_MSG",
|
|
|
|
dissect_nlm1_unlock, NULL },
|
2000-08-08 06:22:08 +00:00
|
|
|
{ NLM_GRANTED_MSG, "GRANTED_MSG",
|
2001-01-16 20:56:14 +00:00
|
|
|
dissect_nlm1_granted, NULL },
|
2000-08-08 06:22:08 +00:00
|
|
|
{ NLM_TEST_RES, "TEST_RES",
|
2001-01-16 20:56:14 +00:00
|
|
|
dissect_nlm1_test_res, NULL },
|
|
|
|
{ NLM_LOCK_RES, "LOCK_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
|
|
|
{ NLM_CANCEL_RES, "CANCEL_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
|
|
|
{ NLM_UNLOCK_RES, "UNLOCK_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
|
|
|
{ NLM_GRANTED_RES, "GRANTED_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
2001-01-20 08:38:10 +00:00
|
|
|
{ 0, NULL,
|
|
|
|
NULL, NULL }
|
2000-08-02 11:36:18 +00:00
|
|
|
};
|
|
|
|
/* end of NLM protocol version 1 */
|
|
|
|
|
|
|
|
/* NLM protocol version 2 */
|
2001-01-18 09:44:51 +00:00
|
|
|
static const vsff nlm2_proc[] = {
|
2001-01-20 08:38:10 +00:00
|
|
|
{ NLM_NULL, "NULL",
|
|
|
|
NULL, NULL },
|
|
|
|
{ NLM_TEST, "TEST",
|
|
|
|
dissect_nlm1_test, dissect_nlm1_test_res },
|
|
|
|
{ NLM_LOCK, "LOCK",
|
|
|
|
dissect_nlm1_lock, dissect_nlm_gen_reply },
|
|
|
|
{ NLM_CANCEL, "CANCEL",
|
|
|
|
dissect_nlm1_cancel, dissect_nlm_gen_reply },
|
|
|
|
{ NLM_UNLOCK, "UNLOCK",
|
|
|
|
dissect_nlm1_unlock, dissect_nlm_gen_reply },
|
|
|
|
{ NLM_GRANTED, "GRANTED",
|
|
|
|
dissect_nlm1_granted, dissect_nlm_gen_reply },
|
|
|
|
{ NLM_TEST_MSG, "TEST_MSG",
|
|
|
|
dissect_nlm1_test, NULL },
|
|
|
|
{ NLM_LOCK_MSG, "LOCK_MSG",
|
|
|
|
dissect_nlm1_lock, NULL },
|
|
|
|
{ NLM_CANCEL_MSG, "CANCEL_MSG",
|
|
|
|
dissect_nlm1_cancel, NULL },
|
|
|
|
{ NLM_UNLOCK_MSG, "UNLOCK_MSG",
|
|
|
|
dissect_nlm1_unlock, NULL },
|
|
|
|
{ NLM_GRANTED_MSG, "GRANTED_MSG",
|
|
|
|
dissect_nlm1_granted, NULL },
|
|
|
|
{ NLM_TEST_RES, "TEST_RES",
|
|
|
|
dissect_nlm1_test_res, NULL },
|
|
|
|
{ NLM_LOCK_RES, "LOCK_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
|
|
|
{ NLM_CANCEL_RES, "CANCEL_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
|
|
|
{ NLM_UNLOCK_RES, "UNLOCK_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
|
|
|
{ NLM_GRANTED_RES, "GRANTED_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
|
|
|
{ 0, NULL,
|
|
|
|
NULL, NULL }
|
2000-08-02 11:36:18 +00:00
|
|
|
};
|
|
|
|
/* end of NLM protocol version 2 */
|
|
|
|
|
1999-11-15 14:17:20 +00:00
|
|
|
/* NLM protocol version 3 */
|
2001-01-18 09:44:51 +00:00
|
|
|
static const vsff nlm3_proc[] = {
|
2001-01-20 08:38:10 +00:00
|
|
|
{ NLM_NULL, "NULL",
|
|
|
|
NULL, NULL },
|
|
|
|
{ NLM_TEST, "TEST",
|
|
|
|
dissect_nlm1_test, dissect_nlm1_test_res },
|
|
|
|
{ NLM_LOCK, "LOCK",
|
|
|
|
dissect_nlm1_lock, dissect_nlm_gen_reply },
|
|
|
|
{ NLM_CANCEL, "CANCEL",
|
|
|
|
dissect_nlm1_cancel, dissect_nlm_gen_reply },
|
|
|
|
{ NLM_UNLOCK, "UNLOCK",
|
|
|
|
dissect_nlm1_unlock, dissect_nlm_gen_reply },
|
|
|
|
{ NLM_GRANTED, "GRANTED",
|
|
|
|
dissect_nlm1_granted, dissect_nlm_gen_reply },
|
|
|
|
{ NLM_TEST_MSG, "TEST_MSG",
|
|
|
|
dissect_nlm1_test, NULL },
|
|
|
|
{ NLM_LOCK_MSG, "LOCK_MSG",
|
|
|
|
dissect_nlm1_lock, NULL },
|
|
|
|
{ NLM_CANCEL_MSG, "CANCEL_MSG",
|
|
|
|
dissect_nlm1_cancel, NULL },
|
|
|
|
{ NLM_UNLOCK_MSG, "UNLOCK_MSG",
|
|
|
|
dissect_nlm1_unlock, NULL },
|
|
|
|
{ NLM_GRANTED_MSG, "GRANTED_MSG",
|
|
|
|
dissect_nlm1_granted, NULL },
|
|
|
|
{ NLM_TEST_RES, "TEST_RES",
|
|
|
|
dissect_nlm1_test_res, NULL },
|
|
|
|
{ NLM_LOCK_RES, "LOCK_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
|
|
|
{ NLM_CANCEL_RES, "CANCEL_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
|
|
|
{ NLM_UNLOCK_RES, "UNLOCK_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
|
|
|
{ NLM_GRANTED_RES, "GRANTED_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
2001-01-16 20:56:14 +00:00
|
|
|
{ NLM_SHARE, "SHARE",
|
2001-02-04 09:04:11 +00:00
|
|
|
dissect_nlm3_share, dissect_nlm3_shareres },
|
2001-01-16 20:56:14 +00:00
|
|
|
{ NLM_UNSHARE, "UNSHARE",
|
2001-02-04 09:04:11 +00:00
|
|
|
dissect_nlm3_share, dissect_nlm3_shareres },
|
2001-01-16 20:56:14 +00:00
|
|
|
{ NLM_NM_LOCK, "NM_LOCK",
|
2001-02-04 09:04:11 +00:00
|
|
|
dissect_nlm1_lock, dissect_nlm_gen_reply },
|
2001-01-16 20:56:14 +00:00
|
|
|
{ NLM_FREE_ALL, "FREE_ALL",
|
2001-02-04 09:04:11 +00:00
|
|
|
dissect_nlm3_freeall, NULL },
|
2001-01-20 08:38:10 +00:00
|
|
|
{ 0, NULL,
|
|
|
|
NULL, NULL }
|
1999-11-15 14:17:20 +00:00
|
|
|
};
|
|
|
|
/* end of NLM protocol version 3 */
|
|
|
|
|
2000-08-08 06:22:08 +00:00
|
|
|
|
2000-08-02 11:36:18 +00:00
|
|
|
/* NLM protocol version 4 */
|
2001-01-18 09:44:51 +00:00
|
|
|
static const vsff nlm4_proc[] = {
|
2001-01-16 20:56:14 +00:00
|
|
|
{ NLM_NULL, "NULL",
|
|
|
|
NULL, NULL },
|
|
|
|
{ NLM_TEST, "TEST",
|
2001-02-04 09:04:11 +00:00
|
|
|
dissect_nlm4_test, dissect_nlm4_test_res },
|
2001-01-16 20:56:14 +00:00
|
|
|
{ NLM_LOCK, "LOCK",
|
2001-02-04 09:04:11 +00:00
|
|
|
dissect_nlm4_lock, dissect_nlm_gen_reply },
|
2001-01-16 20:56:14 +00:00
|
|
|
{ NLM_CANCEL, "CANCEL",
|
2001-02-04 09:04:11 +00:00
|
|
|
dissect_nlm4_cancel, dissect_nlm_gen_reply },
|
2001-01-16 20:56:14 +00:00
|
|
|
{ NLM_UNLOCK, "UNLOCK",
|
2001-02-04 09:04:11 +00:00
|
|
|
dissect_nlm4_unlock, dissect_nlm_gen_reply },
|
2001-01-16 20:56:14 +00:00
|
|
|
{ NLM_GRANTED, "GRANTED",
|
2001-02-04 09:04:11 +00:00
|
|
|
dissect_nlm4_granted, dissect_nlm_gen_reply },
|
2001-01-16 20:56:14 +00:00
|
|
|
{ NLM_TEST_MSG, "TEST_MSG",
|
|
|
|
dissect_nlm4_test, NULL },
|
|
|
|
{ NLM_LOCK_MSG, "LOCK_MSG",
|
|
|
|
dissect_nlm4_lock, NULL },
|
|
|
|
{ NLM_CANCEL_MSG, "CANCEL_MSG",
|
|
|
|
dissect_nlm4_cancel, NULL },
|
|
|
|
{ NLM_UNLOCK_MSG, "UNLOCK_MSG",
|
|
|
|
dissect_nlm4_unlock, NULL },
|
|
|
|
{ NLM_GRANTED_MSG, "GRANTED_MSG",
|
|
|
|
dissect_nlm4_granted, NULL },
|
|
|
|
{ NLM_TEST_RES, "TEST_RES",
|
|
|
|
dissect_nlm4_test_res, NULL },
|
|
|
|
{ NLM_LOCK_RES, "LOCK_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
|
|
|
{ NLM_CANCEL_RES, "CANCEL_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
|
|
|
{ NLM_UNLOCK_RES, "UNLOCK_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
|
|
|
{ NLM_GRANTED_RES, "GRANTED_RES",
|
|
|
|
dissect_nlm_gen_reply, NULL },
|
2001-01-20 08:38:10 +00:00
|
|
|
{ NLM_SHARE, "SHARE",
|
2001-02-04 09:04:11 +00:00
|
|
|
dissect_nlm4_share, dissect_nlm4_shareres },
|
2001-01-20 08:38:10 +00:00
|
|
|
{ NLM_UNSHARE, "UNSHARE",
|
2001-02-04 09:04:11 +00:00
|
|
|
dissect_nlm4_share, dissect_nlm4_shareres },
|
2001-01-16 20:56:14 +00:00
|
|
|
{ NLM_NM_LOCK, "NM_LOCK",
|
2001-02-04 09:04:11 +00:00
|
|
|
dissect_nlm4_lock, dissect_nlm_gen_reply },
|
2001-01-20 08:38:10 +00:00
|
|
|
{ NLM_FREE_ALL, "FREE_ALL",
|
2001-02-04 09:04:11 +00:00
|
|
|
dissect_nlm4_freeall, NULL },
|
2001-01-20 08:38:10 +00:00
|
|
|
{ 0, NULL,
|
|
|
|
NULL, NULL }
|
2000-08-02 11:36:18 +00:00
|
|
|
};
|
|
|
|
/* end of NLM protocol version 4 */
|
1999-11-15 14:17:20 +00:00
|
|
|
|
2000-08-08 06:22:08 +00:00
|
|
|
|
|
|
|
static struct true_false_string yesno = { "Yes", "No" };
|
|
|
|
|
|
|
|
|
1999-11-15 14:17:20 +00:00
|
|
|
void
|
|
|
|
proto_register_nlm(void)
|
|
|
|
{
|
2000-08-08 06:22:08 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_nlm_cookie, {
|
2001-05-23 19:29:45 +00:00
|
|
|
"cookie", "nlm.cookie", FT_BYTES, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "cookie", HFILL }},
|
2000-08-08 06:22:08 +00:00
|
|
|
{ &hf_nlm_block, {
|
|
|
|
"block", "nlm.block", FT_BOOLEAN, BASE_NONE,
|
2001-06-18 02:18:27 +00:00
|
|
|
&yesno, 0, "block", HFILL }},
|
2000-08-08 06:22:08 +00:00
|
|
|
{ &hf_nlm_exclusive, {
|
|
|
|
"exclusive", "nlm.exclusive", FT_BOOLEAN, BASE_NONE,
|
2001-06-18 02:18:27 +00:00
|
|
|
&yesno, 0, "exclusive", HFILL }},
|
2000-08-08 06:22:08 +00:00
|
|
|
{ &hf_nlm_lock, {
|
|
|
|
"lock", "nlm.lock", FT_NONE, 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "lock", HFILL }},
|
2000-08-08 06:22:08 +00:00
|
|
|
{ &hf_nlm_lock_caller_name, {
|
|
|
|
"caller_name", "nlm.lock.caller_name", FT_STRING, BASE_NONE,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "caller_name", HFILL }},
|
2000-08-08 06:22:08 +00:00
|
|
|
{ &hf_nlm_lock_owner, {
|
2001-05-23 19:29:45 +00:00
|
|
|
"owner", "nlm.lock.owner", FT_BYTES, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "owner", HFILL }},
|
2000-08-08 06:22:08 +00:00
|
|
|
{ &hf_nlm_lock_svid, {
|
|
|
|
"svid", "nlm.lock.svid", FT_UINT32, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "svid", HFILL }},
|
2001-10-29 21:13:13 +00:00
|
|
|
{ &hf_nlm_lock_l_offset64, {
|
|
|
|
"l_offset", "nlm.lock.l_offset", FT_UINT64, BASE_DEC,
|
|
|
|
NULL, 0, "l_offset", HFILL }},
|
2000-08-08 06:22:08 +00:00
|
|
|
{ &hf_nlm_lock_l_offset, {
|
|
|
|
"l_offset", "nlm.lock.l_offset", FT_UINT32, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "l_offset", HFILL }},
|
2001-10-29 21:13:13 +00:00
|
|
|
{ &hf_nlm_lock_l_len64, {
|
|
|
|
"l_len", "nlm.lock.l_len", FT_UINT64, BASE_DEC,
|
|
|
|
NULL, 0, "l_len", HFILL }},
|
2000-08-08 06:22:08 +00:00
|
|
|
{ &hf_nlm_lock_l_len, {
|
|
|
|
"l_len", "nlm.lock.l_len", FT_UINT32, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "l_len", HFILL }},
|
2000-08-08 06:22:08 +00:00
|
|
|
{ &hf_nlm_reclaim, {
|
|
|
|
"reclaim", "nlm.reclaim", FT_BOOLEAN, BASE_NONE,
|
2001-06-18 02:18:27 +00:00
|
|
|
&yesno, 0, "reclaim", HFILL }},
|
2000-08-08 06:22:08 +00:00
|
|
|
{ &hf_nlm_state, {
|
|
|
|
"state", "nlm.state", FT_UINT32, BASE_DEC,
|
2001-09-14 06:48:30 +00:00
|
|
|
NULL, 0, "STATD state", HFILL }},
|
|
|
|
{ &hf_nlm_stat, {
|
|
|
|
"stat", "nlm.stat", FT_UINT32, BASE_DEC,
|
|
|
|
VALS(names_nlm_stats), 0, "stat", HFILL }},
|
2001-01-16 20:56:14 +00:00
|
|
|
{ &hf_nlm_test_stat, {
|
|
|
|
"test_stat", "nlm.test_stat", FT_NONE, 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "test_stat", HFILL }},
|
2001-01-16 20:56:14 +00:00
|
|
|
{ &hf_nlm_test_stat_stat, {
|
|
|
|
"stat", "nlm.test_stat.stat", FT_UINT32, BASE_DEC,
|
2001-09-14 06:48:30 +00:00
|
|
|
VALS(names_nlm_stats), 0, "stat", HFILL }},
|
2001-01-16 20:56:14 +00:00
|
|
|
{ &hf_nlm_holder, {
|
|
|
|
"holder", "nlm.holder", FT_NONE, 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "holder", HFILL }},
|
2001-01-16 20:56:14 +00:00
|
|
|
{ &hf_nlm_share, {
|
|
|
|
"share", "nlm.share", FT_NONE, 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "share", HFILL }},
|
2001-01-16 20:56:14 +00:00
|
|
|
{ &hf_nlm_share_mode, {
|
|
|
|
"mode", "nlm.share.mode", FT_UINT32, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
VALS(names_fsh_mode), 0, "mode", HFILL }},
|
2001-01-16 20:56:14 +00:00
|
|
|
{ &hf_nlm_share_access, {
|
|
|
|
"access", "nlm.share.access", FT_UINT32, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
VALS(names_fsh_access), 0, "access", HFILL }},
|
2001-01-16 20:56:14 +00:00
|
|
|
{ &hf_nlm_share_name, {
|
|
|
|
"name", "nlm.share.name", FT_STRING, BASE_NONE,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "name", HFILL }},
|
2001-02-04 09:04:11 +00:00
|
|
|
{ &hf_nlm_sequence, {
|
|
|
|
"sequence", "nlm.sequence", FT_INT32, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "sequence", HFILL }},
|
2002-05-08 12:51:45 +00:00
|
|
|
{ &hf_nlm_request_in, {
|
|
|
|
"Request MSG in", "nlm.msg_in", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0, "The RES packet is a response to the MSG in this packet", HFILL }},
|
|
|
|
{ &hf_nlm_reply_in, {
|
|
|
|
"Reply RES in", "nlm.res_in", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0, "The response to this MSG packet is in this packet", HFILL }},
|
|
|
|
{ &hf_nlm_time, {
|
|
|
|
"Time from request", "nlm.time", FT_RELATIVE_TIME, BASE_NONE,
|
|
|
|
NULL, 0, "Time between Request and Reply for async NLM calls", HFILL }},
|
|
|
|
|
2000-08-08 06:22:08 +00:00
|
|
|
};
|
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_nlm,
|
2000-08-08 06:22:08 +00:00
|
|
|
&ett_nlm_lock,
|
1999-11-16 11:44:20 +00:00
|
|
|
};
|
2002-05-08 12:51:45 +00:00
|
|
|
module_t *nlm_module;
|
1999-11-16 11:44:20 +00:00
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_nlm = proto_register_protocol("Network Lock Manager Protocol",
|
|
|
|
"NLM", "nlm");
|
2000-08-08 06:22:08 +00:00
|
|
|
proto_register_field_array(proto_nlm, hf, array_length(hf));
|
1999-11-16 11:44:20 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2002-05-08 12:51:45 +00:00
|
|
|
|
|
|
|
nlm_module = prefs_register_protocol(proto_nlm, NULL);
|
|
|
|
prefs_register_bool_preference(nlm_module, "nlm_msg_res_matching",
|
|
|
|
"Match MSG/RES packets for async NLM",
|
|
|
|
"Whether the dissector will track and match MSG and RES calls for asynchronous NLM",
|
|
|
|
&nlm_match_msgres);
|
|
|
|
register_init_routine(nlm_msg_res_match_init);
|
2000-04-04 06:46:41 +00:00
|
|
|
}
|
1999-11-15 14:17:20 +00:00
|
|
|
|
2000-04-04 06:46:41 +00:00
|
|
|
void
|
|
|
|
proto_reg_handoff_nlm(void)
|
|
|
|
{
|
1999-11-15 14:17:20 +00:00
|
|
|
/* Register the protocol as RPC */
|
1999-11-16 11:44:20 +00:00
|
|
|
rpc_init_prog(proto_nlm, NLM_PROGRAM, ett_nlm);
|
2000-08-02 11:36:18 +00:00
|
|
|
/* Register the procedure tables */
|
|
|
|
rpc_init_proc_table(NLM_PROGRAM, 1, nlm1_proc);
|
|
|
|
rpc_init_proc_table(NLM_PROGRAM, 2, nlm2_proc);
|
1999-11-15 14:17:20 +00:00
|
|
|
rpc_init_proc_table(NLM_PROGRAM, 3, nlm3_proc);
|
2000-08-02 11:36:18 +00:00
|
|
|
rpc_init_proc_table(NLM_PROGRAM, 4, nlm4_proc);
|
1999-11-15 14:17:20 +00:00
|
|
|
}
|