本文整理汇总了C++中cf_section_name2函数的典型用法代码示例。如果您正苦于以下问题:C++ cf_section_name2函数的具体用法?C++ cf_section_name2怎么用?C++ cf_section_name2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cf_section_name2函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: mod_instantiate
/*
* Do any per-module initialization that is separate to each
* configured instance of the module. e.g. set up connections
* to external databases, read configuration files, set up
* dictionary entries, etc.
*
* If configuration information is given in the config section
* that must be referenced in later calls, store a handle to it
* in *instance otherwise put a null pointer there.
*/
static int mod_instantiate(CONF_SECTION *conf, void *instance)
{
rlm_yubikey_t *inst = instance;
DICT_VALUE *dval;
inst->name = cf_section_name2(conf);
if (!inst->name) {
inst->name = cf_section_name1(conf);
}
dval = dict_valbyname(PW_AUTH_TYPE, 0, inst->name);
if (dval) {
inst->auth_type = dval->value;
} else {
inst->auth_type = 0;
}
if (YUBIKEY_UID_SIZE > MAX_STRING_LEN) {
DEBUGE("rlm_yubikey: YUBIKEY_UID_SIZE too big");
return -1;
}
xlat_register("modhextohex", modhex_to_hex_xlat, inst);
return 0;
}
开发者ID:jcartermeru,项目名称:freeradius-server,代码行数:36,代码来源:rlm_yubikey.c
示例2: mod_instantiate
static int mod_instantiate(CONF_SECTION *conf, void *instance)
{
static bool version_done;
REDIS_INST *inst = instance;
if (!version_done) {
version_done = true;
INFO("rlm_redis: libhiredis version: %i.%i.%i", HIREDIS_MAJOR, HIREDIS_MINOR, HIREDIS_PATCH);
}
inst->xlat_name = cf_section_name2(conf);
if (!inst->xlat_name) inst->xlat_name = cf_section_name1(conf);
xlat_register(inst->xlat_name, redis_xlat, NULL, inst); /* FIXME! */
inst->pool = fr_connection_pool_module_init(conf, inst, mod_conn_create, NULL, NULL);
if (!inst->pool) {
return -1;
}
inst->redis_query = rlm_redis_query;
inst->redis_finish_query = rlm_redis_finish_query;
return 0;
}
开发者ID:johnnywalker,项目名称:freeradius-server,代码行数:28,代码来源:rlm_redis.c
示例3: mod_instantiate
/*
* Ensure that the unlang sections are compiled.
*/
static int mod_instantiate(UNUSED void *instance, CONF_SECTION *listen_cs)
{
int rcode;
CONF_SECTION *server_cs;
vp_tmpl_rules_t parse_rules;
memset(&parse_rules, 0, sizeof(parse_rules));
parse_rules.dict_def = dict_freeradius;
rad_assert(listen_cs);
server_cs = cf_item_to_section(cf_parent(listen_cs));
rad_assert(strcmp(cf_section_name1(server_cs), "server") == 0);
rcode = unlang_compile_subsection(server_cs, "new", "client", MOD_AUTHORIZE, &parse_rules);
if (rcode < 0) return rcode;
if (rcode == 0) {
cf_log_err(server_cs, "Failed finding 'new client { ... }' section of virtual server %s",
cf_section_name2(server_cs));
return -1;
}
rcode = unlang_compile_subsection(server_cs, "add", "client", MOD_POST_AUTH, &parse_rules);
if (rcode < 0) return rcode;
rcode = unlang_compile_subsection(server_cs, "deny", "client", MOD_POST_AUTH, &parse_rules);
if (rcode < 0) return rcode;
return 0;
}
开发者ID:geaaru,项目名称:freeradius-server,代码行数:33,代码来源:proto_radius_dynamic_client.c
示例4: mod_instantiate
/*
* Do any per-module initialization that is separate to each
* configured instance of the module. e.g. set up connections
* to external databases, read configuration files, set up
* dictionary entries, etc.
*
* If configuration information is given in the config section
* that must be referenced in later calls, store a handle to it
* in *instance otherwise put a null pointer there.
*/
static int mod_instantiate(CONF_SECTION *conf, void *instance)
{
rlm_expr_t *inst = instance;
inst->xlat_name = cf_section_name2(conf);
if (!inst->xlat_name) {
inst->xlat_name = cf_section_name1(conf);
}
xlat_register(inst->xlat_name, expr_xlat, NULL, inst);
/*
* FIXME: unregister these, too
*/
xlat_register("rand", rand_xlat, NULL, inst);
xlat_register("randstr", randstr_xlat, NULL, inst);
xlat_register("urlquote", urlquote_xlat, NULL, inst);
xlat_register("escape", escape_xlat, NULL, inst);
xlat_register("tolower", lc_xlat, NULL, inst);
xlat_register("toupper", uc_xlat, NULL, inst);
xlat_register("md5", md5_xlat, NULL, inst);
xlat_register("sha1", sha1_xlat, NULL, inst);
#ifdef HAVE_OPENSSL_EVP_H
xlat_register("sha256", sha256_xlat, NULL, inst);
xlat_register("sha512", sha512_xlat, NULL, inst);
#endif
xlat_register("base64", base64_xlat, NULL, inst);
xlat_register("base64tohex", base64_to_hex_xlat, NULL, inst);
/*
* Initialize various paircompare functions
*/
pair_builtincompare_add(instance);
return 0;
}
开发者ID:kzorba,项目名称:freeradius-server,代码行数:45,代码来源:rlm_expr.c
示例5: mod_instantiate
/*
* Do any per-module initialization that is separate to each
* configured instance of the module. e.g. set up connections
* to external databases, read configuration files, set up
* dictionary entries, etc.
*
* If configuration information is given in the config section
* that must be referenced in later calls, store a handle to it
* in *instance otherwise put a null pointer there.
*/
static int mod_instantiate(CONF_SECTION *conf, void *instance)
{
module_instance_t *sqlinst;
rlm_sqlippool_t *inst = instance;
char const *pool_name = NULL;
pool_name = cf_section_name2(conf);
if (pool_name != NULL) {
inst->pool_name = talloc_typed_strdup(inst, pool_name);
} else {
inst->pool_name = talloc_typed_strdup(inst, "ippool");
}
sqlinst = find_module_instance(cf_section_find("modules"),
inst->sql_instance_name, 1);
if (!sqlinst) {
cf_log_err_cs(conf, "failed to find sql instance named %s",
inst->sql_instance_name);
return -1;
}
if (strcmp(sqlinst->entry->name, "rlm_sql") != 0) {
cf_log_err_cs(conf, "Module \"%s\""
" is not an instance of the rlm_sql module",
inst->sql_instance_name);
return -1;
}
inst->sql_inst = (rlm_sql_t *) sqlinst->insthandle;
return 0;
}
开发者ID:amirdaly,项目名称:freeradius-server,代码行数:40,代码来源:rlm_sqlippool.c
示例6: mod_bootstrap
static int mod_bootstrap(void *instance, CONF_SECTION *conf)
{
rlm_redis_t *inst = instance;
char *name;
xlat_t const *xlat;
inst->name = cf_section_name2(conf);
if (!inst->name) inst->name = cf_section_name1(conf);
xlat_register(inst, inst->name, redis_xlat, NULL, NULL, 0, XLAT_DEFAULT_BUF_LEN, false);
/*
* %{redis_node:<key>[ idx]}
*/
name = talloc_asprintf(NULL, "%s_node", inst->name);
xlat = xlat_async_register(inst, name, redis_node_xlat);
xlat_async_instantiate_set(xlat, redis_xlat_instantiate, rlm_redis_t *, NULL, inst);
talloc_free(name);
name = talloc_asprintf(NULL, "%s_remap", inst->name);
xlat = xlat_async_register(inst, name, redis_remap_xlat);
xlat_async_instantiate_set(xlat, redis_xlat_instantiate, rlm_redis_t *, NULL, inst);
talloc_free(name);
return 0;
}
开发者ID:geaaru,项目名称:freeradius-server,代码行数:26,代码来源:rlm_redis.c
示例7: mod_bootstrap
static int mod_bootstrap(void *instance, CONF_SECTION *conf)
{
rlm_unbound_t *inst = instance;
inst->name = cf_section_name2(conf);
if (!inst->name) inst->name = cf_section_name1(conf);
if (inst->timeout > 10000) {
cf_log_err(conf, "timeout must be 0 to 10000");
return -1;
}
MEM(inst->xlat_a_name = talloc_typed_asprintf(inst, "%s-a", inst->name));
MEM(inst->xlat_aaaa_name = talloc_typed_asprintf(inst, "%s-aaaa", inst->name));
MEM(inst->xlat_ptr_name = talloc_typed_asprintf(inst, "%s-ptr", inst->name));
if (xlat_register(inst, inst->xlat_a_name, xlat_a, NULL, NULL, 0, XLAT_DEFAULT_BUF_LEN, false) ||
xlat_register(inst, inst->xlat_aaaa_name, xlat_aaaa, NULL, NULL, 0, XLAT_DEFAULT_BUF_LEN, false) ||
xlat_register(inst, inst->xlat_ptr_name, xlat_ptr, NULL, NULL, 0, XLAT_DEFAULT_BUF_LEN, false)) {
cf_log_err(conf, "Failed registering xlats");
return -1;
}
return 0;
}
开发者ID:geaaru,项目名称:freeradius-server,代码行数:25,代码来源:rlm_unbound.c
示例8: mod_open
/** Open a detail listener
*
*/
static int mod_open(fr_listen_t *li)
{
proto_detail_file_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_detail_file_t);
proto_detail_file_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_detail_file_thread_t);
if (inst->poll_interval == 0) {
int oflag;
#ifdef O_EVTONLY
oflag = O_EVTONLY;
#else
oflag = O_RDONLY;
#endif
li->fd = thread->fd = open(inst->directory, oflag);
} else {
li->fd = thread->fd = open("/dev/null", O_RDONLY);
}
if (thread->fd < 0) {
cf_log_err(inst->cs, "Failed opening %s: %s", inst->directory, fr_syserror(errno));
return -1;
}
thread->inst = inst;
thread->name = talloc_typed_asprintf(thread, "detail polling for files matching %s", inst->filename);
thread->vnode_fd = -1;
pthread_mutex_init(&thread->worker_mutex, NULL);
DEBUG("Listening on %s bound to virtual server %s",
thread->name, cf_section_name2(inst->parent->server_cs));
return 0;
}
开发者ID:FreeRADIUS,项目名称:freeradius-server,代码行数:35,代码来源:proto_detail_file.c
示例9: mod_instantiate
/*
* Do any per-module initialization that is separate to each
* configured instance of the module. e.g. set up connections
* to external databases, read configuration files, set up
* dictionary entries, etc.
*
* If configuration information is given in the config section
* that must be referenced in later calls, store a handle to it
* in *instance otherwise put a null pointer there.
*/
static int mod_instantiate(CONF_SECTION *conf, void *instance)
{
rlm_expr_t *inst = instance;
inst->xlat_name = cf_section_name2(conf);
if (!inst->xlat_name) {
inst->xlat_name = cf_section_name1(conf);
}
xlat_register(inst->xlat_name, expr_xlat, inst);
xlat_register("rand", rand_xlat, inst);
xlat_register("randstr", randstr_xlat, inst);
xlat_register("urlquote", urlquote_xlat, inst);
xlat_register("escape", escape_xlat, inst);
xlat_register("tolower", lc_xlat, inst);
xlat_register("toupper", uc_xlat, inst);
xlat_register("md5", md5_xlat, inst);
xlat_register("tobase64", base64_xlat, inst);
xlat_register("base64tohex", base64_to_hex_xlat, inst);
/*
* Initialize various paircompare functions
*/
pair_builtincompare_add();
return 0;
}
开发者ID:jcartermeru,项目名称:freeradius-server,代码行数:36,代码来源:rlm_expr.c
示例10: mod_instantiate
static int mod_instantiate(CONF_SECTION *conf, void *instance)
{
module_instance_t *modinst;
rlm_rediswho_t *inst = instance;
inst->xlat_name = cf_section_name2(conf);
if (!inst->xlat_name)
inst->xlat_name = cf_section_name1(conf);
inst->cs = conf;
modinst = module_instantiate(cf_section_find("modules"),
inst->redis_instance_name);
if (!modinst) {
ERROR("rediswho: failed to find module instance \"%s\"",
inst->redis_instance_name);
return -1;
}
if (strcmp(modinst->entry->name, "rlm_redis") != 0) {
ERROR("rediswho: Module \"%s\""
" is not an instance of the redis module",
inst->redis_instance_name);
return -1;
}
inst->redis_inst = (REDIS_INST *) modinst->insthandle;
return 0;
}
开发者ID:janetuk,项目名称:freeradius,代码行数:31,代码来源:rlm_rediswho.c
示例11: mod_instantiate
static int mod_instantiate(void *instance, CONF_SECTION *listen_cs)
{
int rcode;
CONF_SECTION *server_cs;
proto_detail_process_t *inst = talloc_get_type_abort(instance, proto_detail_process_t);
vp_tmpl_rules_t parse_rules;
memset(&parse_rules, 0, sizeof(parse_rules));
parse_rules.dict_def = dict_freeradius;
rad_assert(listen_cs);
server_cs = cf_item_to_section(cf_parent(listen_cs));
rad_assert(strcmp(cf_section_name1(server_cs), "server") == 0);
rcode = unlang_compile_subsection(server_cs, "recv", NULL, inst->recv_type, &parse_rules);
if (rcode < 0) return rcode;
if (rcode == 0) {
cf_log_err(server_cs, "Failed finding 'recv { ... }' section of virtual server %s",
cf_section_name2(server_cs));
return -1;
}
rcode = unlang_compile_subsection(server_cs, "send", "ok", inst->send_type, &parse_rules);
if (rcode < 0) return rcode;
rcode = unlang_compile_subsection(server_cs, "send", "fail", inst->send_type, &parse_rules);
if (rcode < 0) return rcode;
return 0;
}
开发者ID:alagoutte,项目名称:freeradius-server,代码行数:31,代码来源:proto_detail_process.c
示例12: krb5_instantiate
static int krb5_instantiate(CONF_SECTION *conf, void *instance)
{
rlm_krb5_t *inst = instance;
krb5_error_code ret;
#ifndef HEIMDAL_KRB5
krb5_keytab keytab;
char keytab_name[200];
char *princ_name;
#endif
#ifdef HEIMDAL_KRB5
DEBUG("Using Heimdal Kerberos library");
#else
DEBUG("Using MIT Kerberos library");
#endif
#ifndef KRB5_IS_THREAD_SAFE
if (!krb5_is_thread_safe()) {
WDEBUG("libkrb5 is not threadsafe, recompile it, and the server with thread support enabled");
WDEBUG("rlm_krb5 will run in single threaded mode, performance may be degraded");
} else {
WDEBUG("Build time libkrb5 was not threadsafe, but run time library claims to be");
WDEBUG("Reconfigure and recompile rlm_krb5 to enable thread support");
}
#endif
inst->xlat_name = cf_section_name2(conf);
if (!inst->xlat_name) {
inst->xlat_name = cf_section_name1(conf);
}
ret = krb5_init_context(&inst->context);
if (ret) {
ERROR("rlm_krb5 (%s): context initialisation failed: %s", inst->xlat_name,
rlm_krb5_error(NULL, ret));
return -1;
}
/*
* Split service principal into service and host components
* they're needed to build the server principal in MIT,
* and to set the validation service in Heimdal.
*/
if (inst->service_princ) {
size_t len;
/* Service principal appears to contain a host component */
inst->hostname = strchr(inst->service_princ, '/');
if (inst->hostname) {
len = (inst->hostname - inst->service_princ);
inst->hostname++;
} else {
len = strlen(inst->service_princ);
}
if (len) {
inst->service = talloc_array(inst, char, (len + 1));
strlcpy(inst->service, inst->service_princ, len + 1);
}
}
开发者ID:AlainRomeyer,项目名称:freeradius-server,代码行数:59,代码来源:rlm_krb5.c
示例13: mod_bootstrap
/*
* Register the xlats
*/
static int mod_bootstrap(CONF_SECTION *conf, void *instance)
{
if (cf_section_name2(conf)) return 0;
xlat_register("unpack", unpack_xlat, NULL, instance);
return 0;
}
开发者ID:janetuk,项目名称:freeradius,代码行数:11,代码来源:rlm_unpack.c
示例14: mod_instantiate
/*
* Instantiate the module.
*/
static int mod_instantiate(void *instance, CONF_SECTION *conf)
{
rlm_logtee_t *inst = instance;
char prefix[100];
/*
* Escape filenames only if asked.
*/
if (inst->file.escape) {
inst->file.escape_func = rad_filename_escape;
} else {
inst->file.escape_func = rad_filename_make_safe;
}
inst->log_dst = fr_str2int(logtee_dst_table, inst->log_dst_str, LOGTEE_DST_INVALID);
if (inst->log_dst == LOGTEE_DST_INVALID) {
cf_log_err(conf, "Invalid log destination \"%s\"", inst->log_dst_str);
return -1;
}
inst->name = cf_section_name2(conf);
if (!inst->name) inst->name = cf_section_name1(conf);
snprintf(prefix, sizeof(prefix), "rlm_logtee (%s)", inst->name);
FR_SIZE_BOUND_CHECK("buffer_depth", inst->buffer_depth, >=, (size_t)1);
FR_SIZE_BOUND_CHECK("buffer_depth", inst->buffer_depth, <=, (size_t)1000000); /* 1 Million messages */
/*
* Setup the logging destination
*/
switch (inst->log_dst) {
case LOGTEE_DST_FILE:
cf_log_err(conf, "Teeing to files NYI");
return -1;
case LOGTEE_DST_UNIX:
#ifndef HAVE_SYS_UN_H
cf_log_err(conf, "Unix sockets are not supported on this sytem");
return -1;
#endif
case LOGTEE_DST_UDP:
break;
case LOGTEE_DST_TCP:
break;
case LOGTEE_DST_INVALID:
rad_assert(0);
break;
}
inst->delimiter_len = talloc_array_length(inst->delimiter) - 1;
return 0;
}
开发者ID:FreeRADIUS,项目名称:freeradius-server,代码行数:60,代码来源:rlm_logtee.c
示例15: _mod_client_map_section
/** Iterate over all client attribute pairs and create client pair data using JSON element names
*
* If we hit a CONF_SECTION we recurse and process its CONF_PAIRS as well to support nested
* configurations sections.
*
* @param client The new client config section using the mapped names.
* @param map The client attribute section from the module configuration.
* @param json JSON object representation of a client document fetched from Couchbase.
* @param docid Document id.
* @return Returns 0 on success, -1 on error.
*/
int _mod_client_map_section(CONF_SECTION *client, CONF_SECTION const *map,
json_object *json, char const *docid)
{
CONF_ITEM const *ci;
for (ci = cf_item_find_next(map, NULL); ci != NULL; ci = cf_item_find_next(map, ci)) {
CONF_PAIR const *cp;
char const *attribute;
char const *element;
json_object *jval;
/*
* Recursively process map subsection
*/
if (cf_item_is_section(ci)) {
CONF_SECTION *cs, *cc; /* local scoped for new section */
cs = cf_itemtosection(ci);
cc = cf_section_alloc(client, cf_section_name1(cs), cf_section_name2(cs));
if (!cc) return -1;
cf_section_add(client, cc);
if (_mod_client_map_section(cc, cs, json, docid) != 0) {
return -1;
}
/* continue on to the next item */
continue;
}
/* create pair from item and get attribute name and value */
cp = cf_itemtopair(ci);
attribute = cf_pair_attr(cp);
element = cf_pair_value(cp);
/* attempt to find element in json object */
if (!json_object_object_get_ex(json, element, &jval)) {
/* skip this item */
continue;
}
/* allocate config pair */
cp = cf_pair_alloc(client, attribute, json_object_get_string(jval), T_OP_SET, T_SINGLE_QUOTED_STRING);
/* check pair */
if (!cp) {
ERROR("rlm_couchbase: failed allocating config pair '%s' = '%s'", attribute, json_object_get_string(jval));
return -1;
}
/* add pair to section */
cf_item_add(client, cf_pairtoitem(cp));
}
/* return success */
return 0;
}
开发者ID:jrouzierinverse,项目名称:freeradius-server,代码行数:68,代码来源:mod.c
示例16: mod_bootstrap
static int mod_bootstrap(void *instance, CONF_SECTION *conf)
{
rlm_redis_t *inst = instance;
inst->name = cf_section_name2(conf);
if (!inst->name) inst->name = cf_section_name1(conf);
xlat_register(inst, inst->name, redis_xlat, NULL, NULL, 0, XLAT_DEFAULT_BUF_LEN, false);
return 0;
}
开发者ID:mcnewton,项目名称:freeradius-server,代码行数:11,代码来源:rlm_redis.c
示例17: mod_bootstrap
static int mod_bootstrap(void *instance, CONF_SECTION *conf)
{
rlm_delay_t *inst = instance;
xlat_t const *xlat;
inst->xlat_name = cf_section_name2(conf);
if (!inst->xlat_name) inst->xlat_name = cf_section_name1(conf);
xlat = xlat_async_register(inst, inst->xlat_name, xlat_delay);
xlat_async_instantiate_set(xlat, mod_xlat_instantiate, rlm_delay_t *, NULL, inst);
return 0;
}
开发者ID:geaaru,项目名称:freeradius-server,代码行数:12,代码来源:rlm_delay.c
示例18: rediswho_instantiate
static int rediswho_instantiate(CONF_SECTION * conf, void ** instance)
{
module_instance_t *modinst;
rlm_rediswho_t *inst;
/*
* Set up a storage area for instance data
*/
inst = *instance = rad_malloc(sizeof (*inst));
memset(inst, 0, sizeof (*inst));
/*
* If the configuration parameters can't be parsed, then
* fail.
*/
if (cf_section_parse(conf, inst, module_config) < 0) {
free(inst);
return -1;
}
inst->xlat_name = cf_section_name2(conf);
if (!inst->xlat_name)
inst->xlat_name = cf_section_name1(conf);
inst->xlat_name = strdup(inst->xlat_name);
inst->cs = conf;
modinst = find_module_instance(cf_section_find("modules"),
inst->redis_instance_name, 1);
if (!modinst) {
radlog(L_ERR,
"rediswho: failed to find module instance \"%s\"",
inst->redis_instance_name);
rediswho_detach(inst);
return -1;
}
if (strcmp(modinst->entry->name, "rlm_redis") != 0) {
radlog(L_ERR, "rediswho: Module \"%s\""
" is not an instance of the redis module",
inst->redis_instance_name);
rediswho_detach(inst);
return -1;
}
inst->redis_inst = (REDIS_INST *) modinst->insthandle;
return 0;
}
开发者ID:anlaneg,项目名称:freeradius-server,代码行数:52,代码来源:rlm_rediswho.c
示例19: mod_instantiate
/**
* Instantiate module.
* @param[in] conf Module config.
* @param[in] instance Module instance.
* @return Zero on success.
*/
static int mod_instantiate(CONF_SECTION *conf, void *instance) {
rlm_mongodb_t *inst = instance;
inst->name = cf_section_name2(conf);
if (!inst->name) {
inst->name = cf_section_name1(conf);
}
if (!strcasecmp(inst->cfg.action, "get")) {
inst->action = RLM_MONGODB_GET;
cf_log_err_cs(conf, "action 'get' is not implemented");
goto err;
} else if (!strcasecmp(inst->cfg.action, "set")) {
inst->action = RLM_MONGODB_SET;
} else {
cf_log_err_cs(conf, "invalid 'action', use'get' or 'set'");
goto err;
}
if (inst->cfg.remove && inst->cfg.update_query) {
cf_log_err_cs(conf, "'update_query' and 'remove' can't be used at the same time");
goto err;
} else if (!inst->cfg.remove && !inst->cfg.update_query) {
cf_log_err_cs(conf, "'update_query' or 'remove' must be set for 'set' action");
goto err;
}
if (!cf_pair_find(conf, "pool")) {
if (!inst->cfg.server) {
cf_log_err_cs(conf, "Invalid or missing 'server' option");
goto err;
}
} else {
if (inst->cfg.server) {
cf_log_err_cs(conf, "Can't use server option when foreign connection pool specified");
goto err;
}
}
mongoc_init();
mongoc_log_set_handler(mongoc_log_handler, inst);
inst->pool = fr_connection_pool_module_init(conf, inst, mod_conn_create, NULL, inst->name);
if (!inst->pool) {
goto err;
}
return 0;
err:
return -1;
}
开发者ID:intersvyaz,项目名称:rlm_mongodb_ops,代码行数:58,代码来源:rlm_mongodb.c
示例20: mod_instantiate
static int mod_instantiate(CONF_SECTION *conf, void *instance)
{
const char *name;
rlm_soh_t *inst = instance;
name = cf_section_name2(conf);
if (!name) name = cf_section_name1(conf);
inst->xlat_name = name;
if (!inst->xlat_name) return -1;
xlat_register(inst->xlat_name, soh_xlat, inst);
return 0;
}
开发者ID:jcartermeru,项目名称:freeradius-server,代码行数:13,代码来源:rlm_soh.c
注:本文中的cf_section_name2函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论