Enum virtual_net::meta::RequestType
source · pub enum RequestType {
Show 55 variants
Bridge {
network: String,
access_token: String,
security: StreamSecurity,
},
Flush,
Unbridge,
DhcpAcquire,
IpAdd {
ip: IpAddr,
prefix: u8,
},
IpRemove(IpAddr),
IpClear,
GetIpList,
GetMac,
GatewaySet(IpAddr),
RouteAdd {
cidr: IpCidr,
via_router: IpAddr,
preferred_until: Option<Duration>,
expires_at: Option<Duration>,
},
RouteRemove(IpAddr),
RouteClear,
GetRouteList,
BindRaw(SocketId),
ListenTcp {
socket_id: SocketId,
addr: SocketAddr,
only_v6: bool,
reuse_port: bool,
reuse_addr: bool,
},
BindUdp {
socket_id: SocketId,
addr: SocketAddr,
reuse_port: bool,
reuse_addr: bool,
},
BindIcmp {
socket_id: SocketId,
addr: IpAddr,
},
ConnectTcp {
socket_id: SocketId,
addr: SocketAddr,
peer: SocketAddr,
},
Resolve {
host: String,
port: Option<u16>,
dns_server: Option<IpAddr>,
},
Close,
BeginAccept(SocketId),
GetAddrLocal,
GetAddrPeer,
SetTtl(u32),
GetTtl,
GetStatus,
SetLinger(Option<Duration>),
GetLinger,
SetPromiscuous(bool),
GetPromiscuous,
SetRecvBufSize(u64),
GetRecvBufSize,
SetSendBufSize(u64),
GetSendBufSize,
SetNoDelay(bool),
GetNoDelay,
SetKeepAlive(bool),
GetKeepAlive,
SetDontRoute(bool),
GetDontRoute,
Shutdown(Shutdown),
IsClosed,
SetBroadcast(bool),
GetBroadcast,
SetMulticastLoopV4(bool),
GetMulticastLoopV4,
SetMulticastLoopV6(bool),
GetMulticastLoopV6,
SetMulticastTtlV4(u32),
GetMulticastTtlV4,
JoinMulticastV4 {
multiaddr: Ipv4Addr,
iface: Ipv4Addr,
},
LeaveMulticastV4 {
multiaddr: Ipv4Addr,
iface: Ipv4Addr,
},
JoinMulticastV6 {
multiaddr: Ipv6Addr,
iface: u32,
},
LeaveMulticastV6 {
multiaddr: Ipv6Addr,
iface: u32,
},
}
Variants§
Bridge
Bridges this local network with a remote network, which is required in order to make lower level networking calls (such as UDP/TCP)
Flush
Flushes all the data by ensuring a full round trip is completed
Unbridge
Disconnects from the remote network essentially unbridging it
DhcpAcquire
Acquires an IP address on the network and configures the routing tables
IpAdd
Adds a static IP address to the interface with a netmask prefix
IpRemove(IpAddr)
Removes a static (or dynamic) IP address from the interface
IpClear
Clears all the assigned IP addresses for this interface
GetIpList
Lists all the IP addresses currently assigned to this interface
GetMac
Returns the hardware MAC address for this interface
GatewaySet(IpAddr)
Adds a default gateway to the routing table
RouteAdd
Adds a specific route to the routing table
Fields
RouteRemove(IpAddr)
Removes a routing rule from the routing table
RouteClear
Clears the routing table for this interface
GetRouteList
Lists all the routes defined in the routing table for this interface
BindRaw(SocketId)
Creates a low level socket that can read and write Ethernet packets directly to the interface
ListenTcp
Lists for TCP connections on a specific IP and Port combination Multiple servers (processes or threads) can bind to the same port if they each set the reuse-port and-or reuse-addr flags
BindUdp
Opens a UDP socket that listens on a specific IP and Port combination Multiple servers (processes or threads) can bind to the same port if they each set the reuse-port and-or reuse-addr flags
BindIcmp
Creates a socket that can be used to send and receive ICMP packets from a paritcular IP address
ConnectTcp
Opens a TCP connection to a particular destination IP address and port
Resolve
Performs DNS resolution for a specific hostname
Close
Closes the socket
BeginAccept(SocketId)
Begins the process of accepting a socket and returns it later
GetAddrLocal
Returns the local address of this TCP listener
GetAddrPeer
Returns the address (IP and Port) of the peer socket that this is conencted to
SetTtl(u32)
Sets how many network hops the packets are permitted for new connections
GetTtl
Returns the maximum number of network hops before packets are dropped
GetStatus
Returns the status/state of the socket
SetLinger(Option<Duration>)
Determines how long the socket will remain in a TIME_WAIT after it disconnects (only the one that initiates the close will be in a TIME_WAIT state thus the clients should always do this rather than the server)
GetLinger
Returns how long the socket will remain in a TIME_WAIT after it disconnects
SetPromiscuous(bool)
Tells the raw socket and its backing switch that all packets should be received by this socket even if they are not destined for this device
GetPromiscuous
Returns if the socket is running in promiscuous mode whereby it will receive all packets even if they are not destined for the local interface
SetRecvBufSize(u64)
Sets the receive buffer size which acts as a trottle for how much data is buffered on this side of the pipe
GetRecvBufSize
Size of the receive buffer that holds all data that has not yet been read
SetSendBufSize(u64)
Sets the size of the send buffer which will hold the bytes of data while they are being sent over to the peer
GetSendBufSize
Size of the send buffer that holds all data that is currently being transmitted.
SetNoDelay(bool)
When NO_DELAY is set the data that needs to be transmitted to the peer is sent immediately rather than waiting for a bigger batch of data, this reduces latency but increases encapsulation overhead.
GetNoDelay
Indicates if the NO_DELAY flag is set which means that data is immediately sent to the peer without waiting. This reduces latency but increases encapsulation overhead.
SetKeepAlive(bool)
When KEEP_ALIVE is set the connection will periodically send an empty data packet to the server to make sure the connection stays alive.
GetKeepAlive
Indicates if the KEEP_ALIVE flag is set which means that the socket will periodically send an empty data packet to keep the connection alive.
SetDontRoute(bool)
When DONT_ROUTE is set the packet will be sent directly to the interface without passing through the routing logic.
GetDontRoute
Indicates if the packet will pass straight through to the interface bypassing the routing logic.
Shutdown(Shutdown)
Shuts down either the READER or WRITER sides of the socket connection.
IsClosed
Return true if the socket is closed
SetBroadcast(bool)
Sets a flag that means that the UDP socket is able to receive and process broadcast packets.
GetBroadcast
Indicates if the SO_BROADCAST flag is set which means that the UDP socket will receive and process broadcast packets
SetMulticastLoopV4(bool)
Sets a flag that indicates if multicast packets that this socket is a member of will be looped back to the sending socket. This applies to IPv4 addresses
GetMulticastLoopV4
Gets a flag that indicates if multicast packets that this socket is a member of will be looped back to the sending socket. This applies to IPv4 addresses
SetMulticastLoopV6(bool)
Sets a flag that indicates if multicast packets that this socket is a member of will be looped back to the sending socket. This applies to IPv6 addresses
GetMulticastLoopV6
Gets a flag that indicates if multicast packets that this socket is a member of will be looped back to the sending socket. This applies to IPv6 addresses
SetMulticastTtlV4(u32)
Sets the TTL for IPv4 multicast packets which is the number of network hops before the packet is dropped
GetMulticastTtlV4
Gets the TTL for IPv4 multicast packets which is the number of network hops before the packet is dropped
JoinMulticastV4
Tells this interface that it will subscribe to a particular multicast address. This applies to IPv4 addresses
LeaveMulticastV4
Tells this interface that it will unsubscribe to a particular multicast address. This applies to IPv4 addresses
JoinMulticastV6
Tells this interface that it will subscribe to a particular multicast address. This applies to IPv6 addresses
LeaveMulticastV6
Tells this interface that it will unsubscribe to a particular multicast address. This applies to IPv6 addresses
Trait Implementations§
source§impl Clone for RequestType
impl Clone for RequestType
source§fn clone(&self) -> RequestType
fn clone(&self) -> RequestType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RequestType
impl Debug for RequestType
source§impl<'de> Deserialize<'de> for RequestType
impl<'de> Deserialize<'de> for RequestType
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for RequestType
impl RefUnwindSafe for RequestType
impl Send for RequestType
impl Sync for RequestType
impl Unpin for RequestType
impl UnwindSafe for RequestType
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)