Blame wireshark-1.1.2-nfs41-backchnl-decode.patch

Steve Dickson e542b9
diff -up wireshark-1.1.2/epan/dissectors/packet-nfs.c.orig wireshark-1.1.2/epan/dissectors/packet-nfs.c
Steve Dickson e542b9
--- wireshark-1.1.2/epan/dissectors/packet-nfs.c.orig	2009-02-15 08:22:57.000000000 -0500
Steve Dickson e542b9
+++ wireshark-1.1.2/epan/dissectors/packet-nfs.c	2009-02-15 08:31:28.000000000 -0500
Steve Dickson e542b9
@@ -652,6 +652,8 @@ static emem_tree_t *nfs_file_handles = N
Steve Dickson e542b9
 
Steve Dickson e542b9
 static int dissect_nfs_stateid4(tvbuff_t *tvb, int offset, proto_tree *tree);
Steve Dickson e542b9
 
Steve Dickson e542b9
+static void reg_callback(int cbprog);
Steve Dickson e542b9
+
Steve Dickson e542b9
 /* This function will store one nfs filehandle in our global tree of
Steve Dickson e542b9
  * filehandles.
Steve Dickson e542b9
  * We store all filehandles we see in this tree so that every unique
Steve Dickson e542b9
@@ -8648,6 +8650,7 @@ dissect_nfs_argop4(tvbuff_t *tvb, int of
Steve Dickson e542b9
 	proto_item *fitem;
Steve Dickson e542b9
 	proto_tree *ftree = NULL;
Steve Dickson e542b9
 	proto_tree *newftree = NULL;
Steve Dickson e542b9
+	int cbprog;
Steve Dickson e542b9
 
Steve Dickson e542b9
 	ops = tvb_get_ntohl(tvb, offset+0);
Steve Dickson e542b9
 
Steve Dickson e542b9
@@ -8969,6 +8972,8 @@ dissect_nfs_argop4(tvbuff_t *tvb, int of
Steve Dickson e542b9
 					hf_nfs_create_session_flags4, offset);
Steve Dickson e542b9
 			offset = dissect_rpc_chanattrs4(tvb, offset, newftree);
Steve Dickson e542b9
 			offset = dissect_rpc_chanattrs4(tvb, offset, newftree);
Steve Dickson e542b9
+			cbprog = tvb_get_ntohl(tvb, offset);
Steve Dickson e542b9
+			reg_callback(cbprog);
Steve Dickson e542b9
 			offset = dissect_rpc_uint32(tvb, newftree,
Steve Dickson e542b9
 					hf_nfs_cb_program, offset);
Steve Dickson e542b9
 			offset = dissect_rpc_secparms4(tvb, offset, newftree);
Steve Dickson e542b9
@@ -9612,6 +9617,313 @@ static const value_string layoutreturn_n
Steve Dickson e542b9
 	{ 0, NULL }
Steve Dickson e542b9
 };
Steve Dickson e542b9
 
Steve Dickson e542b9
+static const value_string layoutrecall_names[] = {
Steve Dickson e542b9
+	{ 1, "RECALL_FILE"},
Steve Dickson e542b9
+	{ 2, "RECALL_FSID"},
Steve Dickson e542b9
+	{ 3, "RECALL_ALL"},
Steve Dickson e542b9
+	{ 0, NULL }
Steve Dickson e542b9
+};
Steve Dickson e542b9
+
Steve Dickson e542b9
+/* NFS Callback */
Steve Dickson e542b9
+static int hf_nfs_cb_procedure = -1;
Steve Dickson e542b9
+static int hf_nfs_cb_argop = -1;
Steve Dickson e542b9
+static int hf_nfs_cb_resop = -1;
Steve Dickson e542b9
+static int hf_nfs_cb_truncate = -1;
Steve Dickson e542b9
+static int hf_nfs_cb_layoutrecall_type = -1;
Steve Dickson e542b9
+static int hf_nfs_cb_clorachanged = -1;
Steve Dickson e542b9
+
Steve Dickson e542b9
+static gint ett_nfs_cb_argop = -1;
Steve Dickson e542b9
+static gint ett_nfs_cb_resop = -1;
Steve Dickson e542b9
+static gint ett_nfs_cb_getattr = -1;
Steve Dickson e542b9
+static gint ett_nfs_cb_recall = -1;
Steve Dickson e542b9
+static gint ett_nfs_cb_layoutrecall = -1;
Steve Dickson e542b9
+static gint ett_nfs_cb_pushdeleg = -1;
Steve Dickson e542b9
+static gint ett_nfs_cb_recallany = -1;
Steve Dickson e542b9
+static gint ett_nfs_cb_recallableobjavail = -1;
Steve Dickson e542b9
+static gint ett_nfs_cb_recallslot = -1;
Steve Dickson e542b9
+static gint ett_nfs_cb_sequence = -1;
Steve Dickson e542b9
+static gint ett_nfs_cb_wantscancelled = -1;
Steve Dickson e542b9
+static gint ett_nfs_cb_notifylock = -1;
Steve Dickson e542b9
+static gint ett_nfs_cb_notifydeviceid = -1;
Steve Dickson e542b9
+static gint ett_nfs_cb_notify = -1;
Steve Dickson e542b9
+static gint ett_nfs_cb_illegal = -1;
Steve Dickson e542b9
+
Steve Dickson e542b9
+static const value_string names_nfs_cb_operation[] = {
Steve Dickson e542b9
+        {       NFS4_OP_CB_GETATTR,                             "CB_GETATTR" },
Steve Dickson e542b9
+        {       NFS4_OP_CB_RECALL,                              "CB_RECALL"     },
Steve Dickson e542b9
+        {       NFS4_OP_CB_LAYOUTRECALL,                        "CB_LAYOUTRECALL" },
Steve Dickson e542b9
+        {       NFS4_OP_CB_NOTIFY,                              "CB_NOTIFY" },
Steve Dickson e542b9
+        {       NFS4_OP_CB_PUSH_DELEG,                          "CB_PUSH_DELEG" },
Steve Dickson e542b9
+        {       NFS4_OP_CB_RECALL_ANY,                          "CB_RECALL_ANY" },
Steve Dickson e542b9
+        {       NFS4_OP_CB_RECALLABLE_OBJ_AVAIL,                "CB_RECALLABLE_OBJ_AVAIL" },
Steve Dickson e542b9
+        {       NFS4_OP_CB_RECALL_SLOT,                         "CB_RECALL_SLOT"},
Steve Dickson e542b9
+        {       NFS4_OP_CB_SEQUENCE,                            "CB_SEQUENCE"   },
Steve Dickson e542b9
+        {       NFS4_OP_CB_WANTS_CANCELLED,                     "CB_WANTS_CANCELLED" },
Steve Dickson e542b9
+        {       NFS4_OP_CB_NOTIFY_LOCK,                         "CB_NOTIFY_LOCK"},
Steve Dickson e542b9
+        {       NFS4_OP_CB_NOTIFY_DEVICEID,                     "CB_NOTIFY_DEVICEID"    },
Steve Dickson e542b9
+        {       NFS4_OP_CB_ILLEGAL,                             "CB_ILLEGAL"},
Steve Dickson e542b9
+        {       0,      NULL }
Steve Dickson e542b9
+};
Steve Dickson e542b9
+
Steve Dickson e542b9
+gint *nfs_cb_operation_ett[] =
Steve Dickson e542b9
+{
Steve Dickson e542b9
+         &ett_nfs_cb_getattr,
Steve Dickson e542b9
+         &ett_nfs_cb_recall,
Steve Dickson e542b9
+         &ett_nfs_cb_layoutrecall,
Steve Dickson e542b9
+         &ett_nfs_cb_notify,
Steve Dickson e542b9
+         &ett_nfs_cb_pushdeleg,
Steve Dickson e542b9
+         &ett_nfs_cb_recallany,
Steve Dickson e542b9
+         &ett_nfs_cb_recallableobjavail,
Steve Dickson e542b9
+         &ett_nfs_cb_recallslot,
Steve Dickson e542b9
+         &ett_nfs_cb_sequence,
Steve Dickson e542b9
+         &ett_nfs_cb_wantscancelled,
Steve Dickson e542b9
+         &ett_nfs_cb_notifylock,
Steve Dickson e542b9
+         &ett_nfs_cb_notifydeviceid,
Steve Dickson e542b9
+         &ett_nfs_cb_illegal
Steve Dickson e542b9
+};
Steve Dickson e542b9
+
Steve Dickson e542b9
+static int
Steve Dickson e542b9
+dissect_nfs_cb_layoutrecall(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo)
Steve Dickson e542b9
+{
Steve Dickson e542b9
+	guint recalltype = hf_nfs_layouttype4;
Steve Dickson e542b9
+
Steve Dickson e542b9
+	if (recalltype == 1) { /* RETURN_FILE */
Steve Dickson e542b9
+		offset = dissect_nfs_fh4(tvb, offset, pinfo, tree, "filehandle");  
Steve Dickson e542b9
+		offset = dissect_rpc_uint64(tvb, tree, hf_nfs_offset4, offset);
Steve Dickson e542b9
+		offset = dissect_rpc_uint64(tvb, tree, hf_nfs_length4, offset);
Steve Dickson e542b9
+		offset = dissect_nfs_stateid4(tvb, offset, tree);
Steve Dickson e542b9
+	} else if (recalltype == 2) { /* RETURN_FSID */
Steve Dickson e542b9
+		offset = dissect_nfs_fsid4(tvb, offset, tree, "fsid");
Steve Dickson e542b9
+	}
Steve Dickson e542b9
+
Steve Dickson e542b9
+	return offset;
Steve Dickson e542b9
+}
Steve Dickson e542b9
+
Steve Dickson e542b9
+static int
Steve Dickson e542b9
+dissect_nfs_cb_argop(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
Steve Dickson e542b9
+{
Steve Dickson e542b9
+	guint32 ops, ops_counter;
Steve Dickson e542b9
+	guint opcode;
Steve Dickson e542b9
+	proto_item *fitem;
Steve Dickson e542b9
+	proto_tree *ftree = NULL;
Steve Dickson e542b9
+	proto_tree *newftree = NULL;
Steve Dickson e542b9
+
Steve Dickson e542b9
+	ops = tvb_get_ntohl(tvb, offset+0);
Steve Dickson e542b9
+
Steve Dickson e542b9
+	fitem = proto_tree_add_text(tree, tvb, offset, 4, "Operations (count: %u)", ops);
Steve Dickson e542b9
+        offset += 4;
Steve Dickson e542b9
+
Steve Dickson e542b9
+	if (fitem)
Steve Dickson e542b9
+	  	ftree = proto_item_add_subtree(fitem, ett_nfs_cb_argop);
Steve Dickson e542b9
+
Steve Dickson e542b9
+	for (ops_counter=0; ops_counter
Steve Dickson e542b9
+	{
Steve Dickson e542b9
+		opcode = tvb_get_ntohl(tvb, offset);
Steve Dickson e542b9
+		if (check_col(pinfo->cinfo, COL_INFO))
Steve Dickson e542b9
+		  col_append_fstr(pinfo->cinfo, COL_INFO, "%c%s", ops_counter==0?' ':';',
Steve Dickson e542b9
+				  val_to_str(opcode, names_nfs_cb_operation, "Unknown"));
Steve Dickson e542b9
+
Steve Dickson e542b9
+		fitem = proto_tree_add_uint(ftree, hf_nfs_cb_argop, tvb, offset, 4, opcode);
Steve Dickson e542b9
+		offset += 4;
Steve Dickson e542b9
+
Steve Dickson e542b9
+	/* the opcodes are not contiguous */
Steve Dickson e542b9
+		if ((opcode < NFS4_OP_CB_GETATTR || opcode > NFS4_OP_CB_NOTIFY_DEVICEID) &&
Steve Dickson e542b9
+		    (opcode != NFS4_OP_CB_ILLEGAL))
Steve Dickson e542b9
+		  	break;
Steve Dickson e542b9
+
Steve Dickson e542b9
+	/* all of the V4 ops are contiguous, except for NFS4_OP_ILLEGAL */
Steve Dickson e542b9
+		if (opcode == NFS4_OP_CB_ILLEGAL)
Steve Dickson e542b9
+		  	newftree = proto_item_add_subtree(fitem, ett_nfs_cb_illegal);
Steve Dickson e542b9
+		else if (nfs_cb_operation_ett[opcode - 3])
Steve Dickson e542b9
+		  	newftree = proto_item_add_subtree(fitem, *nfs_cb_operation_ett[opcode - 3]);
Steve Dickson e542b9
+		else
Steve Dickson e542b9
+		  	break;
Steve Dickson e542b9
+  
Steve Dickson e542b9
+		switch (opcode)  
Steve Dickson e542b9
+		{
Steve Dickson e542b9
+		case NFS4_OP_CB_RECALL:
Steve Dickson e542b9
+		  	offset = dissect_nfs_stateid4(tvb, offset, newftree);
Steve Dickson e542b9
+			offset = dissect_rpc_bool(tvb, newftree, hf_nfs_cb_truncate, offset);
Steve Dickson e542b9
+			offset = dissect_nfs_fh4(tvb, offset, pinfo, newftree, "filehandle");
Steve Dickson e542b9
+			break;
Steve Dickson e542b9
+		case NFS4_OP_CB_GETATTR:
Steve Dickson e542b9
+		case NFS4_OP_CB_LAYOUTRECALL:
Steve Dickson e542b9
+		  	offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_layouttype4, offset);
Steve Dickson e542b9
+			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_iomode4, offset);
Steve Dickson e542b9
+			offset = dissect_rpc_bool(tvb, newftree, hf_nfs_cb_clorachanged, offset);
Steve Dickson e542b9
+			offset = dissect_nfs_cb_layoutrecall(tvb, offset, newftree, pinfo);
Steve Dickson e542b9
+			break;
Steve Dickson e542b9
+		case NFS4_OP_CB_NOTIFY:
Steve Dickson e542b9
+		case NFS4_OP_CB_PUSH_DELEG:
Steve Dickson e542b9
+		case NFS4_OP_CB_RECALL_ANY:
Steve Dickson e542b9
+		case NFS4_OP_CB_RECALLABLE_OBJ_AVAIL:
Steve Dickson e542b9
+		case NFS4_OP_CB_RECALL_SLOT:
Steve Dickson e542b9
+		  break;
Steve Dickson e542b9
+		case NFS4_OP_CB_SEQUENCE:
Steve Dickson e542b9
+			offset = dissect_rpc_opaque_data(tvb, offset, newftree, NULL, hf_nfs_sessionid4, 
Steve Dickson e542b9
+							 TRUE, 16, FALSE, NULL, NULL);
Steve Dickson e542b9
+			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_seqid4, offset);
Steve Dickson e542b9
+			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_slotid4, offset);
Steve Dickson e542b9
+			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_slotid4, offset);
Steve Dickson e542b9
+			offset = dissect_rpc_bool(tvb, newftree, hf_nfs_cachethis4, offset);
Steve Dickson e542b9
+			/* skip refs -- assume 0 */
Steve Dickson e542b9
+			offset = offset + 4;
Steve Dickson e542b9
+			break;
Steve Dickson e542b9
+		case NFS4_OP_CB_WANTS_CANCELLED:
Steve Dickson e542b9
+		case NFS4_OP_CB_NOTIFY_LOCK:
Steve Dickson e542b9
+		case NFS4_OP_CB_NOTIFY_DEVICEID:
Steve Dickson e542b9
+		  	break;                        
Steve Dickson e542b9
+		case NFS4_OP_ILLEGAL:
Steve Dickson e542b9
+		  	break;
Steve Dickson e542b9
+		default:
Steve Dickson e542b9
+		  	break;
Steve Dickson e542b9
+		}
Steve Dickson e542b9
+	}
Steve Dickson e542b9
+
Steve Dickson e542b9
+	return offset;
Steve Dickson e542b9
+}
Steve Dickson e542b9
+
Steve Dickson e542b9
+static int
Steve Dickson e542b9
+dissect_nfs_cb_compound_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree* tree)
Steve Dickson e542b9
+{
Steve Dickson e542b9
+	char *tag=NULL;
Steve Dickson e542b9
+
Steve Dickson e542b9
+	offset = dissect_nfs_utf8string(tvb, offset, tree, hf_nfs_tag4, &tag;;
Steve Dickson e542b9
+
Steve Dickson e542b9
+	if (check_col(pinfo->cinfo, COL_INFO))
Steve Dickson e542b9
+		  col_append_fstr(pinfo->cinfo, COL_INFO," %s", tag);
Steve Dickson e542b9
+
Steve Dickson e542b9
+	offset = dissect_rpc_uint32(tvb, tree, hf_nfs_minorversion, offset);
Steve Dickson e542b9
+	offset = dissect_rpc_uint32(tvb, tree, hf_nfs_callback_ident, offset);
Steve Dickson e542b9
+	offset = dissect_nfs_cb_argop(tvb, offset, pinfo, tree);
Steve Dickson e542b9
+
Steve Dickson e542b9
+	return offset;
Steve Dickson e542b9
+}
Steve Dickson e542b9
+
Steve Dickson e542b9
+static int
Steve Dickson e542b9
+dissect_nfs_cb_resop(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
Steve Dickson e542b9
+{
Steve Dickson e542b9
+  	guint32 ops, ops_counter;
Steve Dickson e542b9
+	guint32 opcode;
Steve Dickson e542b9
+	proto_item *fitem;
Steve Dickson e542b9
+	proto_tree *ftree = NULL;
Steve Dickson e542b9
+	proto_tree *newftree = NULL;
Steve Dickson e542b9
+	guint32 status;
Steve Dickson e542b9
+
Steve Dickson e542b9
+	ops = tvb_get_ntohl(tvb, offset+0);
Steve Dickson e542b9
+	fitem = proto_tree_add_text(tree, tvb, offset, 4, "Operations (count: %u)", ops);
Steve Dickson e542b9
+	offset += 4;
Steve Dickson e542b9
+
Steve Dickson e542b9
+	if (fitem)
Steve Dickson e542b9
+	  	ftree = proto_item_add_subtree(fitem, ett_nfs_cb_resop);	
Steve Dickson e542b9
+
Steve Dickson e542b9
+	for (ops_counter = 0; ops_counter < ops; ops_counter++)
Steve Dickson e542b9
+	{
Steve Dickson e542b9
+		opcode = tvb_get_ntohl(tvb, offset);
Steve Dickson e542b9
+
Steve Dickson e542b9
+	/* sanity check for bogus packets */
Steve Dickson e542b9
+		if ((opcode < NFS4_OP_CB_GETATTR || opcode > NFS4_OP_CB_NOTIFY_DEVICEID) &&
Steve Dickson e542b9
+		    (opcode != NFS4_OP_ILLEGAL))
Steve Dickson e542b9
+			break;
Steve Dickson e542b9
+	  
Steve Dickson e542b9
+		if (check_col(pinfo->cinfo, COL_INFO))
Steve Dickson e542b9
+			col_append_fstr(pinfo->cinfo, COL_INFO, "%c%s",	ops_counter==0?' ':';',
Steve Dickson e542b9
+					val_to_str(opcode, names_nfs_cb_operation, "Unknown"));
Steve Dickson e542b9
+	  
Steve Dickson e542b9
+		fitem = proto_tree_add_uint(ftree, hf_nfs_cb_resop, tvb, offset, 4, opcode);
Steve Dickson e542b9
+		offset += 4;
Steve Dickson e542b9
+	  
Steve Dickson e542b9
+	  /* all of the V4 ops are contiguous, except for NFS4_OP_ILLEGAL */
Steve Dickson e542b9
+		if (opcode == NFS4_OP_ILLEGAL)
Steve Dickson e542b9
+		  newftree = proto_item_add_subtree(fitem, ett_nfs_illegal4);
Steve Dickson e542b9
+		else if (nfs_cb_operation_ett[opcode - 3])
Steve Dickson e542b9
+		  newftree = proto_item_add_subtree(fitem, *nfs_cb_operation_ett[opcode - 3]);
Steve Dickson e542b9
+		else
Steve Dickson e542b9
+		  break;
Steve Dickson e542b9
+
Steve Dickson e542b9
+		offset = dissect_nfs_nfsstat4(tvb, offset, newftree, &status);
Steve Dickson e542b9
+	  
Steve Dickson e542b9
+	  /* are there any ops that return data with a failure (?) */	   
Steve Dickson e542b9
+		if (status != NFS4_OK)
Steve Dickson e542b9
+			continue;
Steve Dickson e542b9
+
Steve Dickson e542b9
+	  /* These parsing routines are only executed if the status is NFS4_OK */
Steve Dickson e542b9
+		switch (opcode) 
Steve Dickson e542b9
+		{
Steve Dickson e542b9
+		case NFS4_OP_CB_RECALL:
Steve Dickson e542b9
+			break;
Steve Dickson e542b9
+		case NFS4_OP_CB_GETATTR:
Steve Dickson e542b9
+		case NFS4_OP_CB_LAYOUTRECALL:
Steve Dickson e542b9
+		    	break;
Steve Dickson e542b9
+		case NFS4_OP_CB_NOTIFY:
Steve Dickson e542b9
+		case NFS4_OP_CB_PUSH_DELEG:
Steve Dickson e542b9
+		case NFS4_OP_CB_RECALL_ANY:
Steve Dickson e542b9
+		case NFS4_OP_CB_RECALLABLE_OBJ_AVAIL:
Steve Dickson e542b9
+		case NFS4_OP_CB_RECALL_SLOT:
Steve Dickson e542b9
+			break;
Steve Dickson e542b9
+		case NFS4_OP_CB_SEQUENCE:
Steve Dickson e542b9
+			offset = dissect_rpc_opaque_data(tvb, offset, newftree, NULL,
Steve Dickson e542b9
+							 hf_nfs_sessionid4, TRUE, 16,
Steve Dickson e542b9
+							 FALSE, NULL, NULL);
Steve Dickson e542b9
+			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_seqid4, offset);
Steve Dickson e542b9
+			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_slotid4, offset);
Steve Dickson e542b9
+			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_slotid4, offset);
Steve Dickson e542b9
+			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_slotid4, offset);
Steve Dickson e542b9
+			break;
Steve Dickson e542b9
+		case NFS4_OP_CB_WANTS_CANCELLED:
Steve Dickson e542b9
+		case NFS4_OP_CB_NOTIFY_LOCK:
Steve Dickson e542b9
+		case NFS4_OP_CB_NOTIFY_DEVICEID:
Steve Dickson e542b9
+		    	break;
Steve Dickson e542b9
+		case NFS4_OP_ILLEGAL:
Steve Dickson e542b9
+			break;		  
Steve Dickson e542b9
+		default:
Steve Dickson e542b9
+		    	break;
Steve Dickson e542b9
+		  }
Steve Dickson e542b9
+	}
Steve Dickson e542b9
+
Steve Dickson e542b9
+	return offset;
Steve Dickson e542b9
+}
Steve Dickson e542b9
+
Steve Dickson e542b9
+static int
Steve Dickson e542b9
+dissect_nfs_cb_compound_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
Steve Dickson e542b9
+	proto_tree* tree)
Steve Dickson e542b9
+{
Steve Dickson e542b9
+	guint32 status;
Steve Dickson e542b9
+	char *tag=NULL;
Steve Dickson e542b9
+
Steve Dickson e542b9
+	offset = dissect_nfs_nfsstat4(tvb, offset, tree, &status);
Steve Dickson e542b9
+	offset = dissect_nfs_utf8string(tvb, offset, tree, hf_nfs_tag4, &tag;;
Steve Dickson e542b9
+	if (check_col(pinfo->cinfo, COL_INFO))
Steve Dickson e542b9
+		col_append_fstr(pinfo->cinfo, COL_INFO," %s", tag);
Steve Dickson e542b9
+
Steve Dickson e542b9
+	offset = dissect_nfs_cb_resop(tvb, offset, pinfo, tree);
Steve Dickson e542b9
+
Steve Dickson e542b9
+	return offset;
Steve Dickson e542b9
+}
Steve Dickson e542b9
+
Steve Dickson e542b9
+static const vsff nfs_cb_proc[] = {
Steve Dickson e542b9
+        { 0, "CB_NULL",
Steve Dickson e542b9
+	  dissect_nfs3_null_call, dissect_nfs3_null_reply },
Steve Dickson e542b9
+        { 1, "CB_COMPOUND",
Steve Dickson e542b9
+	  dissect_nfs_cb_compound_call, dissect_nfs_cb_compound_reply },
Steve Dickson e542b9
+        { 0, NULL, NULL, NULL }
Steve Dickson e542b9
+};
Steve Dickson e542b9
+
Steve Dickson e542b9
+static const value_string nfs_cb_proc_vals[] = {
Steve Dickson e542b9
+        { 0, "CB_NULL" },
Steve Dickson e542b9
+        { 1, "CB_COMPOUND" },
Steve Dickson e542b9
+        { 0, NULL }
Steve Dickson e542b9
+};
Steve Dickson e542b9
+
Steve Dickson e542b9
+void reg_callback(int cbprog) 
Steve Dickson e542b9
+{
Steve Dickson e542b9
+	/* Register the protocol as RPC */
Steve Dickson e542b9
+	rpc_init_prog(proto_nfs, cbprog, ett_nfs);
Steve Dickson e542b9
+	
Steve Dickson e542b9
+	/* Register the procedure tables */
Steve Dickson e542b9
+	rpc_init_proc_table(cbprog, 1, nfs_cb_proc, hf_nfs_cb_procedure);
Steve Dickson e542b9
+}
Steve Dickson e542b9
+
Steve Dickson e542b9
 void
Steve Dickson e542b9
 proto_register_nfs(void)
Steve Dickson e542b9
 {
Steve Dickson e542b9
@@ -10964,10 +11276,29 @@ proto_register_nfs(void)
Steve Dickson e542b9
 		{ &hf_nfs_cachethis4, {
Steve Dickson e542b9
 			"Cache this?", "nfs.cachethis4", FT_BOOLEAN, BASE_NONE,
Steve Dickson e542b9
 			TFS(&tfs_yes_no), 0, NULL, HFILL }},
Steve Dickson e542b9
-
Steve Dickson e542b9
+		 
Steve Dickson e542b9
+		{ &hf_nfs_cb_procedure, {
Steve Dickson e542b9
+		   "CB Procedure", "nfs.cb_procedure", FT_UINT32, BASE_DEC,
Steve Dickson e542b9
+		VALS(nfs_cb_proc_vals), 0, NULL, HFILL }},	
Steve Dickson e542b9
+		
Steve Dickson e542b9
+		{	  &hf_nfs_cb_argop, {
Steve Dickson e542b9
+		    "Opcode", "nfs.call.operation", FT_UINT32, BASE_DEC,
Steve Dickson e542b9
+		      VALS(names_nfs_cb_operation), 0, NULL, HFILL }},
Steve Dickson e542b9
+		  { &hf_nfs_cb_resop, {
Steve Dickson e542b9
+		      "Opcode", "nfs.reply.operation", FT_UINT32, BASE_DEC,
Steve Dickson e542b9
+			VALS(names_nfs_cb_operation), 0, NULL, HFILL }},	
Steve Dickson e542b9
 		{ &hf_nfs_lrs_present, {
Steve Dickson e542b9
 			"Stateid present?", "nfs.lrs_present", FT_BOOLEAN, BASE_NONE,
Steve Dickson e542b9
 			TFS(&tfs_yes_no), 0, NULL, HFILL }},
Steve Dickson e542b9
+		{ &hf_nfs_cb_truncate, {
Steve Dickson e542b9
+		    "Truncate?", "nfs.truncate", FT_BOOLEAN, BASE_NONE,
Steve Dickson e542b9
+		    TFS(&tfs_yes_no), 0, NULL, HFILL }},
Steve Dickson e542b9
+		{ &hf_nfs_cb_layoutrecall_type, {
Steve Dickson e542b9
+			"recall type", "nfs.recalltype", FT_UINT32, BASE_DEC,
Steve Dickson e542b9
+			VALS(layoutrecall_names), 0, NULL, HFILL }},
Steve Dickson e542b9
+		{ &hf_nfs_cb_clorachanged, {
Steve Dickson e542b9
+			"Clora changed", "nfs.clorachanged", FT_BOOLEAN, BASE_NONE,
Steve Dickson e542b9
+			TFS(&tfs_yes_no), 0, NULL, HFILL }},
Steve Dickson e542b9
 
Steve Dickson e542b9
 	/* Hidden field for v2, v3, and v4 status */
Steve Dickson e542b9
 		{ &hf_nfs_nfsstat, {
Steve Dickson e542b9
@@ -11132,8 +11463,23 @@ proto_register_nfs(void)
Steve Dickson e542b9
 		&ett_nfs_gid4,
Steve Dickson e542b9
 		&ett_nfs_service4,
Steve Dickson e542b9
 		&ett_nfs_sessionid4,
Steve Dickson e542b9
-		&ett_nfs_layoutseg,
Steve Dickson e542b9
-		&ett_nfs_layoutseg_fh
Steve Dickson e542b9
+		&ett_nfs_layoutseg,		
Steve Dickson e542b9
+		&ett_nfs_layoutseg_fh,
Steve Dickson e542b9
+		&ett_nfs_cb_argop,
Steve Dickson e542b9
+		&ett_nfs_cb_resop,
Steve Dickson e542b9
+		&ett_nfs_cb_getattr,
Steve Dickson e542b9
+		&ett_nfs_cb_recall,
Steve Dickson e542b9
+		&ett_nfs_cb_layoutrecall,
Steve Dickson e542b9
+		&ett_nfs_cb_pushdeleg,
Steve Dickson e542b9
+		&ett_nfs_cb_recallany,
Steve Dickson e542b9
+		&ett_nfs_cb_recallableobjavail,
Steve Dickson e542b9
+		&ett_nfs_cb_recallslot,
Steve Dickson e542b9
+		&ett_nfs_cb_sequence,
Steve Dickson e542b9
+		&ett_nfs_cb_wantscancelled,
Steve Dickson e542b9
+		&ett_nfs_cb_notifylock,
Steve Dickson e542b9
+		&ett_nfs_cb_notifydeviceid,
Steve Dickson e542b9
+		&ett_nfs_cb_notify,
Steve Dickson e542b9
+		&ett_nfs_cb_illegal,
Steve Dickson e542b9
 	};
Steve Dickson e542b9
 	module_t *nfs_module;
Steve Dickson e542b9
 
Steve Dickson e542b9
@@ -11169,9 +11515,9 @@ proto_register_nfs(void)
Steve Dickson e542b9
 	nfs_file_handles=se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "nfs_file_handles");
Steve Dickson e542b9
 	nfs_fhandle_frame_table=se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "nfs_fhandle_frame_table");
Steve Dickson e542b9
 	register_init_routine(nfs_name_snoop_init);
Steve Dickson e542b9
-
Steve Dickson e542b9
 }
