CDI Technical Specification

Description: OpenSS7 Project Library Transport CDI

Communications Device Interface

Communications Device Interface

1 Introduction

This document specifies a STREAMS kernel-level instantiation of the ISO Data Link Service Definition DIS
88861 and Logical Link Control DIS 8802/2 (LLC)2. Where the two standards do not conform,
DIS 8886 prevails.

The Communications Device Interface (CDI) enables a communications device service user to access and use any of a
variety of conforming communications device service providers without special knowledge of the provider's protocol.
Specifically, the interface is intended to support X.25 LAPB, BX.25 level 2, SDLC, ISDN LAPD, Ethernet(TM), CSMA/CD,
FDDI, token ring, token bus, and Bisync. Among the expected communications device service users are implementations of
the OSI network data link layer.

The interface specifies access to communications device service providers, and does not define a specific protocol
implementation. Thus, issues of network management, protocol performance, and performance analysis tools are beyond the
scope of this document and should be addressed by specific implementations of a communications device provider.
However, accompanying each provider implementation should be information that describes the protocol-specific behaviour
of that provider. Currently, there are plans to come up with a set of implementor's agreements/guidelines for common
communications device providers. These agreements will address issues such as CDSAP address space, subsequent address,
PPA access and control, QOS, supported services, etc.

1.1 Document Organization

This specification is organized as follows:

Model of the Communications Device Layer,
presents background on the structure of the communications device layer of the OSI Reference Model, and explains the
intended architecture in the STREAMS environment. Communications Device addressing concepts are also presented.

2 Model of the Communications Device Layer

The communications device layer (layer 1 in the OSI Reference Model) is responsible for the transmission and error-free
delivery of bits of information over a physical communications medium.

The model of the communications device layer is presented here to describe concepts that are used throughout the
specification of CDI. It is described in terms of an interface architecture, as well as addressing concepts needed to
identify different components of that architecture. The description of the model assumes familiarity with the OSI
Reference Model.

2.1 Model of the Service Interface

Each layer of the OSI Reference Model has two standards:

one that defines the services provided by the layer, and

one that defines the protocol through which layer services are provided.

CDI is an implementation of the first type of standard. It specifies an interface to the services of the communications
device layer. Figure 1 depicts the abstract view of CDI.

Figure 1. Abstact View of CDI

The communications device interface is the boundary between the data link and physical layers of the OSI Reference
Model. The data link layer entity is the user of the services of the communications device interface (CDS user), and
the communications device entity is the provider of those services (CDS provider). This interface consists of a set of
primitives that provide access to the communications device layer services, plush the rules for using those primitives
(state transition rules). A communications device interface service primitive might request a particular service or
indicate a pending event.

To provide uniformity among the various UNIX system networking products, an effort is underway to develop service
interfaces that map to the OSI Reference Model. A set of kernel-level interfaces, based on the STREAMS development
environment, constitute a major portion of this effort. The service primitives that make up these interfaces are
defined as STREAMS messages that are transferred between the user and provider of the service. CDI is one such
kernel-level interface, and is targeted for STREAMS protocol modules that either use or provide communications device
services. Also, user programs that wish to access a STREAMS-based communications device provider directly may do so
using the putmsg(2) and getmsg(2) system calls.

Referring to the abstract view of CDI (Figure 1), the CDS provider is configured as a STREAMS driver, and the CDS user
accesses the provider using open(2) to establish a stream to the CDS provider. The stream acts as a
communication endpoint between a CDS user and the CDS provider. After the stream is created, the CDS user and CDS
provider communicate via tht messages presented later in this specification.

CDI is intended to free communications device users from specific knowledge of the characteristics of the communications
device provider. Specifically, the definition of CDI hopes to achieve the goal of allowing a CDS user to be implemented
independent of a specific communications medium. Any communications device provider (supporting any communications
medium) that conforms to the CDI specification may be substituted beneath the CDS user to provide communications device
services. Support of a new CDS provider should not require any changes to the implementation of the CDS user.

2.2 Modes of Communication

The communications device interface supports full-duplex and half-duplex communications on a medium.

For half-duplex communications, either the input section or the output section can be active at any point in time, but
not both. For full-duplex communications, both the input section and the output section are both active or both
inactive at any point in time. A particular CDS provider for a half-duplex device can give the appearance of a
full-duplex device for the purposes of the communications device interface presented by the CDS provider. The
communications device interface provides a specialized set of services for half-duplex communications.

Unacknowleged output is message-oriented and supports data transfer in self-contained units with no logical relationship
required between units. Because there is no acknowledgement of each data unit transmission, this output style can be
unreliable in the most general case. However, a specific CDS provider can provide assurance that messages will not be
lost, duplicated or reordered.

Acknowledged output is message-oriented and supports data transfer in self-contained units with no logical relationship
required between units. Because there is acknowledgement of each data unit transmission, this output style can be
reliable in the most general case. Specific CDS providers can provide assurance that messages will not be lost,
duplicated or reordered.

Paced output is message-oriented and supports data transfer in self-contained units with no logical relationship
required between units. Because there is no peer acknowledgement of each data unit transmission, this output style can
be unreliable in the most general case. However, a specific CDS provider can provide assurance that messages will not
be lost, duplicated or reordered. Acknowledgements are used to pacing output, and are typically issued once the data
unit has been transmittted on the medium.

The communications device interface supports three modes of communication: connection, connectionless and
acknowledged connectionless. The connection mode
is circuit-oriented and enables data to be transferred over a pre-established connection in a sequenced manner. Data
may be lost or corrupted in this service mode, however, due to provider-initiated resynchronization or connection
aborts.

The connectionless mode is message-oriented and supports data transfer in self-contained units with no logical
relationship required between units. Because there is no acknowledgement of each data unit transmission, this service
mode can be unreliable in the most general case. However, a specific CDS provider can provide assurance that messages
will not be lost, duplicated, or reordered.

The acknowledged connectionless mode provides the means by which a communications device user can send data and request
the return of data at the same time. Although the exchange service is connectionless, in-sequence delivery is
guaranteed for data sent by the initiating station. The data unit transfer is point-to-point.

2.2.1 Connection-mode Service

The connection-mode service is characterized by four phases of communication:
local management, connection establishment, data transfer, and connection release.

2.2.1.1 Local Management

This phase enables a CDS user to initialize a stream for use in communication and establish an identity with the CDS
provider.

2.2.1.2 Connection Establishment

This phase enables two CDS users to establish a communications device connection between them to exchange data. One
user (the calling CDS user) initiates the connection
establishment procedures, while another user (the called CDS user) waits for incoming connect requests. The called CDS
user is identified by an address associated with its stream (as will be discussed shortly).

A called CDS user may either accept or deny a request for communications device connection. If the request is accepted,
a connection is established between the CDS users and they enter into the data transfer phase. For both the calling and
called CDS users, only one connection may be established per stream. Thus, the
stream is the communication endpoint for a communications device connection. The called CDS user may choose to accept a
connection on the stream where it received the connect request, or it may open a new stream to the CDS provider and
accept the connection on this new, responding stream. By accepting the connection on a separate stream, the initial
stream can be designated as a listening stream through which all connect requests will be processed. As each request
arrives,
a new stream (communication endpoint) can be opened to handle the connection, enabling subsequent requests to be queued
on a single stream until they can be processed.

2.2.1.3 Data Transfer

In this phase, the CDS users are considered peers and may exchange data simultaneously in both directions over an
established communications device connection. Either CDS user may send data to its peer CDS user at any time. Data set
by a CDS user is guaranteed to be delivered to the remote user in the order in which it was sent.

2.2.1.4 Connection Release

This phase enables either the CDS user, or the CDS provider, to break an established connection. The release procedure
is considered abortive, so any data that has not reached the destination user when the connection is released may be
discarded by the CDS provider.

2.2.2 Connectionless-mode Service

The connectionless mode service does not use the connection establishment and
release phases of the connection-mode service. The local management phase is still required to initialize a stream.
Once initialized, however, the connectionless data transfer phase is immediately entered. Because there is no
established connection, however, the connectionless data transfer phase requires the CDS user to identify the
destination of each data unit to be transferred. The destination CDS user is identified by the address associated with
that user (as will be discussed shortly).

Connectionless data transfer does not guarantee that data units will be delivered to the destination user in the order
in which they were sent. Furthermore, it does not guarantee that a given data unit will reach the destination CDS user,
although a given CDS provider may provide assurance that data will not be lost.

2.2.3 Acknowledged Connectionless-mode Service

The acknowledged connectionless mode service also does not use the connection
establishment and release phases of the connection-mode service. The local management phase is still required to
initialize a stream. Once initialized, the acknowledged connectionless data transfer phase is immediately entered.

Acknowledged connectionless data transfer guarantees that data units will be delivered to the destination user in the
order in which they were sent. A data link user entity can send a data unit to the destination CDS user, request a
previously prepared data unit from the destination CDS user, or exchange data units.

2.3 CDI Addressing

Each user of CDI must establish an identity to communicate with other communications device users. The CDS user must
identify the physical medium over which it will communicate. This is particularly evident on systems that are attached
to multiple physical media. Figure 2 illustrates the identification approach, which is explained below.

Figure 2. Communications Device Addressing Components

2.3.1 Physical Attachment Identification

The physical point of attachment (PPA in Figure 2) is the point at which a system attaches itself to a physical
communications medium (a channel, facility or network interface). All communication on that physical medium funnels
through the PPA associated with that physical medium. On systems where a CDS provider supports more than one physical
medium, the CDS user must identify which medium it will communicate through. A PPA is identified by a unique PPA
identifier.

Unlike the Data Link Provider Interface (DLPI), which also uses the concept of a PPA, CDI does not define a SAP for a
CDS user. Once a stream has been associated with a PPA, all messages received on that medium are delivered to the
attached CDS user. Only one major/minor device number combination (Stream head) can be associated with a given PPA at
any point in time. Attempting to attach a second stream to the same PPA to which another stream is attached will fail.

2.3.2 CDS Provider Styles

Two styles of CDS provider are defined by CDI, distinguished by the way they enable a CDS user to choose a particular
PPA.

2.3.2.1 Style 1 CDS Provider

