Yondaiyme 0 Newbie Poster

Hello !!
i need to write some program on the windows that block incoming connection from any Ip from some ports (for example 21 or 25) and allow to connect Ip that are in white list ! and always when coming new connection from ports, the program must check the white list and if ip not allowed, block this ip... and program most allow another program modify the white list when it's running ! please help.....

sorry for my bad English ! Thanks !