A firewall rule consists of several clauses chained together to match specific criteria for each packet. The clauses represent specific layers in the protocol stack. Each clause can be broken down into conditions and expressions. The expressions are the variable part of the rule in which you put the address, port, or numeric parameters.
The developed engine applies encoded rules on any incoming packet.
This is part of my project of 'Logic in Computer Science' course at BITS Pilani.