The Style 1 provider assigns a PPA based on the major/minor device the CDS user opened. One possible
implementation of a Style 1 driver would reserve a major device for each PPA the communications device driver
would support. This would allow the STREAMS clone open feature to be used for each PPA configured. This style of
provider is appropriate when few PPAs will be supported.

For example, a PCI card that supports two V.35 ports could assign a major device number to the card driver and a minor
device number to each of the ports on each card in the system. To establish a stream to a CDS provider for a given
port, the minor device number 1 or 2 could be opened for port 1 or 2 on card 1, minor device number 3 or 4 could be
opened for port 1 or 2 on card 2, and so on. One major device number for the driver could easily support 127 cards in a
system, which is not possible for typical PCI systems and, therefore, is ample.

Style 1 providers do not use the CD_ATTACH_REQ
or CD_DETACH_REQ
primitives and when freshly opened are in
the CD_DISABLED
state. That is, as illustrated in Figure 2, the Style 1 CDS provider associates the stream with the PPA during
the open(2) call.

2.3.2.2 Style 2 CDS Provider

If the number of PPAs a CDS provider will support is large, a Style 2 provider implementation is more suitable.
The Style 2 provider requires a CDS user to explicitly identify the desired PPA using a special attach service
primitive. For a Style 2 driver, the open(2) creates a stream between the CDS user and CDS provider, and
the attach primitive then associates a particular PPA with that stream. The format of the PPA identifier is specific to
the CDS provider, and should be described in the provider-specific addendum documentation.

The CDS user uses the support primitives
(CD_ATTACH_REQ,
CD_ENABLE_REQ)
to associate a stream with a given Physical Point of Appearance. Style 2 CDS providers, when freshly opened, are
in the CD_UNATTACHED
state. That is, the Style 2 CDS provider does not associated the stream with the PPA during the open(2)
call, but only later when the CD_ATTACH_REQ
primitive is issued by the CDS user.

3 CDI Services

The various features of the CDI interface are defined in terms of the services provided by the CDS provider, and the
individual primitives that may flow between the CDS user and CDS provider.

The communications device interface supports two modes of communication (full-duplex and half-duplex) and three output
styles (unacknowledged, acknowledged and paced).

The full-duplex mode permits both the input and output sections of the communications device to be active at the same
time; whereas,
the half-duplex mode only permits either the input or output section of the communications device to be active.

The unacknowledged output style provides no acknowledgement for transmitted data units to the CDS user. This is the
typical arrangement for CDS users that are expecting a best-effort delivery of transmitted data units, or that are not
concerned about recovery of loss of data units, either because the CDS provider provides a reliable delivery of data
units, or because the CDS user expects to provide its own mechanisms should reliable data delivery be required. For
example, LLC Type 1 provides just such an unacknowledged delivery of transmitted data units.

The acknowledged output style provides separate acknowledgement of each transmitted data unit. This is the typical
arrangement for CDS users that are expecting a reliable delivery of transmitted data units and require acknowledgement
of their delivery. For example, LLC Type 2 provides just such an acknowledgement of transmitted data units.

The paced output style provides acknowledgements of transmitted data units, but only as timing hints to the CDS user.
This is the typical arrangement where a CDS provider can provide an acknowledgement when the data is actually
transmitted on the physical medium and such acknowledgement can be used a timing hints to the CDS user. For example,
this is possible with LLC Type 1, where the CDS provider driver implementation has knowledge of when the transmitted
data units are emmitted to the medium.

The services are tabulated below and described more fully in the remainder of this section.

Table 1a. Cross-Reference of CDS Services and Primitives

Table 1b. Cross-Reference of CDS Services and Primitives

Table 1c. Cross-Reference of CDS Services and Primitives

3.1 Local Management Services

The local management services apply to both full- and half-duplex operation as well as unacknowledged, acknowledged and
paced output styles. These services, that fall outside the scope of standards specifications, define the method for
intitializing a stream that is connected to a CDS provider. CDS provider information reporting services are also
supported by the local management facilities.

3.1.1 Information Reporting Service

This service provides information about the CDI stream to the CDS user.

CD_INFO_REQ:
The message CD_INFO_REQ
requests the CDS provider to return operating information about the stream.

CD_INFO_ACK:
The CDS provider returns the information in a CD_INFO_ACK
message.

CD_ERROR_ACK:
The CDS provider acknowledges failure for the information request using a CD_ERROR_ACK
message.
See Error Reporting Service.

In Figure 3, the CDS user requests information with a CD_INFO_REQ message and the local CDS provider responds with
the requested information in a CD_INFO_ACK message.

3.1.2 Attach Service

The attach service assigns a physical point of attachment (PPA) to a stream. This service is required for Style 2
CDS providers (see Physical Attachment Identification) to specify the physical medium over which communication will
occur.

CD_ATTACH_REQ:
The CDS user requests the attach service with a CD_ATTACH_REQ
message.

CD_OK_ACK:
The CDS provider indicates success with a CD_OK_ACK
message.

In Figure 4, the CDS user issues a CD_ATTACH_REQ message for a Style 2 CDS provider which results in the
association of the stream with the requested PPA and possible enabling of the medium associated with the PPA. The CDS
provider acknowledges the attach with a CD_OK_ACK message.

3.1.3 Detach Service

The detach service disassociates a physical point of attachment (PPA) with a stream. This service is required for
Style 2 CDS providers (see Physical Attachment Identification) to disassociate the physical medium from the
stream over which communication has occurred.

CD_DETACH_REQ:
The CDS user request the detach service with a CD_DETACH_REQ
message.

CD_OK_ACK:
The CDS provider indicates success with a CD_OK_ACK
message.

In Figure 5, the CDS user issues a CD_DETACH_REQ message for a Style 2 CDS provider which results in the
disassociation of the stream with the attached PPA and possible disabling of the medium associated with the PPA.
The CDS provider acknowledges the detach with a CD_OK_ACK message.

3.1.4 Multiplex Name Service

3.2 Device Management Services

The device management services allow a CDS user to enable or disable a communications device.

3.2.1 Enable Service

The enable service allows a CDS user to enable a communications device. Enabling a communications device may consist of
dialling a modem to establish a switched connection, or may consist of simply enabling the communications device
attached to a permanent medium.

CD_ENABLE_REQ:
The message CD_ENABLE_REQ
is used to request that a communications device be enabled and to optionally provide a dial string for a modem.

CD_ENABLE_CON:
The CDS provider confirms that the communications device was successfully enabled using a CD_ENABLE_CON
message.

CD_ERROR_ACK:
The CDS provider indicates a failure to enable the communications device using a CD_ERROR_ACK
message.
See Error Reporting Service.

In Figure 36, the CDS user issues a CD_ENABLE_REQ message requesting that the communications device and medium be
enabled or connected. Enabling can be soley a local matter, affecting only the local communications device, or can be
an end-to-end matter, where the underlying protocol exchanges PDUs necessary to dial, connect or enable the medium.

3.2.2 Disable Service

The disable service allows a CDS user to disable a communications device. Disabling a communications device may consist
of disconnecting a modem on a previously established switched connection, or may consist of simply disabling the
communications device attached to a permanent medium.

CD_DISABLE_REQ:
The CD_DISABLE_REQ
message is used to request that a communications device be disabled and to optionally provide for the disposition of
unsent data units.

CD_DISABLE_CON:
The CDS provider confirms that the communications device was successfully disable, and that unsent
data units were properly disposed of, using a CD_DISABLE_CON
message.

CD_ERROR_IND:
The CDS provider indicats a failure of the communications device resulting in it being disabled locally using a
CD_ERROR_IND
message. (The CD_ERROR_IND message normally has an error number indicating that the communications device was
disconnected, i.e. CD_DISC.)

CD_ERROR_ACK:
The CDS provider indicates a failure to disable the communications device using a CD_ERROR_ACK
message.
See Error Reporting Service.

In Figure 37, the CDS user issues a CD_DISABLE_REQ message requesting that the communications device and medium be
disabled or disconnected. Disabling can be soley a local matter, affecting only the local communications device, or can
be an end-to-end matter, where the underlying protocol exchanges PDUs necessary to disconnect or disable the medium.

3.3 Data Transfer Services

Data transfer services provide for the transfer of data between CDS users on a communications device. There are three
output styles for data transfer: unacknowledged, acknowledged and paced. In all modes, data is transferred in
self-contained units and there is not necessarily any relationship between independent units of data. Data can be
trasnferred both in a connectionless sense, in that addresses are associated with the data transfer, or in a
connection-mode sense, in that no addresses are associated with the data transfer. In all output styles, the receiving
CDS user is selected, not with addresses, but by selecting the communications device stream upon which the data is
transmitted. The receiving CDS user is implied: it is the CDS user that is at the other end of the communications
device medium as selected by the PPA. Addresses and priorities associated with the user data are for use by the
receiving CDS user in de-multiplexing the data within the CDS user. The CDS provider does not de-multiplex data and any
data received on the communications devices associated with a physical point of appearance are delivered to the CDS user
that is attached and enabled for that communications device.

3.3.1 Unacknowledged Data Transfer Service

Unacknowledged data transfer service provides for the transfer of data between CDS users without acknowledgement. In
the general case, this is an unreliable data transfer. However, the CDS provide may provide assurances with regard to
the loss, duplication and reordering of data.

CD_UNITDATA_REQ:
The sending CDS user transfers data to the receiving CDS user with the CD_UNITDATA_REQ
message.

CD_UNITDATA_IND:
Upon receiving user data, the CDS provider indicates the received data to the local CDS user with the
CD_UNITDATA_IND
message.

CD_ERROR_IND:
If the local CDS provider is unable to transmit CDS user data requested in a CD_UNITDATA_REQ message, it responds to
the local sending CDS user with a CD_ERROR_IND
message.

CD_BAD_FRAME_IND:
If the local CDS provider is unable to receive CDS user data correctly, it is indicated to the local receiving CDS user
with the CD_BAD_FRAME_IND
message.

The normal sequence of primitives for a successful unacknowledged transmission and reception is illustrated in
Figure 42.

Figure 42. Message Flow: Successful Unacknowleged Data Transfer

The normal sequence of primitives for an unsuccessful unacknowledged transmission is illustrated in Figure 43.

Figure 43. Message Flow: Unsuccessful Unacknowleged Data Transmission

The normal sequence of primitives for an unsuccessful unacknowledged reception is illustrated in Figure 44.

