Lines Matching defs:notify

84 #define DNS_NOTIFY_VALID(notify)	ISC_MAGIC_VALID(notify, NOTIFY_MAGIC)
225 isc_sockaddr_t *notify;
350 #define DNS_ZONEFLG_NEEDNOTIFY 0x00000400U /*%< need to send out notify
436 * Hold notify state.
601 static void notify_find_address(dns_notify_t *notify);
602 static void notify_send(dns_notify_t *notify);
757 zone->notify = NULL;
3387 dns_zone_setalsonotify(dns_zone_t *zone, const isc_sockaddr_t *notify,
3393 REQUIRE(count == 0 || notify != NULL);
3396 if (zone->notify != NULL) {
3397 isc_mem_put(zone->mctx, zone->notify,
3399 zone->notify = NULL;
3408 memmove(new, notify, count * sizeof(*new));
3409 zone->notify = new;
6212 * Do we need to send out notify messages?
6635 dns_notify_t *notify;
6643 for (notify = ISC_LIST_HEAD(zone->notifies);
6644 notify != NULL;
6645 notify = ISC_LIST_NEXT(notify, link)) {
6646 if (notify->find != NULL)
6647 dns_adb_cancelfind(notify->find);
6648 if (notify->request != NULL)
6649 dns_request_cancel(notify->request);
6729 dns_notify_t *notify;
6731 for (notify = ISC_LIST_HEAD(zone->notifies);
6732 notify != NULL;
6733 notify = ISC_LIST_NEXT(notify, link)) {
6734 if (notify->request != NULL)
6736 if (name != NULL && dns_name_dynamic(&notify->ns) &&
6737 dns_name_equal(name, &notify->ns))
6739 if (addr != NULL && isc_sockaddr_equal(addr, &notify->dst))
6789 notify_destroy(dns_notify_t *notify, isc_boolean_t locked) {
6795 REQUIRE(DNS_NOTIFY_VALID(notify));
6797 if (notify->zone != NULL) {
6799 LOCK_ZONE(notify->zone);
6800 REQUIRE(LOCKED_ZONE(notify->zone));
6801 if (ISC_LINK_LINKED(notify, link))
6802 ISC_LIST_UNLINK(notify->zone->notifies, notify, link);
6804 UNLOCK_ZONE(notify->zone);
6806 zone_idetach(&notify->zone);
6808 dns_zone_idetach(&notify->zone);
6810 if (notify->find != NULL)
6811 dns_adb_destroyfind(&notify->find);
6812 if (notify->request != NULL)
6813 dns_request_destroy(&notify->request);
6814 if (dns_name_dynamic(&notify->ns))
6815 dns_name_free(&notify->ns, notify->mctx);
6816 mctx = notify->mctx;
6817 isc_mem_put(notify->mctx, notify, sizeof(*notify));
6823 dns_notify_t *notify;
6827 notify = isc_mem_get(mctx, sizeof(*notify));
6828 if (notify == NULL)
6831 notify->mctx = NULL;
6832 isc_mem_attach(mctx, &notify->mctx);
6833 notify->flags = flags;
6834 notify->zone = NULL;
6835 notify->find = NULL;
6836 notify->request = NULL;
6837 isc_sockaddr_any(&notify->dst);
6838 dns_name_init(&notify->ns, NULL);
6839 ISC_LINK_INIT(notify, link);
6840 notify->magic = NOTIFY_MAGIC;
6841 *notifyp = notify;
6850 dns_notify_t *notify;
6855 notify = ev->ev_arg;
6856 REQUIRE(DNS_NOTIFY_VALID(notify));
6857 INSIST(task == notify->zone->task);
6861 dns_adb_destroyfind(&notify->find);
6862 notify_find_address(notify);
6866 LOCK_ZONE(notify->zone);
6867 notify_send(notify);
6868 UNLOCK_ZONE(notify->zone);
6870 notify_destroy(notify, ISC_FALSE);
6874 notify_find_address(dns_notify_t *notify) {
6878 REQUIRE(DNS_NOTIFY_VALID(notify));
6882 if (notify->zone->view->adb == NULL)
6885 result = dns_adb_createfind(notify->zone->view->adb,
6886 notify->zone->task,
6887 process_adb_event, notify,
6888 &notify->ns, dns_rootname, 0,
6890 notify->zone->view->dstport,
6891 &notify->find);
6898 if ((notify->find->options & DNS_ADBFIND_WANTEVENT) != 0)
6902 LOCK_ZONE(notify->zone);
6903 notify_send(notify);
6904 UNLOCK_ZONE(notify->zone);
6907 notify_destroy(notify, ISC_FALSE);
6912 notify_send_queue(dns_notify_t *notify) {
6916 e = isc_event_allocate(notify->mctx, NULL,
6919 notify, sizeof(isc_event_t));
6922 e->ev_arg = notify;
6924 result = isc_ratelimiter_enqueue(notify->zone->zmgr->notifyrl,
6925 notify->zone->task, &e);
6933 dns_notify_t *notify;
6943 notify = event->ev_arg;
6944 REQUIRE(DNS_NOTIFY_VALID(notify));
6948 LOCK_ZONE(notify->zone);
6950 if (DNS_ZONE_FLAG(notify->zone, DNS_ZONEFLG_LOADED) == 0) {
6956 DNS_ZONE_FLAG(notify->zone, DNS_ZONEFLG_EXITING) ||
6957 notify->zone->view->requestmgr == NULL ||
6958 notify->zone->db == NULL) {
6967 if (isc_sockaddr_pf(&notify->dst) == PF_INET6 &&
6968 IN6_IS_ADDR_V4MAPPED(&notify->dst.type.sin6.sin6_addr)) {
6969 isc_sockaddr_format(&notify->dst, addrbuf, sizeof(addrbuf));
6970 notify_log(notify->zone, ISC_LOG_DEBUG(3),
6971 "notify: ignoring IPv6 mapped IPV4 address: %s",
6977 result = notify_createmessage(notify->zone, notify->flags, &message);
6981 isc_netaddr_fromsockaddr(&dstip, &notify->dst);
6982 isc_sockaddr_format(&notify->dst, addrbuf, sizeof(addrbuf));
6983 result = dns_view_getpeertsig(notify->zone->view, &dstip, &key);
6985 notify_log(notify->zone, ISC_LOG_ERROR, "NOTIFY to %s not "
6990 notify_log(notify->zone, ISC_LOG_DEBUG(3), "sending notify to %s",
6992 if (notify->zone->view->peers != NULL) {
6994 result = dns_peerlist_peerbyaddr(notify->zone->view->peers,
7002 switch (isc_sockaddr_pf(&notify->dst)) {
7005 src = notify->zone->notifysrc4;
7009 src = notify->zone->notifysrc6;
7016 if (DNS_ZONE_FLAG(notify->zone, DNS_ZONEFLG_DIALNOTIFY))
7018 result = dns_request_createvia2(notify->zone->view->requestmgr,
7019 message, &src, &notify->dst, 0, key,
7021 notify->zone->task, notify_done,
7022 notify, &notify->request);
7024 if (isc_sockaddr_pf(&notify->dst) == AF_INET) {
7025 inc_stats(notify->zone,
7028 inc_stats(notify->zone,
7039 UNLOCK_ZONE(notify->zone);
7042 notify_destroy(notify, ISC_FALSE);
7046 notify_send(dns_notify_t *notify) {
7055 REQUIRE(DNS_NOTIFY_VALID(notify));
7056 REQUIRE(LOCKED_ZONE(notify->zone));
7058 for (ai = ISC_LIST_HEAD(notify->find->list);
7062 if (notify_isqueued(notify->zone, NULL, &dst))
7064 if (notify_isself(notify->zone, &dst))
7067 result = notify_create(notify->mctx,
7068 (notify->flags & DNS_NOTIFY_NOSOA),
7072 zone_iattach(notify->zone, &new->zone);
7114 dns_notify_t *notify = NULL;
7187 * Enqueue notify requests for 'also-notify' servers.
7191 dst = zone->notify[i];
7194 result = notify_create(zone->mctx, flags, &notify);
7197 zone_iattach(zone, &notify->zone);
7198 notify->dst = dst;
7199 ISC_LIST_APPEND(zone->notifies, notify, link);
7200 result = notify_send_queue(notify);
7202 notify_destroy(notify, ISC_TRUE);
7209 notify = NULL;
7233 * Don't notify the master server unless explicitly
7256 result = notify_create(zone->mctx, flags, &notify);
7259 dns_zone_iattach(zone, &notify->zone);
7260 result = dns_name_dup(&ns.name, zone->mctx, &notify->ns);
7263 notify_destroy(notify, ISC_TRUE);
7268 ISC_LIST_APPEND(zone->notifies, notify, link);
7270 notify_find_address(notify);
7271 notify = NULL;
8967 * Check that 'from' is a valid notify source, (zone->masters).
8970 * If the notify message contains a serial number check it
9032 * Accept notify requests from non masters if they are on
9041 /* Accept notify. */
9045 "refused notify from non-master: %s", fromtext);
9053 * check if we are a dialup zone as we use the notify request
9084 "notify from %s: "
9095 * let it complete. Record where we got the notify from so we
9103 "notify from %s: refresh in progress, "
9645 dns_notify_t *notify;
9654 notify = event->ev_arg;
9655 REQUIRE(DNS_NOTIFY_VALID(notify));
9656 INSIST(task == notify->zone->task);
9659 isc_sockaddr_format(&notify->dst, addrbuf, sizeof(addrbuf));
9663 result = dns_message_create(notify->zone->mctx,
9671 notify_log(notify->zone, ISC_LOG_DEBUG(3),
9672 "notify response from %s: %.*s",
9675 notify_log(notify->zone, ISC_LOG_DEBUG(2),
9676 "notify to %s failed: %s", addrbuf,
9685 (notify->flags & DNS_NOTIFY_NOSOA) == 0) {
9686 notify->flags |= DNS_NOTIFY_NOSOA;
9687 dns_request_destroy(&notify->request);
9688 result = notify_send_queue(notify);
9690 notify_destroy(notify, ISC_FALSE);
9693 notify_log(notify->zone, ISC_LOG_DEBUG(1),
9694 "notify to %s: retries exceeded", addrbuf);
9695 notify_destroy(notify, ISC_FALSE);
11627 "notify = %d, refresh = %d",