Jump to content
  • Advertisement
Sign in to follow this  
rajend3

How to program a firewall

This topic is 3665 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I tried looking for resources on programming software firewalls but I've found nothing. I want to create a firewall for Linux with C/C++ but I have no idea where to start. If you have any suggestions or helpful links please post them. Thank You.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by rajend3
I tried looking for resources on programming software firewalls but I've found nothing. I want to create a firewall for Linux with C/C++ but I have no idea where to start. If you have any suggestions or helpful links please post them. Thank You.


firewall works on kernel level :) I must deeply know system, where do you want programming. (iptables or ipfw only gives instruction to kernel module).



Share this post


Link to post
Share on other sites
Firewall is basically a piece of code that is called each time something happens on network. It then has the choice of modifying the default behaviour (dropping the packet, modifying it, generating a response, logging it).

So minimal firewall is a function like onReceive() and onSend().

How you do it depends on OS.

Winsock provides a pretty elaborate API for all kinds of socket services. Under Linux, looking at existing solutions would be your best bet (at least to see how it's done).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!