NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
network-address.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
24
#ifndef NDN_NET_NETWORK_ADDRESS_HPP
25
#define NDN_NET_NETWORK_ADDRESS_HPP
26
27
#include "../common.hpp"
28
#include <boost/asio/ip/address.hpp>
29
30
namespace
ndn
{
31
namespace
net
{
32
33
enum class
AddressFamily
{
34
UNSPECIFIED
,
35
V4
,
36
V6
,
37
};
38
39
enum class
AddressScope
{
40
NOWHERE
,
41
HOST
,
42
LINK
,
43
GLOBAL
,
44
};
45
46
std::ostream&
47
operator<<
(std::ostream& os,
AddressScope
scope);
48
52
class
NetworkAddress
53
{
54
public
:
55
NetworkAddress
(
AddressFamily
family,
56
boost::asio::ip::address ip,
57
boost::asio::ip::address broadcast,
58
uint8_t prefixLength,
59
AddressScope
scope,
60
uint32_t flags);
61
64
AddressFamily
65
getFamily
()
const
66
{
67
return
m_family;
68
}
69
72
boost::asio::ip::address
73
getIp
()
const
74
{
75
return
m_ip;
76
}
77
80
boost::asio::ip::address
81
getBroadcast
()
const
82
{
83
return
m_broadcast;
84
}
85
88
uint8_t
89
getPrefixLength
()
const
90
{
91
return
m_prefixLength;
92
}
93
96
AddressScope
97
getScope
()
const
98
{
99
return
m_scope;
100
}
101
104
uint32_t
105
getFlags
()
const
106
{
107
return
m_flags;
108
}
109
110
friend
bool
111
operator<
(
const
NetworkAddress
& a,
const
NetworkAddress
& b)
112
{
113
return
a.m_ip < b.m_ip;
114
}
115
116
private
:
117
AddressFamily
m_family;
118
boost::asio::ip::address m_ip;
119
boost::asio::ip::address m_broadcast;
120
uint8_t m_prefixLength;
121
AddressScope
m_scope;
122
uint32_t m_flags;
// IFA_F_* in if_addr.h
123
};
124
125
std::ostream&
126
operator<<
(std::ostream& os,
const
NetworkAddress& address);
127
128
}
// namespace net
129
}
// namespace ndn
130
131
#endif // NDN_NET_NETWORK_ADDRESS_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::net::NetworkAddress::getScope
AddressScope getScope() const
Returns the address scope.
Definition:
network-address.hpp:97
ndn::net::AddressScope
AddressScope
Definition:
network-address.hpp:39
ndn::net::NetworkAddress::getIp
boost::asio::ip::address getIp() const
Returns the IP address (v4 or v6)
Definition:
network-address.hpp:73
ndn::net::AddressScope::LINK
ndn::net::AddressFamily::UNSPECIFIED
ndn::net::AddressFamily
AddressFamily
Definition:
network-address.hpp:33
ndn::net::NetworkAddress::getFamily
AddressFamily getFamily() const
Returns the address family.
Definition:
network-address.hpp:65
ndn::net::AddressScope::GLOBAL
ndn::net::AddressScope::NOWHERE
ndn::net::AddressFamily::V6
ndn::net::NetworkAddress::getFlags
uint32_t getFlags() const
Returns a bitset of platform-specific flags enabled on the address.
Definition:
network-address.hpp:105
ndn::net::NetworkAddress
Stores one IP address supported by a network interface.
Definition:
network-address.hpp:52
ndn::net::NetworkAddress::getBroadcast
boost::asio::ip::address getBroadcast() const
Returns the IP broadcast address.
Definition:
network-address.hpp:81
ndn::net::NetworkAddress::getPrefixLength
uint8_t getPrefixLength() const
Returns the prefix length.
Definition:
network-address.hpp:89
ndn::net::AddressScope::HOST
ndn::net::NetworkAddress::operator<
friend bool operator<(const NetworkAddress &a, const NetworkAddress &b)
Definition:
network-address.hpp:111
ndn::net::NetworkAddress::NetworkAddress
NetworkAddress(AddressFamily family, boost::asio::ip::address ip, boost::asio::ip::address broadcast, uint8_t prefixLength, AddressScope scope, uint32_t flags)
Definition:
network-address.cpp:45
ndn::net::AddressFamily::V4
ndn::net::operator<<
std::ostream & operator<<(std::ostream &os, AddressScope scope)
Definition:
network-address.cpp:30
ndn::net
Definition:
link-type-helper.cpp:30
ndnSIM
ndn-cxx
src
net
network-address.hpp
Generated on Tue Aug 7 2018 16:19:16 for ndnSIM by
1.8.14