PAM Programming Manual
PAM Programming Manual—142482
B-1
B
Link-Level Programming Examples
This appendix presents annotated programming examples coded in TAL, C, and Pascal.
Sample TAL Calling Sequences
The discussions that follow present TAL coding examples illustrating the major
functional parts of a link-level application. In this sample exercise, the test program
communicates with a node in an attached LAN by way of a PORT. Once the PORT has
been OPENed, the application program communicates with the link-level interface by
sending and receiving SDUs. Refer to the TAL Reference Manual for detailed
information on the conventions used in this example.
Data Definitions
The coding example assumes the presence of the following data definitions:
--/---------------------------------------------------------------/
-- L2 Service Access Point Exercise Program: Definitions
--/---------------------------------------------------------------/
-- Hard Coded Limits
--/---------------------------------------------------------------/
LITERAL Max^Req^Size^B = 32000;
LITERAL Max^User^Data^Size^B = ( Max^Req^Size^B
- $Len ( ZL2S^DDL^Aggr^SDU^Hdr^Def )
- $Len ( ZL2S^DDL^Enet^SDU^Hdr^Def ) );
LITERAL Max^NoWait^Depth = 5;
LITERAL False = 0;
LITERAL True = 1;
STRUCT Buffer^Lst^Entry^Template (*);
BEGIN
INT in^use^flag;
INT user^data^size^b;
INT test^char;
STRING buffer [0:( Max^Req^Size^B - 1 )];
END;