Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

GRE is a sub-dissector (packet-gre.c):

void
proto_reg_handoff_gre(void)
{
    dissector_handle_t gre_handle;
    capture_dissector_handle_t gre_cap_handle;

    gre_handle = create_dissector_handle(dissect_gre, proto_gre);
    dissector_add_uint("ip.proto", IP_PROTO_GRE, gre_handle);
    dissector_add_uint("udp.port", GRE_IN_UDP_PORT, gre_handle);
    gre_cap_handle = create_capture_dissector_handle(capture_gre, proto_gre);
    capture_dissector_add_uint("ip.proto", IP_PROTO_GRE, gre_cap_handle);
}
foo = DissectorTable.get("ip.proto")
print(typeof(foo))

foo_d = foo:get_dissector(47)

print(typeof(foo_d))
print("ip.proto:", foo_d)


foo = DissectorTable.get("udp.port")
print(typeof(foo))

foo_d = foo:get_dissector(4754)

print(typeof(foo_d))
print("udp.port:", foo_d)
7/5/2022 8:32:27 AM Console opened
7/5/2022 8:32:33 AM DissectorTable
7/5/2022 8:32:33 AM Dissector
7/5/2022 8:32:33 AM ip.proto:   GRE
7/5/2022 8:32:33 AM DissectorTable
7/5/2022 8:32:33 AM Dissector
7/5/2022 8:32:33 AM udp.port:   GRE