/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.3

https://bitbucket.org/freebsd/freebsd-head/ · Unknown · 164 lines · 164 code · 0 blank · 0 comment · 0 complexity · 4d2cb7adb986b1b02b9f71eeec375235 MD5 · raw file

  1. .\" Copyright (C) 2004, 2005, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
  2. .\" Copyright (C) 2000, 2001 Internet Software Consortium.
  3. .\"
  4. .\" Permission to use, copy, modify, and/or distribute this software for any
  5. .\" purpose with or without fee is hereby granted, provided that the above
  6. .\" copyright notice and this permission notice appear in all copies.
  7. .\"
  8. .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  9. .\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  10. .\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  11. .\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  12. .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  13. .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  14. .\" PERFORMANCE OF THIS SOFTWARE.
  15. .\"
  16. .\" $Id$
  17. .\"
  18. .hy 0
  19. .ad l
  20. .\" Title: lwres_getrrsetbyname
  21. .\" Author:
  22. .\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
  23. .\" Date: Oct 18, 2000
  24. .\" Manual: BIND9
  25. .\" Source: BIND9
  26. .\"
  27. .TH "LWRES_GETRRSETBYNAME" "3" "Oct 18, 2000" "BIND9" "BIND9"
  28. .\" disable hyphenation
  29. .nh
  30. .\" disable justification (adjust text to left margin only)
  31. .ad l
  32. .SH "NAME"
  33. lwres_getrrsetbyname, lwres_freerrset \- retrieve DNS records
  34. .SH "SYNOPSIS"
  35. .nf
  36. #include <lwres/netdb.h>
  37. .fi
  38. .HP 25
  39. .BI "int lwres_getrrsetbyname(const\ char\ *" "hostname" ", unsigned\ int\ " "rdclass" ", unsigned\ int\ " "rdtype" ", unsigned\ int\ " "flags" ", struct\ rrsetinfo\ **" "res" ");"
  40. .HP 21
  41. .BI "void lwres_freerrset(struct\ rrsetinfo\ *" "rrset" ");"
  42. .PP
  43. The following structures are used:
  44. .PP
  45. .RS 4
  46. .nf
  47. struct rdatainfo {
  48. unsigned int rdi_length; /* length of data */
  49. unsigned char *rdi_data; /* record data */
  50. };
  51. .fi
  52. .RE
  53. .sp
  54. .PP
  55. .RS 4
  56. .nf
  57. struct rrsetinfo {
  58. unsigned int rri_flags; /* RRSET_VALIDATED... */
  59. unsigned int rri_rdclass; /* class number */
  60. unsigned int rri_rdtype; /* RR type number */
  61. unsigned int rri_ttl; /* time to live */
  62. unsigned int rri_nrdatas; /* size of rdatas array */
  63. unsigned int rri_nsigs; /* size of sigs array */
  64. char *rri_name; /* canonical name */
  65. struct rdatainfo *rri_rdatas; /* individual records */
  66. struct rdatainfo *rri_sigs; /* individual signatures */
  67. };
  68. .fi
  69. .RE
  70. .sp
  71. .SH "DESCRIPTION"
  72. .PP
  73. \fBlwres_getrrsetbyname()\fR
  74. gets a set of resource records associated with a
  75. \fIhostname\fR,
  76. \fIclass\fR, and
  77. \fItype\fR.
  78. \fIhostname\fR
  79. is a pointer a to null\-terminated string. The
  80. \fIflags\fR
  81. field is currently unused and must be zero.
  82. .PP
  83. After a successful call to
  84. \fBlwres_getrrsetbyname()\fR,
  85. \fI*res\fR
  86. is a pointer to an
  87. \fBrrsetinfo\fR
  88. structure, containing a list of one or more
  89. \fBrdatainfo\fR
  90. structures containing resource records and potentially another list of
  91. \fBrdatainfo\fR
  92. structures containing SIG resource records associated with those records. The members
  93. \fBrri_rdclass\fR
  94. and
  95. \fBrri_rdtype\fR
  96. are copied from the parameters.
  97. \fBrri_ttl\fR
  98. and
  99. \fBrri_name\fR
  100. are properties of the obtained rrset. The resource records contained in
  101. \fBrri_rdatas\fR
  102. and
  103. \fBrri_sigs\fR
  104. are in uncompressed DNS wire format. Properties of the rdataset are represented in the
  105. \fBrri_flags\fR
  106. bitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC validated and the signatures verified.
  107. .PP
  108. All of the information returned by
  109. \fBlwres_getrrsetbyname()\fR
  110. is dynamically allocated: the
  111. \fBrrsetinfo\fR
  112. and
  113. \fBrdatainfo\fR
  114. structures, and the canonical host name strings pointed to by the
  115. \fBrrsetinfo\fRstructure. Memory allocated for the dynamically allocated structures created by a successful call to
  116. \fBlwres_getrrsetbyname()\fR
  117. is released by
  118. \fBlwres_freerrset()\fR.
  119. \fIrrset\fR
  120. is a pointer to a
  121. \fBstruct rrset\fR
  122. created by a call to
  123. \fBlwres_getrrsetbyname()\fR.
  124. .PP
  125. .SH "RETURN VALUES"
  126. .PP
  127. \fBlwres_getrrsetbyname()\fR
  128. returns zero on success, and one of the following error codes if an error occurred:
  129. .PP
  130. \fBERRSET_NONAME\fR
  131. .RS 4
  132. the name does not exist
  133. .RE
  134. .PP
  135. \fBERRSET_NODATA\fR
  136. .RS 4
  137. the name exists, but does not have data of the desired type
  138. .RE
  139. .PP
  140. \fBERRSET_NOMEMORY\fR
  141. .RS 4
  142. memory could not be allocated
  143. .RE
  144. .PP
  145. \fBERRSET_INVAL\fR
  146. .RS 4
  147. a parameter is invalid
  148. .RE
  149. .PP
  150. \fBERRSET_FAIL\fR
  151. .RS 4
  152. other failure
  153. .RE
  154. .PP
  155. .RS 4
  156. .RE
  157. .SH "SEE ALSO"
  158. .PP
  159. \fBlwres\fR(3).
  160. .SH "COPYRIGHT"
  161. Copyright \(co 2004, 2005, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
  162. .br
  163. Copyright \(co 2000, 2001 Internet Software Consortium.
  164. .br