#include <senf/Socket/Protocols/Raw/LinuxPacketSocketProtocol.hh>
Public Types | |
enum | SocketType { RawSocket, DatagramSocket } |
Public Member Functions | |
void | mcAdd (std::string const &interface, MACAddress const &address) const |
Enable reception of a multicast group. More... | |
void | mcDrop (std::string const &interface, MACAddress const &address) const |
Disable reception of a multicast group. More... | |
void | promisc (std::string const &interface, bool mode) const |
enable/disable promiscuous mode More... | |
unsigned | rxQueueDropped () const |
packets dropped by kernel since last call More... | |
unsigned | txWrongFormat () const |
packets dropped by kernel due to wrong format (too large) since last call More... | |
bool | eof () const |
Check for end-of-file condition. More... | |
Public Member Functions inherited from senf::SocketProtocol | |
virtual SocketPolicyBase const & | policy () const =0 |
Access the policy instance. More... | |
virtual unsigned | available () const =0 |
Return (maximum) number of bytes available for reading without < blocking. More... | |
virtual void | close () |
Close socket. More... | |
virtual void | terminate () const |
Forcibly close socket. More... | |
virtual void | state (SocketStateMap &map, unsigned lod) const |
Return socket state information. More... | |
int | fd () const |
Get file descriptor. More... | |
SocketProtocol () | |
virtual | ~SocketProtocol ()=0 |
Protected Member Functions | |
void | init_packetSocket (SocketType type, int protocol) const |
Protected Member Functions inherited from senf::SocketProtocol | |
FileHandle | fh () const |
Get a FileHandle for this instance. More... | |
void | fd (int) const |
Initialize file descriptor. More... | |
Definition at line 29 of file LinuxPacketSocketProtocol.hh.
Enumerator | |
---|---|
RawSocket | |
DatagramSocket |
Definition at line 33 of file LinuxPacketSocketProtocol.hh.
|
virtual |
Check for end-of-file condition.
This is another check which (like available()) is extremely protocol dependent. This member will return true
only, if at end-of-file. If the protocol does not support the notion of EOF, this member should always return false
.
Implements senf::SocketProtocol.
Definition at line 106 of file LinuxPacketSocketProtocol.cc.
|
protected |
Definition at line 112 of file LinuxPacketSocketProtocol.cc.
void senf::LinuxPacketSocketProtocol::mcAdd | ( | std::string const & | interface, |
MACAddress const & | address | ||
) | const |
Enable reception of a multicast group.
mcAdd will join a new multicast group.
[in] | interface | interface with which to join |
[in] | address | multicast address to join |
Definition at line 51 of file LinuxPacketSocketProtocol.cc.
void senf::LinuxPacketSocketProtocol::mcDrop | ( | std::string const & | interface, |
MACAddress const & | address | ||
) | const |
Disable reception of a multicast group.
Definition at line 58 of file LinuxPacketSocketProtocol.cc.
void senf::LinuxPacketSocketProtocol::promisc | ( | std::string const & | interface, |
bool | mode | ||
) | const |
enable/disable promiscuous mode
Definition at line 65 of file LinuxPacketSocketProtocol.cc.
unsigned senf::LinuxPacketSocketProtocol::rxQueueDropped | ( | ) | const |
packets dropped by kernel since last call
query the number of packets dropped by the kernel since the last call to this method.
Definition at line 80 of file LinuxPacketSocketProtocol.cc.
unsigned senf::LinuxPacketSocketProtocol::txWrongFormat | ( | ) | const |
packets dropped by kernel due to wrong format (too large) since last call
query the number of packets dropped by the kernel since the last call to this method.
Definition at line 91 of file LinuxPacketSocketProtocol.cc.