-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddressVersion6.cpp
More file actions
31 lines (26 loc) · 823 Bytes
/
AddressVersion6.cpp
File metadata and controls
31 lines (26 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2015, The maxSocket Contributors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <maxSocket/IP/AddressVersion6.hpp>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
namespace maxSocket
{
namespace v0
{
namespace IP
{
AddressVersion6::AddressVersion6( const NativeIPVersion6AddressType NativeIPVersion6Address ) MAX_DOES_NOT_THROW
: NativeIPVersion6Address( NativeIPVersion6Address )
{
}
std::string AddressVersion6::GetRepresentation() const MAX_DOES_NOT_THROW
{
auto & Address = NativeIPVersion6Address.sin6_addr;
char str[ INET6_ADDRSTRLEN ];
return std::string( inet_ntop( AF_INET6, & Address, str, INET6_ADDRSTRLEN ) );
}
} // namespace IP
} // namespace v0
} // namespace maxSocket