Packet Format Registration Specifics

The dlpi driver supports generic Common Data Link Interface (CDLI) network interfaces by allowing the user to specify the particular packet format necessary for the transmission media over which the stream is created.

Using the M_IOCTL or M_CTL streams message, the user can specify the packet format. If no packet format is specified, the default is NS_PROTO.

The DLPI user specifies the packet format through the STREAMS I_STR ioctl. The DLPI user is allowed one packet format specification per stream. This packet format must be specified after the attach and before the bind. Otherwise, an error is generated.

The packet formats defined in /usr/include/sys/cdli.h follow:

Item Description
NS_PROTO Remove all link-level headers. Sub-Network Access Protocol (SNAP) is not used.
NS_PROTO_SNAP Remove all link-level headers including SNAP.
NS_INCLUDE_LLC Leave LLC headers in place.
NS_INCLUDE_MAC Do not remove any headers.

The packet formats defined in the /usr/include/sys/dlpi_aix.h file are:

Item Description
NS_PROTO_DL_COMPAT Use the AIX® 3.2.5 DLPI address format.
NS_PROTO_DL_DONTCARE No addresses present in DL_UNITDATA_IND. For the DL_UNITDATA_IND primitive, DLPI provides the header information in the dl_unitdata_ind_t structure.
All packet formats except NS_INCLUDE_MAC accept downstream addresses in the following form:

mac_addr.dsap[.snap].  

Individually, packet formats have the following requirements:

Item Description
NS_PROTO or NS_PROTO_SNAP Medium access control (MAC) and logical link control (LLC) are included in the DLPI header, and the data portion of the message contains only data. The NS_PROTO header does not include SNAP; the NS_PROTO_SNAP header does. Both packet formats present destination addresses as mac_addr and source addresses as mac_addr.ssap.dsap.ctrl[.snap].

For the DL_UNITDATA_REQ primitive, the DLPI user must provide the destination address and an optional destination service access point (DSAP) in the DLPI header. If the DLPI user does not specify the DSAP, the DSAP specified at bind time is used.

NS_PROTO_DONTCARE The dlpi driver places no addresses in the upstream DL_UNITDATA_IND. Addresses are still required on the DL_UNITDATA_REQ.
NS_PROTO_DL_COMPAT The dlpi driver uses the address format used in the AIX® 3.2.5 dlpi driver, which is identical both upstream and downstream. The source and destination addresses are presented as mac_addr.dsap[.snap].
NS_INCLUDE_LLC The DLPI header contains only the destination and source addresses. Only the LLC is placed in the M_DATA portion of the DL_UNITDATA_IND message. Both the source and destination addresses are presented as mac_addr.

For the DL_UNITDATA_REQ primitive, the DLPI user must provide the destination address and an optional DSAP in the DLPI header. If the DLPI user does not specify the DSAP, the DSAP specified at bind time is used.

NS_INCLUDE_MAC The MAC and LLC are both placed in the data portion of the message. Thus, the DLPI user must have knowledge of the MAC header and LLC architecture for a specific interface to retrieve the MAC header and LLC from the data portion of the message. This format sets the stream to raw mode, which does not process incoming or outgoing messages.

For the DL_UNITDATA_REQ primitive, the DLPI user must provide the destination address and an optional DSAP in the DLPI header. If the DLPI user does not specify the DSAP, the DSAP specified at bind time is used.

Downstream messages do not require the DL_UNITDATA_REQ header and must be received as M_DATA messages. Downstream messages must contain a completed MAC header, which will be copied to the medium without further translation.