2 * str2host.h - conversion from str to the host fmt
4 * a Net::DNS like library for C
6 * (c) NLnet Labs, 2005-2006
8 * See the file LICENSE for the license
14 #include <ldns/common.h>
15 #include <ldns/error.h>
17 #include <ldns/rdata.h>
18 #include <ldns/packet.h>
19 #include <ldns/buffer.h>
29 * Defines functions to convert dns data in presentation format or text files
30 * to internal structures.
34 * convert a byte into wireformat
35 * \param[in] rd the rdf where to put the data
36 * \param[in] bytestr the string to be converted
39 ldns_status ldns_str2rdf_int8(ldns_rdf **rd, const char *bytestr);
42 * convert a string to a int16 in wireformat
43 * \param[in] rd the rdf where to put the data
44 * \param[in] shortstr the string to be converted
47 ldns_status ldns_str2rdf_int16(ldns_rdf **rd, const char *shortstr);
50 * convert a strings into a 4 byte int in wireformat
51 * \param[in] rd the rdf where to put the data
52 * \param[in] longstr the string to be converted
55 ldns_status ldns_str2rdf_int32(ldns_rdf **rd, const char *longstr);
58 * convert a time string to a time value in wireformat
59 * \param[in] rd the rdf where to put the data
60 * \param[in] time the string to be converted
63 ldns_status ldns_str2rdf_time(ldns_rdf **rd, const char *time);
65 /* convert string with NSEC3 salt to wireformat)
66 * \param[in] rd the rdf where to put the data
67 * \param[in] str the string to be converted
70 ldns_status ldns_str2rdf_nsec3_salt(ldns_rdf **rd, const char *nsec3_salt);
72 /* convert a time period (think TTL's) to wireformat)
73 * \param[in] rd the rdf where to put the data
74 * \param[in] str the string to be converted
77 ldns_status ldns_str2rdf_period(ldns_rdf **rd, const char *str);
80 * convert str with an A record into wireformat
81 * \param[in] rd the rdf where to put the data
82 * \param[in] str the string to be converted
85 ldns_status ldns_str2rdf_a(ldns_rdf **rd, const char *str);
88 * convert the str with an AAAA record into wireformat
89 * \param[in] rd the rdf where to put the data
90 * \param[in] str the string to be converted
93 ldns_status ldns_str2rdf_aaaa(ldns_rdf **rd, const char *str);
96 * convert a string into wireformat (think txt record)
97 * \param[in] rd the rdf where to put the data
98 * \param[in] str the string to be converted (NULL terminated)
101 ldns_status ldns_str2rdf_str(ldns_rdf **rd, const char *str);
104 * convert str with the apl record into wireformat
105 * \param[in] rd the rdf where to put the data
106 * \param[in] str the string to be converted
107 * \return ldns_status
109 ldns_status ldns_str2rdf_apl(ldns_rdf **rd, const char *str);
112 * convert the string with the b64 data into wireformat
113 * \param[in] rd the rdf where to put the data
114 * \param[in] str the string to be converted
115 * \return ldns_status
117 ldns_status ldns_str2rdf_b64(ldns_rdf **rd, const char *str);
120 * convert the string with the b32 ext hex data into wireformat
121 * \param[in] rd the rdf where to put the data
122 * \param[in] str the string to be converted
123 * \return ldns_status
125 ldns_status ldns_str2rdf_b32_ext(ldns_rdf **rd, const char *str);
128 * convert a hex value into wireformat
129 * \param[in] rd the rdf where to put the data
130 * \param[in] str the string to be converted
131 * \return ldns_status
133 ldns_status ldns_str2rdf_hex(ldns_rdf **rd, const char *str);
136 * convert string with nsec into wireformat
137 * \param[in] rd the rdf where to put the data
138 * \param[in] str the string to be converted
139 * \return ldns_status
141 ldns_status ldns_str2rdf_nsec(ldns_rdf **rd, const char *str);
144 * convert a rrtype into wireformat
145 * \param[in] rd the rdf where to put the data
146 * \param[in] str the string to be converted
147 * \return ldns_status
149 ldns_status ldns_str2rdf_type(ldns_rdf **rd, const char *str);
152 * convert string with a classname into wireformat
153 * \param[in] rd the rdf where to put the data
154 * \param[in] str the string to be converted
155 * \return ldns_status
157 ldns_status ldns_str2rdf_class(ldns_rdf **rd, const char *str);
160 * convert an certificate algorithm value into wireformat
161 * \param[in] rd the rdf where to put the data
162 * \param[in] str the string to be converted
163 * \return ldns_status
165 ldns_status ldns_str2rdf_cert_alg(ldns_rdf **rd, const char *str);
168 * convert and algorithm value into wireformat
169 * \param[in] rd the rdf where to put the data
170 * \param[in] str the string to be converted
171 * \return ldns_status
173 ldns_status ldns_str2rdf_alg(ldns_rdf **rd, const char *str);
176 * convert a string with a unknown RR into wireformat
177 * \param[in] rd the rdf where to put the data
178 * \param[in] str the string to be converted
179 * \return ldns_status
181 ldns_status ldns_str2rdf_unknown(ldns_rdf **rd, const char *str);
184 * convert string with a tsig? RR into wireformat
185 * \param[in] rd the rdf where to put the data
186 * \param[in] str the string to be converted
187 * \return ldns_status
189 ldns_status ldns_str2rdf_tsig(ldns_rdf **rd, const char *str);
192 * convert string with a protocol service into wireformat
193 * \param[in] rd the rdf where to put the data
194 * \param[in] str the string to be converted
195 * \return ldns_status
197 ldns_status ldns_str2rdf_service(ldns_rdf **rd, const char *str);
200 * convert a string with a LOC RR into wireformat
201 * \param[in] rd the rdf where to put the data
202 * \param[in] str the string to be converted
203 * \return ldns_status
205 ldns_status ldns_str2rdf_loc(ldns_rdf **rd, const char *str);
208 * convert string with a WKS RR into wireformat
209 * \param[in] rd the rdf where to put the data
210 * \param[in] str the string to be converted
211 * \return ldns_status
213 ldns_status ldns_str2rdf_wks(ldns_rdf **rd, const char *str);
216 * convert a str with a NSAP RR into wireformat
217 * \param[in] rd the rdf where to put the data
218 * \param[in] str the string to be converted
219 * \return ldns_status
221 ldns_status ldns_str2rdf_nsap(ldns_rdf **rd, const char *str);
224 * convert a str with a ATMA RR into wireformat
225 * \param[in] rd the rdf where to put the data
226 * \param[in] str the string to be converted
227 * \return ldns_status
229 ldns_status ldns_str2rdf_atma(ldns_rdf **rd, const char *str);
232 * convert a str with a IPSECKEY RR into wireformat
233 * \param[in] rd the rdf where to put the data
234 * \param[in] str the string to be converted
235 * \return ldns_status
237 ldns_status ldns_str2rdf_ipseckey(ldns_rdf **rd, const char *str);
240 * convert a dname string into wireformat
241 * \param[in] rd the rdf where to put the data
242 * \param[in] str the string to be converted
243 * \return ldns_status
245 ldns_status ldns_str2rdf_dname(ldns_rdf **rd, const char *str);
251 #endif /* LDNS_2HOST_H */