Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ws_pae_timers.h Source File

ws_pae_timers.h

00001 /*
00002  * Copyright (c) 2019, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef WS_PAE_TIMERS_H_
00019 #define WS_PAE_TIMERS_H_
00020 
00021 typedef struct {
00022     uint32_t gtk_expire_offset;            // GTK lifetime; GTK_EXPIRE_OFFSET (seconds)
00023     uint32_t pmk_lifetime;                 // PMK lifetime (seconds)
00024     uint32_t ptk_lifetime;                 // PTK lifetime (seconds)
00025     uint16_t gtk_new_act_time;             // GTK_NEW_ACTIVATION_TIME (1/X of expire offset)
00026     uint16_t revocat_lifetime_reduct;      // REVOCATION_LIFETIME_REDUCTION (reduction of lifetime)
00027     uint16_t gtk_request_imin;             // GTK_REQUEST_IMIN (seconds)
00028     uint16_t gtk_request_imax;             // GTK_REQUEST_IMAX (seconds)
00029     uint16_t gtk_max_mismatch;             // GTK_MAX_MISMATCH (seconds)
00030     uint8_t gtk_new_install_req;           // GTK_NEW_INSTALL_REQUIRED (percent of GTK lifetime)
00031 } timer_settings_t;
00032 
00033 /**
00034  * ws_pae_timers_settings_init initializes timer settings structure
00035  *
00036  * \param timer_settings timer settings
00037  *
00038  */
00039 void ws_pae_timers_settings_init(timer_settings_t *timer_settings);
00040 
00041 /**
00042  *  ws_pae_timers_lifetime_set sets GTK, PTK and PTK lifetimes
00043  *
00044  * \param timer_settings timer settings
00045  * \param gtk_lifetime GTK lifetime
00046  * \param pmk_lifetime PMK lifetime
00047  * \param ptk_lifetime PTK lifetime
00048  *
00049  */
00050 void ws_pae_timers_lifetime_set(timer_settings_t *timer_settings, uint32_t gtk_lifetime, uint32_t pmk_lifetime, uint32_t ptk_lifetime);
00051 
00052 /**
00053  *  ws_pae_timers_gtk_time_settings_set sets GTK, PTK and PTK lifetimes
00054  *
00055  * \param timer_settings timer settings
00056  * \param revocat_lifetime_reduct revocation lifetime reduction
00057  * \param new_activation_time new activation time
00058  * \param new_install_req new install required
00059  * \param max_mismatch max mismatch
00060  *
00061  */
00062 void ws_pae_timers_gtk_time_settings_set(timer_settings_t *timer_settings, uint8_t revocat_lifetime_reduct, uint8_t new_activation_time, uint8_t new_install_req, uint32_t max_mismatch);
00063 
00064 /**
00065  *  ws_pae_timers_gtk_new_install_required GTK new install required check
00066  *
00067  * \param timer_settings timer settings
00068  * \param seconds elapsed seconds
00069  *
00070  * \return true new GTK install required expired
00071  * \return false GTK install not required
00072  *
00073  */
00074 bool ws_pae_timers_gtk_new_install_required(timer_settings_t *timer_settings, uint32_t seconds);
00075 
00076 /**
00077  *  ws_pae_timers_gtk_new_activation_time GTK new activation time
00078  *
00079  * \param timer_settings timer settings
00080  * \param seconds elapsed seconds
00081  *
00082  * \return true GTK new activation time expired
00083  * \return false GTK new activation time not expired
00084  *
00085  */
00086 bool ws_pae_timers_gtk_new_activation_time(timer_settings_t *timer_settings, uint32_t seconds);
00087 
00088 /**
00089  *  ws_pae_timers_gtk_revocation_lifetime_get GTK revocation lifetime get
00090  *
00091  * \param timer_settings timer settings
00092  *
00093  * \return GTK revocation lifetime
00094  *
00095  */
00096 uint32_t ws_pae_timers_gtk_revocation_lifetime_get(timer_settings_t *timer_settings);
00097 
00098 #endif /* WS_PAE_TIMERS_H_ */