README.api
author Tom Henderson <tomh@tomh.org>
Fri, 17 Apr 2009 12:33:17 -0700
changeset 4379 44c7757fb216
parent 4378 3ad10f8db106
permissions -rw-r--r--
merge with tip
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4376
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
     1
This repository handles changes to the Ipv4 interface class and Ipv4Impl
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
     2
class.
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
     3
4374
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
     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
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    40
(similar API changes to the IPv4 implementation classes instantiating
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    41
the above public API) 
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    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
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    48
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    49
========================================================================
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    50
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    51
2.  Changeset: e493e80274bd (implementation added in parallel)
4376
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    52
    Changeset: db81fdcb06e7 (cut over of client code, remove old code)
4374
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    53
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    54
Synopsis:
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    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
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    57
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    58
Changed public API:
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    59
--------
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    60
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    61
We now have a new class and methods to account for the possibility of having
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    62
multiple IP addresses on an interface:
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    63
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    64
+  virtual uint32_t AddAddress (uint32_t interface, Ipv4InterfaceAddress address) = 0;
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    65
+  virtual Ipv4InterfaceAddress GetAddress (uint32_t interface, uint32_t addressIndex) const = 0;
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    66
+  virtual uint32_t GetNAddresses (uint32_t interface) const = 0;
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    67
4376
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    68
Regarding legacy API usage, typically where you once did the following,
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    69
using the public Ipv4 class interface (e.g.):
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    70
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    71
  ipv4A->SetAddress (ifIndexA, Ipv4Address ("172.16.1.1"));
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    72
  ipv4A->SetNetworkMask (ifIndexA, Ipv4Mask ("255.255.255.255"));
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    73
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    74
you now do:
4374
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    75
4376
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    76
  Ipv4InterfaceAddress ipv4IfAddrA = Ipv4InterfaceAddress (Ipv4Address ("172.16.1.1"), Ipv4Mask ("255.255.255.255"));
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    77
  ipv4A->AddAddress (ifIndexA, ipv4IfAddrA);
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    78
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    79
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    80
At the helper API level, one often gets an address from an interface
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    81
container.  We preserve the legacy GetAddress (uint32_t i) but it
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    82
is documented that this will return only the first (address index 0)
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    83
address on the interface, if there are multiple such addresses. 
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    84
We provide also an overloaded variant for the multi-address case: 
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    85
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    86
Ipv4Address Ipv4InterfaceContainer::GetAddress (uint32_t i)
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    87
+ Ipv4Address Ipv4InterfaceContainer::GetAddress (uint32_t i, uint32_t j)
4374
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    88
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    89
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    90
New public API or classes (src/node)
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    91
--------
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    92
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    93
class Ipv4InterfaceAddress:  This is a new class to parallel Linux 
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    94
struct in_ifaddr.  It holds IP addressing information, including mask, 
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    95
broadcast address, scope, whether primary or secondary, etc.
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    96
4376
ac217f25fe70 Update README
Tom Henderson <tomh@tomh.org>
parents: 4374
diff changeset
    97
Location:  src/node/ipv4-interface-address.h
4374
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    98
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
    99
========================================================================
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   100
4378
3ad10f8db106 update api documentation
Tom Henderson <tomh@tomh.org>
parents: 4376
diff changeset
   101
3.  Changeset: 2a05a47dba22
4374
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   102
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   103
Synopsis:
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   104
--------
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   105
- Remove class Ipv4Impl from src/internet-stack
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   106
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   107
Changed public API:
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   108
--------
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   109
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   110
None
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   111
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   112
Changed private API
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   113
---------
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   114
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   115
Remove class Ipv4Impl; class Ipv4L3Protocol now inherits from class Ipv4
2aae35f2287f update documentation
Tom Henderson <tomh@tomh.org>
parents: 4371
diff changeset
   116
allow multiple IPv4 addresses to be assigned to an interface (bug 188)