Lines Matching defs:rrset
36 * rrset. The resource records contained in #rri_rdatas and #rri_sigs are
46 * lwres_freerrset(). rrset is a pointer to a struct rrset created by a
149 struct rrsetinfo *rrset = NULL;
190 rrset = sane_malloc(sizeof(struct rrsetinfo));
191 if (rrset == NULL) {
195 rrset->rri_name = NULL;
196 rrset->rri_rdclass = response->rdclass;
197 rrset->rri_rdtype = response->rdtype;
198 rrset->rri_ttl = response->ttl;
199 rrset->rri_flags = 0;
200 rrset->rri_nrdatas = 0;
201 rrset->rri_rdatas = NULL;
202 rrset->rri_nsigs = 0;
203 rrset->rri_sigs = NULL;
205 rrset->rri_name = sane_malloc(response->realnamelen + 1);
206 if (rrset->rri_name == NULL) {
210 strncpy(rrset->rri_name, response->realname, response->realnamelen);
211 rrset->rri_name[response->realnamelen] = 0;
214 rrset->rri_flags |= RRSET_VALIDATED;
216 rrset->rri_nrdatas = response->nrdatas;
217 rrset->rri_rdatas = sane_calloc(rrset->rri_nrdatas,
219 if (rrset->rri_rdatas == NULL) {
223 for (i = 0; i < rrset->rri_nrdatas; i++) {
224 rrset->rri_rdatas[i].rdi_length = response->rdatalen[i];
225 rrset->rri_rdatas[i].rdi_data =
226 sane_malloc(rrset->rri_rdatas[i].rdi_length);
227 if (rrset->rri_rdatas[i].rdi_data == NULL) {
231 memmove(rrset->rri_rdatas[i].rdi_data, response->rdatas[i],
232 rrset->rri_rdatas[i].rdi_length);
234 rrset->rri_nsigs = response->nsigs;
235 rrset->rri_sigs = sane_calloc(rrset->rri_nsigs,
237 if (rrset->rri_sigs == NULL) {
241 for (i = 0; i < rrset->rri_nsigs; i++) {
242 rrset->rri_sigs[i].rdi_length = response->siglen[i];
243 rrset->rri_sigs[i].rdi_data =
244 sane_malloc(rrset->rri_sigs[i].rdi_length);
245 if (rrset->rri_sigs[i].rdi_data == NULL) {
249 memmove(rrset->rri_sigs[i].rdi_data, response->sigs[i],
250 rrset->rri_sigs[i].rdi_length);
256 *res = rrset;
259 if (rrset != NULL)
260 lwres_freerrset(rrset);
272 lwres_freerrset(struct rrsetinfo *rrset) {
274 if (rrset->rri_rdatas != NULL) {
275 for (i = 0; i < rrset->rri_nrdatas; i++) {
276 if (rrset->rri_rdatas[i].rdi_data == NULL)
278 free(rrset->rri_rdatas[i].rdi_data);
280 free(rrset->rri_rdatas);
282 if (rrset->rri_sigs != NULL) {
283 for (i = 0; i < rrset->rri_nsigs; i++) {
284 if (rrset->rri_sigs[i].rdi_data == NULL)
286 free(rrset->rri_sigs[i].rdi_data);
288 free(rrset->rri_sigs);
290 free(rrset->rri_name);
291 free(rrset);