Figure 44. Message Flow: Unsuccessful Unacknowleged Data Reception

In Figure 42, the CD_UNITDATA_REQ message at the sending CDS user results in data transfer to the receiving CDS
user. The CDS provider at the receiving side indicates the data in a CD_UNITDATA_IND message. No acknowledgments
or receipt confirmation is indicated at the sending CDS provider, regardless of whether the underlying protocol supports
receipt confirmation.

In Figure 43, the CD_UNITDATA_REQ message at the sending CDS user cannot have its data transmitted by the
CDS provider due to a transmission error (e.g. the communications medium has disconnected). The CDS provider indicates
the transmission error the CDS user with a CD_ERROR_IND message.
This is the same in the unacknowledged, acknowledged and paced cases.

In Figure 44, the CD_UNITDATA_REQ message at the sending CDS user results in data transfer to the receiving CDS
user. The CDS provider at the receiving side detects an error in the transmission (e.g. a CRC error) and indicates an
errored frame to the receiving CDS user with a CD_BAD_FRAME_IND message. No error is indicated to the sending CDS
user, regardless of whether the underlying protocol supports negative acknowledgements of received data.

3.3.2 Acknowledged Data Transfer Service

Acknowledged data transfer service provides for the acknowledged transfer of data between CDS users. In the general
case, this is an unreliable data transfer with indication of loss. However, the CDS provider may provide assurances
with regard to the loss, duplication and reordering of data.

The acknowledged data transfer service requires support from the underlying protocol and CDS provider implementation.

CD_UNITDATA_REQ:
The sending CDS user transfers data to the receiving CDS user with the CD_UNITDATA_REQ
message.

CD_UNITDATA_IND:
Upon receiving user data, the CDS provider indicates the received data to the local CDS user with the
CD_UNITDATA_IND
message.

CD_UNITDATA_ACK:
Upon successful receipt acknowledgement, the CDS provider indicates receipt acknowledgement to the local sending CDS
user with the CD_UNITDATA_ACK
message.

CD_ERROR_IND:
If the local CDS provider is unable to transmit CDS user data requested in a CD_UNITDATA_REQ message, or a negative
acknowledgement is received by the peer CDS provider, it responds to the local sending CDS user with a CD_ERROR_IND
message.

CD_BAD_FRAME_IND:
If the local CDS provider is unable to receive CDS user data correctly, it is indicated to the local receiving CDS user
with the CD_BAD_FRAME_IND
message.

The normal sequence of primitives for a successful acknowledged transmission and reception is illustrated in Figure 45.

Figure 45. Message Flow: Successful Acknowleged Data Transfer

The normal sequence of primitives for an unsuccessful acknowledged transmission is illustrated in Figure 46.

Figure 46. Message Flow: Unsuccessful Acknowleged Data Transmission

The normal sequence of primitives for an unsuccessful acknowledged reception is illustrated in Figure 47.

Figure 47. Message Flow: Unsuccessful Acknowleged Data Reception

In Figure 45, the CD_UNITDATA_REQ message at the sending CDS user results in data transfer to the receiving CDS
user. The CDS provider at the receiving side indicates the data in a CD_UNITDATA_IND message and provides a
positive acknowledgement or receipt confirmation to the sending CDS provider. The sending CDS provider, upon receipt of
the positive acknolwedgement or receipt confirmation indicates acknowledgement to the local sending CDS user with the
CD_UNITDATA_ACK message.

In Figure 46, the CD_UNITDATA_REQ message at the sending CDS user cannot have its data transmitted by the CDS
provider due to a transmission error (e.g. the communications medium has disconnected). The CDS provider indicates the
transmission error the CDS user with a CD_ERROR_IND message.
This is the same in the unacknowledged, acknowledged and paced cases.

In Figure 47, the CD_UNITDATA_REQ message at the sending CDS user results in data transfer to the receiving CDS
user. The CDS provider at the receiving side detects an error in the transmission (e.g. a CRC error) and indicates an
errored frame to the receiving CDS user with a CD_BAD_FRAME_IND message. A negative acknowledgement is
sent to the sending CDS provider using the underlying protocol. The sending CDS provider, upon receipt of the negative
acknowledgement, indicates the reception error to the sending CDS user with a CD_ERROR_IND message.

3.3.3 Paced Data Transfer Service

Paced data transfer service provides for the paced transfer of data between CDS users. In the general case, this is an
unreliable data transfer. Acknowledgements of data transfer only indicate timing hints to the sending CDS user and do
not constitute receipt confirmation. However, the CDS provider may provide assurances with regard to loss, duplication
and reordering of data.

The paced data transfer service requires support from the sending CDS provider.

CD_UNITDATA_REQ:
The sending CDS user transfers data to the receiving CDS user with the CD_UNITDATA_REQ
message.

CD_UNITDATA_ACK:
Upon successful transmission of the user data, the CDS provider acknowledges the data transmission to the local
sending CDS user with the CD_UNITDATA_ACK
message.

CD_UNITDATA_IND:
Upon receiving user data, the CDS provider indicates the received data to the local CDS user with the
CD_UNITDATA_IND
message.

CD_ERROR_IND:
If the local CDS provider is unable to transmit CDS user data requested in a CD_UNITDATA_REQ message, it responds to
the local sending CDS user with a CD_ERROR_IND
message.

CD_BAD_FRAME_IND:
If the local CDS provider is unable to receive CDS user data correctly, it is indicated to the local receiving CDS user
with the CD_BAD_FRAME_IND
message.

The normal sequence of primitives for a successful paced transmission and reception is illustrated in Figure 48.

Figure 48. Message Flow: Successful Paced Data Transfer

The normal sequence of primitives for an unsuccessful paced transmission is illustrated in Figure 49.

Figure 49. Message Flow: Unsuccessful Paced Data Transmission

The normal sequence of primitives for an unsuccessful paced reception is illustrated in Figure 50.

Figure 50. Message Flow: Unsuccessful Paced Data Reception

In Figure 48, the CD_UNITDATA_REQ message at the sending CDS user results in data transfer to the receiving CDS
user. The CDS provider at the sending side, once the data has been transmitted, or using some other timing que, issues
an acknowledgement of the transmission to the local CDS user with the CD_UNITDATA_ACK message. The CDS provider at
the receiving side indicates the data in a CD_UNITDATA_IND message. No receipt confirmation is indicated at the
sending CDS provider, regardless of whether the underlying protocol supports receipt confirmation.

In Figure 49, the CD_UNITDATA_REQ message at the sending CDS user cannot have its data transmitted by the CDS
provider due to a transmission error (e.g. the communications medium has disconnected). The CDS provider indicates the
transmission error the CDS user with a CD_ERROR_IND message.
This is the same in the unacknowledged, acknowledged and paced cases.

In Figure 50, the CD_UNITDATA_REQ message at the sending CDS user results in data transfer to the receiving CDS
user. The CDS provider at the sending side, once the data has been transmitted, or using some other timing que, issues
an acknowledgement of the transmission to the local CDS user with the CD_UNITDATA_ACK message. The CDS provider at
the receiving side detects an error in the transmission (e.g. a CRC error) and indicates an errored frame to the
receiving CDS user with a CD_BAD_FRAME_IND message. No negative acknowledgement is indicated to the sending CDS
user, regardless of whether the underlying protocol supports negative acknowledgements.

3.4 Duplex Management Services

Duplex management services allow fine-grained control of the half-duplex mechanism. These services logically
distinguish between the input section of the communications device and the output section of the communications device.
The input section can be enabled (disabling the output section on half-duplex devices) and disabled (enabling the output
section). The output section can have output aborted. And output-input operations are also possible where data units
are transmitted and then a response is awaited.

These duplex management services are only necessary or CDS providers that expose the activation and deactivation of the
input and output sections to the CDS user. CDS providers that control half-duplex communications devices, but which do
not expose the half-duplex nature to the CDS user, can use the normal data transfer services used for full-duplex
devices. The CDS user can determine the style of the CDS provider using the information reporting service
(see Information Reporting Service).

3.4.1 Input Section Service

Input section services control the activation of the input section (and resulting deactivation of the output section).
The read service provides the ability to activate the input section and await data or the expiry of a time interval for
which to wait. The input allow and halt services provide the ability to permanently active or deactivate the input
section.

3.4.1.1 Read Service

The read service is for half-duplex operation and temporarily enables the input section until data has been received, or
until an time interval has passed, whichever comes first.

CD_READ_REQ:
The CDS user requests the read service using the CD_READ_REQ
message. This message also specifies the period of time to await input data before failing with a CD_READTIMEOUT
error.

CD_OK_ACK:
The CDS provider acknowledges successful receipt of the CD_READ_REQ message using the CD_OK_ACK
message.

CD_ERROR_ACK:
The CDS provider acknowledges failure for the read request using a CD_ERROR_ACK
message.
See Error Reporting Service.

CD_UNITDATA_IND:
If data is available to be read, the CDS provider confirms the read request using a CD_UNITDATA_IND
message.

CD_ERROR_IND:
The CDS provider indicates the failure of the read request (the interval of time has elapsed before data was available
to be read) using a CD_ERROR_IND
message containing the error CD_READTIMEOUT.

The normal sequence of primitives for a successful read request is illustrated in Figure 40.

Figure 40. Message Flow: Successful Read Request

The normal sequence of primitives for an unsuccessful read request is illustrated in Figure 41.

Figure 41. Message Flow: Unsuccessful Read Request

3.4.1.2 Input Allow Service

The input allow service enables the CDS user to allow the input section (disabling the output section) until further
notice. The allow input service is typically used with the halt input service (see Input Halt Service).

CD_ALLOW_INPUT_REQ:
The CDS user requests that the input section be allowed using the CD_ALLOW_INPUT_REQ
message.

CD_OK_ACK:
The CDS provide acknowledges successful receipt of the message using the CD_OK_ACK
message.

CD_ERROR_ACK:
The CDS provider acknowledges failure for the allow input request using a CD_ERROR_ACK
message.
See Error Reporting Service.

3.4.1.3 Input Halt Service

The input halt service enables the CDS user to halt the input section (enabling the output section) until further
notice. The halt input service is typically used following the allow input service (see Input Allow Service).

CD_HALT_INPUT_REQ:
The CDS user request that the input section be halted using the CD_HALT_INPUT_REQ
message.

