// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
- \brief PacketProtocol and PacketSocketHandle non-inline non-template implementation
+ \brief PacketSocketProtocol and PacketSocketHandle non-inline non-template implementation
*/
#include "PacketSocketHandle.hh"
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void senf::PacketProtocol::init_client(SocketType type, int protocol)
+prefix_ void senf::PacketSocketProtocol::init_client(SocketType type, int protocol)
const
{
int socktype = SOCK_RAW;
protocol = ETH_P_ALL;
int sock = ::socket(PF_PACKET, socktype, htons(protocol));
if (sock < 0)
- throw SystemException();
+ SENF_THROW_SYSTEM_EXCEPTION("::socket(...) failed.");
fd(sock);
}
-prefix_ unsigned senf::PacketProtocol::available()
+prefix_ unsigned senf::PacketSocketProtocol::available()
const
{
if (! fh().readable())
return 0;
ssize_t l = ::recv(fd(),0,0,MSG_PEEK | MSG_TRUNC);
if (l < 0)
- throw SystemException();
+ SENF_THROW_SYSTEM_EXCEPTION("::recv(socket_fd) failed.");
return l;
}
-prefix_ bool senf::PacketProtocol::eof()
+prefix_ bool senf::PacketSocketProtocol::eof()
const
{
return false;
}
-prefix_ void senf::PacketProtocol::mcAdd(std::string const & interface,
+prefix_ void senf::PacketSocketProtocol::mcAdd(std::string const & interface,
MACAddress const & address)
const
{
do_mc(fd(),interface,address,true);
}
-prefix_ void senf::PacketProtocol::mcDrop(std::string const & interface,
+prefix_ void senf::PacketSocketProtocol::mcDrop(std::string const & interface,
MACAddress const & address)
const
{