4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // David Wagner <dw6@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief UNAddressing public header */
26 #ifndef HH_SENF_Socket_Protocols_UN_UNAddressing_
27 #define HH_SENF_Socket_Protocols_UN_UNAddressing_ 1
32 #include <sys/socket.h>
34 #include "../BSDAddressingPolicy.hh"
35 #include "../BSDSocketAddress.hh"
37 //#include "UNAddressing.mpp"
38 ///////////////////////////////hh.p////////////////////////////////////////
42 /** \brief Unix domain socket address
44 UNSocketAddress wraps the standard sockaddr_un datatype. It provides simple accessor methods
47 \implementation This implementation is based on sockaddr_un.
52 : public BSDSocketAddress
55 static short const addressFamily = AF_UNIX;
59 explicit UNSocketAddress(std::string const & path);
60 ///< Construct an address constant from given path
62 UNSocketAddress(const UNSocketAddress& other);
63 UNSocketAddress& operator=(const UNSocketAddress& other);
65 std::string path() const ; ///< Return path as string
66 void path(std::string const & path);
68 using BSDSocketAddress::sockaddr_p;
69 using BSDSocketAddress::socklen_p;
72 struct sockaddr_un addr_;
75 /** \brief Write path to os
77 \related UNSocketAddress
79 std::ostream & operator<<(std::ostream & os, UNSocketAddress const & addr);
81 /// \addtogroup policy_impl_group
84 /** \brief Addressing policy supporting unix domain addressing
89 This addressing policy implements addressing using unix domain
92 The various members are directly imported from
93 BSDAddressingPolicyMixin which see for a detailed
96 struct UNAddressingPolicy
97 : public BSDAddressingPolicy,
98 private BSDAddressingPolicyMixin<UNSocketAddress>
100 typedef UNSocketAddress Address;
102 using BSDAddressingPolicyMixin<UNSocketAddress>::peer;
103 using BSDAddressingPolicyMixin<UNSocketAddress>::local;
104 using BSDAddressingPolicyMixin<UNSocketAddress>::connect;
105 using BSDAddressingPolicyMixin<UNSocketAddress>::bind;
111 ///////////////////////////////hh.e////////////////////////////////////////
112 #include "UNAddressing.cci"
113 //#include "UNAddressing.ct"
114 //#include "UNAddressing.cti"
121 // comment-column: 40
122 // c-file-style: "senf"
123 // indent-tabs-mode: nil
124 // ispell-local-dictionary: "american"
125 // compile-command: "scons -u test"