dn_expand() — Resolver domain name expansion

Standards

Standards / Extensions C or C++ Dependencies

BSD 4.3

both OS/390 V2R8

Format

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

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

General description

The dn_expand() function expands the compressed domain name comp_dn to a full domain name. The compressed name is contained in a query or reply message; msg is a pointer to the beginning of the message. The expanded name is placed in the buffer indicated by exp_dn which is of size length. The size of the expanded name is returned or -1 if there was an error.

Note: The dn_expand() function has a dependency on the level of the Enhanced ASCII Extensions. See Enhanced ASCII support for details.

Returned value

If successful, dn_expand() returns the size of the expanded name.

If unsuccessful, dn_expand() returns -1 to report the error, when the name to be expanded was not found before the end of the buffer was reached.

There are no documented errno values.

Related information