A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ipv4-routing-table-entry.h
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:
139  Ipv4Mask mask,
140  Ipv4Address gateway,
141  uint32_t interface);
143  Ipv4Mask mask,
144  uint32_t interface);
146  Ipv4Address gateway,
147  uint32_t interface);
149  uint32_t interface);
150 
151  Ipv4Address m_dest;
152  Ipv4Mask m_destNetworkMask;
153  Ipv4Address m_gateway;
154  uint32_t m_interface;
155 };
156 
157 std::ostream& operator<< (std::ostream& os, Ipv4RoutingTableEntry const& route);
158 
165 public:
170 
184  Ipv4Address GetOrigin (void) const;
188  Ipv4Address GetGroup (void) const;
192  uint32_t GetInputInterface (void) const;
196  uint32_t GetNOutputInterfaces (void) const;
201  uint32_t GetOutputInterface (uint32_t n) const;
205  std::vector<uint32_t> GetOutputInterfaces (void) const;
214  Ipv4Address group, uint32_t inputInterface,
215  std::vector<uint32_t> outputInterfaces);
216 
217 private:
219  uint32_t inputInterface, std::vector<uint32_t> outputInterfaces);
220 
221  Ipv4Address m_origin;
222  Ipv4Address m_group;
223  uint32_t m_inputInterface;
224  std::vector<uint32_t> m_outputInterfaces;
225 };
226 
227 std::ostream& operator<< (std::ostream& os, Ipv4MulticastRoutingTableEntry const& route);
228 
229 } // namespace ns3
230 
231 #endif /* IPV4_ROUTING_TABLE_ENTRY_H */
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
static Ipv4MulticastRoutingTableEntry CreateMulticastRoute(Ipv4Address origin, Ipv4Address group, uint32_t inputInterface, std::vector< uint32_t > outputInterfaces)
uint32_t GetInterface(void) const
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)
bool IsNetwork(void) const
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:43
Ipv4MulticastRoutingTableEntry()
This constructor does nothing.
uint32_t GetOutputInterface(uint32_t n) const
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
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.