2 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
3 // Kompetenzzentrum NETwork research (NET)
4 // David Wagner <david.wagner@fokus.fraunhofer.de>
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the
18 // Free Software Foundation, Inc.,
19 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #include "RawInetSocketHandle.hh"
24 #include <sys/types.h>
25 #include <sys/socket.h>
26 #include <sys/ioctl.h>
28 #include "../../../Utils/Exception.hh"
30 //#include "UDPSocketHandle.mpp"
32 ///////////////////////////////cc.p////////////////////////////////////////
34 ///////////////////////////////////////////////////////////////////////////
35 // senf::RawV4SocketProtocol
37 prefix_ void senf::RawV4SocketProtocol::init_client()
40 init_client(IPPROTO_RAW);
44 senf::RawV4SocketProtocol::init_client(int const & protocol)
47 int sock = ::socket(PF_INET, SOCK_RAW, protocol);
54 senf::RawV4SocketProtocol::init_client(int const & protocol, INet4SocketAddress const & address)
57 init_client(protocol);
61 prefix_ std::auto_ptr<senf::SocketProtocol> senf::RawV4SocketProtocol::clone()
64 return std::auto_ptr<SocketProtocol>(new RawV4SocketProtocol());
67 ///////////////////////////////////////////////////////////////////////////
68 // senf::RawV6SocketProtocol::
70 prefix_ void senf::RawV6SocketProtocol::init_client()
73 init_client(IPPROTO_RAW);
76 prefix_ void senf::RawV6SocketProtocol::init_client(int const & protocol)
79 int sock = ::socket(PF_INET6,SOCK_RAW,protocol);
86 senf::RawV6SocketProtocol::init_client(int const & protocol, INet6SocketAddress const & address)
89 init_client(protocol);
93 prefix_ std::auto_ptr<senf::SocketProtocol> senf::RawV6SocketProtocol::clone()
96 return std::auto_ptr<SocketProtocol>(new RawV6SocketProtocol());
99 ///////////////////////////////cc.e////////////////////////////////////////