5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the
17 // Free Software Foundation, Inc.,
18 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 \brief UNAddressing public header */
23 #ifndef HH_UNAddressing_
24 #define HH_UNAddressing_ 1
29 #include <sys/socket.h>
31 #include <boost/cstdint.hpp>
32 #include <boost/operators.hpp>
33 #include "boost/filesystem/path.hpp"
34 #include "../../../Socket/SocketPolicy.hh"
35 #include "../../../Socket/ClientSocketHandle.hh"
36 #include "../../../Socket/CommunicationPolicy.hh"
37 #include "../../../Socket/Protocols/GenericAddressingPolicy.hh"
38 #include "UNAddress.hh"
40 //#include "UNAddressing.mpp"
41 ///////////////////////////////hh.p////////////////////////////////////////
44 : public ComparableSafeBool<UNSocketAddress>
49 explicit UNSocketAddress(boost::filesystem::path p);
50 ///< Construct an address constant
51 static UNSocketAddress from_string(std::string const s);
52 static UNSocketAddress from_path(boost::filesystem::path const p);
53 static std::string path();
54 static sockaddr_un sockaddr();
55 struct sockaddr * sockaddr_p();
56 struct sockaddr const * sockaddr_p() const;
57 unsigned sockaddr_len() const;
59 static struct sockaddr_un sockAddr;
61 std::ostream & operator<<(std::ostream & os, UNSocketAddress const & addr);
64 struct UNAddressingPolicy
65 : public AddressingPolicyBase,
66 private GenericAddressingPolicy<UNSocketAddress>
68 typedef UNSocketAddress Address;
70 using GenericAddressingPolicy<UNSocketAddress>::peer;
71 using GenericAddressingPolicy<UNSocketAddress>::local;
72 using GenericAddressingPolicy<UNSocketAddress>::connect;
73 using GenericAddressingPolicy<UNSocketAddress>::bind;
76 ///////////////////////////////hh.e////////////////////////////////////////
77 //#include "UNAddressing.cci"
78 //#include "UNAddressing.ct"
79 //#include "UNAddressing.cti"
87 // c-file-style: "senf"
88 // indent-tabs-mode: nil
89 // ispell-local-dictionary: "american"
90 // compile-command: "scons -u test"