CD_OK_ACK:
The CDS provide acknowledges successful receipt of the message using the CD_OK_ACK
message.

CD_ERROR_ACK:
The CDS provider acknowledges failure for the allow input request using a CD_ERROR_ACK
message.
See Error Reporting Service.

The normal sequence of primitives for a successful halt input request is illustrated in Figure 39.

Figure 39. Message Flow: Halt Input

3.4.2 Output Section Service

The output section can be controlled using the abort service. The output abort service provides the ability for the CDS
user to abort any output currently being transmitted by the communications device.

CD_ABORT_OUTPUT_REQ:
The CDS user request that output be aborted using the CD_ABORT_OUTPUT_REQ
message.

CD_OK_ACK:
The CDS provide acknowledges successful receipt of the message using the CD_OK_ACK
message.

CD_ERROR_ACK:
The CDS provider acknowledges failure for the allow input request using a CD_ERROR_ACK
message.
See Error Reporting Service.

The normal sequence of primitives for a successful abort output request is illustrated in .

3.4.3 Input-Output Service

A smooth transition from transmission to reception of data units can be accomplished using the write-read service. This
service provides the CDS user with the ability to transmit data and then await data reception. The service is like a
unit data request service followed by a read service.

CD_WRITE_READ_REQ:
The CDS user request that a write read request be performed using the CD_WRITE_READ_REQ
message.

CD_OK_ACK:
The CDS provide acknowledges successful receipt of the write read request using the CD_OK_ACK
message.

CD_ERROR_ACK:
The CDS provider acknowledges failure for the write read request using a CD_ERROR_ACK
message.
See Error Reporting Service.

CD_UNITDATA_IND:
If data is available to be read, the CDS provider confirms the write read request using a CD_UNITDATA_IND
message.

CD_ERROR_IND:
The CDS provider indicates the failure of the write read request (the interval of time has elapsed before data was
available to be read) using a CD_ERROR_IND
message containing the error CD_READTIMEOUT.

The normal sequence of primitives for a successful write read service request is illustrated in Figure 51.

Figure 51. Message Flow: Successful Write Read Request

The normal sequence of primitives for an unsuccessful write read service request is illustrated in Figure 52.

3.5 Event Services

3.5.1 Error Reporting Service

3.5.2 Modem Signals Services

3.5.2.1 Assert Modem Signals Service

CD_OK_ACK:
The CDS provide acknowledges successful receipt of the modem signal request using the CD_OK_ACK
message.

CD_ERROR_ACK:
The CDS provider acknowledges failure for the modem signal request using a CD_ERROR_ACK
message.
See Error Reporting Service.

3.5.2.2 Poll Modem Signals Service

CD_MODEM_SIG_POLL_REQ:

CD_MODEM_SIG_IND:

CD_ERROR_ACK:
The CDS provider acknowledges failure for the modem signal poll request using a CD_ERROR_ACK
message.
See Error Reporting Service.

3.6 An Example

To bring it all together, the following example illustrates the primitives that
flow during a complete, connection-mode sequence between stream open and stream
close.

Figure 35. Message Flow: A Connection-mode Example

4 CDI Primitives

4.1 Local Management Service Primitives

This section describes the local management service primitives that are common to all service modes. These primitives
support the Information Reporting, Attach and Acknowledgement services. Once a stream has been opened by a CDS user,
these primitive initialize the stream, preparing it for use.

4.1.1 PPA Initialization/De-initialization

The PPA associated with each stream must be initialized before the CDS provider can transfer data over the medium. The
initialization and de-initialization of the PPA is a network management issue, but CDI must address the issue because of
the impact such actions will have on a CDS user. More specifically, CDI requires the CDS provider to initialize the PPA
associated with a stream at some point before it completes the processing of the CD_ENABLE_REQ.
Guidelines for initialization and de-initialization of a PPA by a CDS provider are presented here.

4.1.1.1 PPA Initialization

A CDS provide may initialize a PPA using the following methods:

pre-initialized by some network management mechanism before the CD_ENABLE_REQ
primitive is received; or

automatic initialization on receipt of a CD_ENABLE_REQ
or CD_ATTACH_REQ
primitive.

A specific CDS provider may support either of these methods, or possibly some combination of the two, but the method
implemented has no impact on the CDS user. From the CDS user's viewpoint, the PPA is guaranteed to be initialized on
receipt of a CD_ENABLE_CON
primitive. For automatic initialization, this implies that the CD_ENABLE_CON
primitive may not be issued until the initialization has completed.

If pre-initialization has not been performed and/or automatic initialization fails, the CDS provider will fail the
CD_ENABLE_REQ.
Two errors,
CD_INITFAILED
and CD_FATALERR
may be returned in the CD_ERROR_ACK
primitive in response to a CD_ENABLE_REQ
primitive if PPA initialization fails.
CD_INITFAILED
is returned when a CDS provider supports automatic PPA initialization, but the initialization attempt failed.
CD_FATALERR
is returned wen the CDS provider requires pre-initialization, but the PPA is not initialized before the
CD_ENABLE_REQ
is received.

4.1.1.2 PPA De-initialization

A CDS provider may handle PPA de-initialization using the following methods:

automatic de-initialization upon receipt of the final CD_DETACH_REQ
(for Style 2 providers) or CD_DISABLE_REQ
(for Style 1 providers), or upon closing of the last stream associated with the PPA;

automatic de-initialization after expiration of a timer following the last CD_DETACH_REQ,
CD_DISABLE_REQ,
or close as appropriate; or

no automatic de-initialization; administrative intervention is required to de-initialize the PPA at some point
after it is no longer being accessed.

A specific CDS provider may support any of these methods, or possibly some combination of them, but the method
implemented has no impact on the CDS user. From the CDS user's viewpoint, the PPA is guaranteed to be initialized and
available for transmission until it closes or disables the stream associated with the PPA.

4.1.2 Message CD_INFO_REQ (cd_info_req_t)

This user originated primitive requests that the provider acknowledge the primitive with a
CD_INFO_ACK
primitive indicating protocol and option information.

Message Format

This primitive consists fo one M_PROTO or M_PCPROTO message block structured as follows:

typedef struct {
cd_ulong cd_primitive;
} cd_info_req_t;

Parameters

This primitive contains the following parameters:

cd_primitive

Specifies the primitive type.

State

This primitive is valid in any state other than CD_UNUSABLE
where a local acknowledgement is not pending.

New State

The stat is unchanged as a result of the primitive.

Response

This primitive requires the provider to acknowledge receipt of the primitive as follows:

Successful:
When successful, the provider acknowledges the primitive with the
CD_INFO_ACK.

Unsuccessful (non-fatal errors):
When unsuccessful, the provider acknowledges the primitive with the
CD_ERROR_ACK
indicating the reason for failure of the primitive.

Reasons for Failure

CD_BADPRIM

Unrecognized primitive.

CD_FATALERR

Device has become unusable.

CD_NOTSUPP

Primitive not supported by device.

CD_OUTSTATE

Primitive was issued from an invalid state.

CD_PROTOSHORT

M_PROTO block too short.

CD_SYSERR

UNIX system error.

4.1.3 Message CD_INFO_ACK (cd_info_ack_t)

This provider originated primitive acknowledges a previously issued
CD_INFO_REQ
primitive, and provides protocol and limits information for the stream upon which the primitive is issued.

If the stream is in state
CD_UNATTACHED,
the information returned by
CD_INFO_ACK
might be different after a successful
CD_ATTACH_REQ
than it was before the attach was completed. This is because the CD provider might not yet have all protocol
information concerning the underlying communications device until after it has been attached to a specific Physical
Point of Attachment.

Message Format

This primitive consists of one M_PROTO or M_PCPROTO message block structured as follows:

Parameters

cd_primitive

Indicates the primitive type.

cd_state

Indicates the state of the CDI provider. The
cd_state
can be one of the following values:

CD_UNATTACHED

No Physical Point of Attachment (PPA) is associated with the stream. Only Style 2 communications devices (streams that
return CD_STYLE2
in the cd_ppa_stylefield) can exist in this state.
CD_STYLE2
communication devices start in this state after open(2).

CD_UNUSABLE

PPA cannot be used.

CD_DISABLED

A Physical Point of Attachment (PPA) is associated with the stream, but the communications device is disabled. Style 1
communications devices (streams that return CD_STYLE1
in the cd_ppa_stylefield) start in this state after open(2).

CD_ENABLE_PENDING

A CD_ENABLE_REQ
has been issued and is pending. The provider is waiting for enabling of the communications device to complete before
confirmation with CD_ENABLE_CON
or error acknowledgement with CD_ERROR_ACK.

CD_ENABLED

The communications device is enabled and is awaiting use. Either the input or output must be active or allowed before
data can be transferred.

CD_READ_ACTIVE

The input section is temporarily enabled and will be disabled after data arrives.

CD_INPUT_ALLOWED

The input section is permanently enabled.

CD_DISABLE_PENDING

A CD_DISABLE_REQ
has been issued and is pending. The provider is waiting for disabling of the communications device to complete before
confirmation with CD_DISABLE_CON
or error acknowledgement with CD_ERROR_ACK.

CD_OUTPUT_ACTIVE

Output section active only.

CD_XRAY

X-raying another PPA.

cd_max_sdu

The maximum size of the Signalling Data Unit (SDU) in octets.

cd_min_sdu

The minimum size of the Signalling Data Unit (SDU) in octets.

cd_class

Indicates the class of the communications device. cd_class can be one of the following values:

CD_HDLC

Bit-synchronous.

CD_BISYNC

Character-synchronous.

CD_LAN

ISO 8802-3,4,5 local-area network MAC.

CD_NODEV

No device, PPA used for X-ray.

cd_duplex

Indicates full or half duplex operation. cd_duplex can be one of the following values:

CD_FULLDUPLEX

Full duplex; allow input supported.

CD_HALFDUPLEX

Half duplex; read write/read supported.

cd_output_style

Indicates the output style. cd_output_style can be one of the following values:

Indicates the features supported by the communications device. cd_features can be a bitwise OR of the following
flags:

CD_CANREAD

Read request supported on full duplex.

CD_CANDIAL

Dial information supported.

CD_AUTOALLOW

CD_INPUT_ALLOWED
as soon as enabled.

CD_KEEPALIVE

