2000-05-31 05:09:07 +00:00
|
|
|
/* packet-afs.c
|
|
|
|
* Routines for AFS packet dissection
|
1999-10-20 16:41:20 +00:00
|
|
|
* Copyright 1999, Nathan Neulinger <nneul@umr.edu>
|
|
|
|
* Based on routines from tcpdump patches by
|
|
|
|
* Ken Hornstein <kenh@cmf.nrl.navy.mil>
|
|
|
|
* Portions based on information retrieved from the RX definitions
|
|
|
|
* in Arla, the free AFS client at http://www.stacken.kth.se/project/arla/
|
2000-11-03 17:32:51 +00:00
|
|
|
* Portions based on information/specs retrieved from the OpenAFS sources at
|
2002-08-28 21:04:11 +00:00
|
|
|
* www.openafs.org, Copyright IBM.
|
1999-10-20 16:41:20 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1999-10-20 16:41:20 +00:00
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
2001-05-27 05:00:17 +00:00
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
1999-10-20 16:41:20 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* Copied from packet-tftp.c
|
|
|
|
*
|
|
|
|
* 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 <stdio.h>
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <glib.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/conversation.h>
|
2004-08-06 19:57:49 +00:00
|
|
|
#include <epan/addr_resolv.h>
|
2005-08-13 00:03:12 +00:00
|
|
|
#include <epan/emem.h>
|
1999-10-20 16:41:20 +00:00
|
|
|
|
2000-11-03 17:32:51 +00:00
|
|
|
#include "packet-rx.h"
|
|
|
|
#include "packet-afs.h"
|
|
|
|
#include "packet-afs-defs.h"
|
|
|
|
#include "packet-afs-macros.h"
|
1999-10-20 16:41:20 +00:00
|
|
|
|
2004-01-19 18:36:32 +00:00
|
|
|
#define GETSTR ((const char *)tvb_get_ptr(tvb,offset,tvb_ensure_length_remaining(tvb,offset)))
|
2001-05-27 01:48:25 +00:00
|
|
|
|
2001-04-02 19:10:06 +00:00
|
|
|
#define VALID_OPCODE(opcode) ((opcode >= OPCODE_LOW && opcode <= OPCODE_HIGH) || \
|
|
|
|
(opcode >= VOTE_LOW && opcode <= VOTE_HIGH) || \
|
|
|
|
(opcode >= DISK_LOW && opcode <= DISK_HIGH))
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
struct afs_request_key {
|
Generalize the "ip_src" and "ip_dst" members of the "packet_info"
structure to "dl_src"/"dl_dst", "net_src"/"net_dst", and "src"/"dst"
addresses, where an address is an address type, an address length in
bytes, and a pointer to that many bytes.
"dl_{src,dst}" are the link-layer source/destination; "net_{src,dst}"
are the network-layer source/destination; "{src,dst}" are the
source/destination from the highest of those two layers that we have in
the packet.
Add a port type to "packet_info" as well, specifying whether it's a TCP
or UDP port.
Don't set the address and port columns in the dissector functions; just
set the address and port members of the "packet_info" structure. Set
the columns in "fill_in_columns()"; this means that if we're showing
COL_{DEF,RES,UNRES}_SRC" or "COL_{DEF,RES,UNRES}_DST", we only generate
the string from "src" or "dst", we don't generate a string for the
link-layer address and then overwrite it with a string for the
network-layer address (generating those strings costs CPU).
Add support for "conversations", where a "conversation" is (at present)
a source and destination address and a source and destination port. (In
the future, we may support "conversations" above the transport layer,
e.g. a TFTP conversation, where the first packet goes from the client to
the TFTP server port, but the reply comes back from a different port,
and all subsequent packets go between the client address/port and the
server address/new port, or an NFS conversation, which might include
lock manager, status monitor, and mount packets, as well as NFS
packets.)
Currently, all we support is a call that takes the source and
destination address/port pairs, looks them up in a hash table, and:
if nothing is found, creates a new entry in the hash table, and
assigns it a unique 32-bit conversation ID, and returns that
conversation ID;
if an entry is found, returns its conversation ID.
Use that in the SMB and AFS code to keep track of individual SMB or AFS
conversations. We need to match up requests and replies, as, for
certain replies, the operation code for the request to which it's a
reply doesn't show up in the reply - you have to find the request with a
matching transaction ID. Transaction IDs are per-conversation, so the
hash table for requests should include a conversation ID and transaction
ID as the key.
This allows SMB and AFS decoders to handle IPv4 or IPv6 addresses
transparently (and should allow the SMB decoder to handle NetBIOS atop
other protocols as well, if the source and destination address and port
values in the "packet_info" structure are set appropriately).
In the "Follow TCP Connection" code, check to make sure that the
addresses are IPv4 addressses; ultimately, that code should be changed
to use the conversation code instead, which will let it handle IPv6
transparently.
svn path=/trunk/; revision=909
1999-10-22 07:18:23 +00:00
|
|
|
guint32 conversation, callnumber;
|
|
|
|
guint16 service;
|
1999-10-20 16:41:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct afs_request_val {
|
|
|
|
guint32 opcode;
|
2003-03-05 09:52:22 +00:00
|
|
|
guint req_num;
|
|
|
|
guint rep_num;
|
|
|
|
nstime_t req_time;
|
1999-10-20 16:41:20 +00:00
|
|
|
};
|
|
|
|
|
2002-05-10 23:20:38 +00:00
|
|
|
static GHashTable *afs_request_hash = NULL;
|
2000-11-03 17:32:51 +00:00
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
|
1999-10-20 16:41:20 +00:00
|
|
|
/*
|
|
|
|
* Dissector prototypes
|
|
|
|
*/
|
2002-08-28 21:04:11 +00:00
|
|
|
static int dissect_acl(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_fs_reply(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_fs_request(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_bos_reply(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_bos_request(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_vol_reply(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_vol_request(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_kauth_reply(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_kauth_request(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_cb_reply(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_cb_request(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_prot_reply(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_prot_request(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_vldb_reply(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_vldb_request(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_ubik_reply(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_ubik_request(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_backup_reply(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
2002-08-28 21:04:11 +00:00
|
|
|
static void dissect_backup_request(tvbuff_t *tvb, struct rxinfo *rxinfo,
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *tree, int offset, int opcode);
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
/*
|
2000-10-23 04:26:55 +00:00
|
|
|
* Hash Functions
|
1999-10-20 16:41:20 +00:00
|
|
|
*/
|
2000-10-23 04:26:55 +00:00
|
|
|
static gint
|
1999-10-20 16:41:20 +00:00
|
|
|
afs_equal(gconstpointer v, gconstpointer w)
|
|
|
|
{
|
2002-11-28 03:57:50 +00:00
|
|
|
const struct afs_request_key *v1 = (const struct afs_request_key *)v;
|
|
|
|
const struct afs_request_key *v2 = (const struct afs_request_key *)w;
|
1999-10-20 16:41:20 +00:00
|
|
|
|
Generalize the "ip_src" and "ip_dst" members of the "packet_info"
structure to "dl_src"/"dl_dst", "net_src"/"net_dst", and "src"/"dst"
addresses, where an address is an address type, an address length in
bytes, and a pointer to that many bytes.
"dl_{src,dst}" are the link-layer source/destination; "net_{src,dst}"
are the network-layer source/destination; "{src,dst}" are the
source/destination from the highest of those two layers that we have in
the packet.
Add a port type to "packet_info" as well, specifying whether it's a TCP
or UDP port.
Don't set the address and port columns in the dissector functions; just
set the address and port members of the "packet_info" structure. Set
the columns in "fill_in_columns()"; this means that if we're showing
COL_{DEF,RES,UNRES}_SRC" or "COL_{DEF,RES,UNRES}_DST", we only generate
the string from "src" or "dst", we don't generate a string for the
link-layer address and then overwrite it with a string for the
network-layer address (generating those strings costs CPU).
Add support for "conversations", where a "conversation" is (at present)
a source and destination address and a source and destination port. (In
the future, we may support "conversations" above the transport layer,
e.g. a TFTP conversation, where the first packet goes from the client to
the TFTP server port, but the reply comes back from a different port,
and all subsequent packets go between the client address/port and the
server address/new port, or an NFS conversation, which might include
lock manager, status monitor, and mount packets, as well as NFS
packets.)
Currently, all we support is a call that takes the source and
destination address/port pairs, looks them up in a hash table, and:
if nothing is found, creates a new entry in the hash table, and
assigns it a unique 32-bit conversation ID, and returns that
conversation ID;
if an entry is found, returns its conversation ID.
Use that in the SMB and AFS code to keep track of individual SMB or AFS
conversations. We need to match up requests and replies, as, for
certain replies, the operation code for the request to which it's a
reply doesn't show up in the reply - you have to find the request with a
matching transaction ID. Transaction IDs are per-conversation, so the
hash table for requests should include a conversation ID and transaction
ID as the key.
This allows SMB and AFS decoders to handle IPv4 or IPv6 addresses
transparently (and should allow the SMB decoder to handle NetBIOS atop
other protocols as well, if the source and destination address and port
values in the "packet_info" structure are set appropriately).
In the "Follow TCP Connection" code, check to make sure that the
addresses are IPv4 addressses; ultimately, that code should be changed
to use the conversation code instead, which will let it handle IPv6
transparently.
svn path=/trunk/; revision=909
1999-10-22 07:18:23 +00:00
|
|
|
if (v1 -> conversation == v2 -> conversation &&
|
|
|
|
v1 -> service == v2 -> service &&
|
1999-10-20 16:41:20 +00:00
|
|
|
v1 -> callnumber == v2 -> callnumber ) {
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2000-10-23 04:26:55 +00:00
|
|
|
static guint
|
1999-10-20 16:41:20 +00:00
|
|
|
afs_hash (gconstpointer v)
|
|
|
|
{
|
2002-11-28 03:57:50 +00:00
|
|
|
const struct afs_request_key *key = (const struct afs_request_key *)v;
|
1999-10-20 16:41:20 +00:00
|
|
|
guint val;
|
|
|
|
|
Generalize the "ip_src" and "ip_dst" members of the "packet_info"
structure to "dl_src"/"dl_dst", "net_src"/"net_dst", and "src"/"dst"
addresses, where an address is an address type, an address length in
bytes, and a pointer to that many bytes.
"dl_{src,dst}" are the link-layer source/destination; "net_{src,dst}"
are the network-layer source/destination; "{src,dst}" are the
source/destination from the highest of those two layers that we have in
the packet.
Add a port type to "packet_info" as well, specifying whether it's a TCP
or UDP port.
Don't set the address and port columns in the dissector functions; just
set the address and port members of the "packet_info" structure. Set
the columns in "fill_in_columns()"; this means that if we're showing
COL_{DEF,RES,UNRES}_SRC" or "COL_{DEF,RES,UNRES}_DST", we only generate
the string from "src" or "dst", we don't generate a string for the
link-layer address and then overwrite it with a string for the
network-layer address (generating those strings costs CPU).
Add support for "conversations", where a "conversation" is (at present)
a source and destination address and a source and destination port. (In
the future, we may support "conversations" above the transport layer,
e.g. a TFTP conversation, where the first packet goes from the client to
the TFTP server port, but the reply comes back from a different port,
and all subsequent packets go between the client address/port and the
server address/new port, or an NFS conversation, which might include
lock manager, status monitor, and mount packets, as well as NFS
packets.)
Currently, all we support is a call that takes the source and
destination address/port pairs, looks them up in a hash table, and:
if nothing is found, creates a new entry in the hash table, and
assigns it a unique 32-bit conversation ID, and returns that
conversation ID;
if an entry is found, returns its conversation ID.
Use that in the SMB and AFS code to keep track of individual SMB or AFS
conversations. We need to match up requests and replies, as, for
certain replies, the operation code for the request to which it's a
reply doesn't show up in the reply - you have to find the request with a
matching transaction ID. Transaction IDs are per-conversation, so the
hash table for requests should include a conversation ID and transaction
ID as the key.
This allows SMB and AFS decoders to handle IPv4 or IPv6 addresses
transparently (and should allow the SMB decoder to handle NetBIOS atop
other protocols as well, if the source and destination address and port
values in the "packet_info" structure are set appropriately).
In the "Follow TCP Connection" code, check to make sure that the
addresses are IPv4 addressses; ultimately, that code should be changed
to use the conversation code instead, which will let it handle IPv6
transparently.
svn path=/trunk/; revision=909
1999-10-22 07:18:23 +00:00
|
|
|
val = key -> conversation + key -> service + key -> callnumber;
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Protocol initialization
|
|
|
|
*/
|
Provide a general mechanism by which dissectors can register "init"
routines, which are called before a dissection pass is made over all the
packets in a capture - the "init" routine would clear out any state
information that needs to be initialized before such a dissection pass.
Make the NCP, SMB, AFS, and ONC RPC dissectors register their "init"
routines with that mechanism, have the code that reads in a capture file
call the routine that calls all registered "init" routines rather than
calling a wired-in set of "init" routines, and also have the code that
runs a filtering or colorizing pass over all the packets call that
routine, as a filtering or colorizing pass is a dissection pass.
Have the ONC RPC "init" routine zero out the table of RPC calls, so that
it completely erases any state from the previous dissection pass (so
that, for example, if you run a filtering pass, it doesn't mark any
non-duplicate packets as duplicates because it remembers them from the
previous pass).
svn path=/trunk/; revision=1050
1999-11-17 21:58:33 +00:00
|
|
|
static void
|
1999-10-20 16:41:20 +00:00
|
|
|
afs_init_protocol(void)
|
|
|
|
{
|
|
|
|
if (afs_request_hash)
|
|
|
|
g_hash_table_destroy(afs_request_hash);
|
|
|
|
|
|
|
|
afs_request_hash = g_hash_table_new(afs_hash, afs_equal);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Dissection routines
|
|
|
|
*/
|
|
|
|
|
2001-05-27 05:00:17 +00:00
|
|
|
static void
|
2001-05-27 01:48:25 +00:00
|
|
|
dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-11-03 00:58:52 +00:00
|
|
|
struct rxinfo *rxinfo = pinfo->private_data;
|
1999-10-20 16:41:20 +00:00
|
|
|
int reply = 0;
|
Export the data structure used to represent a conversation.
Replace "add_to_conversation()" with:
"conversation_new()", which creates a new conversation, given
source and destination addresses and ports, and returns a
pointer to the structure for the conversation;
"find_conversation()", which tries to find a conversation for
given source and destination addresses and ports, and returns a
pointer to the structure for the conversation if found, and a
null pointer if not found.
Add a private data pointer field to the conversation structure, and have
"conversation_new()" take an argument that specifies what to set that
pointer to; that lets clients of the conversation code hang arbitrary
data off the conversation (e.g., a hash table of protocol requests and
replies, in case the protocol is a request/reply protocol wherein the
reply doesn't say what type of request it's a reply to, and you need
that information to dissect the reply).
svn path=/trunk/; revision=920
1999-10-24 07:27:20 +00:00
|
|
|
conversation_t *conversation;
|
1999-10-20 16:41:20 +00:00
|
|
|
struct afs_request_key request_key, *new_request_key;
|
2003-03-05 09:52:22 +00:00
|
|
|
struct afs_request_val *request_val=NULL;
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree *afs_tree, *afs_op_tree, *ti;
|
|
|
|
int port, node, typenode, opcode;
|
|
|
|
value_string const *vals;
|
|
|
|
int offset = 0;
|
2003-03-05 09:52:22 +00:00
|
|
|
nstime_t ns;
|
|
|
|
|
2001-08-04 04:04:35 +00:00
|
|
|
void (*dissector)(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode);
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AFS (RX)");
|
2001-05-27 01:48:25 +00:00
|
|
|
}
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2001-05-27 01:48:25 +00:00
|
|
|
}
|
2000-11-02 18:45:15 +00:00
|
|
|
|
2001-08-04 04:04:35 +00:00
|
|
|
reply = (rxinfo->flags & RX_CLIENT_INITIATED) == 0;
|
2001-05-27 01:48:25 +00:00
|
|
|
port = ((reply == 0) ? pinfo->destport : pinfo->srcport );
|
1999-10-20 16:41:20 +00:00
|
|
|
|
Generalize the "ip_src" and "ip_dst" members of the "packet_info"
structure to "dl_src"/"dl_dst", "net_src"/"net_dst", and "src"/"dst"
addresses, where an address is an address type, an address length in
bytes, and a pointer to that many bytes.
"dl_{src,dst}" are the link-layer source/destination; "net_{src,dst}"
are the network-layer source/destination; "{src,dst}" are the
source/destination from the highest of those two layers that we have in
the packet.
Add a port type to "packet_info" as well, specifying whether it's a TCP
or UDP port.
Don't set the address and port columns in the dissector functions; just
set the address and port members of the "packet_info" structure. Set
the columns in "fill_in_columns()"; this means that if we're showing
COL_{DEF,RES,UNRES}_SRC" or "COL_{DEF,RES,UNRES}_DST", we only generate
the string from "src" or "dst", we don't generate a string for the
link-layer address and then overwrite it with a string for the
network-layer address (generating those strings costs CPU).
Add support for "conversations", where a "conversation" is (at present)
a source and destination address and a source and destination port. (In
the future, we may support "conversations" above the transport layer,
e.g. a TFTP conversation, where the first packet goes from the client to
the TFTP server port, but the reply comes back from a different port,
and all subsequent packets go between the client address/port and the
server address/new port, or an NFS conversation, which might include
lock manager, status monitor, and mount packets, as well as NFS
packets.)
Currently, all we support is a call that takes the source and
destination address/port pairs, looks them up in a hash table, and:
if nothing is found, creates a new entry in the hash table, and
assigns it a unique 32-bit conversation ID, and returns that
conversation ID;
if an entry is found, returns its conversation ID.
Use that in the SMB and AFS code to keep track of individual SMB or AFS
conversations. We need to match up requests and replies, as, for
certain replies, the operation code for the request to which it's a
reply doesn't show up in the reply - you have to find the request with a
matching transaction ID. Transaction IDs are per-conversation, so the
hash table for requests should include a conversation ID and transaction
ID as the key.
This allows SMB and AFS decoders to handle IPv4 or IPv6 addresses
transparently (and should allow the SMB decoder to handle NetBIOS atop
other protocols as well, if the source and destination address and port
values in the "packet_info" structure are set appropriately).
In the "Follow TCP Connection" code, check to make sure that the
addresses are IPv4 addressses; ultimately, that code should be changed
to use the conversation code instead, which will let it handle IPv6
transparently.
svn path=/trunk/; revision=909
1999-10-22 07:18:23 +00:00
|
|
|
/*
|
Export the data structure used to represent a conversation.
Replace "add_to_conversation()" with:
"conversation_new()", which creates a new conversation, given
source and destination addresses and ports, and returns a
pointer to the structure for the conversation;
"find_conversation()", which tries to find a conversation for
given source and destination addresses and ports, and returns a
pointer to the structure for the conversation if found, and a
null pointer if not found.
Add a private data pointer field to the conversation structure, and have
"conversation_new()" take an argument that specifies what to set that
pointer to; that lets clients of the conversation code hang arbitrary
data off the conversation (e.g., a hash table of protocol requests and
replies, in case the protocol is a request/reply protocol wherein the
reply doesn't say what type of request it's a reply to, and you need
that information to dissect the reply).
svn path=/trunk/; revision=920
1999-10-24 07:27:20 +00:00
|
|
|
* Find out what conversation this packet is part of.
|
Generalize the "ip_src" and "ip_dst" members of the "packet_info"
structure to "dl_src"/"dl_dst", "net_src"/"net_dst", and "src"/"dst"
addresses, where an address is an address type, an address length in
bytes, and a pointer to that many bytes.
"dl_{src,dst}" are the link-layer source/destination; "net_{src,dst}"
are the network-layer source/destination; "{src,dst}" are the
source/destination from the highest of those two layers that we have in
the packet.
Add a port type to "packet_info" as well, specifying whether it's a TCP
or UDP port.
Don't set the address and port columns in the dissector functions; just
set the address and port members of the "packet_info" structure. Set
the columns in "fill_in_columns()"; this means that if we're showing
COL_{DEF,RES,UNRES}_SRC" or "COL_{DEF,RES,UNRES}_DST", we only generate
the string from "src" or "dst", we don't generate a string for the
link-layer address and then overwrite it with a string for the
network-layer address (generating those strings costs CPU).
Add support for "conversations", where a "conversation" is (at present)
a source and destination address and a source and destination port. (In
the future, we may support "conversations" above the transport layer,
e.g. a TFTP conversation, where the first packet goes from the client to
the TFTP server port, but the reply comes back from a different port,
and all subsequent packets go between the client address/port and the
server address/new port, or an NFS conversation, which might include
lock manager, status monitor, and mount packets, as well as NFS
packets.)
Currently, all we support is a call that takes the source and
destination address/port pairs, looks them up in a hash table, and:
if nothing is found, creates a new entry in the hash table, and
assigns it a unique 32-bit conversation ID, and returns that
conversation ID;
if an entry is found, returns its conversation ID.
Use that in the SMB and AFS code to keep track of individual SMB or AFS
conversations. We need to match up requests and replies, as, for
certain replies, the operation code for the request to which it's a
reply doesn't show up in the reply - you have to find the request with a
matching transaction ID. Transaction IDs are per-conversation, so the
hash table for requests should include a conversation ID and transaction
ID as the key.
This allows SMB and AFS decoders to handle IPv4 or IPv6 addresses
transparently (and should allow the SMB decoder to handle NetBIOS atop
other protocols as well, if the source and destination address and port
values in the "packet_info" structure are set appropriately).
In the "Follow TCP Connection" code, check to make sure that the
addresses are IPv4 addressses; ultimately, that code should be changed
to use the conversation code instead, which will let it handle IPv6
transparently.
svn path=/trunk/; revision=909
1999-10-22 07:18:23 +00:00
|
|
|
* XXX - this should really be done by the transport-layer protocol,
|
|
|
|
* although for connectionless transports, we may not want to do that
|
|
|
|
* unless we know some higher-level protocol will want it - or we
|
|
|
|
* may want to do it, so you can say e.g. "show only the packets in
|
|
|
|
* this UDP 'connection'".
|
|
|
|
*
|
|
|
|
* Note that we don't have to worry about the direction this packet
|
|
|
|
* was going - the conversation code handles that for us, treating
|
|
|
|
* packets from A:X to B:Y as being part of the same conversation as
|
|
|
|
* packets from B:Y to A:X.
|
|
|
|
*/
|
2005-02-02 20:07:03 +00:00
|
|
|
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype,
|
2001-05-27 01:48:25 +00:00
|
|
|
pinfo->srcport, pinfo->destport, 0);
|
Export the data structure used to represent a conversation.
Replace "add_to_conversation()" with:
"conversation_new()", which creates a new conversation, given
source and destination addresses and ports, and returns a
pointer to the structure for the conversation;
"find_conversation()", which tries to find a conversation for
given source and destination addresses and ports, and returns a
pointer to the structure for the conversation if found, and a
null pointer if not found.
Add a private data pointer field to the conversation structure, and have
"conversation_new()" take an argument that specifies what to set that
pointer to; that lets clients of the conversation code hang arbitrary
data off the conversation (e.g., a hash table of protocol requests and
replies, in case the protocol is a request/reply protocol wherein the
reply doesn't say what type of request it's a reply to, and you need
that information to dissect the reply).
svn path=/trunk/; revision=920
1999-10-24 07:27:20 +00:00
|
|
|
if (conversation == NULL) {
|
|
|
|
/* It's not part of any conversation - create a new one. */
|
2005-02-02 20:07:03 +00:00
|
|
|
conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
|
2001-09-03 10:33:12 +00:00
|
|
|
pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
|
Export the data structure used to represent a conversation.
Replace "add_to_conversation()" with:
"conversation_new()", which creates a new conversation, given
source and destination addresses and ports, and returns a
pointer to the structure for the conversation;
"find_conversation()", which tries to find a conversation for
given source and destination addresses and ports, and returns a
pointer to the structure for the conversation if found, and a
null pointer if not found.
Add a private data pointer field to the conversation structure, and have
"conversation_new()" take an argument that specifies what to set that
pointer to; that lets clients of the conversation code hang arbitrary
data off the conversation (e.g., a hash table of protocol requests and
replies, in case the protocol is a request/reply protocol wherein the
reply doesn't say what type of request it's a reply to, and you need
that information to dissect the reply).
svn path=/trunk/; revision=920
1999-10-24 07:27:20 +00:00
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
request_key.conversation = conversation->index;
|
2001-08-04 04:04:35 +00:00
|
|
|
request_key.service = rxinfo->serviceid;
|
|
|
|
request_key.callnumber = rxinfo->callnumber;
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
request_val = (struct afs_request_val *) g_hash_table_lookup(
|
|
|
|
afs_request_hash, &request_key);
|
|
|
|
|
|
|
|
/* only allocate a new hash element when it's a request */
|
|
|
|
opcode = 0;
|
2003-03-05 09:52:22 +00:00
|
|
|
if(!pinfo->fd->flags.visited){
|
|
|
|
if ( !request_val && !reply) {
|
2005-08-13 00:03:12 +00:00
|
|
|
new_request_key = se_alloc(sizeof(struct afs_request_key));
|
2003-03-05 09:52:22 +00:00
|
|
|
*new_request_key = request_key;
|
|
|
|
|
2005-08-13 00:03:12 +00:00
|
|
|
request_val = se_alloc(sizeof(struct afs_request_val));
|
2003-03-05 09:52:22 +00:00
|
|
|
request_val -> opcode = tvb_get_ntohl(tvb, offset);
|
|
|
|
request_val -> req_num = pinfo->fd->num;
|
|
|
|
request_val -> rep_num = 0;
|
|
|
|
request_val -> req_time.secs=pinfo->fd->abs_secs;
|
|
|
|
request_val -> req_time.nsecs=pinfo->fd->abs_usecs*1000;
|
|
|
|
|
|
|
|
g_hash_table_insert(afs_request_hash, new_request_key,
|
|
|
|
request_val);
|
|
|
|
}
|
|
|
|
if( request_val && reply ) {
|
|
|
|
request_val -> rep_num = pinfo->fd->num;
|
|
|
|
}
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
|
2001-05-27 01:48:25 +00:00
|
|
|
if ( request_val ) {
|
1999-10-20 16:41:20 +00:00
|
|
|
opcode = request_val->opcode;
|
|
|
|
}
|
|
|
|
|
2003-03-05 09:52:22 +00:00
|
|
|
|
1999-10-20 16:41:20 +00:00
|
|
|
node = 0;
|
|
|
|
typenode = 0;
|
|
|
|
vals = NULL;
|
|
|
|
dissector = NULL;
|
2001-05-27 01:48:25 +00:00
|
|
|
switch (port) {
|
1999-10-20 16:41:20 +00:00
|
|
|
case AFS_PORT_FS:
|
|
|
|
typenode = hf_afs_fs;
|
|
|
|
node = hf_afs_fs_opcode;
|
|
|
|
vals = fs_req;
|
|
|
|
dissector = reply ? dissect_fs_reply : dissect_fs_request;
|
|
|
|
break;
|
|
|
|
case AFS_PORT_CB:
|
|
|
|
typenode = hf_afs_cb;
|
|
|
|
node = hf_afs_cb_opcode;
|
|
|
|
vals = cb_req;
|
|
|
|
dissector = reply ? dissect_cb_reply : dissect_cb_request;
|
|
|
|
break;
|
|
|
|
case AFS_PORT_PROT:
|
|
|
|
typenode = hf_afs_prot;
|
|
|
|
node = hf_afs_prot_opcode;
|
|
|
|
vals = prot_req;
|
|
|
|
dissector = reply ? dissect_prot_reply : dissect_prot_request;
|
|
|
|
break;
|
|
|
|
case AFS_PORT_VLDB:
|
|
|
|
typenode = hf_afs_vldb;
|
|
|
|
node = hf_afs_vldb_opcode;
|
|
|
|
vals = vldb_req;
|
|
|
|
dissector = reply ? dissect_vldb_reply : dissect_vldb_request;
|
|
|
|
break;
|
|
|
|
case AFS_PORT_KAUTH:
|
|
|
|
typenode = hf_afs_kauth;
|
|
|
|
node = hf_afs_kauth_opcode;
|
|
|
|
vals = kauth_req;
|
|
|
|
dissector = reply ? dissect_kauth_reply : dissect_kauth_request;
|
|
|
|
break;
|
|
|
|
case AFS_PORT_VOL:
|
|
|
|
typenode = hf_afs_vol;
|
|
|
|
node = hf_afs_vol_opcode;
|
|
|
|
vals = vol_req;
|
|
|
|
dissector = reply ? dissect_vol_reply : dissect_vol_request;
|
|
|
|
break;
|
|
|
|
case AFS_PORT_ERROR:
|
|
|
|
typenode = hf_afs_error;
|
|
|
|
node = hf_afs_error_opcode;
|
1999-10-28 15:08:42 +00:00
|
|
|
/* dissector = reply ? dissect_error_reply : dissect_error_request; */
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case AFS_PORT_BOS:
|
|
|
|
typenode = hf_afs_bos;
|
|
|
|
node = hf_afs_bos_opcode;
|
|
|
|
vals = bos_req;
|
|
|
|
dissector = reply ? dissect_bos_reply : dissect_bos_request;
|
|
|
|
break;
|
|
|
|
case AFS_PORT_UPDATE:
|
|
|
|
typenode = hf_afs_update;
|
|
|
|
node = hf_afs_update_opcode;
|
2000-11-02 18:45:15 +00:00
|
|
|
vals = update_req;
|
1999-10-28 15:08:42 +00:00
|
|
|
/* dissector = reply ? dissect_update_reply : dissect_update_request; */
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case AFS_PORT_RMTSYS:
|
|
|
|
typenode = hf_afs_rmtsys;
|
|
|
|
node = hf_afs_rmtsys_opcode;
|
2000-11-02 18:45:15 +00:00
|
|
|
vals = rmtsys_req;
|
1999-10-28 15:08:42 +00:00
|
|
|
/* dissector = reply ? dissect_rmtsys_reply : dissect_rmtsys_request; */
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case AFS_PORT_BACKUP:
|
|
|
|
typenode = hf_afs_backup;
|
|
|
|
node = hf_afs_backup_opcode;
|
2000-11-02 18:45:15 +00:00
|
|
|
vals = backup_req;
|
1999-10-20 16:41:20 +00:00
|
|
|
dissector = reply ? dissect_backup_reply : dissect_backup_request;
|
|
|
|
break;
|
|
|
|
}
|
2001-05-27 01:48:25 +00:00
|
|
|
|
1999-10-20 16:41:20 +00:00
|
|
|
if ( (opcode >= VOTE_LOW && opcode <= VOTE_HIGH) ||
|
2001-05-27 01:48:25 +00:00
|
|
|
(opcode >= DISK_LOW && opcode <= DISK_HIGH) ) {
|
1999-10-20 16:41:20 +00:00
|
|
|
typenode = hf_afs_ubik;
|
|
|
|
node = hf_afs_ubik_opcode;
|
|
|
|
vals = ubik_req;
|
|
|
|
dissector = reply ? dissect_ubik_reply : dissect_ubik_request;
|
|
|
|
}
|
|
|
|
|
2001-05-27 01:48:25 +00:00
|
|
|
|
|
|
|
if ( VALID_OPCODE(opcode) ) {
|
|
|
|
if ( vals ) {
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s%s %s: %s (%d)",
|
2001-04-02 19:10:06 +00:00
|
|
|
typenode == hf_afs_ubik ? "UBIK-" : "",
|
|
|
|
val_to_str(port, port_types_short, "Unknown(%d)"),
|
|
|
|
reply ? "Reply" : "Request",
|
|
|
|
val_to_str(opcode, vals, "Unknown(%d)"), opcode);
|
2001-05-27 01:48:25 +00:00
|
|
|
} else {
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s%s %s: Unknown(%d)",
|
2001-04-02 19:10:06 +00:00
|
|
|
typenode == hf_afs_ubik ? "UBIK-" : "",
|
|
|
|
val_to_str(port, port_types_short, "Unknown(%d)"),
|
|
|
|
reply ? "Reply" : "Request",
|
|
|
|
opcode);
|
|
|
|
}
|
2001-05-27 01:48:25 +00:00
|
|
|
} else {
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Encrypted %s %s",
|
1999-10-20 16:41:20 +00:00
|
|
|
val_to_str(port, port_types_short, "Unknown(%d)"),
|
2001-04-02 19:10:06 +00:00
|
|
|
reply ? "Reply" : "Request"
|
|
|
|
);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (tree) {
|
2002-01-24 09:20:54 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_afs, tvb, offset, -1,
|
|
|
|
FALSE);
|
1999-11-16 11:44:20 +00:00
|
|
|
afs_tree = proto_item_add_subtree(ti, ett_afs);
|
1999-10-20 16:41:20 +00:00
|
|
|
|
2003-12-27 03:45:45 +00:00
|
|
|
proto_tree_add_text(afs_tree, tvb, 0, 0,
|
2001-05-27 01:48:25 +00:00
|
|
|
"Service: %s%s%s %s",
|
|
|
|
VALID_OPCODE(opcode) ? "" : "Encrypted ",
|
|
|
|
typenode == hf_afs_ubik ? "UBIK - " : "",
|
|
|
|
val_to_str(port, port_types, "Unknown(%d)"),
|
|
|
|
reply ? "Reply" : "Request");
|
1999-10-20 16:41:20 +00:00
|
|
|
|
2003-03-05 09:52:22 +00:00
|
|
|
if( request_val && !reply && request_val->rep_num) {
|
|
|
|
proto_tree_add_uint_format(afs_tree, hf_afs_repframe,
|
|
|
|
tvb, 0, 0, request_val->rep_num,
|
|
|
|
"The reply to this request is in frame %u",
|
|
|
|
request_val->rep_num);
|
|
|
|
}
|
|
|
|
if( request_val && reply && request_val->rep_num) {
|
|
|
|
proto_tree_add_uint_format(afs_tree, hf_afs_reqframe,
|
|
|
|
tvb, 0, 0, request_val->req_num,
|
|
|
|
"This is a reply to a request in frame %u",
|
|
|
|
request_val->req_num);
|
|
|
|
ns.secs= pinfo->fd->abs_secs-request_val->req_time.secs;
|
|
|
|
ns.nsecs=pinfo->fd->abs_usecs*1000-request_val->req_time.nsecs;
|
|
|
|
if(ns.nsecs<0){
|
|
|
|
ns.nsecs+=1000000000;
|
|
|
|
ns.secs--;
|
|
|
|
}
|
|
|
|
proto_tree_add_time(afs_tree, hf_afs_time, tvb, offset, 0,
|
|
|
|
&ns);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-27 01:48:25 +00:00
|
|
|
if ( VALID_OPCODE(opcode) ) {
|
2001-04-02 19:10:06 +00:00
|
|
|
/* until we do cache, can't handle replies */
|
|
|
|
ti = NULL;
|
2001-05-27 01:48:25 +00:00
|
|
|
if ( !reply && node != 0 ) {
|
2002-01-18 21:30:05 +00:00
|
|
|
if ( rxinfo->seq == 1 )
|
|
|
|
{
|
|
|
|
ti = proto_tree_add_uint(afs_tree,
|
|
|
|
node, tvb, offset, 4, opcode);
|
|
|
|
} else {
|
|
|
|
ti = proto_tree_add_uint(afs_tree,
|
2003-12-27 03:45:45 +00:00
|
|
|
node, tvb, 0, 0, opcode);
|
2002-01-18 21:30:05 +00:00
|
|
|
}
|
2001-05-27 01:48:25 +00:00
|
|
|
} else if ( reply && node != 0 ) {
|
2001-04-02 19:10:06 +00:00
|
|
|
/* the opcode isn't in this packet */
|
|
|
|
ti = proto_tree_add_uint(afs_tree,
|
2003-12-27 03:45:45 +00:00
|
|
|
node, tvb, 0, 0, opcode);
|
2001-05-27 01:48:25 +00:00
|
|
|
} else {
|
|
|
|
ti = proto_tree_add_text(afs_tree, tvb,
|
2003-12-27 03:45:45 +00:00
|
|
|
0, 0, "Operation: Unknown");
|
2001-04-02 19:10:06 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-04-02 19:10:06 +00:00
|
|
|
/* Add the subtree for this particular service */
|
|
|
|
afs_op_tree = proto_item_add_subtree(ti, ett_afs_op);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2003-03-05 09:52:22 +00:00
|
|
|
|
2001-05-27 01:48:25 +00:00
|
|
|
if ( typenode != 0 ) {
|
2001-04-02 19:10:06 +00:00
|
|
|
/* indicate the type of request */
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree_add_boolean_hidden(afs_tree, typenode, tvb, offset, 0, 1);
|
2001-04-02 19:10:06 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-04-02 19:10:06 +00:00
|
|
|
/* Process the packet according to what service it is */
|
2001-05-27 01:48:25 +00:00
|
|
|
if ( dissector ) {
|
2001-08-04 04:04:35 +00:00
|
|
|
(*dissector)(tvb, rxinfo, afs_op_tree, offset, opcode);
|
2001-04-02 19:10:06 +00:00
|
|
|
}
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if it's the last packet, and it's a reply, remove opcode
|
|
|
|
from hash */
|
|
|
|
/* ignoring for now, I'm not sure how the chunk deallocation works */
|
2001-08-04 04:04:35 +00:00
|
|
|
if ( rxinfo->flags & RX_LAST_PACKET && reply ){
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Here is a helper routine for adding an AFS acl to the proto tree
|
|
|
|
* This is to be used with FS packets only
|
|
|
|
*
|
|
|
|
* An AFS ACL is a string that has the following format:
|
|
|
|
*
|
|
|
|
* <positive> <negative>
|
|
|
|
* <uid1> <aclbits1>
|
|
|
|
* ....
|
|
|
|
*
|
|
|
|
* "positive" and "negative" are integers which contain the number of
|
|
|
|
* positive and negative ACL's in the string. The uid/aclbits pair are
|
|
|
|
* ASCII strings containing the UID/PTS record and and a ascii number
|
|
|
|
* representing a logical OR of all the ACL permission bits
|
|
|
|
*/
|
2002-05-06 01:25:45 +00:00
|
|
|
/*
|
|
|
|
* XXX - FIXME:
|
|
|
|
*
|
|
|
|
* sscanf is probably quite dangerous if we run outside the packet.
|
|
|
|
*
|
|
|
|
* "GETSTR" doesn't guarantee that the resulting string is
|
|
|
|
* null-terminated.
|
|
|
|
*
|
|
|
|
* Should this just scan the string itself, rather than using "sscanf()"?
|
|
|
|
*/
|
2002-08-28 21:04:11 +00:00
|
|
|
static int
|
2002-05-02 10:59:37 +00:00
|
|
|
dissect_acl(tvbuff_t *tvb, struct rxinfo *rxinfo _U_, proto_tree *tree, int offset)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-05-27 01:48:25 +00:00
|
|
|
int old_offset;
|
2001-06-18 01:49:17 +00:00
|
|
|
gint32 bytes;
|
2001-05-27 01:48:25 +00:00
|
|
|
int i, n, pos, neg, acl;
|
2000-11-19 16:58:57 +00:00
|
|
|
char user[128]; /* Be sure to adjust sscanf()s below if length is changed... */
|
1999-10-20 16:41:20 +00:00
|
|
|
|
2001-05-27 01:48:25 +00:00
|
|
|
old_offset = offset;
|
|
|
|
bytes = tvb_get_ntohl(tvb, offset);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_fs_acl_datasize);
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
|
2002-11-28 03:57:50 +00:00
|
|
|
if (sscanf(GETSTR, "%d %n", &pos, &n) != 1) {
|
2002-08-28 21:04:11 +00:00
|
|
|
/* does not matter what we return, if this fails,
|
2001-05-27 01:48:25 +00:00
|
|
|
* we cant dissect anything else in the packet either.
|
|
|
|
*/
|
|
|
|
return offset;
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_uint(tree, hf_afs_fs_acl_count_positive, tvb,
|
2001-05-27 01:48:25 +00:00
|
|
|
offset, n, pos);
|
|
|
|
offset += n;
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
|
2002-11-28 03:57:50 +00:00
|
|
|
if (sscanf(GETSTR, "%d %n", &neg, &n) != 1) {
|
2001-05-27 01:48:25 +00:00
|
|
|
return offset;
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_uint(tree, hf_afs_fs_acl_count_negative, tvb,
|
2001-05-27 01:48:25 +00:00
|
|
|
offset, n, neg);
|
|
|
|
offset += n;
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This wacky order preserves the order used by the "fs" command
|
|
|
|
*/
|
|
|
|
for (i = 0; i < pos; i++) {
|
2002-11-28 03:57:50 +00:00
|
|
|
if (sscanf(GETSTR, "%127s %d %n", user, &acl, &n) != 2) {
|
2001-05-27 01:48:25 +00:00
|
|
|
return offset;
|
|
|
|
}
|
1999-10-20 16:41:20 +00:00
|
|
|
ACLOUT(user,1,acl,n);
|
2001-05-27 01:48:25 +00:00
|
|
|
offset += n;
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
for (i = 0; i < neg; i++) {
|
2002-11-28 03:57:50 +00:00
|
|
|
if (sscanf(GETSTR, "%127s %d %n", user, &acl, &n) != 2) {
|
2001-05-27 01:48:25 +00:00
|
|
|
return offset;
|
|
|
|
}
|
1999-10-20 16:41:20 +00:00
|
|
|
ACLOUT(user,0,acl,n);
|
2001-05-27 01:48:25 +00:00
|
|
|
offset += n;
|
|
|
|
if (offset >= old_offset+bytes ) {
|
|
|
|
return offset;
|
|
|
|
}
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
2001-05-27 01:48:25 +00:00
|
|
|
|
|
|
|
return offset;
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Here are the helper dissection routines
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
2001-08-04 04:04:35 +00:00
|
|
|
dissect_fs_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-08-04 04:04:35 +00:00
|
|
|
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
case 130: /* fetch data */
|
2001-05-27 01:48:25 +00:00
|
|
|
/* only on first packet */
|
2001-08-04 04:04:35 +00:00
|
|
|
if ( rxinfo->seq == 1 )
|
2000-11-03 22:11:36 +00:00
|
|
|
{
|
|
|
|
OUT_FS_AFSFetchStatus("Status");
|
|
|
|
OUT_FS_AFSCallBack();
|
|
|
|
OUT_FS_AFSVolSync();
|
|
|
|
}
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_BYTES_ALL(hf_afs_fs_data);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 131: /* fetch acl */
|
2001-08-04 04:04:35 +00:00
|
|
|
offset = dissect_acl(tvb, rxinfo, tree, offset);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSFetchStatus("Status");
|
|
|
|
OUT_FS_AFSVolSync();
|
|
|
|
break;
|
|
|
|
case 132: /* Fetch status */
|
|
|
|
OUT_FS_AFSFetchStatus("Status");
|
|
|
|
OUT_FS_AFSCallBack();
|
2000-11-03 18:37:24 +00:00
|
|
|
OUT_FS_AFSVolSync();
|
2002-08-28 21:04:11 +00:00
|
|
|
break;
|
2000-11-03 18:37:24 +00:00
|
|
|
case 133: /* Store data */
|
|
|
|
case 134: /* Store ACL */
|
2000-11-03 17:32:51 +00:00
|
|
|
case 135: /* Store status */
|
2000-11-03 18:37:24 +00:00
|
|
|
case 136: /* Remove file */
|
|
|
|
OUT_FS_AFSFetchStatus("Status");
|
|
|
|
OUT_FS_AFSVolSync();
|
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
case 137: /* create file */
|
2000-11-30 14:09:14 +00:00
|
|
|
case 141: /* make dir */
|
|
|
|
case 161: /* lookup */
|
|
|
|
case 163: /* dfs symlink */
|
|
|
|
OUT_FS_AFSFid((opcode == 137)? "New File" : ((opcode == 141)? "New Directory" : "File"));
|
2000-11-03 18:37:24 +00:00
|
|
|
OUT_FS_AFSFetchStatus("File Status");
|
|
|
|
OUT_FS_AFSFetchStatus("Directory Status");
|
|
|
|
OUT_FS_AFSCallBack();
|
|
|
|
OUT_FS_AFSVolSync();
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2000-11-03 18:37:24 +00:00
|
|
|
case 138: /* rename */
|
|
|
|
OUT_FS_AFSFetchStatus("Old Directory Status");
|
|
|
|
OUT_FS_AFSFetchStatus("New Directory Status");
|
|
|
|
OUT_FS_AFSVolSync();
|
|
|
|
break;
|
|
|
|
case 139: /* symlink */
|
|
|
|
OUT_FS_AFSFid("Symlink");
|
|
|
|
case 140: /* link */
|
|
|
|
OUT_FS_AFSFetchStatus("Symlink Status");
|
|
|
|
case 142: /* rmdir */
|
|
|
|
OUT_FS_AFSFetchStatus("Directory Status");
|
|
|
|
OUT_FS_AFSVolSync();
|
|
|
|
break;
|
|
|
|
case 143: /* old set lock */
|
|
|
|
case 144: /* old extend lock */
|
|
|
|
case 145: /* old release lock */
|
2000-11-30 14:09:14 +00:00
|
|
|
case 147: /* give up callbacks */
|
|
|
|
case 150: /* set volume status */
|
2002-08-28 21:04:11 +00:00
|
|
|
case 152: /* check token */
|
2000-11-03 18:37:24 +00:00
|
|
|
/* nothing returned */
|
|
|
|
break;
|
|
|
|
case 146: /* get statistics */
|
|
|
|
OUT_FS_ViceStatistics();
|
|
|
|
break;
|
|
|
|
case 148: /* get volume info */
|
2000-11-30 14:09:14 +00:00
|
|
|
case 154: /* n-get-volume-info */
|
2000-11-03 18:37:24 +00:00
|
|
|
OUT_FS_VolumeInfo();
|
|
|
|
break;
|
|
|
|
case 149: /* get volume status */
|
|
|
|
OUT_FS_AFSFetchVolumeStatus();
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_volname);
|
|
|
|
OUT_RXString(hf_afs_fs_offlinemsg);
|
|
|
|
OUT_RXString(hf_afs_fs_motd);
|
2000-11-03 18:37:24 +00:00
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
case 151: /* root volume */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_volname);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 153: /* get time */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_TIMESTAMP(hf_afs_fs_timestamp);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2000-11-03 18:37:24 +00:00
|
|
|
case 155: /* bulk status */
|
|
|
|
OUT_FS_AFSBulkStats();
|
2002-08-28 21:04:11 +00:00
|
|
|
SKIP(4);
|
2000-11-03 18:37:24 +00:00
|
|
|
OUT_FS_AFSCBs();
|
|
|
|
OUT_FS_AFSVolSync();
|
|
|
|
break;
|
|
|
|
case 156: /* set lock */
|
|
|
|
case 157: /* extend lock */
|
|
|
|
case 158: /* release lock */
|
|
|
|
OUT_FS_AFSVolSync();
|
|
|
|
break;
|
|
|
|
case 159: /* x-stats-version */
|
|
|
|
OUT_UINT(hf_afs_fs_xstats_version);
|
|
|
|
break;
|
|
|
|
case 160: /* get xstats */
|
|
|
|
OUT_UINT(hf_afs_fs_xstats_version);
|
2003-01-18 02:18:39 +00:00
|
|
|
OUT_TIMESECS(hf_afs_fs_xstats_timestamp);
|
2000-11-03 18:37:24 +00:00
|
|
|
OUT_FS_AFS_CollData();
|
|
|
|
break;
|
|
|
|
case 162: /* flush cps */
|
|
|
|
OUT_UINT(hf_afs_fs_cps_spare2);
|
|
|
|
OUT_UINT(hf_afs_fs_cps_spare3);
|
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
2001-08-04 04:04:35 +00:00
|
|
|
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_fs_errcode);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-08-04 04:04:35 +00:00
|
|
|
dissect_fs_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2002-01-18 21:30:05 +00:00
|
|
|
/* skip the opcode if this is the first packet in the stream */
|
|
|
|
if ( rxinfo->seq == 1 )
|
|
|
|
{
|
|
|
|
offset += 4; /* skip the opcode */
|
|
|
|
}
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
case 130: /* Fetch data */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSFid("Source");
|
|
|
|
OUT_UINT(hf_afs_fs_offset);
|
|
|
|
OUT_UINT(hf_afs_fs_length);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 131: /* Fetch ACL */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSFid("Target");
|
2002-08-28 21:04:11 +00:00
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
case 132: /* Fetch Status */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSFid("Target");
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 133: /* Store Data */
|
2002-01-18 21:30:05 +00:00
|
|
|
if ( rxinfo->seq == 1 )
|
|
|
|
{
|
|
|
|
OUT_FS_AFSFid("Destination");
|
|
|
|
OUT_FS_AFSStoreStatus("Status");
|
|
|
|
OUT_UINT(hf_afs_fs_offset);
|
|
|
|
OUT_UINT(hf_afs_fs_length);
|
|
|
|
OUT_UINT(hf_afs_fs_flength);
|
|
|
|
}
|
|
|
|
OUT_BYTES_ALL(hf_afs_fs_data);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 134: /* Store ACL */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSFid("Target");
|
2001-08-04 04:04:35 +00:00
|
|
|
offset = dissect_acl(tvb, rxinfo, tree, offset);
|
2000-11-03 17:32:51 +00:00
|
|
|
break;
|
|
|
|
case 135: /* Store Status */
|
|
|
|
OUT_FS_AFSFid("Target");
|
|
|
|
OUT_FS_AFSStoreStatus("Status");
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 136: /* Remove File */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSFid("Remove File");
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_name);
|
2000-11-03 17:32:51 +00:00
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
case 137: /* Create File */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSFid("Target");
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_name);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSStoreStatus("Status");
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 138: /* Rename file */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSFid("Old");
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_oldname);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSFid("New");
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_newname);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 139: /* Symlink */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSFid("File");
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_symlink_name);
|
|
|
|
OUT_RXString(hf_afs_fs_symlink_content);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSStoreStatus("Status");
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 140: /* Link */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSFid("Link To (New File)");
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_name);
|
2000-11-03 19:27:11 +00:00
|
|
|
OUT_FS_AFSFid("Link From (Old File)");
|
2000-11-03 17:32:51 +00:00
|
|
|
break;
|
|
|
|
case 141: /* Make dir */
|
|
|
|
OUT_FS_AFSFid("Target");
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_name);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSStoreStatus("Status");
|
|
|
|
break;
|
|
|
|
case 142: /* Remove dir */
|
|
|
|
OUT_FS_AFSFid("Target");
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_name);
|
2000-11-03 17:32:51 +00:00
|
|
|
break;
|
|
|
|
case 143: /* Old Set Lock */
|
|
|
|
OUT_FS_AFSFid("Target");
|
2000-11-03 18:37:24 +00:00
|
|
|
OUT_UINT(hf_afs_fs_vicelocktype);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_FS_AFSVolSync();
|
|
|
|
break;
|
|
|
|
case 144: /* Old Extend Lock */
|
|
|
|
OUT_FS_AFSFid("Target");
|
|
|
|
OUT_FS_AFSVolSync();
|
|
|
|
break;
|
|
|
|
case 145: /* Old Release Lock */
|
|
|
|
OUT_FS_AFSFid("Target");
|
|
|
|
OUT_FS_AFSVolSync();
|
|
|
|
break;
|
|
|
|
case 146: /* Get statistics */
|
|
|
|
/* no params */
|
|
|
|
break;
|
|
|
|
case 147: /* Give up callbacks */
|
|
|
|
OUT_FS_AFSCBFids();
|
|
|
|
OUT_FS_AFSCBs();
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 148: /* Get vol info */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_volname);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 149: /* Get vol stats */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_fs_volid);
|
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
case 150: /* Set vol stats */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_fs_volid);
|
2000-11-03 19:27:11 +00:00
|
|
|
OUT_FS_AFSStoreVolumeStatus();
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_volname);
|
|
|
|
OUT_RXString(hf_afs_fs_offlinemsg);
|
|
|
|
OUT_RXString(hf_afs_fs_motd);
|
2000-11-03 19:27:11 +00:00
|
|
|
break;
|
|
|
|
case 151: /* get root volume */
|
|
|
|
/* no params */
|
|
|
|
break;
|
|
|
|
case 152: /* check token */
|
|
|
|
OUT_UINT(hf_afs_fs_viceid);
|
|
|
|
OUT_FS_AFSTOKEN();
|
|
|
|
break;
|
|
|
|
case 153: /* get time */
|
|
|
|
/* no params */
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 154: /* new get vol info */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_volname);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 155: /* bulk stat */
|
2000-11-03 19:27:11 +00:00
|
|
|
OUT_FS_AFSCBFids();
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2000-11-03 17:32:51 +00:00
|
|
|
case 156: /* Set Lock */
|
|
|
|
OUT_FS_AFSFid("Target");
|
2000-11-03 19:27:11 +00:00
|
|
|
OUT_UINT(hf_afs_fs_vicelocktype);
|
2000-11-03 17:32:51 +00:00
|
|
|
break;
|
|
|
|
case 157: /* Extend Lock */
|
|
|
|
OUT_FS_AFSFid("Target");
|
|
|
|
break;
|
|
|
|
case 158: /* Release Lock */
|
|
|
|
OUT_FS_AFSFid("Target");
|
|
|
|
break;
|
2000-11-03 19:27:11 +00:00
|
|
|
case 159: /* xstats version */
|
|
|
|
/* no params */
|
|
|
|
break;
|
|
|
|
case 160: /* get xstats */
|
|
|
|
OUT_UINT(hf_afs_fs_xstats_clientversion);
|
|
|
|
OUT_UINT(hf_afs_fs_xstats_collnumber);
|
|
|
|
break;
|
|
|
|
case 161: /* lookup */
|
|
|
|
OUT_FS_AFSFid("Target");
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_name);
|
2000-11-03 19:27:11 +00:00
|
|
|
break;
|
|
|
|
case 162: /* flush cps */
|
|
|
|
OUT_FS_ViceIds();
|
|
|
|
OUT_FS_IPAddrs();
|
|
|
|
OUT_UINT(hf_afs_fs_cps_spare1);
|
|
|
|
break;
|
|
|
|
case 163: /* dfs symlink */
|
|
|
|
OUT_FS_AFSFid("Target");
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_fs_symlink_name);
|
|
|
|
OUT_RXString(hf_afs_fs_symlink_content);
|
2000-11-03 19:27:11 +00:00
|
|
|
OUT_FS_AFSStoreStatus("Symlink Status");
|
|
|
|
break;
|
2004-05-11 14:21:48 +00:00
|
|
|
case 220: /* residencycmd */
|
|
|
|
OUT_FS_AFSFid("Target");
|
|
|
|
/* need residency inputs here */
|
|
|
|
break;
|
|
|
|
case 65536: /* inline bulk status */
|
|
|
|
OUT_FS_AFSCBFids();
|
|
|
|
break;
|
|
|
|
case 65537: /* fetch-data-64 */
|
|
|
|
OUT_FS_AFSFid("Target");
|
|
|
|
OUT_INT64(hf_afs_fs_offset64);
|
|
|
|
OUT_INT64(hf_afs_fs_length64);
|
|
|
|
/* need more here */
|
|
|
|
break;
|
|
|
|
case 65538: /* store-data-64 */
|
|
|
|
OUT_FS_AFSFid("Target");
|
|
|
|
OUT_FS_AFSStoreStatus("Status");
|
|
|
|
OUT_INT64(hf_afs_fs_offset64);
|
|
|
|
OUT_INT64(hf_afs_fs_length64);
|
|
|
|
OUT_INT64(hf_afs_fs_flength64);
|
|
|
|
/* need residency inputs here */
|
|
|
|
break;
|
|
|
|
case 65539: /* give up all cbs */
|
|
|
|
break;
|
|
|
|
case 65540: /* get capabilities */
|
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* BOS Helpers
|
|
|
|
*/
|
|
|
|
static void
|
2001-08-04 04:04:35 +00:00
|
|
|
dissect_bos_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-08-04 04:04:35 +00:00
|
|
|
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
2000-11-03 22:11:36 +00:00
|
|
|
case 80: /* create bnode */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 81: /* delete bnode */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 82: /* set status */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 83: /* get status */
|
|
|
|
OUT_INT(hf_afs_bos_status);
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_statusdesc);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 84: /* enumerate instance */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_instance);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
case 85: /* get instance info */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_type);
|
2000-11-03 22:11:36 +00:00
|
|
|
OUT_BOS_STATUS();
|
|
|
|
break;
|
|
|
|
case 86: /* get instance parm */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_parm);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 87: /* add siperuser */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 88: /* delete superuser */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 89: /* list superusers */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_user);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 90: /* list keys */
|
|
|
|
OUT_UINT(hf_afs_bos_kvno);
|
|
|
|
OUT_BOS_KEY();
|
|
|
|
OUT_BOS_KEYINFO();
|
|
|
|
break;
|
|
|
|
case 91: /* add key */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 92: /* delete key */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 93: /* set cell name */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 94: /* get cell name */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_cell);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 95: /* get cell host */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_host);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 96: /* add cell host */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 97: /* delete cell host */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 98: /* set tstatus */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 99: /* shutdown all */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 100: /* restart all */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 101: /* startup all */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 102: /* set noauth flag */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 103: /* rebozo */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 104: /* restart */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 105: /* install */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 106: /* uninstall */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 107: /* get dates */
|
2003-01-18 02:18:39 +00:00
|
|
|
OUT_TIMESECS(hf_afs_bos_newtime);
|
|
|
|
OUT_TIMESECS(hf_afs_bos_baktime);
|
|
|
|
OUT_TIMESECS(hf_afs_bos_oldtime);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 108: /* exec */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 109: /* prune */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 110: /* set restart time */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 111: /* get restart time */
|
|
|
|
OUT_BOS_TIME();
|
|
|
|
break;
|
|
|
|
case 112: /* get log */
|
|
|
|
/* need to make this dump a big string somehow */
|
|
|
|
OUT_BYTES_ALL(hf_afs_bos_data);
|
|
|
|
break;
|
|
|
|
case 113: /* wait all */
|
|
|
|
/* no output */
|
|
|
|
break;
|
|
|
|
case 114: /* get instance strings */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_error);
|
|
|
|
OUT_RXString(hf_afs_bos_spare1);
|
|
|
|
OUT_RXString(hf_afs_bos_spare2);
|
|
|
|
OUT_RXString(hf_afs_bos_spare3);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2001-08-04 04:04:35 +00:00
|
|
|
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_bos_errcode);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-05-02 10:59:37 +00:00
|
|
|
dissect_bos_request(tvbuff_t *tvb, struct rxinfo *rxinfo _U_, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-05-27 01:48:25 +00:00
|
|
|
offset += 4; /* skip the opcode */
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
case 80: /* create b node */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_type);
|
|
|
|
OUT_RXString(hf_afs_bos_instance);
|
|
|
|
OUT_RXString(hf_afs_bos_parm);
|
|
|
|
OUT_RXString(hf_afs_bos_parm);
|
|
|
|
OUT_RXString(hf_afs_bos_parm);
|
|
|
|
OUT_RXString(hf_afs_bos_parm);
|
|
|
|
OUT_RXString(hf_afs_bos_parm);
|
|
|
|
OUT_RXString(hf_afs_bos_parm);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 81: /* delete b node */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_instance);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 82: /* set status */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_instance);
|
2003-01-27 22:11:52 +00:00
|
|
|
OUT_INT(hf_afs_bos_status);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2000-11-03 22:11:36 +00:00
|
|
|
case 83: /* get status */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_instance);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 84: /* enumerate instance */
|
|
|
|
OUT_UINT(hf_afs_bos_num);
|
|
|
|
break;
|
|
|
|
case 85: /* get instance info */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_instance);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
case 86: /* get instance parm */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_instance);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_bos_num);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2000-11-03 22:11:36 +00:00
|
|
|
case 87: /* add super user */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_user);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 88: /* delete super user */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_user);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
case 89: /* list super users */
|
2000-11-03 22:11:36 +00:00
|
|
|
OUT_UINT(hf_afs_bos_num);
|
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
case 90: /* list keys */
|
2000-11-03 22:11:36 +00:00
|
|
|
OUT_UINT(hf_afs_bos_num);
|
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
case 91: /* add key */
|
2000-11-03 22:11:36 +00:00
|
|
|
OUT_UINT(hf_afs_bos_num);
|
|
|
|
OUT_BOS_KEY();
|
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
case 92: /* delete key */
|
2000-11-03 22:11:36 +00:00
|
|
|
OUT_UINT(hf_afs_bos_num);
|
|
|
|
break;
|
|
|
|
case 93: /* set cell name */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_content);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
case 95: /* set cell host */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_bos_num);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2000-11-03 22:11:36 +00:00
|
|
|
case 96: /* add cell host */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_content);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 97: /* delete cell host */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_content);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 98: /* set t status */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_content);
|
2003-01-27 22:11:52 +00:00
|
|
|
OUT_INT(hf_afs_bos_status);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 99: /* shutdown all */
|
|
|
|
/* no params */
|
|
|
|
break;
|
|
|
|
case 100: /* restart all */
|
|
|
|
/* no params */
|
|
|
|
break;
|
|
|
|
case 101: /* startup all */
|
|
|
|
/* no params */
|
|
|
|
break;
|
|
|
|
case 102: /* set no-auth flag */
|
|
|
|
OUT_UINT(hf_afs_bos_flags);
|
|
|
|
break;
|
|
|
|
case 103: /* re-bozo? */
|
|
|
|
/* no params */
|
|
|
|
break;
|
|
|
|
case 104: /* restart */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_instance);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 105: /* install */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_path);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_bos_size);
|
|
|
|
OUT_UINT(hf_afs_bos_flags);
|
|
|
|
OUT_UINT(hf_afs_bos_date);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2000-11-03 22:11:36 +00:00
|
|
|
case 106: /* uninstall */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_path);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 107: /* get dates */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_path);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 108: /* exec */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_cmd);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 109: /* prune */
|
|
|
|
OUT_UINT(hf_afs_bos_flags);
|
|
|
|
break;
|
|
|
|
case 110: /* set restart time */
|
|
|
|
OUT_UINT(hf_afs_bos_num);
|
|
|
|
OUT_BOS_TIME();
|
|
|
|
break;
|
|
|
|
case 111: /* get restart time */
|
|
|
|
OUT_UINT(hf_afs_bos_num);
|
|
|
|
break;
|
|
|
|
case 112: /* get log */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_file);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
|
|
|
case 113: /* wait all */
|
|
|
|
/* no params */
|
|
|
|
break;
|
|
|
|
case 114: /* get instance strings */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_bos_content);
|
2000-11-03 22:11:36 +00:00
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* VOL Helpers
|
|
|
|
*/
|
|
|
|
static void
|
2001-08-04 04:04:35 +00:00
|
|
|
dissect_vol_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-08-04 04:04:35 +00:00
|
|
|
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
case 121:
|
|
|
|
/* should loop here maybe */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vol_count);
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXStringV(hf_afs_vol_name, 32); /* not sure on */
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2001-08-04 04:04:35 +00:00
|
|
|
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vol_errcode);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-05-02 10:59:37 +00:00
|
|
|
dissect_vol_request(tvbuff_t *tvb, struct rxinfo *rxinfo _U_, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-05-27 01:48:25 +00:00
|
|
|
offset += 4; /* skip the opcode */
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
case 121: /* list one vol */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vol_count);
|
|
|
|
OUT_UINT(hf_afs_vol_id);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* KAUTH Helpers
|
|
|
|
*/
|
|
|
|
static void
|
2001-08-04 04:04:35 +00:00
|
|
|
dissect_kauth_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-08-04 04:04:35 +00:00
|
|
|
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2001-08-04 04:04:35 +00:00
|
|
|
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_kauth_errcode);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-05-02 10:59:37 +00:00
|
|
|
dissect_kauth_request(tvbuff_t *tvb, struct rxinfo *rxinfo _U_, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-05-27 01:48:25 +00:00
|
|
|
offset += 4; /* skip the opcode */
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
case 1: /* authenticate old */
|
|
|
|
case 21: /* authenticate */
|
|
|
|
case 22: /* authenticate v2 */
|
|
|
|
case 2: /* change pw */
|
|
|
|
case 5: /* set fields */
|
|
|
|
case 6: /* create user */
|
|
|
|
case 7: /* delete user */
|
|
|
|
case 8: /* get entry */
|
|
|
|
case 14: /* unlock */
|
|
|
|
case 15: /* lock status */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_kauth_princ);
|
|
|
|
OUT_RXString(hf_afs_kauth_realm);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_BYTES_ALL(hf_afs_kauth_data);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 3: /* getticket-old */
|
|
|
|
case 23: /* getticket */
|
2002-09-30 02:19:38 +00:00
|
|
|
OUT_KAUTH_GetTicket();
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 4: /* set pass */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_kauth_princ);
|
|
|
|
OUT_RXString(hf_afs_kauth_realm);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_kauth_kvno);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 12: /* get pass */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_kauth_name);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* CB Helpers
|
|
|
|
*/
|
|
|
|
static void
|
2001-08-04 04:04:35 +00:00
|
|
|
dissect_cb_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-08-04 04:04:35 +00:00
|
|
|
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2001-08-04 04:04:35 +00:00
|
|
|
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_cb_errcode);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-05-02 10:59:37 +00:00
|
|
|
dissect_cb_request(tvbuff_t *tvb, struct rxinfo *rxinfo _U_, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-05-27 01:48:25 +00:00
|
|
|
offset += 4; /* skip the opcode */
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
case 204: /* callback */
|
|
|
|
{
|
|
|
|
unsigned int i,j;
|
|
|
|
|
2001-05-27 01:48:25 +00:00
|
|
|
j = tvb_get_ntohl(tvb, offset);
|
|
|
|
offset += 4;
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
for (i=0; i<j; i++)
|
|
|
|
{
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_CB_AFSFid("Target");
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
|
2001-05-27 01:48:25 +00:00
|
|
|
j = tvb_get_ntohl(tvb, offset);
|
|
|
|
offset += 4;
|
1999-10-20 16:41:20 +00:00
|
|
|
for (i=0; i<j; i++)
|
|
|
|
{
|
2000-11-03 19:27:11 +00:00
|
|
|
OUT_CB_AFSCallBack();
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* PROT Helpers
|
|
|
|
*/
|
|
|
|
static void
|
2001-08-04 04:04:35 +00:00
|
|
|
dissect_prot_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-08-04 04:04:35 +00:00
|
|
|
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
case 504: /* name to id */
|
|
|
|
{
|
|
|
|
unsigned int i, j;
|
|
|
|
|
2001-05-27 01:48:25 +00:00
|
|
|
j = tvb_get_ntohl(tvb, offset);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_count);
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
for (i=0; i<j; i++)
|
|
|
|
{
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_id);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 505: /* id to name */
|
|
|
|
{
|
|
|
|
unsigned int i, j;
|
|
|
|
|
2001-05-27 01:48:25 +00:00
|
|
|
j = tvb_get_ntohl(tvb, offset);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_count);
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
for (i=0; i<j; i++)
|
|
|
|
{
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXStringV(hf_afs_prot_name, PRNAMEMAX);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 508: /* get cps */
|
|
|
|
case 514: /* list elements */
|
|
|
|
case 517: /* list owned */
|
|
|
|
case 518: /* get cps2 */
|
|
|
|
case 519: /* get host cps */
|
|
|
|
{
|
|
|
|
unsigned int i, j;
|
|
|
|
|
2001-05-27 01:48:25 +00:00
|
|
|
j = tvb_get_ntohl(tvb, offset);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_count);
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
for (i=0; i<j; i++)
|
|
|
|
{
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_id);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 510: /* list max */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_maxuid);
|
|
|
|
OUT_UINT(hf_afs_prot_maxgid);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2001-08-04 04:04:35 +00:00
|
|
|
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_errcode);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-05-02 10:59:37 +00:00
|
|
|
dissect_prot_request(tvbuff_t *tvb, struct rxinfo *rxinfo _U_, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-05-27 01:48:25 +00:00
|
|
|
offset += 4; /* skip the opcode */
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
case 500: /* new user */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_prot_name);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_id);
|
|
|
|
OUT_UINT(hf_afs_prot_oldid);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 501: /* where is it */
|
|
|
|
case 506: /* delete */
|
|
|
|
case 508: /* get cps */
|
|
|
|
case 512: /* list entry */
|
|
|
|
case 514: /* list elements */
|
|
|
|
case 517: /* list owned */
|
|
|
|
case 519: /* get host cps */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_id);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 502: /* dump entry */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_pos);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 503: /* add to group */
|
|
|
|
case 507: /* remove from group */
|
|
|
|
case 515: /* is a member of? */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_uid);
|
|
|
|
OUT_UINT(hf_afs_prot_gid);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 504: /* name to id */
|
|
|
|
{
|
|
|
|
unsigned int i, j;
|
|
|
|
|
2001-05-27 01:48:25 +00:00
|
|
|
j = tvb_get_ntohl(tvb, offset);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_count);
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
for (i=0; i<j; i++)
|
|
|
|
{
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXStringV(hf_afs_prot_name,PRNAMEMAX);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 505: /* id to name */
|
|
|
|
{
|
|
|
|
unsigned int i, j;
|
|
|
|
|
2001-05-27 01:48:25 +00:00
|
|
|
j = tvb_get_ntohl(tvb, offset);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_count);
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
for (i=0; i<j; i++)
|
|
|
|
{
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_id);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 509: /* new entry */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_prot_name);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_flag);
|
|
|
|
OUT_UINT(hf_afs_prot_oldid);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 511: /* set max */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_id);
|
|
|
|
OUT_UINT(hf_afs_prot_flag);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 513: /* change entry */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_id);
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_prot_name);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_oldid);
|
|
|
|
OUT_UINT(hf_afs_prot_newid);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 520: /* update entry */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_prot_id);
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_prot_name);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* VLDB Helpers
|
|
|
|
*/
|
|
|
|
static void
|
2001-08-04 04:04:35 +00:00
|
|
|
dissect_vldb_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-08-04 04:04:35 +00:00
|
|
|
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
case 510: /* list entry */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_count);
|
|
|
|
OUT_UINT(hf_afs_vldb_nextindex);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 503: /* get entry by id */
|
|
|
|
case 504: /* get entry by name */
|
|
|
|
{
|
|
|
|
int nservers,i,j;
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXStringV(hf_afs_vldb_name, VLNAMEMAX);
|
2002-02-03 18:12:04 +00:00
|
|
|
SKIP(4);
|
2001-05-27 01:48:25 +00:00
|
|
|
nservers = tvb_get_ntohl(tvb, offset);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_numservers);
|
1999-10-20 16:41:20 +00:00
|
|
|
for (i=0; i<8; i++)
|
|
|
|
{
|
|
|
|
if ( i<nservers )
|
|
|
|
{
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_IP(hf_afs_vldb_server);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SKIP(4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (i=0; i<8; i++)
|
|
|
|
{
|
|
|
|
char part[8];
|
2001-05-27 01:48:25 +00:00
|
|
|
j = tvb_get_ntohl(tvb, offset);
|
1999-10-20 16:41:20 +00:00
|
|
|
strcpy(part, "/vicepa");
|
2000-06-21 04:41:30 +00:00
|
|
|
if ( i<nservers && j<=25 )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2000-06-21 04:41:30 +00:00
|
|
|
part[6] = 'a' + (char) j;
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree_add_string(tree, hf_afs_vldb_partition, tvb,
|
|
|
|
offset, 4, part);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
SKIP(4);
|
|
|
|
}
|
|
|
|
SKIP(8 * sizeof(guint32));
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_rwvol);
|
|
|
|
OUT_UINT(hf_afs_vldb_rovol);
|
|
|
|
OUT_UINT(hf_afs_vldb_bkvol);
|
2002-02-03 18:12:04 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_clonevol);
|
|
|
|
OUT_VLDB_Flags();
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 505: /* get new volume id */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_id);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 521: /* list entry */
|
|
|
|
case 529: /* list entry U */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_count);
|
|
|
|
OUT_UINT(hf_afs_vldb_nextindex);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 518: /* get entry by id n */
|
|
|
|
case 519: /* get entry by name N */
|
|
|
|
{
|
|
|
|
int nservers,i,j;
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXStringV(hf_afs_vldb_name, VLNAMEMAX);
|
2001-05-27 01:48:25 +00:00
|
|
|
nservers = tvb_get_ntohl(tvb, offset);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_numservers);
|
1999-10-20 16:41:20 +00:00
|
|
|
for (i=0; i<13; i++)
|
|
|
|
{
|
|
|
|
if ( i<nservers )
|
|
|
|
{
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_IP(hf_afs_vldb_server);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SKIP(4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (i=0; i<13; i++)
|
|
|
|
{
|
|
|
|
char part[8];
|
2001-05-27 01:48:25 +00:00
|
|
|
j = tvb_get_ntohl(tvb, offset);
|
1999-10-20 16:41:20 +00:00
|
|
|
strcpy(part, "/vicepa");
|
2000-06-21 04:41:30 +00:00
|
|
|
if ( i<nservers && j<=25 )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2000-06-21 04:41:30 +00:00
|
|
|
part[6] = 'a' + (char) j;
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree_add_string(tree, hf_afs_vldb_partition, tvb,
|
|
|
|
offset, 4, part);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
SKIP(4);
|
|
|
|
}
|
|
|
|
SKIP(13 * sizeof(guint32));
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_rwvol);
|
|
|
|
OUT_UINT(hf_afs_vldb_rovol);
|
|
|
|
OUT_UINT(hf_afs_vldb_bkvol);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 526: /* get entry by id u */
|
|
|
|
case 527: /* get entry by name u */
|
|
|
|
{
|
|
|
|
int nservers,i,j;
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXStringV(hf_afs_vldb_name, VLNAMEMAX);
|
2001-05-27 01:48:25 +00:00
|
|
|
nservers = tvb_get_ntohl(tvb, offset);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_numservers);
|
1999-10-20 16:41:20 +00:00
|
|
|
for (i=0; i<13; i++)
|
|
|
|
{
|
|
|
|
if ( i<nservers )
|
|
|
|
{
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_UUID(hf_afs_vldb_serveruuid);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-02-08 22:36:21 +00:00
|
|
|
SKIP_UUID();
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
for (i=0; i<13; i++)
|
2002-01-18 21:46:51 +00:00
|
|
|
{
|
|
|
|
if ( i<nservers )
|
|
|
|
{
|
|
|
|
OUT_UINT(hf_afs_vldb_serveruniq);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SKIP(sizeof(guint32));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (i=0; i<13; i++)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
|
|
|
char part[8];
|
2001-05-27 01:48:25 +00:00
|
|
|
j = tvb_get_ntohl(tvb, offset);
|
1999-10-20 16:41:20 +00:00
|
|
|
strcpy(part, "/vicepa");
|
2000-06-21 04:41:30 +00:00
|
|
|
if ( i<nservers && j<=25 )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2000-06-21 04:41:30 +00:00
|
|
|
part[6] = 'a' + (char) j;
|
2001-05-27 01:48:25 +00:00
|
|
|
proto_tree_add_string(tree, hf_afs_vldb_partition, tvb,
|
|
|
|
offset, 4, part);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
SKIP(4);
|
|
|
|
}
|
2002-01-18 21:46:51 +00:00
|
|
|
for (i=0; i<13; i++)
|
|
|
|
{
|
|
|
|
if ( i<nservers )
|
|
|
|
{
|
|
|
|
OUT_UINT(hf_afs_vldb_serverflags);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SKIP(sizeof(guint32));
|
|
|
|
}
|
|
|
|
}
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_rwvol);
|
|
|
|
OUT_UINT(hf_afs_vldb_rovol);
|
|
|
|
OUT_UINT(hf_afs_vldb_bkvol);
|
2002-01-18 21:46:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_clonevol);
|
|
|
|
OUT_UINT(hf_afs_vldb_flags);
|
|
|
|
OUT_UINT(hf_afs_vldb_spare1);
|
|
|
|
OUT_UINT(hf_afs_vldb_spare2);
|
|
|
|
OUT_UINT(hf_afs_vldb_spare3);
|
|
|
|
OUT_UINT(hf_afs_vldb_spare4);
|
|
|
|
OUT_UINT(hf_afs_vldb_spare5);
|
|
|
|
OUT_UINT(hf_afs_vldb_spare6);
|
|
|
|
OUT_UINT(hf_afs_vldb_spare7);
|
|
|
|
OUT_UINT(hf_afs_vldb_spare8);
|
|
|
|
OUT_UINT(hf_afs_vldb_spare9);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2001-08-04 04:04:35 +00:00
|
|
|
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_errcode);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-05-02 10:59:37 +00:00
|
|
|
dissect_vldb_request(tvbuff_t *tvb, struct rxinfo *rxinfo _U_, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-05-27 01:48:25 +00:00
|
|
|
offset += 4; /* skip the opcode */
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
case 501: /* create new volume */
|
|
|
|
case 517: /* create entry N */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXStringV(hf_afs_vldb_name, VLNAMEMAX);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 502: /* delete entry */
|
|
|
|
case 503: /* get entry by id */
|
|
|
|
case 507: /* update entry */
|
|
|
|
case 508: /* set lock */
|
|
|
|
case 509: /* release lock */
|
|
|
|
case 518: /* get entry by id */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_id);
|
|
|
|
OUT_UINT(hf_afs_vldb_type);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 504: /* get entry by name */
|
|
|
|
case 519: /* get entry by name N */
|
|
|
|
case 524: /* update entry by name */
|
|
|
|
case 527: /* get entry by name U */
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXString(hf_afs_vldb_name);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 505: /* get new vol id */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_bump);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 506: /* replace entry */
|
|
|
|
case 520: /* replace entry N */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_id);
|
|
|
|
OUT_UINT(hf_afs_vldb_type);
|
2002-02-08 22:36:21 +00:00
|
|
|
OUT_RXStringV(hf_afs_vldb_name, VLNAMEMAX);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
case 510: /* list entry */
|
|
|
|
case 521: /* list entry N */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_vldb_index);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2002-02-08 22:36:21 +00:00
|
|
|
case 532: /* regaddr */
|
|
|
|
OUT_UUID(hf_afs_vldb_serveruuid);
|
|
|
|
OUT_UINT(hf_afs_vldb_spare1);
|
|
|
|
OUT_VLDB_BulkAddr();
|
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* UBIK Helpers
|
|
|
|
*/
|
|
|
|
static void
|
2002-05-02 10:59:37 +00:00
|
|
|
dissect_ubik_reply(tvbuff_t *tvb, struct rxinfo *rxinfo _U_, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-03-23 21:42:37 +00:00
|
|
|
switch ( opcode )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-03-23 21:42:37 +00:00
|
|
|
case 10000: /* vote-beacon */
|
|
|
|
break;
|
|
|
|
case 10001: /* vote-debug-old */
|
2001-03-26 15:27:55 +00:00
|
|
|
OUT_UBIK_DebugOld();
|
2001-03-23 21:42:37 +00:00
|
|
|
break;
|
|
|
|
case 10002: /* vote-sdebug-old */
|
2001-03-26 15:27:55 +00:00
|
|
|
OUT_UBIK_SDebugOld();
|
2001-03-23 21:42:37 +00:00
|
|
|
break;
|
|
|
|
case 10003: /* vote-get syncsite */
|
|
|
|
break;
|
|
|
|
case 10004: /* vote-debug */
|
2001-03-26 15:27:55 +00:00
|
|
|
OUT_UBIK_DebugOld();
|
|
|
|
OUT_UBIK_InterfaceAddrs();
|
2001-03-23 21:42:37 +00:00
|
|
|
break;
|
|
|
|
case 10005: /* vote-sdebug */
|
2001-03-26 15:27:55 +00:00
|
|
|
OUT_UBIK_SDebugOld();
|
|
|
|
OUT_UBIK_InterfaceAddrs();
|
2001-03-23 21:42:37 +00:00
|
|
|
break;
|
|
|
|
case 10006: /* vote-xdebug */
|
2001-03-26 15:27:55 +00:00
|
|
|
OUT_UBIK_DebugOld();
|
|
|
|
OUT_UBIK_InterfaceAddrs();
|
|
|
|
OUT_UINT(hf_afs_ubik_isclone);
|
2001-03-23 21:42:37 +00:00
|
|
|
break;
|
|
|
|
case 10007: /* vote-xsdebug */
|
2001-03-26 15:27:55 +00:00
|
|
|
OUT_UBIK_SDebugOld();
|
|
|
|
OUT_UBIK_InterfaceAddrs();
|
|
|
|
OUT_UINT(hf_afs_ubik_isclone);
|
2001-03-23 21:42:37 +00:00
|
|
|
break;
|
|
|
|
case 20000: /* disk-begin */
|
|
|
|
break;
|
|
|
|
case 20004: /* get version */
|
|
|
|
OUT_UBIKVERSION("DB Version");
|
|
|
|
break;
|
|
|
|
case 20010: /* disk-probe */
|
|
|
|
break;
|
2001-03-26 15:27:55 +00:00
|
|
|
case 20012: /* disk-interfaceaddr */
|
|
|
|
OUT_UBIK_InterfaceAddrs();
|
|
|
|
break;
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-05-02 10:59:37 +00:00
|
|
|
dissect_ubik_request(tvbuff_t *tvb, struct rxinfo *rxinfo _U_, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-05-27 01:48:25 +00:00
|
|
|
offset += 4; /* skip the opcode */
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
2001-03-23 21:42:37 +00:00
|
|
|
case 10000: /* vote-beacon */
|
|
|
|
OUT_UINT(hf_afs_ubik_state);
|
2003-01-18 02:18:39 +00:00
|
|
|
OUT_TIMESECS(hf_afs_ubik_votestart);
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UBIKVERSION("DB Version");
|
|
|
|
OUT_UBIKVERSION("TID");
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2001-03-23 21:42:37 +00:00
|
|
|
case 10001: /* vote-debug-old */
|
|
|
|
break;
|
|
|
|
case 10002: /* vote-sdebug-old */
|
|
|
|
OUT_UINT(hf_afs_ubik_site);
|
|
|
|
break;
|
|
|
|
case 10003: /* vote-get sync site */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_IP(hf_afs_ubik_site);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2001-03-23 21:42:37 +00:00
|
|
|
case 10004: /* vote-debug */
|
|
|
|
case 10005: /* vote-sdebug */
|
|
|
|
OUT_IP(hf_afs_ubik_site);
|
|
|
|
break;
|
|
|
|
case 20000: /* disk-begin */
|
|
|
|
OUT_UBIKVERSION("TID");
|
|
|
|
break;
|
|
|
|
case 20001: /* disk-commit */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UBIKVERSION("TID");
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2001-03-23 21:42:37 +00:00
|
|
|
case 20002: /* disk-lock */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UBIKVERSION("TID");
|
|
|
|
OUT_UINT(hf_afs_ubik_file);
|
|
|
|
OUT_UINT(hf_afs_ubik_pos);
|
|
|
|
OUT_UINT(hf_afs_ubik_length);
|
|
|
|
OUT_UINT(hf_afs_ubik_locktype);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2001-03-23 21:42:37 +00:00
|
|
|
case 20003: /* disk-write */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UBIKVERSION("TID");
|
|
|
|
OUT_UINT(hf_afs_ubik_file);
|
|
|
|
OUT_UINT(hf_afs_ubik_pos);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2001-03-23 21:42:37 +00:00
|
|
|
case 20004: /* disk-get version */
|
|
|
|
break;
|
|
|
|
case 20005: /* disk-get file */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_ubik_file);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2001-03-23 21:42:37 +00:00
|
|
|
case 20006: /* disk-send file */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_ubik_file);
|
|
|
|
OUT_UINT(hf_afs_ubik_length);
|
|
|
|
OUT_UBIKVERSION("DB Version");
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2001-03-23 21:42:37 +00:00
|
|
|
case 20007: /* disk-abort */
|
|
|
|
case 20008: /* disk-release locks */
|
|
|
|
case 20010: /* disk-probe */
|
|
|
|
break;
|
|
|
|
case 20009: /* disk-truncate */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UBIKVERSION("TID");
|
|
|
|
OUT_UINT(hf_afs_ubik_file);
|
|
|
|
OUT_UINT(hf_afs_ubik_length);
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
2001-03-23 21:42:37 +00:00
|
|
|
case 20011: /* disk-writev */
|
|
|
|
OUT_UBIKVERSION("TID");
|
|
|
|
break;
|
2001-03-26 15:27:55 +00:00
|
|
|
case 20012: /* disk-interfaceaddr */
|
|
|
|
OUT_UBIK_InterfaceAddrs();
|
|
|
|
break;
|
|
|
|
case 20013: /* disk-set version */
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UBIKVERSION("TID");
|
|
|
|
OUT_UBIKVERSION("Old DB Version");
|
|
|
|
OUT_UBIKVERSION("New DB Version");
|
1999-10-20 16:41:20 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* BACKUP Helpers
|
|
|
|
*/
|
|
|
|
static void
|
2001-08-04 04:04:35 +00:00
|
|
|
dissect_backup_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-08-04 04:04:35 +00:00
|
|
|
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2001-08-04 04:04:35 +00:00
|
|
|
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2000-11-03 17:32:51 +00:00
|
|
|
OUT_UINT(hf_afs_backup_errcode);
|
1999-10-20 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-05-02 10:59:37 +00:00
|
|
|
dissect_backup_request(tvbuff_t *tvb _U_, struct rxinfo *rxinfo _U_, proto_tree *tree _U_, int offset, int opcode)
|
1999-10-20 16:41:20 +00:00
|
|
|
{
|
2001-05-27 01:48:25 +00:00
|
|
|
offset += 4; /* skip the opcode */
|
1999-10-20 16:41:20 +00:00
|
|
|
|
|
|
|
switch ( opcode )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Registration code for registering the protocol and fields
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_afs(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
2000-11-03 17:32:51 +00:00
|
|
|
#include "packet-afs-register-info.h"
|
1999-10-20 16:41:20 +00:00
|
|
|
};
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_afs,
|
|
|
|
&ett_afs_op,
|
|
|
|
&ett_afs_acl,
|
|
|
|
&ett_afs_fid,
|
|
|
|
&ett_afs_callback,
|
|
|
|
&ett_afs_ubikver,
|
2000-11-03 17:32:51 +00:00
|
|
|
&ett_afs_status,
|
|
|
|
&ett_afs_status_mask,
|
|
|
|
&ett_afs_volsync,
|
|
|
|
&ett_afs_volumeinfo,
|
|
|
|
&ett_afs_vicestat,
|
2002-02-03 18:12:04 +00:00
|
|
|
&ett_afs_vldb_flags,
|
1999-11-16 11:44:20 +00:00
|
|
|
};
|
1999-10-20 16:41:20 +00:00
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_afs = proto_register_protocol("Andrew File System (AFS)",
|
|
|
|
"AFS (RX)", "afs");
|
1999-10-20 16:41:20 +00:00
|
|
|
proto_register_field_array(proto_afs, hf, array_length(hf));
|
1999-11-16 11:44:20 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
Provide a general mechanism by which dissectors can register "init"
routines, which are called before a dissection pass is made over all the
packets in a capture - the "init" routine would clear out any state
information that needs to be initialized before such a dissection pass.
Make the NCP, SMB, AFS, and ONC RPC dissectors register their "init"
routines with that mechanism, have the code that reads in a capture file
call the routine that calls all registered "init" routines rather than
calling a wired-in set of "init" routines, and also have the code that
runs a filtering or colorizing pass over all the packets call that
routine, as a filtering or colorizing pass is a dissection pass.
Have the ONC RPC "init" routine zero out the table of RPC calls, so that
it completely erases any state from the previous dissection pass (so
that, for example, if you run a filtering pass, it doesn't mark any
non-duplicate packets as duplicates because it remembers them from the
previous pass).
svn path=/trunk/; revision=1050
1999-11-17 21:58:33 +00:00
|
|
|
register_init_routine(&afs_init_protocol);
|
2001-05-27 01:48:25 +00:00
|
|
|
|
2001-05-27 05:00:17 +00:00
|
|
|
register_dissector("afs", dissect_afs, proto_afs);
|
|
|
|
}
|