diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2019-02-16 11:52:21 +0000 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2019-02-16 23:20:21 +0000 |
commit | ea7b7f052c246008a5fba5a476f27ca087eaf285 (patch) | |
tree | 9a5b775dfa2df4240b093db488d4e4bb66071515 /tools | |
parent | 29ac5a9e61edcde7d7f517be3b9734bf29ad8dc9 (diff) |
ASN1: Also show root node for exports.
For now, only apply to nr-rrc.
Change-Id: I9be4bc5c3af33acad76c0a24ac04547e5f302c73
Reviewed-on: https://code.wireshark.org/review/32058
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/asn2wrs.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py index 477ded4ae4..bc02a91df0 100755 --- a/tools/asn2wrs.py +++ b/tools/asn2wrs.py @@ -1497,6 +1497,13 @@ class EthCtx: out += ');\n' return out + def output_proto_root(self): + out = '' + if self.conform.proto_root_name: + out += ' proto_item *prot_ti = proto_tree_add_item(tree, ' + self.conform.proto_root_name + ', tvb, 0, -1, ENC_NA);\n' + out += ' PROTO_ITEM_SET_HIDDEN(prot_ti);\n' + return out + #--- eth_type_fn_hdr -------------------------------------------------------- def eth_type_fn_hdr(self, tname): out = '\n' @@ -1510,10 +1517,8 @@ class EthCtx: #if self.conform.get_fn_presence(tname): # out += self.conform.get_fn_text(tname, 'FN_HDR') #el - if self.conform.check_item('PDU', tname) and self.conform.proto_root_name: - out += ' proto_item *prot_ti = proto_tree_add_item(tree, ' + self.conform.proto_root_name + ', tvb, 0, -1, ENC_NA);\n' - out += ' PROTO_ITEM_SET_HIDDEN(prot_ti);\n' - + if self.conform.check_item('PDU', tname): + out += self.output_proto_root() if self.conform.get_fn_presence(self.eth_type[tname]['ref'][0]): out += self.conform.get_fn_text(self.eth_type[tname]['ref'][0], 'FN_HDR') @@ -1744,6 +1749,8 @@ class EthCtx: out += 'static ' out += 'int ' out += 'dissect_'+f+'(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {\n' + out += self.output_proto_root() + out += ' int offset = 0;\n' off_par = 'offset' ret_par = 'offset' |