}
-static unlang_t *compile_fork(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs,
- unlang_group_type_t group_type, unlang_group_type_t parentgroup_type, unlang_type_t mod_type)
+static unlang_t *compile_create(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs,
+ unlang_group_type_t group_type, unlang_group_type_t parentgroup_type, unlang_type_t mod_type)
{
char const *name2;
unlang_t *c;
return NULL;
}
+ /*
+ * @todo - figure out how to tell protocol at
+ * compile time? Packet-Type is RADIUS-specific,
+ * and we want this to be protocol-specific.
+ */
da = fr_dict_attr_by_name(NULL, "Packet-Type");
if (!da) {
cf_log_err(cs, "Failed finding Packet-Type attribute for 'fork'");
{ "map", compile_map, UNLANG_GROUP_TYPE_SIMPLE, UNLANG_TYPE_MAP },
{ "switch", compile_switch, UNLANG_GROUP_TYPE_SIMPLE, UNLANG_TYPE_SWITCH },
{ "parallel", compile_parallel, UNLANG_GROUP_TYPE_SIMPLE, UNLANG_TYPE_PARALLEL },
- { "fork", compile_fork, UNLANG_GROUP_TYPE_SIMPLE, UNLANG_TYPE_FORK },
+ { "create", compile_create, UNLANG_GROUP_TYPE_SIMPLE, UNLANG_TYPE_CREATE },
{ NULL, NULL, 0, UNLANG_TYPE_NULL }
};
FR_DLIST_INIT(child->async->time_order);
/*
- * fork() is a copy???
+ * create {...} creates an empty copy.
*/
- child->packet->vps = fr_pair_list_copy(child->packet, request->packet->vps);
return child;
}
/** Send a signal from parent request to child
*
*/
-static void unlang_fork_signal(UNUSED REQUEST *request, UNUSED void *instance, UNUSED void *thread, void *ctx,
+static void unlang_create_signal(UNUSED REQUEST *request, UNUSED void *instance, UNUSED void *thread, void *ctx,
fr_state_action_t action)
{
REQUEST *child = talloc_get_type_abort(ctx, REQUEST);
}
-/** Resume a forked request
+/** Resume a created child request
*
*/
-static rlm_rcode_t unlang_fork_resume(UNUSED REQUEST *request, unlang_stack_t *stack,
+static rlm_rcode_t unlang_create_resume(UNUSED REQUEST *request, unlang_stack_t *stack,
UNUSED const void *instance, UNUSED void *thread, void *resume_ctx)
{
REQUEST *child = talloc_get_type_abort(resume_ctx, REQUEST);
frame = &stack->frame[stack->depth];
rad_assert(frame->instruction->type == UNLANG_TYPE_RESUME);
- frame->instruction->type = UNLANG_TYPE_FORK; /* for debug purposes */
+ frame->instruction->type = UNLANG_TYPE_CREATE; /* for debug purposes */
talloc_free(child);
return rcode;
}
(void) talloc_get_type_abort(mr, unlang_resume_t);
rad_assert(mr->callback == NULL);
- rad_assert(mr->signal_callback == unlang_fork_signal);
+ rad_assert(mr->signal_callback == unlang_create_signal);
rad_assert(mr->resume_ctx == child);
#endif
return RLM_MODULE_YIELD;
}
-static unlang_action_t unlang_fork(REQUEST *request, unlang_stack_t *stack,
- rlm_rcode_t *presult, int *priority)
+static unlang_action_t unlang_create(REQUEST *request, unlang_stack_t *stack,
+ rlm_rcode_t *presult, int *priority)
{
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
unlang_t *instruction = frame->instruction;
/*
* Create the "resume" stack frame, and have it replace our stack frame.
*/
- mr = unlang_resume_alloc(request, NULL, unlang_fork_signal, child);
+ mr = unlang_resume_alloc(request, NULL, unlang_create_signal, child);
if (!mr) {
*presult = RLM_MODULE_FAIL;
*priority = instruction->actions[*presult];
}
static unlang_op_resume_func_t unlang_ops_resume[] = {
- [UNLANG_TYPE_FORK] = unlang_fork_resume,
+ [UNLANG_TYPE_CREATE] = unlang_create_resume,
[UNLANG_TYPE_PARALLEL] = unlang_parallel_resume,
};
.func = unlang_policy,
.debug_braces = true
},
- [UNLANG_TYPE_FORK] = {
- .name = "fork",
- .func = unlang_fork,
+ [UNLANG_TYPE_CREATE] = {
+ .name = "create",
+ .func = unlang_create,
.debug_braces = true
},
#endif
VERIFY_REQUEST(request);
/*
- * We may be multiple layers deep in fork{} or
+ * We may be multiple layers deep in create{} or
* parallel{}. Only the top-level request is
* tracked && marked "stop processing".
*/