Steve Dickson e542b9
 
Steve Dickson e542b9
+
Steve Dickson e542b9
 void
Steve Dickson e542b9
 proto_reg_handoff_nfs(void)
Steve Dickson e542b9
 {
Steve Dickson e542b9
@@ -11179,7 +11525,7 @@ proto_reg_handoff_nfs(void)
Steve Dickson e542b9
 
Steve Dickson e542b9
 	/* Register the protocol as RPC */
Steve Dickson e542b9
 	rpc_init_prog(proto_nfs, NFS_PROGRAM, ett_nfs);
Steve Dickson e542b9
-
Steve Dickson e542b9
+	
Steve Dickson e542b9
 	/* Register the procedure tables */
Steve Dickson e542b9
 	rpc_init_proc_table(NFS_PROGRAM, 2, nfs2_proc, hf_nfs_procedure_v2);
Steve Dickson e542b9
 	rpc_init_proc_table(NFS_PROGRAM, 3, nfs3_proc, hf_nfs_procedure_v3);
Steve Dickson e542b9
@@ -11208,7 +11554,4 @@ proto_reg_handoff_nfs(void)
Steve Dickson e542b9
 
Steve Dickson e542b9
 	fhandle_handle=create_dissector_handle(dissect_fhandle_data_unknown, proto_nfs);
Steve Dickson e542b9
 	dissector_add("nfs_fhandle.type", FHT_UNKNOWN, fhandle_handle);
Steve Dickson e542b9
-
Steve Dickson e542b9
-
Steve Dickson e542b9
 }
