~andreserl/ubuntu/lucid/bind9/bind9-apport-533601

« back to all changes in this revision

Viewing changes to lib/dns/rdata/generic/ipseckey_45.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2010-03-01 20:51:23 UTC
  • mfrom: (1.6.4 upstream) (10.1.5 experimental)
  • Revision ID: james.westby@ubuntu.com-20100301205123-kslpwaipx72vq1o1
Tags: 1:9.7.0.dfsg-1~build1
upload of -1 to lucid, LP#530107

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 * PERFORMANCE OF THIS SOFTWARE.
15
15
 */
16
16
 
17
 
/* $Id: ipseckey_45.c,v 1.4.332.2 2009/01/18 23:47:41 tbox Exp $ */
 
17
/* $Id: ipseckey_45.c,v 1.9 2009/12/04 22:06:37 tbox Exp $ */
18
18
 
19
19
#ifndef RDATA_GENERIC_IPSECKEY_45_C
20
20
#define RDATA_GENERIC_IPSECKEY_45_C
243
243
                isc_buffer_forward(source, 3);
244
244
                RETERR(dns_name_fromwire(&name, source, dctx, options, target));
245
245
                isc_buffer_activeregion(source, &region);
 
246
                isc_buffer_forward(source, region.length);
246
247
                return(mem_tobuffer(target, region.base, region.length));
247
248
 
248
249
        default:
459
460
        return (ISC_TRUE);
460
461
}
461
462
 
 
463
static inline int
 
464
casecompare_ipseckey(ARGS_COMPARE) {
 
465
        isc_region_t region1;
 
466
        isc_region_t region2;
 
467
        dns_name_t name1;
 
468
        dns_name_t name2;
 
469
        int order;
 
470
 
 
471
        REQUIRE(rdata1->type == rdata2->type);
 
472
        REQUIRE(rdata1->rdclass == rdata2->rdclass);
 
473
        REQUIRE(rdata1->type == 45);
 
474
        REQUIRE(rdata1->length >= 3);
 
475
        REQUIRE(rdata2->length >= 3);
 
476
 
 
477
        dns_rdata_toregion(rdata1, &region1);
 
478
        dns_rdata_toregion(rdata2, &region2);
 
479
 
 
480
        if (memcmp(region1.base, region2.base, 3) != 0 || region1.base[1] != 3)
 
481
                return (isc_region_compare(&region1, &region2));
 
482
 
 
483
        dns_name_init(&name1, NULL);
 
484
        dns_name_init(&name2, NULL);
 
485
 
 
486
        isc_region_consume(&region1, 3);
 
487
        isc_region_consume(&region2, 3);
 
488
 
 
489
        dns_name_fromregion(&name1, &region1);
 
490
        dns_name_fromregion(&name2, &region2);
 
491
 
 
492
        order = dns_name_rdatacompare(&name1, &name2);
 
493
        if (order != 0)
 
494
                return (order);
 
495
 
 
496
        isc_region_consume(&region1, name_length(&name1));
 
497
        isc_region_consume(&region2, name_length(&name2));
 
498
 
 
499
        return (isc_region_compare(&region1, &region2));
 
500
}
 
501
 
462
502
#endif  /* RDATA_GENERIC_IPSECKEY_45_C */