pub trait IpPacketBuilder<I: IpExt>:
PacketBuilder
+ Clone
+ Debug {
// Required methods
fn new(src_ip: I::Addr, dst_ip: I::Addr, ttl: u8, proto: I::Proto) -> Self;
fn src_ip(&self) -> I::Addr;
fn set_src_ip(&mut self, addr: I::Addr);
fn dst_ip(&self) -> I::Addr;
fn set_dst_ip(&mut self, addr: I::Addr);
fn proto(&self) -> I::Proto;
fn set_dscp_and_ecn(&mut self, dscp_and_ecn: DscpAndEcn);
}
Expand description
A builder for IP packets.
Required Methods§
Sourcefn new(src_ip: I::Addr, dst_ip: I::Addr, ttl: u8, proto: I::Proto) -> Self
fn new(src_ip: I::Addr, dst_ip: I::Addr, ttl: u8, proto: I::Proto) -> Self
Returns a new packet builder for an associated IP version with the given given source and destination IP addresses, TTL (IPv4)/Hop Limit (IPv4) and Protocol Number.
Sourcefn set_src_ip(&mut self, addr: I::Addr)
fn set_src_ip(&mut self, addr: I::Addr)
Sets the source IP address for the builder.
Sourcefn set_dst_ip(&mut self, addr: I::Addr)
fn set_dst_ip(&mut self, addr: I::Addr)
Sets the destination IP address for the builder.
Sourcefn set_dscp_and_ecn(&mut self, dscp_and_ecn: DscpAndEcn)
fn set_dscp_and_ecn(&mut self, dscp_and_ecn: DscpAndEcn)
Set DSCP & ECN fields.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.