/contrib/bind9/lib/dns/include/dns/xfrin.h

https://bitbucket.org/freebsd/freebsd-head/ · C Header · 111 lines · 27 code · 18 blank · 66 comment · 0 complexity · ede901dc6c846955890f5dc231c007fa MD5 · raw file

  1. /*
  2. * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
  3. * Copyright (C) 1999-2001, 2003 Internet Software Consortium.
  4. *
  5. * Permission to use, copy, modify, and/or 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. /* $Id: xfrin.h,v 1.30 2009/01/17 23:47:43 tbox Exp $ */
  18. #ifndef DNS_XFRIN_H
  19. #define DNS_XFRIN_H 1
  20. /*****
  21. ***** Module Info
  22. *****/
  23. /*! \file dns/xfrin.h
  24. * \brief
  25. * Incoming zone transfers (AXFR + IXFR).
  26. */
  27. /***
  28. *** Imports
  29. ***/
  30. #include <isc/lang.h>
  31. #include <dns/types.h>
  32. /***
  33. *** Types
  34. ***/
  35. /*%
  36. * A transfer in progress. This is an opaque type.
  37. */
  38. typedef struct dns_xfrin_ctx dns_xfrin_ctx_t;
  39. /***
  40. *** Functions
  41. ***/
  42. ISC_LANG_BEGINDECLS
  43. /*% see dns_xfrin_create2() */
  44. isc_result_t
  45. dns_xfrin_create(dns_zone_t *zone, dns_rdatatype_t xfrtype,
  46. isc_sockaddr_t *masteraddr, dns_tsigkey_t *tsigkey,
  47. isc_mem_t *mctx, isc_timermgr_t *timermgr,
  48. isc_socketmgr_t *socketmgr, isc_task_t *task,
  49. dns_xfrindone_t done, dns_xfrin_ctx_t **xfrp);
  50. isc_result_t
  51. dns_xfrin_create2(dns_zone_t *zone, dns_rdatatype_t xfrtype,
  52. isc_sockaddr_t *masteraddr, isc_sockaddr_t *sourceaddr,
  53. dns_tsigkey_t *tsigkey, isc_mem_t *mctx,
  54. isc_timermgr_t *timermgr, isc_socketmgr_t *socketmgr,
  55. isc_task_t *task, dns_xfrindone_t done,
  56. dns_xfrin_ctx_t **xfrp);
  57. /*%<
  58. * Attempt to start an incoming zone transfer of 'zone'
  59. * from 'masteraddr', creating a dns_xfrin_ctx_t object to
  60. * manage it. Attach '*xfrp' to the newly created object.
  61. *
  62. * Iff ISC_R_SUCCESS is returned, '*done' is guaranteed to be
  63. * called in the context of 'task', with 'zone' and a result
  64. * code as arguments when the transfer finishes.
  65. *
  66. * Requires:
  67. *\li 'xfrtype' is dns_rdatatype_axfr, dns_rdatatype_ixfr
  68. * or dns_rdatatype_soa (soa query followed by axfr if
  69. * serial is greater than current serial).
  70. *
  71. *\li If 'xfrtype' is dns_rdatatype_ixfr or dns_rdatatype_soa,
  72. * the zone has a database.
  73. */
  74. void
  75. dns_xfrin_shutdown(dns_xfrin_ctx_t *xfr);
  76. /*%<
  77. * If the zone transfer 'xfr' has already finished,
  78. * do nothing. Otherwise, abort it and cause it to call
  79. * its done callback with a status of ISC_R_CANCELED.
  80. */
  81. void
  82. dns_xfrin_detach(dns_xfrin_ctx_t **xfrp);
  83. /*%<
  84. * Detach a reference to a zone transfer object.
  85. * Caller to maintain external locking if required.
  86. */
  87. void
  88. dns_xfrin_attach(dns_xfrin_ctx_t *source, dns_xfrin_ctx_t **target);
  89. /*%<
  90. * Caller to maintain external locking if required.
  91. */
  92. ISC_LANG_ENDDECLS
  93. #endif /* DNS_XFRIN_H */