1VAL_GETHOSTBYNAME(1)  User Contributed Perl Documentation VAL_GETHOSTBYNAME(1)
2
3
4

NAME

6       val_gethostbyname(), val_gethostbyname2(), val_gethostbyname_r(),
7       val_gethostbyname2_r() - get DNSSEC-validated network host entry
8

SYNOPSIS

10         #include <validator.h>
11
12         extern int h_errno;
13         struct hostent *val_gethostbyname(const val_context_t *ctx,
14                                           const char *name,
15                                           val_status_t *val_status);
16
17         struct hostent *val_gethostbyname2(const val_context_t *ctx,
18                                            const char *name,
19                                            int af,
20                                            val_status_t *val_status);
21
22         int val_gethostbyname_r(const val_context_t *ctx,
23                                 const char *name,
24                                 struct hostent *ret,
25                                 char *buf,
26                                 size_t buflen,
27                                 struct hostent **result,
28                                 int *h_errnop,
29                                 val_status_t *val_status);
30
31         int val_gethostbyname2_r(const val_context_t *ctx,
32                                  const char *name,
33                                  int af,
34                                  struct hostent *ret,
35                                  char *buf,
36                                  size_t buflen,
37                                  struct hostent **result,
38                                  int *h_errnop,
39                                  val_status_t *val_status);
40
41           struct hostent *val_gethostbyaddr(val_context_t * ctx,
42                                             const char *addr,
43                                             int len,
44                                             int type,
45                                             val_status_t * val_status);
46
47           int val_gethostbyaddr_r(val_context_t * ctx,
48                                   const char *addr,
49                                   int len,
50                                   int type,
51                                   struct hostent *ret,
52                                   char *buf,
53                                   int buflen,
54                                   struct hostent **result,
55                                   int *h_errnop,
56                                   val_status_t * val_status);
57

DESCRIPTION

59       val_gethostbyname(), val_gethostbyname2(), val_gethostbyname_r(),
60       val_gethostbyname2_r(), val_gethostbyaddr() and val_gethostbyaddr_r()
61       perform DNSSEC validation of DNS queries.  They return a network host
62       entry value of type struct hostent and are DNSSEC-aware versions of the
63       gethostbyname(3), gethostbyname2(3), gethostbyname_r(), gethostby‐
64       name2_r(), gethostbyaddr() and gethostbyaddr_r() functions respec‐
65       tively.  (See gethostbyname(3) for more information on type struct hos‐
66       tent).
67
68       val_gethostbyname(), val_gethostbyname_r(), val_gethostbyaddr(), and
69       val_gethostbyaddr_r() support only IPv4 addresses.  val_gethostby‐
70       name2() and val_gethostbyname2_r() support both IPv4 and IPv6
71       addresses.
72
73       The val_gethostbyname_r(), val_gethostbyname2_r() and val_gethost‐
74       byaddr_r() functions are reentrant versions and can be safely used in
75       multi-threaded applications.
76
77       The ctx parameter specifies the validation context, which can be set to
78       NULL for default values (see libval(3) and dnsval.conf for more details
79       on validation contexts and validation policy).
80
81       val_gethostbyname(), val_gethostbyname2() and val_gethostbyaddr() set
82       the global h_errno variable to return the resolver error code.  The
83       reentrant versions val_gethostbyname_r(), val_gethostbyname2_r() and
84       val_gethostbyaddr_r() use the h_errnop parameter to return this value.
85       This ensures thread safety, by avoiding the global h_errno variable.
86       h_errnop must not be NULL.  (See the man page for gethostbyname(3) for
87       possible values of h_errno.)
88
89       The name, af, ret, buf, buflen, and result parameters have the same
90       syntax and semantics as the corresponding parameters for the original
91       gethostbyname*() and gethostbyaddr*() functions.  See the manual page
92       for gethostbyname(3) for more details about these parameters.
93
94       The val_status parameter is used to return the validator error code and
95       must not be NULL.  val_istrusted() and val_isvalidated() can be used to
96       determine the trustworthiness of data and p_val_status() can be used to
97       display the status value to the user in ASCII