list_add_tail(&new->node, &fo->sockopts);
}
-void flowopt_add_bool(struct flowopts *fo, int lev, int opt,
- const char *optname, bool on_or_off)
-{
- int on = on_or_off; /* kernel takes 'int' */
-
- flowopt_add(fo, lev, opt, optname, &on, sizeof(on));
-}
-
/** Set the entire bunch of pre-connection options at once. */
static void flowopt_setopts(int sockfd, struct flowopts *fo)
{
extern struct flowopts *flowopt_new(void);
extern void flowopt_add(struct flowopts *fo, int level, int opt,
const char *name, const void *val, int len);
-extern void flowopt_add_bool(struct flowopts *fo, int lev, int opt,
- const char *optname, bool on_or_off);
/** Flowopt shortcut macros */
#define OPT_ADD(fo, lev, opt, val, len) flowopt_add(fo, lev, opt, #opt, val, len)
-#define OPT_ENABLE(fo, lev, opt) flowopt_add_bool(fo, lev, opt, #opt, 1)
-#define OPT_DISABLE(fo, lev, opt) flowopt_add_bool(fo, lev, opt, #opt, 0)
/**
* Functions to parse and validate (parts of) URLs.