BSDSocketAddress.cc
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 #include "BSDSocketAddress.hh"
18 //#include "BSDSocketAddress.ih"
19 
20 // Custom includes
24 
25 //#include "BSDSocketAddress.mpp"
26 #define prefix_
27 //-/////////////////////////////////////////////////////////////////////////////////////////////////
28 
29 prefix_ std::ostream & senf::operator<<(std::ostream & os, BSDSocketAddress const & addr)
30 {
31  switch(addr.family()) {
32  case INet4SocketAddress::addressFamily :
33  os << sockaddr_cast<INet4SocketAddress>(addr);
34  break;
35  case INet6SocketAddress::addressFamily :
36  os << sockaddr_cast<INet6SocketAddress>(addr);
37  break;
38  case UNSocketAddress::addressFamily :
39  os << sockaddr_cast<UNSocketAddress>(addr);
40  break;
41  case LLSocketAddress::addressFamily :
42  os << sockaddr_cast<LLSocketAddress>(addr);
43  break;
44  case AF_UNSPEC :
45  os << "[unspecified address]";
46  break;
47  default:
48  os << "[unknown address family " << addr.family() << "]";
49  break;
50  }
51  return os;
52 }
53 
54 //-/////////////////////////////////////////////////////////////////////////////////////////////////
55 #undef prefix_
56 //#include "BSDSocketAddress.mpp"
57 
58 
59 // Local Variables:
60 // mode: c++
61 // fill-column: 100
62 // comment-column: 40
63 // c-file-style: "senf"
64 // indent-tabs-mode: nil
65 // ispell-local-dictionary: "american"
66 // compile-command: "scons -u test"
67 // End:
#define prefix_
BSDSocketAddress public header.
std::ostream & operator<<(std::ostream &os, Packet const &packet)
LLSocketAddress and LLAddressingPolicy public header.
UNAddressing public header.
INet[46]Address and INet[46]AddressingPolicy public header.