simple-socket library 1.2.0
SocketUtils.h
Go to the documentation of this file.
1#ifndef NET_SocketUtils_h__
2#define NET_SocketUtils_h__
3
4#include <cstdint>
5#include <vector>
6#include <string>
7
8namespace NET
9{
17 std::string resolveHostname( const std::string& hostname);
18
28 uint16_t resolveService( const std::string& service, const std::string& protocol = "tcp");
29
31 std::vector<std::string> getNetworkInterfaces();
32
34
38 std::string getInterfaceAddress( std::string_view interface);
39
41
45 void setInterfaceAddress( std::string_view interface, std::string_view address);
46
48
59 std::string getBroadcastAddress( std::string_view interface);
60
62
69 void setBroadcastAddress( std::string_view interface, std::string_view address);
70
72
78 std::string getNetmask( std::string_view interface);
79
81
88 void setNetmask( std::string_view interface, std::string_view address);
89
91
97 std::string getDestinationAddress( std::string_view interface);
98
100
107 void setDestinationAddress( std::string_view interface, std::string_view address);
108
110
115 int getMTU( std::string_view interface);
116
118
124 void setMTU( std::string_view interface, int mtu);
125
127
132 std::string getHardwareAddress( std::string_view interface);
133}
134#endif // NET_SocketUtils_h__
Definition CANFrame.h:7
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.