dn_find()--Search for Compressed Domain Name
Syntax
#include <sys/types.h> #include <netinet/in.h> #include <arpa/nameser.h> #include <resolv.h> int dn_find(unsigned char *expanded_domain_name, unsigned char *message_pointer, unsigned char **domain_name_pointers, unsigned char **last_domain_name)
Service Program Name: QSOSRV2
Default Public Authority: *USE
Threadsafe: Yes
The dn_find() function is used to search for an expanded domain name in a list of compressed domain names.
Authorities and Locks
None.
Parameters
- expanded_domain_name
- (Input) The pointer to the expanded domain name.
- message_pointer_name
- (Input) A pointer to the DNS packet that contains the compressed names
pointed to by the elements of domain_name_pointers.
- domain_name_pointers
- (Input) The pointer to an array of pointers to previously compressed names
in the current message.
- last_domain_name
- (Input) The pointer to the end of the array of domain_name_pointers.
Return Value
dn_find() returns an integer. Possible values are:
- -1 (unsuccessful)
- n (successful), where n is an offset into the message_pointer where domain name was found.
Error Conditions
When the dn_find() function fails, it does not set specific errno or h_errno values. An error occurs under the following conditions:
- NULL pointer(s) passed to the function.
- Invalid pointer(s) passed to the function.
- Expanded domain name not found in the DNS packet.
Usage Notes
- dn_find() locates an expanded name in an array of previously
compressed names.
- Usually dn_find() is called from dn_comp() but can be
called directly.
- dn_find() expects EBCDIC data as input.
Related Information
- dn_expand()--Expand Domain Name
- dn_comp()--Compress Domain Name
- dn_skipname()--Skip over Compressed Domain Name
API introduced: V3R1