A library called libipq is provided for userspace packet handling. There is now documentation for this in the form of man pages. You need to build and install the iptables development components:
make install-devel
then see libipq(3).
You may also be interested in the Perl bindings for libipq, Perlipq at: http://www.intercode.com.au/jmorris/perlipq/. The binding itself is an example of using the library.
Other code examples include:
The netfilter core-team keeps a TODO list where it lists all the desired changes / new features. You can retrieve this list via anonymous CVS, instructions are on the netfilter Homepage. Alternatively you can also go to http://cvs.samba.org/cgi-bin/cvsweb/netfilter/TODO/ using CVSweb.
If you want to publish it, please send it to the netfilter-devel mailinglist. Subscription instructions are at http://lists.samba.org/mailman/listinfo/netfilter-devel/.
The correct way of sending a patch is the following :