From b0531a38cc7135538d251440ac4fc2c887d9f335 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 1 Dec 2003 01:41:38 +0000 Subject: started adding netlogon IDL and test suite (This used to be commit 3d64eefb464d09fb6e84d6139f801887a278cf86) --- source4/librpc/ndr/ndr_basic.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'source4/librpc/ndr') diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 52f4d29428..32cc7bac5f 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -597,6 +597,25 @@ NTSTATUS ndr_pull_NTTIME(struct ndr_pull *ndr, NTTIME *t) return NT_STATUS_OK; } +/* + push a time_t +*/ +NTSTATUS ndr_push_time_t(struct ndr_push *ndr, time_t t) +{ + return ndr_push_uint32(ndr, t); +} + +/* + pull a time_t +*/ +NTSTATUS ndr_pull_time_t(struct ndr_pull *ndr, time_t *t) +{ + uint32 tt; + NDR_CHECK(ndr_pull_uint32(ndr, &tt)); + *t = tt; + return NT_STATUS_OK; +} + void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type) { @@ -646,6 +665,15 @@ void ndr_print_NTTIME(struct ndr_print *ndr, const char *name, NTTIME t) ndr->print(ndr, "%-25s: %s", name, nt_time_string(ndr->mem_ctx, &t)); } +void ndr_print_time_t(struct ndr_print *ndr, const char *name, time_t t) +{ + if (t == (time_t)-1 || t == 0) { + ndr->print(ndr, "%-25s: (time_t)%d", name, (int)t); + } else { + ndr->print(ndr, "%-25s: %s", name, http_timestring(ndr->mem_ctx, t)); + } +} + void ndr_print_union(struct ndr_print *ndr, const char *name, uint16 level, const char *type) { ndr->print(ndr, "%-25s: union %s(case %u)", name, type, level); -- cgit