Chapter Contents

Previous

Next
dn_expand

dn_expand



Expands Compressed Domain Names

Portability: UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
PORTABILITY
IMPLEMENTATION
RELATED FUNCTIONS


SYNOPSIS

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

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


DESCRIPTION

dn_expand expands the compressed domain name to a full domain name. Expanded names are converted to uppercase EBCDIC.

msg
is a pointer to the beginning of the domain name message that contains the name to be expanded.

eonmorig
is an end-of-message limit pointer beyond which the expansion cannot go.

comp_dn
is a pointer to the first byte of the compressed name.

exp_dn
is a pointer to a buffer of size length that receives the expanded domain name.

dn_expand is part of the resolver. The resolver is a set of routines that provide a programming interface for communicating with Internet name servers. dn_expand translates domain names from the compressed format used by name servers to conventional character string format. In the interests of greater portability, the SAS/C version of dn_expand performs ASCII-to-EBCDIC translation of exp_dn .

For information on the UNIX programming interface and Internet name servers, refer to "The Domain Name System" and "The Socket Interface" in Internetworking with TCP/IP, Volume I.


RETURN VALUE

If successful, dn_expand returns the size of the compressed domain name. Otherwise, it returns a -1 , and sets errno to indicate the type of error.


PORTABILITY

dn_expand is available on most versions of the UNIX operating system.


IMPLEMENTATION

The SAS/C version of dn_expand is a direct port from the BSD UNIX Socket Library. The ASCII-to-EBCDIC translation feature is the only change.


RELATED FUNCTIONS

dn_comp , res_mkquery


Chapter Contents

Previous

Next

Top of Page

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