117 lines
3.6 KiB
Plaintext
117 lines
3.6 KiB
Plaintext
This repository handles changes to the Ipv4 interface class and Ipv4Impl
|
|
class.
|
|
|
|
1. Changeset: d99061f1167c
|
|
|
|
Synopsis:
|
|
--------
|
|
- deconflict NetDevice::ifIndex and Ipv4::ifIndex (bug 85)
|
|
|
|
Changed public API (src/node)
|
|
--------
|
|
|
|
All function parameters named "ifIndex" that refer to an Ipv4 interface
|
|
are instead named "interface".
|
|
|
|
- static const uint32_t Ipv4RoutingProtocol::IF_INDEX_ANY = 0xffffffff;
|
|
+ static const uint32_t Ipv4RoutingProtocol::INTERFACE_ANY = 0xffffffff;
|
|
|
|
- bool Ipv4RoutingProtocol::RequestIfIndex (Ipv4Address destination, uint32_t& ifIndex);
|
|
+ bool Ipv4RoutingProtocol::RequestInterface (Ipv4Address destination, uint32_t& interface);
|
|
(N.B. this particular function will be later renamed to RouteOutput() in the
|
|
proposed IPv4 routing refactoring)
|
|
|
|
- uint32_t Ipv4::GetIfIndexByAddress (Ipv4Address addr, Ipv4Mask mask);
|
|
+ int_32t Ipv4::GetInterfaceForAddress (Ipv4Address address, Ipv4Mask mask) const;
|
|
|
|
- bool Ipv4::GetIfIndexForDestination (Ipv4Address dest, uint32_t &ifIndex) const;
|
|
+ bool Ipv4::GetInterfaceForDestination (Ipv4Address dest, uint32_t &interface) const;
|
|
(N.B. this function is not needed in the proposed Ipv4 routing refactoring)
|
|
|
|
|
|
New public API or classes (src/node)
|
|
--------
|
|
|
|
None.
|
|
|
|
Changed private API (src/internet-node)
|
|
--------
|
|
|
|
(similar API changes to the IPv4 implementation classes instantiating
|
|
the above public API)
|
|
|
|
New private API or classes (src/internet-node)
|
|
--------
|
|
|
|
None.
|
|
|
|
|
|
========================================================================
|
|
|
|
2. Changeset: e493e80274bd (implementation added in parallel)
|
|
Changeset: db81fdcb06e7 (cut over of client code, remove old code)
|
|
|
|
Synopsis:
|
|
--------
|
|
- allow multiple IPv4 addresses to be assigned to an interface (bug 188)
|
|
|
|
Changed public API:
|
|
--------
|
|
|
|
We now have a new class and methods to account for the possibility of having
|
|
multiple IP addresses on an interface:
|
|
|
|
+ virtual uint32_t AddAddress (uint32_t interface, Ipv4InterfaceAddress address) = 0;
|
|
+ virtual Ipv4InterfaceAddress GetAddress (uint32_t interface, uint32_t addressIndex) const = 0;
|
|
+ virtual uint32_t GetNAddresses (uint32_t interface) const = 0;
|
|
|
|
Regarding legacy API usage, typically where you once did the following,
|
|
using the public Ipv4 class interface (e.g.):
|
|
|
|
ipv4A->SetAddress (ifIndexA, Ipv4Address ("172.16.1.1"));
|
|
ipv4A->SetNetworkMask (ifIndexA, Ipv4Mask ("255.255.255.255"));
|
|
|
|
you now do:
|
|
|
|
Ipv4InterfaceAddress ipv4IfAddrA = Ipv4InterfaceAddress (Ipv4Address ("172.16.1.1"), Ipv4Mask ("255.255.255.255"));
|
|
ipv4A->AddAddress (ifIndexA, ipv4IfAddrA);
|
|
|
|
|
|
At the helper API level, one often gets an address from an interface
|
|
container. We preserve the legacy GetAddress (uint32_t i) but it
|
|
is documented that this will return only the first (address index 0)
|
|
address on the interface, if there are multiple such addresses.
|
|
We provide also an overloaded variant for the multi-address case:
|
|
|
|
Ipv4Address Ipv4InterfaceContainer::GetAddress (uint32_t i)
|
|
+ Ipv4Address Ipv4InterfaceContainer::GetAddress (uint32_t i, uint32_t j)
|
|
|
|
|
|
New public API or classes (src/node)
|
|
--------
|
|
|
|
class Ipv4InterfaceAddress: This is a new class to parallel Linux
|
|
struct in_ifaddr. It holds IP addressing information, including mask,
|
|
broadcast address, scope, whether primary or secondary, etc.
|
|
|
|
Location: src/node/ipv4-interface-address.h
|
|
|
|
========================================================================
|
|
|
|
3. Changeset: 2a05a47dba22
|
|
|
|
Synopsis:
|
|
--------
|
|
- Remove class Ipv4Impl from src/internet-stack
|
|
|
|
Changed public API:
|
|
--------
|
|
|
|
None
|
|
|
|
Changed private API
|
|
---------
|
|
|
|
Remove class Ipv4Impl; class Ipv4L3Protocol now inherits from class Ipv4
|
|
allow multiple IPv4 addresses to be assigned to an interface (bug 188)
|