static void vnc_init_basic_info(SocketAddressLegacy *addr,

                                VncBasicInfo *info,

                                Error **errp)

{

    switch (addr->type) {

    case SOCKET_ADDRESS_LEGACY_KIND_INET:

        info->host = g_strdup(addr->u.inet.data->host);

        info->service = g_strdup(addr->u.inet.data->port);

        if (addr->u.inet.data->ipv6) {

            info->family = NETWORK_ADDRESS_FAMILY_IPV6;

        } else {

            info->family = NETWORK_ADDRESS_FAMILY_IPV4;

        }

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_UNIX:

        info->host = g_strdup("");

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

        info->family = NETWORK_ADDRESS_FAMILY_UNIX;

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_VSOCK:

    case SOCKET_ADDRESS_LEGACY_KIND_FD:

        error_setg(errp, "Unsupported socket address type %s",

                   SocketAddressLegacyKind_lookup[addr->type]);

        break;

    default:

        abort();

    }



    return;

}

static void vnc_init_basic_info(SocketAddressLegacy *addr,

                                VncBasicInfo *info,

                                Error **errp)

{

    switch (addr->type) {

    case SOCKET_ADDRESS_LEGACY_KIND_INET:

        info->host = g_strdup(addr->u.inet.data->host);

        info->service = g_strdup(addr->u.inet.data->port);

        if (addr->u.inet.data->ipv6) {

            info->family = NETWORK_ADDRESS_FAMILY_IPV6;

        } else {

            info->family = NETWORK_ADDRESS_FAMILY_IPV4;

        }

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_UNIX:

        info->host = g_strdup("");

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

        info->family = NETWORK_ADDRESS_FAMILY_UNIX;

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_VSOCK:

    case SOCKET_ADDRESS_LEGACY_KIND_FD:

        error_setg(errp, "Unsupported socket address type %s",

                   SocketAddressLegacyKind_lookup[addr->type]);

        break;

    default:

        abort();

    }



    return;

}

static void FUNC_0(SocketAddressLegacy *VAR_0,

                                VncBasicInfo *VAR_1,

                                Error **VAR_2)

{

    switch (VAR_0->type) {

    case SOCKET_ADDRESS_LEGACY_KIND_INET:

        VAR_1->host = g_strdup(VAR_0->u.inet.data->host);

        VAR_1->service = g_strdup(VAR_0->u.inet.data->port);

        if (VAR_0->u.inet.data->ipv6) {

            VAR_1->family = NETWORK_ADDRESS_FAMILY_IPV6;

        } else {

            VAR_1->family = NETWORK_ADDRESS_FAMILY_IPV4;

        }

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_UNIX:

        VAR_1->host = g_strdup("");

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

        VAR_1->family = NETWORK_ADDRESS_FAMILY_UNIX;

        break;



    case SOCKET_ADDRESS_LEGACY_KIND_VSOCK:

    case SOCKET_ADDRESS_LEGACY_KIND_FD:

        error_setg(VAR_2, "Unsupported socket address type %s",

                   SocketAddressLegacyKind_lookup[VAR_0->type]);

        break;

    default:

        abort();

    }



    return;

}

static void FUNC_0(SocketAddressLegacy *VAR_0,
VncBasicInfo *VAR_1,
Error **VAR_2)
{ switch (VAR_0->type) { case SOCKET_ADDRESS_LEGACY_KIND_INET:
VAR_1->host = g_strdup(VAR_0->u.inet.data->host); VAR_1->service = g_strdup(VAR_0->u.inet.data->port); if (VAR_0->u.inet.data->ipv6) { VAR_1->family = NETWORK_ADDRESS_FAMILY_IPV6; } else { VAR_1->family = NETWORK_ADDRESS_FAMILY_IPV4; } break; case SOCKET_ADDRESS_LEGACY_KIND_UNIX:
VAR_1->host = g_strdup(""); VAR_1->service = g_strdup(VAR_0->u.q_unix.data->path); VAR_1->family = NETWORK_ADDRESS_FAMILY_UNIX; break; case SOCKET_ADDRESS_LEGACY_KIND_VSOCK:
case SOCKET_ADDRESS_LEGACY_KIND_FD:
error_setg(VAR_2, "Unsupported socket address type %s",
SocketAddressLegacyKind_lookup[VAR_0->type]); break; default:
abort(); } return; }