Do not send off at CD_DISABLE_REQ.
This is a Gcom extension.

cd_addr_length

The maximum size of an address for use with CD_UNITDATA_REQ,
CD_UNITDATA_IND.

cd_ppa_style

Indicates the Physical Point of Attachment (PPA) style. cd_ppa_style can be one of the following values:

CD_STYLE1

The communications device is already attached to the physical point of appearance at open(2). The device
starts in the CD_DISABLED
state.

CD_STYLE2

The communications device is not attached to the physical point of appearance at open(2), and must be attached
with CD_ATTACH_REQ.
The device starts in the CD_UNATTACHED
state.

State

This primitive is valid in any state where a local acknowledgement (requiring response with a
CD_OK_ACK)
is not pending, and only in response to a CD_INFO_REQ
primitive.

New State

The new state is unchanged.

4.1.4 Message CD_ATTACH_REQ (cd_attach_req_t)

This user originated primitive requests that the requesting stream be attached to the physical device indicated by the
Physical Point of Attachment (PPA).

When a Style 2 CDI stream is first opened, it is opened in the CD_UNATTACHED
state and is not associated with a Physical Point of Appearance (PPA). The CD_ATTACH_REQ
primitive requests that the provider associate the stream with the specified PPA and move the stream to the
CD_DISABLED
state.

Style 1 CDI streams open in the CD_DISABLED
state, and a CD_ATTACH_REQ
primitive issued on a Style 1 stream will fail.

This primitive is only valid for devices that return CD_STYLE2
in the cd_ppa_stylefield in a CD_INFO_ACK.

Addressing

A Physical Point of Appearance corresponds to the hardware interface associated with a specific communications device.
A PPA number is associated with each hardware interface for a specific provider or device. PPA numbers are a
cd_ulong,
but which PPA number corresponds to which Physical Point of Appearance is a provider-specific configuration matter.
Specific providers should document the mapping of PPA numbers to actual Physical Points of Appearance as part of the
provider-specific documentation.

Message Format

This primitive consists of on M_PROTO message block structured as follows:

Parameters

Specifies the Physical Point of Attachment (PPA). The format of this field is provider- and device-specific.

State

This primitive is only valid in state CD_UNATTACHED.

New State

The new state is CD_DISABLED.

Response

This primitive requires the provider to return an acknowledgement indicating the success or failure of the
CD_ATTACH_REQ.

Successful:
When successful, the provider responds with a CD_OK_ACK
primitive acknowledging successful processing of the CD_ATTACH_REQ.
The new state is CD_DISABLED.

Unsuccessful (non-fatal errors):
When unsuccessful, the provider responds with a CD_ERROR_ACK
indicating the non-fatal error. The state is unchanged.

Reasons for Failure

CD_BADPPA

Invalid PPA identifier.

CD_BADPRIM

Unrecognized primitive.

CD_EVENT

Protocol-specific event occurred.

CD_FATALERR

Device has become unusable.

CD_NOTSUPP

Primitive not supported by this device.

CD_OUTSTATE

Primitive was issued from an invalid state.

CD_PROTOSHORT

M_PROTO block too short.

CD_SYSERR

UNIX system error.

4.1.5 Message CD_DETACH_REQ (cd_detach_req_t)

This user originated primitive requests that the requesting stream be detached from the Physical Point of Attachment
(PPA) to which it was previously attached with a successful CD_ATTACH_REQ
primitive.

Message Format

This primitive consists of one M_PROTO or M_PCPROTO message block structured as follows:

typedef struct {
cd_ulong cd_primitive;
} cd_detach_req_t;

Parameters

This primitive contains the following parameters:

cd_primitive

Specifies the primitive type.

State

This primitive is only valid in state CD_DISABLED.

New State

The new state is CD_UNATTACHED.

Response

This primitive requires the provider to acknowledge the receipt of the CD_DETACH_REQ
primitive as follows:

Successful:
When the primitive is successful, the provider acknowledges receipt of the primitive with the CD_OK_ACK
primitive.

Unsuccessful (non-fatal errors):
When unsuccessful, the provider acknowledges receipt of the primitive with the CD_ERROR_ACK
primitive indicating the error.

Reasons for Failure

Non-Fata Errors: applicable non-fatal errors are as follows:

CD_BADPRIM

Unrecognized primitive.

CD_EVENT

Protocol-specific event occurred.

CD_FATALERR

Device has become unusable.

CD_NOTSUPP

Primitive not supported by this device.

CD_OUTSTATE

Primitive was issued from an invalid state.

CD_PROTOSHORT

M_PROTO block too short.

CD_SYSERR

UNIX system error.

4.1.6 Message CD_OK_ACK (cd_ok_ack_t)

This provider originated primitive acknowledges that a primitive requiring local acknowledgement with the CD_OK_ACK
has been received and successfully processed.

Message Format

This primitive consists of one M_PCPROTO message block structured as follows:

Parameters

Indicates the new state of the CD provider following successful processing of the request message that elicited the
CD_OK_ACK.

CD_UNATTACHED

No PPA attached.

CD_UNUSABLE

PPA cannot be used.

CD_DISABLED

PPA attached.

CD_ENABLE_PENDING

Waiting acknowledgement of enable request.

CD_ENABLED

Awaiting use.

CD_READ_ACTIVE

Input section enabled; disabled after data arrives.

CD_INPUT_ALLOWED

Input section permanently enabled.

CD_DISABLE_PENDING

Waiting acknowledgement of disable request.

CD_OUTPUT_ACTIVE

Output section active only.

CD_XRAY

X-raying another PPA.

cd_correct_primitive

Indicates the primitive that was successfully received. cd_correct_primitive can be one of the following values:

CD_ABORT_OUTPUT_REQ

abort output.

CD_ALLOW_INPUT_REQ

allow input.

CD_ATTACH_REQ

attach to a physical point of attachment.

CD_DETACH_REQ

detach from a physical point of attachment.

CD_HALT_INPUT_REQ

halt input.

CD_MODEM_SIG_REQ

assert modem signals.

CD_MUX_NAME_REQ

get multiplexer name.

State

This primitive is valid in any state where a local acknowledgement is pending and the primitive is required by the
request primitive.

New State

The new state is the state described under the corresponding request primitive.

4.1.7 Message CD_ERROR_ACK (cd_error_ack_t)

This provider originated primitive acknowledges that the previously receive primitive requiring an acknowledgement was
received in error. The primitive to which the error acknowledgement applies and the error code are indicated.

Message Format

This primitive consists of one M_PCPROTO message block structured as follows:

Parameters

Indicates the current state of the interface. cd_state can be one of the following values:

CD_UNATTACHED

No PPA attached.

CD_UNUSABLE

PPA cannot be used.

CD_DISABLED

PPA attached.

CD_ENABLE_PENDING

Waiting acknowledgement of enable request.

CD_ENABLED

Awaiting use.

CD_READ_ACTIVE

Input section enabled; disabled after data arrives.

CD_INPUT_ALLOWED

Input section permanently enabled.

CD_DISABLE_PENDING

Waiting acknowledgement of disable request.

CD_OUTPUT_ACTIVE

Output section active only.

CD_XRAY

X-raying another PPA.

cd_error_primitive

Indicates the primitive was received in error. cd_error_primitive can be one of the following values:

CD_ABORT_OUTPUT_REQ

CD_ALLOW_INPUT_REQ

CD_ATTACH_REQ

CD_DETACH_REQ

CD_DISABLE_REQ

CD_ENABLE_REQ

CD_HALT_INPUT_REQ

CD_INFO_REQ

CD_MODEM_SIG_REQ

CD_MUX_NAME_REQ

CD_READ_REQ

CD_UNITDATA_REQ

CD_WRITE_READ_REQ

cd_errno

Indicates the reason for the error. cd_errno can be one of the following values:

CD_BADADDRESS

Address was invalid.

CD_BADADDRTYPE

Invalid address type.

CD_BADDIAL

Dial information was invalid.

CD_BADDIALTYPE

Invalid dial information type.

CD_BADDISPOSAL

Invalid disposal parameter.

CD_BADFRAME

Defective SDU received.

CD_BADPPA

Invalid PPA identifier.

CD_BADPRIM

Unrecognized primitive.

CD_DISC

Disconnected.

CD_EVENT

Protocol-specific event occurred.

CD_FATALERR

Device has become unusable.

CD_INITFAILED

Line initialization failed.

CD_NOTSUPP

Primitive not supported by this device.

CD_OUTSTATE

Primitive was issued from an invalid state.

CD_PROTOSHORT

M_PROTO block too short.

CD_READTIMEOUT

Read request timed out before data arrived.

CD_SYSERR

UNIX system error.

CD_WRITEFAIL

Unit data request failed.

cd_explanation

Indicates a futher explanation of the error. When cd_errno is CD_SYSERR, this field contains the
UNIX system error as described in errno(3). Otherwise, cd_explanation may contain one of the
following values:

CD_CRCERR

CRC or FCS error.

CD_DLE_EOT

DLE EOT detected.

CD_FORMAT

Format error detected.

CD_HDLC_ABORT

Aborted frame detected.

CD_OVERRUN

Input overrun.

CD_TOOSHORT

Frame too short.

CD_INCOMPLETE

Partial frame received.

CD_BUSY

Telephone was busy.

CD_NOANSWER

Connection went unanswered.

CD_CALLREJECT

Connection rejected.

CD_HDLC_IDLE

HDLC line went idle.

CD_HDLC_NOTIDLE

HDLC line no longer idle.

CD_QUIESCENT

Line being reassigned.

CD_RESUMED

Line has been reassigned.

CD_DSRTIMEOUT

Did not see DSR in time.

CD_LAN_COLLISIONS

LAN excessive collisions.

CD_LAN_REFUSED

LAN message refused.

CD_LAN_NOSTATION

LAN no such station.

CD_LOSTCTS

Lost Clear to Send signal.

CD_DEVERR

Start of device-specific codes.

In addition, when the explanation is CD_DEVERR or greater, the explanation may be a device-specific explanation
code.

State

This primitive is valid in any state where a local acknowledgement is pending in response to one of the following
primitives:
CD_ABORT_OUTPUT_REQ,
CD_ALLOW_INPUT_REQ,
CD_ATTACH_REQ,
CD_DETACH_REQ,
CD_DISABLE_REQ,
CD_ENABLE_REQ,
CD_HALT_INPUT_REQ,
CD_INFO_REQ,
CD_MODEM_SIG_REQ,
CD_MUX_NAME_REQ,
CD_READ_REQ,
CD_UNITDATA_REQ,
CD_WRITE_READ_REQ.

