Hello, community. In the ASN.1 definition I work with there is a value defined as an UTF8String. ~/epan/dissectors/packet-per.c does not contain any function dissecting it. Thus, I suppose I have to write my own one and to add it to packet-per.c How can I do that? I looked to other string dissectors. In many of them function "dissect_per_restricted_character_string_sorted" is used with differences in the last three parameters. Is it about supplying correct parameters to that function only? Thank you in advance Ewgenij asked 15 Jan '13, 00:17 Ewgenijkkg showing 5 of 8 show 3 more comments |
One Answer:
So, I wrote my UTF8String dissection function in packet-per.c and packet-per.h according to the comments above:
That worked out then. Great thanks for your help, Anders! answered 15 Jan '13, 07:08 Ewgenijkkg edited 15 Jan '13, 07:13 If the code is correct, then maybe it would be worth to add it to the Wireshark distribution? (15 Jan '13, 07:56) Ewgenijkkg Please open a bug report (enhancement)and include a patch/diff. It would be great if it would be possible to try it with a trace as well, if you are not willing to submit/share your dissector perhaps it's possible to design a dummy dissector and a dummy frame to test with? (15 Jan '13, 08:14) Anders ♦ OK, I submitted the enhancement request with my patch. (16 Jan '13, 02:11) Ewgenijkkg The feature request was implemented in the current code version, however not with dissect_per_octet_string but with dissect_per_restricted_character_string_sorted. (24 Jan '13, 01:58) Ewgenijkkg |
What does asn2wrs generate now?
Hello, it creates a call to "dissect_per_UTF8String(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE)". But as I mentioned the function is absent in packet-per.c
Its not clear to me if it should be 27 Encoding the restricted character string types : Or 28 Encoding the unrestricted character string type : If it's the later I presume its actually an OCTET STRING filled with the UTF-8 characters?
Hmm, the only thing I know is that it's the UTF8String data type of ASN.1 That's the value type in my ASN.1 definition. How could I find out the rest?
Hi, I would start by defining dissect_per_UTF8String() in packet-per.[ch] then in that function call dissect_per_octet_string() then see if the length and content comes out right.
Hmm I would try mimicing dissect_per_IA5String() and do required changes as I go, I'm guessing the alphbet_lenght is 2^32-1. If you have a trace to work with and know what the encoded string is it should be possible to work it out. In dissect_per_restricted_character_string_sorted() the for loop fetching bit by bit can probably be replacet by tvb_get_bits...
OK, it worked out! However, I set the last parameter of "call dissect_per_octet_string" - "tvbuff_t **value_tvb" to NULL. What is that parameter for, when would I need it?
BR
Ewgenij
P.S. I mean your first suggestion with dissect_per_octet_string() worked out :)
That parameter is used when you want to have the OCTET STRING returned in a new tvb for further dissection.