The res_mkquery() call makes a query message for the name servers in the internet domain.
Syntax
#include <types.h>
#include <netinet\in.h>
#include <arpa\nameser.h>
#include <resolv.h>
int res_mkquery(op, dname, class, type, data, datalen, newrr,
buf, buflen)
int op;
char *dname;
int class;
int type;
char *data;
int datalen;
struct rrec *newrr;
char *buf;
int buflen;
Parameters
op
C_IN
T_A
Description
This call creates packets for name servers in the internet domain. The call makes a query message for the name servers and puts that query message in the location pointed to by the buf parameter.
The res_mkquery() call is one of a group of calls that form the resolver. The resolver is a set of functions that perform a translation between domain names and network addresses. Global information used by the resolver calls resides in the _res data structure. The <RESOLV.H> file contains the _res data structure definition. (See The _res Data Structure for more on the _res data structure.)
Return Values
When successful, the res_mkquery() call returns the size of the query. When the query is larger than the value of buflen, the call fails and returns a value of -1.
Related Calls
dn_comp() dn_expand()
dn_find()
dn_skipname()
putlong()
putshort()
res_init()
res_query()
res_search()
res_send()