PIDL (DCERPC winreg): enhance dissector

* Fix PIDL generator for NOEMIT Element (fix -Wunused-function for DCERPC winreg dissector)
* Fix indent (use tabs)
* Remove DCERPC winreg dissector from DIRTY list

Change-Id: I5d16cbfe8481a5e5f7e5df9b51735c93ae4375a7
Reviewed-on: https://code.wireshark.org/review/4322
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Alexis La Goutte 2014-09-26 23:29:43 +02:00 committed by Michael Mann
parent e759d8272b
commit 28ec9c29ea
5 changed files with 13 additions and 24 deletions

View File

@ -174,6 +174,7 @@ set(PIDL_DISSECTOR_SRC
dissectors/packet-dcerpc-nspi.c
dissectors/packet-dcerpc-rfr.c
dissectors/packet-dcerpc-srvsvc.c
dissectors/packet-dcerpc-winreg.c
dissectors/packet-dcerpc-wkssvc.c
dissectors/packet-dcerpc-wzcsvc.c
)
@ -185,7 +186,7 @@ set(DIRTY_PIDL_DISSECTOR_SRC
dissectors/packet-dcerpc-mapi.c
dissectors/packet-dcerpc-mdssvc.c
dissectors/packet-dcerpc-misc.c
dissectors/packet-dcerpc-winreg.c
)
set(ASN1_DISSECTOR_SRC
dissectors/packet-acp133.c

View File

@ -55,9 +55,11 @@ PIDL_DISSECTOR_SRC = \
packet-dcerpc-nspi.c \
packet-dcerpc-rfr.c \
packet-dcerpc-srvsvc.c \
packet-dcerpc-winreg.c \
packet-dcerpc-wkssvc.c \
packet-dcerpc-wzcsvc.c
#
# PIDL-generated DCE RPC dissectors with warnings.
#
@ -69,8 +71,8 @@ DIRTY_PIDL_DISSECTOR_SRC = \
packet-dcerpc-lsa.c \
packet-dcerpc-mapi.c \
packet-dcerpc-mdssvc.c \
packet-dcerpc-misc.c \
packet-dcerpc-winreg.c
packet-dcerpc-misc.c
#
# Headers for PIDL-generated dissectors.

View File

@ -243,7 +243,6 @@ static int winreg_dissect_element_String_name(tvbuff_t *tvb _U_, int offset _U_,
static int winreg_dissect_element_String_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
static int winreg_dissect_element_KeySecurityData_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
static int winreg_dissect_element_KeySecurityData_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
static int winreg_dissect_element_KeySecurityData_data__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
static int winreg_dissect_element_KeySecurityData_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
static int winreg_dissect_element_KeySecurityData_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
static int winreg_dissect_element_SecBuf_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
@ -598,12 +597,9 @@ winreg_dissect_element_KeySecurityData_data_(tvbuff_t *tvb, int offset, packet_i
return offset;
}
/* this is a varying and conformant array */
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep,
hf_winreg_sd_max_size, NULL);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep,
hf_winreg_sd_offset, NULL);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep,
hf_winreg_sd_actual_size, &len);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep, hf_winreg_sd_max_size, NULL);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep, hf_winreg_sd_offset, NULL);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep, hf_winreg_sd_actual_size, &len);
dissect_nt_sec_desc(tvb, offset, pinfo, tree, drep, TRUE, len,
&winreg_access_mask_info);
offset += len;
@ -782,14 +778,6 @@ winreg_dissect_element_KeySecurityData_data(tvbuff_t *tvb _U_, int offset _U_, p
return offset;
}
static int
winreg_dissect_element_KeySecurityData_data__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, di, drep, hf_winreg_KeySecurityData_data, 0);
return offset;
}
static int
winreg_dissect_element_KeySecurityData_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{

View File

@ -166,12 +166,9 @@ winreg_dissect_element_KeySecurityData_data_(tvbuff_t *tvb, int offset, packet_i
}
/* this is a varying and conformant array */
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep,
hf_winreg_sd_max_size, NULL);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep,
hf_winreg_sd_offset, NULL);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep,
hf_winreg_sd_actual_size, &len);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep, hf_winreg_sd_max_size, NULL);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep, hf_winreg_sd_offset, NULL);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep, hf_winreg_sd_actual_size, &len);
dissect_nt_sec_desc(tvb, offset, pinfo, tree, drep, TRUE, len,
&winreg_access_mask_info);

View File

@ -483,6 +483,7 @@ sub Element($$$$$$)
}
}
next if ($_->{TYPE} eq "SWITCH");
next if (defined($self->{conformance}->{noemit}->{"$dissectorname$add"}));
$self->pidl_def("static int $dissectorname$add(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_$moreparam);");
$self->pidl_fn_start("$dissectorname$add");
$self->pidl_code("static int");