UNAddressing.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
17 #ifndef HH_SENF_Socket_Protocols_UN_UNAddressing_
18 #define HH_SENF_Socket_Protocols_UN_UNAddressing_ 1
19 
20 // Custom includes
21 #include <string>
22 #include <sys/socket.h>
23 #include <sys/un.h>
26 
27 //#include "UNAddressing.mpp"
28 //-/////////////////////////////////////////////////////////////////////////////////////////////////
29 
30 namespace senf {
31 
42  : public BSDSocketAddress
43  {
44  public:
45  static short const addressFamily = AF_UNIX;
46 
48 
49  explicit UNSocketAddress(std::string const & path);
51 
52  UNSocketAddress(const UNSocketAddress& other);
54 
55  std::string path() const ;
56  void path(std::string const & path);
57 
60 
61  private:
62  struct sockaddr_un addr_;
63  };
64 
69  std::ostream & operator<<(std::ostream & os, UNSocketAddress const & addr);
70 
72  //\{
73 
87  : public BSDAddressingPolicy,
88  private BSDAddressingPolicyMixin<UNSocketAddress>
89  {
91 
96  };
97 
98  //\}
99 }
100 
101 //-/////////////////////////////////////////////////////////////////////////////////////////////////
102 #include "UNAddressing.cci"
103 //#include "UNAddressing.ct"
104 //#include "UNAddressing.cti"
105 #endif
106 
107 
108 // Local Variables:
109 // mode: c++
110 // fill-column: 100
111 // comment-column: 40
112 // c-file-style: "senf"
113 // indent-tabs-mode: nil
114 // ispell-local-dictionary: "american"
115 // compile-command: "scons -u test"
116 // End:
Unix domain socket address.
Definition: UNAddressing.hh:41
BSDSocketAddress public header.
UNSocketAddress & operator=(const UNSocketAddress &other)
UNSocketAddress Address
Definition: UNAddressing.hh:90
socklen_t const * socklen_p() const
std::ostream & operator<<(std::ostream &os, UNSocketAddress const &addr)
Write path to os.
Socket addressing, BSD style.
struct sockaddr const * sockaddr_p() const
Addressing policy supporting unix domain addressing.
Definition: UNAddressing.hh:86
BSDAddressingPolicyMixin public header.
static short const addressFamily
Definition: UNAddressing.hh:45
Template for generic AddressingPolicy implementation based on the BSD socket API. ...
std::string path() const
Return path as string.