OpenDNSSEC-signer 2.1.13
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 "status.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
70
82
83
90extern void edns_init(edns_data_type* data, uint16_t max_length);
91
98extern edns_rr_type* edns_rr_create(void);
99
100
106extern void edns_rr_reset(edns_rr_type* err);
107
115extern int edns_rr_parse(edns_rr_type* err, buffer_type* buffer);
116
123extern size_t edns_rr_reserved_space(edns_rr_type* err);
124
125extern void edns_rr_cleanup(edns_rr_type* err);
126
127
128#endif /* WIRE_EDNS_H */
void edns_rr_cleanup(edns_rr_type *err)
Definition edns.c:172
void edns_init(edns_data_type *data, uint16_t max_length)
Definition edns.c:64
#define OPT_RDATA
Definition edns.h:44
edns_status_enum
Definition edns.h:64
@ EDNS_NOT_PRESENT
Definition edns.h:65
@ EDNS_ERROR
Definition edns.h:67
@ EDNS_OK
Definition edns.h:66
size_t edns_rr_reserved_space(edns_rr_type *err)
Definition edns.c:162
edns_rr_type * edns_rr_create(void)
Definition edns.c:50
void edns_rr_reset(edns_rr_type *err)
Definition edns.c:90
#define OPT_LEN
Definition edns.h:43
enum edns_status_enum edns_status
Definition edns.h:69
int edns_rr_parse(edns_rr_type *err, buffer_type *buffer)
Definition edns.c:107
unsigned char ok[OPT_LEN]
Definition edns.h:55
unsigned char error[OPT_LEN]
Definition edns.h:56
unsigned char rdata_none[OPT_RDATA]
Definition edns.h:57
int dnssec_ok
Definition edns.h:80
edns_status status
Definition edns.h:77
size_t position
Definition edns.h:78
size_t maxlen
Definition edns.h:79