This chapter summarizes the IRIS ATM signaling application interface calls that support switched virtual circuits (SVCs). The product includes an example of an application coded in C, /usr/lib/atm/examples/sigtest.c, that uses this SVC API.
The services of the ATM subsystem are accessed through the IRIX character device interface ioctl() calls that specify ATM signaling requests (commands). These calls are described alphabetically in “SVC Commands”, and are summarized in Table 3-1.
Table 3-1. Summary of SVC ioctl() calls
Type of Operation | Command (or Function) | Port State | Description | More Info |
---|---|---|---|---|
Getting a link to the ATM subsystem | open() | all | Opens a file descriptor for a device. Must be held open as long as the SVC or the SVC request-queue is active. | |
Tearing down a VC | close() | all | Closes the file descriptor and causes the VC to be torn down and all resources released, including graceful rejection of any setup requests in the input queue. | |
Activating SVCs as the called party |
|
|
|
|
| ATMIOC_REGISTER | up/dn | Creates a request queue for incoming setup requests. Setup requests that match the specified traffic contract are accepted. | |
| ATMIOC_LISTEN | up/dn | Retrieves one setup request from the SVC's request queue. | |
| ATMIOC_ACCEPT | up/dn | Accepts a setup request. This results in a new SVC. | |
| ATMIOC_REJECT | up/dn | Refuses to accept a setup request. | |
Activating SVCs as the calling party |
|
|
|
|
| ATMIOC_SETUP | up/dn | Requests a point-to-point SVC. | |
| ATMIOC_MPSETUP | up/dn | Requests a point-to-multipoint SVC and adds the first party. | |
Maintaining a multipoint SVC |
|
|
|
|
| ATMIOC_ADDPARTY | up/dn | Each call adds one more destination address to a point-to-multipoint SVC. | |
| ATMIOC_DROPPARTY | up/dn | Drops one destination address from a point-to-multipoint SVC. | |
Retrieving VC Information |
|
|
|
|
| ATMIOC_GETVCCTABLEINFO | up | Retrieves information about all the VCCs currently open on the device. | |
Managing data |
|
|
|
|
| write() | up | Pinned down, 8-byte aligned buffer of any size. If necessary, ATM subsystem divides data into different packets for transmission. | |
| writev() | up | Gathers data from a number of buffers for transmission as one or more packets. | |
| read() | up | Retrieves incoming data. |
The following files must be included in any program using the ATM-specific ioctl() calls:
“sys/atm.h”
“sys/atm_user.h”
“sys/if_atm.h” (only for applications doing IP-over-ATM)
The IRIS ATM signaling software makes it possible for applications to dynamically set up and tear down switched virtual circuits (SVCs) in accordance with the ATM User-Network Interface (ATM UNI) standard. The software consists of the following components that work together to transparently provide support for SVCs:
Driver for the IRIS ATM network controller hardware
Signaling daemon (atmsigd) that implements the ATM User-Network Interface signaling standard for setting up and tearing down SVCs
Interim local management interface daemon (atmilmid) that implements the ATM User-Network Interface local management standard for exchange of status, configuration, and control information, including obtaining ATM addressing information from an adjacent switch
The IRIS ATM driver is the access point for applications using IRIS ATM services, as illustrated in Figure 3-1, to Figure 3-4. Applications use the IRIS ATM application programming interface (API) to place their requests for creating and tearing down SVCs. The driver communicates these requests to the atmsigd and atmilmid modules, as appropriate. The atmsigd and atmilmid modules process requests in compliance with the ATM protocols as specified in the ATM User-Network Interface Specification.
The atmsigd module interfaces with other modules that handle the ATM signaling protocols and communication with the adjacent ATM switch. The ATM signaling protocol stack consists of three protocols: Q.2931, QSAAL, and AAL5. The software can be configured so that multiple UNIs are created, each with a different possible configuration.
The atmilmid module uses the simple network management protocol (SNMP, RFC 1157) to maintain a management information database (MIB) for each physical ATM connection and to communicate with adjacent interim local management interface (ILMI) programs. The objects within this MIB are defined in the ILMI section of the ATM User-Network Interface standard. See Chapter 4, “ Commands for Use by ILMI Modules”, for the API calls that retrieve ILMI information.
![]() | Note: SVCs are created using ATMIOC_SETUP or ATMIOC_REGISTER, ATMIOC_LISTEN, and ATMIOC_ACCEPT. PVCs are created using ATMIOC_CREATEPVC. |
The data structures described in this section are used as arguments for many of the ATM signaling ioctl() calls.
The atm_address_t structure contains an ATM subsystem's network layer address, used for identifying users (the two endpoints) of a VC. Separate addresses are used for the called and the calling ATM subsystems. All fields of this address, except the ESI and SEL fields of the ATM network service access point (NSAP), are assigned by an endpoint's switch.
Table 3-2, describes the atm_address_t structure. The first byte (addrType field) of the structure indicates the type of address: null, ATM NSAP, or native-E.164. The remaining field, addr, contains either a 20-byte ATM NSAP address (array of characters) or a variable-length E.164 address structure.
Table 3-2. The atm_address_t structure
Field | Type | Values |
---|---|---|
addrType | char | NULLADDR_TYPE: no address is specified. NSAP_TYPE E164_TYPE |
addr | union | One of the following structures: |
nsap | array of char | atm_nsap_t[20]: an array of 20 numerals. Table 3-3, and Figure 3-5, provide more details. |
e164 | struct | atm_e164_t: variable length structure (as described in next 2 rows). |
len | char | Number of valid digits in addr[] array. |
addr[15] | array of char | Up to 15 digits encoded in IA5 characters. Table B-1 describes the IA5 character set. |
Table 3-3. Contents for fields of ATM NSAP
Field | AFI Value[a] | IDI Content (Data Size, Field Length) | DSP Length | Total Length of NSAP When in This Format |
---|---|---|---|---|
AFI_DCC | 39 | An ISO DCC value, which is a data country code from ISO 3166 (3-digit code, represented by 2 octets in which the unused least-significant 4 bits are set to ones). | 17 octets | 20 octets |
AFI_E164 | 45 | An E.164 address or number (up to 15 digits, represented by 8 octets in which the least significant 4 bits are ones, and any unused most-significant bits are set to zeros) | 11 octets | 20 octets |
AFI_ICD | 47 | An ISO ICD value, which is an international code designator from ISO 6523 (4-digit code, represented by 2 octets) | 17 octets | 20 octets |
[a] Encoded in binary-coded decimal (BCD) format, where each 4 bits encodes one decimal numeral. For example, 0001 0010 (binary) represents 12 decimal. Binary values 0xA to 0xF are not valid for BCD encoding. |
Following is an example of the atm_address structure, as defined in the sys/atm_user.h file:
typedef struct atm_address { #define NULLADDR_TYPE 0 /* No address specified */ #define NSAP_TYPE 0x02 #define E164_TYPE 0x11 char addrType; /* one of the above types */ union { nsap_address_t nsap; e164_address_t e164; } addr; } atm_address_t; #define AFI_DCC 0x39 #define AFI_ICD 0x47 #define AFI_E164 0x45 typedef char nsap_address_t[20]; typedef struct e164_address { unsigned char len; char addr[15]; } e164_address_t; |
The cellrate_t structure (described in Table 3-5) is used to specify an SVC's transmission rate and other traffic contract parameters. The user selects one of the cellrate types listed in Table 3-4, and specifies that selection in the first byte of the cellrate_t structure. The format for the remaining portions of the cellrate_t structure depends on the content of the cellrate_type field. The various formats are described in Table 3-5. The specified peak cellrate must be supported by the hardware subsystem, as described in the “Characteristics of the ATM-OC3c Hardware” in Chapter 1; each IRIS ATM board handles transmission rates differently.
Table 3-4. Values for cellrate Type
Value for cellrate Type Field | Description |
---|---|
CRT_NULL | Zero bandwidth. |
CRT_PEAK_AGG | Aggregate peak cellrate for CLP0+1. |
CRT_PSB_AGG | Aggregate peak cellrate, sustainable cellrate, and maximum burst size for CLP 0+1. |
CRT_BEST_EFFORT | Peak cellrate for CLP0+1 with best-effort indication. |
CRT_PEAK | Not supported in this release. Peak cellrates for CLP0 and CLP0+1. |
CRT_PEAK_TAG | Not supported in this release. Same as CRT_PEAK, with tagging requested. |
CRT_PSB | Not supported in this release. Peak cellrate for CLP0+1, sustainable cellrate for CLP0, maximum burst size for CLP0. |
CRT_PSB_TAG | Not supported in this release. Same as CRT_PSB, with tagging requested. |
Table 3-5. The cellrate_t structure
Field | Type | Values |
---|---|---|
cellrate_type | char | From Table 3-4. |
rate | union | One of the following formats or structures: |
pcr_01 | struct | Use with CRT_PEAK_AGG and CRT_BEST_EFFORT |
pcr01 | int | Peak cellrate for CLP 0+1, in cells per second. Value must be supported by the IRIS ATM hardware, as described in “Characteristics of the ATM-OC3c Hardware” in Chapter 1. |
psb_01 | struct | Use with CRT_PSB_AGG. |
pcr01 | int | Peak cellrate for CLP 0+1, in cells per second. Value must be supported by the IRIS ATM hardware, as described in “Characteristics of the ATM-OC3c Hardware” in Chapter 1. |
scr01 | int | Sustainable cellrate for CLP 0+1, in cells per second. Value must be supported by the IRIS ATM hardware, as described in “Characteristics of the ATM-OC3c Hardware” in Chapter 1. |
mbs01 | int | Maximum burst size for CLP 0+1, in cells per burst. Valid values are multiples of 32 between 1 and 2,048, inclusive. Zero is not valid. |
Following is an example of the cellrate_type structure, as defined in the sys/atm_user.h file:
typedef struct { char cellrate_type; /* a value from Table 3-4 */ union { /* for cellrate_type = CRT_PEAK, CRT_PEAK_TAG */ struct { int pcr0; int pcr01; } pcr_0_01; /* for cellrate_type = CRT_PEAK_AGG, CRT_BEST_EFFORT */ struct { int pcr01; } pcr_01; /* for cellrate_type = CRT_PSB, CRT_PSB_TAG */ struct { int pcr01; int scr0; int mbs0; } psb_0_01; /* for cellrate_type = CRT_PSB_AGG */ struct { int pcr01; int scr01; int mbs01; } psb_01; } rate; } cellrate_t; |
Many of the ioctl() SVC commands provide information returned from the ATM network that indicates the cause when a signaling message fails or is rejected. The structure used for this information is reject_reason_t, summarized in Table 3-6.
Table 3-6. The reject_reason_t structure
Field | Type | Values |
---|---|---|
location | char | Identifies where along the VCC the failure or rejection occurred. Table 3-7, lists the values for this field. |
cause | char | Describes the reason for the failure. Table C-1, lists the values for this field. |
diags[4] | array of char | Reserved for future use. Does not contain valid data. |
Table 3-7. Values for location Field in the reject_reason_t Structure
Text | Value for location Field |
---|---|
User | 0x00 |
Private network serving the local user | 0x01 |
Public network serving the local user | 0x02 |
Transit network | 0x03 |
Public network serving the remote user | 0x04 |
Private network serving the remote user | 0x05 |
International network | 0x07 |
Network beyond interworking point | 0x0A |
Following is an example of the reject_reason_t structure, as defined in the sys/atm_user.h file:
typedef struct { char cause;/* value from Table C-1 or Table C-2 */ char location;/* value from Table 3-7 */ char diags[4];/* reserved for future use */ } reject_reason_t; |
The 1-byte quality of service variables (fwdQOS and bwdQOS) are used in a number of ATM signaling commands to specify the forward and backward ATM service classes. Table 3-8, summarizes the valid values.
Table 3-8. Values for QoS Variables
Text | Value for QoS Variable | Description |
---|---|---|
QOS_CLASS_0 | 0 | Use with best-effort traffic. |
QOS_CLASS_1 | 1 | Use with constant bit rate (CBR). |
QOS_CLASS_2 | 2 | Use with variable bit rate (VBR). |
QOS_CLASS_3 | 3 | Use for connection-oriented data. |
QOS_CLASS_4 | 4 | Use for connectionless data. |
The broadband low layer information (BLLI) variable is used in a number of ATM signaling commands to specify or communicate the ATM user network interface (UNI) BLLI for a virtual channel connection (VCC). Calling parties can specify one to three BLLI options in their setup requests; after the request succeeds, the single negotiated BLLI option is returned in the first element of the array. Called parties register for one option. Each BLLI value can be registered (with ATMIOC_REGISTER) by only one process at a time. (This does not mean one VC, since by forking, the registered process can support multiple VCs, as explained in “ATMIOC_ACCEPT”.) Table 3-9, summarizes the supported BLLI values.
When the BLLI_ANY value is specified in an ATMIOC_REGISTER call, any incoming BLLI value from the other party is accepted (including a null BLLI). Use of all other values requires that the other party's specified BLLI selection match exactly; if there is no match, the IRIS ATM software rejects the connection request and does not place it on a reception queue.
Table 3-9. Values for BLLI Variable
Text | Value for BLLI Variable | Description |
---|---|---|
BLLI_NULL | 0 | Null low layers. When used with ATMIOC_SETUP, always results in a negotiated BLLI of null. When used with ATMIOC_REGISTER, matches only to an incoming null BLLI. |
BLLI_ANY | 1 | Any BLLI. Not valid for ATMIOC_SETUP. With ATMIOC_REGISTER, matches any BLLI, including null, on incoming setup requests. |
BLLI_LLC2 | 2 | Level 2 LLI = LLC. Whenever IP-over-ATM is enabled, this BLLI is registered (occupied) by the IP stack (the input queues for logical IP network interfaces), so other processes cannot receive on it. Additional ATMIOC_REGISTER commands fail. |
BLLI_LE_C | 3 | LAN Emulation control. |
BLLI_LE_ENET | 4 | LAN Emulation 802.3 data. |
BLLI_LE_ENET_MC | 5 | LAN Emulation 802.3 multicast. |
BLLI_LE_TR | 6 | LAN Emulation 802.5 data. |
BLLI_LE_TR_MC | 7 | LAN Emulation 802.5 multicast. |
The 1-byte BearerClass variable is used in a number of ATM signaling commands to specify the broadband bearer (also called transport or network) capability. Table 3-10, summarizes the valid values. See ATM UNI 3.1, Appendix F, for usage guidelines.
Table 3-10. Values for BearerClass Variables
Text | Value for BearerClass Variable | Description |
---|---|---|
BCOB_A | 1 | For use with non-ATM endpoints. Intermediate network nodes may map the data to another format. |
BCOB_C | 2 | For use with non-ATM endpoints. Intermediate network nodes may map the data to another format. |
BCOB_X_UNSPEC | 3 | Use for best-effort ATM traffic. |
BCOB_X_CBR | 4 | Use for constant bit rate (CBR) ATM traffic. |
BCOB_X_VBR | 5 | Use for variable bit rate (VBR) ATM traffic. |
CSDU is a shortened version of CPCS-SDU, which stands for common-part convergence sublayer service data unit. The 2-byte MaxCSDU integer value specifies the maximum size for the data units (packets) at the convergence sublayer of the AAL layer. This variable is subject to negotiation during connection setup, so the MaxCSDU sizes that are actually used are not necessarily those requested with the SETUP, MPSETUP, or REGISTER command.
Valid values range from 8 to 0x2FF8, and must be divisible by 8.
Separate MaxCSDU sizes are specified for the forward and the back channels of a VC. The fwdMaxCSDU size specifies a maximum packet size for the forward channel (that is, the channel on which the calling party transmits and the called party receives). The bwdMaxCSDU size specifies a maximum packet size for the back channel (that is, the channel on which the calling party receives and the called party transmits).
![]() | Note: The forward and back channels are always labeled from the calling party's viewpoint. |
An extensive sample of ATM-over-SVC code is provided in the file /usr/lib/atm/examples/sigtest.c.
The following sections describe each ATM SVC ioctl() command in detail. The commands are organized alphabetically.
![]() | Note: In these descriptions, forward refers to the channel carrying data from the calling party to the called party, and backward refers to the channel carrying data (in the opposite direction) from the called party to the calling party. |
The ATMIOC_ACCEPT ioctl() command accepts a connection setup request that has already been retrieved by an ATMIOC_LISTEN call. The file descriptor used in this call must be a new file descriptor for the same device used in the ATMIOC_REGISTER call. The application must block until the ATM software replies, which it does when an ATM UNI CONNECT ACKNOWLEDGE message returns from the calling party. The request is not removed from the queue until the call setup has completed (either by creating the SVC or by acknowledging a rejection). While waiting for the CONNECT ACKNOWLEDGE message, the program that made the ioctl() call is put to sleep.
Invoking this ioctl() command causes the ATM signaling software to generate an ATM UNI CONNECT message. (An ATMIOC_LISTEN ioctl() command must have completed successfully before the ATMIOC_ACCEPT command can be invoked.) If the application wants to open multiple SVCs simultaneously for the associated traffic contract, it forks the new file descriptor (new_fd_atm) as soon as the ATMIOC_ACCEPT command returns. At that point, the application can retrieve (using ATMIOC_LISTEN) and accept (using ATMIOC_ACCEPT) the next item on the queue. The application can receive (read()) data from all its open SVCs.
When the application wants to close a receiving SVC (accept no more requests), it simply closes the file descriptor. If one or more child processes have been forked, and they are still running, they must be killed or must also close their file descriptors. When the original file descriptor is closed, the ATM signaling software generates an ATM UNI RELEASE message to the calling party.
Use the following format:
open (new_fd_atm, O_RDWR); ioctl (new_fd_atm, ATMIOC_ACCEPT, &accept); <wait for return, proceed as described in the next paragraph> |
The new_fd_atm file descriptor is a new read-write file descriptor for the same ATM device used in the ATMIOC_REGISTER call, and accept is an atm_accept_t structure.
Once the ATMIOC_ACCEPT returns, one of the following actions must be taken:
If it is desirable to continue accepting other calls on this SVC (specifically its BLLI value), the process should fork, then the parent process should close its copy of the new_fd_atm that was used in the ATMIOC_ACCEPT call. The parent process goes back to blocking on the ATMIOC_LISTEN call and processing new connection requests as they appear on the SVC's queue. The child process should close its copy of the file descriptor belonging to ATMIOC_LISTEN and use the open connection until it is finished, at which time it simply closes its file descriptor.
If this is the only call for this SVC, the process should close the file descriptor from the ATMIOC_LISTEN call so that no more incoming calls are added to the queue. This releases the BLLI value associated with that SVC for registration by another process. The process can then proceed to read() and write() the new_fd_atm file descriptor.
The atm_accept_t structure should be prepared as described in Table 3-11.
Table 3-11. Recommended Values for the Argument of the ATMIOC_ACCEPT Command
Field in atm_accept_t | Type | Values |
---|---|---|
userHandle | int | The out value from ATMIOC_LISTEN. |
callHandle | int | The out value from ATMIOC_LISTEN. |
If successful, ATMIOC_ACCEPT returns zero.
On failure, the ioctl() returns -1 with an error heading for descriptions of individual errors. For a description of possible errors, see “Errors”
Following is an example of the atm_accept_t structure, as defined in the sys/atm_user.h file:
typedef struct { int userHandle; int callHandle; } atm_accept_t; |
Possible errors include:
EINTR | While waiting for the accept call to complete from over the network, the ioctl() was unexpectedly interrupted. | |
EINVAL | The file descriptor was already bound (for example, with ATMIOC_CREATEPVC, ATMIOC_SETUP, ATMIOC_MPSETUP, or ATMIOC_ACCEPT), or the userHandle or callHandle was not valid or belonged to a different application, or the supplied userHandle did not identify a registered queue, or the ATM software discovered that the queue was empty. | |
ENOTCONN | The connection request is no longer valid. It has timed out or has been released by the calling party. | |
EFAULT | An error occurred when the ATM software attempted to read the call's argument. | |
ENOSPC | The driver was not able to allocate a userHandle to the new file descriptor for the SVC. | |
ENODEV | The port was not in the up or down state or the port was not operational. |
The ATMIOC_ADDPARTY ioctl() command is invoked by a calling party to cause the ATM signaling software to add another party to an already existing point-to-multipoint connection. The ATM signaling software issues an ATM UNI ADDPARTY message. No backward channel is created for this SVC.
Use the following format:
ioctl (mp_fd_atm, ATMIOC_ADDPARTY, &addparty); |
mp_fd_atm is the same file descriptor used in the ATMIOC_MPSETUP call and addparty is an atm_addparty_t structure.
The atm_addparty_t structure should be prepared as described in Table 3-12.
Table 3-12. Recommended Values for the Argument of the ATMIOC_ADDPARTY Command
Field in atm_addparty_t
| Type | Values |
---|---|---|
addparams | struct | An addpartyparams_t structure as described in the following structures. |
calledNumber | struct | |
| int | A locally unique tag, supplied by the program making this call. The handle is for identifying each party on an existing multipoint connection or connection request. User is responsible for ensuring that all its active tags are unique within its own environment. This value is not used in any meaningful way by the ATM signaling software. |
reject | struct | See “The reject_reason_t Structure”. Upon failure, this field equals the out value, as follows. If the add request fails to create an SVC, this structure contains the reason. A zero indicates that the failure occurred in the driver (before contacting the ATM signaling daemon). A nonzero value indicates that the failure or rejection occurred at the called endpoint or at an intermediate system. The cause field identifies the cause for the failure as described in Table C-2. |
If successful, ATMIOC_ADDPARTY returns zero.
When a failure occurs within the driver, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”. When the error occurs within the driver, the reject field is zero. When a failure is due to a negative response from the network, the ioctl() wakes the sleeping program and returns -1 with an EIO error stored in errno. The reject out value should be read.
When the ioctl() fails to create a VCC for the party, the out value in the reject field of the argument contains one of the causes described in Table C-2. A reject field of zero indicates that the ioctl() failed within the driver (not due to a negative response from the network).
The atm_address_t and reject_reason_t structures are described in “Frequently Used Structures”.
Following is an example of the addpartyparams_t structure, as defined in the sys/atm_user.h file:
typedef struct { addpartyparams_t addparams; reject_reason_t reject; } atm_addparty_t; typedef struct { atm_address_t calledNumber; int partyHandle; } addpartyparams_t; |
Possible errors include:
EFAULT | An error occurred when the ATM software attempted to read the call's argument. | |
EINVAL | The SVC associated with the file descriptor is not connected or is not a multipoint connection (for example, the ATMIOC_MPSETUP command has not been called or did not succeed). | |
EIO | The add party call was rejected by the network (an intermediate system) or by the called party. The reasons have been written into the reject field of the argument (which is a reject_reason_t structure). See “The reject_reason_t Structure”, and Table C-2. | |
ENODEV | The port was not in the up or down state or the port was not operational. |
The ATMIOC_DROPPARTY ioctl() command is invoked by a calling party to cause the ATM signaling software to drop a called party from an existing point-to-multipoint connection. This ioctl() command causes the ATM signaling software to issue an ATM UNI DROPPARTY message.
Use the following format:
ioctl (mp_fd_atm, ATMIOC_DROPPARTY, &dropparty); |
mp_fd_atm is the same file descriptor used in the ATMIOC_MPSETUP or ATMIOC_ADDPARTY call that was used to add the party, and dropparty is an atm_dropparty_t structure.
The atm_dropparty_t structure should be prepared as described in Table 3-13.
Table 3-13. Recommended Values for the Argument of the ATMIOC_DROPPARTY Command
Field in atm_dropparty_t | Type | Values |
---|---|---|
partyHandle | int | The tag that was supplied by the program when it added this party to the SVC. |
If successful, ATMIOC_DROPPARTY returns zero.
On failure, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”.
Following is an example of the atm_dropparty_t structure, as defined in the sys/atm_user.h file:
typedef struct { int partyHandle; } atm_dropparty_t; |
Possible errors include:
EFAULT | An error occurred when the ATM software attempted to read the call's argument. | |
EINVAL | The SVC associated with the file descriptor is not connected or is not a multipoint connection (for example, the ATMIOC_MPSETU command has not been called or did not succeed). | |
ENODEV | The port was not in the up or down state or the port was not operational. |
The ATMIOC_GETVCCTABLEINFO ioctl() command retrieves the entire virtual channel table (both transmit and receive VCs) from any IRIS ATM port. The port must be in the up state.
Use the following format:
ioctl (fd_atm, ATMIOC_GETVCCTABLEINFO, &sioc); |
sioc is an atmsioc_t structure.
The pointer to sioc identifies an instance of an atmsioc_t structure. The atmsioc_t structure should be set up as summarized in Table 3-14.
Table 3-14. Recommended Values for the Argument of the ATMIOC_GETVCCTABLEINFO Command
Field of atmsioc_t | Recommended Value | Comments |
---|---|---|
*ptr | Pointer to vcce[] | Pointer to location for retrieved information. Upon return, the out value equals the recommended value. Out value is an array of atm_vcce_t structures. |
len | size of(vcce[MAX_FWD_VCS+MAX_RVS_VCS]); | Maximum possible size of the table. Upon return, the out value equals the recommended value. Out value is length of retrieved table. |
If successful, ATMIOC_GETVCCTABLEINFO returns zero. The out values should be read.
On failure, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”.
The len field in the argument (sioc) is updated to contain the actual length of the retrieved data, as described in Table 3-14. The retrieved data is written to the array of atm_vcce_t structures. Each table entry is one atm_vcce_t structure, as described in Table 3-15.
Table 3-15. Values Retrieved by the ATMIOC_GETVCCTABLEINFO Command
Field of atm_vcce_t | Type | Description |
---|---|---|
vpi | int | Value for VPI |
vci | int | Value for VCI |
xmit_cellrate | struct cellrate_t | Transmit cellrate |
recv_cellrate | struct cellrate_t | Receive (backward) cellrate |
xmitQOS | int | Transmit quality of service |
recvQOS | int | Receive (backward) quality of service |
The atmsioc_t structure and the atm_vcce_t structure, as defined in the sys/atm_user.h file, are as follows:
typedef struct atmsioc { void *ptr; u_int len; } atmsioc_t; typedef struct { int vpi; int vci; cellrate_t xmit_cellrate; cellrate_t recv_cellrate; int xmitQOS; int recvQOS; } atm_vcce_t; |
The ATMIOC_LISTEN ioctl() command retrieves connection setup requests from the input queue created by the ATMIOC_REGISTER call. The program calling this ioctl() must block until the ATM software replies, which it does whenever there is a request on the queue. If there are currently no requests waiting, the caller of the ioctl() is put to sleep and awakened when a request becomes available.
Each invocation of this ioctl() retrieves the topmost (longest awaiting) item on the queue. Each retrieval provides identification tags (handles) and the negotiated traffic contract for the SVC, which may be different from the parameters specified in the ATMIOC_REGISTER call. The request is not actually removed from the queue until the request has been completely processed by an ATMIOC_ACCEPT or ATMIOC_REJECT.
![]() | Note: An ATMIOC_REGISTER ioctl() command must have completed successfully before ATMIOC_LISTEN can be invoked. |
Use the following format:
ioctl (registered_fd_atm, ATMIOC_LISTEN, &listen); |
registered_fd_atm is the file descriptor used in the ATMIOC_REGISTER call, and listen is an atm_listen_t structure.
The argument is a pointer to an empty atm_listen_t structure (described in Table 3-16).
If successful, ATMIOC_LISTEN returns zero. The out values should be read.
On failure, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”.
When the ATMIOC_LISTEN ioctl() command completes successfully, each field of the call's argument contains information about one connection setup request from the input queue for the SVC associated with the file descriptor. The retrieved information describes the traffic contract for the connection, as described in Table 3-16.
Table 3-16. Values Retrieved by the ATMIOC_LISTEN Command
Field in atm_listen_t | Type | Values |
---|---|---|
userHandle | int | Unique value provided by the ATM signaling software to identify the application that invoked ATMIOC_LISTEN. The value must be used in future ioctl() calls for this SVC. |
callHandle | int | Unique value provided by the ATM signaling software to identify this connection (SVC). The value must be used in future ioctl() calls for this SVC. |
fwdMaxCSDU | u_short | The negotiated fwdMaxCSDU for the SVC. Value is always equal to or smaller than the value specified in ATMIOC_REGISTER. See “The MaxCSDU Variables”. |
bwdMaxCSDU | u_short | The negotiated bwdMaxCSDU for the SVC. Value is always equal to or smaller than the value specified in ATMIOC_REGISTER. See “The MaxCSDU Variables” |
blli | char | The blli value for the SVC. See “The BLLI Variable”. |
caller | struct | The ATM address of the calling party, as taken from the setup request. See “The atm_address_t Structure”. |
xmitcellrate | struct | The cellrate for the SVC. See “The cellrate_t Structure”. |
The atm_listen_t structure is described in Table 3-16. The atm_address_t and cellrate_t structures, and the MaxCSDU and blli variables are described in “Frequently Used Structures”.
Following is an example of the atm_listen_t structure, as defined in the sys/atm_user.h file:
typedef struct { int userHandle; int callHandle; u_short fwdMaxCSDU; u_short bwdMaxCSDU; char blli; atm_address_t caller; cellrate_t xmitcellrate; } atm_listen_t; |
The ATMIOC_MPSETUP ioctl() command is invoked by a calling party to cause the ATM signaling software to initiate an ATM UNI SETUP request message for the first party on a point-to-multipoint channel. No backward channel is created, so the device must be write-only. The application must block until the ATM driver replies, which it does when the SVC is either ready to use or has been refused. The driver puts the calling process to sleep until the call is complete or has been rejected. To maximize throughput, set the size for the VC's user protocol data units (CSPDUs) to MAX_CS_PDU.
When the remote endpoint accepts the connection request, the driver wakes the caller up and returns the negotiated traffic contract, which can be different (smaller) than what was specified in the call. Once open, the SVC is accessed by write() calls to the specified file descriptor. The file descriptor opened for the ATM device (fd_atm) should be writable only.
To add additional parties and drop individual parties on this SVC, use the ATMIOC_ADDPARTY and ATMIOC_DROPPARTY commands.
To tear down this SVC, the application uses the ATMIOC_DROPPARTY command for each party that has been added to the SVC. This causes the ATM signaling software to generate an ATM UNI DROPPARTY message for each party, until only one party remains, at which point a RELEASE message is generated. After the final party is dropped, the application can close the file descriptor.
![]() | Note: If the application closes the file descriptor without calling ATMIOC_DROPPARTY for each party, the software still smoothly releases and tears down the SVC. |
Use the following format:
ioctl (fd_atm, ATMIOC_MPSETUP, &mpsetup); |
fd_atm is a write-only file descriptor for the desired ATM hardware, and mpsetup is an atm_mpsetup_t structure.
The atm_mpsetup_t structure should be prepared as described in Table 3-17.
Table 3-17. Recommended Values for the Argument of the ATMIOC_MPSETUP Command
Field in atm_mpsetup_t | Type | Values |
---|---|---|
mpcallparams | struct | Call setup parameters for point-to-multipoint calls |
calledNumber | struct | |
callingNumber | struct | |
fwdCSDU | u_short | See “The MaxCSDU Variables”. Upon return, this field equals the out value. When the ioctl() returns successfully, this field contains the negotiated value, which may be smaller than the original value. |
fwdCellRate | struct | |
fwdQOS | char | See “The QoS Variables”. |
blliCount | char | 0-3. Number of BLLI values in blli[] field. When this count is set to zero, the software specifies BLLI_NULL (which is the same as setting blliCount=1 and blli[0]=BLLI_NULL). |
blli[3] | char | See “The BLLI Variable”. Upon return, this field is equal to the out value. blli[0] indicates the BLLI selected for this VCC, which can be any of the original selections. |
bearerClass | char | |
sscsType | char | Zero. Reserved for future use. |
bhli | char | Zero. Reserved for future use. |
partyHandle | int | A locally unique tag supplied by the program making this call. The handle is for identifying each party on an existing multipoint connection or connection request. User is responsible for ensuring that all its active tags are unique within its own evironment. This value is not used in any meaningful way by the ATM signaling software. |
reject | struct | See “The reject_reason_t Structure”. Upon failure, this field is equal to the out value, as follows. If the setup request fails to create an SVC, this structure contains the reason. A zero indicates that the failure occurred in the driver (before contacting the ATM signaling daemon). A nonzero value indicates that the failure or rejection occurred at the called endpoint or at an intermediate system. The cause field identifies the cause for the failure as described in Table C-2. |
If successful, ATMIOC_MPSETUP returns zero. The out values should be read.
When a failure occurs within the driver (before it has placed the request onto the network), the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”. Under this condition, the reject field is zero. When a failure is due to a negative response from the network, the ioctl() wakes the sleeping program and returns -1 with an EIO error stored in errno. The reject out value contains information about the network's reason for the failure, so it should be read.
When the ioctl() is successful, the calling party should check the values in the fwdMaxCSDU and blli[0] fields of the call's argument to discover the negotiated parameters. If the new values are acceptable, the calling party can start using the SVC. If the traffic contract is unacceptable (which really should not ever occur since the negotiated values are always lower), the application should close the file descriptor to close the connection. This action causes the IRIS ATM signaling subsystem to generate a RELEASE message.
When the ioctl() fails to create an SVC, the out value in the reject field of the argument contains one of the causes described in Table C-2. A reject field of zero indicates that the ioctl() failed within the driver (not due to a negative response from the network).
The atm_address_t, cellrate_t, and reject_reason_t structures, and the MaxCSDU, QOS, bearerClass, and blli variables are described in “Frequently Used Structures”.
Following is an example of the mpcallparams_t structure, as defined in the sys/atm_user.h file:
typedef struct { mpcallparams_t callparams; reject_reason_t reject; } atm_mpsetup_t; typedef struct { atm_address_t calledNumber; atm_address_t callingNumber; u_short fwdMaxCSDU; cellrate_t fwdCellRate; char fwdQOS; char blliCount; char blli[3]; char bearerClass; char sscsType; /* reserved*/ char bhli; /* reserved*/ int partyHandle; } mpcallparams_t; |
Possible errors include:
EFAULT | An error occurred when the ATM software attempted to read the call's argument. | |
EINTR | While waiting for a response from the switch, the driver was interrupted. The setup request cannot be completed. Try again. | |
EINVAL | The file descriptor was already bound (for example, with ATMIOC_CREATEPVC, ATMIOC_SETUP, ATMIOC_MPSETUP, or ATMIOC_ACCEPT) or the access mode (read or write) was incorrect. | |
EIO | The setup call was rejected by the network (an intermediate system) or by the called party. The reasons have been written into the reject field of the argument (which is a reject_reason_t structure). See “The reject_reason_t Structure”, and Table C-2. | |
ENODEV | The port was not in the up or down state or the port was not operational. | |
ENOSPC | The driver was not able to allocate a userHandle to the SVC. |
The ATMIOC_REGISTER ioctl() command is invoked by an application to inform the IRIS ATM signaling software that it is present and ready as a called party. The file descriptor must be open for read-write access. The application must block until the ATM driver replies, which it does when the SVC is either ready to use or has been refused. The driver puts the calling process to sleep until the software has completed the SVC registration. When the ATM subsystem replies to this ioctl(), the application should immediately call ATMIOC_LISTEN to retrieve the first queued connection request.
Each ATMIOC_REGISTER call defines a traffic contract. For each registered traffic contract, the ATM subsystem maintains a queue of incoming connection (SVC) setup requests. The ATM signaling software compares the registered traffic contracts to incoming connection setup request parameters. When the incoming values are higher than the registered values, the software negotiates down to the traffic contract. When the incoming values are equal to or smaller than the traffic contract, the software accepts the setup request and places it on the queue. This ioctl() fails if the specified traffic contract is currently registered.
When this ioctl() returns successfully, the ATM signaling software has created a queue of the length specified by the application and has started queuing incoming connection (ATM UNI SETUP) requests. As long as the file descriptor remains open, the ATM signaling software continues to queue requests.
When the application no longer accepts connection requests for this traffic contract, it simply closes the file descriptor. The ATM signaling software generates ATM UNI RELEASE messages for the unretrieved requests remaining in the queue, and stops accepting requests for the associated traffic contract. Once the file descriptor is closed, the application cannot retrieve any more of the queued connection requests.
Use the following format:
ioctl (fd_atm, ATMIOC_REGISTER, ®ister); |
fd_atm is a read-write file descriptor for the desired ATM hardware, and register is an atm_register_t structure.
The atm_register_t structure should be prepared as described in Table 3-18.
Table 3-18. Recommended Values for the Argument of the ATMIOC_REGISTER Command
Field in atm_register_t | Type | Values |
---|---|---|
fwdMaxCSDU | u_short | Upper limit for size of a CPCS-SDU on calling party's forward channel. This value is compared to the requested value on incoming setup requests. A request is queued when the incoming value is equal to or smaller than this value. See “The MaxCSDU Variables”. |
bwdMaxCSDU | u_short | Upper limit for size of a CPCS-SDU on calling party's backward channel. This value is compared to the requested value on incoming setup requests. A request is queued when the incoming value is equal to or smaller than this value. See “The MaxCSDU Variables”. |
listenQlength | short | Maximum number of incoming setup requests that can be queued for this traffic contract. |
blli | char | BLLI that is acceptable for these SVCs. When BLLI_ANY is specified, all incoming BLLI values are acceptable. See “The BLLI Variable”. |
sscsType | char | Zero. Reserved for future use. |
cause | int | Upon failure, this field is equal to the out value, as follows. If the register request fails to create an VCC, this field contains the reason. A zero indicates that the failure occurred in the driver (before contacting the ATM signaling daemon). A nonzero value indicates that the failure or rejection occurred at the network. The value identifies the cause for the failure as described in Table C-2. |
If successful, ATMIOC_REGISTER returns zero.
When a failure occurs within the driver, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”. When the error occurs within the driver, the cause field is zero. When a failure is due to a negative response from the network, the ioctl() wakes the sleeping program and returns -1 with an EIO error stored in errno. The cause out value should be read.
When the ioctl() fails to create a VCC for the party, the out value in the cause field of the argument contains one of the causes described in Table C-2. A cause field of zero indicates that the ioctl() failed within the driver (not due to a negative response from the network).
The MaxCSDU and blli variables are described in “Frequently Used Structures”.
Following is an example of the atm_register_t structure, as defined in the sys/atm_user.h file:
typedef struct { u_short fwdMaxCSDU; u_short bwdMaxCSDU; short listenQlength; /* Nmbr of outstndng reqs to queue */ char blli; char sscsType; /* reserved for future use */ int cause; /* if ioctl fails with EIO, cause contains */ /* a value from Table C-2 */ } atm_register_t; |
Possible errors include:
EFAULT | An error occurred when the ATM software attempted to read the call's argument. | |
EINVAL | The file descriptor was already bound (for example, with ATMIOC_CREATEPVC, ATMIOC_SETUP, ATMIOC_MPSETUP, or ATMIOC_ACCEPT) or the access mode (read or write) was incorrect or the listenQlength value was not valid. | |
EIO | The registration request was rejected, and the reason has been written into the cause field of the argument. See Table C-2, for a complete list of the possible values (causes). | |
ENOSPC | The driver was not able to allocate a userHandle to the SVC. | |
ENODEV | The port was not in the up or down state or the port was not operational. |
The ATMIOC_REJECT ioctl() command refuses a connection setup request (that has already been retrieved by ATMIOC_LISTEN) and indicates the reason for the rejection. (An ATMIOC_LISTEN ioctl() must have completed successfully before ATMIOC_REJECT can be invoked.) ATMIOC_REJECT is invoked on the same file descriptor as the ATMIOC_LISTEN call. This ioctl() causes the ATM signaling software to issue an ATM UNI RELEASE message.
The explanation for the rejection is given in the call's argument and can be any of the ATM UNI cause codes, summarized in Table C-2.
The program calling this ioctl() can retrieve the next request from the queue immediately.
![]() | Note: This ioctl() cannot be used to release an existing SVC or to stop queuing SVC requests onto a registered queue. To stop accepting SVC setup requests, an application must close the file descriptor associated with the ATMIOC_REGISTER. To clear an active SVC, the calling application closes the file descriptor associated with ATMIOC_SETUP. |
Use the following format:
ioctl (listen_fd_atm, ATMIOC_REJECT, &reject); |
listen_fd_atm is the same file descriptor used in the ATMIOC_LISTEN call, and reject is an atm_reject_t structure.
The atm_reject_t structure should be prepared as described in Table 3-19.
Table 3-19. Recommended Values for the Argument of the ATMIOC_REJECT Command
Field in atm_reject_t | Type | Values |
---|---|---|
callHandle | int | This value must be the out value from ATMIOC_LISTEN for this SVC. |
cause | int | The reason the application is rejecting the setup request. Can be any of the ATM UNI causes listed in Table C-2. |
If successful, ATMIOC_REJECT returns zero.
On failure, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”.
Following is an example of the atm_reject_t structure, as defined in the sys/atm_user.h file:
typedef struct { int callHandle; int cause; } atm_reject_t; |
Possible errors include:
EFAULT | An error occurred when the ATM software attempted to read the call's argument. | |
EINVAL | The supplied callHandle did not identify a registered queue or the ATM software discovered that the queue was empty. | |
ENODEV | The port was not in the up or down state or the port was not operational. |
The ATMIOC_SETUP ioctl() command is invoked by a calling party to set up a point-to-point SVC with traffic contract parameters specified in the call's argument. The application must block until the ATM driver replies, which it does when the SVC is either ready to use or has been refused. The driver puts the calling process to sleep until the call is complete or has been rejected.
This ioctl() causes the ATM signaling software to initiate an ATM UNI SETUP request message for creation of both a forward and a backward channel. To maximize throughput, set the size for the forward VC's user protocol data units (CSPDUs) to MAX_CS_PDU. When the remote endpoint accepts the connection request, the driver wakes the caller up and returns the negotiated traffic contract, which can be different (smaller) than what was specified in the call. Once open, the SVC is accessed by read() operations from and write() operations to the specified file descriptor. The file descriptor opened for the ATM device (fd_atm) should be readable and writable.[9]
To tear down this SVC, the application simply closes the file descriptor. This causes the ATM signaling software to generate an ATM UNI RELEASE message.
Use the following format:
ioctl (fd_atm, ATMIOC_SETUP, &setup); |
fd_atm is a read-write file descriptor for the desired ATM hardware and setup is an atm_setup_t structure.
The atm_setup_t structure should be prepared as described in Table 3-20.
Table 3-20. Recommended Values for the Argument of the ATMIOC_SETUP Command
Field in atm_setup_t | Recommended Value | Values |
---|---|---|
ppcallparams | struct | Call setup parameters for point-to-point calls |
calledNumber | struct | |
callingNumber | struct | |
fwdMaxCSDU | u_short | See “The MaxCSDU Variables”. Set to MAX_CS_PDU for optimal throughput. Upon return, this field equals the out value, as follows: When the ioctl() returns successfully, this field contains the negotiated value, which may be smaller than the original value. |
bwdMaxCSDU | u_short | See “The MaxCSDU Variables”. Upon return, this field equals the out value, as follows: When the ioctl() returns successfully, this field contains the negotiated value, which may be smaller than the original value. |
fwdCellRate | struct | |
bwdCellRate | struct | |
fwdQOS | char | See “The QoS Variables”. |
bwdQOS | char | See “The QoS Variables”. |
blliCount | char | 0-3. Number of BLLI values in blli[] field. When this count is set to zero, the software specifies BLLI_NULL (which is the same as setting blliCount=1 and blli[0]=BLLI_NULL). |
blli[3] | array of char | See “The BLLI Variable”. Upon return, this field equals the out value, as follows: When the ioctl() returns successfully, the first element (blli[0]) contains the negotiated value, which can be any one of the original values. |
bearerClass | char | |
sscsType | char | Zero. Reserved for future use. |
reject | struct | See “The reject_reason_t Structure”. Upon failure, this field equals the out value, as follows: If the setup request fails to create a SVC, this structure contains the reason. A zero indicates that the failure occurred in the driver (before contacting the ATM signaling daemon). A nonzero value indicates that the failure or rejection occurred at the called endpoint or at an intermediate system. The cause field identifies the cause for the failure as described in Table C-2. |
If successful, ATMIOC_SETUP returns zero. The out values should be read.
When a failure occurs within the driver (before it has placed the request onto the network), the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”. Under this condition, the reject field is zero. When a failure is due to a negative response from the network, the ioctl() wakes the sleeping program and returns -1 with an EIO error stored in errno. The reject out value contains information about the network's reason for the failure, so it should be read.
The calling party should check the values in the xxxMaxCSDU and blli[0] fields of the call's argument to discover the negotiated parameters. If the new values are acceptable, the calling party can start using the SVC. If the traffic contract is unacceptable (which really should not ever occur since the negotiated values are always lower), the application should close the file descriptor to close the connection. This action causes the IRIS ATM signaling subsystem to generate a RELEASE message.
When the ioctl() fails to create an SVC, the out value in the reject field of the argument contains one of the causes described in Table C-2. A reject field of zero indicates that the ioctl() failed within the driver (not due to a negative response from the network).
The atm_address_t, cellrate_t, and reject_reason_t structures, and the MaxCSDU, QOS, bearerClass, and blli variables are described in “Frequently Used Structures”.
Following is an example of the ppcallparams structure, as defined in the sys/atm_user.h file:
typedef struct { ppcallparams_t callparams; reject_reason_t reject; } atm_setup_t; typedef struct { atm_address_t calledNumber; atm_address_t callingNumber; u_short fwdMaxCSDU, bwdMaxCSDU; cellrate_t fwdCellRate,bwdCellRate; char fwdQOS, bwdQOS; char blliCount; char blli[3]; char bearerClass; char sscsType; /* reserved for future use */ char bhli; /* reserved for future use */ } ppcallparams_t; |
Possible errors include:
EFAULT | An error occurred when the ATM software attempted to read the call's argument. | |
EINTR | While waiting for a response from the switch, the driver was interrupted. The setup request cannot be completed. Try again. | |
EINVAL | The file descriptor was already bound (for example, with ATMIOC_CREATEPVC, ATMIOC_SETUP, ATMIOC_MPSETUP, or ATMIOC_ACCEPT) or the access mode (read or write) was incorrect. | |
EIO | The setup call was rejected by the network (an intermediate system) or by the called party. The reasons have been written into the reject field of the argument (which is a reject_reason_t structure). See “The reject_reason_t Structure”, and Table C-2. | |
ENODEV | The port was not in the up or down state or the port was not operational. | |
ENOSPC | The driver was not able to allocate a userHandle to the SVC. |