2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Added dns_tsigkey_attach & _detach, to simplify reference counting.

Added dns_message_get/settsigkey to deuglify tsig key handling in message code.
This commit is contained in:
Brian Wellington
2000-05-26 00:16:46 +00:00
parent 82a30bf0a0
commit af60263664
10 changed files with 176 additions and 80 deletions

View File

@@ -522,7 +522,7 @@ msgreset(dns_message_t *msg, isc_boolean_t everything) {
}
if (msg->tsigkey != NULL) {
dns_tsigkey_free(&msg->tsigkey);
dns_tsigkey_detach(&msg->tsigkey);
msg->tsigkey = NULL;
}
@@ -2220,6 +2220,32 @@ dns_message_gettsig(dns_message_t *msg, dns_name_t **owner) {
return (msg->tsigset);
}
void
dns_message_settsigkey(dns_message_t *msg, dns_tsigkey_t *key) {
/*
* Set the TSIG key for 'msg'
*/
REQUIRE(DNS_MESSAGE_VALID(msg));
REQUIRE(msg->tsigkey == NULL);
if (key != NULL)
dns_tsigkey_attach(key, &msg->tsigkey);
}
dns_tsigkey_t *
dns_message_gettsigkey(dns_message_t *msg) {
/*
* Get the TSIG key for 'msg'
*/
REQUIRE(DNS_MESSAGE_VALID(msg));
return (msg->tsigkey);
}
dns_rdataset_t *
dns_message_getsig0(dns_message_t *msg, dns_name_t **owner) {