8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / smbsrv / libsmbns / common / smbns_dyndns.h
blob9ff163ba543f055eea161a0ef0b0ea369afde0e2
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SMBSRV_DYNDNS_H
27 #define _SMBSRV_DYNDNS_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <smbsrv/libsmbns.h>
34 * Header section format:
36 * The header contains the following fields:
38 * 1 1 1 1 1 1
39 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
40 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
41 * | ID |
42 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
43 * |QR| Opcode |AA|TC|RD|RA| Z | RCODE |
44 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
45 * | QDCOUNT |
46 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
47 * | ANCOUNT |
48 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
49 * | NSCOUNT |
50 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
51 * | ARCOUNT |
52 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
54 * where:
56 * ID A 16 bit identifier assigned by the program that
57 * generates any kind of query. This identifier is copied
58 * the corresponding reply and can be used by the requester
59 * to match up replies to outstanding queries.
61 * QR A one bit field that specifies whether this message is a
62 * query (0), or a response (1).
64 * OPCODE A four bit field that specifies kind of query in this
65 * message. This value is set by the originator of a query
66 * and copied into the response. The values are:
68 * 0 a standard query (QUERY)
70 * 1 an inverse query (IQUERY)
72 * 2 a server status request (STATUS)
74 * 3-15 reserved for future use
76 * AA Authoritative Answer - this bit is valid in responses,
77 * and specifies that the responding name server is an
78 * authority for the domain name in question section.
80 * Note that the contents of the answer section may have
81 * multiple owner names because of aliases. The AA bit
83 * corresponds to the name which matches the query name, or
84 * the first owner name in the answer section.
86 * TC TrunCation - specifies that this message was truncated
87 * due to length greater than that permitted on the
88 * transmission channel.
90 * RD Recursion Desired - this bit may be set in a query and
91 * is copied into the response. If RD is set, it directs
92 * the name server to pursue the query recursively.
93 * Recursive query support is optional.
95 * RA Recursion Available - this be is set or cleared in a
96 * response, and denotes whether recursive query support is
97 * available in the name server.
99 * Z Reserved for future use. Must be zero in all queries
100 * and responses.
102 * RCODE Response code - this 4 bit field is set as part of
103 * responses. The values have the following
104 * interpretation:
106 * 0 No error condition
108 * 1 Format error - The name server was
109 * unable to interpret the query.
111 * 2 Server failure - The name server was
112 * unable to process this query due to a
113 * problem with the name server.
115 * 3 Name Error - Meaningful only for
116 * responses from an authoritative name
117 * server, this code signifies that the
118 * domain name referenced in the query does
119 * not exist.
121 * 4 Not Implemented - The name server does
122 * not support the requested kind of query.
124 * 5 Refused - The name server refuses to
125 * perform the specified operation for
126 * policy reasons. For example, a name
127 * server may not wish to provide the
128 * information to the particular requester,
129 * or a name server may not wish to perform
130 * a particular operation (e.g., zone
132 * transfer) for particular data.
134 * 6-15 Reserved for future use.
136 * QDCOUNT an unsigned 16 bit integer specifying the number of
137 * entries in the question section.
139 * ANCOUNT an unsigned 16 bit integer specifying the number of
140 * resource records in the answer section.
142 * NSCOUNT an unsigned 16 bit integer specifying the number of name
143 * server resource records in the authority records
144 * section.
146 * ARCOUNT an unsigned 16 bit integer specifying the number of
147 * resource records in the additional records section.
150 #include <sys/types.h>
152 #ifdef __cplusplus
153 extern "C" {
154 #endif
156 /* Other definitions: */
157 #define REQ_QUERY 1 /* DNS query request */
158 #define REQ_UPDATE 0 /* DNS update request */
159 #define UPDATE_FORW 1 /* Update forward lookup zone */
160 #define UPDATE_REV 0 /* Update reverse lookup zone */
161 #define UPDATE_ADD 1 /* Update add request */
162 #define UPDATE_DEL 0 /* Update remove request */
163 #define MODE_GSS_API 3 /* Key negotiation mode */
165 /* Max buffer size for send and receive buffer */
166 #define MAX_BUF_SIZE 2000
167 #define MAX_RETRIES 3 /* Max number of send retries if no response */
168 #define TSIG_SIGNED 1 /* TSIG contains signed data */
169 #define TSIG_UNSIGNED 0 /* TSIG does not conain signed data */
170 #define DNS_CHECK 1 /* Check DNS for entry */
171 #define DNS_NOCHECK 0 /* Don't check DNS for entry */
172 #define MAX_TCP_SIZE 2000 /* max tcp DNS message size */
174 /* Delete 1 entry */
175 #define DEL_ONE 1
176 /* Delete all entries of the same resource name */
177 #define DEL_ALL 0
179 #define DNSF_RECUR_SUPP 0x80 /* Server can do recursive queries */
180 #define DNSF_RECUR_QRY 0x100 /* Query is recursive */
182 #define BUFLEN_TCP(x, y) (MAX_TCP_SIZE-(x-y))
183 #define BUFLEN_UDP(x, y) (NS_PACKETSZ-(x-y))
186 * DDNS_TTL is the time to live in DNS caches. Note that this
187 * does not affect the entry in the authoritative DNS database.
189 #define DDNS_TTL 1200
191 #ifdef __cplusplus
193 #endif
195 #endif /* _SMBSRV_DYNDNS_H */