New State

The new state remains unchanged from the state in which the request primitive was issued that elicited the error
acknowledgement.

4.1.8 Message CD_MUX_NAME_REQ (cd_mux_name_req_t)

This user originated primitive request is not documented.

Message Format

This primitive consists of one M_PROTO or M_PCPROTO message block structured as follows:

typedef struct {
cd_ulong cd_primitive;
} cd_mux_name_req_t;

Parameters

This primitive contains the following parameters:

cd_primitive

Specifies the primitive type.

State

Not documented.

New State

Not documented.

Response

Successful:
Not documented.

Unsucessful (non-fatal errors):
Not documented.

Reasons for Failure

Non-Fatal Errors: Not documented.

CD_BADADDRESS

Address was invalid.

CD_BADADDRTYPE

Invalid address type.

CD_BADDIAL

Dial information was invalid.

CD_BADDIALTYPE

Invalid dial information type.

CD_BADDISPOSAL

Invalid disposal parameter.

CD_BADFRAME

Defective SDU received.

CD_BADPPA

Invalid PPA identifier.

CD_BADPRIM

Unrecognized primitive.

CD_DISC

Disconnected.

CD_EVENT

Protocol-specific event occurred.

CD_FATALERR

Device has become unusable.

CD_INITFAILED

Line initialization failed.

CD_NOTSUPP

Primitive not supported by this device.

CD_OUTSTATE

Primitive was issued from an invalid state.

CD_PROTOSHORT

M_PROTO block too short.

CD_READTIMEOUT

Read request timed out before data arrived.

CD_SYSERR

UNIX system error.

CD_WRITEFAIL

Unit data request failed.

4.2 Device Management Service Primitives

This section describes the service primitives that support the enabling and disabling service of the communications
device. These primitives support the Enable and Disable services described earlier.

4.2.1 Message CD_ENABLE_REQ (cd_enable_req_t)

This user originated primitive requests that the communications device be prepared for service and enabled.

A CDI stream that is in the
CD_DISABLED
stat is not yet ready for transmission. Before the stream can be used for transmission, ti must be successfully enabled
with the
CD_ENABLE_REQ
primitive. Successful processing of the
CD_ENABLE_REQ
primitive moves the stream to the
CD_ENABLED
state.

If the communications device returns the CD_CANDIAL
flag in the
cd_featuresfield of the
CD_INFO_ACK,
the device is capable of dialling and a dial string can be provided, specified by the
cd_dial_lengthand
cd_dial_offsetfields. The specification of the dial string is provider- and device-specific.

In the
CD_ENABLED
state, the stream is able to transmit must have not yet necessarily been allowed for input. If the stream returns
CD_AUTOALLOW
in the
cd_featuresfield of the
CD_INFO_ACK,
the communications device will be allowed for both transmission and reception upon successful completion of the
CD_ENABLE_REQ;
however, if the
CD_AUTOALLOW
flag is not returned, the CD user must first call
CD_ALLOW_INPUT_REQ
before reception can begin.

Message Format

This primitive consists of one M_PROTO message block structured as follows:

Parameters

Specifies the type of the provided dial string. The type can be set to a provider- or device-specific type, or can be
set as follows:

CD_NODIAL

Specifies that there is no dial string associated with the
CD_ENABLE_REQ.

cd_dial_length

Specifies the length of the dial string. Specification of dial strings is only allowed when the provider returns
CD_CANDIAL
in the
cd_featuresfield of the
CD_INFO_ACK.
When no dial string is specified by the user, or
cd_dial_typeis set to CD_NODIAL,
this field is set to zero
(0).

cd_dial_offset

Specifies the offset of the dial string from the beginning of the M_PROTO message block. When
cd_dial_lengthis zero (0), this field is ignored.

State

This primitive is valid in state CD_DISABLED.

New State

The new state is CD_ENABLED
for stream that do not return CD_AUTOALLOW
in the
cd_featuresfield of the
CD_INFO_ACK,
or the new state is CD_INPUT_ALLOWED
for those streams that do return CD_AUTOALLOW
in the
cd_featuresfield of the
CD_INFO_ACK.

Response

This primitive requires that the provider acknowledge the receipt of the primitive as follows:

Successful:
Upon success, the provider confirms that the device is enabled with the
CD_ENABLE_CON
primitive.

Unsuccessful (non-fatal errors):
Upon failure, the provider acknowledges the receipt of the primitive with the
CD_ERROR_ACK
primitive indicating the error.

Reasons for Failure

Non-Fatal Errors: appropriate non-fatal errors are as follows:

CD_BADDIAL

Dial information was invalid.

CD_BADDIALTYPE

Invalid dial information type.

CD_BADPRIM

Unrecognized primitive.

CD_EVENT

Protocol-specific event occurred.

CD_FATALERR

Device has become unusable.

CD_INITFAILED

Line initialization failed.

CD_NOTSUPP

Primitive not supported by this device.

CD_OUTSTATE

Primitive was issued from an invalid state.

CD_PROTOSHORT

M_PROTO block too short.

CD_SYSERR

UNIX system error.

4.2.2 Message CD_ENABLE_CON (cd_enable_con_t)

This provider originated primitive confirms that the previously issued CD_ENABLE_REQ
primitive has been successful.

Message Format

This primitive consists of one M_PROTO or M_PCPROTO message block structured as follows:

Parameters

Indicates the state of the CD provider at the time that the primitive was issued. cd_state can be one of the
following values:

CD_UNATTACHED

No PPA attached.

CD_UNUSABLE

PPA cannot be used.

CD_DISABLED

PPA attached.

CD_ENABLE_PENDING

Waiting acknowledgement of enable request.

CD_ENABLED

Awaiting use.

CD_READ_ACTIVE

Input section enabled; disabled after data arrives.

CD_INPUT_ALLOWED

Input section permanently enabled.

CD_DISABLE_PENDING

Waiting acknowledgement of disable request.

CD_OUTPUT_ACTIVE

Output section active only.

CD_XRAY

X-raying another PPA.

State

This primitive is issued by the CD provider in the CD_ENABLE_PENDING
state.

New State

After issuing this primitive, the CD provider enters the CD_ENABLED
state, unless the CD_INFO_ACK
returns the CD_AUTOALLOW
flag in the cd_featuresfield. In that case, the CD provider enters the CD_INPUT_ALLOWED
state.

4.2.3 Message CD_DISABLE_REQ (cd_disable_req_t)

This user originated primitive requests that the communications device, previously enabled with a successful
CD_ENABLE_REQ
primitive, be disabled. In addition, ti specifies the disposition of unsent messages.

Message Format

This primitive consists of one M_PROTO message block structured as follows:

Parameters

cd_primitive

Specifies the primitive type.

cd_disposal

Specifies how unsent message are to be disposed. This field can be one of the following values:

CD_FLUSH

Discard undeliverable data. All data that is unsent at the time that the CD_DISABLE_REQ primitive is received will
be discarded. Any data awaiting transmission in the device's write queue will be flushed.

CD_WAIT

Attempt to deliver unsent data. All data that is unsent, at the time that the CD_DISABLE_REQ primitive is received,
the provider will attempt to send before confirming the primitive. The provider will not wait for acknowledgement of
sent message.

CD_DELIVER

Deliver unsent data. All data that is unsent, at the time that the CD_DISABLE_REQ primitive is received, the
provider will deliver before confirming the primitive. The provider will wait for acknowledgement of sent messages.

State

This primitive is valid in state CD_ENABLED.

New State

The new state is CD_DISABLED.

Response

This primitive requires the provider to acknowledge receipt of the primitive as follows:

Successful:
When successful, the provider confirms the receipt of the primitive with a CD_DISABLE_CON
primitive indicating the success of the operation. The new state is CD_UNATTACHED.

Unsuccessful (non-fatal errors):
When unsuccessful, the provider acknowledges the receipt of the primitive with a CD_ERROR_ACK
primitive indicating the error. The state is unchanged.

Reasons for Failure

Non-Fatal Errors: applicable non-fatal errors are as follows:

CD_BADDISPOSAL

Invalid disposal parameter.

CD_BADPRIM

Unrecognized primitive.

CD_EVENT

Protocol-specific event occurred.

CD_FATALERR

Device has become unusable.

CD_NOTSUPP

Primitive not supported by this device.

CD_OUTSTATE

Primitive was issued from an invalid state.

CD_PROTOSHORT

M_PROTO block too short.

CD_SYSERR

UNIX system error.

4.2.4 Message CD_DISABLE_CON (cd_disable_con_t)

This provider originated primitive confirms that the previous CD_DISABLE_REQ
has been successful.

Message Format

This primitive consists of one M_PROTO message block structured as follows:

Parameters

Indicates the state of the CD provider following the CD_ERROR_IND.
cd_state can be one of the following values:

CD_UNATTACHED

No PPA attached.

CD_UNUSABLE

PPA cannot be used.

CD_DISABLED

PPA attached.

CD_ENABLE_PENDING

Waiting acknowledgement of enable request.

CD_ENABLED

Awaiting use.

CD_READ_ACTIVE

Input section enabled; disabled after data arrives.

CD_INPUT_ALLOWED

Input section permanently enabled.

CD_DISABLE_PENDING

Waiting acknowledgement of disable request.

CD_OUTPUT_ACTIVE

Output section active only.

CD_XRAY

X-raying another PPA.

cd_errno

Indicates the reason for error. cd_errno can be one of the following values:

CD_BADFRAME

Defective SDU received.

CD_DISC

Disconnected.

CD_EVENT

Protocol-specific event occurred.

CD_FATALERR

Device has become unusable.

CD_READTIMEOUT

Read request timed out before data arrived.

CD_SYSERR

UNIX system error.

CD_WRITEFAIL

Unit data request failed.

cd_explanation

Indicates a futher explanation of the error. When cd_errno is CD_SYSERR, this field contains the
UNIX system error as described in errno(3). Otherwise, cd_explanation may contain one of the
following values:

CD_CRCERR

CRC or FCS error.

CD_DLE_EOT

