root/tools/iphone-sdk/trunk/ldns_sources/ldns/str2host.h
| Revision 32, 6.8 kB (checked in by kjaleel, 5 years ago) |
|---|
| Line | |
|---|---|
| 1 | /** |
| 2 | * str2host.h - conversion from str to the host fmt |
| 3 | * |
| 4 | * a Net::DNS like library for C |
| 5 | * |
| 6 | * (c) NLnet Labs, 2005-2006 |
| 7 | * |
| 8 | * See the file LICENSE for the license |
| 9 | */ |
| 10 | |
| 11 | #ifndef LDNS_2HOST_H |
| 12 | #define LDNS_2HOST_H |
| 13 | |
| 14 | #include "common.h" |
| 15 | #include "error.h" |
| 16 | #include "rr.h" |
| 17 | #include "rdata.h" |
| 18 | #include "packet.h" |
| 19 | #include "buffer.h" |
| 20 | #include <ctype.h> |
| 21 | |
| 22 | /** |
| 23 | * \file |
| 24 | * |
| 25 | * Defines functions to convert dns data in presentation format or text files |
| 26 | * to internal structures. |
| 27 | */ |
| 28 | |
| 29 | /** |
| 30 | * convert a byte into wireformat |
| 31 | * \param[in] rd the rdf where to put the data |
| 32 | * \param[in] bytestr the string to be converted |
| 33 | * \return ldns_status |
| 34 | */ |
| 35 | ldns_status ldns_str2rdf_int8(ldns_rdf **rd, const char *bytestr); |
| 36 | |
| 37 | /** |
| 38 | * convert a string to a int16 in wireformat |
| 39 | * \param[in] rd the rdf where to put the data |
| 40 | * \param[in] shortstr the string to be converted |
| 41 | * \return ldns_status |
| 42 | */ |
| 43 | ldns_status ldns_str2rdf_int16(ldns_rdf **rd, const char *shortstr); |
| 44 | |
| 45 | /** |
| 46 | * convert a strings into a 4 byte int in wireformat |
| 47 | * \param[in] rd the rdf where to put the data |
| 48 | * \param[in] longstr the string to be converted |
| 49 | * \return ldns_status |
| 50 | */ |
| 51 | ldns_status ldns_str2rdf_int32(ldns_rdf **rd, const char *longstr); |
| 52 | |
| 53 | /** |
| 54 | * convert a time string to a time value in wireformat |
| 55 | * \param[in] rd the rdf where to put the data |
| 56 | * \param[in] time the string to be converted |
| 57 | * \return ldns_status |
| 58 | */ |
| 59 | ldns_status ldns_str2rdf_time(ldns_rdf **rd, const char *time); |
| 60 | |
| 61 | /* convert string with NSEC3 vars to wireformat) |
| 62 | * \param[in] rd the rdf where to put the data |
| 63 | * \param[in] str the string to be converted |
| 64 | * return ldns_status |
| 65 | */ |
| 66 | ldns_status ldns_str2rdf_nsec3_vars(ldns_rdf **rd, const char *nsec3_vars); |
| 67 | |
| 68 | /* convert string with NSEC3 salt to wireformat) |
| 69 | * \param[in] rd the rdf where to put the data |
| 70 | * \param[in] str the string to be converted |
| 71 | * return ldns_status |
| 72 | */ |
| 73 | ldns_status ldns_str2rdf_nsec3_salt(ldns_rdf **rd, const char *nsec3_salt); |
| 74 | |
| 75 | /* convert a time period (think TTL's) to wireformat) |
| 76 | * \param[in] rd the rdf where to put the data |
| 77 | * \param[in] str the string to be converted |
| 78 | * return ldns_status |
| 79 | */ |
| 80 | ldns_status ldns_str2rdf_period(ldns_rdf **rd, const char *str); |
| 81 | |
| 82 | /** |
| 83 | * convert str with an A record into wireformat |
| 84 | * \param[in] rd the rdf where to put the data |
| 85 | * \param[in] str the string to be converted |
| 86 | * \return ldns_status |
| 87 | */ |
| 88 | ldns_status ldns_str2rdf_a(ldns_rdf **rd, const char *str); |
| 89 | |
| 90 | /** |
| 91 | * convert the str with an AAAA record into wireformat |
| 92 | * \param[in] rd the rdf where to put the data |
| 93 | * \param[in] str the string to be converted |
| 94 | * \return ldns_status |
| 95 | */ |
| 96 | ldns_status ldns_str2rdf_aaaa(ldns_rdf **rd, const char *str); |
| 97 | |
| 98 | /** |
| 99 | * convert a string into wireformat (think txt record) |
| 100 | * \param[in] rd the rdf where to put the data |
| 101 | * \param[in] str the string to be converted (NULL terminated) |
| 102 | * \return ldns_status |
| 103 | */ |
| 104 | ldns_status ldns_str2rdf_str(ldns_rdf **rd, const char *str); |
| 105 | |
| 106 | /** |
| 107 | * convert str with the apl record into wireformat |
| 108 | * \param[in] rd the rdf where to put the data |
| 109 | * \param[in] str the string to be converted |
| 110 | * \return ldns_status |
| 111 | */ |
| 112 | ldns_status ldns_str2rdf_apl(ldns_rdf **rd, const char *str); |
| 113 | |
| 114 | /** |
| 115 | * convert the string with the b64 data into wireformat |
| 116 | * \param[in] rd the rdf where to put the data |
| 117 | * \param[in] str the string to be converted |
| 118 | * \return ldns_status |
| 119 | */ |
| 120 | ldns_status ldns_str2rdf_b64(ldns_rdf **rd, const char *str); |
| 121 | |
| 122 | /** |
| 123 | * convert the string with the b32 ext hex data into wireformat |
| 124 | * \param[in] rd the rdf where to put the data |
| 125 | * \param[in] str the string to be converted |
| 126 | * \return ldns_status |
| 127 | */ |
| 128 | ldns_status ldns_str2rdf_b32_ext(ldns_rdf **rd, const char *str); |
| 129 | |
| 130 | /** |
| 131 | * convert a hex value into wireformat |
| 132 | * \param[in] rd the rdf where to put the data |
| 133 | * \param[in] str the string to be converted |
| 134 | * \return ldns_status |
| 135 | */ |
| 136 | ldns_status ldns_str2rdf_hex(ldns_rdf **rd, const char *str); |
| 137 | |
| 138 | /** |
| 139 | * convert string with nsec into wireformat |
| 140 | * \param[in] rd the rdf where to put the data |
| 141 | * \param[in] str the string to be converted |
| 142 | * \return ldns_status |
| 143 | */ |
| 144 | ldns_status ldns_str2rdf_nsec(ldns_rdf **rd, const char *str); |
| 145 | |
| 146 | /** |
| 147 | * convert a rrtype into wireformat |
| 148 | * \param[in] rd the rdf where to put the data |
| 149 | * \param[in] str the string to be converted |
| 150 | * \return ldns_status |
| 151 | */ |
| 152 | ldns_status ldns_str2rdf_type(ldns_rdf **rd, const char *str); |
| 153 | |
| 154 | /** |
| 155 | * convert string with a classname into wireformat |
| 156 | * \param[in] rd the rdf where to put the data |
| 157 | * \param[in] str the string to be converted |
| 158 | * \return ldns_status |
| 159 | */ |
| 160 | ldns_status ldns_str2rdf_class(ldns_rdf **rd, const char *str); |
| 161 | |
| 162 | /** |
| 163 | * convert string with a CERT RR into wireformat |
| 164 | * \param[in] rd the rdf where to put the data |
| 165 | * \param[in] str the string to be converted |
| 166 | * \return ldns_status |
| 167 | */ |
| 168 | ldns_status ldns_str2rdf_cert(ldns_rdf **rd, const char *str); |
| 169 | |
| 170 | /** |
| 171 | * convert an certificate algorithm value into wireformat |
| 172 | * \param[in] rd the rdf where to put the data |
| 173 | * \param[in] str the string to be converted |
| 174 | * \return ldns_status |
| 175 | */ |
| 176 | ldns_status ldns_str2rdf_cert_alg(ldns_rdf **rd, const char *str); |
| 177 | |
| 178 | /** |
| 179 | * convert and algorithm value into wireformat |
| 180 | * \param[in] rd the rdf where to put the data |
| 181 | * \param[in] str the string to be converted |
| 182 | * \return ldns_status |
| 183 | */ |
| 184 | ldns_status ldns_str2rdf_alg(ldns_rdf **rd, const char *str); |
| 185 | |
| 186 | /** |
| 187 | * convert a string with a unknown RR into wireformat |
| 188 | * \param[in] rd the rdf where to put the data |
| 189 | * \param[in] str the string to be converted |
| 190 | * \return ldns_status |
| 191 | */ |
| 192 | ldns_status ldns_str2rdf_unknown(ldns_rdf **rd, const char *str); |
| 193 | |
| 194 | /** |
| 195 | * convert string with a tsig? RR into wireformat |
| 196 | * \param[in] rd the rdf where to put the data |
| 197 | * \param[in] str the string to be converted |
| 198 | * \return ldns_status |
| 199 | */ |
| 200 | ldns_status ldns_str2rdf_tsig(ldns_rdf **rd, const char *str); |
| 201 | |
| 202 | /** |
| 203 | * convert string with a protocol service into wireformat |
| 204 | * \param[in] rd the rdf where to put the data |
| 205 | * \param[in] str the string to be converted |
| 206 | * \return ldns_status |
| 207 | */ |
| 208 | ldns_status ldns_str2rdf_service(ldns_rdf **rd, const char *str); |
| 209 | |
| 210 | /** |
| 211 | * convert a string with a LOC RR into wireformat |
| 212 | * \param[in] rd the rdf where to put the data |
| 213 | * \param[in] str the string to be converted |
| 214 | * \return ldns_status |
| 215 | */ |
| 216 | ldns_status ldns_str2rdf_loc(ldns_rdf **rd, const char *str); |
| 217 | |
| 218 | /** |
| 219 | * convert string with a WKS RR into wireformat |
| 220 | * \param[in] rd the rdf where to put the data |
| 221 | * \param[in] str the string to be converted |
| 222 | * \return ldns_status |
| 223 | */ |
| 224 | ldns_status ldns_str2rdf_wks(ldns_rdf **rd, const char *str); |
| 225 | |
| 226 | /** |
| 227 | * convert a str with a NSAP RR into wireformat |
| 228 | * \param[in] rd the rdf where to put the data |
| 229 | * \param[in] str the string to be converted |
| 230 | * \return ldns_status |
| 231 | */ |
| 232 | ldns_status ldns_str2rdf_nsap(ldns_rdf **rd, const char *str); |
| 233 | |
| 234 | /** |
| 235 | * convert a dname string into wireformat |
| 236 | * \param[in] rd the rdf where to put the data |
| 237 | * \param[in] str the string to be converted |
| 238 | * \return ldns_status |
| 239 | */ |
| 240 | ldns_status ldns_str2rdf_dname(ldns_rdf **rd, const char *str); |
| 241 | |
| 242 | #endif /* LDNS_2HOST_H */ |
Note: See TracBrowser
for help on using the browser.








