dn_expand()--Expand Domain Name


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

 int dn_expand(unsigned char *message_pointer,
               unsigned char *end_of_message,
               unsigned char *compressed_domain_name,
               unsigned char *expanded_domain_name,
               int  answer_buffer_length)

  Service Program Name: QSOSRV2

  Default Public Authority: *USE

  Threadsafe: Yes

The dn_expand() function is used to expand a compressed domain name.


Authorities and Locks

None.


Parameters

message_pointer
(Input) The pointer to the beginning of a DNS packet.

end_of_message
(Input) The pointer to the end of the DNS packet.

compressed_domain_name
(Input) The pointer to the compressed domain name within the DNS packet.

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

answer_buffer_length
(Input) The size of the expanded_domain_name buffer.

Return Value

dn_expand() returns an integer. Possible values are:


Error Conditions

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


Usage Notes

  1. The compressed domain name size is returned rather than the expanded domain name size because it is used to parse through the DNS packet.

  2. dn_expand() uses end_of_message to insure that it doesn't run past the end of the DNS packet.

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

Related Information



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