home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / dns / ds.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-09-17  |  1.8 KB  |  64 lines

  1. /*
  2.  * Copyright (C) 2004-2006  Internet Systems Consortium, Inc. ("ISC")
  3.  * Copyright (C) 2002  Internet Software Consortium.
  4.  *
  5.  * Permission to use, copy, modify, and distribute this software for any
  6.  * purpose with or without fee is hereby granted, provided that the above
  7.  * copyright notice and this permission notice appear in all copies.
  8.  *
  9.  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  10.  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  11.  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  12.  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  13.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  14.  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15.  * PERFORMANCE OF THIS SOFTWARE.
  16.  */
  17.  
  18. /* $Id: ds.h,v 1.3.20.5 2006/02/22 23:50:09 marka Exp $ */
  19.  
  20. #ifndef DNS_DS_H
  21. #define DNS_DS_H 1
  22.  
  23. #include <isc/lang.h>
  24.  
  25. #include <dns/types.h>
  26.  
  27. #define DNS_DSDIGEST_SHA1 (1)
  28. #define DNS_DSDIGEST_SHA256 (2)
  29.  
  30. /*
  31.  * Assuming SHA-256 digest type.
  32.  */
  33. #define DNS_DS_BUFFERSIZE (36)
  34.  
  35. ISC_LANG_BEGINDECLS
  36.  
  37. isc_result_t
  38. dns_ds_buildrdata(dns_name_t *owner, dns_rdata_t *key,
  39.           unsigned int digest_type, unsigned char *buffer,
  40.           dns_rdata_t *rdata);
  41. /*%<
  42.  * Build the rdata of a DS record.
  43.  *
  44.  * Requires:
  45.  *\li    key    Points to a valid DNS KEY record.
  46.  *\li    buffer    Points to a temporary buffer of at least
  47.  *         #DNS_DS_BUFFERSIZE bytes.
  48.  *\li    rdata    Points to an initialized dns_rdata_t.
  49.  *
  50.  * Ensures:
  51.  *  \li    *rdata    Contains a valid DS rdata.  The 'data' member refers
  52.  *        to 'buffer'.
  53.  */
  54.  
  55. isc_boolean_t
  56. dns_ds_digest_supported(unsigned int digest_type);
  57. /*%<
  58.  * Is this digest algorithm supported by dns_ds_buildrdata()?
  59.  */
  60.  
  61. ISC_LANG_ENDDECLS
  62.  
  63. #endif /* DNS_DS_H */
  64.