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) 2011 Yufei Cheng | 3 * Copyright (c) 2011 Yufei Cheng |
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 30 matching lines...) Expand all Loading... |
41 namespace ns3 { | 41 namespace ns3 { |
42 namespace dsr { | 42 namespace dsr { |
43 /* | 43 /* |
44 * The gratuitous table entries, it maintains the already sent gratuitous route
reply entries. | 44 * The gratuitous table entries, it maintains the already sent gratuitous route
reply entries. |
45 * When the node "promiscuously" received a packet destined for other nodes, and
inferred a shorter | 45 * When the node "promiscuously" received a packet destined for other nodes, and
inferred a shorter |
46 * route for the data packet, it will construct a route reply and send back to t
he source | 46 * route for the data packet, it will construct a route reply and send back to t
he source |
47 */ | 47 */ |
48 struct GraReplyEntry | 48 struct GraReplyEntry |
49 { | 49 { |
50 Ipv4Address m_replyTo; | 50 Ipv4Address m_replyTo; |
51 Ipv4Address m_replyFrom; | 51 Ipv4Address m_hearFrom; |
52 Time m_gratReplyHoldoff; | 52 Time m_gratReplyHoldoff; |
53 | 53 |
54 GraReplyEntry (Ipv4Address t, Ipv4Address f, Time h) | 54 GraReplyEntry (Ipv4Address t, Ipv4Address f, Time h) |
55 : m_replyTo (t), | 55 : m_replyTo (t), |
56 m_replyFrom (f), | 56 m_hearFrom (f), |
57 m_gratReplyHoldoff (h) | 57 m_gratReplyHoldoff (h) |
58 { | 58 { |
59 } | 59 } |
60 }; | 60 }; |
61 /** | 61 /** |
62 * \ingroup dsr | 62 * \ingroup dsr |
63 * \brief maintain the gratuitous reply | 63 * \brief maintain the gratuitous reply |
64 */ | 64 */ |
65 class GraReply : public Object | 65 class GraReply : public Object |
66 { | 66 { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 bool operator() (const struct GraReplyEntry & b) const | 113 bool operator() (const struct GraReplyEntry & b) const |
114 { | 114 { |
115 return (b.m_gratReplyHoldoff < Simulator::Now ()); | 115 return (b.m_gratReplyHoldoff < Simulator::Now ()); |
116 } | 116 } |
117 }; | 117 }; |
118 }; | 118 }; |
119 } // namespace dsr | 119 } // namespace dsr |
120 } // namespace ns3 | 120 } // namespace ns3 |
121 | 121 |
122 #endif /* DSR_GRATUITOUS_REPLY_TABLE_H */ | 122 #endif /* DSR_GRATUITOUS_REPLY_TABLE_H */ |
OLD | NEW |