char *socket_address_to_string(struct SocketAddressLegacy *addr, Error **errp)

{

    char *buf;

    InetSocketAddress *inet;



    switch (addr->type) {

    case SOCKET_ADDRESS_LEGACY_KIND_INET:

        inet = addr->u.inet.data;

        if (strchr(inet->host, ':') == NULL) {

            buf = g_strdup_printf("%s:%s", inet->host, inet->port);

        } else {

            buf = g_strdup_printf("[%s]:%s", inet->host, inet->port);

        }

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_UNIX:

        buf = g_strdup(addr->u.q_unix.data->path);

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_FD:

        buf = g_strdup(addr->u.fd.data->str);

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_VSOCK:

        buf = g_strdup_printf("%s:%s",

                              addr->u.vsock.data->cid,

                              addr->u.vsock.data->port);

        break;



    default:

        abort();

    }

    return buf;

}

char *socket_address_to_string(struct SocketAddressLegacy *addr, Error **errp)

{

    char *buf;

    InetSocketAddress *inet;



    switch (addr->type) {

    case SOCKET_ADDRESS_LEGACY_KIND_INET:

        inet = addr->u.inet.data;

        if (strchr(inet->host, ':') == NULL) {

            buf = g_strdup_printf("%s:%s", inet->host, inet->port);

        } else {

            buf = g_strdup_printf("[%s]:%s", inet->host, inet->port);

        }

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_UNIX:

        buf = g_strdup(addr->u.q_unix.data->path);

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_FD:

        buf = g_strdup(addr->u.fd.data->str);

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_VSOCK:

        buf = g_strdup_printf("%s:%s",

                              addr->u.vsock.data->cid,

                              addr->u.vsock.data->port);

        break;



    default:

        abort();

    }

    return buf;

}

char *FUNC_0(struct SocketAddressLegacy *VAR_0, Error **VAR_1)

{

    char *VAR_2;

    InetSocketAddress *inet;



    switch (VAR_0->type) {

    case SOCKET_ADDRESS_LEGACY_KIND_INET:

        inet = VAR_0->u.inet.data;

        if (strchr(inet->host, ':') == NULL) {

            VAR_2 = g_strdup_printf("%s:%s", inet->host, inet->port);

        } else {

            VAR_2 = g_strdup_printf("[%s]:%s", inet->host, inet->port);

        }

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_UNIX:

        VAR_2 = g_strdup(VAR_0->u.q_unix.data->path);

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_FD:

        VAR_2 = g_strdup(VAR_0->u.fd.data->str);

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_VSOCK:

        VAR_2 = g_strdup_printf("%s:%s",

                              VAR_0->u.vsock.data->cid,

                              VAR_0->u.vsock.data->port);

        break;



    default:

        abort();

    }

    return VAR_2;

}

char *FUNC_0(struct SocketAddressLegacy *VAR_0, Error **VAR_1)
{ char *VAR_2; InetSocketAddress *inet; switch (VAR_0->type) { case SOCKET_ADDRESS_LEGACY_KIND_INET:
inet = VAR_0->u.inet.data; if (strchr(inet->host, ':') == NULL) { VAR_2 = g_strdup_printf("%s:%s", inet->host, inet->port); } else { VAR_2 = g_strdup_printf("[%s]:%s", inet->host, inet->port); } break; case SOCKET_ADDRESS_LEGACY_KIND_UNIX:
VAR_2 = g_strdup(VAR_0->u.q_unix.data->path); break; case SOCKET_ADDRESS_LEGACY_KIND_FD:
VAR_2 = g_strdup(VAR_0->u.fd.data->str); break; case SOCKET_ADDRESS_LEGACY_KIND_VSOCK:
VAR_2 = g_strdup_printf("%s:%s",
VAR_0->u.vsock.data->cid,
VAR_0->u.vsock.data->port); break; default:
abort(); } return VAR_2; }