Wireshark-dev: Re: [Wireshark-dev] asn2wrs #.TABLE

From: "Anders Broman" <a.broman@xxxxxxxxx>
Date: Mon, 26 Nov 2007 22:12:18 +0100
Hi,

They *should* be the same 

# line 179 of MTSAbstractservice ABSTRACT-OPERATION ::= OPERATION

I suppose a workaround could be to rename ABSTRACT-OPERATION to OPERATION in
the ASN1 file…

/Anders

 

  _____  

Från: wireshark-dev-bounces@xxxxxxxxxxxxx
[mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] För Kukosa, Tomas
Skickat: den 26 november 2007 19:56
Till: Developer support list for Wireshark
Ämne: Re: [Wireshark-dev] asn2wrs #.TABLE

 

Hello Graeme,

 

it is not your error.

 

The asn2wrs really supports #.TABLE only for built-it classes
(TYPE-IDENTIFIER, ABSTRACT-SYNTAX, OPERATION, ERROR).

I would like to support at least "OPERATION-like" classes but it will take
some time.

 

Best regards,

  Tomas

 

 

  _____  

Od: wireshark-dev-bounces@xxxxxxxxxxxxx za uživatele Graeme Lunt
Odesláno: po 26.11.2007 18:38
Komu: 'Developer support list for Wireshark'
Předmět: [Wireshark-dev] asn2wrs #.TABLE

Tomas, Anders,

I am trying to make the new P7 dissector table driven using the #.TABLE
directives in the conformance file, based on what I can see in the camel
dissector.

I added the following to p7.cnf (it is commented out in the checked-in
version):

# This table creates the value_sting to name P7 operation codes and errors
# in file packet-p7-table.c which is included in the template file
#
#.TABLE_HDR
/* P7 ABSTRACT-OPERATIONS */
const value_string p7_opr_code_strings[] = {
#.TABLE_BODY ABSTRACT-OPERATION
        { %(&operationCode)s, "%(_ident)s" },
#.TABLE_FTR
  { 0, NULL }
;
#.END

ABSTRACT-OPERATION is defined as:

#.CLASS ABSTRACT-OPERATION
&ArgumentType         
&argumentTypeOptional  BooleanType
&returnResult          BooleanType
&ResultType           
&resultTypeOptional    BooleanType
&Errors                ClassReference ERROR
&Linked                ClassReference OPERATION
&synchronous           BooleanType
&alwaysReturns         BooleanType
&InvokePriority        _FixedTypeValueSetFieldSpec
&ResultPriority        _FixedTypeValueSetFieldSpec
&operationCode         TypeReference Code
#.END

Now I know that I am building the table on "ABSTRACT-OPERATION" rather than
"OPERATION" and "OPERATION" seems to be hard-coded into ans2wrs, but I tried
anyway.

I get the following error (which I didn't before):

        env python "../../tools/asn2wrs.py"  -b -e -X -T  -p p7  -c p7.cnf
-s packet-p7-template   MSAbstractService.asn  MSGeneralAttributeTypes.asn
MSAccessProtocol.asn
ASN.1 to Wireshark dissector compiler
Traceback (most recent call last):
  File "../../tools/asn2wrs.py", line 7671, in ?
    eth_main()
  File "../../tools/asn2wrs.py", line 7610, in eth_main
    ectx.eth_do_output()
  File "../../tools/asn2wrs.py", line 1987, in eth_do_output
    self.eth_output_table()
  File "../../tools/asn2wrs.py", line 1846, in eth_output_table
    raise sys.exc_type, "%s:%s invalid key %s for information object %s of
%s" % (rep['fn'], rep['lineno'], sys.exc_value, ident, var)
KeyError: "p7.cnf:199 invalid key '&operationCode' for information object
ms-bind of ABSTRACT-OPERATION"

This looks encouraging, as it seems to be saying that it doesn't like
ms-bind not having an operationCode.
Bind doesn't have an operation code, so I comment out this
ABSTRACT-OPERATION:

-- MS-bind abstract-operation
--ms-bind ABSTRACT-OPERATION ::= {
--  ARGUMENT  MSBindArgument
--  RESULT    MSBindResult
--  ERRORS    {ms-bind-error}
--}

And try again:

        env python "../../tools/asn2wrs.py"  -b -e -X -T  -p p7  -c p7.cnf
-s packet-p7-template   MSAbstractService.asn  MSGeneralAttributeTypes.asn
MSAccessProtocol.asn
ASN.1 to Wireshark dissector compiler
Traceback (most recent call last):
  File "../../tools/asn2wrs.py", line 7671, in ?
    eth_main()
  File "../../tools/asn2wrs.py", line 7610, in eth_main
    ectx.eth_do_output()
  File "../../tools/asn2wrs.py", line 1987, in eth_do_output
    self.eth_output_table()
  File "../../tools/asn2wrs.py", line 1838, in eth_output_table
    obj = self.get_obj_repr(ident, var_list)
  File "../../tools/asn2wrs.py", line 711, in get_obj_repr
    for f in val.keys():
AttributeError: 'str' object has no attribute 'keys'

It now seems to be trying to output the table - but something fundamental is
wrong.
(I'm afraid my python isn't up to debugging this.)

Any ideas where I am going wrong? Or is this not yet supported in asn2wrs?

Thanks,

Graeme


_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev

<<attachment: winmail.dat>>