ACSE/Presentation and ROSE Interface Programmer's Guide

54 Chapter 4
Programming Guide
3. Managing Data
3. Managing Data
ACSE/Presentation (A/P) defines two types of data: control data and user
data. Control data (cdata) is associated with the primitives and its
content is specific to each primitive. User data (ubuf) is managed by the
application and is defined by the context and transfer syntax selected.
Control Data
Control data is associated with the supported ACSE/Presentation
primitives and is managed by the A/P library. Control data is stored in
the cdata structure and consists of additional protocol information that
must be conveyed to the receiving process using the ap_snd() and
ap_rcv() calls. An example of a primitive that contains the cdata
structure is A_ASSOC_REQ which passes the proposed initial token
assignment to the responder.
For each A/P primitive, the specific information required for the
primitive is saved in its own cdata structure.
User Data
User data is managed by the application. User data must be encoded and
decoded by the application. The two applications or processes in an
association must agree to the presentation context used as previously
discussed. Refer to the ACSE/Presentation interface manpages for
information on encoding each primitive.
Multiple Sends and Receives of Data
If you decide to send a single primitive using multiple ap_snd() calls, or
the user data is too large to send in one buffer, you can set the AP_MORE
bit in the flags parameter to help assure complete receipt of the data by
the other process. Each additional ap_snd() call must use the same
sptype. The last ap_snd() call must reset the AP_MORE bit to indicate
the end of the data. For example: