A method and system is disclosed for managing and implementing a plurality
of network policies in a network device. Each of the plurality of
policies are defined by one or more filters. The filters are installed in
a policy engine. A layer identifies the network policy to be applied to a
packet by sending a request to the policy engine. The policy engine then
returns the policy to the requesting layer. The method and system may be
used to implement a programmable, host-based, distributed, authenticating
firewall that enables security and other policies to be applied at
several protocol layers.