isc_result_t
dns_time32_totext(isc_uint32_t value, isc_buffer_t *target) {
	isc_stdtime_t now;
	isc_int64_t start;
	isc_int64_t base;
	isc_int64_t t;

	/*
	 * Adjust the time to the closest epoch.  This should be changed
	 * to use a 64-bit counterpart to isc_stdtime_get() if one ever
	 * is defined, but even the current code is good until the year
	 * 2106.
	 */
	isc_stdtime_get(&now);
	start = (isc_int64_t) now;
	start -= 0x7fffffff;
	base = 0;
	while ((t = (base + value)) < start) {
		base += 0x80000000;
		base += 0x80000000;
	}
	return (dns_time64_totext(t, target));
}
Exemple #2
0
isc_result_t
dns_time32_totext(isc_uint32_t value, isc_buffer_t *target) {
	return (dns_time64_totext(dns_time64_from32(value), target));
}