pub struct TcpPacketBuilder {
pub src_ip: IpAddr,
pub src_port: u16,
pub dst_ip: IpAddr,
pub dst_port: u16,
pub window: u16,
pub flags: u8,
pub options: Vec<TcpOption>,
pub payload: Vec<u8>,
}
Expand description
TCP Packet Builder.
Fields§
§src_ip: IpAddr
Source IP address.
src_port: u16
Source port.
dst_ip: IpAddr
Destination IP address.
dst_port: u16
Destination port.
window: u16
Window size.
flags: u8
TCP flags.
options: Vec<TcpOption>
TCP options.
payload: Vec<u8>
TCP payload.
Implementations§
Source§impl TcpPacketBuilder
impl TcpPacketBuilder
Sourcepub fn new(src_addr: SocketAddr, dst_addr: SocketAddr) -> TcpPacketBuilder
pub fn new(src_addr: SocketAddr, dst_addr: SocketAddr) -> TcpPacketBuilder
Constructs a new TcpPacketBuilder from Source SocketAddr and Destination SocketAddr with default options.
Trait Implementations§
Source§impl Clone for TcpPacketBuilder
impl Clone for TcpPacketBuilder
Source§fn clone(&self) -> TcpPacketBuilder
fn clone(&self) -> TcpPacketBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for TcpPacketBuilder
impl RefUnwindSafe for TcpPacketBuilder
impl Send for TcpPacketBuilder
impl Sync for TcpPacketBuilder
impl Unpin for TcpPacketBuilder
impl UnwindSafe for TcpPacketBuilder
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