def generate_tc_commands(values, overhead, ips, disk):
    """Generate TC commands

    Args:
        values (list(float)): Avg latency, Var latency, throughput
        packets_overhead (int): Increase the buffer by x for safety
        ips (list(str)): List of ips to filter TC for
        disk (int): Qdisc to attach to

    Returns:
        list(str): List of TC commands
    """
    latency_avg = values[0]
    latency_var = values[1]
    throughput = values[2]

    commands = []

    if disk == 1:
        # Root disk
        commands.append(
            ["sudo", "tc", "qdisc", "add", "dev", "ens2", "root", "handle", "1:", "htb"]
        )

    # Set latency
    commands.append(
        [
            "sudo",
            "tc",
            "class",
            "add",
            "dev",
            "ens2",
            "parent",
            "1:",
            "classid",
            "1:%i" % (disk),
            "htb",
            "rate",
            "%smbit" % (throughput),
        ]
    )

    # Filter for specific IPs
    for ip in ips:
        commands.append(
            [
                "sudo",
                "tc",
                "filter",
                "add",
                "dev",
                "ens2",
                "parent",
                "1:",
                "protocol",
                "ip",
                "prio",
                str(disk),
                "u32",
                "flowid",
                "1:%i" % (disk),
                "match",
                "ip",
                "dst",
                ip,
            ]
        )

    # Set throughput
    commands.append(
        [
            "sudo",
            "tc",
            "qdisc",
            "add",
            "dev",
            "ens2",
            "parent",
            "1:%i" % (disk),
            "handle",
            "%i0:" % (disk),
            "netem",
            "delay",
            "%sms" % (latency_avg),
            "%sms" % (latency_var),
            "distribution",
            "normal",
        ]
    )

    return commands