summaryrefslogtreecommitdiff
path: root/lib/tsocket/tsocket_guide.txt
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-11-04 19:03:41 +0100
committerStefan Metzmacher <metze@samba.org>2009-12-15 23:34:22 +0100
commitedbf2caa6f8273227229cd8f1b293e95c6a6122d (patch)
treea81b2a12e33ea0b11fbae9c8dc53ec9bd9cbba61 /lib/tsocket/tsocket_guide.txt
parent4a19adadcc543f289f4f1c70e696153b488f79c6 (diff)
downloadsamba-edbf2caa6f8273227229cd8f1b293e95c6a6122d.tar.gz
samba-edbf2caa6f8273227229cd8f1b293e95c6a6122d.tar.bz2
samba-edbf2caa6f8273227229cd8f1b293e95c6a6122d.zip
tsocket: add tsocket_address_bsd_sockaddr() and tsocket_address_bsd_from_sockaddr()
metze
Diffstat (limited to 'lib/tsocket/tsocket_guide.txt')
-rw-r--r--lib/tsocket/tsocket_guide.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/tsocket/tsocket_guide.txt b/lib/tsocket/tsocket_guide.txt
index ed903c6027..287fe8a4e5 100644
--- a/lib/tsocket/tsocket_guide.txt
+++ b/lib/tsocket/tsocket_guide.txt
@@ -421,6 +421,29 @@ int tstream_unix_socketpair(TALLOC_CTX *mem_ctx1,
TALLOC_CTX *mem_ctx2,
struct tstream_context **stream2);
+In some situations it's needed to create a tsocket_address from
+a given 'struct sockaddr'. You can use tsocket_address_bsd_from_sockaddr()
+for that. This should only be used if really needed, because of
+already existing fixed APIs. Only AF_INET, AF_INET6 and AF_UNIX
+sockets are allowed. The function returns -1 and set errno on error.
+Otherwise it returns 0.
+
+int tsocket_address_bsd_from_sockaddr(TALLOC_CTX *mem_ctx,
+ struct sockaddr *sa,
+ socklen_t sa_socklen,
+ struct tsocket_address **addr);
+
+In some situations it's needed to get a 'struct a tsocket_address from
+a given 'struct sockaddr'. You can use tsocket_address_bsd_from_sockaddr()
+for that. This should only be used if really needed, because of
+already existing fixed APIs. Only AF_INET, AF_INET6 and AF_UNIX
+sockets are allowed. The function returns -1 and set errno on error.
+Otherwise it returns 0.
+
+int tsocket_address_bsd_sockaddr(const struct tsocket_address *addr,
+ struct sockaddr *sa,
+ socklen_t *sa_socklen);
+
In some situations it's needed to wrap existing file descriptors
into the tstream abstraction. You can use tstream_bsd_existing_socket()
for that. But you should read the tsocket_bsd.c code and unterstand it