Wireshark mailing list archives

still unclear how to build a new ASN.1-based dissector


From: Vincent Randal <vtrandal () gmail com>
Date: Sun, 18 Apr 2021 20:15:19 -0600

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 clone https://<wireshark repo> wireshark
cd wireshark
git checkout wireshark-3.4.4
cd ..
mkdir build
cd build
cmake ../wireshark #this step worked previously but not on a fresh
wireshark clone now
make asn1 #with relevant entries in two CMakeListsCustom files
make

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 doneCMake 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 .txxCMake 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:
tar xvf myfoo.tgz
./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.

Vincent

NOTE: The attached dissector code is based on the simple ASN.1-based
dissector example online.
https://www.wireshark.org/docs/wsdg_html_chunked/SimpleASN1BasedDissector.html

Attachment: myfoo.tgz
Description:

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: