Distributed Name Service (DNS) Management Programming Manual

Using SPI to Build Commands and Decode Responses
SPI Programming Considerations for DNS
46958 Tandem Computers Incorporated 3–7
Receiving and Decoding a
Response Message
The following is a summary of the steps your application must take to receive and
decode a response message:
1. Declare a buffer of appropriate size.
2. Read the response message, using the mechanism appropriate to your
programming language (for example, a WRITEREAD call in TAL).
3. Call SSGET or SSGETTKN to retrieve the values of header tokens and other tokens
from the buffer.
4. On encountering the data-list token (ZSPI-TKN-DATALIST) or the error-list token
(ZSPI-TKN-ERRLIST), make another call to SSGET or SSGETTKN to retrieve the
tokens inside the data list or error list.
5. On encountering a context token (ZSPI-TKN-CONTEXT), finish reading the other
tokens in the buffer. Then, optionally, use SSMOVE or SSMOVETKN to copy the
context token into the command buffer, and resend the command to get the next
message in the response.
6. Take action appropriate to the information in the response.
The DNS subsystem returns multiple response records in its responses to some
commands, as described in the Distributed Systems Management (DSM) Programming
Manual.
Commands that update the DNS database return no response tokens other ZSPI-
TKN-RETCODE, ZSPI-TKN-OBJNAME (the name that was updated), and error lists.
The INFO, LISTOPENS, and STATUS commands allow multiple responses to be
returned in a single response buffer. These Inquiry commands return response tokens
in addition to ZSPI-TKN-RETCODE error lists, and they allow responses to be
continued over several buffers.