dn_comp()

The dn_comp() call compresses the expanded domain name.

Syntax

#include <types.h>
#include <netinet\in.h>
#include <arpa\nameser.h>
#include <resolv.h>
int dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr)
u_char *exp_dn;
u_char *comp_dn;
int length;
u_char **dnptrs;
u_char **lastdnptr;

Parameters

exp_dn

comp_dn length dnptrs lastdnptr

Description

The dn_comp() call compresses a domain name to conserve space. When compressing names, the client process must keep a record of suffixes that have appeared previously. The dn_comp() call compresses a full domain name by comparing suffixes to a list of previously used suffixes and removing the longest possible suffix.

The dn_comp() call compresses the domain name pointed to by the exp_dn parameter and stores it in the area pointed to by the comp_dn parameter. The dn_comp() call inserts labels into the message as the name is compressed. The dn_comp() call also maintains a list of pointers to the message labels and updates the list of label pointers.

The dn_comp() 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 dn_comp() call returns the size of the compressed domain name. When unsuccessful, the call returns a value of -1.

Related Calls


[Back: TCP/IP Network Utility Routines API]
[Next: dn_expand()]