X.25 API Developers Toolkit for CorLink X.25
CorLink X.25 is an X.25 protocol communications package developed by Corman
Technologies Inc. With CorLink X.25 data transfer between QNX networks, remote users, and
X.25 Packet Switching Data Networks becomes easy.
A major application of CorLink X.25 is in transaction processing. In most transaction
processing environments, several remote processes need to communicate with a local host,
often using X.25 communications. CorLink X.25 supports these applications with an
Application Programmer's Interface (API) Toolkit. The CorLink X.25 API Toolkit allows your
application to manage multiple incoming and outgoing calls simultaneously.
As a developer, you can easily integrate X.25 communications into your application by
combining a run-time version of CorLink X.25 with your application program.
Uses of CorLink X.25 API in Transaction Processing
- Credit Card Verification
- Database Access
- Airline Ticket Reservations
- Remote Process Monitoring
- Financial Transaction Processing
Do You Need the CorLink X.25 API Toolkit?
The standard CorLink X.25 gateway software package consists of two main applications:
HOST and ITI (Interactive Terminal Interface). With these two applications, you can
connect to and communicate over X.25 networks worldwide. The applications allow you to
share all available X.25 circuits as they are needed.
HOST
The CorLink X.25 HOST program allows remote users to log into your QNX Network through
the standard device interface.
ITI
The CorLink X.25 ITI (Interactive Terminal Interface) program acts as a Packet
Assembler/Disassembler (PAD) to allow you to make outgoing calls. Like HOST this is also
accomplished through the standard device interface.
Both HOST and ITI use the standard QNX device interface. You can write simple X.25
applications using the standard device interface to HOST or ITI. To gain full access to
the power of X.25, however, your application needs to use the CorLink X.25 API to access
X.25 communication functions.
Using the CorLink X.25 API Toolkit, you can build complete X.25 support into your QNX
application quickly and easily. The CorLink X.25 library is linked with your application,
allowing you to perform all X.25 communications procedures through simple function calls.
You can support any number of X.25 circuits in your application without consuming limited
system resources such as file descriptors or process slots.
Features of the CorLink X.25 API Toolkit
Working sample application programs provide examples of commonly-used CorLink X.25
functions.
These examples provide you with a basis from which to develop your applications.
-
The trace facilities allow you to obtain full X.25 packet level and HDLC link level
trace data.
This can help you quickly track down problems on your X.25 link.
-
Detailed documentation explains all functions, includes helpful notes regarding possible
exception conditions, and provides code samples to demonstrate how to use each function.
This documentation should answer most X.25 development questions you may have.
-
The API provides two interfaces: a synchronous interface where your process remains
blocked until the requested action is completed, and an asynchronous event-driven
interface using QNX proxies.
The asynchronous interface allows your application to perform other functions while
waiting for X.25 communications. It also allows you to manage multiple X.25 virtual
circuits within a single process.
-
Virtual circuits can be shared among multiple processes to allow for distributed
functionality.
This enables you to take full advantage of the multi-tasking nature of QNX in the
design of your application.
-
The CorLink X.25 API Toolkit includes all required data structures, constants, and
prototypes.
This simplifies your program development and ensures that the compiler will warn you
about any incorrect function calls.
The CorLink X.25 API Toolkit Contents:
-
CorLink X.25 Plus package (including support for 254 virtual circuits, transmission
speeds of up to 2,048,000 baud, HOST, ITI, and all support processes)
-
CorLink X.25 Watcom C function library (small, compact, medium, large, and 32-bit memory
models)
- Sample Application Programs
- Test Program
- API Developer's Manual
- Six Months Premium Technical Development Support
System Requirements
QNX 4.21 or later
2M RAM
EiconCard
Select API Functions
This is an overview of some basic API functions commonly used for X.25 communications.
x25call() - Sends a call request to establish a session
x25listen() - Sets up a listen request to accept an incoming call request
x25hangup() - Terminates an X.25 session
x25send() - Sends data on an established session
x25receive() - Receives data on an established session
x25done() - Get return code and optional return data for an asynchronous call made
earlier. Usually called in response to a proxy trigger indicating the completion of an
earlier function call
x25errormsg() - Returns printable error message for any CorLink X25 library error code
There are many additional functions. All functions are described in detail in the
CorLink X.25 API Toolkit Developer's Manual.
Sample CorLink X.25 API Application
This program establishes an X.25 session, sends text entered at the keyboard, and
terminates the session when the user types 'quit'.
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <stdarg.h>
#include <sys/types.h>
#include "/corlinkx25/toolkit/clx25lib.h"
int main( int argc, char **argv )
{
char buf[80]; /* Keyboard input buffer */
short err; /* Return code from X.25 function calls */
short unsigned cid; /* Circuit ID for our X.25 virtual circuit */
/* The X.25 address to call must be supplied on the command line */
if ( argc !=2 ) {
printf ( "Use: %s <address>\n", argv[0] );
exit( -1 );
}
/* Initialize the CorLink X.25 library */
err = x25init( "x25admin", X25_NAME_GLOBAL, NULL, NULL );
if ( err !=X25_OK ) {
printf( "Cannot initialize X.25 library: %s\n", x25errormsg( err ) );
exit( -1 );
}
/* Initiate call to set up an X.25 virtual circuit */
err = x25call( 0, X25_WAIT, X25_NO_PROXY, argv[1], NULL, &cid );
if ( err !=X25_OK ) {
printf( "Call to %s failed: %s\n", argv[1], x25errormsg( err ) );
x25exit( 0 );
exit( -1 );
}
printf( "Call initiated successfully: CID = %u\n", cid );
printf( "Now enter data to transmit (type 'quit' to exit).\n" );
/* Loop to accept input and send it to the remote */
do {
buf[0] = sizeof( buf ) - 2;
cgets( buf );
err = x25send( cid, X25_WAIT, X25_NO_PROXY, 0, buf[1], &buf[2] );
if ( err !=X25_OK )
printf( "Send data error: %s\n", x25errormsg( err ) );
} while ( strncmp( &buf[2], "quit", 4 ) );
/* Hang up to terminate the X.25 virtual circuit */
err = x25hangup( cid, X25_WAIT, X25_NO_PROXY, NULL );
if ( err )
printf( "Hangup error: %s\n", x25errormsg( err ) );
x25exit( 0 ); /* Terminate library */
return( 0 );
}
Catalogue entry
|