static int net_socket_mcast_init(NetClientState *peer,

                                 const char *model,

                                 const char *name,

                                 const char *host_str,

                                 const char *localaddr_str)

{

    NetSocketState *s;

    int fd;

    struct sockaddr_in saddr;

    struct in_addr localaddr, *param_localaddr;



    if (parse_host_port(&saddr, host_str) < 0)

        return -1;



    if (localaddr_str != NULL) {

        if (inet_aton(localaddr_str, &localaddr) == 0)

            return -1;

        param_localaddr = &localaddr;

    } else {

        param_localaddr = NULL;

    }



    fd = net_socket_mcast_create(&saddr, param_localaddr);

    if (fd < 0)

        return -1;



    s = net_socket_fd_init(peer, model, name, fd, 0);

    if (!s)

        return -1;



    s->dgram_dst = saddr;



    snprintf(s->nc.info_str, sizeof(s->nc.info_str),

             "socket: mcast=%s:%d",

             inet_ntoa(saddr.sin_addr), ntohs(saddr.sin_port));

    return 0;



}

static int net_socket_mcast_init(NetClientState *peer,

                                 const char *model,

                                 const char *name,

                                 const char *host_str,

                                 const char *localaddr_str)

{

    NetSocketState *s;

    int fd;

    struct sockaddr_in saddr;

    struct in_addr localaddr, *param_localaddr;



    if (parse_host_port(&saddr, host_str) < 0)

        return -1;



    if (localaddr_str != NULL) {

        if (inet_aton(localaddr_str, &localaddr) == 0)

            return -1;

        param_localaddr = &localaddr;

    } else {

        param_localaddr = NULL;

    }



    fd = net_socket_mcast_create(&saddr, param_localaddr);

    if (fd < 0)

        return -1;



    s = net_socket_fd_init(peer, model, name, fd, 0);

    if (!s)

        return -1;



    s->dgram_dst = saddr;



    snprintf(s->nc.info_str, sizeof(s->nc.info_str),

             "socket: mcast=%s:%d",

             inet_ntoa(saddr.sin_addr), ntohs(saddr.sin_port));

    return 0;



}

    s = net_socket_fd_init(peer, model, name, fd, 0);     s = net_socket_fd_init(peer, model, name, fd, 0);
static int FUNC_0(NetClientState *VAR_0,

                                 const char *VAR_1,

                                 const char *VAR_2,

                                 const char *VAR_3,

                                 const char *VAR_4)

{

    NetSocketState *s;

    int VAR_5;

    struct sockaddr_in VAR_6;

    struct in_addr VAR_7, *VAR_8;



    if (parse_host_port(&VAR_6, VAR_3) < 0)

        return -1;



    if (VAR_4 != NULL) {

        if (inet_aton(VAR_4, &VAR_7) == 0)

            return -1;

        VAR_8 = &VAR_7;

    } else {

        VAR_8 = NULL;

    }



    VAR_5 = net_socket_mcast_create(&VAR_6, VAR_8);

    if (VAR_5 < 0)

        return -1;



    s = net_socket_fd_init(VAR_0, VAR_1, VAR_2, VAR_5, 0);

    if (!s)

        return -1;



    s->dgram_dst = VAR_6;



    snprintf(s->nc.info_str, sizeof(s->nc.info_str),

             "socket: mcast=%s:%d",

             inet_ntoa(VAR_6.sin_addr), ntohs(VAR_6.sin_port));

    return 0;



}

static int FUNC_0(NetClientState *VAR_0,
const char *VAR_1,
const char *VAR_2,
const char *VAR_3,
const char *VAR_4)
{ NetSocketState *s; int VAR_5; struct sockaddr_in VAR_6; struct in_addr VAR_7, *VAR_8; if (parse_host_port(&VAR_6, VAR_3) < 0)
return -1; if (VAR_4 != NULL) { if (inet_aton(VAR_4, &VAR_7) == 0)
return -1; VAR_8 = &VAR_7; } else { VAR_8 = NULL; } VAR_5 = net_socket_mcast_create(&VAR_6, VAR_8); if (VAR_5 < 0)
return -1; s = net_socket_fd_init(VAR_0, VAR_1, VAR_2, VAR_5, 0); if (!s)
return -1; s->dgram_dst = VAR_6; snprintf(s->nc.info_str, sizeof(s->nc.info_str),
"socket: mcast=%s:%d",
inet_ntoa(VAR_6.sin_addr), ntohs(VAR_6.sin_port)); return 0; }