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,2009 IITP RAS | 3 * Copyright (c) 2008,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 30 matching lines...) Expand all Loading... |
41 const static uint32_t MAX_METRIC = 0xffffffff; | 41 const static uint32_t MAX_METRIC = 0xffffffff; |
42 | 42 |
43 /// Route lookup result, return type of LookupXXX methods | 43 /// Route lookup result, return type of LookupXXX methods |
44 struct LookupResult | 44 struct LookupResult |
45 { | 45 { |
46 Mac48Address retransmitter; ///< retransmitter | 46 Mac48Address retransmitter; ///< retransmitter |
47 uint32_t ifIndex; ///< IF index | 47 uint32_t ifIndex; ///< IF index |
48 uint32_t metric; ///< metric | 48 uint32_t metric; ///< metric |
49 uint32_t seqnum; ///< sequence number | 49 uint32_t seqnum; ///< sequence number |
50 Time lifetime; ///< lifetime | 50 Time lifetime; ///< lifetime |
51 /// Lookup result function | 51 /** |
| 52 * Lookup result function |
| 53 * |
| 54 * \param r the result address |
| 55 * \param i the interface |
| 56 * \param m the metric |
| 57 * \param s |
| 58 * \param l |
| 59 */ |
52 LookupResult (Mac48Address r = Mac48Address::GetBroadcast (), | 60 LookupResult (Mac48Address r = Mac48Address::GetBroadcast (), |
53 uint32_t i = INTERFACE_ANY, | 61 uint32_t i = INTERFACE_ANY, |
54 uint32_t m = MAX_METRIC, | 62 uint32_t m = MAX_METRIC, |
55 uint32_t s = 0, | 63 uint32_t s = 0, |
56 Time l = Seconds (0.0)); | 64 Time l = Seconds (0.0)); |
57 /// True for valid route | 65 /** |
| 66 * \returns True for valid route |
| 67 */ |
58 bool IsValid () const; | 68 bool IsValid () const; |
59 /// Compare route lookup results, used by tests | 69 /** |
| 70 * Compare route lookup results, used by tests |
| 71 * \param o the lookup result to compare |
| 72 * \returns true if equal |
| 73 */ |
60 bool operator== (const LookupResult & o) const; | 74 bool operator== (const LookupResult & o) const; |
61 }; | 75 }; |
62 /// Path precursor = {MAC, interface ID} | 76 /// Path precursor = {MAC, interface ID} |
63 typedef std::vector<std::pair<uint32_t, Mac48Address> > PrecursorList; | 77 typedef std::vector<std::pair<uint32_t, Mac48Address> > PrecursorList; |
64 | 78 |
65 public: | 79 public: |
66 /** | 80 /** |
67 * \brief Get the type ID. | 81 * \brief Get the type ID. |
68 * \return the object TypeId | 82 * \return the object TypeId |
69 */ | 83 */ |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 /// Lookup path to destination | 116 /// Lookup path to destination |
103 LookupResult LookupReactive (Mac48Address destination); | 117 LookupResult LookupReactive (Mac48Address destination); |
104 /// Return all reactive paths, including expired | 118 /// Return all reactive paths, including expired |
105 LookupResult LookupReactiveExpired (Mac48Address destination); | 119 LookupResult LookupReactiveExpired (Mac48Address destination); |
106 /// Find proactive path to tree root. Note that calling this method has side e
ffect of deleting expired proactive path | 120 /// Find proactive path to tree root. Note that calling this method has side e
ffect of deleting expired proactive path |
107 LookupResult LookupProactive (); | 121 LookupResult LookupProactive (); |
108 /// Return all proactive paths, including expired | 122 /// Return all proactive paths, including expired |
109 LookupResult LookupProactiveExpired (); | 123 LookupResult LookupProactiveExpired (); |
110 //\} | 124 //\} |
111 | 125 |
112 /// When peer link with a given MAC-address fails - it returns list of unreach
able destination addresses | 126 /** |
| 127 * When peer link with a given MAC-address fails - it returns list of unreacha
ble destination addresses |
| 128 * \param peerAddress the peer address |
| 129 * \returns the list of unreachable destinations |
| 130 */ |
113 std::vector<HwmpProtocol::FailedDestination> GetUnreachableDestinations (Mac48
Address peerAddress); | 131 std::vector<HwmpProtocol::FailedDestination> GetUnreachableDestinations (Mac48
Address peerAddress); |
114 | 132 |
115 private: | 133 private: |
116 /// Route found in reactive mode | 134 /// Route found in reactive mode |
117 struct Precursor | 135 struct Precursor |
118 { | 136 { |
119 Mac48Address address; ///< address | 137 Mac48Address address; ///< address |
120 uint32_t interface; ///< interface | 138 uint32_t interface; ///< interface |
121 Time whenExpire; ///< expire time | 139 Time whenExpire; ///< expire time |
122 }; | 140 }; |
(...skipping 20 matching lines...) Expand all Loading... |
143 }; | 161 }; |
144 | 162 |
145 /// List of routes | 163 /// List of routes |
146 std::map<Mac48Address, ReactiveRoute> m_routes; | 164 std::map<Mac48Address, ReactiveRoute> m_routes; |
147 /// Path to proactive tree root MP | 165 /// Path to proactive tree root MP |
148 ProactiveRoute m_root; | 166 ProactiveRoute m_root; |
149 }; | 167 }; |
150 } // namespace dot11s | 168 } // namespace dot11s |
151 } // namespace ns3 | 169 } // namespace ns3 |
152 #endif | 170 #endif |
OLD | NEW |