fixedname.h 1.62 KB
Newer Older
Bob Halley's avatar
add  
Bob Halley committed
1
/*
2
 * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3
 *
4 5 6
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 8 9
 *
 * See the COPYRIGHT file distributed with this work for additional
 * information regarding copyright ownership.
Bob Halley's avatar
add  
Bob Halley committed
10 11
 */

David Lawrence's avatar
David Lawrence committed
12

Bob Halley's avatar
add  
Bob Halley committed
13 14 15 16 17 18 19
#ifndef DNS_FIXEDNAME_H
#define DNS_FIXEDNAME_H 1

/*****
 ***** Module Info
 *****/

20
/*! \file dns/fixedname.h
21
 * \brief
Bob Halley's avatar
add  
Bob Halley committed
22 23
 * Fixed-size Names
 *
24 25 26
 * dns_fixedname_t is a convenience type containing a name, an offsets
 * table, and a dedicated buffer big enough for the longest possible
 * name. This is typically used for stack-allocated names.
Bob Halley's avatar
add  
Bob Halley committed
27 28
 *
 * MP:
29
 *\li	The caller must ensure any required synchronization.
Bob Halley's avatar
add  
Bob Halley committed
30 31
 *
 * Reliability:
32
 *\li	No anticipated impact.
Bob Halley's avatar
add  
Bob Halley committed
33 34
 *
 * Resources:
35 36
 *\li	Per dns_fixedname_t:
 *\code
Bob Halley's avatar
add  
Bob Halley committed
37 38
 *		sizeof(dns_name_t) + sizeof(dns_offsets_t) +
 *		sizeof(isc_buffer_t) + 255 bytes + structure padding
39
 *\endcode
Bob Halley's avatar
add  
Bob Halley committed
40 41
 *
 * Security:
42
 *\li	No anticipated impact.
Bob Halley's avatar
add  
Bob Halley committed
43 44
 *
 * Standards:
45
 *\li	None.
Bob Halley's avatar
add  
Bob Halley committed
46 47 48 49 50 51 52
 */

/*****
 ***** Imports
 *****/

#include <isc/buffer.h>
53
#include <isc/lang.h>
Bob Halley's avatar
add  
Bob Halley committed
54 55 56 57 58 59 60

#include <dns/name.h>

/*****
 ***** Types
 *****/

61 62 63 64
struct dns_fixedname {
	dns_name_t			name;
	dns_offsets_t			offsets;
	isc_buffer_t			buffer;
65
	unsigned char			data[DNS_NAME_MAXWIRE];
66
};
Bob Halley's avatar
add  
Bob Halley committed
67

68 69
ISC_LANG_BEGINDECLS

70 71
void
dns_fixedname_init(dns_fixedname_t *fixed);
Bob Halley's avatar
add  
Bob Halley committed
72

73 74
void
dns_fixedname_invalidate(dns_fixedname_t *fixed);
Bob Halley's avatar
add  
Bob Halley committed
75

76 77 78 79 80
dns_name_t *
dns_fixedname_name(dns_fixedname_t *fixed);

dns_name_t *
dns_fixedname_initname(dns_fixedname_t *fixed);
81

82 83
ISC_LANG_ENDDECLS

Bob Halley's avatar
add  
Bob Halley committed
84
#endif /* DNS_FIXEDNAME_H */