|
|
| 216 |
virtual bool RemoveAddress (uint32_t interface, uint32_t addressIndex) = 0; |
216 |
virtual bool RemoveAddress (uint32_t interface, uint32_t addressIndex) = 0; |
| 217 |
|
217 |
|
| 218 |
/** |
218 |
/** |
|
|
219 |
* \brief Return the first primary source address with scope less than |
| 220 |
* or equal to the requested scope, to use in sending a packet to |
| 221 |
* destination dst out of the specified device. |
| 222 |
* |
| 223 |
* This method mirrors the behavior of Linux inet_select_addr() and is |
| 224 |
* provided because interfaces may have multiple IP addresses configured |
| 225 |
* on them with different scopes, and with a primary and secondary status. |
| 226 |
* Secondary addresses are never returned. |
| 227 |
* \see Ipv4InterfaceAddress |
| 228 |
* |
| 229 |
* If a non-zero device pointer is provided, the method first tries to |
| 230 |
* return a primary address that is configured on that device, and whose |
| 231 |
* subnet matches that of dst and whose scope is less than or equal to |
| 232 |
* the requested scope. If a primary address does not match the |
| 233 |
* subnet of dst but otherwise matches the scope, it is returned. |
| 234 |
* If no such address on the device is found, the other devices are |
| 235 |
* searched in order of their interface index, but not considering dst |
| 236 |
* as a factor in the search. Because a loopback interface is typically |
| 237 |
* the first one configured on a node, it will be the first alternate |
| 238 |
* device to be tried. Addresses scoped at LINK scope are not returned |
| 239 |
* in this phase. |
| 240 |
* |
| 241 |
* If no device pointer is provided, the same logic as above applies, only |
| 242 |
* that there is no preferred device that is consulted first. This means |
| 243 |
* that if the device pointer is null, input parameter dst will be ignored. |
| 244 |
* |
| 245 |
* If there are no possible addresses to return, a warning log message |
| 246 |
* is issued and the all-zeroes address is returned. |
| 247 |
* |
| 248 |
* \param device output NetDevice (optionally provided, only to constrain the search) |
| 249 |
* \param dst Destination address to match, if device is provided |
| 250 |
* \param scope Scope of returned address must be less than or equal to this |
| 251 |
* \returns the first primary Ipv4Address that meets the search criteria |
| 252 |
*/ |
| 253 |
virtual Ipv4Address SelectSourceAddress (Ptr<const NetDevice> device, |
| 254 |
Ipv4Address dst, Ipv4InterfaceAddress::InterfaceAddressScope_e scope) = 0; |
| 255 |
|
| 256 |
/** |
| 219 |
* \param interface The interface number of an Ipv4 interface |
257 |
* \param interface The interface number of an Ipv4 interface |
| 220 |
* \param metric routing metric (cost) associated to the underlying |
258 |
* \param metric routing metric (cost) associated to the underlying |
| 221 |
* Ipv4 interface |
259 |
* Ipv4 interface |