etfilter is a framework for arbitrary packet mangling. So far, a new NAT system and packet-filtering system have been built on top of it, as well as compatibility modules for ipfwadm and ipchains. Netfilter is a work-in-progress, but should be fairly robust for non-exotic work.
f4917334f36ca4cc4426e84f2dac7ec17b333061054625c2fd6204ec9b45dc06