res_nmkupdate()--Construct an Update Packet
Syntax
#include <sys/types.h> #include <netinet/in.h> #include <arpa/nameser.h> #include <resolv.h> int res_nmkupdate(state* res, ns_updrec *update_record, unsigned char *buffer, int buffer_length)
Service Program Name: QSOSRV2
Default Public Authority: *USE
Threadsafe: Yes
The res_nmkupdate() function builds a dynamic update packet from the linked list of update records.
Parameters
- res
- (Input) The pointer to the state structure.
- update_record
- (Input) The pointer to the linked list of update records. See res_nupdate() for more information.
- buffer
- (Input) The pointer to the buffer to be filled in with the update
packet.
- buffer_length
- (Input) The length of the buffer.
Authorities
No authorization is required.
Return Value
res_nmkupdate() returns an integer. Possible values are:
- n (successful), where n is the actual size of the resulting update
packet.
- -1 (unsuccessful) An error occurred parsing a word or number in the rdata
portion of the update records.
- -2 (unsuccessful) The buffer was too small
- -3 (unsuccessful) The zone section is not the first section in the linked
list, or the section order has a problem. The section order is
ns_s_zn, ns_s_pr and ns_s_ud.
- -4 (unsuccessful) A number overflow occurred.
- -5 (unsuccessful) Unknown operation or no records found.
Error Conditions
When the res_nmkupdate() function fails, res_nmkupdate() can set errno to one of the following:
- [ECONVERT]
Either the input packet could not be translated to ASCII or the answer received could not be translated to the coded character set identifier (CCSID) currently in effect for the job.
- [EFAULT]
The system detected a pointer that was invalid while attempting to access an input pointer.
- [EINVAL]
One of the following reasons:
- An invalid length or NULL pointer was passed to res_nmkupdate()
- The res appears to be initialized but the reserved field is not set to zeros.
Note: No attempt is made to initialize the res structure if it was initialized previous to the res_nmkupdate() being issued.
- An invalid length or NULL pointer was passed to res_nmkupdate()
- [EMSGSIZE]
The message buffer was too small. The return value was -2.
Usage Notes
- res_nmkupdate() calls res_ninit() if the
res structure has not been initialized.
- res_nmkupdate() assumes that the data passed to it is EBCDIC and is in the default coded character set identifier (CCSID) currently in effect for the job. It translates the data from the default CCSID currently in effect for the job to ASCII (CCSID 819) before the data is sent out to a name server. The response that it receives from the name server is returned in the default CCSID currently in effect for the job.
Related Information
- res_nclose()--Close Socket and Reset res
Structure
- res_findzonecut()--Find the Enclosing Zone and
Servers
- res_hostalias()--Retrieve the host alias
- res_ninit()--Initialize res Structure
- res_nmkquery()--Place Domain Query in
Buffer
- res_nquery()--Send Domain Query
- res_nsearch()--Search for Domain Name
- res_nsend()--Send Buffered Domain Query
- res_nsendsigned()--Send Authenticated Domain
Query
- res_nupdate()--Build and Send Dynamic
Updates
- res_xlate()--Translate DNS Packets
API introduced: V5R1