dn_expand()

expand a compressed Internet domain name

Synopsis:

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

int dn_expand( const u_char *msg, 
               const u_char *eomorig, 
               const u_char *comp_dn, 
               u_char *exp_dn, 
               int length );

Description:

The dn_expand() function is a low-level routine used by res_query() to expand the compressed domain name, comp_dn, to a full domain name.

The compressed name is contained in a query or reply message; msg is a pointer to the beginning of the message. The eomorig argument is a pointer to the first location after the message.

The uncompressed name is placed in the buffer indicated by exp_dn; the size of the buffer is specified by length.

Returns:

The size of the compressed domain name, in bytes, or -1 if an error occurred.

Classification:

UNIX

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

dn_comp(), gethostbyname(), res_init() res_mkquery(), res_query(), res_search(), res_send()

/etc/resolv.conf, hostname, named in the TCP/IP User's Guide

RFC 1032, RFC 1033, RFC 1034, RFC 1035, RFC 974