How to setup a totally new dissector for the data without UDP/TCP header
In the chapter 9.2.1 of developing guide book,
there is a disssector example 9.2. (Dissector Handoff)
void proto_reg_handoff_foo(void)
{
static dissector_handle_t foo_handle;
foo_handle = create_dissector_handle(dissect_foo, proto_foo);
dissector_add_uint("udp.port", FOO_PORT, foo_handle);
}
The example always has a related basement, like UDP, TCP or so on. I would like to parse the whole enhanced packet block (data payload) from the first byte(bit) [of course, I have a header in the packet, to identify it from other interface's protocol ], how to wirte the code?
I try to follow plugins\grython code and the developing guide book, but all code are related with some conditions, like udp, or tcp, and just parse the data from a special port, I would like to get help for the new idea.
Thanks in advance.
By "other interface's protocol" do you mean that these packets are coming from a particular network interface?
And do you mean that you want all packets for that interface to be handled by your protocol?
Or Ethernet/802.11/PPP/whatever? I.e., your protocol isn't running atop any other link-layer protocol, it is the link-layer protocol?
Yes, I need to parse it from the first byte of the whole payload in EPB (pcapng format file), I have some special bytes at the header of the packet, and special byte order for special communication proposal.
With lua embedded script, I have implemented it. I have received all tvb data which is the whole payload in EPB (pcapng format file), it is working fine.
Now, I need to use c code under plugins folder to handle it.. Thanks a lot.
So what LinkType is present in the Interface Description Block? (can't be '1', since you stated there are some special bytes at the header (I assume you mean 'at the beginning') of the packet).
Since LinkType is 2 bytes, I set it to 999 in IDB now, since I know it should be available in my testing for time being.
(Reformatted so it shows up correctly.)
From Pcap-common.c Seems it maybe easy if I use linkType of user0~15 to solve it. right?