split up setsockopt struct generation to ease reuse.

I want to use this from the main process, which means not screwing
with child shm entries.
do perioidic setsockopt on opened sockets.
split the regeneration code out to its own file.
add missing proto
remove unneeded include