ACC X.25 Protocol User's Guide
X.25 Application Programming
Programmatically Configuring X.25
Chapter 470
/*
Initialize the Physical Device type, poll, select and option words for the
X.25 link and insert them into the Physical Terminal Table.
*/
term_parms.pttype = 25; /* Must be 25 for an X.25 Link ZLU. */
term_parms.ptport = 1; /* We created this link on Port 1 */
term_parms.ptpoll = 0x9009; /* DTE, Enforced D-bit negotiation, 512 pkt size */
term_parms.ptselect = 0x01EA; /* K = 7, N2 = 10 */
term_parms.ptoption = 0x18; /* Set NTX and IRX bits */
if (rc = zcntl(&l2zlu, 1, ZCOM_MRQCODE_TERM, &term_parms, sizeof(term_parms), 0)) {
/* Handle Error */
}
/*
Now generate an X.25 Reconfiguration System Event Message (SEM) to inform
the ACC X.25 subsystem of the newly created X.25 link ZLU.
*/
cdata.header.config = ZCOM_ZCONFIG_CNTL; /* DSC Control Request */
cdata.header.action = 3; /* Broadcast Reconfiguration SEM. */
cdata.data.setctl.cfg_class = ZxCLASS_X25; /* X.25 was reconfigured. */
cdata.data.setctl.cfg_info1 = l2zlu.zlu; /* X.25 link ZLU added/deleted. */
if (rc = zconfig(&pzlu, 0, 0, &cdata, &rdata)) {
/* Handle error */
}
The X.25 link ZLU now exists in the run-time ZCOM subsystem and has
been properly configured for use. You should now configure any SVCs or
PVCs that are needed on this link.
Configuring X.25 Virtual Circuits
If the X.25 link ZLU is defined, you may dynamically create and
configure X.25 Virtual Circuit ZLUs. The primary information that is
typically modified programmatically is the poll, select and option words
of a Virtual Circuit. These are changed using the zcntl() routine with a
request code of Set Terminal Parameters, just as in the X.25 Link ZLU.
In addition, you may want to modify the ptcnfg field in the PTT which
may be used to restrict inbound calls to a specific X.121 address. This
will occur if you place an X.121 address into the ptcnfg field. See the
notes section in the zx25callout() man page for a description of the
address format to use.
The following code fragment provides an example of how to dynamically
create an X.25 Virtual Circuit ZLU (SVC) and to configure the various
X.25 VC related parameters. This example creates an X.25 two-way SVC
ZLU on port 1 on mux 2 (as defined in the currently loaded TTGEN
configuration):










