OpenDNSSEC-signer
1.4.5
Main Page
Data Structures
Files
File List
Globals
signer
src
wire
query.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 NLNet Labs. All rights reserved.
3
*
4
* Redistribution and use in source and binary forms, with or without
5
* modification, are permitted provided that the following conditions
6
* are met:
7
* 1. Redistributions of source code must retain the above copyright
8
* notice, this list of conditions and the following disclaimer.
9
* 2. Redistributions in binary form must reproduce the above copyright
10
* notice, this list of conditions and the following disclaimer in the
11
* documentation and/or other materials provided with the distribution.
12
*
13
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
17
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
19
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
21
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
23
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
*
25
*/
26
32
#ifndef WIRE_QUERY_H
33
#define WIRE_QUERY_H
34
35
#include "config.h"
36
#include "
shared/allocator.h
"
37
#include "
signer/zone.h
"
38
#include "
wire/buffer.h
"
39
#include "
wire/edns.h
"
40
#include "
wire/tsig.h
"
41
42
#define UDP_MAX_MESSAGE_LEN 512
43
#define TCP_MAX_MESSAGE_LEN 65535
44
#define QUERY_RESPONSE_MAX_RRSET 10
/* should be enough */
45
46
enum
query_enum
{
47
QUERY_PROCESSED
= 0,
48
QUERY_DISCARDED
,
49
QUERY_AXFR
,
50
QUERY_IXFR
51
};
52
typedef
enum
query_enum
query_state
;
53
58
typedef
struct
query_struct
query_type
;
59
struct
query_struct
{
60
/* Memory allocator */
61
allocator_type
*
allocator
;
62
/* Query from addres */
63
struct
sockaddr_storage
addr
;
64
socklen_t
addrlen
;
65
/* Maximum supported query size */
66
size_t
maxlen
;
67
size_t
reserved_space
;
68
/* TSIG */
69
tsig_rr_type
*
tsig_rr
;
70
/* EDNS */
71
edns_rr_type
*
edns_rr
;
72
/* TCP */
73
int
tcp
;
74
uint16_t
tcplen
;
75
buffer_type
*
buffer
;
76
/* QNAME, QTYPE, QCLASS */
77
78
/* Zone */
79
zone_type
*
zone
;
80
/* Compression */
81
82
/* AXFR IXFR */
83
FILE*
axfr_fd
;
84
uint32_t
serial
;
85
size_t
startpos
;
86
/* Bits */
87
unsigned
axfr_is_done
: 1;
88
unsigned
tsig_prepare_it
: 1;
89
unsigned
tsig_update_it
: 1;
90
unsigned
tsig_sign_it
: 1;
91
};
92
97
typedef
struct
response_struct
response_type
;
98
struct
response_struct
{
99
size_t
rrset_count
;
100
ldns_pkt_section
sections
[
QUERY_RESPONSE_MAX_RRSET
];
101
rrset_type
*
rrsets
[
QUERY_RESPONSE_MAX_RRSET
];
102
};
103
109
query_type
*
query_create
(
void
);
110
116
void
query_prepare
(
query_type
* q);
117
125
query_state
query_process
(
query_type
* q,
void
* engine);
126
134
void
query_reset
(
query_type
* q,
size_t
maxlen,
int
is_tcp);
135
142
void
query_add_optional
(
query_type
* q,
void
* engine);
143
151
int
query_add_rr
(
query_type
* q, ldns_rr* rr);
152
158
void
query_cleanup
(
query_type
* q);
159
160
#endif
/* WIRE_QUERY_H */
Generated on Tue Jul 22 2014 00:37:52 for OpenDNSSEC-signer by
1.8.1.2