dn_comp()--Compress Domain Name


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

 int dn_comp(unsigned char *expanded_domain_name,
             unsigned char *compressed_domain_name,  
             int  answer_buffer_length,
             unsigned char **domain_name_pointers,
             unsigned char **last_domain_name)

  Service Program Name: QSOSRV2

  Default Public Authority: *USE

   Threadsafe: Yes

The dn_comp() function is used to compress an expanded domain name.


Authorities and Locks

None.


Parameters

expanded_domain_name
(Input) The pointer to the expanded domain name.

compressed_domain_name
(Output) The pointer to where the compressed domain name will be stored.

answer_buffer_length
(Input) The size of the compressed_domain_name buffer.

domain_name_pointers
(Input) The pointer to an array of pointers to previously compressed domain names in the current message.

last_domain_name
(Input) The pointer to the end of the array specified by domain_name_pointers.

Return Value

dn_comp() returns an integer. Possible values are:


Error Conditions

When the dn_comp() function fails, it does not set specific errno or h_errno values. An error occurs under the following conditions:


Usage Notes

  1. domain_name_pointers[0] points to the beginning of the DNS packet. The list of pointers ends with a NULL pointer. After domain_name_pointers[0] is initialized to the beginning of the packet and domain_name_pointers[1] is initialized to NULL, dn_comp() updates the list each time it is called.

  2. dn_comp() calls dn_find() to attempt to locate the different parts of the domain name being compressed.

  3. dn_comp() expects EBCDIC data as input. The output from dn_comp() is also EBCDIC.

Related Information



API introduced: V3R1
Top | UNIX-Type APIs | APIs by category