tfDnsUpdateOpen

Jump to: navigation, search

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


#include <trsocket.h>


ttDnsUpdateHandle tfDnsUpdateOpen (
const struct sockaddr_storage * serverAddrPtr,
int protocol,
int * errorPtr
);


Function Description

Create a descriptor for building and sending DNS update requests. A handle to the new descriptor is returned that you can then use with other DNS update functions. The descriptor represents a single session with a DNS server. Multiple update requests can be built and sent with the same descriptor, as long as the server is authoritative for the zones being updated. When you are finished, call tfDnsUpdateClose() to dispose of the descriptor.


Parameters

  • serverAddrPtr
    The destination IP address and port number to which the DNS update request will be sent. This must be the address of a DNS server that has the authority to update the master file for the zone you want to update, or can forward the request to an authoritative server. Set the port number to zero to use the default DNS service port (53).
  • protocol
    Select the transport protocol to use: IPPROTO_UDP, IPPROTO_TCP, or 0 for the default (IPPROTO_UDP).
  • errorPtr
    A pointer to a variable to receive the error code. This can be set to NULL if you do not wish to receive the error code.


Returns

  • ttDnsUpdateHandle
    If successful, a handle to a new DNS update descriptor is returned. If unsuccessful, TM_DNS_UPDATE_INVALID_HANDLE is returned.

    *errorPtr is set to one of the following codes:

  • TM_ENOERROR
    Success.
  • TM_EINVAL
    serverAddrPtr is NULL or the contents are incomplete or protocol is not as specified above.
  • TM_EPROTONOSUPPORT
    The specified protocol is not supported (e.g. IPPROTO_TCP specified and TM_DISABLE_TCP is defined).
  • TM_ENOBUFS
    Not enough memory.


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