src/shared/: split AF_UNIX/AF_VSOCK address parsing into src/basic/

We'll use it from libsystemd0 later, but AF_INET/6 requires some
netlink calls and thus the additional library dependency
This commit is contained in:
Luca Boccassi
2023-01-05 18:43:47 +01:00
parent ea575e176a
commit 747b5d963e
3 changed files with 131 additions and 103 deletions
+6
View File
@@ -336,3 +336,9 @@ int socket_get_mtu(int fd, int af, size_t *ret);
#define UCRED_INVALID { .pid = 0, .uid = UID_INVALID, .gid = GID_INVALID }
int connect_unix_path(int fd, int dir_fd, const char *path);
/* Parses AF_UNIX and AF_VSOCK addresses. AF_INET[6] require some netlink calls, so it cannot be in
* src/basic/ and is done from 'socket_local_address from src/shared/. Return -EPROTO in case of
* protocol mismatch. */
int socket_address_parse_unix(SocketAddress *ret_address, const char *s);
int socket_address_parse_vsock(SocketAddress *ret_address, const char *s);