RawINetSocketHandle.hh

Go to the documentation of this file.
00001 // $Id: RawINetSocketHandle.hh 597 2008-01-15 09:16:20Z g0dil $
00002 //
00003 // Copyright (C) 2007
00004 // Fraunhofer (FOKUS)
00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY
00006 //     David Wagner <dw6@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 
00023 #ifndef HH_SENF_Socket_Protocols_INet_RawINetSocketHandle_
00024 #define HH_SENF_Socket_Protocols_INet_RawINetSocketHandle_
00025 
00026 
00027 // Custom includes
00028 #include "INetAddressing.hh"
00029 #include "RawINetSocketProtocol.hh"
00030 #include "MulticastSocketProtocol.hh"
00031 #include <senf/Socket/Protocols/BSDSocketProtocol.hh>
00032 #include <senf/Socket/Protocols/DatagramSocketProtocol.hh>
00033 #include <senf/Socket/FramingPolicy.hh>
00034 #include <senf/Socket/CommunicationPolicy.hh>
00035 #include <senf/Socket/ReadWritePolicy.hh>
00036 #include <senf/Socket/ProtocolClientSocketHandle.hh>
00037 
00038 
00039 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00040 
00041 namespace senf {
00042 
00044     //\{
00045 
00046     typedef MakeSocketPolicy<
00047         INet4AddressingPolicy,
00048         DatagramFramingPolicy,
00049         UnconnectedCommunicationPolicy,
00050         ReadablePolicy,
00051         WriteablePolicy
00052         >::policy RawV4Socket_Policy;   
00053 
00080     class RawV4SocketProtocol
00081         : public ConcreteSocketProtocol<RawV4Socket_Policy, RawV4SocketProtocol>,
00082           public RawINetSocketProtocol,
00083           public BSDSocketProtocol,
00084           public AddressableBSDSocketProtocol,
00085           public DatagramSocketProtocol,
00086           public INet4MulticastSocketProtocol
00087     {
00088     public:
00089         //-////////////////////////////////////////////////////////////////////////
00090         // internal interface
00091 
00093         //\{
00094 
00095         void init_client() const;       
00096 
00099         void init_client(int const & protocol) const;       
00100 
00101         void init_client(int const & protocol, INet4SocketAddress const & address) const;
00103 
00108         //\}
00109     };
00110 
00111     typedef ProtocolClientSocketHandle<RawV4SocketProtocol> RawV4ClientSocketHandle;
00112 
00113 
00114 
00115 
00116 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00117     typedef MakeSocketPolicy<
00118         INet6AddressingPolicy,
00119         DatagramFramingPolicy,
00120         UnconnectedCommunicationPolicy,
00121         ReadablePolicy,
00122         WriteablePolicy
00123         >::policy RawV6Socket_Policy;   
00124 
00151     class RawV6SocketProtocol
00152         : public ConcreteSocketProtocol<RawV6Socket_Policy,RawV6SocketProtocol>,
00153           public RawINetSocketProtocol,
00154           public BSDSocketProtocol,
00155           public AddressableBSDSocketProtocol,
00156           public DatagramSocketProtocol,
00157           public INet6MulticastSocketProtocol
00158     {
00159     public:
00160         //-////////////////////////////////////////////////////////////////////////
00161         // internal interface
00162 
00164         //\{
00165 
00166         void init_client() const;       
00167 
00171         void init_client(int const & protocol) const;       
00172 
00173         void init_client(int const & protocol, INet6SocketAddress const & address) const;
00175 
00183         //\}
00184     };
00185 
00186     typedef ProtocolClientSocketHandle<RawV6SocketProtocol> RawV6ClientSocketHandle;
00187 
00188     //\}
00189 
00190 }
00191 
00192 #endif /*HH_SENF_Socket_Protocols_INet_RawINetSocketHandle_*/