summaryrefslogtreecommitdiff
path: root/tools/wireshark_gen.py
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2015-05-01 11:36:14 +0200
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2015-05-01 09:38:29 +0000
commit0d7087cc4ca0f3cccb39672ea014117e8b9e1f40 (patch)
treefd6798af2465e13a875a49dc03678ef214a34ed2 /tools/wireshark_gen.py
parent3ca9318d8215738b8d4edcde0598226cfc6cf031 (diff)
downloadwireshark-0d7087cc4ca0f3cccb39672ea014117e8b9e1f40.tar.gz
Revert "Fix the need to manually adjust packet-gias.c"
This reverts commit 3ca9318d8215738b8d4edcde0598226cfc6cf031. Mac OS X buildbot are not happy packet-gias.c:356: warning: 'hf_UCO_InvalidInputParameter_details' defined but not used packet-gias.c:359: warning: 'hf_UCO_ProcessingFault_details' defined but not used packet-gias.c:360: warning: 'hf_UCO_SystemFault_details' defined but not used packet-gias.c:5275: warning: 'decode_UCO_Ratio_st' defined but not used packet-gias.c:5303: warning: 'decode_UCO_DirectAccessLocation_st' defined but not used packet-gias.c:5588: warning: 'decode_UCO_Coordinate3d_st' defined but not used packet-gias.c:5612: warning: 'decode_UCO_Circle_st' defined but not used packet-gias.c:5625: warning: 'decode_UCO_Ellipse_st' defined but not used packet-gias.c:5656: warning: 'decode_UCO_SimpleGSImage_st' defined but not used packet-gias.c:5671: warning: 'decode_UCO_SimpleCImage_st' defined but not used packet-gias.c:5694: warning: 'decode_UCO_CompressedImage_st' defined but not used packet-gias.c:5836: warning: 'decode_GIAS_ImageSpec_st' defined but not used Change-Id: Iee076c00eb4e48571a99f6b854b7e3e52983c2f8 Reviewed-on: https://code.wireshark.org/review/8265 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'tools/wireshark_gen.py')
-rwxr-xr-xtools/wireshark_gen.py69
1 files changed, 9 insertions, 60 deletions
diff --git a/tools/wireshark_gen.py b/tools/wireshark_gen.py
index a922e07229..3028825fef 100755
--- a/tools/wireshark_gen.py
+++ b/tools/wireshark_gen.py
@@ -397,8 +397,6 @@ class wireshark_gen_C:
for m in ex.members():
for decl in m.declarators():
if (m.memberType().unalias().kind() == idltype.tk_sequence):
- if (self.isSeqNativeType(m.memberType().unalias().seqType())):
- self.st.out(self.template_hf, name=sname + "_" + decl.identifier())
self.st.out(self.template_hf, name=sname + "_" + decl.identifier() + "_loop")
else:
self.st.out(self.template_hf, name=sname + "_" + decl.identifier())
@@ -771,33 +769,19 @@ class wireshark_gen_C:
if self.DEBUG:
print "XXX genExHelper"
- # check to see if we need an item
- need_item = 0
- for m in ex.members():
- if (self.isItemVarType(m.memberType())):
- need_item = 1
- break
-
-
sname = self.namespace(ex, "_")
self.curr_sname = sname # update current opnode/exnode scoped name
if not self.fn_hash_built:
self.fn_hash[sname] = [] # init empty list as val for this sname key
# but only if the fn_hash is not already built
- if (need_item):
- self.st.out(self.template_exception_helper_function_start_item, sname=sname, exname=ex.repoId())
- else:
- self.st.out(self.template_exception_helper_function_start_no_item, sname=sname, exname=ex.repoId())
+ self.st.out(self.template_exception_helper_function_start, sname=sname, exname=ex.repoId())
self.st.inc_indent()
if (len(self.fn_hash[sname]) > 0):
self.st.out(self.template_helper_function_vars_start)
self.dumpCvars(sname)
- if (need_item):
- self.st.out(self.template_helper_function_vars_end_item )
- else:
- self.st.out(self.template_helper_function_vars_end )
+ self.st.out(self.template_helper_function_vars_end )
for m in ex.members():
if self.DEBUG:
@@ -1131,26 +1115,6 @@ class wireshark_gen_C:
else:
return 0
- def isItemVarType(self,type):
-
- pt = type.unalias().kind() # param CDR type
-
- if self.DEBUG:
- print "XXX isItemVarType: kind = " , pt
-
- elif pt == idltype.tk_fixed:
- return 1
- elif pt == idltype.tk_any:
- return 1
- elif pt == idltype.tk_enum:
- return 1
- elif pt == idltype.tk_struct:
- return 1
- elif pt == idltype.tk_sequence:
- return 1
- else:
- return 0
-
#
# getCDR()
@@ -1411,7 +1375,7 @@ class wireshark_gen_C:
elif pt == idltype.tk_alias:
if self.DEBUG:
print "XXXXX Alias type hf XXXXX " , type
- self.get_CDR_alias_hf(type,desc,filter,pn)
+ self.get_CDR_alias_hf(type,pn)
else:
self.genWARNING("Unknown typecode = " + '%i ' % pt) # put comment in source code
@@ -1482,7 +1446,7 @@ class wireshark_gen_C:
if (self.isSeqNativeType(type.unalias().seqType())):
self.getCDR_hf(type.unalias().seqType(),desc,filter,pn)
- def get_CDR_alias_hf(self,type,desc,filter,pn):
+ def get_CDR_alias_hf(self,type,pn):
if self.DEBUG:
print "XXX get_CDR_alias_hf, type = " ,type , " pn = " , pn
print "XXX get_CDR_alias_hf, type.decl() = " ,type.decl()
@@ -1498,7 +1462,7 @@ class wireshark_gen_C:
#self.st.out(self.template_get_CDR_array_start, aname=pn, aval=string_indices)
#self.addvar(self.c_i + pn + ";")
#self.st.inc_indent()
- self.getCDR_hf(type.decl().alias().aliasType(), desc, filter, pn )
+ self.getCDR_hf(type.decl().alias().aliasType(), pn )
#self.st.dec_indent()
#self.st.out(self.template_get_CDR_array_end)
@@ -1509,7 +1473,7 @@ class wireshark_gen_C:
print "XXX get_CDR_alias_hf, type = " ,type , " pn = " , pn
print "XXX get_CDR_alias_hf, type.decl() = " ,type.decl()
- self.getCDR_hf(type, desc, filter, decl.identifier() )
+ self.getCDR_hf(type, decl.identifier() )
#
@@ -1800,13 +1764,10 @@ class wireshark_gen_C:
#
def get_CDR_sequence_octet(self,type, pn):
- if self.DEBUG:
- print "XXX get_CDR_sequence_octet"
-
self.st.out(self.template_get_CDR_sequence_length, seqname=pn)
self.st.out(self.template_get_CDR_sequence_octet, seqname=pn)
self.addvar(self.c_i_lim + pn + ";")
- self.addvar("const gchar * binary_seq_" + pn + ";")
+ self.addvar("gchar * binary_seq_" + pn + ";")
self.addvar("gchar * text_seq_" + pn + ";")
@@ -2069,9 +2030,6 @@ class wireshark_gen_C:
(void)item; /* Avoid coverity param_set_but_unused parse warning */
"""
- template_helper_function_vars_end_item = """\
-/* Operation specific Variable declarations End */
-"""
template_helper_function_start = """\
static void
@@ -2482,7 +2440,6 @@ for (i_@aname@=0; i_@aname@ < @aval@; i_@aname@++) {
{&hf_@hfname@_loop, {"Seq length of @descname@","giop-@dissector_name@.@filtername@.size",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},"""
template_get_CDR_sequence_octet_hf = """\
- {&hf_@hfname@_loop, {"Seq length of @descname@","giop-@dissector_name@.@filtername@.size",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL}},
{&hf_@hfname@, {"@descname@","giop-@dissector_name@.@filtername@",FT_UINT8,BASE_HEX,NULL,0x0,NULL,HFILL}},"""
#
@@ -2743,7 +2700,7 @@ if (strcmp(header->exception_id, "@exname@") == 0) {
#
- template_exception_helper_function_start_no_item = """\
+ template_exception_helper_function_start = """\
/* Exception = @exname@ */
static void
decode_ex_@sname@(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, const gchar *operation _U_, gboolean stream_is_big_endian _U_)
@@ -2751,14 +2708,6 @@ decode_ex_@sname@(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U
proto_item *item _U_;
"""
- template_exception_helper_function_start_item = """\
-/* Exception = @exname@ */
-static void
-decode_ex_@sname@(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, const gchar *operation _U_, gboolean stream_is_big_endian _U_)
-{
- proto_item *item = NULL;
-"""
-
template_exception_helper_function_end = """\
}
"""
@@ -3039,7 +2988,7 @@ decode_@name@_st(tvb, pinfo, tree, item, offset, header, operation, stream_is_bi
/* Union = @unname@ */
static void decode_@name@_un(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, const gchar *operation _U_, gboolean stream_is_big_endian _U_);
"""
- template_decode_union = """\
+ template_decode_union = """
decode_@name@_un(tvb, pinfo, tree, offset, header, operation, stream_is_big_endian);
"""