void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict)

{

    struct in_addr host_addr = { .s_addr = INADDR_ANY };

    int host_port;

    char buf[256] = "";

    const char *src_str, *p;

    SlirpState *s;

    int is_udp = 0;

    int err;

    const char *arg1 = qdict_get_str(qdict, "arg1");

    const char *arg2 = qdict_get_try_str(qdict, "arg2");

    const char *arg3 = qdict_get_try_str(qdict, "arg3");



    if (arg2) {

        s = slirp_lookup(mon, arg1, arg2);

        src_str = arg3;

    } else {

        s = slirp_lookup(mon, NULL, NULL);

        src_str = arg1;

    }

    if (!s) {

        return;

    }



    if (!src_str || !src_str[0])

        goto fail_syntax;



    p = src_str;

    get_str_sep(buf, sizeof(buf), &p, ':');



    if (!strcmp(buf, "tcp") || buf[0] == '\0') {

        is_udp = 0;

    } else if (!strcmp(buf, "udp")) {

        is_udp = 1;

    } else {

        goto fail_syntax;

    }



    if (get_str_sep(buf, sizeof(buf), &p, ':') < 0) {

        goto fail_syntax;

    }

    if (buf[0] != '\0' && !inet_aton(buf, &host_addr)) {

        goto fail_syntax;

    }



    host_port = atoi(p);



    err = slirp_remove_hostfwd(QTAILQ_FIRST(&slirp_stacks)->slirp, is_udp,

                               host_addr, host_port);



    monitor_printf(mon, "host forwarding rule for %s %s\n", src_str,

                   err ? "removed" : "not found");

    return;



 fail_syntax:

    monitor_printf(mon, "invalid format\n");

}

void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict)

{

    struct in_addr host_addr = { .s_addr = INADDR_ANY };

    int host_port;

    char buf[256] = "";

    const char *src_str, *p;

    SlirpState *s;

    int is_udp = 0;

    int err;

    const char *arg1 = qdict_get_str(qdict, "arg1");

    const char *arg2 = qdict_get_try_str(qdict, "arg2");

    const char *arg3 = qdict_get_try_str(qdict, "arg3");



    if (arg2) {

        s = slirp_lookup(mon, arg1, arg2);

        src_str = arg3;

    } else {

        s = slirp_lookup(mon, NULL, NULL);

        src_str = arg1;

    }

    if (!s) {

        return;

    }



    if (!src_str || !src_str[0])

        goto fail_syntax;



    p = src_str;

    get_str_sep(buf, sizeof(buf), &p, ':');



    if (!strcmp(buf, "tcp") || buf[0] == '\0') {

        is_udp = 0;

    } else if (!strcmp(buf, "udp")) {

        is_udp = 1;

    } else {

        goto fail_syntax;

    }



    if (get_str_sep(buf, sizeof(buf), &p, ':') < 0) {

        goto fail_syntax;

    }

    if (buf[0] != '\0' && !inet_aton(buf, &host_addr)) {

        goto fail_syntax;

    }



    host_port = atoi(p);



    err = slirp_remove_hostfwd(QTAILQ_FIRST(&slirp_stacks)->slirp, is_udp,

                               host_addr, host_port);



    monitor_printf(mon, "host forwarding rule for %s %s\n", src_str,

                   err ? "removed" : "not found");

    return;



 fail_syntax:

    monitor_printf(mon, "invalid format\n");

}

    char buf[256] = "";     if (!src_str || !src_str[0])         goto fail_syntax;     get_str_sep(buf, sizeof(buf), &p, ':');
void FUNC_0(Monitor *VAR_0, const QDict *VAR_1)

{

    struct in_addr VAR_2 = { .s_addr = INADDR_ANY };

    int VAR_3;

    char VAR_4[256] = "";

    const char *VAR_5, *VAR_6;

    SlirpState *s;

    int VAR_7 = 0;

    int VAR_8;

    const char *VAR_9 = qdict_get_str(VAR_1, "VAR_9");

    const char *VAR_10 = qdict_get_try_str(VAR_1, "VAR_10");

    const char *VAR_11 = qdict_get_try_str(VAR_1, "VAR_11");



    if (VAR_10) {

        s = slirp_lookup(VAR_0, VAR_9, VAR_10);

        VAR_5 = VAR_11;

    } else {

        s = slirp_lookup(VAR_0, NULL, NULL);

        VAR_5 = VAR_9;

    }

    if (!s) {

        return;

    }



    if (!VAR_5 || !VAR_5[0])

        goto fail_syntax;



    VAR_6 = VAR_5;

    get_str_sep(VAR_4, sizeof(VAR_4), &VAR_6, ':');



    if (!strcmp(VAR_4, "tcp") || VAR_4[0] == '\0') {

        VAR_7 = 0;

    } else if (!strcmp(VAR_4, "udp")) {

        VAR_7 = 1;

    } else {

        goto fail_syntax;

    }



    if (get_str_sep(VAR_4, sizeof(VAR_4), &VAR_6, ':') < 0) {

        goto fail_syntax;

    }

    if (VAR_4[0] != '\0' && !inet_aton(VAR_4, &VAR_2)) {

        goto fail_syntax;

    }



    VAR_3 = atoi(VAR_6);



    VAR_8 = slirp_remove_hostfwd(QTAILQ_FIRST(&slirp_stacks)->slirp, VAR_7,

                               VAR_2, VAR_3);



    monitor_printf(VAR_0, "host forwarding rule for %s %s\n", VAR_5,

                   VAR_8 ? "removed" : "not found");

    return;



 fail_syntax:

    monitor_printf(VAR_0, "invalid format\n");

}

void FUNC_0(Monitor *VAR_0, const QDict *VAR_1)
{ struct in_addr VAR_2 = { .s_addr = INADDR_ANY }; int VAR_3; char VAR_4[256] = ""; const char *VAR_5, *VAR_6; SlirpState *s; int VAR_7 = 0; int VAR_8; const char *VAR_9 = qdict_get_str(VAR_1, "VAR_9"); const char *VAR_10 = qdict_get_try_str(VAR_1, "VAR_10"); const char *VAR_11 = qdict_get_try_str(VAR_1, "VAR_11"); if (VAR_10) { s = slirp_lookup(VAR_0, VAR_9, VAR_10); VAR_5 = VAR_11; } else { s = slirp_lookup(VAR_0, NULL, NULL); VAR_5 = VAR_9; } if (!s) { return; } if (!VAR_5 || !VAR_5[0])
goto fail_syntax; VAR_6 = VAR_5; get_str_sep(VAR_4, sizeof(VAR_4), &VAR_6, ':'); if (!strcmp(VAR_4, "tcp") || VAR_4[0] == '\0') { VAR_7 = 0; } else if (!strcmp(VAR_4, "udp")) { VAR_7 = 1; } else { goto fail_syntax; } if (get_str_sep(VAR_4, sizeof(VAR_4), &VAR_6, ':') < 0) { goto fail_syntax; } if (VAR_4[0] != '\0' && !inet_aton(VAR_4, &VAR_2)) { goto fail_syntax; } VAR_3 = atoi(VAR_6); VAR_8 = slirp_remove_hostfwd(QTAILQ_FIRST(&slirp_stacks)->slirp, VAR_7,
VAR_2, VAR_3); monitor_printf(VAR_0, "host forwarding rule for %s %s\n", VAR_5,
VAR_8 ? "removed" : "not found"); return; fail_syntax:
monitor_printf(VAR_0, "invalid format\n"); }