senf::LinuxPacketSocketProtocol Class Reference

#include <senf/Socket/Protocols/Raw/LinuxPacketSocketProtocol.hh>

Inheritance diagram for senf::LinuxPacketSocketProtocol:

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...
 

Detailed Description

Definition at line 29 of file LinuxPacketSocketProtocol.hh.

Member Enumeration Documentation

◆ SocketType

Enumerator
RawSocket 
DatagramSocket 

Definition at line 33 of file LinuxPacketSocketProtocol.hh.

Member Function Documentation

◆ eof()

bool senf::LinuxPacketSocketProtocol::eof ( ) const
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.

◆ init_packetSocket()

void senf::LinuxPacketSocketProtocol::init_packetSocket ( SocketType  type,
int  protocol 
) const
protected

Definition at line 112 of file LinuxPacketSocketProtocol.cc.

◆ mcAdd()

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.

Parameters
[in]interfaceinterface with which to join
[in]addressmulticast address to join
See also
LLSocketAddress

Definition at line 51 of file LinuxPacketSocketProtocol.cc.

◆ mcDrop()

void senf::LinuxPacketSocketProtocol::mcDrop ( std::string const &  interface,
MACAddress const &  address 
) const

Disable reception of a multicast group.

See also
mcAdd()

Definition at line 58 of file LinuxPacketSocketProtocol.cc.

◆ promisc()

void senf::LinuxPacketSocketProtocol::promisc ( std::string const &  interface,
bool  mode 
) const

enable/disable promiscuous mode

Definition at line 65 of file LinuxPacketSocketProtocol.cc.

◆ rxQueueDropped()

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.

◆ txWrongFormat()

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.


The documentation for this class was generated from the following files: