(This wiki page needs a lot more updating but lets put some text here before I forget :ronnie)
#.NO_EMIT and #.USER_DEFINED
These two directives in the conformance file for Asn2wrs can be used to suppress generation of dissectors and/or value_strings and similar for a protocol. This is useful when there are types in the asn definition that either Asn2wrs can not handle or if we want to handle the dissection ourself inside the template file to do additional state keeping or things that Asn2wrs does not know how to manage.
These two directives are very similar. The only difference between is that #.NO_EMIT will suppress emitting the dissector for that function and also any value_strings while #.USER_DEFINED will emit declarations instead of definitions.
I.e. #.USER_DEFINED will emit declarations such as
extern const value_string Type_vals;
[static] int dissect_Proto_Type(...);
Use #.NO_EMIT if you dont need to call this function at all from anywhere (except from the template itself) and use #.USER_DEFINED is better if you implement the function inside the template but still want to allow it to be called from other places. (need much better explanation here)
#.USER_DEFINED TypeName [WITH_VALS|WITHOUT_VALS|ONLY_VALS] ... #.END
#.NO_EMIT TypeName [WITH_VALS|WITHOUT_VALS|ONLY_VALS] ... #.END
- WITH_VALS (default) - both dissection function and value string table are user defined / not emitted
- WITHOUT_VALS - only dissection function is user defined / not emitted
- ONLY_VALS - only value string table is user defined / not emitted