]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add state maching support for auth restart and auth error
authorAlan T. DeKok <aland@freeradius.org>
Tue, 14 Feb 2023 12:56:45 +0000 (07:56 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 14 Feb 2023 13:13:03 +0000 (08:13 -0500)
src/process/tacacs/base.c

index 6cb05b16f993ac59450d70c9b21a8590e049742b..51026212fedb149089ac1cc64fc50c3e5956d857 100644 (file)
@@ -786,6 +786,16 @@ RESUME_NO_RCTX(auth_fail)
        RETURN_MODULE_OK;
 }
 
+RESUME_NO_RCTX(auth_restart)
+{
+       process_tacacs_t const          *inst = talloc_get_type_abort_const(mctx->inst->data, process_tacacs_t);
+
+       PROCESS_TRACE;
+
+       fr_state_discard(inst->auth.state_tree, request);
+       RETURN_MODULE_OK;
+}
+
 RESUME(auth_get)
 {
        process_tacacs_t const          *inst = talloc_get_type_abort_const(mctx->inst->data, process_tacacs_t);
@@ -1219,6 +1229,22 @@ static fr_process_state_t const process_state[] = {
                .resume = resume_auth_get,
                .section_offset = offsetof(process_tacacs_sections_t, auth_getuser),
        },
+       [ FR_TACACS_CODE_AUTH_RESTART ] = {
+               .packet_type = {
+               },
+               .rcode = RLM_MODULE_NOOP,
+               .send = send_generic,
+               .resume = resume_auth_restart,
+               .section_offset = offsetof(process_tacacs_sections_t, auth_restart),
+       },
+       [ FR_TACACS_CODE_AUTH_ERROR ] = {
+               .packet_type = {
+               },
+               .rcode = RLM_MODULE_NOOP,
+               .send = send_generic,
+               .resume = resume_auth_restart,
+               .section_offset = offsetof(process_tacacs_sections_t, auth_error),
+       },
 
        [ FR_TACACS_CODE_AUTH_CONT ] = {
                .packet_type = {