Distributed Name Service (DNS) Management Programming Manual

Using SPI to Build Commands and Decode Responses
SPI Programming Considerations for DNS
3–6 46958 Tandem Computers Incorporated
Building and Sending a
Command Message
The following is a summary of the steps your application must take to build and send
a command message:
1. Declare a buffer of appropriate size.
The recommended buffer size for all commands sent to the DNS subsystem is
ZDNS-VAL-BUFLEN (4196 bytes). The maximum buffer size that DNS accepts is
ZDNS-VAL-MAXBUF (1000 bytes). The minimum buffer size that DNS accepts is
ZDNS-VAL-MINBUF (612 bytes).
For sending commands, the size of the buffer you select must be passed as a
parameter to SSINIT. You must also allocate a buffer of the chosen size in the
program’s data space or in an extended data segment.
2. Call the SSINIT procedure to initialize the command buffer. SSINIT sets the
values of certain header tokens, including the command, the object type, and the
target subsystem ID.
3. Call SSNULL to initialize each extensible structured token to be used in the
command.
4. Call SSPUT or SSPUTTKN to place the appropriate tokens in the buffer.
5. If you are resending a command to retrieve the next response message in a series,
call SSMOVE or SSMOVETKN to move the context token from the previous
response buffer into the command buffer.
6. Send the command message using the mechanism appropriate to your
programming language (for example, a WRITEREAD call in TAL).
The DNS subsystem does not support multiple commands in a single request
message. However, some DNS commands accept a wild-card character (“*”), which is
an implicit way to specify more than one object in a command. For DNS, you can use
the wild-card character with the ADD, ALTER, and INFO commands only.
Caution An extensible structured token that appears in a command should always be initialized using the SPI
procedure SSNULL. Doing this ensures every field of the token is initialized to its null value. This is
important because an operation will be performed if a field contains a value other than its null value.
Using SSNULL is important even when your application assigns a value to every field of an extensible
structured token. Otherwise, the application will not work correctly later if it is compiled with a new version
of the definition files that add new fields to the token.