libutil++  1.9.3
 All Classes Functions Variables
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
sella::net::EtherSocket Class Reference
Inheritance diagram for sella::net::EtherSocket:
sella::net::Socket

Public Types

typedef std::shared_ptr
< EtherSocket
shared
 
typedef EtherSocketptr
 
- Public Types inherited from sella::net::Socket
typedef std::shared_ptr< Socketshared
 
typedef Socketptr
 

Public Member Functions

 EtherSocket (int etherType, const std::string &interface, bool raw=false) throw (SocketException)
 
 EtherSocket (int etherType, int ifIndex, bool raw=false) throw (SocketException)
 
 EtherSocket (int etherType, bool raw=false) throw (SocketException)
 
 EtherSocket (const EtherSocket &sock)=delete
 
void operator= (const EtherSocket &sock)=delete
 
EtherSocketsetInterface (const std::string &interface) throw (SocketException)
 
EtherSocketsetIfIndex (int index) throw ()
 
int getEtherType (void) const throw ()
 
std::string getInterface (void) const throw (SocketException)
 
int getIfIndex (void) const throw ()
 
bool isRaw (void) const throw ()
 
void bindInterface (void) throw (SocketException)
 
void setSoBindToDevice (const std::string &interface) throw (SocketException)
 
void setSoBindToDevice (void) throw (SocketException)
 
void setPromiscous (bool on=true) throw (SocketException)
 
ssize_t sendto (const void *data, size_t len, const std::string &dst_mac, int flags=0) throw (SocketException)
 
ssize_t sendto (const void *data, size_t len, const unsigned char *dst_mac=BroadcastMAC, int flags=0) throw (SocketException)
 
ssize_t sendto (const void *data, size_t len, int flags, const struct sockaddr_ll *dst_addr, socklen_t addrlen) throw (SocketException)
 
ssize_t recvfrom (void *data, size_t len, int flags=0, struct sockaddr_ll *src_addr=NULL, socklen_t *addrlen=NULL) throw (SocketException)
 
ssize_t recvfrom (void *data, size_t len, std::string &src_mac, int flags=0) throw (SocketException)
 
void bind (const IPAddressPort &addressport)=delete throw (SocketException)
 
void bind (const IPAddress &address, const Port &port)=delete throw (SocketException)
 
void bind (const std::string &address=std::string(), const unsigned short port=0)=delete throw (SocketException)
 
void connect (const IPAddressPort &addressport)=delete throw (SocketException)
 
void connect (const IPAddress &address, const Port &port)=delete throw (SocketException)
 
void connect (const std::string &address, const unsigned short port)=delete throw (SocketException)
 
virtual ssize_t send (const void *data, size_t len, int flags=0) throw (SocketException)
 
virtual ssize_t recv (void *data, size_t len, int flags=0) throw (SocketException)
 
- Public Member Functions inherited from sella::net::Socket
 Socket (const Socket &sock)=delete
 
void operator= (const Socket &sock)=delete
 
void bind (const IPAddressPort &addressport) throw (SocketException)
 
void bind (const IPAddress &address, const Port &port) throw (SocketException)
 
void bind (const std::string &address=std::string(), const unsigned short port=0) throw (SocketException)
 
void connect (const IPAddressPort &addressport) throw (SocketException)
 
void connect (const IPAddress &address, const Port &port) throw (SocketException)
 
void connect (const std::string &address, const unsigned short port) throw (SocketException)
 
virtual ssize_t send (const std::string &data, int flags=0) throw (SocketException)
 
virtual ssize_t send (const std::vector< uint8_t > &data, int flags=0) throw (SocketException)
 
virtual ssize_t recv (std::string &data, size_t len=RecvSizeDefault, int flags=0) throw (SocketException)
 
virtual ssize_t recv (std::vector< uint8_t > &data, size_t len=RecvSizeDefault, int flags=0) throw (SocketException)
 
int getFD (void) const
 
bool isRead (void) const
 
bool isWrite (void) const
 
bool isExcept (void) const
 
bool hasData (void) const throw (SocketException)
 
int getQueuedBytes (void) const throw (SocketException)
 
IPAddressPort getLocalIPAddressPort (void) const throw (SocketException)
 
IPAddress getLocalIPAddress (void) const throw (SocketException)
 
Port getLocalPort (void) const throw (SocketException)
 
IPAddressPort getRemoteIPAddressPort (void) const throw (SocketException)
 
IPAddress getRemoteIPAddress (void) const throw (SocketException)
 
Port getRemotePort (void) const throw (SocketException)
 
int getFamily (void) const throw ()
 
bool isUsable (void) const throw ()
 
bool hasMux (void) const throw ()
 
virtual bool isSecure (void) const throw ()
 
void setBlock (bool on=true) throw (SocketException)
 
bool isBlock (void) throw (SocketException)
 
void setIpOptions (const void *option, socklen_t len) throw (SocketException)
 
void setIpPktInfo (bool on=true) throw (SocketException)
 
void setIpRecvTOS (bool on=true) throw (SocketException)
 
void setIpRecvTTL (bool on=true) throw (SocketException)
 
void setIpRecvOpts (bool on=true) throw (SocketException)
 
void setIpRetOpts (bool on=true) throw (SocketException)
 
void setIpTOS (unsigned char tos) throw (SocketException)
 
unsigned char getIpTOS (void) const throw (SocketException)
 
void setIpTTL (int ttl) throw (SocketException)
 
int getIpTTL (void) const throw (SocketException)
 
void setIpHdrIncl (bool on=true) throw (SocketException)
 
void setIpRecvErr (bool on=true) throw (SocketException)
 
