/* packet-nlm.c
* Routines for nlm dissection
*
- * $Id: packet-nlm.c,v 1.16 2001/05/23 19:29:45 guy Exp $
+ * $Id: packet-nlm.c,v 1.22 2001/12/23 21:36:57 guy Exp $
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
*
* Copied from packet-mount.c
*
- * 2001-JAN Ronnie Sahlberg <rsahlber@bigpond.net.au>
+ * 2001-JAN Ronnie Sahlberg <See AUTHORS for email>
* Updates to version 1 of the protocol.
* Added version 3 of the protocol.
* Added version 4 of the protocol.
static int hf_nlm_lock_owner = -1;
static int hf_nlm_lock_svid = -1;
static int hf_nlm_lock_l_offset = -1;
+static int hf_nlm_lock_l_offset64 = -1;
static int hf_nlm_lock_l_len = -1;
+static int hf_nlm_lock_l_len64 = -1;
static int hf_nlm_reclaim = -1;
+static int hf_nlm_stat = -1;
static int hf_nlm_state = -1;
static int hf_nlm_test_stat = -1;
static int hf_nlm_test_stat_stat = -1;
static gint ett_nlm_lock = -1;
-const value_string names_nlm_state[] =
+const value_string names_nlm_stats[] =
{
/* NLM_GRANTED is the function number 5 and the state code 0.
* So we use for the state the postfix _S.
lock_tree = proto_item_add_subtree(lock_item, ett_nlm_lock);
}
- offset = dissect_rpc_string_tvb(tvb,pinfo,lock_tree,
+ offset = dissect_rpc_string(tvb,pinfo,lock_tree,
hf_nlm_lock_caller_name, offset, NULL);
offset = dissect_nfs_fh3(tvb, offset, pinfo, lock_tree,"fh");
- offset = dissect_rpc_data_tvb(tvb, pinfo, lock_tree, hf_nlm_lock_owner, offset);
+ offset = dissect_rpc_data(tvb, pinfo, lock_tree, hf_nlm_lock_owner, offset);
- offset = dissect_rpc_uint32_tvb(tvb, pinfo, lock_tree, hf_nlm_lock_svid, offset);
+ offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_lock_svid, offset);
if (version == 4) {
- offset = dissect_rpc_uint64_tvb(tvb, pinfo, lock_tree, hf_nlm_lock_l_offset, offset);
- offset = dissect_rpc_uint64_tvb(tvb, pinfo, lock_tree, hf_nlm_lock_l_len, offset);
+ offset = dissect_rpc_uint64(tvb, pinfo, lock_tree, hf_nlm_lock_l_offset64, offset);
+ offset = dissect_rpc_uint64(tvb, pinfo, lock_tree, hf_nlm_lock_l_len64, offset);
}
else {
- offset = dissect_rpc_uint32_tvb(tvb, pinfo, lock_tree, hf_nlm_lock_l_offset, offset);
- offset = dissect_rpc_uint32_tvb(tvb, pinfo, lock_tree, hf_nlm_lock_l_len, offset);
+ offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_lock_l_offset, offset);
+ offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_lock_l_len, offset);
}
return offset;
dissect_nlm_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, int version)
{
- offset = dissect_rpc_data_tvb(tvb, pinfo, tree, hf_nlm_cookie, offset);
- dissect_rpc_bool_tvb(tvb, pinfo, tree, hf_nlm_exclusive, offset);
+ offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
+ dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_exclusive, offset);
offset += 4;
offset = dissect_lock(tvb, pinfo, tree, version, offset);
return offset;
dissect_nlm_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree,int version)
{
- offset = dissect_rpc_data_tvb(tvb, pinfo, tree, hf_nlm_cookie, offset);
- offset = dissect_rpc_bool_tvb(tvb, pinfo, tree, hf_nlm_block, offset);
- offset = dissect_rpc_bool_tvb(tvb, pinfo, tree, hf_nlm_exclusive, offset);
+ offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
+ offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_block, offset);
+ offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_exclusive, offset);
offset = dissect_lock(tvb, pinfo, tree, version, offset);
- offset = dissect_rpc_bool_tvb(tvb, pinfo, tree, hf_nlm_reclaim, offset);
- offset = dissect_rpc_uint32_tvb(tvb, pinfo, tree, hf_nlm_state, offset);
+ offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_reclaim, offset);
+ offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_state, offset);
return offset;
}
dissect_nlm_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree,int version)
{
- offset = dissect_rpc_data_tvb(tvb, pinfo, tree, hf_nlm_cookie, offset);
- offset = dissect_rpc_bool_tvb(tvb, pinfo, tree, hf_nlm_block, offset);
- offset = dissect_rpc_bool_tvb(tvb, pinfo, tree, hf_nlm_exclusive, offset);
+ offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
+ offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_block, offset);
+ offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_exclusive, offset);
offset = dissect_lock(tvb, pinfo, tree, version, offset);
return offset;
}
dissect_nlm_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree,int version)
{
- offset = dissect_rpc_data_tvb(tvb, pinfo, tree, hf_nlm_cookie, offset);
+ offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
offset = dissect_lock(tvb, pinfo, tree, version, offset);
return offset;
}
dissect_nlm_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree,int version)
{
- offset = dissect_rpc_data_tvb(tvb, pinfo, tree, hf_nlm_cookie, offset);
- offset = dissect_rpc_bool_tvb(tvb, pinfo, tree, hf_nlm_exclusive, offset);
+ offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
+ offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_exclusive, offset);
offset = dissect_lock(tvb, pinfo, tree, version, offset);
return offset;
}
proto_item* lock_item = NULL;
proto_tree* lock_tree = NULL;
- offset = dissect_rpc_data_tvb(tvb, pinfo, tree, hf_nlm_cookie, offset);
+ offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
if (tree) {
lock_item = proto_tree_add_item(tree, hf_nlm_test_stat, tvb,
ett_nlm_lock);
}
- offset = dissect_rpc_uint32_tvb(tvb, pinfo, lock_tree, hf_nlm_test_stat_stat,
+ offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_test_stat_stat,
offset);
/* last structure is optional, only supplied for stat==1 (LOCKED) */
ett_nlm_lock);
}
- offset = dissect_rpc_bool_tvb(tvb, pinfo, lock_tree, hf_nlm_exclusive,
+ offset = dissect_rpc_bool(tvb, pinfo, lock_tree, hf_nlm_exclusive,
offset);
- offset = dissect_rpc_uint32_tvb(tvb, pinfo, lock_tree, hf_nlm_lock_svid,
+ offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_lock_svid,
offset);
- offset = dissect_rpc_data_tvb(tvb, pinfo, lock_tree, hf_nlm_lock_owner,
+ offset = dissect_rpc_data(tvb, pinfo, lock_tree, hf_nlm_lock_owner,
offset);
if (version == 4) {
- offset = dissect_rpc_uint64_tvb(tvb, pinfo, lock_tree,
- hf_nlm_lock_l_offset, offset);
- offset = dissect_rpc_uint64_tvb(tvb, pinfo, lock_tree,
- hf_nlm_lock_l_len, offset);
+ offset = dissect_rpc_uint64(tvb, pinfo, lock_tree,
+ hf_nlm_lock_l_offset64, offset);
+ offset = dissect_rpc_uint64(tvb, pinfo, lock_tree,
+ hf_nlm_lock_l_len64, offset);
}
else {
- offset = dissect_rpc_uint32_tvb(tvb, pinfo, lock_tree,
+ offset = dissect_rpc_uint32(tvb, pinfo, lock_tree,
hf_nlm_lock_l_offset, offset);
- offset = dissect_rpc_uint32_tvb(tvb, pinfo, lock_tree,
+ offset = dissect_rpc_uint32(tvb, pinfo, lock_tree,
hf_nlm_lock_l_len, offset);
}
proto_item* lock_item = NULL;
proto_tree* lock_tree = NULL;
- offset = dissect_rpc_data_tvb(tvb, pinfo, tree, hf_nlm_cookie, offset);
+ offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
if (tree) {
lock_item = proto_tree_add_item(tree, hf_nlm_share, tvb,
ett_nlm_lock);
}
- offset = dissect_rpc_string_tvb(tvb,pinfo,lock_tree,
+ offset = dissect_rpc_string(tvb,pinfo,lock_tree,
hf_nlm_lock_caller_name, offset, NULL);
offset = dissect_nfs_fh3(tvb, offset, pinfo, lock_tree, "fh");
- offset = dissect_rpc_data_tvb(tvb, pinfo, lock_tree, hf_nlm_lock_owner, offset);
+ offset = dissect_rpc_data(tvb, pinfo, lock_tree, hf_nlm_lock_owner, offset);
- offset = dissect_rpc_uint32_tvb(tvb, pinfo, lock_tree, hf_nlm_share_mode, offset);
- offset = dissect_rpc_uint32_tvb(tvb, pinfo, lock_tree, hf_nlm_share_access, offset);
+ offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_share_mode, offset);
+ offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_share_access, offset);
- offset = dissect_rpc_bool_tvb(tvb, pinfo, tree, hf_nlm_reclaim, offset);
+ offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_reclaim, offset);
return offset;
}
dissect_nlm_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, int version)
{
- offset = dissect_rpc_data_tvb(tvb, pinfo, tree, hf_nlm_cookie, offset);
- offset = dissect_rpc_uint32_tvb(tvb, pinfo, tree, hf_nlm_state, offset);
- offset = dissect_rpc_uint32_tvb(tvb, pinfo, tree, hf_nlm_sequence, offset);
+ offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
+ offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_stat, offset);
+ offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_sequence, offset);
return offset;
}
dissect_nlm_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree,int version)
{
- offset = dissect_rpc_string_tvb(tvb,pinfo,tree,
+ offset = dissect_rpc_string(tvb,pinfo,tree,
hf_nlm_share_name, offset, NULL);
- offset = dissect_rpc_uint32_tvb(tvb, pinfo, tree, hf_nlm_state, offset);
+ offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_stat, offset);
return offset;
}
dissect_nlm_gen_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree)
{
- offset = dissect_rpc_data_tvb(tvb, pinfo, tree, hf_nlm_cookie, offset);
- offset = dissect_rpc_uint32_tvb(tvb, pinfo, tree, hf_nlm_state, offset);
+ offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
+ offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_stat, offset);
return offset;
}
static hf_register_info hf[] = {
{ &hf_nlm_cookie, {
"cookie", "nlm.cookie", FT_BYTES, BASE_DEC,
- NULL, 0, "cookie" }},
+ NULL, 0, "cookie", HFILL }},
{ &hf_nlm_block, {
"block", "nlm.block", FT_BOOLEAN, BASE_NONE,
- &yesno, 0, "block" }},
+ &yesno, 0, "block", HFILL }},
{ &hf_nlm_exclusive, {
"exclusive", "nlm.exclusive", FT_BOOLEAN, BASE_NONE,
- &yesno, 0, "exclusive" }},
+ &yesno, 0, "exclusive", HFILL }},
{ &hf_nlm_lock, {
"lock", "nlm.lock", FT_NONE, 0,
- NULL, 0, "lock" }},
+ NULL, 0, "lock", HFILL }},
{ &hf_nlm_lock_caller_name, {
"caller_name", "nlm.lock.caller_name", FT_STRING, BASE_NONE,
- NULL, 0, "caller_name" }},
+ NULL, 0, "caller_name", HFILL }},
{ &hf_nlm_lock_owner, {
"owner", "nlm.lock.owner", FT_BYTES, BASE_DEC,
- NULL, 0, "owner" }},
+ NULL, 0, "owner", HFILL }},
{ &hf_nlm_lock_svid, {
"svid", "nlm.lock.svid", FT_UINT32, BASE_DEC,
- NULL, 0, "svid" }},
+ NULL, 0, "svid", HFILL }},
+ { &hf_nlm_lock_l_offset64, {
+ "l_offset", "nlm.lock.l_offset", FT_UINT64, BASE_DEC,
+ NULL, 0, "l_offset", HFILL }},
{ &hf_nlm_lock_l_offset, {
"l_offset", "nlm.lock.l_offset", FT_UINT32, BASE_DEC,
- NULL, 0, "l_offset" }},
+ NULL, 0, "l_offset", HFILL }},
+ { &hf_nlm_lock_l_len64, {
+ "l_len", "nlm.lock.l_len", FT_UINT64, BASE_DEC,
+ NULL, 0, "l_len", HFILL }},
{ &hf_nlm_lock_l_len, {
"l_len", "nlm.lock.l_len", FT_UINT32, BASE_DEC,
- NULL, 0, "l_len" }},
+ NULL, 0, "l_len", HFILL }},
{ &hf_nlm_reclaim, {
"reclaim", "nlm.reclaim", FT_BOOLEAN, BASE_NONE,
- &yesno, 0, "reclaim" }},
+ &yesno, 0, "reclaim", HFILL }},
{ &hf_nlm_state, {
"state", "nlm.state", FT_UINT32, BASE_DEC,
- VALS(names_nlm_state), 0, "state" }},
+ NULL, 0, "STATD state", HFILL }},
+ { &hf_nlm_stat, {
+ "stat", "nlm.stat", FT_UINT32, BASE_DEC,
+ VALS(names_nlm_stats), 0, "stat", HFILL }},
{ &hf_nlm_test_stat, {
"test_stat", "nlm.test_stat", FT_NONE, 0,
- NULL, 0, "test_stat" }},
+ NULL, 0, "test_stat", HFILL }},
{ &hf_nlm_test_stat_stat, {
"stat", "nlm.test_stat.stat", FT_UINT32, BASE_DEC,
- VALS(names_nlm_state), 0, "stat" }},
+ VALS(names_nlm_stats), 0, "stat", HFILL }},
{ &hf_nlm_holder, {
"holder", "nlm.holder", FT_NONE, 0,
- NULL, 0, "holder" }},
+ NULL, 0, "holder", HFILL }},
{ &hf_nlm_share, {
"share", "nlm.share", FT_NONE, 0,
- NULL, 0, "share" }},
+ NULL, 0, "share", HFILL }},
{ &hf_nlm_share_mode, {
"mode", "nlm.share.mode", FT_UINT32, BASE_DEC,
- VALS(names_fsh_mode), 0, "mode" }},
+ VALS(names_fsh_mode), 0, "mode", HFILL }},
{ &hf_nlm_share_access, {
"access", "nlm.share.access", FT_UINT32, BASE_DEC,
- VALS(names_fsh_access), 0, "access" }},
+ VALS(names_fsh_access), 0, "access", HFILL }},
{ &hf_nlm_share_name, {
"name", "nlm.share.name", FT_STRING, BASE_NONE,
- NULL, 0, "name" }},
+ NULL, 0, "name", HFILL }},
{ &hf_nlm_sequence, {
"sequence", "nlm.sequence", FT_INT32, BASE_DEC,
- NULL, 0, "sequence" }},
+ NULL, 0, "sequence", HFILL }},
};
static gint *ett[] = {