summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr_basic.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-12-01 01:41:38 +0000
committerAndrew Tridgell <tridge@samba.org>2003-12-01 01:41:38 +0000
commitb0531a38cc7135538d251440ac4fc2c887d9f335 (patch)
tree4f3eb93d99463cdd652f0aac410555937194834b /source4/librpc/ndr/ndr_basic.c
parentcfd41af8145ce31e9d0ff7abfcbd0d7c275dc30e (diff)
downloadsamba-b0531a38cc7135538d251440ac4fc2c887d9f335.tar.gz
samba-b0531a38cc7135538d251440ac4fc2c887d9f335.tar.bz2
samba-b0531a38cc7135538d251440ac4fc2c887d9f335.zip
started adding netlogon IDL and test suite
(This used to be commit 3d64eefb464d09fb6e84d6139f801887a278cf86)
Diffstat (limited to 'source4/librpc/ndr/ndr_basic.c')
-rw-r--r--source4/librpc/ndr/ndr_basic.c28
1 files changed, 28 insertions, 0 deletions
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);