[ Previous | Next | Contents | Search ]
AIXLink/X.25 1.1 for AIX: Guide and Reference

x25_pvc_alloc Subroutine

Purpose

Allocates a permanent virtual circuit (PVC) for use by an application.

Library

X.25 Communications Library (libx25s.a)

C Syntax

int x25_pvc_alloc(pvc_ptr, ctr_id)
struct cb_pvc_alloc_struct *pvc_ptr;
int ctr_id;

Description

The x25_pvc_alloc subroutine reserves the use of the specified permanent virtual circuit (PVC) for an application.

Parameters

pvc_ptr Contains a pointer to the cb_pvc_alloc_struct structure, which contains the name of the X.25 port and the logical channel number of the PVC to be used. Together, the port and the logical number, identify the PVC.
ctr_id Identifies a counter allocated by a previous x25_ctr_get subroutine.

Return Values

If successful, the x25_pvc_alloc subroutine returns the connection identifier to be used by other subroutines. If an error occurs, the x25_pvc_alloc subroutine returns a value of -1 and sets the x25_errno global variable to one of the error codes shown below.

Error Codes

On failure, the x25_errno global variable is set to one of the following:

X25INVCTR

X25NOCARD

X25NOLINK

X25NOSUCHLINK

X25NOTINIT

X25NOTPVC

X25PVCUSED

X25SYSERR

If the x25_errno global variable is set to the X25SYSERR value, the errno global variable is set to one of the following values:

EINTR

EIO

Examples

The example program, pvcxmit, illustrates code statements that allocate a PVC.

Implementation Specifics

This subroutine is part of X.25 Application in Base Operating System (BOS) Extensions 2.

Related Information

The x25_pvc_free subroutine.

Processing Calls with the X.25 API, Using the X.25 Structures and Flags, in AIX Version 4.3 Communications Programming Concepts.


[ Previous | Next | Contents | Search ]