From: tho Date: Thu, 4 Dec 2008 10:48:52 +0000 (+0000) Subject: added some documentation X-Git-Url: http://g0dil.de/git?p=senf.git;a=commitdiff_plain;h=8ac1897a6759df5e28a5d88c1409cc8fdf373920 added some documentation git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1000 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Examples/psi2tsModule/psi2ts.test.cc b/Examples/psi2tsModule/psi2ts.test.cc index 6cd4f5d..c047c46 100644 --- a/Examples/psi2tsModule/psi2ts.test.cc +++ b/Examples/psi2tsModule/psi2ts.test.cc @@ -89,7 +89,7 @@ BOOST_AUTO_UNIT_TEST(one_section_to_one_transportpacket) ts_payload_data.end(), 0xffu)); } -#include + BOOST_AUTO_UNIT_TEST(one_section_to_two_transportpackets) { senf::ppi::module::debug::ActiveSource source; diff --git a/Packets/80211Bundle/Mainpage.dox b/Packets/80211Bundle/Mainpage.dox new file mode 100644 index 0000000..e85beb6 --- /dev/null +++ b/Packets/80211Bundle/Mainpage.dox @@ -0,0 +1,47 @@ +// $Id: Mainpage.dox 881 2008-06-20 14:27:37Z g0dil $ +// +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \defgroup protocolbundle_80211 The 802.11 Bundle + + Each protocol consists of several objects + + \li The packet \c typedef symbol. This is the only object explicitly accessed from the outside + \li The associated parser object. This is, where the field names are documented + \li The internal packet type object + + Below you find a list of the internal packet type object for each of the implemented + protocols. You will never use this type directly, however the documentation will reference the + packet typedef to use and will document the parser used to parse the packet's fields. + */ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u doc" +// mode: auto-fill +// End: + diff --git a/Packets/Mainpage.dox b/Packets/Mainpage.dox index cb9444a..7482b9f 100644 --- a/Packets/Mainpage.dox +++ b/Packets/Mainpage.dox @@ -66,6 +66,7 @@ \li \ref protocolbundle_default : Some basic default protocols: Ethernet, Ip, TCP, UDP \li \ref protocolbundle_mpegdvb : MPEG and DVB protocols + \li \ref protocolbundle_80211 : 802.11 protocols There are two ways to link with a bundle diff --git a/Socket/Protocols/Raw/TunTapSocketHandle.cc b/Socket/Protocols/Raw/TunTapSocketHandle.cc index 6b36fb3..f2be645 100644 --- a/Socket/Protocols/Raw/TunTapSocketHandle.cc +++ b/Socket/Protocols/Raw/TunTapSocketHandle.cc @@ -1,9 +1,9 @@ // $Id$ // -// Copyright (C) 2006 +// Copyright (C) 2008 // Fraunhofer Institute for Open Communication Systems (FOKUS) // Competence Center NETwork research (NET), St. Augustin, GERMANY -// Stefan Bund +// Thorsten Horstmann // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -39,13 +39,13 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -prefix_ std::string senf::TapSocketProtocol::init_client() +prefix_ void senf::TapSocketProtocol::init_client() const { - return init_client(std::string()); + init_client(std::string()); } -prefix_ std::string senf::TapSocketProtocol::init_client(std::string const & interface_name, bool const NO_PI) +prefix_ void senf::TapSocketProtocol::init_client(std::string const & interface_name, bool NO_PI) const { int f; @@ -61,7 +61,6 @@ prefix_ std::string senf::TapSocketProtocol::init_client(std::string const & int SENF_THROW_SYSTEM_EXCEPTION( "Could not create tap device: ") << ifr.ifr_name << "."; ifaceIndex_ = if_nametoindex(ifr.ifr_name); fd(f); - return ifaceName(); } prefix_ unsigned senf::TapSocketProtocol::available() diff --git a/Socket/Protocols/Raw/TunTapSocketHandle.hh b/Socket/Protocols/Raw/TunTapSocketHandle.hh index 41c422f..4301a0f 100644 --- a/Socket/Protocols/Raw/TunTapSocketHandle.hh +++ b/Socket/Protocols/Raw/TunTapSocketHandle.hh @@ -1,9 +1,9 @@ // $Id:PacketSocketHandle.hh 218 2007-03-20 14:39:32Z tho $ // -// Copyright (C) 2006 +// Copyright (C) 2008 // Fraunhofer Institute for Open Communication Systems (FOKUS) // Competence Center NETwork research (NET), St. Augustin, GERMANY -// Stefan Bund +// Thorsten Horstmann // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -52,23 +52,28 @@ namespace senf { ConnectedCommunicationPolicy, ReadablePolicy, WriteablePolicy - >::policy Tap_Policy; ///< Policy for TAP + >::policy Tap_Policy; ///< Policy for TapSocketProtocol - /** \brief TAP - - \todo document me + /** \brief SocketProcol for the tap pseudo-device. \par Socket Handle typedefs: - + \ref TapSocketHandle \par Policy Interface: + ClientSocketHandle::read() ... + The TapSocketProtocol provides access to the Linux tap device. - \par Address Type: - + The tap device is a virtual ethernet network device. The tap driver was designed as low + level kernel support for ethernet tunneling. Userland application can write Ethernet + frames to the socket and kernel will receive this frames from the tap interface. + In the same time every frame that kernel writes to the tap interface can be read by + userland application from the socket. This class is utilized as the protocol class of the ProtocolClientSocketHandle via the - Socket Handle typedefs above. + Socket Handle typedef above. + + \see Kernel documentation for the TUN/TAP device driver. */ class TapSocketProtocol : public ConcreteSocketProtocol, @@ -77,16 +82,30 @@ namespace senf { public: ///\name Constructors ///@{ - std::string init_client() const; - ///< Create TAP socket - /**< \todo document me */ + void init_client() const; ///< Open tap socket and create new tap interface + /**< Opens the tun/tap socket and create a new tap interface + Use \ref ifaceName() to get the actual name of the newly + created interface. + + The new interface is down and has to be set up separately. + After closing the socket, the tap interface and all + corresponding routes will be deleted automatically. */ /**< \note This member is implicitly called from the ProtocolClientSocketHandle::ProtocolClientSocketHandle() constructor */ - std::string init_client(std::string const & interface_name, bool const NO_PI=true) const; - ///< Create TAP socket - /**< \todo document me - \param[in] address remote address to connect to */ + void init_client(std::string const & interface_name, bool NO_PI=true) const; + ///< Open tap socket and create new tap interface + /**< Opens the tun/tap socket and create a new tap interface + with the given name. Note that the created interface can + have a different name as specified. Use \ref ifaceName() + to get the actual name. + + The new interface is down and has to be set up separately. + After closing the socket, the tap interface and all + corresponding routes will be deleted automatically. + \param[in] interface_name name of the new tap interface. + \param[in] NO_PI if set to \c false each packet has a + additional 4 bytes header (flags, proto) */ /**< \note This member is implicitly called from the ProtocolClientSocketHandle::ProtocolClientSocketHandle() constructor */ @@ -97,9 +116,9 @@ namespace senf { ///@{ unsigned available() const; - bool eof() const; - unsigned int ifaceIndex() const; - std::string ifaceName() const; + bool eof() const; ///< returns always false. + unsigned int ifaceIndex() const;///< returns the index of the correspondent tap interface + std::string ifaceName() const; ///< returns the actual name of the correspondent tap interface private: mutable unsigned int ifaceIndex_; @@ -108,7 +127,7 @@ namespace senf { typedef ProtocolClientSocketHandle TapSocketHandle; ///< SocketHandle of TapSocketProtocol - /**< \related TapPrototol */ + /**< \related TapSocketProtocol */ /// @} } diff --git a/Socket/Protocols/Raw/TunTapSocketHandle.test.cc b/Socket/Protocols/Raw/TunTapSocketHandle.test.cc index a270d10..45d7154 100644 --- a/Socket/Protocols/Raw/TunTapSocketHandle.test.cc +++ b/Socket/Protocols/Raw/TunTapSocketHandle.test.cc @@ -1,9 +1,9 @@ // $Id$ // -// Copyright (C) 2006 +// Copyright (C) 2008 // Fraunhofer Institute for Open Communication Systems (FOKUS) // Competence Center NETwork research (NET), St. Augustin, GERMANY -// Stefan Bund +// Thorsten Horstmann // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -45,11 +45,11 @@ BOOST_AUTO_UNIT_TEST(tapSocketHandle) BOOST_WARN_MESSAGE(false, "Cannot test senf::TunTapSocketHandle as non-root user"); return; } - + senf::TapSocketHandle handle ("tap_unittest"); int ret = system( "/sbin/ifconfig tap_unittest up"); BOOST_CHECK_EQUAL( WEXITSTATUS(ret), 0); - + senf::PacketSocketHandle sock; BOOST_CHECK_NO_THROW( sock.bind(senf::LLSocketAddress("tap_unittest")) ); } @@ -57,7 +57,7 @@ BOOST_AUTO_UNIT_TEST(tapSocketHandle) ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_ - + // Local Variables: // mode: c++ // fill-column: 100