NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
network-interface.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NFD_CORE_NETWORK_INTERFACE_HPP
27
#define NFD_CORE_NETWORK_INTERFACE_HPP
28
29
#include "
common.hpp
"
30
31
#include <ndn-cxx/util/ethernet.hpp>
32
33
#include <net/if.h>
34
35
namespace
nfd
{
36
37
namespace
ethernet
=
ndn::util::ethernet
;
38
41
class
NetworkInterfaceInfo
42
{
43
public
:
44
45
int
index
;
46
std::string
name
;
47
ethernet::Address
etherAddress
;
48
std::vector<boost::asio::ip::address_v4>
ipv4Addresses
;
49
std::vector<boost::asio::ip::address_v6>
ipv6Addresses
;
50
boost::asio::ip::address_v4
broadcastAddress
;
51
unsigned
int
flags
;
52
53
bool
54
isLoopback
()
const
;
55
56
bool
57
isMulticastCapable
()
const
;
58
59
bool
60
isBroadcastCapable
()
const
;
61
62
bool
63
isUp
()
const
;
64
65
};
66
67
inline
bool
68
NetworkInterfaceInfo::isLoopback
()
const
69
{
70
return
(
flags
& IFF_LOOPBACK) != 0;
71
}
72
73
inline
bool
74
NetworkInterfaceInfo::isMulticastCapable
()
const
75
{
76
return
(
flags
& IFF_MULTICAST) != 0;
77
}
78
79
inline
bool
80
NetworkInterfaceInfo::isBroadcastCapable
()
const
81
{
82
return
(
flags
& IFF_BROADCAST) != 0;
83
}
84
85
inline
bool
86
NetworkInterfaceInfo::isUp
()
const
87
{
88
return
(
flags
& IFF_UP) != 0;
89
}
90
94
std::vector<NetworkInterfaceInfo>
95
listNetworkInterfaces
();
96
97
#ifdef WITH_TESTS
98
101
void
102
setDebugNetworkInterfaces(shared_ptr<std::vector<NetworkInterfaceInfo>> interfaces);
103
#endif
104
105
}
// namespace nfd
106
107
#endif // NFD_CORE_NETWORK_INTERFACE_HPP
ndn::util::ethernet::Address
represents an Ethernet hardware address
Definition:
ethernet.hpp:53
nfd::NetworkInterfaceInfo
contains information about a network interface
Definition:
network-interface.hpp:41
nfd::NetworkInterfaceInfo::etherAddress
ethernet::Address etherAddress
Definition:
network-interface.hpp:47
nfd::NetworkInterfaceInfo::isBroadcastCapable
bool isBroadcastCapable() const
Definition:
network-interface.hpp:80
nfd::NetworkInterfaceInfo::isMulticastCapable
bool isMulticastCapable() const
Definition:
network-interface.hpp:74
common.hpp
nfd::listNetworkInterfaces
std::vector< NetworkInterfaceInfo > listNetworkInterfaces()
List configured network interfaces on the system and their info.
Definition:
network-interface.cpp:73
nfd::NetworkInterfaceInfo::broadcastAddress
boost::asio::ip::address_v4 broadcastAddress
Definition:
network-interface.hpp:50
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
nfd::NetworkInterfaceInfo::ipv6Addresses
std::vector< boost::asio::ip::address_v6 > ipv6Addresses
Definition:
network-interface.hpp:49
nfd::NetworkInterfaceInfo::index
int index
Definition:
network-interface.hpp:45
nfd::NetworkInterfaceInfo::isLoopback
bool isLoopback() const
Definition:
network-interface.hpp:68
nfd::NetworkInterfaceInfo::ipv4Addresses
std::vector< boost::asio::ip::address_v4 > ipv4Addresses
Definition:
network-interface.hpp:48
nfd::NetworkInterfaceInfo::isUp
bool isUp() const
Definition:
network-interface.hpp:86
nfd::NetworkInterfaceInfo::name
std::string name
Definition:
network-interface.hpp:46
ndn::util::ethernet
Definition:
ethernet.cpp:31
nfd::NetworkInterfaceInfo::flags
unsigned int flags
Definition:
network-interface.hpp:51
ndnSIM
NFD
core
network-interface.hpp
Generated on Wed Jan 11 2017 18:17:15 for ndnSIM by
1.8.13