diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/qemu-sockets.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index a4a1e9d300..447720f62a 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -102,6 +102,16 @@ const char *inet_strfamily(int family) return "unknown"; } +NetworkAddressFamily inet_netfamily(int family) +{ + switch (family) { + case PF_INET6: return NETWORK_ADDRESS_FAMILY_IPV6; + case PF_INET: return NETWORK_ADDRESS_FAMILY_IPV4; + case PF_UNIX: return NETWORK_ADDRESS_FAMILY_UNIX; + } + return NETWORK_ADDRESS_FAMILY_UNKNOWN; +} + int inet_listen_opts(QemuOpts *opts, int port_offset, Error **errp) { struct addrinfo ai,*res,*e; |