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

« back to all changes in this revision

Viewing changes to lib/dns/rdata/generic/nsec_47.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:
1
1
/*
2
 
 * Copyright (C) 2004, 2007, 2008  Internet Systems Consortium, Inc. ("ISC")
 
2
 * Copyright (C) 2004, 2007-2009  Internet Systems Consortium, Inc. ("ISC")
3
3
 * Copyright (C) 2003  Internet Software Consortium.
4
4
 *
5
5
 * Permission to use, copy, modify, and/or distribute this software for any
15
15
 * PERFORMANCE OF THIS SOFTWARE.
16
16
 */
17
17
 
18
 
/* $Id: nsec_47.c,v 1.11 2008/07/15 23:47:21 tbox Exp $ */
 
18
/* $Id: nsec_47.c,v 1.13 2009/12/04 22:06:37 tbox Exp $ */
19
19
 
20
20
/* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */
21
21
 
363
363
        return (ISC_TRUE);
364
364
}
365
365
 
 
366
static inline int
 
367
casecompare_nsec(ARGS_COMPARE) {
 
368
        isc_region_t region1;
 
369
        isc_region_t region2;
 
370
        dns_name_t name1;
 
371
        dns_name_t name2;
 
372
        int order;
 
373
 
 
374
        REQUIRE(rdata1->type == rdata2->type);
 
375
        REQUIRE(rdata1->rdclass == rdata2->rdclass);
 
376
        REQUIRE(rdata1->type == 47);
 
377
        REQUIRE(rdata1->length != 0);
 
378
        REQUIRE(rdata2->length != 0);
 
379
 
 
380
        dns_name_init(&name1, NULL);
 
381
        dns_name_init(&name2, NULL);
 
382
 
 
383
        dns_rdata_toregion(rdata1, &region1);
 
384
        dns_rdata_toregion(rdata2, &region2);
 
385
 
 
386
        dns_name_fromregion(&name1, &region1);
 
387
        dns_name_fromregion(&name2, &region2);
 
388
 
 
389
        order = dns_name_rdatacompare(&name1, &name2);
 
390
        if (order != 0)
 
391
                return (order);
 
392
 
 
393
        isc_region_consume(&region1, name_length(&name1));
 
394
        isc_region_consume(&region2, name_length(&name2));
 
395
 
 
396
        return (isc_region_compare(&region1, &region2));
 
397
}
366
398
#endif  /* RDATA_GENERIC_NSEC_47_C */