DLE EOT detected.

CD_FORMAT

Format error detected.

CD_HDLC_ABORT

Aborted frame detected.

CD_OVERRUN

Input overrun.

CD_TOOSHORT

Frame too short.

CD_INCOMPLETE

Partial frame received.

CD_BUSY

Telephone was busy.

CD_NOANSWER

Connection went unanswered.

CD_CALLREJECT

Connection rejected.

CD_HDLC_IDLE

HDLC line went idle.

CD_HDLC_NOTIDLE

HDLC line no longer idle.

CD_QUIESCENT

Line being reassigned.

CD_RESUMED

Line has been reassigned.

CD_DSRTIMEOUT

Did not see DSR in time.

CD_LAN_COLLISIONS

LAN excessive collisions.

CD_LAN_REFUSED

LAN message refused.

CD_LAN_NOSTATION

LAN no such station.

CD_LOSTCTS

Lost Clear to Send signal.

CD_DEVERR

Start of device-specific codes.

In addition, when the explanation is CD_DEVERR or greater, the explanation may be a device-specific explanation
code.

State

This primitive is valid in any state where data transmission is valid.

New State

The new state is indicated in the primitive.

4.3.2 Message CD_BAD_FRAME_IND (cd_bad_frame_ind_t)

This provider originated primitive indicates that a frame was received in error. The error is indicated along with any
data that is retrievable from the frame received in error.

Message Format

This primitive consists of one M_PROTO message block followed by zero or more M_DATA message blocks. The M_PROTO
message block is structured as follows:

Parameters

Indicates the state of the provider following the issuing of the primitive. It can be one of the following values:

CD_UNATTACHED

No PPA attached.

CD_UNUSABLE

PPA cannot be used.

CD_DISABLED

PPA attached.

CD_ENABLE_PENDING

Waiting acknowledgement of enable request.

CD_ENABLED

Awaiting use.

CD_READ_ACTIVE

Input section enabled; disabled after data arrives.

CD_INPUT_ALLOWED

Input section permanently enabled.

CD_DISABLE_PENDING

Waiting acknowledgement of disable request.

CD_OUTPUT_ACTIVE

Output section active only.

CD_XRAY

X-raying another PPA.

cd_error

Indicates the error encountered by the frame. Among other values defined for a particular device, this error can be one
of the following values:

CD_FRMTOOLONG

The frame was too long; it overflowed the receive buffer. The data that was successfully received is in the M_DATA
message blocks associated with the primitive.

CD_FRMNONOCTET

The frame was not octet-aligned. This is a residue error. The data that was successfully received (not including the
residue error bits) is in the M_DATA message blocks associated with the primitive.

CD_EMPTY_BFR

The receive buffer is empty. This error is not normally used. No M_DATA message blocks are included with this error.

CD_BAD_CRC

There was a CRC error in an otherwise correctly received frame. The data that was successfully received, but which
failed CRC calculation, is in the M_DATA message blocks associated with the primitive.

CD_FRM_ABORTED

The frame was aborted. Any successfully received octets at the time of the abort are included in the M_DATA message
blocks associated with the primitive.

CD_RCV_OVERRUN

There was a receiver overrun during the reception of the frame. Any successfully received octets up to the point of the
receiver overrun are included in the M_DATA message blocks associated with the primitive.

State

This primitive is valid in any state where the user is not expecting local acknowledgement.

New State

After issuing this primitive, the new state is indicated in the primitive.

4.3.3 Message CD_UNITDATA_IND (cd_unitdata_ind_t)

This provider originated primitive indicates that data has arrived for the specified source and destination addresses
with the specified priority.

The M_PROTO message block is only necessary when the parameters included in the primitive are not implied by the
communications device.

Message Format

This primitive consists of one M_PROTO message block followed by one or more M_DATA message blocks. The M_PROTO message
block is optional. The M_PROTO message block is structured as follows:

Parameters

Indicates the state of the CD provider following the indication primitive. cd_state can be one of the following
values:

CD_UNATTACHED

No PPA attached.

CD_UNUSABLE

PPA cannot be used.

CD_DISABLED

PPA attached.

CD_ENABLE_PENDING

Waiting acknowledgement of enable request.

CD_ENABLED

Awaiting use.

CD_READ_ACTIVE

Input section enabled; disabled after data arrives.

CD_INPUT_ALLOWED

Input section permanently enabled.

CD_DISABLE_PENDING

Waiting acknowledgement of disable request.

CD_OUTPUT_ACTIVE

Output section active only.

CD_XRAY

X-raying another PPA.

cd_src_addr_length

Indicates the length of the source address associated with the received data. When the sending endpoint uses CDI, this
address is the same as the cd_dest_addr_lengthof the corresponding CD_UNITDATA_REQ
primitive. When no source address is provided, or the source address is implicit to the data, this field is coded zero
(0).

cd_src_addr_offset

Indicates the offset of the source address from the beginning of the M_PROTO message block. When
cd_src_addr_length is zero (0), this field is also zero (0).

cd_addr_type

CD_SPECIFIC

Indicates that an address is contained in the primitive. When cd_addr_type is set to CD_SPECIFIC, a destination
address is indicated in the cd_dest_addr_length and cd_dest_addr_offset fields.

CD_BROADCAST

Indicates that the data was sent to the implicit broadcast address and no specific address follows. When
cd_addr_type is set to CD_BROADCAST, the fields cd_dest_addr_length and cd_dest_addr_offset are
coded zero (0) and should be ignored by the CD user.

CD_IMPLICIT

Indicates that an implicit address was used, or that the address is embedded in the data. When cd_addr_type is
set to CD_IMPLICIT, the fields cd_dest_addr_length and cd_dest_addr_offset are coded zero (0) and should
be ignored by the CD user.

cd_priority

Indicates the priority of the received data. The priority is provider- and device-specific.

cd_dest_addr_length

Indicates the length of the destination address. When this field is coded zero (0), it indicates that no destination
address is included in the message.

cd_dest_addr_offset

Indicates the offset of the destination address from the start of the M_PROTO message block. When
cd_dest_addr_length is zero (0), this field is also coded zero (0) and should be ignored by the CD user.

State

This primitive is valid in any state when the device is allowed to receive data (i.e. CD_READ_ACTIVE
and CD_INPUT_ALLOWED).

New State

The state remains unchanged.

4.3.4 Message CD_UNITDATA_REQ (cd_unitdata_req_t)

This user originated primitive requests that the specified data be sent to the specified destination address with the
specified priority.

Message Format

This primitive consists of one M_PROTO message block followed by one or more M_DATA message blocks. The M_PROTO message
block is structured as follows:

Parameters

Specifies the address type. The address type can be one of the following values:

CD_SPECIFIC

Specifies that an address is contained in the primitive. When cd_addr_type is set to CD_SPECIFIC, a destination
address must be specified in the cd_dest_addr_length and cd_dest_addr_offset fields.

CD_BROADCAST

Specifies that the data is to be sent to the implicit broadcast address and no specific address follows. When
cd_addr_type is set to CD_BROADCAST, the field cd_dest_addr_length and cd_dest_addr_offset should
be coded zero (0) and are ignored by the CD provider.

CD_IMPLICIT

Specifies that an implicit address is to be used, or that the address is embedded in the data. When cd_addr_type
is set to CD_IMPLICIT, the fields cd_dest_addr_length and cd_dest_addr_offset should be coded zero (0) and
are ignored by the CD provider. No address or embedded address.

cd_priority

Specifies the priority of the data. Priorities are provider- and device-specific.

cd_dest_addr_length

When cd_addr_type is CD_SPECIFIC, this field specifies the length of the destination address to which to send
the message. Otherwise, this field is coded zero (0) and ignored by the CD provider.

cd_dest_addr_offset

When cd_addr_type is CD_SPECIFIC, this field specifies the offset of the destination address from the start of
the M_PROTO message block. Otherwise, this field is ignored by the CD provider.

State

This primitive is valid in states
CD_ENABLED,
CD_INPUT_ALLOWED,
CD_OUTPUT_ACTIVE,
CD_READ_ACTIVE.

New State

The state remains unchanged.

Response

This primitive requires an acknowledgement under the following conditions:

Successful:
When field cd_output_stylein CD_INFO_ACK
is set to CD_ACKEDOUTPUT,
then the provider is required to acknowledge the CD_UNITDATA_REQ with a CD_UNITDATA_ACK.
Otherwise, the primitive does not require an acknowledgement. In either case, the state remains unchanged.

Unsuccessful (non-fatal errors):
When unsuccessful, the provider is required to acknowledge the primitive with a CD_ERROR_ACK
primitive indicating the error.

Reaons for Failure

Non-Fatal Errors: applicable non-fatal errors are as follows:

CD_BADADDRESS

Address was invalid.

CD_BADADDRTYPE

Invalid address type.

CD_BADPRIM

Unrecognized primitive.

CD_DISC

Disconnected.

CD_EVENT

Protocol-specific event occurred.

CD_FATALERR

Device has become unusable.

CD_NOTSUPP

Primitive not supported by this device.

CD_OUTSTATE

Primitive was issued from an invalid state.

CD_PROTOSHORT

M_PROTO block too short.

CD_SYSERR

UNIX system error.

CD_WRITEFAIL

Unit data request failed.

4.3.5 Message CD_UNITDATA_ACK (cd_unitdata_ack_t)

This provider originated primitive acknowledges that the previous CD_UNITDATA_REQ
primitive was acknowledged as sent.

CD_UNITDATA_ACK primitives are indicated or not depending on the output style as indicated in the
cd_output_stylefield of the CD_INFO_ACK
primitive as follows:

CD_UNACKEDOUTPUT

No CD_UNITDATA_ACK primitives will be indicated.

CD_ACKEDOUTPUT

CD_UNITDATA_ACK primitives will be issued for every outstanding CD_UNITDATA_REQ.

CD_PACEDOUTPUT

CD_UNITDATA_ACK primitives will only be issued as a timing clue for output.

When the CD_DISABLE_REQ
primitive is requested, outstanding acknowledgements may be cancelled depending on the value contained in the
cd_disposalfield of this primitive. When the CD_ABORT_OUTPUT_REQ
primitive is requested, outstanding acknowledgements are cancelled.

Message Format

This primitive consists of one M_PROTO message block structured as follows:

4.4 Device Duplex Management Service Primitives

