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) 2009 University of Washington | 3 * Copyright (c) 2009 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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 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 | 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 | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 */ | 17 */ |
18 #ifndef IPV4_ROUTING_PROTOCOL_H | 18 #ifndef IPV4_ROUTING_PROTOCOL_H |
19 #define IPV4_ROUTING_PROTOCOL_H | 19 #define IPV4_ROUTING_PROTOCOL_H |
20 | 20 |
21 #include "ns3/packet.h" | 21 #include "ns3/packet.h" |
22 #include "ns3/callback.h" | 22 #include "ns3/callback.h" |
23 #include "ns3/object.h" | 23 #include "ns3/object.h" |
24 #include "ns3/socket.h" | 24 #include "ns3/socket.h" |
25 #include "ipv4-header.h" | 25 #include "ipv4-header.h" |
26 #include "ns3/ipv4-interface-address.h" | 26 #include "ns3/ipv4-interface-address.h" |
27 #include "ipv4.h" | 27 #include "ipv4.h" |
28 #include "ns3/output-stream-wrapper.h" | 28 #include "ns3/output-stream-wrapper.h" |
| 29 #include "flowi.h" |
29 | 30 |
30 namespace ns3 { | 31 namespace ns3 { |
31 | 32 |
32 class Ipv4MulticastRoute; | 33 class Ipv4MulticastRoute; |
33 class Ipv4Route; | 34 class Ipv4Route; |
34 class NetDevice; | 35 class NetDevice; |
35 | 36 |
36 /** | 37 /** |
37 * \ingroup internet· | 38 * \ingroup internet· |
38 * \defgroup ipv4Routing Ipv4RoutingProtocol· | 39 * \defgroup ipv4Routing Ipv4RoutingProtocol· |
(...skipping 20 matching lines...) Expand all Loading... |
59 | 60 |
60 /** | 61 /** |
61 * \brief Query routing cache for an existing route, for an outbound packet | 62 * \brief Query routing cache for an existing route, for an outbound packet |
62 * | 63 * |
63 * This lookup is used by transport protocols. It does not cause any | 64 * This lookup is used by transport protocols. It does not cause any |
64 * packet to be forwarded, and is synchronous. Can be used for | 65 * packet to be forwarded, and is synchronous. Can be used for |
65 * multicast or unicast. The Linux equivalent is ip_route_output() | 66 * multicast or unicast. The Linux equivalent is ip_route_output() |
66 * | 67 * |
67 * \param p packet to be routed. Note that this method may modify the packet. | 68 * \param p packet to be routed. Note that this method may modify the packet. |
68 * Callers may also pass in a null pointer.· | 69 * Callers may also pass in a null pointer.· |
69 * \param header input parameter (used to form key to search for the route) | 70 * \param flowi structure with information to routing algorithm. |
70 * \param oif Output interface Netdevice. May be zero, or may be bound via | |
71 * socket options to a particular output interface. | |
72 * \param sockerr Output parameter; socket errno· | 71 * \param sockerr Output parameter; socket errno· |
73 * | 72 * |
74 * \returns a code that indicates what happened in the lookup | 73 * \returns a code that indicates what happened in the lookup |
75 */ | 74 */ |
76 virtual Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, P
tr<NetDevice> oif, Socket::SocketErrno &sockerr) = 0; | 75 virtual Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4FlowI &flowi, Soc
ket::SocketErrno &sockerr) = 0; |
77 | 76 |
78 /** | 77 /** |
79 * \brief Route an input packet (to be forwarded or locally delivered) | 78 * \brief Route an input packet (to be forwarded or locally delivered) |
80 * | 79 * |
81 * This lookup is used in the forwarding process. The packet is | 80 * This lookup is used in the forwarding process. The packet is |
82 * handed over to the Ipv4RoutingProtocol, and will get forwarded onward | 81 * handed over to the Ipv4RoutingProtocol, and will get forwarded onward |
83 * by one of the callbacks. The Linux equivalent is ip_route_input(). | 82 * by one of the callbacks. The Linux equivalent is ip_route_input(). |
84 * There are four valid outcomes, and a matching callbacks to handle each. | 83 * There are four valid outcomes, and a matching callbacks to handle each. |
85 * | 84 * |
86 * \param p received packet | 85 * \param p received packet |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 * Typically, invoked directly or indirectly from ns3::Ipv4::SetRoutingProtoco
l | 140 * Typically, invoked directly or indirectly from ns3::Ipv4::SetRoutingProtoco
l |
142 */ | 141 */ |
143 virtual void SetIpv4 (Ptr<Ipv4> ipv4) = 0; | 142 virtual void SetIpv4 (Ptr<Ipv4> ipv4) = 0; |
144 | 143 |
145 virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const = 0; | 144 virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const = 0; |
146 }; | 145 }; |
147 | 146 |
148 } // namespace ns3 | 147 } // namespace ns3 |
149 | 148 |
150 #endif /* IPV4_ROUTING_PROTOCOL_H */ | 149 #endif /* IPV4_ROUTING_PROTOCOL_H */ |
OLD | NEW |