In order to support a class of socket options which have to be set
before commiting a socket to a connection, this patch adds an API
for "pre-connection" socket options, called "flowopts" here.
The API is used as follows:
* to provide queue storage, a new head is allocated using flowopt_new();
* this queue is then populated with pre-connection socket options via
- generic 'add' method flowopt_add(),
- a specific variant for adding Boolean options - flowopt_add_bool(),
- convenience macros - OPT_ADD(), OPT_ENABLE(), OPT_DISABLE();
* the rest is then dealt with automatically by makesock():
- any provided flowopts are set before making the connection,
- due to using a queue, the order of invocation is preserved,
- after making the connection, makesock() frees storage that has been
previously allocated by flowopt_new() and flowopt_add.*().