int net_init_bridge(const NetClientOptions *opts, const char *name,

                    NetClientState *peer, Error **errp)

{

    /* FIXME error_setg(errp, ...) on failure */

    const NetdevBridgeOptions *bridge;

    const char *helper, *br;

    TAPState *s;

    int fd, vnet_hdr;



    assert(opts->kind == NET_CLIENT_OPTIONS_KIND_BRIDGE);

    bridge = opts->bridge;



    helper = bridge->has_helper ? bridge->helper : DEFAULT_BRIDGE_HELPER;

    br     = bridge->has_br     ? bridge->br     : DEFAULT_BRIDGE_INTERFACE;



    fd = net_bridge_run_helper(helper, br);

    if (fd == -1) {

        return -1;

    }



    fcntl(fd, F_SETFL, O_NONBLOCK);

    vnet_hdr = tap_probe_vnet_hdr(fd);

    s = net_tap_fd_init(peer, "bridge", name, fd, vnet_hdr);



    snprintf(s->nc.info_str, sizeof(s->nc.info_str), "helper=%s,br=%s", helper,

             br);



    return 0;

}

int net_init_bridge(const NetClientOptions *opts, const char *name,

                    NetClientState *peer, Error **errp)

{

    

    const NetdevBridgeOptions *bridge;

    const char *helper, *br;

    TAPState *s;

    int fd, vnet_hdr;



    assert(opts->kind == NET_CLIENT_OPTIONS_KIND_BRIDGE);

    bridge = opts->bridge;



    helper = bridge->has_helper ? bridge->helper : DEFAULT_BRIDGE_HELPER;

    br     = bridge->has_br     ? bridge->br     : DEFAULT_BRIDGE_INTERFACE;



    fd = net_bridge_run_helper(helper, br);

    if (fd == -1) {

        return -1;

    }



    fcntl(fd, F_SETFL, O_NONBLOCK);

    vnet_hdr = tap_probe_vnet_hdr(fd);

    s = net_tap_fd_init(peer, "bridge", name, fd, vnet_hdr);



    snprintf(s->nc.info_str, sizeof(s->nc.info_str), "helper=%s,br=%s", helper,

             br);



    return 0;

}

    fd = net_bridge_run_helper(helper, br);
int FUNC_0(const NetClientOptions *VAR_0, const char *VAR_1,

                    NetClientState *VAR_2, Error **VAR_3)

{

    

    const NetdevBridgeOptions *VAR_4;

    const char *VAR_5, *VAR_6;

    TAPState *s;

    int VAR_7, VAR_8;



    assert(VAR_0->kind == NET_CLIENT_OPTIONS_KIND_BRIDGE);

    VAR_4 = VAR_0->VAR_4;



    VAR_5 = VAR_4->has_helper ? VAR_4->VAR_5 : DEFAULT_BRIDGE_HELPER;

    VAR_6     = VAR_4->has_br     ? VAR_4->VAR_6     : DEFAULT_BRIDGE_INTERFACE;



    VAR_7 = net_bridge_run_helper(VAR_5, VAR_6);

    if (VAR_7 == -1) {

        return -1;

    }



    fcntl(VAR_7, F_SETFL, O_NONBLOCK);

    VAR_8 = tap_probe_vnet_hdr(VAR_7);

    s = net_tap_fd_init(VAR_2, "VAR_4", VAR_1, VAR_7, VAR_8);



    snprintf(s->nc.info_str, sizeof(s->nc.info_str), "VAR_5=%s,VAR_6=%s", VAR_5,

             VAR_6);



    return 0;

}

int FUNC_0(const NetClientOptions *VAR_0, const char *VAR_1,
NetClientState *VAR_2, Error **VAR_3)
{ const NetdevBridgeOptions *VAR_4; const char *VAR_5, *VAR_6; TAPState *s; int VAR_7, VAR_8; assert(VAR_0->kind == NET_CLIENT_OPTIONS_KIND_BRIDGE); VAR_4 = VAR_0->VAR_4; VAR_5 = VAR_4->has_helper ? VAR_4->VAR_5 : DEFAULT_BRIDGE_HELPER; VAR_6     = VAR_4->has_br     ? VAR_4->VAR_6     : DEFAULT_BRIDGE_INTERFACE; VAR_7 = net_bridge_run_helper(VAR_5, VAR_6); if (VAR_7 == -1) { return -1; } fcntl(VAR_7, F_SETFL, O_NONBLOCK); VAR_8 = tap_probe_vnet_hdr(VAR_7); s = net_tap_fd_init(VAR_2, "VAR_4", VAR_1, VAR_7, VAR_8); snprintf(s->nc.info_str, sizeof(s->nc.info_str), "VAR_5=%s,VAR_6=%s", VAR_5,
VAR_6); return 0; }