pub struct Dlt {
pub data_link_type: DataLink,
pub name: Cow<'static, str>,
pub display: Cow<'static, str>,
}
Expand description
Struct defining the DLT to be used for this extcap. Typically the DLT is
defined together with the Interface
and
passed into
InterfacesStep::list_interfaces
.
But you can also use this class standalone and print out the resulting
config using the print_sentence
method.
Fields§
§data_link_type: DataLink
The data link type this packet should be analyzed as.
See: http://www.tcpdump.org/linktypes.html for the list of DLTs.
name: Cow<'static, str>
The name of this DLT. Typically this is the same as the name in
http://www.tcpdump.org/linktypes.html without the LINKTYPE_
prefix.
display: Cow<'static, str>
A user-friendly string describing this DLT.
Implementations§
Trait Implementations§
source§impl PrintSentence for Dlt
impl PrintSentence for Dlt
Print the configuration line suitable for use with --extcap-dlts
.
Example
use r_extcap::config::ExtcapFormatter;
use r_extcap::interface::{DataLink, Dlt};
let dlt = Dlt {
data_link_type: DataLink::ETHERNET,
name: "ETHERNET".into(),
display: "IEEE 802.3 Ethernet".into(),
};
assert_eq!(
ExtcapFormatter(&dlt).to_string(),
"dlt {number=1}{name=ETHERNET}{display=IEEE 802.3 Ethernet}\n",
);
source§fn format_sentence(&self, f: &mut Formatter<'_>) -> Result
fn format_sentence(&self, f: &mut Formatter<'_>) -> Result
The extcap interface expects certain output “sentences” to stdout to
communicate with Wireshark, like Read more
source§fn print_sentence(&self)
fn print_sentence(&self)
Prints the extcap sentence to stdout.