Get MemeStreams Stuff!
Good read on how a stateful filter works plus some pragmatic information about the general state of the space in open source.
Interview: Daniel Hartmeier - OpenBSD 'pf' (packet filter) developer