NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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 
42 {
43 public:
44 
45  int index;
46  std::string name;
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
69 {
70  return (flags & IFF_LOOPBACK) != 0;
71 }
72 
73 inline bool
75 {
76  return (flags & IFF_MULTICAST) != 0;
77 }
78 
79 inline bool
81 {
82  return (flags & IFF_BROADCAST) != 0;
83 }
84 
85 inline bool
87 {
88  return (flags & IFF_UP) != 0;
89 }
90 
94 std::vector<NetworkInterfaceInfo>
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
represents an Ethernet hardware address
Definition: ethernet.hpp:53
contains information about a network interface
ethernet::Address etherAddress
std::vector< NetworkInterfaceInfo > listNetworkInterfaces()
List configured network interfaces on the system and their info.
boost::asio::ip::address_v4 broadcastAddress
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
std::vector< boost::asio::ip::address_v6 > ipv6Addresses
std::vector< boost::asio::ip::address_v4 > ipv4Addresses