Generate code for socket options.

This uses a gist available at https://gist.github.com/4969086.git, which
should be somehow more included or attached to this repository.  The
result builds, but has not be tested much, with 2.2 and 3.2.  Code
generated for 2.1 has not been tested yet.