UDPSocketHandle.hh

Go to the documentation of this file.
00001 // $Id: UDPSocketHandle.hh 1742 2010-11-04 14:51:56Z g0dil $
00002 //
00003 // Copyright (C) 2006
00004 // Fraunhofer (FOKUS)
00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY
00006 //     Stefan Bund <g0dil@berlios.de>
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2 of the License, or
00011 // (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the
00020 // Free Software Foundation, Inc.,
00021 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00030 #ifndef HH_SENF_Socket_Protocols_INet_UDPSocketHandle_
00031 #define HH_SENF_Socket_Protocols_INet_UDPSocketHandle_ 1
00032 
00033 // Custom includes
00034 #include "INetAddressing.hh"
00035 #include "UDPSocketProtocol.hh"
00036 #include "MulticastSocketProtocol.hh"
00037 #include <senf/Socket/Protocols/BSDSocketProtocol.hh>
00038 #include <senf/Socket/Protocols/DatagramSocketProtocol.hh>
00039 #include <senf/Socket/FramingPolicy.hh>
00040 #include <senf/Socket/CommunicationPolicy.hh>
00041 #include <senf/Socket/ReadWritePolicy.hh>
00042 #include <senf/Socket/ProtocolClientSocketHandle.hh>
00043 
00044 //#include "UDPSocketHandle.mpp"
00045 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00046 
00047 namespace senf {
00048 
00050     //\{
00051 
00052     typedef MakeSocketPolicy<
00053         INet4AddressingPolicy,
00054         DatagramFramingPolicy,
00055         UnconnectedCommunicationPolicy,
00056         ReadablePolicy,
00057         WriteablePolicy
00058         >::policy UDPv4Socket_Policy;   
00059 
00080     class UDPv4SocketProtocol
00081         : public ConcreteSocketProtocol<UDPv4Socket_Policy, UDPv4SocketProtocol>,
00082           public UDPSocketProtocol,
00083           public INet4MulticastSocketProtocol,
00084           public BSDSocketProtocol,
00085           public DatagramSocketProtocol,
00086           public AddressableBSDSocketProtocol
00087     {
00088     public:
00089         //-////////////////////////////////////////////////////////////////////////
00090         // internal interface
00091 
00093         //\{
00094 
00095         void init_client() const;       
00096 
00099         void init_client(INet4SocketAddress const & address) const;
00101 
00108         //\}
00109 
00110     };
00111 
00112     typedef ProtocolClientSocketHandle<UDPv4SocketProtocol> UDPv4ClientSocketHandle;
00113 
00114     typedef MakeSocketPolicy<
00115         UDPv4Socket_Policy,
00116         INet6AddressingPolicy
00117         >::policy UDPv6Socket_Policy;
00118 
00139     class UDPv6SocketProtocol
00140         : public ConcreteSocketProtocol<UDPv6Socket_Policy, UDPv6SocketProtocol>,
00141           public UDPSocketProtocol,
00142           public INet6MulticastSocketProtocol,
00143           public BSDSocketProtocol,
00144           public DatagramSocketProtocol,
00145           public AddressableBSDSocketProtocol
00146     {
00147     public:
00148         //-////////////////////////////////////////////////////////////////////////
00149         // internal interface
00150 
00152         //\{
00153 
00154         void init_client() const;       
00155 
00158         void init_client(INet6SocketAddress const & address) const;
00160 
00167         //\}
00168     };
00169 
00170     typedef ProtocolClientSocketHandle<UDPv6SocketProtocol> UDPv6ClientSocketHandle;
00171 
00172     //\}
00173 
00174 }
00175 
00176 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00177 //#include "UDPSocketHandle.cci"
00178 //#include "UDPSocketHandle.ct"
00179 //#include "UDPSocketHandle.cti"
00180 #endif
00181 
00182 
00183 // Local Variables:
00184 // mode: c++
00185 // fill-column: 100
00186 // c-file-style: "senf"
00187 // indent-tabs-mode: nil
00188 // ispell-local-dictionary: "american"
00189 // compile-command: "scons -u test"
00190 // comment-column: 40
00191 // End: