Skip to main content

Crate solana_net_utils

Crate solana_net_utils 

Source
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 PinnedXdpSender which is a convenience wrapper around agave_xdp::transmitter::XdpSender for 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. KeyedRateLimiter allows to rate-limit multiple keyed items, such as connections.
tooling_for_tests

Structs§

UdpSocketPair
A data type representing a public Udp socket

Enums§

IpEchoClientError

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

Type Aliases§

IpEchoServer
PortRange