summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cesar/cp/av/cco/action/src/cco_action.c22
-rw-r--r--cesar/cp/av/sta/action/src/handover.c3
-rw-r--r--cesar/cp/cco/action/inc/cco_action.h4
3 files changed, 23 insertions, 6 deletions
diff --git a/cesar/cp/av/cco/action/src/cco_action.c b/cesar/cp/av/cco/action/src/cco_action.c
index c2c8b901e1..9aff1c8f9f 100644
--- a/cesar/cp/av/cco/action/src/cco_action.c
+++ b/cesar/cp/av/cco/action/src/cco_action.c
@@ -320,6 +320,8 @@ cp_av_cco_action_init (cp_t *ctx)
cp_av_cco_region_default (ctx);
ctx->cco_action.nek_change_period_ms = HPAV_NEK_CHANGE_MS;
+ ctx->cco_action.tei_lease_assoc_min = CP_LEASE_ASSOC_MIN;
+ ctx->cco_action.tei_lease_auth_min = CP_LEASE_AUTH_MIN;
if (CONFIG_STATS)
{
lib_stats_set_stat_value_notype (
@@ -327,6 +329,16 @@ cp_av_cco_action_init (cp_t *ctx)
&ctx->cco_action.nek_change_period_ms,
LIB_STATS_ACCESS_READ_WRITE,
LIB_STATS_DEBUG);
+ lib_stats_set_stat_value_notype (
+ "TEI_LEASE_ASSOCIATION_MIN",
+ &ctx->cco_action.tei_lease_assoc_min,
+ LIB_STATS_ACCESS_READ_WRITE,
+ LIB_STATS_DEBUG);
+ lib_stats_set_stat_value_notype (
+ "TEI_LEASE_AUTHENTICATION_MIN",
+ &ctx->cco_action.tei_lease_auth_min,
+ LIB_STATS_ACCESS_READ_WRITE,
+ LIB_STATS_DEBUG);
}
}
@@ -664,7 +676,7 @@ cp_av_cco_action__assoc__join (cp_t *ctx, cp_mme_rx_t *msg,
if (MAC_TEI_IS_STA (tei))
{
cnf.result = CP_MSG_CC_ASSOC_CNF_RESULT_SUCCESS;
- cnf.lease_time_min = CP_LEASE_ASSOC_MIN;
+ cnf.lease_time_min = ctx->cco_action.tei_lease_assoc_min;
}
/* Otherwise, it's an error. */
else
@@ -688,7 +700,7 @@ cp_av_cco_action__assoc__join (cp_t *ctx, cp_mme_rx_t *msg,
cp_sta_mgr_commit_to_dataplane (ctx);
u32 date_ms = cp_sta_core_get_date_ms (ctx);
sta->tei_lease_date_ms = date_ms +
- MAC_SEC_TO_MS(CP_LEASE_ASSOC_MIN * 60);
+ MAC_SEC_TO_MS(ctx->cco_action.tei_lease_assoc_min * 60);
/* Update the last request date in the sta. */
cp_sta_set_assoc_confirmed (ctx, sta, false);
@@ -743,10 +755,10 @@ cp_av_cco_action__assoc__renew (cp_t *ctx, cp_mme_rx_t *msg,
/* Renew the TEI. */
u32 date_ms = cp_sta_core_get_date_ms (ctx);
sta->tei_lease_date_ms = date_ms +
- MAC_SEC_TO_MS(CP_LEASE_AUTH_MIN * 60);
+ MAC_SEC_TO_MS(ctx->cco_action.tei_lease_auth_min * 60);
cnf.result = CP_MSG_CC_ASSOC_CNF_RESULT_SUCCESS;
cnf.sta_tei = cp_sta_get_tei (sta);
- cnf.lease_time_min = CP_LEASE_AUTH_MIN;
+ cnf.lease_time_min = ctx->cco_action.tei_lease_auth_min;
slab_release (sta);
}
@@ -1244,7 +1256,7 @@ cp_av_cco_action_sc__sc_cco__cc_assoc_req (cp_t *ctx, cp_mme_rx_t *mme)
/* No TEI for the STA. */
cnf.sta_tei = 0;
/* Lease default value. */
- cnf.lease_time_min = CP_LEASE_ASSOC_MIN;
+ cnf.lease_time_min = ctx->cco_action.tei_lease_assoc_min;
/* Send reply. */
cp_msg_cc_assoc_cnf_send (ctx, &mme->peer, &cnf);
}
diff --git a/cesar/cp/av/sta/action/src/handover.c b/cesar/cp/av/sta/action/src/handover.c
index 222f5ac983..eccbad17a6 100644
--- a/cesar/cp/av/sta/action/src/handover.c
+++ b/cesar/cp/av/sta/action/src/handover.c
@@ -152,7 +152,8 @@ cp_av_sta_action_handover__handover_info_ind_receive (cp_t *ctx,
cp_sta_set_authenticated (ctx, sta, status);
sta->pco = ptei;
sta->tei_lease_date_ms = cp_sta_core_get_date_ms (ctx) +
- MAC_SEC_TO_MS (CP_LEASE_ASSOC_MIN * 60);
+ MAC_SEC_TO_MS (
+ ctx->cco_action.tei_lease_association_min * 60);
cp_av_cco_action_tei_in_use (ctx, tei);
slab_release (sta);
diff --git a/cesar/cp/cco/action/inc/cco_action.h b/cesar/cp/cco/action/inc/cco_action.h
index 501db65930..0cb4f808ea 100644
--- a/cesar/cp/cco/action/inc/cco_action.h
+++ b/cesar/cp/cco/action/inc/cco_action.h
@@ -48,6 +48,10 @@ struct cp_cco_action_t
heap_t selection_heap;
/** period of nek changes in milliseconds. */
uint nek_change_period_ms;
+ /** TEI lease value for associated stations (in minutes). */
+ uint tei_lease_assoc_min;
+ /** TEI lease value for authenticated stations (in minutes). */
+ uint tei_lease_auth_min;
};
BEGIN_DECLS