4.4.1 Message CD_READ_REQ (cd_read_req_t)

When a stream is enabled with CD_ENABLE_REQ,
it can be used for transmission. If the stream returns CD_AUTOALLOW
in the cd_featuresfield of the CD_INFO_ACK,
the device automatically allows input and there is no need to call the CD_READ_REQ
primitive for the device, unless CD_HALT_INPUT_REQ
has been successfully called beforehand.

Message Format

This primitive consists of one M_PROTO or M_PCPROTO message block structured as follows:

4.4.2 Message CD_ALLOW_INPUT_REQ (cd_allow_input_req_t)

When a stream is enabled with CD_ENABLE_REQ,
it can be used for transmission. If the stream returns CD_AUTOALLOW
in the cd_featuresfield of the CD_INFO_ACK,
the device automatically allows input and there is no need to call the CD_ALLOW_INPUT_REQ primitive for the
device, unless the CD_HALT_INPUT_REQ
has been successfully called beforehand.

Message Format

This primitive consists of one M_PROTO or M_PCPROTO message block structured as follows:

typedef struct {
cd_ulong cd_primitive;
} cd_allow_input_req_t;

Parameters

This primitive contains the following parameters:

cd_primitive

Specifies the primitive type.

State

This primitive is valid in the CD_ENABLED
state.

New State

When successful, the new stat is CD_INPUT_ALLOWED.

Response

This primitive requires that the provider acknowledge receipt of the primitive as follows:

Successful:
When successful, the provider acknowledges the receipt of the primitive with the CD_OK_ACK
primitive. The new state is CD_INPUT_ALLOWED.

Unsuccessful (non-fatal errors):
When unsuccessful, the provider acknowledges the receipt of the primitive with the CD_ERROR_ACK
primitive. The reason for failure is provided in the error field of the primitive. The state remains unchanged.

Reasons for Failure

Non-Fatal Errors: applicable non-fatal errors are as follows:

CD_BADPRIM

Unrecognized primitive.

CD_DISC

Disconnected.

CD_EVENT

Protocol-specific event occurred.

CD_FATALERR

Device has become unusable.

CD_NOTSUPP

Primitive not supported by this device.

CD_OUTSTATE

Primitive was issued from an invalid state.

CD_PROTOSHORT

M_PROTO block too short.

CD_SYSERR

UNIX system error.

If the input section is already allowed and this primitive is issued in the CD_INPUT_ALLOWED
state, the provider should ignore the primitive and not generate a non-fatal error.

4.4.3 Message CD_HALT_INPUT_REQ (cd_halt_input_req_t)

This user originated primitive requests that the input section be halted.

When a stream is enabled with CD_ENABLE_REQ,
it can be used immediately for transmission. If the stream returns CD_AUTOALLOW
in the cd_featuresfield of the CD_INFO_ACK,
the device automatically allows input and there is no need to call CD_ALLOW_INPUT_REQ
for the device. However, CD_HALT_INPUT_REQ will halt input on such a device.

In addition, if the input section is temporarily enabled with CD_READ_REQ,
on a half-duplex communications device, then CD_HALT_INPUT_REQ will abort the read operation.

Message Format

This primitive consists of one M_PROTO or M_PCPROTO message block structured as follows:

Parameters

Specifies how unsent messages are to be disposed. This field can be one of the following values:

CD_FLUSH

Discard undeliverable data. All data that is undelivered at the time that the CD_HALT_INPUT_REQ primitive is
received will be discarded. Any data awaiting delivery in the device's read queue will be flushed.

CD_WAIT

Attempt to deliver undelivered data. All data that is undelivered at the timer that the CD_HALT_INPUT_REQ
primitive is received the provider will attempt to deliver before acknowledging the primitive. The provider will not
wait for acknowledgement of sent messages.

CD_DELIVER

Deliver undelivered data. All data that is undelivered at the time that the CD_HALT_INPUT_REQ primitive is
received the provider will deliver before acknowledging the primitive. The provider will also wait for an deliver
acknowledgement of sent messages.

State

This primitive is valid in state
CD_ENABLED,
CD_INPUT_ALLOWED or
CD_READ_ACTIVE,

New State

The new state is CD_ENABLED.

Response

This primitive requires that the CD provider acknowledge receipt of the primitive as follows:

Successful:
Upon success, the provider will acknowledge receipt of the primitive with the CD_OK_ACK
primitive. The new state is CD_ENABLED.

Unsuccessful (non-fatal errors):
Upon failure, the provider will acknowledge receipt of the primitive with the CD_ERROR_ACK
primitive with the error indicated in the primitive. The new state remains unchanged.

Reasons for Failure

Non-Fatal Errors: applicable non-fatal errors are as follows:

CD_BADDISPOSAL

Invalid disposal parameter.

CD_BADPRIM

Unrecognized primitive.

CD_DISC

Disconnected.

CD_EVENT

Protocol-specific event occurred.

CD_FATALERR

Device has become unusable.

CD_NOTSUPP

Primitive not supported by this device.

CD_OUTSTATE

Primitive was issued from an invalid state.

CD_PROTOSHORT

M_PROTO block too short.

CD_SYSERR

UNIX system error.

If the communications device is in the CD_ENABLED
state and the input section is not active, the CD_HALT_INPUT_REQ primitive should be ignored and no non-fatal
error generated.

4.4.4 Message CD_ABORT_OUTPUT_REQ (cd_abort_output_req_t)

This user originated primitive requests that any transmission operation currently in progress be aborted.

Message Format

This primitive consists of one M_PROTO or M_PCPROTO message block structured as follows:

typedef struct {
cd_ulong cd_primitive;
} cd_abort_output_req_t;

Parameters

This primitive contains the following parameters:

cd_primitive

Specifies the primitive type.

State

This primitive is valid in any state in which the output section is enabled, but no local acknowledgement is pending.

New State

The new state remains unchanged unless the current state is CD_OUTPUT_ACTIVE,
in which case the new state is CD_ENABLED
or CD_INPUT_ALLOWED,
depending on the state of the input section.

Response

This primitive requires the CD provider to acknowledge receipt of the primitive as follows:

Successful:
Upon success, the provider acknowledges the receipt of the primitive with the CD_OK_ACK
primitive. The new state is unchanged.

Unsuccessful (non-fatal errors):
Upon failure, the provider acknowledges the receipt of the primitive with the CD_ERROR_ACK
including the reason for failure. The new state remains unchanged.

Note that if the output section is not active at the time that the CD_ABORT_OUTPUT_REQ is issued, but the
communications device is enabled, the provider should discard the CD_ABORT_OUTPUT_REQ primitive and not issue any
non-fatal error.

Reasons for Failure

CD_BADPRIM

Unrecognized primitive.

CD_DISC

Disconnected.

CD_EVENT

Protocol-specific event occurred.

CD_FATALERR

Device has become unusable.

CD_NOTSUPP

Primitive not supported by this device.

CD_OUTSTATE

Primitive was issued from an invalid state.

CD_PROTOSHORT

M_PROTO block too short.

CD_SYSERR

UNIX system error.

4.4.5 Message CD_WRITE_READ_REQ (cd_write_read_req_t)

This user originated primitive requests that the provided data be transmitted and that the output section be disabled
and the input section enabled immediately following the transmission.

Message Format

This primitive consists of one M_PROTO message block followed by one or more M_DATA message blocks. The M_PROTO message
block is structured as follows:

Parameters

Specifies a CD_UNITDATA_REQ
primitive. See cd_unitdata_req_tfor formatting of this parameter.

cd_read_req

Specifies a CD_READ_REQ
primitive. See cd_read_req_tfor formatting of this parameter.

State

This primitive is valid in any state where the CD_UNITDATA_REQ
primitive and CD_ALLOW_INPUT_REQ
primitive are permitted.

New State

The new state remains unchanged.

Response

Successful:
This primitive requires the same response from the CD provider as if a CD_UNITDATA_REQ
primitive immediately followed by a CD_READ_REQ
primitive were to be issued.

Unsuccessful (non-fatal errors):
When unsuccessful, this primitive requires an error acknowledgement using the CD_ERROR_ACK
primitive with the error indicated.

Reasons for Failure

Non-Fatal Errors: appropriate non-fatal errors are as follows:

CD_BADADDRESS

Address was invalid.

CD_BADADDRTYPE

Invalid address type.

CD_BADPRIM

Unrecognized primitive.

CD_DISC

Disconnected.

CD_EVENT

Protocol-specific event occurred.

CD_FATALERR

Device has become unusable.

CD_NOTSUPP

Primitive not supported by this device.

CD_OUTSTATE

Primitive was issued from an invalid state.

CD_PROTOSHORT

M_PROTO block too short.

CD_READTIMEOUT

Read request timed out before data arrived.

CD_SYSERR

UNIX system error.

CD_WRITEFAIL

Unit data request failed.

4.5 Lead and Signal Service Primitives

4.5.1 Message CD_MODEM_SIG_IND (cd_modem_sig_ind_t)

This provider originated primitive indicates the status of a number of modem lines and signals. This primitive is
issued in response to a change in modem signals or in response to a CD_MODEM_SIG_POLL
primitive.

Message Format

This primitive consists of one M_PROTO message block structured as follows:

Parameters

Specifies the signals to assert or de-assert, and is a bitwise OR of the following flags:

CD_DTR

Data terminal ready.

CD_RTS

Request to send.

CD_DSR

Data set ready.

CD_DCD

Data carrier detect.

CD_CTS

Clear to send.

CD_RI

Ring indicator.

If the flag is set in cd_sigs, the corresponding lead will be asserted. If the flag is clear, the corresponding
lead will be de-asserted. Flags that are not output leads and are input leads only (such as CD_DCD) are ignored.

State

This primitive is valid in any state other than CD_UNATTACHED
or CD_UNUSABLE,
and where a local acknowledgement is not pending.

New State

The state remains unchanged.

Response

This primitive requires the CD provider to acknowledge receipt of the primitive as follows:

Successful:
Upon success, the CD provider acknowledges receipt of the primitive with a CD_OK_ACK
primitive. The state remains unchanged.

Unsuccessful (non-fatal errors):
Upon failure, the CD provider acknowledges receipt of the primitive with a CD_ERROR_ACK
indicating the reason for failure in the error number. The state remains unchanged.