typedef struct vir_dissector_index vir_dissector_index_t;
struct vir_dissector_index {
- guint32 proc;
+ int32_t proc;
vir_xdr_dissector_t args;
vir_xdr_dissector_t ret;
vir_xdr_dissector_t msg;
}
static vir_xdr_dissector_t
-find_payload_dissector(guint32 proc, guint32 type,
- const vir_dissector_index_t *pds, gsize length)
+find_payload_dissector(int32_t proc,
+ enum vir_net_message_type type,
+ const vir_dissector_index_t *pds,
+ gsize length)
{
const vir_dissector_index_t *pd;
guint32 first, last, direction;
return pd->ret;
case VIR_NET_MESSAGE:
return pd->msg;
+ case VIR_NET_STREAM:
+ case VIR_NET_STREAM_HOLE:
+ /* Handled elsewhere */
+ return NULL;
}
return NULL;
}
#include "libvirt/protocol.h"
static void
-dissect_libvirt_payload(tvbuff_t *tvb, proto_tree *tree,
- guint32 prog, guint32 proc, guint32 type, guint32 status)
+dissect_libvirt_payload(tvbuff_t *tvb,
+ proto_tree *tree,
+ uint32_t prog,
+ int32_t proc,
+ int32_t type,
+ int32_t status)
{
gssize payload_length;
return;
unknown:
- dbg("Cannot determine payload: Prog=%u, Proc=%u, Type=%u, Status=%u", prog, proc, type, status);
+ dbg("Cannot determine payload: Prog=%u, Proc=%d, Type=%d, Status=%d",
+ prog, proc, type, status);
proto_tree_add_item(tree, hf_libvirt_unknown, tvb, VIR_HEADER_LEN, -1, ENC_NA);
}
void *opaque G_GNUC_UNUSED)
{
goffset offset;
- guint32 prog, proc, type, serial, status;
+ uint32_t prog, serial;
+ int32_t proc, type, status;
const value_string *vs;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Libvirt");
offset = 4; /* End of length field */
prog = tvb_get_ntohl(tvb, offset); offset += 4;
offset += 4; /* Ignore version header field */
- proc = tvb_get_ntohl(tvb, offset); offset += 4;
- type = tvb_get_ntohl(tvb, offset); offset += 4;
+ proc = tvb_get_ntohil(tvb, offset); offset += 4;
+ type = tvb_get_ntohil(tvb, offset); offset += 4;
serial = tvb_get_ntohl(tvb, offset); offset += 4;
- status = tvb_get_ntohl(tvb, offset); offset += 4;
+ status = tvb_get_ntohil(tvb, offset); offset += 4;
col_add_fstr(pinfo->cinfo, COL_INFO, "Prog=%s",
val_to_str(prog, program_strings, "%x"));
vs = get_program_data(prog, VIR_PROGRAM_PROCSTRINGS);
if (vs == NULL) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " Proc=%u", proc);
+ col_append_fstr(pinfo->cinfo, COL_INFO, " Proc=%d", proc);
} else {
col_append_fstr(pinfo->cinfo, COL_INFO, " Proc=%s", val_to_str(proc, vs, "%d"));
}