tfDnsUpdateSend

Jump to: navigation, search

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


#include <trsocket.h>


int tfDnsUpdateSend (ttDnsUpdateHandle dnsUpdateHandle);


Function Description

Send a DNS update request. This call begins a stateful period during which other calls will be prevented from modifying the descriptor. Retransmissions may occur if using UDP. The send completes when a valid response is received or the send times out based on the TM_DNS_OPTION_RETRIES and TM_DNS_OPTION_TIMEOUT values that are set via tfDnsSetOption(). At least one call to tfDnsUpdateAdd() or tfDnsUpdateDelete() must be made prior to calling tfDnsUpdateSend().

If blocking mode is used (see tfDnsInit()), tfDnsUpdateSend() will return when the send is complete (as defined above). Pend and post operations control event synchronization between the receive task, the timer task and the task that called tfDnsUpdateSend().

If non-blocking mode is used, the send processing is split between tfDnsUpdateSend() and tfDnsUpdateExecute(). If tfDnsUpdateSend() returns TM_EWOULDBLOCK, you must call tfDnsUpdateExecute() periodically until the return code is something other than TM_EWOULDBLOCK.

When the send completes, all the prerequisite conditions and updates (adds and deletes) are cleared from the descriptor. If the send did not end with a fatal error, such as connection reset, you are free to build and send a new request with the same descriptor. You can even revise and resend a request after the DNS server indicated that a prerequisite failed.


Parameters

  • dnsUpdateHandle
    A DNS update descriptor handle returned by tfDnsUpdateOpen().


Returns

  • TM_ENOERROR
    Success. The zone master file has been updated as requested.
  • TM_EWOULDBLOCK
    The update is in progress, call tfDnsUpdateExecute() periodically to service the operation. (Non-blocking mode only. See tfDnsInit().)
  • TM_EINVAL
    Invalid descriptor handle.
  • TM_EPERM
    A call to tfDnsUpdateSend() is already in progress.
  • TM_ENOBUFS
    Insufficient memory.
  • TM_ETIMEDOUT
    Timed out waiting for a response from the server. See tfDnsSetOption(), options TM_DNS_OPTION_RETRIES and TM_DNS_OPTION_TIMEOUT.
  • TM_ECONNREFUSED
    The server rejected the connection. This usually indicates that the remote host not listening on the port.
  • TM_ESHUTDOWN
    The server closed the connection (TCP only).
  • TM_ECONNRESET
    The server reset the connection (TCP only).
  • TM_DNS_EFORMAT
    The name server was unable to interpret the request due to a format error.
  • TM_DNS_ESERVER
    The name server encountered an internal failure while processing this request, for example an operating system error or a forwarding timeout.
  • TM_DNS_ENXDOMAIN
    Non-existent domain. Some name that ought to exist, does not exist.
  • TM_DNS_ENOT_IMPLEM
    The name server does not support the specified opcode.
  • TM_DNS_EREFUSED
    The name server refuses to perform the specified operation for policy or security reasons.
  • TM_DNS_EYXDOMAIN
    Some name that ought not to exist, does exist.
  • TM_DNS_EYXRRSET
    Some RRset that ought not to exist, does exist.
  • TM_DNS_ENXRRSET
    Some RRset that ought to exist, does not exist.
  • TM_DNS_ENOTAUTH
    The server is not authoritative for the zone named in the Zone Section of the request.
  • TM_DNS_ENOTZONE
    A name used in the Prerequisite or Update Section of the request is not within the zone denoted by the Zone Section.
  • (more)
    Other socket errors are possible. See sendto() and recvfrom() for UDP, or send(), recv() and connect() for TCP.


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