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 Strasbourg University | 3 * Copyright (c) 2008-2009 Strasbourg University |
4 * 2013 Universita' di Firenze | 4 * 2013 Universita' di Firenze |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 | 40 |
41 Ipv6InterfaceContainer::Iterator | 41 Ipv6InterfaceContainer::Iterator |
42 Ipv6InterfaceContainer::End (void) const | 42 Ipv6InterfaceContainer::End (void) const |
43 { | 43 { |
44 return m_interfaces.end (); | 44 return m_interfaces.end (); |
45 } | 45 } |
46 | 46 |
47 uint32_t Ipv6InterfaceContainer::GetN () const | 47 uint32_t Ipv6InterfaceContainer::GetN () const |
48 { | 48 { |
49 return m_interfaces.size (); | 49 return static_cast<uint32_t> (m_interfaces.size ()); |
50 } | 50 } |
51 | 51 |
52 uint32_t Ipv6InterfaceContainer::GetInterfaceIndex (uint32_t i) const | 52 uint32_t Ipv6InterfaceContainer::GetInterfaceIndex (uint32_t i) const |
53 { | 53 { |
54 return m_interfaces[i].second; | 54 return m_interfaces[i].second; |
55 } | 55 } |
56 | 56 |
57 Ipv6Address Ipv6InterfaceContainer::GetAddress (uint32_t i, uint32_t j) const | 57 Ipv6Address Ipv6InterfaceContainer::GetAddress (uint32_t i, uint32_t j) const |
58 { | 58 { |
59 Ptr<Ipv6> ipv6 = m_interfaces[i].first; | 59 Ptr<Ipv6> ipv6 = m_interfaces[i].first; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 167 } |
168 | 168 |
169 | 169 |
170 void Ipv6InterfaceContainer::SetDefaultRoute (uint32_t i, Ipv6Address routerAddr
) | 170 void Ipv6InterfaceContainer::SetDefaultRoute (uint32_t i, Ipv6Address routerAddr
) |
171 { | 171 { |
172 uint32_t routerIndex = 0; | 172 uint32_t routerIndex = 0; |
173 bool found = false; | 173 bool found = false; |
174 for (uint32_t index = 0; index < m_interfaces.size (); index++) | 174 for (uint32_t index = 0; index < m_interfaces.size (); index++) |
175 { | 175 { |
176 Ptr<Ipv6> ipv6 = m_interfaces[index].first; | 176 Ptr<Ipv6> ipv6 = m_interfaces[index].first; |
177 for (uint32_t i = 0; i < ipv6->GetNAddresses (m_interfaces[index].second);
i++) | 177 for (uint32_t j = 0; j < ipv6->GetNAddresses (m_interfaces[index].second);
j++) |
178 { | 178 { |
179 Ipv6Address addr = ipv6->GetAddress (m_interfaces[index].second, i).Ge
tAddress (); | 179 Ipv6Address addr = ipv6->GetAddress (m_interfaces[index].second, j).Ge
tAddress (); |
180 if (addr == routerAddr) | 180 if (addr == routerAddr) |
181 { | 181 { |
182 routerIndex = index; | 182 routerIndex = index; |
183 found = true; | 183 found = true; |
184 break; | 184 break; |
185 } | 185 } |
186 } | 186 } |
187 if (found) | 187 if (found) |
188 { | 188 { |
189 break; | 189 break; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 { | 257 { |
258 return iAddress.GetAddress (); | 258 return iAddress.GetAddress (); |
259 } | 259 } |
260 } | 260 } |
261 return Ipv6Address::GetAny (); | 261 return Ipv6Address::GetAny (); |
262 } | 262 } |
263 | 263 |
264 | 264 |
265 } /* namespace ns3 */ | 265 } /* namespace ns3 */ |
266 | 266 |
OLD | NEW |