OpenDNSSEC-signer  1.4.10
edns.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 NLNet Labs. All rights reserved.
3  *
4  * Taken from NSD3 and adjusted for OpenDNSSEC, NLnet Labs.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
19  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
21  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
23  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
25  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  */
28 
34 #ifndef WIRE_EDNS_H
35 #define WIRE_EDNS_H
36 
37 #include "config.h"
38 #include "shared/allocator.h"
39 #include "wire/buffer.h"
40 
41 #include <ldns/ldns.h>
42 
43 #define OPT_LEN 9U /* length of the NSD EDNS response record minus 2 */
44 #define OPT_RDATA 2 /* holds the rdata length comes after OPT_LEN */
45 #define DNSSEC_OK_MASK 0x8000U /* do bit mask */
46 
47 #define EDNS_MAX_MESSAGE_LEN 4096
48 
55  unsigned char ok[OPT_LEN];
56  unsigned char error[OPT_LEN];
57  unsigned char rdata_none[OPT_RDATA];
58 };
59 
68 };
70 
79  size_t position;
80  size_t maxlen;
81  int dnssec_ok;
82 };
83 
84 
91 void edns_init(edns_data_type* data, uint16_t max_length);
92 
100 
101 
107 void edns_rr_reset(edns_rr_type* err);
108 
116 int edns_rr_parse(edns_rr_type* err, buffer_type* buffer);
117 
125 
126 #endif /* WIRE_EDNS_H */
edns_rr_type * edns_rr_create(allocator_type *allocator)
Definition: edns.c:50
#define OPT_RDATA
Definition: edns.h:44
size_t edns_rr_reserved_space(edns_rr_type *err)
Definition: edns.c:171
size_t position
Definition: edns.h:79
int dnssec_ok
Definition: edns.h:81
enum edns_status_enum edns_status
Definition: edns.h:69
allocator_type * allocator
Definition: edns.h:77
void edns_init(edns_data_type *data, uint16_t max_length)
Definition: edns.c:73
Definition: edns.h:66
edns_status_enum
Definition: edns.h:64
int edns_rr_parse(edns_rr_type *err, buffer_type *buffer)
Definition: edns.c:118
size_t maxlen
Definition: edns.h:80
#define OPT_LEN
Definition: edns.h:43
unsigned char error[OPT_LEN]
Definition: edns.h:56
unsigned char ok[OPT_LEN]
Definition: edns.h:55
edns_status status
Definition: edns.h:78
void edns_rr_reset(edns_rr_type *err)
Definition: edns.c:100
unsigned char rdata_none[OPT_RDATA]
Definition: edns.h:57