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 IITP RAS | 3 * Copyright (c) 2009 IITP RAS |
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 23 matching lines...) Expand all Loading... |
34 * \ingroup aodv | 34 * \ingroup aodv |
35 * | 35 * |
36 * \brief Helper class used to remember already seen packets and detect duplicat
es. | 36 * \brief Helper class used to remember already seen packets and detect duplicat
es. |
37 * | 37 * |
38 * Currently duplicate detection is based on uinique packet ID given by Packet::
GetUid () | 38 * Currently duplicate detection is based on uinique packet ID given by Packet::
GetUid () |
39 * This approach is known to be weak and should be changed. | 39 * This approach is known to be weak and should be changed. |
40 */ | 40 */ |
41 class DuplicatePacketDetection | 41 class DuplicatePacketDetection |
42 { | 42 { |
43 public: | 43 public: |
44 /// C-tor | 44 /** |
| 45 * C-tor |
| 46 * \param lifetime the duplicate record lifetime |
| 47 */ |
45 DuplicatePacketDetection (Time lifetime) : m_idCache (lifetime) | 48 DuplicatePacketDetection (Time lifetime) : m_idCache (lifetime) |
46 { | 49 { |
47 } | 50 } |
48 /// Check that the packet is duplicated. If not, save information about this p
acket. | 51 /** |
| 52 * Check that the packet is duplicated. If not, save information about this pa
cket. |
| 53 * \param p the packet to check |
| 54 * \param header the IP header to check |
| 55 * \returns true if duplicated |
| 56 */ |
49 bool IsDuplicate (Ptr<const Packet> p, const Ipv4Header & header); | 57 bool IsDuplicate (Ptr<const Packet> p, const Ipv4Header & header); |
50 /// Set duplicate records lifetimes | 58 /** |
| 59 * Set duplicate records lifetimes |
| 60 * \param lifetime the lifetime for duplicate records |
| 61 */ |
51 void SetLifetime (Time lifetime); | 62 void SetLifetime (Time lifetime); |
52 /// Get duplicate records lifetimes | 63 /** |
| 64 * Get duplicate records lifetimes |
| 65 * \returns the duplicate record lifetime |
| 66 */ |
53 Time GetLifetime () const; | 67 Time GetLifetime () const; |
54 private: | 68 private: |
55 /// Impl | 69 /// Impl |
56 IdCache m_idCache; | 70 IdCache m_idCache; |
57 }; | 71 }; |
58 | 72 |
59 } | 73 } |
60 } | 74 } |
61 | 75 |
62 #endif /* AODV_DPD_H */ | 76 #endif /* AODV_DPD_H */ |
OLD | NEW |