I'm sponsoring this open fast-track for Sagun Shakya. The timer expires
on 05/25/2007.
Files in the materials directory:
- spec.txt (specification, also included below)
- libdlpi-arch.txt (libdlpi architecture document modified to include
these two new functions)
- libdlpi-api_mapping.txt (man pages for the two new functions)
- libdlpi-api_updated.txt (all libdlpi man pages including those for
these two new functions)
DLPI MAC-Type Mapping Functions
-------------------------------
libdlpi will provide functions that will map a DLPI MAC-Type value to
either a BSD sockets interface type value or an ARP hardware type value
(which are defined in <net/if_types.h> and <netinet/arp.h>
respectively). The functions to be provided are dlpi_iftype() and
dlpi_arptype() and the interface classification for these functions will
be Committed.
Although, these types represent the same media type, they are defined in
separate public namespaces with a different numbering scheme. The types
defined in <net/if_types.h> represent the link types for BSD sockets
interface types. Similarly, the types in <netinet/arp.h> represent the
hardware types in the ARP protocol. The DHCPv6 client has multiple
places where the mapping of DLPI MAC-Type to ARP hardware type is needed
and therefore it has its own mapping function (dlpi_to_arp()) placed in
libdhcputil. Currently, there are no consumers of the dlpi_iftype()
interface. One potential use of this function could be with the socket
interfaces. The mapped link types can be used when dealing with AF_LINK
sockets in the BSD sockets API (for example, when setting the sdl_type
field in struct sockaddr_dl). Thus, rather than applications writing
their own mapping functions, libdlpi will provide such interfaces. If in
the future a new media type is introduced, having one common routine
will also allow us to add the new type easily.
Note that it can be reasonably argued that a reverse function that maps
ARP types and BSD sockets interface types to DLPI MAC-Types should also
be provided. In that case, libdlpi can provide such functions as well.
The libdlpi architectural document and the manpages in the case
materials directory have been updated to include these mapping routines
and are marked with '|' to show the changes. See section 1.7.d in the
architectural document.