domingo, 27 de noviembre de 2011

NP3: Firewall

To complement our Third Practical Assignment, we implement a simple Firewall in NachOS. First, we wrote 2 files, and Firewall.h


How it works?

The firewall uses a function named isBlocked(). That function receive a parameter (integer) that is a machine address. The function open a file named blocked, read whole the file and check if the received parameter is in the file. If the address is in the file that address is blocked, if not, the address is secure.

The function returns an integer, 1 if the address is secure, 0 if the address is blocked.

The firewall is included in

And used ind the function:

When a package of a blocked address is received, the host machine receive a warning and the answer of the machine also changes.


For this example, our blocked addresses are: 1, 3, 5, 10, 22, 30, 140, 200, 250, 310

The file blocked must be in the network folder, also the files and Firewall.h.

Also includes the new Makefile of the network folder, an the new Makefile.common of NachOS main directory.

1 comentario: