pub struct LinuxTproxy;Implementations§
Source§impl LinuxTproxy
impl LinuxTproxy
Sourcepub fn enable_tproxy(socket: &UdpSocket) -> Result<()>
pub fn enable_tproxy(socket: &UdpSocket) -> Result<()>
Enable IP_TRANSPARENT and IP_RECVORIGDSTADDR on the socket
Sourcepub fn create_transparent_udp_socket(addr: SocketAddr) -> Result<UdpSocket>
pub fn create_transparent_udp_socket(addr: SocketAddr) -> Result<UdpSocket>
Create a UDP socket bound to a specific address with IP_TRANSPARENT enabled. This allows binding to non-local addresses (spoofing source IP).
Sourcepub async fn recv_original_dst(
socket: &UdpSocket,
buf: &mut [u8],
) -> Result<(usize, SocketAddr, Option<SocketAddr>)>
pub async fn recv_original_dst( socket: &UdpSocket, buf: &mut [u8], ) -> Result<(usize, SocketAddr, Option<SocketAddr>)>
Receive a packet with original destination address Returns (bytes_read, source_addr, original_dest_addr)
Auto Trait Implementations§
impl Freeze for LinuxTproxy
impl RefUnwindSafe for LinuxTproxy
impl Send for LinuxTproxy
impl Sync for LinuxTproxy
impl Unpin for LinuxTproxy
impl UnsafeUnpin for LinuxTproxy
impl UnwindSafe for LinuxTproxy
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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