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)

Fields

§network: String
§access_token: String
§

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

Fields

§prefix: u8
§

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

§cidr: IpCidr
§via_router: IpAddr
§preferred_until: Option<Duration>
§expires_at: Option<Duration>
§

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

Fields

§socket_id: SocketId
§only_v6: bool
§reuse_port: bool
§reuse_addr: bool
§

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

Fields

§socket_id: SocketId
§reuse_port: bool
§reuse_addr: bool
§

BindIcmp

Creates a socket that can be used to send and receive ICMP packets from a paritcular IP address

Fields

§socket_id: SocketId
§addr: IpAddr
§

ConnectTcp

Opens a TCP connection to a particular destination IP address and port

Fields

§socket_id: SocketId
§

Resolve

Performs DNS resolution for a specific hostname

Fields

§host: String
§port: Option<u16>
§dns_server: Option<IpAddr>
§

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

Fields

§multiaddr: Ipv4Addr
§iface: Ipv4Addr
§

LeaveMulticastV4

Tells this interface that it will unsubscribe to a particular multicast address. This applies to IPv4 addresses

Fields

§multiaddr: Ipv4Addr
§iface: Ipv4Addr
§

JoinMulticastV6

Tells this interface that it will subscribe to a particular multicast address. This applies to IPv6 addresses

Fields

§multiaddr: Ipv6Addr
§iface: u32
§

LeaveMulticastV6

Tells this interface that it will unsubscribe to a particular multicast address. This applies to IPv6 addresses

Fields

§multiaddr: Ipv6Addr
§iface: u32

Trait Implementations§

source§

impl Clone for RequestType

source§

fn clone(&self) -> RequestType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RequestType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for RequestType

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for RequestType

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,