*/
env = getenv("FR_GLOBAL_POOL");
if (env) {
- if (fr_size_from_str(&pool_size, &FR_SBUFF_IN(env, strlen(env))) < 0) {
+ if (fr_size_from_str(&pool_size, &FR_SBUFF_IN_STR(env)) < 0) {
fr_perror("%s: Invalid pool size string \"%s\"", program, env);
EXIT_WITH_FAILURE;
}
};
relative = (fr_pair_parse_t) { };
- if (fr_pair_list_afrom_substr(&root, &relative, &FR_SBUFF_IN(filter, strlen(filter))) <= 0) {
+ if (fr_pair_list_afrom_substr(&root, &relative, &FR_SBUFF_IN_STR(filter)) <= 0) {
fr_perror("Invalid RADIUS filter \"%s\"", filter);
return -1;
}
fr_sbuff_t value_elem = FR_SBUFF_IN(tmp, sizeof(tmp));
size_t size;
- if (fr_size_from_str(&size, &FR_SBUFF_IN(value, strlen(value))) < 0) {
+ if (fr_size_from_str(&size, &FR_SBUFF_IN_STR(value)) < 0) {
cf_log_perr(cs, "Failed parsing default \"%s\"", value);
return -1;
}
in = buffer;
}
- len = tmpl_afrom_substr(ctx, &parsed, &FR_SBUFF_IN(in, strlen(in)), T_DOUBLE_QUOTED_STRING, NULL, t_rules);
+ len = tmpl_afrom_substr(ctx, &parsed, &FR_SBUFF_IN_STR(in), T_DOUBLE_QUOTED_STRING, NULL, t_rules);
talloc_free(buffer);
MEM(tmp_ctx = talloc_init_const("tmp"));
slen = tmpl_request_ref_list_afrom_substr(ctx, NULL, &our_lhs_rules.attr.request_def,
- &FR_SBUFF_IN(p, strlen(p)));
+ &FR_SBUFF_IN_STR(p));
if (slen < 0) {
cf_log_err(ci, "Invalid reference - %s", fr_strerror());
talloc_free(tmp_ctx);
}
p += slen;
- slen = tmpl_attr_list_from_substr(&our_lhs_rules.attr.list_def, &FR_SBUFF_IN(p, strlen(p)));
+ slen = tmpl_attr_list_from_substr(&our_lhs_rules.attr.list_def, &FR_SBUFF_IN_STR(p));
if (slen == 0) {
cf_log_err(ci, "Unknown list reference \"%s\"", p);
talloc_free(tmp_ctx);
map = map_alloc(ctx, NULL);
slen = tmpl_afrom_substr(map, &map->lhs,
- &FR_SBUFF_IN(lhs, strlen(lhs)),
+ &FR_SBUFF_IN_STR(lhs),
lhs_quote,
NULL,
lhs_rules);
fr_assert(tmpl_is_attr(parent->lhs));
my_rules.attr.namespace = tmpl_attr_tail_da(parent->lhs);
- slen = tmpl_afrom_attr_substr(map, NULL, &map->lhs, &FR_SBUFF_IN(lhs, strlen(lhs)),
+ slen = tmpl_afrom_attr_substr(map, NULL, &map->lhs, &FR_SBUFF_IN_STR(lhs),
&map_parse_rules_bareword_quoted, lhs_rules);
} else {
/*
/*
* Parse it as the given data type.
*/
- slen = tmpl_afrom_substr(map, &map->rhs, &FR_SBUFF_IN(rhs, strlen(rhs)),
+ slen = tmpl_afrom_substr(map, &map->rhs, &FR_SBUFF_IN_STR(rhs),
T_BARE_WORD, value_parse_rules_unquoted[T_BARE_WORD], &my_rules);
if (slen <= 0) {
goto parse_as_attr;
static inline CC_HINT(always_inline)
int _tmpl_setup_and_cursor_init(fr_pair_t **vp_out, tmpl_dcursor_vars_t *vars, request_t *request, char const *ref)
{
- tmpl_afrom_attr_substr(autofree, NULL, &vars->vpt, &FR_SBUFF_IN(ref, strlen(ref)), NULL, &(tmpl_rules_t){
+ tmpl_afrom_attr_substr(autofree, NULL, &vars->vpt, &FR_SBUFF_IN_STR(ref), NULL, &(tmpl_rules_t){
.attr = {
.dict_def = test_dict,
.list_def = request_attr_request,
static inline CC_HINT(always_inline)
int _tmpl_setup_and_cursor_build_init(fr_pair_t **vp_out, tmpl_dcursor_vars_t *vars, request_t *request, char const *ref)
{
- tmpl_afrom_attr_substr(autofree, NULL, &vars->vpt, &FR_SBUFF_IN(ref, strlen(ref)), NULL, &(tmpl_rules_t){
+ tmpl_afrom_attr_substr(autofree, NULL, &vars->vpt, &FR_SBUFF_IN_STR(ref), NULL, &(tmpl_rules_t){
.attr = {
.dict_def = test_dict,
.list_def = request_attr_request,
slen = module_rlm_by_name_and_method(m, &m->mmc,
unlang_ctx->vs,
&(section_name_t){ .name1 = unlang_ctx->section_name1, .name2 = unlang_ctx->section_name2 },
- &FR_SBUFF_IN(name, strlen(name)),
+ &FR_SBUFF_IN_STR(name),
unlang_ctx->rules);
if (slen < 0) {
cf_log_perr(ci, "Failed compiling module call");
p_rules.terminals = &if_terminals;
- slen = xlat_tokenize_condition(cs, &head, &FR_SBUFF_IN(name2, strlen(name2)), &p_rules, &t_rules);
+ slen = xlat_tokenize_condition(cs, &head, &FR_SBUFF_IN_STR(name2), &p_rules, &t_rules);
if (slen == 0) {
cf_canonicalize_error(cs, slen, "Empty conditions are invalid", name2);
return NULL;
}
slen = tmpl_afrom_substr(g, &vpt,
- &FR_SBUFF_IN(name2, strlen(name2)),
+ &FR_SBUFF_IN_STR(name2),
token,
NULL,
&t_rules);
RULES_VERIFY(&t_rules);
slen = tmpl_afrom_substr(gext, &vpt,
- &FR_SBUFF_IN(name2, strlen(name2)),
+ &FR_SBUFF_IN_STR(name2),
token,
NULL,
&t_rules);
quote = cf_section_name2_quote(cs);
gext = unlang_group_to_load_balance(g);
slen = tmpl_afrom_substr(gext, &gext->vpt,
- &FR_SBUFF_IN(name2, strlen(name2)),
+ &FR_SBUFF_IN_STR(name2),
quote,
NULL,
&t_rules);
quote = cf_section_name2_quote(cs);
slen = tmpl_afrom_substr(cs, &vpt,
- &FR_SBUFF_IN(name2, strlen(name2)),
+ &FR_SBUFF_IN_STR(name2),
quote,
NULL,
&t_rules);
if ((token == T_BARE_WORD) && (name2[0] != '%')) {
slen = tmpl_afrom_attr_substr(gext, NULL, &gext->vpt,
- &FR_SBUFF_IN(name2, strlen(name2)),
+ &FR_SBUFF_IN_STR(name2),
NULL,
&t_rules);
} else {
slen = tmpl_afrom_substr(gext, &gext->vpt,
- &FR_SBUFF_IN(name2, strlen(name2)),
+ &FR_SBUFF_IN_STR(name2),
token,
NULL,
&t_rules);
RULES_VERIFY(&t_rules);
slen = tmpl_afrom_substr(gext, &vpt,
- &FR_SBUFF_IN(name2, strlen(name2)),
+ &FR_SBUFF_IN_STR(name2),
token,
NULL,
&t_rules);
* Give better errors than the old code.
*/
len = xlat_tokenize(ctx, &head,
- &FR_SBUFF_IN(fmt, strlen(fmt)),
+ &FR_SBUFF_IN_STR(fmt),
NULL,
&(tmpl_rules_t){
.attr = {
*
* foo = { bar = baz }
*/
- if (fr_pair_list_afrom_substr(&root, &relative, &FR_SBUFF_IN(buf, strlen(buf))) < 0) {
+ if (fr_pair_list_afrom_substr(&root, &relative, &FR_SBUFF_IN_STR(buf)) < 0) {
*pfiledone = false;
fr_pair_list_free(&tmp_list);
return -1;
while ((p = strchr(p, '#'))) {
*p = (char)(i + 48);
}
- slen = fr_pair_list_afrom_substr(&root, &relative, &FR_SBUFF_IN(prep_pairs, strlen(prep_pairs)));
+ slen = fr_pair_list_afrom_substr(&root, &relative, &FR_SBUFF_IN_STR(prep_pairs));
if (slen <= 0) fr_perror("pair_list_perf_tests");
TEST_ASSERT(slen > 0);
*/
-#define test_str(_str) &FR_SBUFF_IN(_str, strlen(_str))
+#define test_str(_str) &FR_SBUFF_IN_STR(_str)
#define test_out(_buff) &FR_SBUFF_OUT(_buff, sizeof(_buff))
static char buff[sizeof("18446744073709551615") + 3];
DEBUG2("LDAP filter %s does not match Active Directory requirements, parsing for local filtering.",
sync->config->filter);
filter = "(objectClass=*)";
- ret = fr_ldap_filter_parse(sync, &sync->filter, &FR_SBUFF_IN(config->filter, strlen(config->filter)),
+ ret = fr_ldap_filter_parse(sync, &sync->filter, &FR_SBUFF_IN_STR(config->filter),
active_directory_sync_attr_add, UNCONST(sync_config_t *,config));
if (ret < 0) {
CONF_ITEM *ci;
RDEBUG2("Found new challenge from MS-CHAP-Error: err=%d retry=%d challenge=%s",
err, retry, buf);
fr_base16_decode(NULL, &FR_DBUFF_TMP(data->auth_challenge, 16),
- &FR_SBUFF_IN(buf, strlen(buf)), false);
+ &FR_SBUFF_IN_STR(buf), false);
} else {
RDEBUG2("Could not parse new challenge from MS-CHAP-Error: %d", n);
}
MEM(fr_sbuff_init_talloc(conf, &out, &tctx, strlen(argv[1]) + 1, SIZE_MAX));
(void) fr_value_str_unescape(&out,
- &FR_SBUFF_IN(argv[1], strlen(argv[1])), SIZE_MAX, '"');
+ &FR_SBUFF_IN_STR(argv[1]), SIZE_MAX, '"');
talloc_realloc(conf, out.buff, uint8_t, fr_sbuff_used(&out));
pool_arg = (uint8_t *)out.buff;
}
MEM(fr_sbuff_init_talloc(conf, &out, &tctx, strlen(argv[1]) + 1, SIZE_MAX));
(void) fr_value_str_unescape(&out,
- &FR_SBUFF_IN(argv[2], strlen(argv[2])), SIZE_MAX, '"');
+ &FR_SBUFF_IN_STR(argv[2]), SIZE_MAX, '"');
talloc_realloc(conf, out.buff, uint8_t, fr_sbuff_used(&out));
range_arg = (uint8_t *)out.buff;
}
return 1;
}
- len = fr_base32_decode(&FR_DBUFF_TMP(key, sizeof(key)), &FR_SBUFF_IN(argv[2], strlen(argv[2])), true, true);
+ len = fr_base32_decode(&FR_DBUFF_TMP(key, sizeof(key)), &FR_SBUFF_IN_STR(argv[2]), true, true);
printf("Decoded %ld %s\n", len, key);
for (p = key; p < (key + len); p++) {
}
tmpl_afrom_substr(ctx, &parsed_tmpl,
- &FR_SBUFF_IN(wb_info->netbios_domain, strlen(wb_info->netbios_domain)),
+ &FR_SBUFF_IN_STR(wb_info->netbios_domain),
T_SINGLE_QUOTED_STRING, NULL, t_rules);
if (!parsed_tmpl) {
cf_log_perr(ci, "Bad domain");
*/
token = fr_base16_decode(NULL,
&FR_DBUFF_TMP(net->node, IPX_NODE_ADDR_LEN),
- &FR_SBUFF_IN(p, strlen(p)), false);
+ &FR_SBUFF_IN_STR(p), false);
if (token != IPX_NODE_ADDR_LEN) {
fr_strerror_printf("IPX network node name '%s' is the wrong size", argv[2]);
return -1;
slen = fr_base16_decode(NULL,
&FR_DBUFF_TMP(filter->mask, sizeof(filter->mask)),
- &FR_SBUFF_IN(argv[1], strlen(argv[1])), false);
+ &FR_SBUFF_IN_STR(argv[1]), false);
if (slen != sizeof(filter->mask)) {
fr_strerror_printf("Invalid filter mask '%s'", argv[1]);
return -1;
token = fr_base16_decode(NULL,
&FR_DBUFF_TMP(filter->value, sizeof(filter->value)),
- &FR_SBUFF_IN(argv[2], strlen(argv[2])), false);
+ &FR_SBUFF_IN_STR(argv[2]), false);
if (token != sizeof(filter->value)) {
fr_strerror_printf("Invalid filter mask '%s'", argv[1]);
return -1;