OpenDNSSEC-signer
1.4.5
Main Page
Data Structures
Files
File List
Globals
signer
src
wire
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
53
typedef
struct
edns_data_struct
edns_data_type
;
54
struct
edns_data_struct
{
55
unsigned
char
ok
[
OPT_LEN
];
56
unsigned
char
error
[
OPT_LEN
];
57
unsigned
char
rdata_none
[
OPT_RDATA
];
58
};
59
64
enum
edns_status_enum
{
65
EDNS_NOT_PRESENT
,
66
EDNS_OK
,
67
EDNS_ERROR
68
};
69
typedef
enum
edns_status_enum
edns_status
;
70
75
typedef
struct
edns_rr_struct
edns_rr_type
;
76
struct
edns_rr_struct
{
77
allocator_type
*
allocator
;
78
edns_status
status
;
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
99
edns_rr_type
*
edns_rr_create
(
allocator_type
* allocator);
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
124
size_t
edns_rr_reserved_space
(
edns_rr_type
* err);
125
126
#endif
/* WIRE_EDNS_H */
Generated on Tue Jul 22 2014 00:37:52 for OpenDNSSEC-signer by
1.8.1.2