Go to the documentation of this file.
36 #ifndef RCDISCOVER_SOCKET_LINUX_H
37 #define RCDISCOVER_SOCKET_LINUX_H
43 #include <netinet/in.h>
69 static SocketLinux create(in_addr_t dst_ip, uint16_t port, std::string iface_name);
89 in_addr_t dst_ip, uint16_t port,
90 std::string iface_name);
118 void bindImpl(
const sockaddr_in &addr);
124 void sendImpl(
const std::vector<uint8_t> &sendbuf);
153 #endif // RCDISCOVER_SOCKET_LINUX_H
void bindToDevice(const std::string &device)
Binds this socket to a specific device (root privileges are required).
SocketLinux & operator=(SocketLinux &&other)
void enableBroadcastImpl()
Enables broadcast for this socket.
SocketLinux(int domain, int type, int protocol, in_addr_t dst_ip, uint16_t port, std::string iface_name)
Constructor.
void bindImpl(const sockaddr_in &addr)
Binds the socket to a specific sockaddr.
const int & getHandleImpl() const
Returns the native socket handle.
const sockaddr_in & getDestSockAddr() const
Returns the sockaddr to which the socket is bound.
static SocketLinux create(in_addr_t dst_ip, uint16_t port, std::string iface_name)
Create a new socket.
void sendImpl(const std::vector< uint8_t > &sendbuf)
Sends data.
static std::vector< SocketLinux > createAndBindForAllInterfaces(uint16_t port)
Creates sockets for all interfaces and binds them to the respective interface.
static const in_addr_t & getBroadcastAddr()
Returns the broadcast address.
int SocketType
Type representing the native socket handle type.
void enableNonBlockingImpl()
Enables non-blocking operation for this socket.
Socket implementation for Linux.
CRTP class for platform specific socket implementation.
rcdiscover
Author(s): Heiko Hirschmueller
, Raphael Schaller
autogenerated on Thu Aug 1 2024 02:55:56