summaryrefslogtreecommitdiff
path: root/lib/tsocket/tsocket_guide.txt
diff options
context:
space:
mode:
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