summaryrefslogtreecommitdiffstats
path: root/include/qemu/sockets.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/qemu/sockets.h')
-rw-r--r--include/qemu/sockets.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h
index c174b5c..5a183c5 100644
--- a/include/qemu/sockets.h
+++ b/include/qemu/sockets.h
@@ -88,4 +88,38 @@ int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp);
int parse_host_port(struct sockaddr_in *saddr, const char *str);
int socket_init(void);
+/**
+ * socket_local_address:
+ * @fd: the socket file handle
+ * @errp: pointer to uninitialized error object
+ *
+ * Get the string representation of the local socket
+ * address. A pointer to the allocated address information
+ * struct will be returned, which the caller is required to
+ * release with a call qapi_free_SocketAddress when no
+ * longer required.
+ *
+ * Returns: the socket address struct, or NULL on error
+ */
+SocketAddress *socket_local_address(int fd, Error **errp);
+
+/**
+ * socket_remote_address:
+ * @fd: the socket file handle
+ * @errp: pointer to uninitialized error object
+ *
+ * Get the string representation of the remote socket
+ * address. A pointer to the allocated address information
+ * struct will be returned, which the caller is required to
+ * release with a call qapi_free_SocketAddress when no
+ * longer required.
+ *
+ * Returns: the socket address struct, or NULL on error
+ */
+SocketAddress *socket_remote_address(int fd, Error **errp);
+
+
+void qapi_copy_SocketAddress(SocketAddress **p_dest,
+ SocketAddress *src);
+
#endif /* QEMU_SOCKET_H */
OpenPOWER on IntegriCloud