A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ipv4-routing-table-entry.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 #ifndef IPV4_ROUTING_TABLE_ENTRY_H
21 #define IPV4_ROUTING_TABLE_ENTRY_H
22 
23 #include <list>
24 #include <vector>
25 #include <ostream>
26 
27 #include "ns3/ipv4-address.h"
28 
29 namespace ns3 {
30 
38 public:
56  bool IsHost (void) const;
62  bool IsNetwork (void) const;
66  bool IsDefault (void) const;
70  bool IsGateway (void) const;
74  Ipv4Address GetGateway (void) const;
78  Ipv4Address GetDest (void) const;
82  Ipv4Address GetDestNetwork (void) const;
86  Ipv4Mask GetDestNetworkMask (void) const;
90  uint32_t GetInterface (void) const;
98  Ipv4Address nextHop,
99  uint32_t interface);
106  uint32_t interface);
115  Ipv4Mask networkMask,
116  Ipv4Address nextHop,
117  uint32_t interface);
125  Ipv4Mask networkMask,
126  uint32_t interface);
135  uint32_t interface);
136 
137 private:
146  Ipv4Mask mask,
147  Ipv4Address gateway,
148  uint32_t interface);
156  Ipv4Mask mask,
157  uint32_t interface);
165  Ipv4Address gateway,
166  uint32_t interface);
173  uint32_t interface);
174 
178  uint32_t m_interface;
179 };
180 
188 std::ostream& operator<< (std::ostream& os, Ipv4RoutingTableEntry const& route);
189 
196 public:
201 
215  Ipv4Address GetOrigin (void) const;
219  Ipv4Address GetGroup (void) const;
223  uint32_t GetInputInterface (void) const;
227  uint32_t GetNOutputInterfaces (void) const;
232  uint32_t GetOutputInterface (uint32_t n) const;
236  std::vector<uint32_t> GetOutputInterfaces (void) const;
245  Ipv4Address group, uint32_t inputInterface,
246  std::vector<uint32_t> outputInterfaces);
247 
248 private:
257  uint32_t inputInterface, std::vector<uint32_t> outputInterfaces);
258 
261  uint32_t m_inputInterface;
262  std::vector<uint32_t> m_outputInterfaces;
263 };
264 
272 std::ostream& operator<< (std::ostream& os, Ipv4MulticastRoutingTableEntry const& route);
273 
274 } // namespace ns3
275 
276 #endif /* IPV4_ROUTING_TABLE_ENTRY_H */
Ipv4Address m_origin
source address
uint32_t m_inputInterface
input interface
a class to represent an Ipv4 address mask
Definition: ipv4-address.h:210
Ipv4Address GetOrigin(void) const
Ipv4Address GetDestNetwork(void) const
uint32_t GetInputInterface(void) const
uint32_t m_interface
output interface
static Ipv4MulticastRoutingTableEntry CreateMulticastRoute(Ipv4Address origin, Ipv4Address group, uint32_t inputInterface, std::vector< uint32_t > outputInterfaces)
Ipv4Address m_group
destination address
uint32_t GetInterface(void) const
A record of an IPv4 routing table entry for Ipv4GlobalRouting and Ipv4StaticRouting.
bool IsGateway(void) const
static Ipv4RoutingTableEntry CreateHostRouteTo(Ipv4Address dest, Ipv4Address nextHop, uint32_t interface)
static Ipv4RoutingTableEntry CreateNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface)
std::vector< uint32_t > m_outputInterfaces
output interfaces
bool IsNetwork(void) const
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:43
Ipv4Address m_gateway
gateway
Ipv4MulticastRoutingTableEntry()
This constructor does nothing.
uint32_t GetOutputInterface(uint32_t n) const
Ipv4Mask m_destNetworkMask
destination network mask
static Ipv4RoutingTableEntry CreateDefaultRoute(Ipv4Address nextHop, uint32_t interface)
Ipv4Address GetDest(void) const
A record of an IPv4 multicast route for Ipv4GlobalRouting and Ipv4StaticRouting.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:38
Ipv4Address GetGroup(void) const
Ipv4Address GetGateway(void) const
Ipv4Address m_dest
destination address
uint32_t GetNOutputInterfaces(void) const
bool IsHost(void) const
Ipv4Mask GetDestNetworkMask(void) const
bool IsDefault(void) const
std::vector< uint32_t > GetOutputInterfaces(void) const
Ipv4RoutingTableEntry()
This constructor does nothing.