I'm running "IP Security Policy Managment" to block ip addresses.
Is it possible to create a new filter by using the console or by using win32 api? I would like to automate the process from my application.
In the the
I suspect that you'll be able to figure it out since you're already familiar with all the terminology in the GUI, which is virtually the same in the command-line interface. Here's a short example creating a policy (not active), a filteraction (block), a filterlist, adding a filter to that filterlist (any source, destination me, ICMP), and adding a rule to the policy.
netsh ipsec static add filteraction name=MyFilteraction action=block
netsh ipsec static add filterlist name=MyFilterlist
netsh ipsec static add filter filterlist=MyFilterlist srcaddr=any dstaddr=me protocol=ICMP
netsh ipsec static add rule name=Rule1 policy=MyPolicy filterlist=MyFilterlist filteraction=MyFilteraction
wipfw is a BSD-licensed Windows port of ipfw from FreeBSD. If I would be you, I would study its code and eventually reuse it in my application.
This should be possible with