author | Tom Henderson <tomh@tomh.org> |
Sun, 12 Apr 2009 22:40:31 -0700 | |
changeset 4377 | 2a05a47dba22 |
parent 4376 | ac217f25fe70 |
child 4378 | 3ad10f8db106 |
permissions | -rw-r--r-- |
4376 | 1 |
This repository handles changes to the Ipv4 interface class and Ipv4Impl |
2 |
class. |
|
3 |
||
4374 | 4 |
1. Changeset: d99061f1167c |
4371
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
5 |
|
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
6 |
Synopsis: |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
7 |
-------- |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
8 |
- deconflict NetDevice::ifIndex and Ipv4::ifIndex (bug 85) |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
9 |
|
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
10 |
Changed public API (src/node) |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
11 |
-------- |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
12 |
|
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
13 |
All function parameters named "ifIndex" that refer to an Ipv4 interface |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
14 |
are instead named "interface". |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
15 |
|
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
16 |
- static const uint32_t Ipv4RoutingProtocol::IF_INDEX_ANY = 0xffffffff; |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
17 |
+ static const uint32_t Ipv4RoutingProtocol::INTERFACE_ANY = 0xffffffff; |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
18 |
|
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
19 |
- bool Ipv4RoutingProtocol::RequestIfIndex (Ipv4Address destination, uint32_t& ifIndex); |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
20 |
+ bool Ipv4RoutingProtocol::RequestInterface (Ipv4Address destination, uint32_t& interface); |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
21 |
(N.B. this particular function will be later renamed to RouteOutput() in the |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
22 |
proposed IPv4 routing refactoring) |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
23 |
|
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
24 |
- uint32_t Ipv4::GetIfIndexByAddress (Ipv4Address addr, Ipv4Mask mask); |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
25 |
+ int_32t Ipv4::GetInterfaceForAddress (Ipv4Address address, Ipv4Mask mask) const; |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
26 |
|
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
27 |
- bool Ipv4::GetIfIndexForDestination (Ipv4Address dest, uint32_t &ifIndex) const; |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
28 |
+ bool Ipv4::GetInterfaceForDestination (Ipv4Address dest, uint32_t &interface) const; |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
29 |
(N.B. this function is not needed in the proposed Ipv4 routing refactoring) |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
30 |
|
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
31 |
|
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
32 |
New public API or classes (src/node) |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
33 |
-------- |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
34 |
|
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
35 |
None. |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
36 |
|
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
37 |
Changed private API (src/internet-node) |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
38 |
-------- |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
39 |
|
4374 | 40 |
(similar API changes to the IPv4 implementation classes instantiating |
41 |
the above public API) |
|
42 |
||
4371
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
43 |
New private API or classes (src/internet-node) |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
44 |
-------- |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
45 |
|
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
46 |
None. |
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
47 |
|
4374 | 48 |
|
49 |
======================================================================== |
|
50 |
||
51 |
2. Changeset: e493e80274bd (implementation added in parallel) |
|
4376 | 52 |
Changeset: db81fdcb06e7 (cut over of client code, remove old code) |
4374 | 53 |
|
54 |
Synopsis: |
|
55 |
-------- |
|
4371
d942c257847d
File for documenting API changes of this repo
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
56 |
- allow multiple IPv4 addresses to be assigned to an interface (bug 188) |
4374 | 57 |
|
58 |
Changed public API: |
|
59 |
-------- |
|
60 |
||
61 |
We now have a new class and methods to account for the possibility of having |
|
62 |
multiple IP addresses on an interface: |
|
63 |
||
64 |
+ virtual uint32_t AddAddress (uint32_t interface, Ipv4InterfaceAddress address) = 0; |
|
65 |
+ virtual Ipv4InterfaceAddress GetAddress (uint32_t interface, uint32_t addressIndex) const = 0; |
|
66 |
+ virtual uint32_t GetNAddresses (uint32_t interface) const = 0; |
|
67 |
||
4376 | 68 |
Regarding legacy API usage, typically where you once did the following, |
69 |
using the public Ipv4 class interface (e.g.): |
|
70 |
||
71 |
ipv4A->SetAddress (ifIndexA, Ipv4Address ("172.16.1.1")); |
|
72 |
ipv4A->SetNetworkMask (ifIndexA, Ipv4Mask ("255.255.255.255")); |
|
73 |
||
74 |
you now do: |
|
4374 | 75 |
|
4376 | 76 |
Ipv4InterfaceAddress ipv4IfAddrA = Ipv4InterfaceAddress (Ipv4Address ("172.16.1.1"), Ipv4Mask ("255.255.255.255")); |
77 |
ipv4A->AddAddress (ifIndexA, ipv4IfAddrA); |
|
78 |
||
79 |
||
80 |
At the helper API level, one often gets an address from an interface |
|
81 |
container. We preserve the legacy GetAddress (uint32_t i) but it |
|
82 |
is documented that this will return only the first (address index 0) |
|
83 |
address on the interface, if there are multiple such addresses. |
|
84 |
We provide also an overloaded variant for the multi-address case: |
|
85 |
||
86 |
Ipv4Address Ipv4InterfaceContainer::GetAddress (uint32_t i) |
|
87 |
+ Ipv4Address Ipv4InterfaceContainer::GetAddress (uint32_t i, uint32_t j) |
|
4374 | 88 |
|
89 |
||
90 |
New public API or classes (src/node) |
|
91 |
-------- |
|
92 |
||
93 |
class Ipv4InterfaceAddress: This is a new class to parallel Linux |
|
94 |
struct in_ifaddr. It holds IP addressing information, including mask, |
|
95 |
broadcast address, scope, whether primary or secondary, etc. |
|
96 |
||
4376 | 97 |
Location: src/node/ipv4-interface-address.h |
4374 | 98 |
|
99 |
======================================================================== |
|
100 |
||
101 |
3. Changeset: TBD |
|
102 |
||
103 |
Synopsis: |
|
104 |
-------- |
|
105 |
- Remove class Ipv4Impl from src/internet-stack |
|
106 |
||
107 |
Changed public API: |
|
108 |
-------- |
|
109 |
||
110 |
None |
|
111 |
||
112 |
Changed private API |
|
113 |
--------- |
|
114 |
||
115 |
Remove class Ipv4Impl; class Ipv4L3Protocol now inherits from class Ipv4 |
|
116 |
allow multiple IPv4 addresses to be assigned to an interface (bug 188) |