Expand description
The net_utils module assists with networking
Re-exports§
pub use pinned_xdp_sender::PinnedXdpSender;pub use socket_addr_space::SocketAddrSpace;
Modules§
- banlist
- multihomed_
sockets - pinned_
xdp_ sender - This module defines
PinnedXdpSenderwhich is a convenience wrapper aroundagave_xdp::transmitter::XdpSenderfor the case when source address is fixed. - socket_
addr_ space - sockets
- token_
bucket - This module contains
TokenBucket, which provides ability to limit rate of certain events, while allowing bursts through.KeyedRateLimiterallows to rate-limit multiple keyed items, such as connections. - tooling_
for_ tests
Structs§
- UdpSocket
Pair - A data type representing a public Udp socket
Enums§
Constants§
- DEFAULT_
IP_ ECHO_ SERVER_ THREADS - MAX_
PORT_ COUNT_ PER_ MESSAGE - MINIMUM_
VALIDATOR_ PORT_ RANGE_ WIDTH - VALIDATOR_
PORT_ RANGE
Functions§
- bind_
in_ range - bind_
to_ unspecified - find_
available_ port_ in_ range - Searches for an open port on a given binding ip_addr in the provided range.
- find_
available_ ports_ in_ range - Searches for several ports on a given binding ip_addr in the provided range.
- get_
cluster_ shred_ version - Retrieves cluster shred version from Entrypoint address provided.
- get_
cluster_ shred_ version_ with_ binding - Retrieves cluster shred version from Entrypoint address provided, binds client-side socket to the IP provided.
- get_
public_ ip_ addr_ with_ binding - Determine the public IP address of this machine by asking an ip_echo_server at the given address. This function will bind to the provided bind_addreess.
- ip_
echo_ server - Starts a simple TCP server that echos the IP address of any peer that connects Used by functions like |get_public_ip_addr| and |get_cluster_shred_version|
- is_host
- is_
host_ port - parse_
host - parse_
host_ port - parse_
port_ or_ addr - parse_
port_ range - verify_
all_ reachable_ tcp - Checks if all of the provided TCP ports are reachable by the machine at
ip_echo_server_addr. Tests must complete within timeout provided. Tests will run concurrently when possible, using up to 64 threads for IO. This function assumes that all sockets are bound to the same IP, and will panic otherwise. - verify_
all_ reachable_ udp - Checks if all of the provided UDP ports are reachable by the machine at
ip_echo_server_addr. Tests must complete within timeout provided. Tests will run concurrently when possible, using up to 64 threads for IO. This function assumes that all sockets are bound to the same IP, and will panic otherwise