A Discrete-Event Network Simulator
API
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 
198 
205 public:
210 
224  Ipv4Address GetOrigin (void) const;
228  Ipv4Address GetGroup (void) const;
232  uint32_t GetInputInterface (void) const;
236  uint32_t GetNOutputInterfaces (void) const;
241  uint32_t GetOutputInterface (uint32_t n) const;
245  std::vector<uint32_t> GetOutputInterfaces (void) const;
254  Ipv4Address group, uint32_t inputInterface,
255  std::vector<uint32_t> outputInterfaces);
256 
257 private:
266  uint32_t inputInterface, std::vector<uint32_t> outputInterfaces);
267 
270  uint32_t m_inputInterface;
271  std::vector<uint32_t> m_outputInterfaces;
272 };
273 
281 std::ostream& operator<< (std::ostream& os, Ipv4MulticastRoutingTableEntry const& route);
282 
291 
292 } // namespace ns3
293 
294 #endif /* IPV4_ROUTING_TABLE_ENTRY_H */
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
a class to represent an Ipv4 address mask
Definition: ipv4-address.h:256
A record of an IPv4 multicast route for Ipv4GlobalRouting and Ipv4StaticRouting.
Ipv4Address GetGroup(void) const
Ipv4Address m_origin
source address
std::vector< uint32_t > m_outputInterfaces
output interfaces
std::vector< uint32_t > GetOutputInterfaces(void) const
Ipv4Address m_group
destination address
uint32_t GetOutputInterface(uint32_t n) const
Ipv4Address GetOrigin(void) const
uint32_t GetInputInterface(void) const
Ipv4MulticastRoutingTableEntry()
This constructor does nothing.
static Ipv4MulticastRoutingTableEntry CreateMulticastRoute(Ipv4Address origin, Ipv4Address group, uint32_t inputInterface, std::vector< uint32_t > outputInterfaces)
uint32_t m_inputInterface
input interface
uint32_t GetNOutputInterfaces(void) const
A record of an IPv4 routing table entry for Ipv4GlobalRouting and Ipv4StaticRouting.
static Ipv4RoutingTableEntry CreateDefaultRoute(Ipv4Address nextHop, uint32_t interface)
Ipv4Address m_dest
destination address
Ipv4RoutingTableEntry()
This constructor does nothing.
uint32_t m_interface
output interface
bool IsNetwork(void) const
bool IsHost(void) const
bool IsDefault(void) const
uint32_t GetInterface(void) const
bool IsGateway(void) const
Ipv4Mask m_destNetworkMask
destination network mask
Ipv4Address GetDestNetwork(void) const
Ipv4Address GetDest(void) const
Ipv4Mask GetDestNetworkMask(void) const
Ipv4Address m_gateway
gateway
static Ipv4RoutingTableEntry CreateNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface)
static Ipv4RoutingTableEntry CreateHostRouteTo(Ipv4Address dest, Ipv4Address nextHop, uint32_t interface)
Ipv4Address GetGateway(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool operator==(const EventId &a, const EventId &b)
Definition: event-id.h:158
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:139