Abstract base class for network sockets.
Definition abstractsocket.h:38
int _fd
Socket file descriptor.
Definition abstractsocket.h:203
Lightweight error code wrapper for the promeki library.
Definition error.h:39
OpenMode
Mode flags controlling how a device is opened.
Definition iodevice.h:33
Dynamic array container wrapping std::vector.
Definition list.h:40
Base object for promeki.
Definition objectbase.h:129
ObjectBase * parent() const
Returns the parent object, if one. nullptr if none.
Definition objectbase.h:258
Raw Ethernet frame socket.
Definition rawsocket.h:37
Error close() override
Closes the socket.
int64_t read(void *data, int64_t maxSize) override
Reads a raw Ethernet frame.
void setProtocol(uint16_t ethertype)
Sets the Ethernet protocol filter.
Definition rawsocket.h:73
void setInterface(const String &interfaceName)
Sets the network interface to bind to.
Definition rawsocket.h:56
bool isOpen() const override
Returns true if the socket is open.
Definition rawsocket.h:97
Error open(OpenMode mode) override
Opens the raw socket.
const String & interface() const
Returns the configured interface name.
Definition rawsocket.h:59
RawSocket(ObjectBase *parent=nullptr)
Constructs a RawSocket.
~RawSocket() override
Destructor.
int64_t write(const void *data, int64_t maxSize) override
Writes a raw Ethernet frame.
Error setPromiscuous(bool enable)
Enables or disables promiscuous mode.
uint16_t protocol() const
Returns the configured protocol filter.
Definition rawsocket.h:76
Encoding-aware string class with copy-on-write semantics.
Definition string.h:35
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19