Wireshark-dev: Re: [Wireshark-dev] still unclear how to build a new ASN.1-based dissector
Hello,
Anders, thank you. I think I've finally got the separate "generate" and "compile" steps clear now. Thank you.
What I think remains is regression testing. Yes? No? For a new dissector should there be entry in some file (somewhere) that tells the build tools what to test (if anything) regarding a new dissector in the asn1 directory?
I've been digging around a bit in the source files and I have not yet made sense of how regression testing (or any testing) is done, or even if it applies to dissectors let alone a new dissector.
Vincent Randal
Hi,
Perhaps a misconception here, the generated files are part of the source tree currently so when you change any of the files in the
../asn1/foo directory you need to run make foo and check in the generated .c and optionally .h file.
So on the very first round add the directory and files in the /foo directory DO NOT change cmake for the generated files yet
Run cmake to have the cmake files generated needed to generate asn1 dissectors.
Run make foo
You should now have generated .c and possibly .h files in your src dir
Check them in and update the cmake files to include the f´generated .c .h files
Run make to have them built
Best regards
Anders
CORRECTION: I omitted the troublesome steps (underlined) when describing the problem:
git checkout wireshark-3.4.4
cd wireshark/epan/dissectors
cp ~/myfoo.tgz . #copy dissector code into wireshark clone
tar xvf myfoo.tgz #extract the dissector code (details in previous email)
cmake ../wireshark #this step worked previously but not on a fresh wireshark clone now
make asn1 #with relevant entries in two CMakeListsCustom files
Hello Wireshark-dev community,
Apparently, I still don't have the correct sequence of steps necessary for first time generation of "packet-myfoo.c" and "packet-myfoo.h" for a new ASN.1-based dissector called myfoo. Details follow.
I would like to understand (much better than I do) how to add an ASN.1-based dissector to epan/dissectors/asn1 in a fresh clone of wireshark. I got a lot of help from a lot of people last week (for which I am grateful) but I must still be missing a step here:
git checkout wireshark-3.4.4
cmake ../wireshark #this step worked previously but not on a fresh wireshark clone now
make asn1 #with relevant entries in two CMakeListsCustom files
When I add my dissector folder "myfoo" to epan/dissectors/asn1 here's the relevant error messages from cmake (with some highlighting by me):
-- Configuring done
CMake Error at epan/dissectors/CMakeLists.txt:2004 (add_library):
Cannot find source file:
/home/vtrandal/ws1/wireshark/epan/dissectors/packet-myfoo.c
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx
CMake Error at epan/dissectors/CMakeLists.txt:2004 (add_library):
No SOURCES given to target: dissectors
[end of cmake error messages]
The point of the above cmake error messages is that the "packet-myfoo.c" and "packet-myfoo.h" files have not yet been generated (and I don't know how to generate them). I do not know how I got past the cmake step before, but I was lucky (and unlucky now). The ASN.1-based dissector code is in the attached .tgz file which I extract in epan/dissectors as follows:
./CMakeListsCustom.txt <== contains entry for myfoo
./asn1/CMakeListsCustom.txt <== contains entry for myfoo
./asn1/myfoo/
./asn1/myfoo/myfoo.asn
./asn1/myfoo/myfoo.cnf
./asn1/myfoo/CMakeLists.txt
./asn1/myfoo/packet-myfoo-template.h
./asn1/myfoo/packet-myfoo-template.c
I apologize in advance for being thick-headed about the process of adding a new ASN.1-based dissector to epan/dissectors/asn1 in Wireshark. With help from a lot of people I got it to compile previously (again for which I am grateful). But I cannot repeat that success starting with a fresh clone of wireshark regardless of the branch. Somehow I still don't have the correct sequence of steps necessary to generate "packet-myfoo.c" and "packet-myfoo.h" the first time. With my dissector code in epan/dissectors the cmake step fails and I cannot make anything.
___________________________________________________________________________
Sent via: Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives: https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe