tfDnsUpdateDelete

Jump to: navigation, search

Table of Contents >> Application Reference >> Dynamic DNS Update


#include <trsocket.h>


int tfDnsUpdateDelete (
ttDnsUpdateHandle dnsUpdateHandle,
const char * domainNamePtr,
unsigned int rrType,
const char * dataPtr,
int dataLength,
int dataType
);


Function Description

Delete zero or more resource records with the specified domain name, record type and record data from the current zone. Each DNS update request must include at least one call to tfDnsUpdateAdd() or tfDnsUpdateDelete(). If you call tfDnsUpdateAdd() and/or tfDnsUpdateDelete() more than once per request, the DNS server will perform the updates in the order you made them.

The data at dataPtr can be provided in a convenient form (e.g. ASCII string), then encoded, as required by the server, prior to transmission. The incoming data format and the encoding algorithm are determined by the dataType parameter. See the Data Types section below.

Note Note: tfDnsUpdateDelete() simply appends the request into the descriptor without sending anything to the DNS server. When you have finished building your request, call tfDnsUpdateSend() to send the request.


Parameters

  • dnsUpdateHandle
    A DNS update descriptor handle returned by tfDnsUpdateOpen().
  • domainNamePtr
    The domain name to match (NUL terminated ASCII string, e.g. "www.example.com").
  • rrType
    The DNS resource record type to match (e.g. TM_DNS_RR_TYPE_A, TM_DNS_RR_TYPE_PTR). Specify TM_DNS_RR_TYPE_ANY to delete all resource records for the domain name specified.
  • dataPtr
    The resource record data to match. Specify NULL if there is no data to match.
  • dataLength
    If dataPtr is not NULL, this is the length of data at dataPtr. If dataPtr is a NUL terminated ASCII string, you can set dataLength to -1 (depending on dataType, see the Data Types section below).
  • dataType
    If dataPtr is not NULL, this specifies the type of data at dataPtr and how to encode the data in the outbound request message (see the Data Types section below).


Data Types

  • TM_DNS_UPDATE_DATA_BINARY
    Data at dataPtr is binary with length dataLength. The data will be sent without modification.
  • TM_DNS_UPDATE_DATA_DOMAIN
    Data at dataPtr is a domain name encoded as an ASCII string (e.g. "www.example.com"). The data will be converted to binary form before being sent (see RFC 1035 section 3.1). If dataLength is -1, the string must be NUL terminated and the length will be derived from the string length.
  • TM_DNS_UPDATE_DATA_IPV4
    Data at dataPtr is an IPv4 address encoded as an ASCII string (e.g. "192.168.1.20"). The data will be converted to a 32-bit binary value before being sent. If dataLength is -1, the string must be NUL terminated and the length will be derived from the string length.
  • TM_DNS_UPDATE_DATA_IPV6
    Data at dataPtr is an IPv6 address encoded as an ASCII string (e.g. "2001:db8::6f"). The data will be converted to a 128-bit binary value before being sent. If dataLength is -1, the string must be NUL terminated and the length will be derived from the string length.
  • TM_DNS_UPDATE_DATA_TEXT
    Data at dataPtr is plain text encoded as an ASCII string (e.g. "Hello World!"). The data will be encoded as a character-string (prefixed with a single length byte: see RFC 1035 section 3.3). If dataLength is -1, the string must be NUL terminated and the length will be derived from the string length.


Returns

  • TM_ENOERROR
    Success.
  • TM_EINVAL
    Invalid descriptor handle, domain name, or resource record type.
  • TM_EPERM
    Cannot change the descriptor while tfDnsUpdateSend() is in progress.
  • TM_ENOBUFS
    Insufficient memory.


Table of Contents >> Application Reference >> Dynamic DNS Update