IPv4 RAW Socket Protocol. More...
#include <senf/Socket/Protocols/INet/RawINetSocketHandle.hh>
Constructors | |
void | init_client () const |
Create unconnected client socket for IPPROTO_RAW. More... | |
void | init_client (int const &protocol) const |
Create unconnected client socket for protocol. More... | |
void | init_client (int const &protocol, INet4SocketAddress const &address) const |
Create client socket and bind. More... | |
Additional Inherited Members | |
![]() | |
typedef RawV4Socket_Policy | Policy |
The protocols policy. More... | |
![]() | |
Policy const & | policy () const |
Access the policy instance. More... | |
~ConcreteSocketProtocol ()=0 | |
![]() | |
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 |
![]() | |
unsigned | available () const |
Return (maximum) number of bytes available for reading without < blocking. More... | |
bool | eof () const |
Check for end-of-file condition. More... | |
![]() | |
void | bindInterface (std::string const &iface) const |
Bind socket to specific interface. More... | |
std::string | bindInterface () |
Get bound interface. More... | |
![]() | |
std::pair< bool, unsigned > | linger () const |
Return current linger status. More... | |
void | linger (bool enable, unsigned timeout=0) const |
Change linger status. More... | |
boost::uint8_t | priority () const |
Get packet priority assigned to outgoing packets. More... | |
void | priority (boost::uint8_t value) const |
Set packet priority (e.g. TOS) More... | |
int | error () const |
Get and clear pending socket error. More... | |
unsigned | rcvbuf () const |
Check receive buffer size. More... | |
void | rcvbuf (unsigned size) const |
Change receive buffer size. More... | |
unsigned | sndbuf () const |
Check send buffer size. More... | |
void | sndbuf (unsigned size) const |
Change size of send buffer. More... | |
template<unsigned short N> | |
void | attachSocketFilter (::sock_filter(&filter)[N]) |
void | detachSocketFilter () |
void | mtuDiscovery (int mode) const |
void | rcvLowat (unsigned lowWat) const |
void | sndLowat (unsigned lowWat) const |
![]() | |
bool | reuseaddr () const |
Return current reuseaddr state. More... | |
void | reuseaddr (bool value) const |
Set reuseraddr state. More... | |
![]() | |
void | timestamp (struct timespec *spec) const |
Return packet timestamp of last packet. More... | |
ClockService::clock_type | timestamp () const |
Return packet timestamp of last packet. More... | |
![]() | |
void | mcAddMembership (INet4Address const &mcAddr) const |
Join multicast group on default interface. More... | |
void | mcAddMembership (INet4Address const &mcAddr, INet4Address const &localAddr) const |
join multicast group on a specific interface More... | |
void | mcAddMembership (INet4Address const &mcAddr, std::string const &iface) const |
join multicast group on a specific interface More... | |
void | mcDropMembership (INet4Address const &mcAddr) const |
Leave multicast group. More... | |
void | mcDropMembership (INet4Address const &mcAddr, INet4Address const &localAddr) const |
leave multicast group on a specific interface More... | |
void | mcDropMembership (INet4Address const &mcAddr, std::string const &iface) const |
leave multicast group on a specific interface More... | |
void | mcJoinSSMSource (INet4Address const &group, INet4Address const &source, std::string const &iface) const |
join SSM multicast group More... | |
void | mcLeaveSSMSource (INet4Address const &group, INet4Address const &source, std::string const &iface) const |
leave SSM multicast group More... | |
![]() | |
void | broadcastEnabled (bool v) const |
Enable broadcast send/receive. More... | |
bool | broadcastEnabled () const |
Get broadcast send/receive state. More... | |
unsigned | mcTTL () const |
Return current multicast TTL. More... | |
void | mcTTL (unsigned value) const |
Set multicast TTL. More... | |
bool | mcLoop () const |
Return current multicast loopback state. More... | |
void | mcLoop (bool value) const |
Set multicast loopback state. More... | |
void | mcIface (std::string const &iface=std::string()) const |
Set multicast send interface of the socket. More... | |
![]() | |
ClientSocketHandle< Policy > | clientHandle () const |
Get client handle for associated socket. More... | |
ServerSocketHandle< Policy > | serverHandle () const |
Get server handle for associated socket. More... | |
![]() | |
FileHandle | fh () const |
Get a FileHandle for this instance. More... | |
void | fd (int) const |
Initialize file descriptor. More... | |
IPv4 RAW Socket Protocol.
RawV4SocketProtocol provides an internet protocol raw socket based on IPv4 addressing. This socket will put data written to it onto the IPv4 layer: if you call writeto don't include the header! On the other hand read
will return the packet data including the IP header. This behaviour is strange and differs from the behaviour of IPv6 RAW sockets and should be changed in the future.
This class is utilized as the protocol class of the ProtocolClientSocketHandle via the Socket Handle typedefs above.
Definition at line 71 of file RawINetSocketHandle.hh.
void senf::RawV4SocketProtocol::init_client | ( | ) | const |
Create unconnected client socket for IPPROTO_RAW.
Definition at line 30 of file RawINetSocketHandle.cc.
void senf::RawV4SocketProtocol::init_client | ( | int const & | protocol | ) | const |
Create unconnected client socket for protocol.
Definition at line 37 of file RawINetSocketHandle.cc.
void senf::RawV4SocketProtocol::init_client | ( | int const & | protocol, |
INet4SocketAddress const & | address | ||
) | const |
Create client socket and bind.
Creates a new client socket for the given protocol and binds to the given address.
[in] | protocol | Layer 4 protocol to filter for / to send |
[in] | address | local address to bind to |
Definition at line 47 of file RawINetSocketHandle.cc.