1 // $Id:PacketSocketHandle.hh 218 2007-03-20 14:39:32Z tho $
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief PacketSocketProtocol and PacketSocketHandle public header
27 #ifndef HH_SENF_Socket_Protocols_Raw_TunTapSocketHandle_
28 #define HH_SENF_Socket_Protocols_Raw_TunTapSocketHandle_ 1
31 #include "../../../Socket/SocketPolicy.hh"
32 #include "../../../Socket/SocketProtocol.hh"
33 #include "../../../Socket/ProtocolClientSocketHandle.hh"
34 #include "../../../Socket/FramingPolicy.hh"
35 #include "../../../Socket/CommunicationPolicy.hh"
36 #include "../../../Socket/ReadWritePolicy.hh"
37 #include "../../../Socket/Protocols/BSDSocketProtocol.hh"
38 #include "LLAddressing.hh"
40 //#include "TunTapSocketHandle.mpp"
41 //#include "TunTapSocketHandle.ih"
42 ///////////////////////////////hh.p////////////////////////////////////////
46 /// \addtogroup concrete_protocol_group
49 typedef MakeSocketPolicy<
51 DatagramFramingPolicy,
52 ConnectedCommunicationPolicy,
55 >::policy Tap_Policy; ///< Policy for TAP
61 \par Socket Handle typedefs:
64 \par Policy Interface:
70 This class is utilized as the protocol class of the ProtocolClientSocketHandle via the
71 Socket Handle typedefs above.
73 class TapSocketProtocol
74 : public ConcreteSocketProtocol<Tap_Policy,TapSocketProtocol>,
75 public BSDSocketProtocol
80 std::string init_client() const;
81 ///< Create TAP socket
82 /**< \todo document me */
83 /**< \note This member is implicitly called from the
84 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
86 std::string init_client(std::string const & interface_name, bool const NO_PI=true) const;
87 ///< Create TAP socket
88 /**< \todo document me
89 \param[in] address remote address to connect to */
90 /**< \note This member is implicitly called from the
91 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
96 ///\name Abstract Interface Implementation
99 unsigned available() const;
101 unsigned int ifaceIndex() const;
102 std::string ifaceName() const;
105 mutable unsigned int ifaceIndex_;
109 typedef ProtocolClientSocketHandle<TapSocketProtocol> TapSocketHandle;
110 ///< SocketHandle of TapSocketProtocol
111 /**< \related TapPrototol */
116 ///////////////////////////////hh.e////////////////////////////////////////
117 //#include "TunTapSocketHandle.cci"
118 //#include "TunTapSocketHandle.ct"
119 //#include "TunTapSocketHandle.cti"
120 //#include "TunTapSocketHandle.mpp"
127 // c-file-style: "senf"
128 // indent-tabs-mode: nil
129 // ispell-local-dictionary: "american"
130 // compile-command: "scons -u test"
131 // comment-column: 40