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
Print the configuration line suitable for use with --extcap-dlts
.
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.
Auto Trait Implementations§
impl Freeze for Dlt
impl RefUnwindSafe for Dlt
impl Send for Dlt
impl Sync for Dlt
impl Unpin for Dlt
impl UnwindSafe for Dlt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more