def map_tcp_flags(bitmap):
    """
    Maps text names of tcp flags to values in bitmap

    :param bitmap: array[8]
    :return: dictionary with keynames as names of the flags
    """

    result = {}
    result["FIN"] = bitmap[7]
    result["SYN"] = bitmap[6]
    result["RST"] = bitmap[5]
    result["PSH"] = bitmap[4]
    result["ACK"] = bitmap[3]
    result["URG"] = bitmap[2]
    result["ECE"] = bitmap[1]
    result["CRW"] = bitmap[0]
    return result