/* mutually-recursive static functions need a prototype up front */
static modcallable *do_compile_modgroup(int, CONF_SECTION *, const char *,
- int, int);
+ int, int);
/* Actions may be a positive integer (the highest one returned in the group
* will be returned), or the keyword "return", represented here by
return atoi(s);
else {
radlog(L_ERR|L_CONS,
- "%s[%d] Unknown action '%s'.\n",
- filename, lineno, s);
+ "%s[%d] Unknown action '%s'.\n",
+ filename, lineno, s);
exit(1);
}
}
*/
static void safe_lock(module_instance_t *instance)
{
- if (instance->mutex) pthread_mutex_lock(instance->mutex);
+ if (instance->mutex)
+ pthread_mutex_lock(instance->mutex);
}
/*
*/
static void safe_unlock(module_instance_t *instance)
{
- if (instance->mutex) pthread_mutex_unlock(instance->mutex);
+ if (instance->mutex)
+ pthread_mutex_unlock(instance->mutex);
}
#else
/*
#endif
static int call_modsingle(int component, modsingle *sp, REQUEST *request,
- int default_result)
+ int default_result)
{
int myresult = default_result;
safe_lock(sp->modinst);
myresult = sp->modinst->entry->module->methods[component](
- sp->modinst->insthandle, request);
+ sp->modinst->insthandle, request);
safe_unlock(sp->modinst);
return myresult;
}
static int call_modgroup(int component, modgroup *g, REQUEST *request,
- int default_result)
+ int default_result)
{
int myresult = default_result;
int myresultpref;
/* Choose a default return value appropriate for the component */
switch(component) {
- case RLM_COMPONENT_AUTZ: myresult = RLM_MODULE_NOTFOUND;break;
- case RLM_COMPONENT_AUTH: myresult = RLM_MODULE_REJECT; break;
- case RLM_COMPONENT_PREACCT:myresult = RLM_MODULE_NOOP; break;
- case RLM_COMPONENT_ACCT: myresult = RLM_MODULE_NOOP; break;
- case RLM_COMPONENT_SESS: myresult = RLM_MODULE_FAIL; break;
+ case RLM_COMPONENT_AUTZ: myresult = RLM_MODULE_NOTFOUND;break;
+ case RLM_COMPONENT_AUTH: myresult = RLM_MODULE_REJECT; break;
+ case RLM_COMPONENT_PREACCT: myresult = RLM_MODULE_NOOP; break;
+ case RLM_COMPONENT_ACCT: myresult = RLM_MODULE_NOOP; break;
+ case RLM_COMPONENT_SESS: myresult = RLM_MODULE_FAIL; break;
default: myresult = RLM_MODULE_FAIL;
}
if(!c) {
- DEBUG2("modcall[%s]: Null object returns %s",
- comp2str[component], rcode2str[myresult]);
- return myresult;
+ DEBUG2("modcall[%s]: Null object returns %s",
+ comp2str[component], rcode2str[myresult]);
+ return myresult;
}
if(c->type==MOD_GROUP) {
/* Parse a CONF_SECTION containing only result=action pairs */
static void override_actions(modcallable *c, CONF_SECTION *cs,
- const char *filename)
+ const char *filename)
{
CONF_ITEM *ci;
CONF_PAIR *cp;
}
static modcallable *do_compile_modsingle(int component, CONF_ITEM *ci,
- const char *filename, int grouptype,
- const char **modname)
+ const char *filename, int grouptype,
+ const char **modname)
{
int lineno;
const char *modrefname;
if(!strcmp(modrefname, "group")) {
*modname = "UnnamedGroup";
return do_compile_modgroup(component, cs, filename,
- GROUPTYPE_SIMPLEGROUP, grouptype);
+ GROUPTYPE_SIMPLEGROUP, grouptype);
} else if(!strcmp(modrefname, "redundant")) {
*modname = "UnnamedGroup";
return do_compile_modgroup(component, cs, filename,
- GROUPTYPE_REDUNDANT, grouptype);
+ GROUPTYPE_REDUNDANT, grouptype);
} else if(!strcmp(modrefname, "append")) {
*modname = "UnnamedGroup";
return do_compile_modgroup(component, cs, filename,
- GROUPTYPE_APPEND, grouptype);
+ GROUPTYPE_APPEND, grouptype);
}
} else {
CONF_PAIR *cp = cf_itemtopair(ci);
}
modcallable *compile_modsingle(int component, CONF_ITEM *ci,
- const char *filename, const char **modname)
+ const char *filename, const char **modname)
{
modcallable *ret = do_compile_modsingle(component, ci, filename,
- GROUPTYPE_SIMPLEGROUP,
- modname);
+ GROUPTYPE_SIMPLEGROUP,
+ modname);
/*dump_tree(component, ret);*/
return ret;
}
static modcallable *do_compile_modgroup(int component, CONF_SECTION *cs,
- const char *filename, int grouptype,
- int parentgrouptype)
+ const char *filename, int grouptype,
+ int parentgrouptype)
{
modgroup *g;
modcallable *c;
const char *junk;
modcallable *single;
single = do_compile_modsingle(component, ci, filename,
- grouptype, &junk);
+ grouptype, &junk);
add_child(g, single);
} else {
const char *attr, *value;
}
modcallable *compile_modgroup(int component, CONF_SECTION *cs,
- const char *filename)
+ const char *filename)
{
modcallable *ret = do_compile_modgroup(component, cs, filename,
- GROUPTYPE_SIMPLEGROUP,
- GROUPTYPE_SIMPLEGROUP);
+ GROUPTYPE_SIMPLEGROUP,
+ GROUPTYPE_SIMPLEGROUP);
/*dump_tree(component, ret);*/
return ret;
}
void add_to_modcallable(modcallable **parent, modcallable *this,
- int component, int lineno)
+ int component, int lineno)
{
modgroup *g;
c = mod_grouptocallable(g);
c->next = NULL;
memcpy(c->actions,
- defaultactions[component][GROUPTYPE_SIMPLEGROUP],
- sizeof c->actions);
+ defaultactions[component][GROUPTYPE_SIMPLEGROUP],
+ sizeof c->actions);
c->lineno = lineno;
c->type = MOD_GROUP;
g->children = NULL;