Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/d/dn_comp.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/d/dn_comp.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/d/dn_comp.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/d/dn_comp.html on line 8

dn_comp()

Compress an Internet domain name

Synopsis:

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

int dn_comp( const char * exp_dn,
             u_char * comp_dn,
             int length, 
             u_char ** dnptrs,
             u_char ** lastdnptr );

Arguments:

exp_dn
The Internet domain name you want to compress.
comp_dn
A buffer where the function can store the compressed name.
length
The size of the array that comp_dn points to.
dnptrs
NULL, or an array of pointers to previously compressed names in the current message; see below.
lastdnptr
NULL, or the limit of the array specified by dnptrs.

Library:

libsocket

Use the -l socket option to qcc to link against this library.

Description:

The dn_comp() routine is a low-level routine used by res_query() to compress an Internet domain name. This routine compresses the domain name exp_dn and stores it in comp_dn.

The compression uses an array of pointers, dnptrs, to previously compressed names in the current message. The first pointer points to the beginning of the message and the list ends with NULL. The limit to the array is specified by lastdnptr. As a side effect, dn_comp() updates the list of pointers for labels inserted into the message as the name is compressed. If dnptrs is NULL, names aren't compressed. If lastdnptr is NULL, the list of labels isn't updated.

Returns:

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

Classification:

Unix

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

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

/etc/resolv.conf, hostname in the Utilities Reference

Based on RFC 974, RFC 1032, RFC 1033, RFC 1034, RFC 1035


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/d/dn_comp.html on line 164

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/d/dn_comp.html on line 164