diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-01-29 16:17:52 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-01-29 16:17:52 +0100 |
commit | cd47bd564d7fc6177ba2e231d76bf352978409b8 (patch) | |
tree | 7465150c86969e66a90e4b960bb3537485205842 /doc/socket_functions.rst | |
parent | 6c88f3bab0b743487b367712fa1ec27d1f87389e (diff) | |
parent | bfef0924f58eab930bdd826ac0132786abc32220 (diff) |
Update upstream source from tag 'upstream/4.10'
Update to upstream version '4.10'
with Debian dir 3c0b972fcc05149f237318f1a516c1c6bee6ce20
Diffstat (limited to 'doc/socket_functions.rst')
-rw-r--r-- | doc/socket_functions.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/socket_functions.rst b/doc/socket_functions.rst index fe2b69d..ead0f08 100644 --- a/doc/socket_functions.rst +++ b/doc/socket_functions.rst @@ -7,6 +7,8 @@ Socket functions #include <libHX/socket.h> int HX_socket_from_env(const struct addrinfo *ai, const char *intf); + int HX_sockaddr_is_local(const struct sockaddr *, socklen_t, unsigned int flags); + int HX_ipaddr_is_local(const char *, unsigned int flags); ``HX_socket_from_env`` The function looks up the current process's file descriptors for a @@ -14,3 +16,19 @@ Socket functions (optionally) intf if the latter is not NULL``. Upon success, the fd number is returned, or -1 if no file descriptor matched. No errors are signalled. + +``HX_sockaddr_is_local`` + Attempts to determine if the given socket address refers to a local + address. This function may be helpful in determining whether a process + should spend any time (or not) on compressing data before sending to a + peer. The definition of "local" is generally dependent upon the network + APIs. The ``flags`` parameter can contain ``AI_V4MAPPED`` if + IPv4-mapped IPv6 addresses should be recognized. The function returns + >0 if the address is considered local, 0 if not, and any other + negative value for a system error that makes the result + indeterminate. + +``HX_ipaddr_is_local`` + Takes a text representation of an IPv6/IPv4 address and, after + transformation, calls ``HX_sockaddr_is_local``. ``flags`` and + return value behave the same as that. |