pub struct GephNat { /* private fields */ }
Implementations§
Source§impl GephNat
impl GephNat
pub fn new(cap: usize, src_ip: Ipv4Addr) -> Self
Sourcepub fn rewrite_upstream_src(
&self,
original_src: SocketAddrV4,
dest: SocketAddrV4,
) -> SocketAddrV4
pub fn rewrite_upstream_src( &self, original_src: SocketAddrV4, dest: SocketAddrV4, ) -> SocketAddrV4
Given the source and destination addresses of an upstream packet, return the corresponding address on the “up-facing” side of the NAT
Sourcepub fn rewrite_downstream_dest(
&self,
current_dest: SocketAddrV4,
src: SocketAddrV4,
) -> Option<SocketAddrV4>
pub fn rewrite_downstream_dest( &self, current_dest: SocketAddrV4, src: SocketAddrV4, ) -> Option<SocketAddrV4>
Given the destination and source addresses of a downstream packet, return the corresponding address on the “down-facing” side of the NAT
Sourcepub fn mangle_upstream_pkt(&self, msg: &[u8]) -> Option<Bytes>
pub fn mangle_upstream_pkt(&self, msg: &[u8]) -> Option<Bytes>
Given an upstream IP packet, return the mangled version (if it parses successfully)
Sourcepub fn mangle_downstream_pkt(&self, msg: &[u8]) -> Option<Bytes>
pub fn mangle_downstream_pkt(&self, msg: &[u8]) -> Option<Bytes>
Given a downstream IP packet, return the mangled form if it parses correctly.
Auto Trait Implementations§
impl !Freeze for GephNat
impl !RefUnwindSafe for GephNat
impl Send for GephNat
impl Sync for GephNat
impl Unpin for GephNat
impl UnwindSafe for GephNat
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