*
* Example:
@verbatim
-"%(chap_password:<password>)" == 0x<id><md5_hash>
+"%(chap.password:<password>)" == 0x<id><md5_hash>
@endverbatim
*
* @ingroup xlat_functions
return 0;
}
-static int mod_load(void)
+static int mod_bootstrap(module_inst_ctx_t const *mctx)
{
xlat_t *xlat;
- if (unlikely((xlat = xlat_func_register(NULL, "chap_password", xlat_func_chap_password, FR_TYPE_OCTETS)) == NULL)) return -1;
+ if (unlikely((xlat = xlat_func_register_module(NULL, mctx, "password", xlat_func_chap_password,
+ FR_TYPE_OCTETS)) == NULL)) return -1;
xlat_func_args_set(xlat, xlat_func_chap_password_args);
return 0;
}
-static void mod_unload(void)
-{
- xlat_func_unregister("chap_password");
-}
-
/*
* The module name should be the only globally exported symbol.
* That is, everything else should be 'static'.
.magic = MODULE_MAGIC_INIT,
.name = "chap",
.inst_size = sizeof(rlm_chap_t),
- .onload = mod_load,
- .unload = mod_unload,
+ .bootstrap = mod_bootstrap,
.config = module_config,
.instantiate = mod_instantiate
},
==== CHAP Access-Request - unlang
```
User-Name = "testuser"
-Chap-Password = %(chap_password:supersecret)
+Chap-Password = %(chap.password:supersecret)
Service-Type = Framed-User
NAS-IP-Address = 127.0.0.1
Tunnel-Password = "supersecret"
&CHAP-Challenge := 0x0102030405060708090a0b0c0d0e0f10
&control.Password.Cleartext := "supersecret"
-&CHAP-Password := "%(chap_password:%{control.Password.Cleartext})"
+&CHAP-Password := "%(chap.password:%{control.Password.Cleartext})"
chap.authenticate
if (ok) {