summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-01-15 15:16:24 +0100
committerGünther Deschner <gd@samba.org>2008-01-15 15:29:36 +0100
commit4e2029f25c961dd1cba52cf6ac985915902f1726 (patch)
tree1e56b8021a787130ad7aaea9fb93599c79ccc47c /source3
parent6c9d51782656a51cea5ac5f644decf0cc93a51df (diff)
downloadsamba-4e2029f25c961dd1cba52cf6ac985915902f1726.tar.gz
samba-4e2029f25c961dd1cba52cf6ac985915902f1726.tar.bz2
samba-4e2029f25c961dd1cba52cf6ac985915902f1726.zip
Add ndr_print_sockaddr_storage and ndr_print_bool.
Guenther (This used to be commit f44f76415a7ce3ea73b5c52494f3b36feab4c870)
Diffstat (limited to 'source3')
-rw-r--r--source3/librpc/ndr/ndr_basic.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/librpc/ndr/ndr_basic.c b/source3/librpc/ndr/ndr_basic.c
index 0ef78a2a54..54397c9469 100644
--- a/source3/librpc/ndr/ndr_basic.c
+++ b/source3/librpc/ndr/ndr_basic.c
@@ -847,3 +847,14 @@ _PUBLIC_ uint32_t ndr_size_DATA_BLOB(int ret, const DATA_BLOB *data, int flags)
if (!data) return ret;
return ret + data->length;
}
+
+_PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b)
+{
+ ndr->print(ndr, "%-25s: %s", name, b?"true":"false");
+}
+
+_PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss)
+{
+ char addr[INET6_ADDRSTRLEN];
+ ndr->print(ndr, "%-25s: %s", name, print_sockaddr(addr, sizeof(addr), ss));
+}