def METHOD_NAME(val):
    """Create class based on decode of an DMAR table from filename."""
    base_length = ctypes.sizeof(dmar_factory(list()))
    data = open(val, mode='rb').read()
    buf = ctypes.create_string_buffer(data, len(data))
    addr = ctypes.addressof(buf)
    hdr = TableHeader.from_address(addr)
    field_list = dmar_subtable_list(addr + base_length, hdr.length - base_length)
    return dmar_factory(field_list).from_buffer_copy(data)