Distributed Name Service (DNS) Management Programming Manual
DNS Programming Example, C
46958 Tandem Computers Incorporated H–23
/*--------------------*/
/* Get name to delete */
/*--------------------*/
dns_strtomem(¶m.zname, dnsname, ZDNS_VAL_DNSLEN);
/*---------------------------------------*/
/* Put the token into the request buffer */
/*---------------------------------------*/
if (status = SSPUT((short *) &req_buf
, (short *) &zdns_map_del_dnsobj
, (char *) ¶m))
return dns_return(spi_err, status);
/*-------------------------*/
/* Start a TMF transaction */
/*-------------------------*/
if (status = BEGINTRANSACTION())
return dns_return(tmf_err, status);
/*--------------------------------------*/
/* Send the request to the name manager */
/*--------------------------------------*/
result = dns_send(file_desc, &req_buf, &resp_buf, false);
if (result.err_class)
{
/*-------------------------------------------------------*/
/* Error during send; abort the transaction and return */
/*-------------------------------------------------------*/
ABORTTRANSACTION();
return result;
}
/*----------------------------------*/
/* Get RETCODE from response buffer */
/*----------------------------------*/
if (status = SSGETTKN((short *) &resp_buf
, ZSPI_TKN_RETCODE
, (char *) &retcode))
{
/*-----------------------------------------------------------*/
/* Error getting RETCODE; abort the transaction and return */
/*-----------------------------------------------------------*/
ABORTTRANSACTION();
return dns_return(spi_err, status);
}
if (retcode)
{