wiki:AddingNewLinktype

Version 1 (modified by perry, 14 years ago) (diff)

--

Steps for adding full support for a new Link type to libtrace:

# Get a TRACE_TYPE assigned and add it to libtrace.h # Add conversions to/from your linktype

  • If your linktype is supported by pcap:
    • add LIBTRACE_DLT of the correct number to libtrace.h
    • Add your new TRACE_TYPE to libtrace_to_pcap_dlt/pcap_dlt_to_libtrace
  • If your linktype is supported by ERF
    • Add TYPE_* of the correct number to libtrace.h
    • Add your new TRACE_TYPE to libtrace_to_erf_type/erf_type_to_libtrace
  • If your linktype is supported by the Linux kernel:
    • Add your linktype to linuxnative_get_link_type

# Add a structure to parse your linktype to libtrace.h with a name "libtrace_yourlinktype_t" # Add trace_get_payload_from_yourlinktype to protocols.c, and add code to trace_get_payload_from_link() to understand your linktype. # Add a protocol description to libpacketdump/