uint16_t num_recs = 0;
uint16_t first = 0;
uint16_t i;
- NTTIME t;
WERROR werr;
if (state->transaction_token != (void*)version) {
if (dns_name_is_static(recs, num_recs)) {
rec->dwTimeStamp = 0;
} else {
- unix_to_nt_time(&t, time(NULL));
- t /= 10 * 1000 * 1000; /* convert to seconds */
- t /= 3600; /* convert to hours */
- rec->dwTimeStamp = (uint32_t)t;
+ rec->dwTimeStamp = unix_to_dns_timestamp(time(NULL));
}
}
bool name_is_static)
{
enum ndr_err_code ndr_err;
- NTTIME t;
if (rrec->rr_type == DNS_QTYPE_ALL) {
return DNS_ERR(FORMAT_ERROR);
if (name_is_static) {
r->dwTimeStamp = 0;
} else {
- unix_to_nt_time(&t, time(NULL));
- t /= 10 * 1000 * 1000;
- t /= 3600;
- r->dwTimeStamp = t;
+ r->dwTimeStamp = unix_to_dns_timestamp(time(NULL));
}
/* If we get QCLASS_ANY, we're done here */
bool become_tombstoned = false;
struct ldb_dn *zone_dn = NULL;
struct dnsserver_zoneinfo *zoneinfo = NULL;
- NTTIME t;
+ uint32_t t;
msg = ldb_msg_new(mem_ctx);
W_ERROR_HAVE_NO_MEMORY(msg);
}
if (zoneinfo->fAging == 1 && records[i].dwTimeStamp != 0) {
- unix_to_nt_time(&t, time(NULL));
- t /= 10 * 1000 * 1000;
- t /= 3600;
+ t = unix_to_dns_timestamp(time(NULL));
if (t - records[i].dwTimeStamp >
zoneinfo->dwNoRefreshInterval) {
records[i].dwTimeStamp = t;
struct dns_server_zone *zones = NULL;
struct dns_server_zone *z = NULL;
int ret, i;
- NTTIME current_time;
+ uint32_t current_time;
enum ndr_err_code ndr_err;
struct ldb_result *res = NULL;
int tombstone_time;
const char *attrs[] = {"dnsRecord", "dNSTombstoned", NULL};
rec = talloc_zero(mem_ctx, struct dnsp_DnssrvRpcRecord);
- unix_to_nt_time(¤t_time, time(NULL));
- current_time /= 10 * 1000 * 1000;
- current_time /= 3600;
+ current_time = unix_to_dns_timestamp(time(NULL));
lp_ctx = (struct loadparm_context *)ldb_get_opaque(samdb, "loadparm");
tombstone_time =