Commit 4f6dd514 authored by Michael Graff's avatar Michael Graff
Browse files

add dns_adb_changeflags()

parent d0345e08
...@@ -3414,3 +3414,20 @@ dns_adb_adjustsrtt(dns_adb_t *adb, dns_adbaddrinfo_t *addr, ...@@ -3414,3 +3414,20 @@ dns_adb_adjustsrtt(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
UNLOCK(&adb->entrylocks[bucket]); UNLOCK(&adb->entrylocks[bucket]);
} }
void
dns_adb_changeflags(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
unsigned int bits, unsigned int mask)
{
int bucket;
REQUIRE(DNS_ADB_VALID(adb));
REQUIRE(DNS_ADBADDRINFO_VALID(addr));
bucket = addr->entry->lock_bucket;
LOCK(&adb->entrylocks[bucket]);
addr->flags = (addr->flags & ~mask) | (bits | mask);
UNLOCK(&adb->entrylocks[bucket]);
}
...@@ -469,14 +469,26 @@ dns_adb_adjustsrtt(dns_adb_t *adb, dns_adbaddrinfo_t *addr, ...@@ -469,14 +469,26 @@ dns_adb_adjustsrtt(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
* srtt value. This may include changes made by others. * srtt value. This may include changes made by others.
*/ */
void
dns_adb_changeflags(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
unsigned int bits, unsigned int mask);
/*
* Set the flags as given by:
*
* newflags = (oldflags & ~mask) | (bits & mask);
*
* Requires:
*
* adb be valid.
*
* addr be valid.
*/
/* /*
* XXX Need functions/macros to: * XXX Need functions/macros to:
* *
* Remove an address from a find's linked list. This is needed * Remove an address from a find's linked list. This is needed
* because the data pointed to by a dns_adbaddr_t is reference counted. * because the data pointed to by a dns_adbaddr_t is reference counted.
*
* set/clear various flags. (Which flags?)
*/ */
ISC_LANG_ENDDECLS ISC_LANG_ENDDECLS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment