First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

example code packet-sf19.c build - no display SF19 protocol [closed]

  • retag add tags

Hi,

I install the Wireshark development using the Visual Studio 2002, port your example code packet-sf19.c into epan folder, add packet-sf19.c into Cmake.list of epan folder, the build Wireshark.exe, I launch the Wireshark.exe,

but I do not see SF19 protocol, pic4, is there anything I missed?

Thanks, Chuan Lu

chuanlu66's avatar
1
chuanlu66
asked 2023-10-05 20:10:40 +0000
edit flag offensive 0 remove flag reopen merge delete

Closed for the following reason "the question is answered, right answer was accepted" by Jaap 2023-10-06 17:30:52 +0000

Comments

add a comment see more comments

3 Answers

0

I install the Wireshark development using the Visual Studio 2002

Presumably meaning "Visual Studio 2022", not "2002".

If you want to add a built-in protocol dissector, in a source file named "packet-sf19.c", to Wireshark. you:

  • put packet-sf19.c in the "dissectors" subdirectory/subfolder of the "epan" directory/folder ("epan/dissectors" on UNIX, "epan\dissectors on Windows") - not in the "epan" directory/folder itself;
  • add to the "CMakeLists.txt" file in the "dissectors" directory/folder a line ${CMAKE_CURRENT_SOURCE_DIR}/packet-sf19.c to the list of dissectors following the set(DISSECTOR_SRC line (and before the closing ) line at the end of that list - not to the"CMakeLists.txt" file in the "epan" directory/folder.

It will probably not be necessary to re-run CMake - that should happen automatically, as you've modified the "CMakeLists.txt" file.

However, if you did the stuff in the list above and the resulting Wireshark still can't dissect SF19 packets, try running CMake again in the build directory and try building again.

Guy Harris's avatar
19.9k
Guy Harris
answered 2023-10-05 21:27:36 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

(Sample code and instructions for build are in the zip at https://sharkfest.wireshark.org/retro...

03: Writing a Wireshark Dissector: 3 ways to eat bytes by Graham Bloice)

The source file should be added to epan/dissectors and an entry added to epan/dissectors/CMakeLists.txt or create a epan/dissectors/CMakeListsCustom.txt.

Chuckc's avatar
3k
Chuckc
answered 2023-10-05 21:17:09 +0000, updated 2023-10-05 21:21:03 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

Hi,

how can we use this bit mask? does bit mask will mask sf19_func_vals?

for example, initially sf19_func_vals = 0xff, I set bitmask to 0x03 below, then final sf19_func_vals will be 0x03?

static hf_register_info hf[] = { { &hf_sf19_Func_Code, { "Function", "sf19.func", FT_UINT8, BASE_DEC, VALS(sf19_func_vals), 0x0, "Message Function Code Identifier", HFILL } },

    { &hf_sf19_Length,
        { "Length", "sf19.len",
          FT_UINT16, BASE_DEC, NULL, 0x0,
          "Message Length", HFILL }
    },
chuanlu66's avatar
1
chuanlu66
answered 2023-10-06 14:56:31 +0000
edit flag offensive 0 remove flag delete link

Comments

New question requires new topic.

Jaap's avatar Jaap (2023-10-06 17:30:34 +0000) edit
add a comment see more comments