def make_data_tlsa(tlsa):
    "Make a tlsa data block for a 'config' chunk.\n\n    The format is:\n\n    +-1----+-2----+-N--------+-1--+-M-----------+-1--+\n    | spec | port | protocol | \x00 | tlsa_domain | \x00 |\n    +------+------+----------+----+-------------+----+\n\n    spec: the byte value is calculated as:\n        (36 * usage) + (6 * selector) + (matching type).\n        E.g., (usage, selector, matching type) = (3,1,1):\n            spec value = 3*36 + 1*6 + 1 = 115\n\n    Args:\n        tlsa (Tlsa): object containing the TLSA data.\n\n    Returns:\n        bytes: the data block as a byte string.\n    "
    return (36 * int(tlsa.usage) + 6 * int(tlsa.selector) + int(tlsa.matching)
        ).to_bytes(1, byteorder='big') + int(tlsa.port).to_bytes(2,
        byteorder='big') + tlsa.protocol.encode(
        ) + b'\x00' + tlsa.domain.encode() + b'\x00'
