OLD | NEW |
1 // -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- | 1 // -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- |
2 // | 2 // |
3 // Copyright (c) 2008 University of Washington | 3 // Copyright (c) 2008 University of Washington |
4 // | 4 // |
5 // This program is free software; you can redistribute it and/or modify | 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 | 6 // it under the terms of the GNU General Public License version 2 as |
7 // published by the Free Software Foundation; | 7 // published by the Free Software Foundation; |
8 // | 8 // |
9 // This program is distributed in the hope that it will be useful, | 9 // This program is distributed in the hope that it will be useful, |
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 virtual Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, P
tr<NetDevice> oif, Socket::SocketErrno &sockerr); | 85 virtual Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, P
tr<NetDevice> oif, Socket::SocketErrno &sockerr); |
86 | 86 |
87 virtual bool RouteInput (Ptr<const Packet> p, const Ipv4Header &header, Ptr<c
onst NetDevice> idev, | 87 virtual bool RouteInput (Ptr<const Packet> p, const Ipv4Header &header, Ptr<c
onst NetDevice> idev, |
88 UnicastForwardCallback ucb, MulticastForwardCallbac
k mcb, | 88 UnicastForwardCallback ucb, MulticastForwardCallbac
k mcb, |
89 LocalDeliverCallback lcb, ErrorCallback ecb); | 89 LocalDeliverCallback lcb, ErrorCallback ecb); |
90 virtual void NotifyInterfaceUp (uint32_t interface); | 90 virtual void NotifyInterfaceUp (uint32_t interface); |
91 virtual void NotifyInterfaceDown (uint32_t interface); | 91 virtual void NotifyInterfaceDown (uint32_t interface); |
92 virtual void NotifyAddAddress (uint32_t interface, Ipv4InterfaceAddress addres
s); | 92 virtual void NotifyAddAddress (uint32_t interface, Ipv4InterfaceAddress addres
s); |
93 virtual void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress add
ress); | 93 virtual void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress add
ress); |
94 virtual void SetIpv4 (Ptr<Ipv4> ipv4); | 94 virtual void SetIpv4 (Ptr<Ipv4> ipv4); |
| 95 virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const; |
95 | 96 |
96 /** | 97 /** |
97 * \brief Add a host route to the global routing table. | 98 * \brief Add a host route to the global routing table. |
98 * | 99 * |
99 * \param dest The Ipv4Address destination for this route. | 100 * \param dest The Ipv4Address destination for this route. |
100 * \param nextHop The Ipv4Address of the next hop in the route. | 101 * \param nextHop The Ipv4Address of the next hop in the route. |
101 * \param interface The network interface index used to send packets to the | 102 * \param interface The network interface index used to send packets to the |
102 * destination. | 103 * destination. |
103 * | 104 * |
104 * \see Ipv4Address | 105 * \see Ipv4Address |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 Ipv4Mask networkMask, | 162 Ipv4Mask networkMask, |
162 Ipv4Address nextHop, | 163 Ipv4Address nextHop, |
163 uint32_t interface); | 164 uint32_t interface); |
164 | 165 |
165 /** | 166 /** |
166 * \brief Get the number of individual unicast routes that have been added | 167 * \brief Get the number of individual unicast routes that have been added |
167 * to the routing table. | 168 * to the routing table. |
168 * | 169 * |
169 * \warning The default route counts as one of the routes. | 170 * \warning The default route counts as one of the routes. |
170 */ | 171 */ |
171 uint32_t GetNRoutes (void); | 172 uint32_t GetNRoutes (void) const; |
172 | 173 |
173 /** | 174 /** |
174 * \brief Get a route from the global unicast routing table. | 175 * \brief Get a route from the global unicast routing table. |
175 * | 176 * |
176 * Externally, the unicast global routing table appears simply as a table with | 177 * Externally, the unicast global routing table appears simply as a table with |
177 * n entries. The one subtlety of note is that if a default route has been set | 178 * n entries. The one subtlety of note is that if a default route has been set |
178 * it will appear as the zeroth entry in the table. This means that if you | 179 * it will appear as the zeroth entry in the table. This means that if you |
179 * add only a default route, the table will have one entry that can be accessed | 180 * add only a default route, the table will have one entry that can be accessed |
180 * either by explicitly calling GetDefaultRoute () or by calling GetRoute (0). | 181 * either by explicitly calling GetDefaultRoute () or by calling GetRoute (0). |
181 *· | 182 *· |
182 * Similarly, if the default route has been set, calling RemoveRoute (0) will | 183 * Similarly, if the default route has been set, calling RemoveRoute (0) will |
183 * remove the default route. | 184 * remove the default route. |
184 * | 185 * |
185 * \param i The index (into the routing table) of the route to retrieve. If | 186 * \param i The index (into the routing table) of the route to retrieve. If |
186 * the default route has been set, it will occupy index zero. | 187 * the default route has been set, it will occupy index zero. |
187 * \return If route is set, a pointer to that Ipv4RoutingTableEntry is returned,
otherwise | 188 * \return If route is set, a pointer to that Ipv4RoutingTableEntry is returned,
otherwise |
188 * a zero pointer is returned. | 189 * a zero pointer is returned. |
189 * | 190 * |
190 * \see Ipv4RoutingTableEntry | 191 * \see Ipv4RoutingTableEntry |
191 * \see Ipv4GlobalRouting::RemoveRoute | 192 * \see Ipv4GlobalRouting::RemoveRoute |
192 */ | 193 */ |
193 Ipv4RoutingTableEntry *GetRoute (uint32_t i); | 194 Ipv4RoutingTableEntry *GetRoute (uint32_t i) const; |
194 | 195 |
195 /** | 196 /** |
196 * \brief Remove a route from the global unicast routing table. | 197 * \brief Remove a route from the global unicast routing table. |
197 * | 198 * |
198 * Externally, the unicast global routing table appears simply as a table with | 199 * Externally, the unicast global routing table appears simply as a table with |
199 * n entries. The one subtlety of note is that if a default route has been set | 200 * n entries. The one subtlety of note is that if a default route has been set |
200 * it will appear as the zeroth entry in the table. This means that if the | 201 * it will appear as the zeroth entry in the table. This means that if the |
201 * default route has been set, calling RemoveRoute (0) will remove the | 202 * default route has been set, calling RemoveRoute (0) will remove the |
202 * default route. | 203 * default route. |
203 * | 204 * |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 HostRoutes m_hostRoutes; | 237 HostRoutes m_hostRoutes; |
237 NetworkRoutes m_networkRoutes; | 238 NetworkRoutes m_networkRoutes; |
238 ASExternalRoutes m_ASexternalRoutes; // External routes imported | 239 ASExternalRoutes m_ASexternalRoutes; // External routes imported |
239 ·· | 240 ·· |
240 Ptr<Ipv4> m_ipv4; | 241 Ptr<Ipv4> m_ipv4; |
241 }; | 242 }; |
242 | 243 |
243 } // Namespace ns3 | 244 } // Namespace ns3 |
244 | 245 |
245 #endif /* IPV4_GLOBAL_ROUTING_H */ | 246 #endif /* IPV4_GLOBAL_ROUTING_H */ |
OLD | NEW |