Ask Your Question
0

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

asked 2023-10-05 20:10:40 +0000

chuanlu66 gravatar image

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

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Jaap
close date 2023-10-06 17:30:52.352574

3 Answers

Sort by ยป oldest newest most voted
0

answered 2023-10-06 14:56:31 +0000

chuanlu66 gravatar image

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 }
    },
edit flag offensive delete link more

Comments

New question requires new topic.

Jaap gravatar imageJaap ( 2023-10-06 17:30:34 +0000 )edit
0

answered 2023-10-05 21:17:09 +0000

Chuckc gravatar image

updated 2023-10-05 21:21:03 +0000

(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.

edit flag offensive delete link more
0

answered 2023-10-05 21:27:36 +0000

Guy Harris gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-10-05 20:10:40 +0000

Seen: 119 times

Last updated: Oct 06 '23