Lines Matching refs:notify

84 #define DNS_NOTIFY_VALID(notify)	ISC_MAGIC_VALID(notify, NOTIFY_MAGIC)
258 isc_sockaddr_t *notify;
464 #define DNS_ZONEFLG_NEEDNOTIFY 0x00000400U /*%< need to send out notify
492 #define DNS_ZONEFLG_NEEDSTARTUPNOTIFY 0x80000000U /*%< need to send out notify
566 * Hold notify state.
781 static void notify_find_address(dns_notify_t *notify);
782 static void notify_send(dns_notify_t *notify);
978 zone->notify = NULL;
5799 dns_zone_setalsonotify(dns_zone_t *zone, const isc_sockaddr_t *notify,
5802 return (dns_zone_setalsonotifydscpkeys(zone, notify, NULL, NULL,
5807 dns_zone_setalsonotifywithkeys(dns_zone_t *zone, const isc_sockaddr_t *notify,
5810 return (dns_zone_setalsonotifydscpkeys(zone, notify, NULL, keynames,
5815 dns_zone_setalsonotifydscpkeys(dns_zone_t *zone, const isc_sockaddr_t *notify,
5825 REQUIRE(count == 0 || notify != NULL);
5832 same_addrs(zone->notify, notify, count) &&
5836 clear_addresskeylist(&zone->notify, &zone->notifydscp,
5844 * Set up the notify and notifykey lists
5846 result = set_addrkeylist(count, notify, &newaddrs, dscps, &newdscps,
5854 zone->notify = newaddrs;
10494 dns_notify_t *notify;
10502 for (notify = ISC_LIST_HEAD(zone->notifies);
10503 notify != NULL;
10504 notify = ISC_LIST_NEXT(notify, link)) {
10505 if (notify->find != NULL)
10506 dns_adb_cancelfind(notify->find);
10507 if (notify->request != NULL)
10508 dns_request_cancel(notify->request);
10603 dns_notify_t *notify;
10607 for (notify = ISC_LIST_HEAD(zone->notifies);
10608 notify != NULL;
10609 notify = ISC_LIST_NEXT(notify, link)) {
10610 if (notify->request != NULL)
10612 if (name != NULL && dns_name_dynamic(&notify->ns) &&
10613 dns_name_equal(name, &notify->ns))
10615 if (addr != NULL && isc_sockaddr_equal(addr, &notify->dst) &&
10616 notify->key == key)
10624 * not a startup notify, re-enqueue on the normal notify
10627 if (notify->event != NULL && (flags & DNS_NOTIFY_STARTUP) == 0 &&
10628 (notify->flags & DNS_NOTIFY_STARTUP) != 0) {
10629 zmgr = notify->zone->zmgr;
10631 notify->event);
10635 notify->flags &= ~DNS_NOTIFY_STARTUP;
10636 result = isc_ratelimiter_enqueue(notify->zone->zmgr->notifyrl,
10637 notify->zone->task,
10638 &notify->event);
10640 isc_event_free(&notify->event);
10692 notify_destroy(dns_notify_t *notify, isc_boolean_t locked) {
10695 REQUIRE(DNS_NOTIFY_VALID(notify));
10697 if (notify->zone != NULL) {
10699 LOCK_ZONE(notify->zone);
10700 REQUIRE(LOCKED_ZONE(notify->zone));
10701 if (ISC_LINK_LINKED(notify, link))
10702 ISC_LIST_UNLINK(notify->zone->notifies, notify, link);
10704 UNLOCK_ZONE(notify->zone);
10706 zone_idetach(&notify->zone);
10708 dns_zone_idetach(&notify->zone);
10710 if (notify->find != NULL)
10711 dns_adb_destroyfind(&notify->find);
10712 if (notify->request != NULL)
10713 dns_request_destroy(&notify->request);
10714 if (dns_name_dynamic(&notify->ns))
10715 dns_name_free(&notify->ns, notify->mctx);
10716 if (notify->key != NULL)
10717 dns_tsigkey_detach(&notify->key);
10718 mctx = notify->mctx;
10719 isc_mem_put(notify->mctx, notify, sizeof(*notify));
10725 dns_notify_t *notify;
10729 notify = isc_mem_get(mctx, sizeof(*notify));
10730 if (notify == NULL)
10733 notify->mctx = NULL;
10734 isc_mem_attach(mctx, &notify->mctx);
10735 notify->flags = flags;
10736 notify->zone = NULL;
10737 notify->find = NULL;
10738 notify->request = NULL;
10739 notify->key = NULL;
10740 notify->event = NULL;
10741 isc_sockaddr_any(&notify->dst);
10742 dns_name_init(&notify->ns, NULL);
10743 ISC_LINK_INIT(notify, link);
10744 notify->magic = NOTIFY_MAGIC;
10745 *notifyp = notify;
10754 dns_notify_t *notify;
10759 notify = ev->ev_arg;
10760 REQUIRE(DNS_NOTIFY_VALID(notify));
10761 INSIST(task == notify->zone->task);
10765 dns_adb_destroyfind(&notify->find);
10766 notify_find_address(notify);
10770 LOCK_ZONE(notify->zone);
10771 notify_send(notify);
10772 UNLOCK_ZONE(notify->zone);
10774 notify_destroy(notify, ISC_FALSE);
10778 notify_find_address(dns_notify_t *notify) {
10782 REQUIRE(DNS_NOTIFY_VALID(notify));
10786 if (notify->zone->view->adb == NULL)
10789 result = dns_adb_createfind(notify->zone->view->adb,
10790 notify->zone->task,
10791 process_adb_event, notify,
10792 &notify->ns, dns_rootname, 0,
10794 notify->zone->view->dstport,
10795 &notify->find);
10802 if ((notify->find->options & DNS_ADBFIND_WANTEVENT) != 0)
10806 LOCK_ZONE(notify->zone);
10807 notify_send(notify);
10808 UNLOCK_ZONE(notify->zone);
10811 notify_destroy(notify, ISC_FALSE);
10816 notify_send_queue(dns_notify_t *notify, isc_boolean_t startup) {
10820 INSIST(notify->event == NULL);
10821 e = isc_event_allocate(notify->mctx, NULL, DNS_EVENT_NOTIFYSENDTOADDR,
10822 notify_send_toaddr, notify, sizeof(isc_event_t));
10826 notify->event = e;
10827 e->ev_arg = notify;
10830 ? notify->zone->zmgr->startupnotifyrl
10831 : notify->zone->zmgr->notifyrl,
10832 notify->zone->task, &e);
10835 notify->event = NULL;
10842 dns_notify_t *notify;
10854 notify = event->ev_arg;
10855 REQUIRE(DNS_NOTIFY_VALID(notify));
10859 LOCK_ZONE(notify->zone);
10861 notify->event = NULL;
10863 if (DNS_ZONE_FLAG(notify->zone, DNS_ZONEFLG_LOADED) == 0) {
10869 DNS_ZONE_FLAG(notify->zone, DNS_ZONEFLG_EXITING) ||
10870 notify->zone->view->requestmgr == NULL ||
10871 notify->zone->db == NULL) {
10880 if (isc_sockaddr_pf(&notify->dst) == PF_INET6 &&
10881 IN6_IS_ADDR_V4MAPPED(&notify->dst.type.sin6.sin6_addr)) {
10882 isc_sockaddr_format(&notify->dst, addrbuf, sizeof(addrbuf));
10883 notify_log(notify->zone, ISC_LOG_DEBUG(3),
10884 "notify: ignoring IPv6 mapped IPV4 address: %s",
10890 result = notify_createmessage(notify->zone, notify->flags, &message);
10894 isc_sockaddr_format(&notify->dst, addrbuf, sizeof(addrbuf));
10895 if (notify->key != NULL) {
10897 key = notify->key;
10898 notify->key = NULL;
10900 isc_netaddr_fromsockaddr(&dstip, &notify->dst);
10901 result = dns_view_getpeertsig(notify->zone->view, &dstip, &key);
10903 notify_log(notify->zone, ISC_LOG_ERROR,
10911 notify_log(notify->zone, ISC_LOG_DEBUG(3), "sending notify to %s",
10914 if (notify->zone->view->peers != NULL) {
10917 result = dns_peerlist_peerbyaddr(notify->zone->view->peers,
10931 switch (isc_sockaddr_pf(&notify->dst)) {
10934 src = notify->zone->notifysrc4;
10936 dscp = notify->zone->notifysrc4dscp;
10940 src = notify->zone->notifysrc6;
10942 dscp = notify->zone->notifysrc6dscp;
10949 if (DNS_ZONE_FLAG(notify->zone, DNS_ZONEFLG_DIALNOTIFY))
10951 result = dns_request_createvia4(notify->zone->view->requestmgr,
10952 message, &src, &notify->dst, dscp,
10954 0, notify->zone->task, notify_done,
10955 notify, &notify->request);
10957 if (isc_sockaddr_pf(&notify->dst) == AF_INET) {
10958 inc_stats(notify->zone,
10961 inc_stats(notify->zone,
10972 UNLOCK_ZONE(notify->zone);
10975 notify_destroy(notify, ISC_FALSE);
10979 notify_send(dns_notify_t *notify) {
10990 REQUIRE(DNS_NOTIFY_VALID(notify));
10991 REQUIRE(LOCKED_ZONE(notify->zone));
10993 if (DNS_ZONE_FLAG(notify->zone, DNS_ZONEFLG_EXITING))
10996 for (ai = ISC_LIST_HEAD(notify->find->list);
11000 if (notify_isqueued(notify->zone, notify->flags, NULL, &dst,
11003 if (notify_isself(notify->zone, &dst))
11006 flags = notify->flags & DNS_NOTIFY_NOSOA;
11007 result = notify_create(notify->mctx, flags, &newnotify);
11010 zone_iattach(notify->zone, &newnotify->zone);
11013 startup = ISC_TF((notify->flags & DNS_NOTIFY_STARTUP) != 0);
11092 * Record that this was a notify due to starting up.
11135 * Enqueue notify requests for 'also-notify' servers.
11140 dns_notify_t *notify = NULL;
11149 dst = zone->notify[i];
11156 result = notify_create(zone->mctx, flags, &notify);
11163 zone_iattach(zone, &notify->zone);
11164 notify->dst = dst;
11166 INSIST(notify->key == NULL);
11169 notify->key = key;
11173 ISC_LIST_APPEND(zone->notifies, notify, link);
11174 result = notify_send_queue(notify, startup);
11176 notify_destroy(notify, ISC_TRUE);
11201 dns_notify_t *notify = NULL;
11208 * Don't notify the master server unless explicitly
11231 result = notify_create(zone->mctx, flags, &notify);
11234 dns_zone_iattach(zone, &notify->zone);
11235 result = dns_name_dup(&ns.name, zone->mctx, &notify->ns);
11238 notify_destroy(notify, ISC_TRUE);
11243 ISC_LIST_APPEND(zone->notifies, notify, link);
11245 notify_find_address(notify);
13102 * Check that 'from' is a valid notify source, (zone->masters).
13105 * If the notify message contains a serial number check it
13176 * Accept notify requests from non masters if they are on
13187 /* Accept notify. */
13191 "refused notify from non-master: %s", fromtext);
13199 * check if we are a dialup zone as we use the notify request
13233 "notify from %s: "
13244 * let it complete. Record where we got the notify from so we
13253 "notify from %s: serial %u: refresh in "
13258 "notify from %s: refresh in progress, "
13263 dns_zone_log(zone, ISC_LOG_INFO, "notify from %s: serial %u",
13266 dns_zone_log(zone, ISC_LOG_INFO, "notify from %s: no serial",
13837 dns_notify_t *notify;
13846 notify = event->ev_arg;
13847 REQUIRE(DNS_NOTIFY_VALID(notify));
13848 INSIST(task == notify->zone->task);
13851 isc_sockaddr_format(&notify->dst, addrbuf, sizeof(addrbuf));
13855 result = dns_message_create(notify->zone->mctx,
13863 notify_log(notify->zone, ISC_LOG_DEBUG(3),
13864 "notify response from %s: %.*s",
13867 notify_log(notify->zone, ISC_LOG_DEBUG(2),
13868 "notify to %s failed: %s", addrbuf,
13877 (notify->flags & DNS_NOTIFY_NOSOA) == 0) {
13880 notify->flags |= DNS_NOTIFY_NOSOA;
13881 dns_request_destroy(&notify->request);
13882 startup = ISC_TF((notify->flags & DNS_NOTIFY_STARTUP) != 0);
13883 result = notify_send_queue(notify, startup);
13885 notify_destroy(notify, ISC_FALSE);
13888 notify_log(notify->zone, ISC_LOG_DEBUG(1),
13889 "notify to %s: retries exceeded", addrbuf);
13890 notify_destroy(notify, ISC_FALSE);
17009 "notify = %d, refresh = %d",