I think that's not really possible. To handle the actual packets you need to be in kernelspace. One possible way I can think of, though, is to use netfilter (iptables) to specify a rule that forwards a packet to userspace. Use the "QUEUE" target for this.
The only thing I know about this is that it should be possible (if the kernel is configured to support this). It's only mentioned in the man page (search for "userspace"). Have a look in the netfilter doc's in the kernel sources or on
www.netfilter.org for more info.