ACC X.25 Protocol User's Guide
Chapter 4 73
X.25 Application Programming
Sending and Receiving Data
Sending and Receiving Data
Before you can send to or receive data from an X.25 Virtual Circuit, the
X.25 Link must be up, the VC ZLU must be enabled and activated, and
in the case of an SVC, a call must be established. The zcntl() routine i s
used to enable and activate the VC ZLU and the ACC X.25 API routines
are used to establish a call on an SVC. Once these conditions are met,
you may send data using the zsend() routine and read data that has
arrived on t he application’s program ZLU using the zread() routine. Note
that before inbound data from a VC ZLU is delivered to an application’s
program ZLU, you must cal l the zset_rcvr() routine for each and every VC
ZLU whose inbound data is to be delivered to the application.
All application data is transmitted (or received) as the data field of a
data packet contained within t he I-field of an information frame. All
level 2 and level 3 p rotocol h eaders and/or trailers are transparently
suppliedbytheprotocolforoutgoingmessagesandremovedbythe
protocol for incoming messages. Only the actual data to be transferred is
dealt with by the application program.
When reading inbound data from the application’ s program ZLU queue,
care must be taken to examine the type of data that has arrived. The
zread() routine returns the ZCOM message header and the message data
buffer. The message header contains information on which VC ZLU the
data came from and what type of data the message represents. Note that
the message could contain inbound data from t he VC ZLU, unsolicited
status information, or buffer completion status from a previous zsend()
call. The following example shows how to enable a VC, s etup the VC’s
receiver for inbound data, read a data message and interpret its
meaning:










