I am creating a Java Desktop Application that is going to have a Firewall. My Application is going to support Windows XP, Vista and 7.
I found that the netstat /? command works for listing connections but I did not see any way of controlling them.
How do I write a Firewall and what language should I use? I prefer to use Java or the command line.
You won’t be able to plug in directly to Windows networking code just with Java. Because of that, writing a firewall in Java is not really warranted. Maybe there is something that can be done with J# if you insist on Java (I’m not an expert), but J# seems to have been orphaned by Microsoft, so C# is probably a better alternative.
If you just want to act like a firewall for your own application (and intercept network calls made inside JVM), you can do that with SecurityManager.