Commit 5126112b authored by Mark Andrews's avatar Mark Andrews

438. [func] New function dns_message_getrawmessage().

parent 66827886
438. [func] New function dns_message_getrawmessage().
437. [func] Log NOTIFY activity to the notify channel.
436. [bug] If recvmsg() returned EHOSTUNREACH or ENETUNREACH,
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: message.h,v 1.75 2000/08/01 01:24:21 tale Exp $ */
/* $Id: message.h,v 1.76 2000/09/11 05:55:27 marka Exp $ */
#ifndef DNS_MESSAGE_H
#define DNS_MESSAGE_H 1
......@@ -211,6 +211,7 @@ struct dns_message {
dns_rcode_t sig0status;
isc_region_t *query;
isc_region_t *saved;
isc_buffer_t *rawmessge;
};
/***
......@@ -1154,6 +1155,9 @@ dns_message_checksig(dns_message_t *msg, dns_view_t *view);
* DNS_R_TSIGVERIFYFAILURE - The TSIG failed to verify
*/
isc_region_t *
dns_message_getrawmessage(dns_message_t *msg);
ISC_LANG_ENDDECLS
#endif /* DNS_MESSAGE_H */
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: message.c,v 1.144 2000/09/09 10:46:58 bwelling Exp $ */
/* $Id: message.c,v 1.145 2000/09/11 05:55:23 marka Exp $ */
/***
*** Imports
......@@ -1488,21 +1488,19 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source,
}
}
if (msg->tsig != NULL || msg->tsigkey != NULL || msg->sig0 != NULL) {
msg->saved = isc_mem_get(msg->mctx, sizeof(isc_region_t));
if (msg->saved == NULL)
return (ISC_R_NOMEMORY);
isc_buffer_usedregion(&origsource, &r);
msg->saved->length = r.length;
msg->saved->base = isc_mem_get(msg->mctx, msg->saved->length);
if (msg->saved->base == NULL) {
isc_mem_put(msg->mctx, msg->saved,
sizeof(isc_region_t));
msg->saved = NULL;
return (ISC_R_NOMEMORY);
}
memcpy(msg->saved->base, r.base, msg->saved->length);
msg->saved = isc_mem_get(msg->mctx, sizeof(isc_region_t));
if (msg->saved == NULL)
return (ISC_R_NOMEMORY);
isc_buffer_usedregion(&origsource, &r);
msg->saved->length = r.length;
msg->saved->base = isc_mem_get(msg->mctx, msg->saved->length);
if (msg->saved->base == NULL) {
isc_mem_put(msg->mctx, msg->saved,
sizeof(isc_region_t));
msg->saved = NULL;
return (ISC_R_NOMEMORY);
}
memcpy(msg->saved->base, r.base, msg->saved->length);
return (ISC_R_SUCCESS);
}
......@@ -2894,3 +2892,9 @@ dns_message_totext(dns_message_t *msg, dns_messagetextflag_t flags,
return (ISC_R_SUCCESS);
}
isc_region_t *
dns_message_getrawmessage(dns_message_t *msg) {
REQUIRE(DNS_MESSAGE_VALID(msg));
return (msg->saved);
}
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