The mask input
The filter mask is used to define which bits of the CAN identifier are to be compared with the assigned filter.
If a mask bit is not set, the corresponding bit of the CAN-Id is accepted irrespective of whether the filter code is 0 or 1.
If a mask bit is set, the corresponding bit of the CAN-Id is compared with the value of the filter code. If both are the same, the message is accepted, if they differ the message is rejected.
Sample 1)
Only the message with the ID 0x1200 is to be accepted.
Filter code and mask for acceptance of the ID 0x1200:

All bits must be compared, all bits of the mask to 1
The filter code must be set to the desired ID
Sample 2)
Filter code and mask for acceptance of the range ID 0x1200 – ID 0x120F:

The messages from 0x1200 to 0x120F are to be accepted:
In order to permit a range, the bits of the mask that mark the range are not set.
The filter code can be set to any desired ID within the range