summaryrefslogtreecommitdiff
path: root/usr.sbin/nsd/query.h
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@cvs.openbsd.org>2010-01-15 19:24:56 +0000
committerJakob Schlyter <jakob@cvs.openbsd.org>2010-01-15 19:24:56 +0000
commit25a5983ce5a98058efc26fbded60fc2f59316e55 (patch)
tree71c519f94533ad53d4ff5765162af4dbb7cbbb9c /usr.sbin/nsd/query.h
parent62f6cef61c385b9ceb428485e396f1ff11e7f0e0 (diff)
NSD v3.2.4
Diffstat (limited to 'usr.sbin/nsd/query.h')
-rw-r--r--usr.sbin/nsd/query.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/usr.sbin/nsd/query.h b/usr.sbin/nsd/query.h
index a950de3e002..89ea960570e 100644
--- a/usr.sbin/nsd/query.h
+++ b/usr.sbin/nsd/query.h
@@ -56,10 +56,12 @@ struct query {
/* EDNS information provided by the client. */
edns_record_type edns;
+#ifdef TSIG
/* TSIG record information and running hash for query-response */
tsig_record_type tsig;
/* tsig actions can be overridden, for axfr transfer. */
int tsig_prepare_it, tsig_update_it, tsig_sign_it;
+#endif /* TSIG */
int tcp;
uint16_t tcplen;
@@ -76,6 +78,9 @@ struct query {
/* The zone used to answer the query. */
zone_type *zone;
+ /* The domain used to answer the query. */
+ domain_type *domain;
+
/* The delegation domain, if any. */
domain_type *delegation_domain;
@@ -103,10 +108,10 @@ struct query {
* query name when generated from a wildcard record.
*/
uint16_t *compressed_dname_offsets;
- size_t compressed_dname_offsets_size;
+ uint32_t compressed_dname_offsets_size;
/* number of temporary domains used for the query */
- size_t number_temporary_domains;
+ uint32_t number_temporary_domains;
/*
* Used for AXFR processing.
@@ -116,11 +121,6 @@ struct query {
domain_type *axfr_current_domain;
rrset_type *axfr_current_rrset;
uint16_t axfr_current_rr;
-
-#ifdef RATELIMIT
- /* if we encountered a wildcard, its domain */
- domain_type *wildcard_domain;
-#endif
};
@@ -157,7 +157,7 @@ void query_clear_dname_offsets(struct query *query, size_t max_offset);
* Clear the compression tables.
*/
void query_clear_compression_tables(struct query *query);
-
+
/*
* Enter the specified domain into the compression table starting at
* the specified offset.
@@ -172,7 +172,7 @@ void query_add_compression_domain(struct query *query,
*/
query_type *query_create(region_type *region,
uint16_t *compressed_dname_offsets,
- size_t compressed_dname_size);
+ uint32_t compressed_dname_size);
/*
* Reset a query structure so it is ready for receiving and processing
@@ -191,7 +191,7 @@ query_state_type query_process(query_type *q, nsd_type *nsd);
* includes the packet header and question section. Space is reserved
* for the optional EDNS record, if required.
*/
-void query_prepare_response(query_type *q, nsd_type* nsd);
+void query_prepare_response(query_type *q);
/*
* Add EDNS0 information to the response if required.
@@ -209,4 +209,9 @@ query_overflow(query_type *q)
{
return buffer_position(q->packet) > (q->maxlen - q->reserved_space);
}
+static inline int
+query_overflow_nsid(query_type *q, uint16_t nsid_len)
+{
+ return buffer_position(q->packet) > (q->maxlen - q->reserved_space - nsid_len);
+}
#endif /* _QUERY_H_ */