summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-vxi11.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-vxi11.c')
-rw-r--r--epan/dissectors/packet-vxi11.c64
1 files changed, 22 insertions, 42 deletions
diff --git a/epan/dissectors/packet-vxi11.c b/epan/dissectors/packet-vxi11.c
index 1a5f867c85..eb5ee3426e 100644
--- a/epan/dissectors/packet-vxi11.c
+++ b/epan/dissectors/packet-vxi11.c
@@ -324,21 +324,18 @@ dissect_reason(tvbuff_t *tvb, int offset, proto_tree *tree)
static int
dissect_create_link_parms(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
const char *str;
+ int offset = 0;
offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_client_id, offset);
offset = dissect_rpc_bool(tvb, tree, hf_vxi11_core_lock_device, offset);
offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lock_timeout, offset);
offset = dissect_rpc_string(tvb, tree, hf_vxi11_core_device, offset, &str);
- if (tree)
- {
- proto_item_append_text(tree, " (Create_LinkParms) %s", str);
- }
+ proto_item_append_text(tree, " (Create_LinkParms) %s", str);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", str);
return offset;
@@ -346,11 +343,11 @@ dissect_create_link_parms(tvbuff_t *tvb,
static int
dissect_create_link_resp(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
guint32 error, lid;
+ int offset = 0;
offset = dissect_error(tvb, offset, pinfo, tree, "Create_LinkResp", &error);
@@ -362,10 +359,7 @@ dissect_create_link_resp(tvbuff_t *tvb,
if (error == VXI11_CORE_ERROR_NO_ERROR)
{
- if (tree)
- {
- proto_item_append_text(tree, " LID=%d", lid);
- }
+ proto_item_append_text(tree, " LID=%d", lid);
col_append_fstr(pinfo->cinfo, COL_INFO, " LID=%d", lid);
}
@@ -374,28 +368,24 @@ dissect_create_link_resp(tvbuff_t *tvb,
static int
dissect_device_SRQ_parms(tvbuff_t *tvb,
- int offset,
packet_info *pinfo _U_,
proto_tree *tree, void* data _U_)
{
- offset = dissect_rpc_opaque_data(tvb, offset, tree, NULL, hf_vxi11_intr_handle, FALSE, 0, FALSE, NULL, NULL);
+ int offset = dissect_rpc_opaque_data(tvb, 0, tree, NULL, hf_vxi11_intr_handle, FALSE, 0, FALSE, NULL, NULL);
- if (tree)
- {
- proto_item_append_text(tree, " (Device_SrqParms)");
- }
+ proto_item_append_text(tree, " (Device_SrqParms)");
return offset;
}
static int
dissect_device_docmd_parms(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
guint32 lid, cmd;
const gchar *cmdstr;
+ int offset = 0;
lid = tvb_get_ntohl(tvb, offset);
offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset);
@@ -423,11 +413,11 @@ dissect_device_docmd_parms(tvbuff_t *tvb,
static int
dissect_device_docmd_resp(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
guint32 error;
+ int offset = 0;
offset = dissect_error(tvb, offset, pinfo, tree, "Device_DocmdResp", &error);
offset = dissect_rpc_opaque_data(tvb, offset, tree, NULL, hf_vxi11_core_data, FALSE, 0, FALSE, NULL, NULL);
@@ -437,10 +427,10 @@ dissect_device_docmd_resp(tvbuff_t *tvb,
static int
dissect_device_enable_SRQ_parms(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
+ int offset = 0;
guint32 lid = tvb_get_ntohl(tvb, offset);
offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset);
@@ -458,21 +448,20 @@ dissect_device_enable_SRQ_parms(tvbuff_t *tvb,
static int
dissect_device_error(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
guint32 error;
- return dissect_error(tvb, offset, pinfo, tree, "Device_Error", &error);
+ return dissect_error(tvb, 0, pinfo, tree, "Device_Error", &error);
}
static int
dissect_device_generic_parms(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
+ int offset = 0;
guint32 lid = tvb_get_ntohl(tvb, offset);
offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset);
@@ -491,10 +480,10 @@ dissect_device_generic_parms(tvbuff_t *tvb,
static int
dissect_device_link(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
+ int offset = 0;
guint32 lid = tvb_get_ntohl(tvb, offset);
offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset);
@@ -510,10 +499,10 @@ dissect_device_link(tvbuff_t *tvb,
static int
dissect_device_lock_parms(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
+ int offset = 0;
guint32 lid = tvb_get_ntohl(tvb, offset);
offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset);
@@ -531,10 +520,10 @@ dissect_device_lock_parms(tvbuff_t *tvb,
static int
dissect_device_read_parms(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
+ int offset = 0;
guint32 lid = tvb_get_ntohl(tvb, offset);
offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset);
@@ -544,10 +533,7 @@ dissect_device_read_parms(tvbuff_t *tvb,
offset = dissect_flags(tvb, offset, tree);
offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_term_char, offset);
- if (tree)
- {
- proto_item_append_text(tree, " (Device_ReadParms) LID=%d", lid);
- }
+ proto_item_append_text(tree, " (Device_ReadParms) LID=%d", lid);
col_append_fstr(pinfo->cinfo, COL_INFO, " LID=%d", lid);
return offset;
@@ -555,11 +541,11 @@ dissect_device_read_parms(tvbuff_t *tvb,
static int
dissect_device_read_resp(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
guint32 error;
+ int offset = 0;
guint32 datalength = 0;
offset = dissect_error(tvb, offset, pinfo, tree, "Device_ReadResp", &error);
@@ -577,11 +563,11 @@ dissect_device_read_resp(tvbuff_t *tvb,
static int
dissect_device_readstb_resp(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
guint32 error, stb;
+ int offset = 0;
offset = dissect_error(tvb, offset, pinfo, tree, "Device_ReadStbResp", &error);
@@ -590,10 +576,7 @@ dissect_device_readstb_resp(tvbuff_t *tvb,
if (error == VXI11_CORE_ERROR_NO_ERROR)
{
- if (tree)
- {
- proto_item_append_text(tree, " STB=0x%02x", stb);
- }
+ proto_item_append_text(tree, " STB=0x%02x", stb);
col_append_fstr(pinfo->cinfo, COL_INFO, " STB=0x%02x", stb);
}
@@ -602,12 +585,12 @@ dissect_device_readstb_resp(tvbuff_t *tvb,
static int
dissect_device_remote_func(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
guint32 port;
const gchar *addrstr;
+ int offset = 0;
addrstr = tvb_ip_to_str(tvb, offset);
offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_host_addr, offset);
@@ -619,10 +602,7 @@ dissect_device_remote_func(tvbuff_t *tvb,
offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_prog_vers, offset);
offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_prog_family, offset);
- if (tree)
- {
- proto_item_append_text(tree, " (Device_RemoteFunc) %s:%d", addrstr, port);
- }
+ proto_item_append_text(tree, " (Device_RemoteFunc) %s:%d", addrstr, port);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s:%d", addrstr, port);
return offset;
@@ -630,11 +610,11 @@ dissect_device_remote_func(tvbuff_t *tvb,
static int
dissect_device_write_parms(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
guint32 datalength = 0;
+ int offset = 0;
guint32 lid = tvb_get_ntohl(tvb, offset);
offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset);
@@ -659,11 +639,11 @@ dissect_device_write_parms(tvbuff_t *tvb,
static int
dissect_device_write_resp(tvbuff_t *tvb,
- int offset,
packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
guint32 error;
+ int offset = 0;
offset = dissect_error(tvb, offset, pinfo, tree, "Device_WriteResp", &error);
offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_size, offset);