ConnectedRawINetSocketHandle.hh

Go to the documentation of this file.
00001 // $Id: ConnectedRawINetSocketHandle.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 CONNECTEDHH_SENF_Socket_Protocols_INet_RawINetSocketHandle_
00024 #define CONNECTEDHH_SENF_Socket_Protocols_INet_RawINetSocketHandle_
00025 
00026 // Custom includes
00027 #include "INetAddressing.hh"
00028 #include "RawINetSocketProtocol.hh"
00029 #include <senf/Socket/Protocols/BSDSocketProtocol.hh>
00030 #include <senf/Socket/Protocols/DatagramSocketProtocol.hh>
00031 #include <senf/Socket/FramingPolicy.hh>
00032 #include <senf/Socket/CommunicationPolicy.hh>
00033 #include <senf/Socket/ReadWritePolicy.hh>
00034 #include <senf/Socket/ProtocolClientSocketHandle.hh>
00035 
00036 
00037 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00038 
00039 namespace senf {
00040 
00042     //\{
00043 
00044     typedef MakeSocketPolicy<
00045         INet4AddressingPolicy,
00046         DatagramFramingPolicy,
00047         ConnectedCommunicationPolicy,
00048         ReadablePolicy,
00049         WriteablePolicy
00050         >::policy ConnectedRawV4Socket_Policy;   
00051 
00083     class ConnectedRawV4SocketProtocol
00084         : public ConcreteSocketProtocol<ConnectedRawV4Socket_Policy, ConnectedRawV4SocketProtocol>,
00085           public RawINetSocketProtocol,
00086           public BSDSocketProtocol,
00087           public DatagramSocketProtocol,
00088           public AddressableBSDSocketProtocol
00089     {
00090     public:
00091         //-////////////////////////////////////////////////////////////////////////
00092         // internal interface
00093 
00095         //\{
00096 
00097         void init_client() const;       
00098 
00101         void init_client(int const & protocol) const;
00103 
00104         void init_client(int const & protocol, INet4SocketAddress const & address) const;
00106 
00112         //\}
00113     };
00114 
00115     typedef ProtocolClientSocketHandle<ConnectedRawV4SocketProtocol>
00116         ConnectedRawV4ClientSocketHandle;
00117 
00118 
00119 
00120 
00121 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00122     typedef MakeSocketPolicy<
00123         INet6AddressingPolicy,
00124         DatagramFramingPolicy,
00125         ConnectedCommunicationPolicy,
00126         ReadablePolicy,
00127         WriteablePolicy
00128         >::policy ConnectedRawV6Socket_Policy;   
00129 
00159     class ConnectedRawV6SocketProtocol
00160         : public ConcreteSocketProtocol<ConnectedRawV6Socket_Policy, ConnectedRawV6SocketProtocol>,
00161           public RawINetSocketProtocol,
00162           public BSDSocketProtocol,
00163           public DatagramSocketProtocol,
00164           public AddressableBSDSocketProtocol
00165     {
00166     public:
00167         //-////////////////////////////////////////////////////////////////////////
00168         // internal interface
00169 
00171         //\{
00172 
00173         void init_client() const;       
00174 
00178         void init_client(int const & protocol) const;
00180 
00181         void init_client(int const & protocol, INet6SocketAddress const & address) const;
00183 
00192         //\}
00193     };
00194 
00195     typedef ProtocolClientSocketHandle<ConnectedRawV6SocketProtocol>
00196         ConnectedRawV6ClientSocketHandle;
00197 
00198     //\}
00199 
00200 }
00201 
00202 #endif /*CONNECTEDHH_SENF_Socket_Protocols_INet_RawINetSocketHandle_*/
00203 
00204 
00205 // Local Variables:
00206 // mode: c++
00207 // fill-column: 100
00208 // c-file-style: "senf"
00209 // indent-tabs-mode: nil
00210 // ispell-local-dictionary: "american"
00211 // compile-command: "scons -u test"
00212 // comment-column: 40
00213 // End: