how block traffic from certain Mac address

i have a problem in c++.
i want o create a code to block received IP traffic based of the source mac address of the packet, but i don't know how to do this.

i will have a list of mac addresses that i want to block and i want the program when a message is received it will check this list if found the source mac address in the block list it will drop the packets at the data link layer.

if any one can help me in this issue

thanks in advance
Topic archived. No new replies allowed.