void setIpMtuDiscover (bool on=true) throw (SocketException)
 
int getIpMtu (void) const throw (SocketException)
 
void setIpRouterAlert (bool on=true) throw (SocketException)
 
void setIpMulticastTTL (int ttl) throw (SocketException)
 
int getIpMulticastTTL (void) const throw (SocketException)
 
void setIpMulticastLoop (bool on=true) throw (SocketException)
 
void setIpAddMembership (struct ip_mreqn &m) throw (SocketException)
 
void setIpDropMembership (struct ip_mreqn &m) throw (SocketException)
 
void setSoReuseAddr (bool on=true) throw (SocketException)
 
void setSoKeepAlive (bool on=true) throw (SocketException)
 
void setSoNoSigPipe (bool on=true) throw (SocketException)
 
bool getSoAcceptConn (void) const throw (SocketException)
 
void setSoBindToDevice (const std::string &interface) throw (SocketException)
 
void setSoBroadcast (bool on=true) throw (SocketException)
 
void setSoDebug (bool on=true) throw (SocketException)
 
int getSoError (void) const throw (SocketException)
 
void setSoDontRoute (bool on=true) throw (SocketException)
 
void setSoLinger (int onoff, int linger) throw (SocketException)
 
void setSoPriority (int pri) throw (SocketException)
 
void setSoRcvTimeo (struct timeval &tv) throw (SocketException)
 
void setSoSndTimeo (struct timeval &tv) throw (SocketException)
 
void setSoRcvBuf (int bytes) throw (SocketException)
 
void setSoRcvBufForce (int bytes) throw (SocketException)
 
int getSoRcvBuf (void) const throw (SocketException)
 
void setSoSndBuf (int bytes) throw (SocketException)
 
void setSoSndBufForce (int bytes) throw (SocketException)
 
int getSoSndBuf (void) const throw (SocketException)
 
void setSoTimestamp (bool on=true) throw (SocketException)
 
int getSoType (void) throw (SocketException)
 
void setIpv6AddrForm (int family=AF_INET) throw (SocketException)
 
void setIp6AddMembership (struct ipv6_mreq &m) throw (SocketException)
 
void setIp6DropMembership (struct ipv6_mreq &m) throw (SocketException)
 
void setIpv6Mtu (int bytes) throw (SocketException)
 
void setIpv6MtuDiscover (bool on=true) throw (SocketException)
 
void setIpv6MutlicastHops (int hops=-1) throw (SocketException)
 
void setIpv6MutlicastIf (int ifindex) throw (SocketException)
 
void setIpv6MulticastLoop (bool on=true) throw (SocketException)
 
void setIpv6RecvPktInfo (bool on=true) throw (SocketException)
 
void setIpv6RtHdr (bool on=true) throw (SocketException)
 
void setIpv6AuthHdr (bool on=true) throw (SocketException)
 
void setIpv6DstOpts (bool on=true) throw (SocketException)
 
void setIpv6HopOpts (bool on=true) throw (SocketException)
 
void setIpv6FlowInfo (bool on=true) throw (SocketException)
 
void setIpv6HopLimit (bool on=true) throw (SocketException)
 
void setIpv6RecvErr (bool on=true) throw (SocketException)
 
void setIpv6RouterAlert (int option=-1) throw (SocketException)
 
void setIpv6UnicastHops (int limit=-1) throw (SocketException)
 
void setIpv6V6Only (bool on=true) throw (SocketException)
 
bool getIpv6V6Only (void) const throw (SocketException)
 
void mmapRingBuffer (unsigned char **ring, struct tpacket_req &req) throw (SocketException)
 
void munmapRingBuffer (unsigned char **ring, struct tpacket_req &req) throw (SocketException)
 
void setPacketRxRing (struct tpacket_req &req, int version=TPACKET_V2) throw (SocketException)
 
void setPacketTxRing (struct tpacket_req &req, int version=TPACKET_V2) throw (SocketException)
 
int getPacketHdrLen (int version=TPACKET_V2) throw (SocketException)
 
void setPacketLoss (bool drop=true) throw (SocketException)
 

Static Public Member Functions

static const EtherSocket::shared shared_ptr (int etherType) throw (SocketException)
 
- Static Public Member Functions inherited from sella::net::Socket
static unsigned short resolveService (const std::string &service, const std::string &protocol=std::string("tcp")) throw (SocketException)
 

Static Public Attributes

static const int EthAll = ETH_P_ALL
 
static const int EthIP = ETH_P_IP
 
static const int EthARP = ETH_P_ARP
 
static const int EthRARP = ETH_P_RARP
 
static const int Eth8021Q = ETH_P_8021Q
 
static const int EthMPLSUC = ETH_P_MPLS_UC
 
static const int EthMPLSMC = ETH_P_MPLS_MC
 
static const unsigned char BroadcastMAC [] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
 
- Static Public Attributes inherited from sella::net::Socket
static const size_t RecvSizeDefault = 65536
 

Additional Inherited Members

- Protected Member Functions inherited from sella::net::Socket
 Socket (int s) throw (SocketException)
 
 Socket (int family, int type, int protocol) throw (SocketException)
 
virtual void close (void) throw (SocketException)
 
- Static Protected Member Functions inherited from sella::net::Socket
static void initAddr (int family, const std::string &address, unsigned short port, sockaddr_storage &addr, socklen_t size) throw (SocketException)
 
- Protected Attributes inherited from sella::net::Socket
int s
 
int family
 
bool usable
 
bool mux
 
bool read
 
bool write
 
bool except
 

Detailed Description

Definition at line 26 of file EtherSocket.h.


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