kernel-interface: Add feature to indicate if query_sa() returns last use time

Currently supported by libipsec and PF_KEY on macOS (FreeBSD, like Linux,
reports the time the SA was first used in sadb_lifetime_usetime - it also
triggers rekeyings based on that, which Linux doesn't, it also triggers
them if an SA is never used).
This commit is contained in:
Tobias Brunner
2023-02-22 13:20:10 +01:00
parent 1efdb0f791
commit b9131c34d3
5 changed files with 40 additions and 11 deletions
+7 -4
View File
@@ -269,7 +269,11 @@ struct kernel_ipsec_t {
kernel_ipsec_update_sa_t *data);
/**
* Query the number of bytes processed by an SA from the SAD.
* Query the number of bytes and packets processed by an SA from the SAD.
*
* Some implementations may also return the last use time (as indicated by
* get_features()). This is a monotonic timestamp as returned by
* time_monotonic().
*
* @param id data identifying this SA
* @param data data to query the SA
@@ -314,12 +318,11 @@ struct kernel_ipsec_t {
* Query the use time of a policy.
*
* The use time of a policy is the time the policy was used for the last
* time. It is not the system time, but a monotonic timestamp as returned
* by time_monotonic.
* time. This is a monotonic timestamp as returned by time_monotonic().
*
* @param id data identifying this policy
* @param data data to query the policy
* @param[out] use_time the monotonic timestamp of this SA's last use
* @param[out] use_time the monotonic timestamp of this policy's last use
* @return SUCCESS if operation completed
*/
status_t (*query_policy)(kernel_ipsec_t *this,