void plugin_init(void) { dbglog("pybackend plugin: plugin_init()"); Py_Initialize(); add_options(pybackend_options); // // Only support one type of auth for now. // chap_mdtype_all &= MDTYPE_MICROSOFT_V2; chap_check_hook = pybackend_chap_check; chap_verify_hook = pybackend_chap_verify; ip_choose_hook = pybackend_ip_choose; allowed_address_hook = pybackend_allowed_address; add_notifier(&ip_up_notifier, pybackend_notifier, "ip_up_notifier"); add_notifier(&ip_down_notifier, pybackend_notifier, "ip_down_notifier"); add_notifier(&auth_up_notifier, pybackend_notifier, "auth_up_notifier"); add_notifier(&link_down_notifier, pybackend_notifier, "link_down_notifier"); info("pybackend plugin: initialized"); }
char *set_options(int argc, char **argv, int *i) { char *str; if (!(str = ft_strnew(ft_strlen(ALLOWED_OPTIONS)))) return (NULL); while (*i < argc) { if (ft_strequ(argv[*i], "--")) { (*i)++; break ; } if (argv[*i][0] != '-' || ft_strequ(argv[*i], "-")) break ; if (!add_options(str, argv, i)) { ft_strdel(&(str)); return (NULL); } (*i)++; } return (str); }
/* ARGSUSED */ static void sig_reboot(void *arg) { siginfo_t *siginfo = arg; struct if_options *ifo; int i; syslog(LOG_INFO, "received SIGALRM from PID %d, rebinding", (int)siginfo->si_pid); for (i = 0; i < ifac; i++) free(ifav[i]); free(ifav); ifav = NULL; ifac = 0; for (i = 0; i < ifdc; i++) free(ifdv[i]); free(ifdv); ifdc = 0; ifdv = NULL; ifo = read_config(cffile, NULL, NULL, NULL); add_options(ifo, margc, margv); /* We need to preserve these two options. */ if (options & DHCPCD_MASTER) ifo->options |= DHCPCD_MASTER; if (options & DHCPCD_DAEMONISED) ifo->options |= DHCPCD_DAEMONISED; options = ifo->options; free_options(ifo); reconf_reboot(1, ifc, ifv, 0); }
FftwOptions() : OptionsDefault() { add_options() ("rigor", value(&rigor_)->default_value("measure"), "FFTW rigor (measure, estimate, wisdom, patient or exhaustive)") ("wisdom_sp", value(&wisdom_sp_), "Wisdom file for single-precision.") ("wisdom_dp", value(&wisdom_dp_), "Wisdom file for double-precision.") ("plan_timelimit", value(&plan_timelimit_)->default_value(-1.0), "Timelimit in seconds for planning in FFTW."); }
reversible_program_options& reversible_program_options::add_costs_option() { add_options()( "costs", boost::program_options::value<unsigned>( &d->costs )->default_value( 0 ), "0: Gate Costs\n1: Line Costs\n2: Transistor Costs" ); d->has_costs = true; return *this; }
reversible_program_options& reversible_program_options::add_write_realization_option() { add_options()( "realname", boost::program_options::value<std::string>( &d->out_realization ), "output circuit realization in RevLib *.real format" ); d->has_out_realization = true; return *this; }
plugin_init(void) #endif { /* fatal("PPPoE plugin loading..."); */ #ifndef EMBED #if _linux_ if (!ppp_available() && !new_style_driver) fatal("Kernel doesn't support ppp_generic needed for PPPoE"); #else fatal("No PPPoE support on this OS"); #endif #endif /*EMBED*/ add_options(pppoe_options); tty_open_hook = connect_pppoe_ses; tty_close_hook = disconnect_pppoe_ses; setdevname_hook = &setdevname_pppoe; establish_ppp_hook = &generic_establish_ppp; disestablish_ppp_hook = &generic_disestablish_ppp; ppp_send_config_hook = &send_config_pppoe; ppp_recv_config_hook = &recv_config_pppoe; info("PPPoE Plugin Initialized"); }
void plugin_init(void) { #if defined(__linux__) extern int new_style_driver; /* From sys-linux.c */ if (!ppp_available() && !new_style_driver) fatal("Kernel doesn't support ppp_generic - " "needed for Ippool"); #else fatal("No IP pool support on this OS"); #endif add_options(ippool_options); memset(&ippool_addr, 0, sizeof(ippool_addr)); /* * Store the previously assigned hooks: * this allows us to co-exist with radius module. */ old_allowed_address_hook = allowed_address_hook; old_ip_choose_hook = ip_choose_hook; old_ip_down_hook = ip_down_hook; allowed_address_hook = ippool_allowed_address; ip_choose_hook = ippool_choose_ip; ip_down_hook = ippool_release_ip; /* brute force, just in case ip_down_hook doesn't get called */ add_notifier(&exitnotify, ippool_cleanup, 0); }
BSONTool::BSONTool( const char * name , bool objcheck ) : Tool( name , true , "" , "" ) , _objcheck( objcheck ){ add_options() ("objcheck" , "validate object before inserting" ) ("filter" , po::value<string>() , "filter to apply before inserting" ) ; }
static void configure_interface(struct interface *ifp, int argc, char **argv) { select_profile(ifp, NULL); add_options(ifp->options, argc, argv); configure_interface1(ifp); }
void plugin_init(void) { if (!ppp_available() && !new_style_driver) fatal("Kernel doesn't support ppp_generic needed for Zaptel PPP"); add_options(zaptel_options); info("Zaptel Plugin Initialized"); }
void Engine::init(){ MoveGenerator::init(); Trans::create(); pos.start(); add_options(); Book::load(); EGBB::load(); }
void plugin_init(void) { radius_pre_auth_hook = lookup_realm; add_options(Options); info("RADIUS Realms plugin initialized."); }
void plugin_init(void) { add_options(options); add_notifier(&ip_up_notifier, ip_up, NULL); add_notifier(&ip_down_notifier, ip_down, NULL); if (debug) notice("pptpd-logwtmp: $Version$"); }
reversible_program_options& reversible_program_options::add_read_specification_option() { assert( !( d->has_in_realization || d->has_in_specification ) ); add_options()( "filename", boost::program_options::value<std::string>( &d->in_specification ), "circuit specification in RevLib *.spec format" ); d->has_in_specification = true; return *this; }
Argv& Argv::addBoolOption(const std::string& optname,const std::string& optdesc) { #ifdef BOOST_PO auto opts=m_options[m_curidx].first; opts->add_options()(optname.c_str(),optdesc.c_str()); #endif return *this; }
Argv& Argv::addDecimalOptionI(const std::string& optname,const std::string& optdesc,double impvalue) { #ifdef BOOST_PO auto opts=m_options[m_curidx].first; opts->add_options()(optname.c_str(),boost::program_options::value<double>()->implicit_value(impvalue),optdesc.c_str()); addRecordD(optname); #endif return *this; }
BSONTool::BSONTool( const char * name, DBAccess access , bool objcheck ) : Tool( name , access , "" , "" , false ) , _objcheck( objcheck ) { add_options() ("objcheck" , "validate object before inserting (default)" ) ("noobjcheck" , "don't validate object before inserting" ) ("filter" , po::value<string>() , "filter to apply before inserting" ) ; }
Argv& Argv::addIntegerOptionD(const std::string& optname,const std::string& optdesc,long defvalue) { #ifdef BOOST_PO auto opts=m_options[m_curidx].first; opts->add_options()(optname.c_str(),boost::program_options::value<long>()->default_value(defvalue),optdesc.c_str()); addRecordI(optname); #endif return *this; }
Argv& Argv::addTextOptionDI(const std::string& optname,const std::string& optdesc,const std::string& defvalue,const std::string& impvalue) { #ifdef BOOST_PO auto opts=m_options[m_curidx].first; opts->add_options()(optname.c_str(),boost::program_options::value<std::string>()->default_value(defvalue)->implicit_value(impvalue),optdesc.c_str()); addRecordT(optname); #endif return *this; }
Argv& Argv::addFileOption(const std::string& optname,const std::string& optdesc) { #ifdef BOOST_PO auto opts=m_options[m_curidx].first; opts->add_options()(optname.c_str(),boost::program_options::value<std::string>(),optdesc.c_str()); addRecordF(optname); #endif return *this; }
void plugin_init(void) { info("userpass: %s", revision); add_options(options); pap_passwd_hook = get_password_hook; #if PPPVER >= PPPVersion(2,4,2,3) chap_passwd_hook = get_password_hook; #endif }
/********************************************************************** * %FUNCTION: plugin_init * %ARGUMENTS: * None * %RETURNS: * Nothing * %DESCRIPTION: * Initializes hooks for pppd plugin ***********************************************************************/ void plugin_init(void) { if (!ppp_available() && !new_style_driver) { fatal("Linux kernel does not support PPPoE -- are you running 2.4.x?"); } add_options(Options); }
void plugin_init(void) { add_options(Options); info("PPTP plugin version %s", PPTP_VERSION); the_channel = &pptp_channel; modem = 0; }
/* ----------------------------------------------------------------------------- plugin entry point, called by pppd ----------------------------------------------------------------------------- */ int start(CFBundleRef ref) { CFStringRef strref; CFURLRef urlref; bundle = ref; CFRetain(bundle); url = CFBundleCopyBundleURL(bundle); // hookup our handlers old_check_options = the_channel->check_options; the_channel->check_options = serial_check_options; old_connect = the_channel->connect; the_channel->connect = serial_connect; old_process_extra_options = the_channel->process_extra_options; the_channel->process_extra_options = serial_process_extra_options; add_notifier(&connect_fail_notify, serial_connect_notifier, 0); add_notifier(&lcp_lowerdown_notify, serial_lcpdown_notifier, 0); cancelstrref = CFBundleCopyLocalizedString(bundle, CFSTR("Cancel"), CFSTR("Cancel"), NULL); if (cancelstrref == 0) return 1; CFStringGetCString(cancelstrref, (char*)cancelstr, sizeof(cancelstr), kCFStringEncodingUTF8); icstrref = CFBundleCopyLocalizedString(bundle, CFSTR("Network Connection"), CFSTR("Network Connection"), NULL); if (icstrref == 0) return 1; CFStringGetCString(icstrref, (char*)icstr, sizeof(icstr), kCFStringEncodingUTF8); urlref = CFBundleCopyResourceURL(bundle, CFSTR("NetworkConnect.icns"), NULL, NULL); if (urlref == 0 || ((strref = CFURLGetString(urlref)) == 0)) { if (urlref) CFRelease(urlref); return 1; } CFStringGetCString(strref, (char*)iconstr, sizeof(iconstr), kCFStringEncodingUTF8); iconstrref = CFStringCreateCopy(NULL, strref); CFRelease(urlref); urlref = CFBundleCopyBuiltInPlugInsURL(bundle); if (urlref == 0 || ((CFURLGetFileSystemRepresentation(urlref, TRUE, pathccl, sizeof(pathccl))) == FALSE)) { if (urlref) CFRelease(urlref); return 1; } strlcat((char*)pathccl, SUFFIX_CCLENGINE, sizeof(pathccl)); CFRelease(urlref); // add the socket specific options add_options(serial_options); return 0; }
void plugin_init (void) { add_options (options); pap_check_hook = pwfd_check; pap_passwd_hook = pwfd_passwd; chap_check_hook = pwfd_check; chap_passwd_hook = pwfd_passwd; }
MMS() : Module( "mms" ) , _baseurl( "http://mms.10gen.com/ping/" ) , _secsToSleep(1) , _token( "" ) , _name( "" ) { add_options() ( "mms-token" , po::value<string>() , "account token for mongo monitoring server" ) ( "mms-name" , po::value<string>() , "server name mongo monitoring server" ) ( "mms-interval" , po::value<int>()->default_value(30) , "ping interval for mongo monitoring server" ) ; }
po::options_description commandLineOptions() { auto opts = po::options_description("Demo Options"); opts.add_options() ("help,h", "Print help message") ("loglevel,l", po::value<int>()->default_value(0), "Logging level") ("address,a",po::value<std::string>()->default_value("localhost:5555"), "Address of server") ("jobtypes,j",po::value<uint>()->default_value(3), "Number of job types") ; return opts; }
void plugin_init(void) { add_options(Options); info("PPTP plugin version %s compiled for pppd-%s", PLUGINVERSION, VERSION); the_channel = &pptp_channel; modem = 0; memset(&rt, 0, sizeof(rt)); }
/********************************************************************** * %FUNCTION: plugin_init * %ARGUMENTS: * None * %RETURNS: * Nothing * %DESCRIPTION: * Initializes hooks for pppd plugin ***********************************************************************/ void plugin_init(void) { if (!ppp_available() && !new_style_driver) { fatal("Linux kernel does not support PPPoE -- are you running 2.4.x?"); } add_options(Options); info("RP-PPPoE plugin version %s compiled against pppd %s", RP_VERSION, VERSION); }