int net_init_netmap(const NetClientOptions *opts,

                    const char *name, NetClientState *peer, Error **errp)

{

    const NetdevNetmapOptions *netmap_opts = opts->u.netmap;

    struct nm_desc *nmd;

    NetClientState *nc;

    Error *err = NULL;

    NetmapState *s;



    nmd = netmap_open(netmap_opts, &err);

    if (err) {

        error_propagate(errp, err);

        return -1;

    }

    /* Create the object. */

    nc = qemu_new_net_client(&net_netmap_info, peer, "netmap", name);

    s = DO_UPCAST(NetmapState, nc, nc);

    s->nmd = nmd;

    s->tx = NETMAP_TXRING(nmd->nifp, 0);

    s->rx = NETMAP_RXRING(nmd->nifp, 0);

    s->vnet_hdr_len = 0;

    pstrcpy(s->ifname, sizeof(s->ifname), netmap_opts->ifname);

    netmap_read_poll(s, true); /* Initially only poll for reads. */



    return 0;

}

int net_init_netmap(const NetClientOptions *opts,

                    const char *name, NetClientState *peer, Error **errp)

{

    const NetdevNetmapOptions *netmap_opts = opts->u.netmap;

    struct nm_desc *nmd;

    NetClientState *nc;

    Error *err = NULL;

    NetmapState *s;



    nmd = netmap_open(netmap_opts, &err);

    if (err) {

        error_propagate(errp, err);

        return -1;

    }

    

    nc = qemu_new_net_client(&net_netmap_info, peer, "netmap", name);

    s = DO_UPCAST(NetmapState, nc, nc);

    s->nmd = nmd;

    s->tx = NETMAP_TXRING(nmd->nifp, 0);

    s->rx = NETMAP_RXRING(nmd->nifp, 0);

    s->vnet_hdr_len = 0;

    pstrcpy(s->ifname, sizeof(s->ifname), netmap_opts->ifname);

    netmap_read_poll(s, true); 



    return 0;

}

int FUNC_0(const NetClientOptions *VAR_0,

                    const char *VAR_1, NetClientState *VAR_2, Error **VAR_3)

{

    const NetdevNetmapOptions *VAR_4 = VAR_0->u.netmap;

    struct nm_desc *VAR_5;

    NetClientState *nc;

    Error *err = NULL;

    NetmapState *s;



    VAR_5 = netmap_open(VAR_4, &err);

    if (err) {

        error_propagate(VAR_3, err);

        return -1;

    }

    

    nc = qemu_new_net_client(&net_netmap_info, VAR_2, "netmap", VAR_1);

    s = DO_UPCAST(NetmapState, nc, nc);

    s->VAR_5 = VAR_5;

    s->tx = NETMAP_TXRING(VAR_5->nifp, 0);

    s->rx = NETMAP_RXRING(VAR_5->nifp, 0);

    s->vnet_hdr_len = 0;

    pstrcpy(s->ifname, sizeof(s->ifname), VAR_4->ifname);

    netmap_read_poll(s, true); 



    return 0;

}

int FUNC_0(const NetClientOptions *VAR_0,
const char *VAR_1, NetClientState *VAR_2, Error **VAR_3)
{ const NetdevNetmapOptions *VAR_4 = VAR_0->u.netmap; struct nm_desc *VAR_5; NetClientState *nc; Error *err = NULL; NetmapState *s; VAR_5 = netmap_open(VAR_4, &err); if (err) { error_propagate(VAR_3, err); return -1; } nc = qemu_new_net_client(&net_netmap_info, VAR_2, "netmap", VAR_1); s = DO_UPCAST(NetmapState, nc, nc); s->VAR_5 = VAR_5; s->tx = NETMAP_TXRING(VAR_5->nifp, 0); s->rx = NETMAP_RXRING(VAR_5->nifp, 0); s->vnet_hdr_len = 0; pstrcpy(s->ifname, sizeof(s->ifname), VAR_4->ifname); netmap_read_poll(s, true); return 0; }