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>
25 * Defines functions to convert dns data in presentation format or text files
26 * to internal structures.
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
35 ldns_status ldns_str2rdf_int8(ldns_rdf **rd, const char *bytestr);
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
43 ldns_status ldns_str2rdf_int16(ldns_rdf **rd, const char *shortstr);
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
51 ldns_status ldns_str2rdf_int32(ldns_rdf **rd, const char *longstr);
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
59 ldns_status ldns_str2rdf_time(ldns_rdf **rd, const char *time);
61 /* convert string with NSEC3 salt to wireformat)
62 * \param[in] rd the rdf where to put the data
63 * \param[in] str the string to be converted
66 ldns_status ldns_str2rdf_nsec3_salt(ldns_rdf **rd, const char *nsec3_salt);
68 /* convert a time period (think TTL's) to wireformat)
69 * \param[in] rd the rdf where to put the data
70 * \param[in] str the string to be converted
73 ldns_status ldns_str2rdf_period(ldns_rdf **rd, const char *str);
76 * convert str with an A record into wireformat
77 * \param[in] rd the rdf where to put the data
78 * \param[in] str the string to be converted
81 ldns_status ldns_str2rdf_a(ldns_rdf **rd, const char *str);
84 * convert the str with an AAAA record into wireformat
85 * \param[in] rd the rdf where to put the data
86 * \param[in] str the string to be converted
89 ldns_status ldns_str2rdf_aaaa(ldns_rdf **rd, const char *str);
92 * convert a string into wireformat (think txt record)
93 * \param[in] rd the rdf where to put the data
94 * \param[in] str the string to be converted (NULL terminated)
97 ldns_status ldns_str2rdf_str(ldns_rdf **rd, const char *str);
100 * convert str with the apl record into wireformat
101 * \param[in] rd the rdf where to put the data
102 * \param[in] str the string to be converted
103 * \return ldns_status
105 ldns_status ldns_str2rdf_apl(ldns_rdf **rd, const char *str);
108 * convert the string with the b64 data into wireformat
109 * \param[in] rd the rdf where to put the data
110 * \param[in] str the string to be converted
111 * \return ldns_status
113 ldns_status ldns_str2rdf_b64(ldns_rdf **rd, const char *str);
116 * convert the string with the b32 ext hex data into wireformat
117 * \param[in] rd the rdf where to put the data
118 * \param[in] str the string to be converted
119 * \return ldns_status
121 ldns_status ldns_str2rdf_b32_ext(ldns_rdf **rd, const char *str);
124 * convert a hex value into wireformat
125 * \param[in] rd the rdf where to put the data
126 * \param[in] str the string to be converted
127 * \return ldns_status
129 ldns_status ldns_str2rdf_hex(ldns_rdf **rd, const char *str);
132 * convert string with nsec into wireformat
133 * \param[in] rd the rdf where to put the data
134 * \param[in] str the string to be converted
135 * \return ldns_status
137 ldns_status ldns_str2rdf_nsec(ldns_rdf **rd, const char *str);
140 * convert a rrtype into wireformat
141 * \param[in] rd the rdf where to put the data
142 * \param[in] str the string to be converted
143 * \return ldns_status
145 ldns_status ldns_str2rdf_type(ldns_rdf **rd, const char *str);
148 * convert string with a classname into wireformat
149 * \param[in] rd the rdf where to put the data
150 * \param[in] str the string to be converted
151 * \return ldns_status
153 ldns_status ldns_str2rdf_class(ldns_rdf **rd, const char *str);
156 * convert an certificate algorithm value into wireformat
157 * \param[in] rd the rdf where to put the data
158 * \param[in] str the string to be converted
159 * \return ldns_status
161 ldns_status ldns_str2rdf_cert_alg(ldns_rdf **rd, const char *str);
164 * convert and algorithm value into wireformat
165 * \param[in] rd the rdf where to put the data
166 * \param[in] str the string to be converted
167 * \return ldns_status
169 ldns_status ldns_str2rdf_alg(ldns_rdf **rd, const char *str);
172 * convert a string with a unknown RR into wireformat
173 * \param[in] rd the rdf where to put the data
174 * \param[in] str the string to be converted
175 * \return ldns_status
177 ldns_status ldns_str2rdf_unknown(ldns_rdf **rd, const char *str);
180 * convert string with a tsig? RR into wireformat
181 * \param[in] rd the rdf where to put the data
182 * \param[in] str the string to be converted
183 * \return ldns_status
185 ldns_status ldns_str2rdf_tsig(ldns_rdf **rd, const char *str);
188 * convert string with a protocol service into wireformat
189 * \param[in] rd the rdf where to put the data
190 * \param[in] str the string to be converted
191 * \return ldns_status
193 ldns_status ldns_str2rdf_service(ldns_rdf **rd, const char *str);
196 * convert a string with a LOC RR into wireformat
197 * \param[in] rd the rdf where to put the data
198 * \param[in] str the string to be converted
199 * \return ldns_status
201 ldns_status ldns_str2rdf_loc(ldns_rdf **rd, const char *str);
204 * convert string with a WKS RR into wireformat
205 * \param[in] rd the rdf where to put the data
206 * \param[in] str the string to be converted
207 * \return ldns_status
209 ldns_status ldns_str2rdf_wks(ldns_rdf **rd, const char *str);
212 * convert a str with a NSAP RR into wireformat
213 * \param[in] rd the rdf where to put the data
214 * \param[in] str the string to be converted
215 * \return ldns_status
217 ldns_status ldns_str2rdf_nsap(ldns_rdf **rd, const char *str);
220 * convert a str with a ATMA RR into wireformat
221 * \param[in] rd the rdf where to put the data
222 * \param[in] str the string to be converted
223 * \return ldns_status
225 ldns_status ldns_str2rdf_atma(ldns_rdf **rd, const char *str);
228 * convert a str with a IPSECKEY RR into wireformat
229 * \param[in] rd the rdf where to put the data
230 * \param[in] str the string to be converted
231 * \return ldns_status
233 ldns_status ldns_str2rdf_ipseckey(ldns_rdf **rd, const char *str);
236 * convert a dname string into wireformat
237 * \param[in] rd the rdf where to put the data
238 * \param[in] str the string to be converted
239 * \return ldns_status
241 ldns_status ldns_str2rdf_dname(ldns_rdf **rd, const char *str);
243 #endif /* LDNS_2HOST_H */