cosmetic: clarify session active / partially active semantics

Change-Id: I2db85b3ffd61cbf8fb404b17ee3b6593d1d189c4
This commit is contained in:
Neels Hofmeyr 2023-02-11 01:08:07 +01:00 committed by neels
parent 40a30fce4a
commit 5bd84491b8
2 changed files with 6 additions and 1 deletions

View File

@ -1529,11 +1529,16 @@ static enum osmo_pfcp_cause up_session_setup_gtp(struct up_session *session)
return cause;
}
/* Return true when the session is in Established state and has active GTP actions. */
bool up_session_is_active(struct up_session *session)
{
return session && (session->fi->state == UP_SESSION_ST_ESTABLISHED) && !llist_empty(&session->active_gtp_actions);
}
/* Return true when up_session_is_active() == true *and* it has only active PDR/FAR pairs.
* A PDR/FAR is inactive when it is not part of an active GTP action. Reasons may be that it has no PDR-to-FAR relation,
* there is no matching reverse PDR/FAR, that a FAR is not set to FORW, an ignored Source/Destination Interface, ...
*/
bool up_session_is_fully_active(struct up_session *session, int *active_p, int *inactive_p)
{
struct pdr *pdr;

View File

@ -481,7 +481,7 @@ DEFUN(show_session, show_session_cmd,
}
}
}
vty_out(vty, "(%d fully-active + %d partially active + %d inactive)%s",
vty_out(vty, "(%d fully-active + %d active with some PDR/FAR ignored + %d inactive)%s",
fully_active_count, active_count, inactive_count, VTY_NEWLINE);
return CMD_SUCCESS;
}