1 /* 2 * dns.h -- defines for the Domain Name System 3 * 4 * Copyright (c) 2005-2008, NLnet Labs. All rights reserved. 5 * 6 * See LICENSE for the license. 7 * 8 * This library was created by: 9 * Jelte Jansen, Erik Rozendaal and Miek Gieben 10 * 11 * A bunch of defines that are used in the DNS. 12 */ 13 14 15 /** 16 \mainpage LDNS Documentation 17 18 \section introduction Introduction 19 20 The goal of ldns is to simplify DNS programming, it supports recent RFCs 21 like the DNSSEC documents, and allow developers to easily create software 22 conforming to current RFCs, and experimental software for current Internet 23 drafts. A secondary benefit of using ldns is speed, because ldns is written 24 in C, and although it is not optimized for performance, it should be a lot 25 faster than Perl. 26 27 The first main tool to use ldns is Drill, from which part of the library was 28 derived. From version 1.0.0 on, drill is included in the ldns release 29 and will not be distributed separately anymore. The library also includes some 30 other examples and tools to show how it can be used. These can be found in the 31 examples/ directory in the tarball. 32 33 ldns depends on OpenSSL for it's cryptographic functions. 34 Feature list 35 36 - Transparent IPv4 and IPv6 support (overridable if necessary), 37 - TSIG support, 38 - DNSSEC support; signing and verification, 39 - small size, 40 - online documentation as well as manual pages. 41 42 If you want to send us patches please use the code from git. 43 44 \section using_ldns Using ldns 45 46 Almost all interaction between an application and ldns goes through the ldns 47 data structures (\ref ldns_rr, \ref ldns_pkt, etc.). These are input or 48 output to the functions of ldns. For example, \ref ldns_zone_new_frm_fp 49 reads a zone from a \c FILE pointer, and returns an \ref ldns_zone 50 structure. 51 52 53 Let's use Drill as an example. Drill is a tool much like dig, whose most 54 basic function is to send 1 query to a nameserver and print the response. 55 56 To be able to do this, drill uses the resolver module of ldns, which acts as 57 a stub resolver. The resolver module uses the net module to actually send 58 the query that drill requested. It then uses the wire2host module to 59 translate the response and place it in ldns' internal structures. These are 60 passed back to drill, which then uses the host2str module to print the 61 response in presentation format. 62 63 \section gettingstarted Getting Started 64 65 See the \ref design page for a very high level description of the design 66 choices made for ldns. 67 68 For an overview of the functions and types ldns provides, you can check out 69 the \ref ldns ldns header file descriptions. 70 71 If you want to see some libdns action, you can read our tutorials: 72 - \ref tutorial1_mx 73 - \ref tutorial2_zone 74 - \ref tutorial3_signzone 75 76 Or you can just use the menu above to browse through the API docs. 77 78 <div style="visibility:hidden;"> 79 \image html LogoInGradientBar2-y100.png 80 </div> 81 */ 82 83 /** 84 * \file ldns.h 85 * 86 * Including this file will include all ldns files, and define some lookup tables. 87 */ 88 89 #ifndef LDNS_DNS_H 90 #define LDNS_DNS_H 91 92 #include <stdio.h> 93 #include <stdlib.h> 94 95 #include <ldns/util.h> 96 #include <ldns/buffer.h> 97 #include <ldns/common.h> 98 #include <ldns/dane.h> 99 #include <ldns/dname.h> 100 #include <ldns/dnssec.h> 101 #include <ldns/dnssec_verify.h> 102 #include <ldns/dnssec_sign.h> 103 #include <ldns/duration.h> 104 #include <ldns/error.h> 105 #include <ldns/higher.h> 106 #include <ldns/host2str.h> 107 #include <ldns/host2wire.h> 108 #include <ldns/net.h> 109 #include <ldns/packet.h> 110 #include <ldns/rdata.h> 111 #include <ldns/resolver.h> 112 #include <ldns/rr.h> 113 #include <ldns/str2host.h> 114 #include <ldns/tsig.h> 115 #include <ldns/update.h> 116 #include <ldns/wire2host.h> 117 #include <ldns/rr_functions.h> 118 #include <ldns/keys.h> 119 #include <ldns/parse.h> 120 #include <ldns/zone.h> 121 #include <ldns/dnssec_zone.h> 122 #include <ldns/radix.h> 123 #include <ldns/rbtree.h> 124 #include <ldns/sha1.h> 125 #include <ldns/sha2.h> 126 127 #ifdef __cplusplus 128 extern "C" { 129 #endif 130 131 #define LDNS_IP4ADDRLEN (32/8) 132 #define LDNS_IP6ADDRLEN (128/8) 133 #define LDNS_PORT 53 134 #define LDNS_ROOT_LABEL_STR "." 135 #define LDNS_DEFAULT_TTL 3600 136 137 /* lookup tables for standard DNS stuff */ 138 139 /** Taken from RFC 2538, section 2.1. */ 140 extern ldns_lookup_table ldns_certificate_types[]; 141 /** Taken from RFC 2535, section 7. */ 142 extern ldns_lookup_table ldns_algorithms[]; 143 /** Taken from RFC 2538. */ 144 extern ldns_lookup_table ldns_cert_algorithms[]; 145 /** rr types */ 146 extern ldns_lookup_table ldns_rr_classes[]; 147 /** Response codes */ 148 extern ldns_lookup_table ldns_rcodes[]; 149 /** Operation codes */ 150 extern ldns_lookup_table ldns_opcodes[]; 151 /** EDNS flags */ 152 extern ldns_lookup_table ldns_edns_flags[]; 153 154 #ifdef __cplusplus 155 } 156 #endif 157 158 #endif /* LDNS_DNS_H */ 159