iostat - add read/write details to output
[dragonfly.git] / contrib / bind / lib / lwres / man / lwres_packet.3
1 .\" Copyright (C) 2004, 2005, 2007 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: lwres_packet.3,v 1.29.214.1 2009/07/11 01:43:32 tbox Exp $
17 .\"
18 .hy 0
19 .ad l
20 .\"     Title: lwres_packet
21 .\"    Author: 
22 .\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
23 .\"      Date: Jun 30, 2000
24 .\"    Manual: BIND9
25 .\"    Source: BIND9
26 .\"
27 .TH "LWRES_PACKET" "3" "Jun 30, 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_lwpacket_renderheader, lwres_lwpacket_parseheader \- lightweight resolver packet handling functions
34 .SH "SYNOPSIS"
35 .nf
36 #include <lwres/lwpacket.h>
37 .fi
38 .HP 43
39 .BI "lwres_result_t lwres_lwpacket_renderheader(lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ");"
40 .HP 42
41 .BI "lwres_result_t lwres_lwpacket_parseheader(lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ");"
42 .SH "DESCRIPTION"
43 .PP
44 These functions rely on a
45 \fBstruct lwres_lwpacket\fR
46 which is defined in
47 \fIlwres/lwpacket.h\fR.
48 .PP
49 .RS 4
50 .nf
51 typedef struct lwres_lwpacket lwres_lwpacket_t;
52 .fi
53 .RE
54 .sp
55 .PP
56 .RS 4
57 .nf
58 struct lwres_lwpacket {
59         lwres_uint32_t          length;
60         lwres_uint16_t          version;
61         lwres_uint16_t          pktflags;
62         lwres_uint32_t          serial;
63         lwres_uint32_t          opcode;
64         lwres_uint32_t          result;
65         lwres_uint32_t          recvlength;
66         lwres_uint16_t          authtype;
67         lwres_uint16_t          authlength;
68 };
69 .fi
70 .RE
71 .sp
72 .PP
73 The elements of this structure are:
74 .PP
75 \fBlength\fR
76 .RS 4
77 the overall packet length, including the entire packet header. This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls.
78 .RE
79 .PP
80 \fBversion\fR
81 .RS 4
82 the header format. There is currently only one format,
83 \fBLWRES_LWPACKETVERSION_0\fR. This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls.
84 .RE
85 .PP
86 \fBpktflags\fR
87 .RS 4
88 library\-defined flags for this packet: for instance whether the packet is a request or a reply. Flag values can be set, but not defined by the caller. This field is filled in by the application wit the exception of the LWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library in the lwres_gabn_*() and lwres_gnba_*() calls.
89 .RE
90 .PP
91 \fBserial\fR
92 .RS 4
93 is set by the requestor and is returned in all replies. If two or more packets from the same source have the same serial number and are from the same source, they are assumed to be duplicates and the latter ones may be dropped. This field must be set by the application.
94 .RE
95 .PP
96 \fBopcode\fR
97 .RS 4
98 indicates the operation. Opcodes between 0x00000000 and 0x03ffffff are reserved for use by the lightweight resolver library. Opcodes between 0x04000000 and 0xffffffff are application defined. This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls.
99 .RE
100 .PP
101 \fBresult\fR
102 .RS 4
103 is only valid for replies. Results between 0x04000000 and 0xffffffff are application defined. Results between 0x00000000 and 0x03ffffff are reserved for library use. This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls.
104 .RE
105 .PP
106 \fBrecvlength\fR
107 .RS 4
108 is the maximum buffer size that the receiver can handle on requests and the size of the buffer needed to satisfy a request when the buffer is too large for replies. This field is supplied by the application.
109 .RE
110 .PP
111 \fBauthtype\fR
112 .RS 4
113 defines the packet level authentication that is used. Authorisation types between 0x1000 and 0xffff are application defined and types between 0x0000 and 0x0fff are reserved for library use. Currently these are not used and must be zero.
114 .RE
115 .PP
116 \fBauthlen\fR
117 .RS 4
118 gives the length of the authentication data. Since packet authentication is currently not used, this must be zero.
119 .RE
120 .PP
121 The following opcodes are currently defined:
122 .PP
123 \fBNOOP\fR
124 .RS 4
125 Success is always returned and the packet contents are echoed. The lwres_noop_*() functions should be used for this type.
126 .RE
127 .PP
128 \fBGETADDRSBYNAME\fR
129 .RS 4
130 returns all known addresses for a given name. The lwres_gabn_*() functions should be used for this type.
131 .RE
132 .PP
133 \fBGETNAMEBYADDR\fR
134 .RS 4
135 return the hostname for the given address. The lwres_gnba_*() functions should be used for this type.
136 .RE
137 .PP
138 \fBlwres_lwpacket_renderheader()\fR
139 transfers the contents of lightweight resolver packet structure
140 \fBlwres_lwpacket_t\fR
141 \fI*pkt\fR
142 in network byte order to the lightweight resolver buffer,
143 \fI*b\fR.
144 .PP
145 \fBlwres_lwpacket_parseheader()\fR
146 performs the converse operation. It transfers data in network byte order from buffer
147 \fI*b\fR
148 to resolver packet
149 \fI*pkt\fR. The contents of the buffer
150 \fIb\fR
151 should correspond to a
152 \fBlwres_lwpacket_t\fR.
153 .SH "RETURN VALUES"
154 .PP
155 Successful calls to
156 \fBlwres_lwpacket_renderheader()\fR
157 and
158 \fBlwres_lwpacket_parseheader()\fR
159 return
160 \fBLWRES_R_SUCCESS\fR. If there is insufficient space to copy data between the buffer
161 \fI*b\fR
162 and lightweight resolver packet
163 \fI*pkt\fR
164 both functions return
165 \fBLWRES_R_UNEXPECTEDEND\fR.
166 .SH "COPYRIGHT"
167 Copyright \(co 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
168 .br
169 Copyright \(co 2000, 2001 Internet Software Consortium.
170 .br