Steve Dickson e542b9
-
Steve Dickson e542b9
diff -up wireshark-1.1.2/epan/dissectors/packet-nfs.h.orig wireshark-1.1.2/epan/dissectors/packet-nfs.h
Steve Dickson e542b9
--- wireshark-1.1.2/epan/dissectors/packet-nfs.h.orig	2009-01-15 10:28:17.000000000 -0500
Steve Dickson e542b9
+++ wireshark-1.1.2/epan/dissectors/packet-nfs.h	2009-02-15 08:31:28.000000000 -0500
Steve Dickson e542b9
@@ -127,6 +127,23 @@
Steve Dickson e542b9
 
Steve Dickson e542b9
 #define NFS4_OP_ILLEGAL						10044
Steve Dickson e542b9
 
Steve Dickson e542b9
+/*
Steve Dickson e542b9
+ * NFSv41 callback ops
Steve Dickson e542b9
+ */
Steve Dickson e542b9
+#define NFS4_OP_CB_GETATTR						3
Steve Dickson e542b9
+#define NFS4_OP_CB_RECALL						4
Steve Dickson e542b9
+#define NFS4_OP_CB_LAYOUTRECALL						5
Steve Dickson e542b9
+#define NFS4_OP_CB_NOTIFY						6
Steve Dickson e542b9
+#define NFS4_OP_CB_PUSH_DELEG						7
Steve Dickson e542b9
+#define NFS4_OP_CB_RECALL_ANY						8
Steve Dickson e542b9
+#define NFS4_OP_CB_RECALLABLE_OBJ_AVAIL					9
Steve Dickson e542b9
+#define NFS4_OP_CB_RECALL_SLOT						10
Steve Dickson e542b9
+#define NFS4_OP_CB_SEQUENCE						11
Steve Dickson e542b9
+#define NFS4_OP_CB_WANTS_CANCELLED					12
Steve Dickson e542b9
+#define NFS4_OP_CB_NOTIFY_LOCK						13
Steve Dickson e542b9
+#define NFS4_OP_CB_NOTIFY_DEVICEID					14
Steve Dickson e542b9
+#define NFS4_OP_CB_ILLEGAL						10044
Steve Dickson e542b9
+
Steve Dickson e542b9
 /* for write */
Steve Dickson e542b9
 #define UNSTABLE 0
Steve Dickson e542b9
 #define DATA_SYNC 1