Chapter Contents

Previous

Next
res_send

res_send



Sends a Query

Portability: UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
IMPLEMENTATION
RELATED FUNCTIONS


SYNOPSIS

#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>

int res_send(char *msg, int msglen, char *answer, int anslen);


DESCRIPTION

res_send sends a query msg to name servers and returns an answer. msglen is the length of the query. answer is an area where the answer to the query can be stored. anslen is the length of the answer buffer.

This routine implements a part of the resolver, which is a set of routines providing a programming interface for communications with Internet name servers.

For information on buffer formats for Internet name servers, refer to Chapter 20, "The Domain Name System," in Internetworking with TCP/IP.

bitfield(1) option is required for this routine.


RETURN VALUE

If successful, res_send returns the size of the answer. It returns a -1 if there were errors.


IMPLEMENTATION

The SAS/C version of res_send is a direct port from the BSD UNIX Socket Library.


RELATED FUNCTIONS

dn_expand , res_init , res_mkquery


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.