コード例 #1
0
	}
	if (cfg.max_log_size != 0 && cfg.max_log_size <= 10) cfg.max_log_size = 10;
	if (cfg.ftimeout >= cfg.ctimeout) cfg.ftimeout = cfg.ctimeout - 100;
#ifdef WITH_LB
	if (cfg.lb_save > 0 && cfg.lb_save < 100) cfg.lb_save = 100;
	if (cfg.lb_nbest_readers < 2) cfg.lb_nbest_readers = DEFAULT_NBEST;
#endif
}

#define OFS(X) offsetof(struct s_config, X)
#define SIZEOF(X) sizeof(((struct s_config *)0)->X)

static const struct config_list global_opts[] = {
	DEF_OPT_FIXUP_FUNC(global_fixups_fn),
#ifdef LEDSUPPORT
	DEF_OPT_INT8("enableled"				, OFS(enableled),			0 ),
#endif
	DEF_OPT_FUNC("disablelog"				, OFS(disablelog),			disablelog_fn ),
#if defined(WEBIF) || defined(MODULE_MONITOR)
	DEF_OPT_FUNC("loghistorysize"			, OFS(loghistorysize),		loghistorysize_fn ),
#endif
	DEF_OPT_FUNC("serverip"					, OFS(srvip),				serverip_fn ),
	DEF_OPT_FUNC("logfile"					, OFS(logfile),				logfile_fn ),
	DEF_OPT_INT8("logduplicatelines"		, OFS(logduplicatelines),	0 ),
	DEF_OPT_STR("pidfile"					, OFS(pidfile),				NULL ),
	DEF_OPT_INT8("disableuserfile"			, OFS(disableuserfile),		1 ),
	DEF_OPT_INT8("disablemail"				, OFS(disablemail),			1 ),
	DEF_OPT_INT8("usrfileflag"				, OFS(usrfileflag),			0 ),
	DEF_OPT_UINT32("clienttimeout"			, OFS(ctimeout),			CS_CLIENT_TIMEOUT ),
	DEF_OPT_UINT32("fallbacktimeout"		, OFS(ftimeout),			CS_CLIENT_TIMEOUT / 2 ),
	DEF_OPT_UINT32("clientmaxidle"			, OFS(cmaxidle),			CS_CLIENT_MAXIDLE ),
コード例 #2
0
#ifdef CS_ANTICASC
static void account_fixups_fn(void *var) {
	struct s_auth *account = var;
	if (account->ac_users < -1) account->ac_users = DEFAULT_AC_USERS;
	if (account->ac_penalty < -1) account->ac_penalty = DEFAULT_AC_PENALTY;
}
#endif

#define OFS(X) offsetof(struct s_auth, X)
#define SIZEOF(X) sizeof(((struct s_auth *)0)->X)

static const struct config_list account_opts[] = {
#ifdef CS_ANTICASC
	DEF_OPT_FIXUP_FUNC(account_fixups_fn),
#endif
	DEF_OPT_INT8("disabled"				, OFS(disabled),				0 ),
	DEF_OPT_SSTR("user"					, OFS(usr),						"", SIZEOF(usr) ),
	DEF_OPT_STR("pwd"					, OFS(pwd),						NULL ),
#ifdef WEBIF
	DEF_OPT_STR("description"			, OFS(description),				NULL ),
#endif
	DEF_OPT_STR("hostname"				, OFS(dyndns),					NULL ),
	DEF_OPT_FUNC("caid"					, OFS(ctab),					check_caidtab_fn ),
	DEF_OPT_INT8("uniq"					, OFS(uniq),					0 ),
	DEF_OPT_UINT8("sleepsend"			, OFS(c35_sleepsend),			0 ),
	DEF_OPT_INT32("failban"				, OFS(failban),					0 ),
	DEF_OPT_INT8("monlevel"				, OFS(monlvl),					0 ),
	DEF_OPT_FUNC("sleep"				, OFS(tosleep),					account_tosleep_fn ),
	DEF_OPT_FUNC("suppresscmd08"		, OFS(c35_suppresscmd08),		account_c35_suppresscmd08_fn ),
	DEF_OPT_FUNC("keepalive"			, OFS(ncd_keepalive),			account_ncd_keepalive_fn ),
	DEF_OPT_FUNC("au"					, 0,							account_au_fn ),
コード例 #3
0
	}
	if(cfg.max_log_size != 0 && cfg.max_log_size <= 10) { cfg.max_log_size = 10; }
#ifdef WITH_LB
	if(cfg.lb_save > 0 && cfg.lb_save < 100) { cfg.lb_save = 100; }
	if(cfg.lb_nbest_readers < 2) { cfg.lb_nbest_readers = DEFAULT_NBEST; }
#endif
}

#define OFS(X) offsetof(struct s_config, X)
#define SIZEOF(X) sizeof(((struct s_config *)0)->X)

