1:集中定义
#include <ci/internal/opts_netif_def.h>:
CI_CFG_OPT("", tcp_sndbuf_min, ci_uint32,
"Minimum value for SO_SNDBUF for TCP sockets. Set via O/S interface.",
, tcp_sndbuf, CI_CFG_TCP_SNDBUF_MIN, MIN, MAX, bincount)
2:使用其为数据结构:
typedef struct {
/* These fields are defined in a separate file that is also used by the
** configuration subsystem
*/
#define _CI_CFG_BITFIELD
#define _CI_CFG_BITFIELD1 :1
#define _CI_CFG_BITFIELD2 :2
#define _CI_CFG_BITFIELD3 :3
#define _CI_CFG_BITFIELD4 :4
#define _CI_CFG_BITFIELD8 :8#define _CI_CFG_BITFIELD16 :16
#define _CI_CFG_BITFIELDA8 CI_ALIGN(8)
#undef CI_CFG_OPTFILE_VERSION
#undef CI_CFG_OPT
#undef CI_CFG_OPTGROUP
#define CI_CFG_OPTFILE_VERSION(version)
#define CI_CFG_OPTGROUP(group, category, expertise)
#define CI_CFG_OPT(env, name, type, doc, bits, group, default, min, max, presentation) \
type name _CI_CFG_BITFIELD##bits;
#include <ci/internal/opts_netif_def.h>
ci_boolean_t inited;
} ci_netif_config_opts;
ci_netif_config_opts is:
typedef struct {
ci_uint32 tcp_sndbuf_min;
}
3:使用其为赋值:
ci_netif_config_opts* opts;
# undef CI_CFG_OPTFILE_VERSION
# undef CI_CFG_OPTGROUP
# undef CI_CFG_OPT
# define CI_CFG_OPT(env, name, type, doc, type_modifider, group, \
default, minimum, maximum, presentation) \
opts->name = default;
# include <ci/internal/opts_netif_def.h>
opt->tcp_sndbuf_min = CI_CFG_TCP_SNDBUF_MIN;