1#ifndef NET_SocketUtils_h__
2#define NET_SocketUtils_h__
28 uint16_t
resolveService(
const std::string& service,
const std::string& protocol =
"tcp");
78 std::string
getNetmask( std::string_view interface);
88 void setNetmask( std::string_view interface, std::string_view address);
115 int getMTU( std::string_view interface);
124 void setMTU( std::string_view interface,
int mtu);
void setDestinationAddress(std::string_view interface, std::string_view address)
Set the IPv4 destination address of the given network interface.
std::string getDestinationAddress(std::string_view interface)
Return the IPv4 destination address of the given network interface.
std::string getHardwareAddress(std::string_view interface)
Return the MAC address of the given network interfaces.
std::string getInterfaceAddress(std::string_view interface)
Return the IPv4 address of the given network interface.
int getMTU(std::string_view interface)
Return the MTU (Maximum Transmission Unit) of the given network interface in bytes.
void setInterfaceAddress(std::string_view interface, std::string_view address)
Set the IPv4 address of the given network interface.
uint16_t resolveService(const std::string &service, const std::string &protocol="tcp")
std::vector< std::string > getNetworkInterfaces()
Return a list of available network interfaces.
std::string getBroadcastAddress(std::string_view interface)
Return the IPv4 broadcast address of the given network interface.
void setMTU(std::string_view interface, int mtu)
Set the MTU (Maximum Transmission Unit) of the given network interface in bytes.
std::string getNetmask(std::string_view interface)
Return the IPv4 netmask of the given network interface.
std::string resolveHostname(const std::string &hostname)
void setBroadcastAddress(std::string_view interface, std::string_view address)
Set the IPv4 broadcast address of the given network interface.
void setNetmask(std::string_view interface, std::string_view address)
Set the IPv4 netmask of the given network interface.