LEFT | RIGHT |
(no file at all) | |
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 11 matching lines...) Expand all Loading... |
22 * Information and Telecommunication Technology Center (ITTC) | 22 * Information and Telecommunication Technology Center (ITTC) |
23 * and Department of Electrical Engineering and Computer Science | 23 * and Department of Electrical Engineering and Computer Science |
24 * The University of Kansas Lawrence, KS USA. | 24 * The University of Kansas Lawrence, KS USA. |
25 * | 25 * |
26 * Work supported in part by NSF FIND (Future Internet Design) Program | 26 * Work supported in part by NSF FIND (Future Internet Design) Program |
27 * under grant CNS-0626918 (Postmodern Internet Architecture), | 27 * under grant CNS-0626918 (Postmodern Internet Architecture), |
28 * NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimenta
tion on GENI), | 28 * NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimenta
tion on GENI), |
29 * US Department of Defense (DoD), and ITTC at The University of Kansas. | 29 * US Department of Defense (DoD), and ITTC at The University of Kansas. |
30 */ | 30 */ |
31 | 31 |
32 #ifndef DSR_RSENDBUFF_H | 32 #ifndef DSR_SENDBUFF_H |
33 #define DSR_RSENDBUFF_H | 33 #define DSR_SENDBUFF_H |
34 | 34 |
35 #include <vector> | 35 #include <vector> |
36 #include "ns3/ipv4-routing-protocol.h" | 36 #include "ns3/ipv4-routing-protocol.h" |
37 #include "ns3/simulator.h" | 37 #include "ns3/simulator.h" |
38 | 38 |
39 namespace ns3 { | 39 namespace ns3 { |
40 namespace dsr { | 40 namespace dsr { |
41 /** | 41 /** |
42 * \ingroup dsr | 42 * \ingroup dsr |
43 * \brief DSR Send Buffer Entry | 43 * \brief DSR Send Buffer Entry |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 { | 132 { |
133 } | 133 } |
134 // / Push entry in queue, if there is no entry with the same packet and destin
ation address in queue. | 134 // / Push entry in queue, if there is no entry with the same packet and destin
ation address in queue. |
135 bool Enqueue (SendBuffEntry & entry); | 135 bool Enqueue (SendBuffEntry & entry); |
136 // / Return first found (the earliest) entry for given destination | 136 // / Return first found (the earliest) entry for given destination |
137 bool Dequeue (Ipv4Address dst, SendBuffEntry & entry); | 137 bool Dequeue (Ipv4Address dst, SendBuffEntry & entry); |
138 // / Remove all packets with destination IP address dst | 138 // / Remove all packets with destination IP address dst |
139 void DropPacketWithDst (Ipv4Address dst); | 139 void DropPacketWithDst (Ipv4Address dst); |
140 // / Finds whether a packet with destination dst exists in the queue | 140 // / Finds whether a packet with destination dst exists in the queue |
141 bool Find (Ipv4Address dst); | 141 bool Find (Ipv4Address dst); |
142 // / Find number of packets with destination dst in the queue | |
143 uint32_t FindPacketsWithDst (Ipv4Address dst); | |
144 // / Number of entries | 142 // / Number of entries |
145 uint32_t GetSize (); | 143 uint32_t GetSize (); |
146 // /\name Fields | 144 // /\name Fields |
147 // \{ | 145 // \{ |
148 uint32_t GetMaxQueueLen () const | 146 uint32_t GetMaxQueueLen () const |
149 { | 147 { |
150 return m_maxLen; | 148 return m_maxLen; |
151 } | 149 } |
152 void SetMaxQueueLen (uint32_t len) | 150 void SetMaxQueueLen (uint32_t len) |
153 { | 151 { |
(...skipping 28 matching lines...) Expand all Loading... |
182 // / Check if the send buffer entry is the same or not | 180 // / Check if the send buffer entry is the same or not |
183 static bool IsEqual (SendBuffEntry en, const Ipv4Address dst) | 181 static bool IsEqual (SendBuffEntry en, const Ipv4Address dst) |
184 { | 182 { |
185 return (en.GetDestination () == dst); | 183 return (en.GetDestination () == dst); |
186 } | 184 } |
187 }; | 185 }; |
188 /*******************************************************************************
************************************************/ | 186 /*******************************************************************************
************************************************/ |
189 } // namespace dsr | 187 } // namespace dsr |
190 } // namespace ns3 | 188 } // namespace ns3 |
191 | 189 |
192 #endif /* DSR_RSENDBUFF_H */ | 190 #endif /* DSR_SENDBUFF_H */ |
LEFT | RIGHT |