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

X.25 Example Programs

To help you learn how to use the X.25 subroutines there are two pairs of example programs. One pair demonstrates the use of a switched virtual circuit, and the other the use of a permanent virtual circuit. The example programs are:

General information on using the examples includes:

Preparing, Compiling, and Running the Example Programs

The example programs (svcxmit.c, svcrcv.c, pvcxmit.c, and pvcrcv.c) are in the samples directory /usr/Licensed Program Product/sx25/samples.

Each of the example programs has variables to which values are assigned at the start. These include CALLING_ADDR, CALLED_ADDR, LINK_NAME, and LOG_CHAN_NUM. These must be set to appropriate values for your setup before you can run the programs.

To compile the example programs, enter:

cd /usr/"Licensed Program" Product/bosext2/x25app/samples
cc svcxmit.c -lx25s -o svcxmit
cc svcrcv.c -lx25s -o svcrcv
cc pvcxmit.c -lx25s -o pvcxmit
cc pvcrcv.c -lx25s -o pvcrcv

This creates the executable files svcxmit, svcrcv, pvcxmit, and pvcrcv.

To run a program, type the name of the executable file at the shell prompt. Run them in pairs: svcxmit talks to svcrcv, and pvcxmit talks to pvcrcv.

Note: You cannot run the PVC programs unless your network allows the use of permanent virtual circuits.

Using the Example Code

The example programs are for demonstration purposes only. When creating your own programs, you may find it useful to copy parts of the code from the examples. Be aware that the examples do not, in most cases, check the return codes from the subroutines. When you invoke an X.25 subroutine in a production program, you should assign the return value into a variable, as in the following:

rc = x25_...(...);

Then test the value of the return code.

If you do not want to write your own programs, use the xtalk command to communicate with other users.

[ Previous | Next | Contents | Search ]