I have a project that requires some networking code that's a bit different from what I'm used to. Normally the code we write is either for a server or client, and how to do this is pretty well established. I now want to write some code that effectively has my computer acting like a firewall.
What I want is to be able to put two network
cards in my computer (call this "A"). One will be connected to a conventional router, and the other will be connected to another computer (call this "B"). What I'd like is that the existance of "A" should be completely transparent to "B". In other words, if "B" tries to send something out to the network, "A" simply takes the data and forwards it through on the other network card. If "B" tries to open a port, "A" will allow this and open its port on the other network card, and then transfer the data from clients who connect to it.
Obviously, this isn't all I need to do since it would be kind of pointless. Ultimately, computer "A" will do some filtering of the data passing through it (image processing application). Once I get a basic framework, I can do the rest.
I'm having trouble figuring out where to even start with a project like this. I don't think sockets are the right place to start here. I had a look at java.net.NetworkInterface which seems like the right place but I don't think it is.
I'm starting to think that
Java is not the appropriate language for an application like this since it is not sufficiently low level. Anyone have any ideas on where to begin?
Sander Smith