static const struct config_list global_opts[] =
{
	DEF_OPT_FIXUP_FUNC(global_fixups_fn),
#ifdef LEDSUPPORT
	DEF_OPT_INT8("enableled"                , OFS(enableled),           0),
#endif
	DEF_OPT_FUNC("disablelog"               , OFS(disablelog),          disablelog_fn),
#if defined(WEBIF) || defined(MODULE_MONITOR)
	DEF_OPT_FUNC("loghistorysize"           , OFS(loghistorysize),      loghistorysize_fn),
#endif
	DEF_OPT_FUNC("serverip"                 , OFS(srvip),               serverip_fn),
	DEF_OPT_FUNC("logfile"                  , OFS(logfile),             logfile_fn),
	DEF_OPT_INT32("initial_debuglevel"      , OFS(initial_debuglevel),  0), 
	DEF_OPT_STR("sysloghost"                , OFS(sysloghost),          NULL),
	DEF_OPT_INT32("syslogport"				, OFS(syslogport),			514),
	DEF_OPT_INT8("logduplicatelines"        , OFS(logduplicatelines),   0),
	DEF_OPT_STR("pidfile"                   , OFS(pidfile),             NULL),
	DEF_OPT_INT8("disableuserfile"          , OFS(disableuserfile),     1),
	DEF_OPT_INT8("disablemail"              , OFS(disablemail),         1),
	DEF_OPT_INT8("usrfileflag"              , OFS(usrfileflag),         0),
コード例 #4
0
ファイル: oscam-config-account.c プロジェクト: Uukrull/OSCam
	if(account->acosc_zap_limit < -1) { account->acosc_zap_limit = -1; }
	if(account->acosc_penalty < -1) { account->acosc_penalty = -1; }
	if(account->acosc_penalty_duration < -1) { account->acosc_penalty_duration = -1; }
	if(account->acosc_delay < -1) { account->acosc_delay = -1; }
}
#endif

#define OFS(X) offsetof(struct s_auth, X)
#define SIZEOF(X) sizeof(((struct s_auth *)0)->X)

static const struct config_list account_opts[] =
{
#ifdef CS_ANTICASC
	DEF_OPT_FIXUP_FUNC(account_fixups_fn),
#endif
	DEF_OPT_INT8("disabled"             , OFS(disabled),                0),
	DEF_OPT_SSTR("user"                 , OFS(usr),                     "", SIZEOF(usr)),
	DEF_OPT_STR("pwd"                   , OFS(pwd),                     NULL),
#ifdef WEBIF
	DEF_OPT_STR("description"           , OFS(description),             NULL),
#endif
	DEF_OPT_STR("hostname"              , OFS(dyndns),                  NULL),
	DEF_OPT_FUNC("caid"                 , OFS(ctab),                    check_caidtab_fn),
	DEF_OPT_INT8("uniq"                 , OFS(uniq),                    0),
	DEF_OPT_UINT8("sleepsend"           , OFS(c35_sleepsend),           0),
	DEF_OPT_INT32("failban"             , OFS(failban),                 0),
	DEF_OPT_INT8("monlevel"             , OFS(monlvl),                  0),
	DEF_OPT_FUNC("sleep"                , OFS(tosleep),                 account_tosleep_fn),
	DEF_OPT_FUNC("suppresscmd08"        , OFS(c35_suppresscmd08),       account_c35_suppresscmd08_fn),
	DEF_OPT_INT32("umaxidle"            , OFS(umaxidle),                -1),
	DEF_OPT_FUNC("keepalive"            , OFS(ncd_keepalive),           account_ncd_keepalive_fn),
コード例 #5
0
	if (cfg.ftimeout < cfg.srtimeout) cfg.ftimeout = cfg.srtimeout + 100;
	if (cfg.ctimeout < cfg.srtimeout) cfg.ctimeout = cfg.srtimeout + 100;
	if (cfg.max_cache_time < (cfg.ctimeout / 1000 + 1)) cfg.max_cache_time = cfg.ctimeout / 1000 + 2;
#ifdef WITH_LB
	if (cfg.lb_save > 0 && cfg.lb_save < 100) cfg.lb_save = 100;
	if (cfg.lb_nbest_readers < 2) cfg.lb_nbest_readers = DEFAULT_NBEST;
#endif
}

#define OFS(X) offsetof(struct s_config, X)
#define SIZEOF(X) sizeof(((struct s_config *)0)->X)

static const struct config_list global_opts[] = {
	DEF_OPT_FIXUP_FUNC(global_fixups_fn),
#ifdef LEDSUPPORT
	DEF_OPT_INT8("enableled"				, OFS(enableled),			0 ),
#endif
	DEF_OPT_FUNC("disablelog"				, OFS(disablelog),			disablelog_fn ),
#if defined(WEBIF) || defined(MODULE_MONITOR)
	DEF_OPT_FUNC("loghistorysize"			, OFS(loghistorysize),		loghistorysize_fn ),
#endif
	DEF_OPT_FUNC("serverip"					, OFS(srvip),				serverip_fn ),
	DEF_OPT_FUNC("logfile"					, OFS(logfile),				logfile_fn ),
	DEF_OPT_STR("pidfile"					, OFS(pidfile),				NULL ),
	DEF_OPT_INT8("disableuserfile"			, OFS(disableuserfile),		1 ),
	DEF_OPT_INT8("disablemail"				, OFS(disablemail),			1 ),
	DEF_OPT_INT8("usrfileflag"				, OFS(usrfileflag),			0 ),
	DEF_OPT_UINT32("clienttimeout"			, OFS(ctimeout),			CS_CLIENT_TIMEOUT ),
	DEF_OPT_UINT32("fallbacktimeout"		, OFS(ftimeout),			CS_CLIENT_TIMEOUT / 2 ),
	DEF_OPT_UINT32("clientmaxidle"			, OFS(cmaxidle),			CS_CLIENT_MAXIDLE ),
	DEF_OPT_UINT32("cachedelay"				, OFS(delay),				CS_DELAY ),