wpa_supplicant / hostapd 2.0

pmksa_cache.h

Go to the documentation of this file.
00001 
00010 #ifndef PMKSA_CACHE_H
00011 #define PMKSA_CACHE_H
00012 
00017 struct rsn_pmksa_cache_entry {
00018         struct rsn_pmksa_cache_entry *next;
00019         u8 pmkid[PMKID_LEN];
00020         u8 pmk[PMK_LEN];
00021         size_t pmk_len;
00022         os_time_t expiration;
00023         int akmp; /* WPA_KEY_MGMT_* */
00024         u8 aa[ETH_ALEN];
00025 
00026         os_time_t reauth_time;
00027 
00038         void *network_ctx;
00039         int opportunistic;
00040 };
00041 
00042 struct rsn_pmksa_cache;
00043 
00044 #if defined(IEEE8021X_EAPOL) && !defined(CONFIG_NO_WPA2)
00045 
00046 struct rsn_pmksa_cache *
00047 pmksa_cache_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry,
00048                                  void *ctx, int replace),
00049                  void *ctx, struct wpa_sm *sm);
00050 void pmksa_cache_deinit(struct rsn_pmksa_cache *pmksa);
00051 struct rsn_pmksa_cache_entry * pmksa_cache_get(struct rsn_pmksa_cache *pmksa,
00052                                                const u8 *aa, const u8 *pmkid,
00053                                                const void *network_ctx);
00054 int pmksa_cache_list(struct rsn_pmksa_cache *pmksa, char *buf, size_t len);
00055 struct rsn_pmksa_cache_entry *
00056 pmksa_cache_add(struct rsn_pmksa_cache *pmksa, const u8 *pmk, size_t pmk_len,
00057                 const u8 *aa, const u8 *spa, void *network_ctx, int akmp);
00058 struct rsn_pmksa_cache_entry * pmksa_cache_get_current(struct wpa_sm *sm);
00059 void pmksa_cache_clear_current(struct wpa_sm *sm);
00060 int pmksa_cache_set_current(struct wpa_sm *sm, const u8 *pmkid,
00061                             const u8 *bssid, void *network_ctx,
00062                             int try_opportunistic);
00063 struct rsn_pmksa_cache_entry *
00064 pmksa_cache_get_opportunistic(struct rsn_pmksa_cache *pmksa,
00065                               void *network_ctx, const u8 *aa);
00066 void pmksa_cache_flush(struct rsn_pmksa_cache *pmksa, void *network_ctx);
00067 
00068 #else /* IEEE8021X_EAPOL and !CONFIG_NO_WPA2 */
00069 
00070 static inline struct rsn_pmksa_cache *
00071 pmksa_cache_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry,
00072                                  void *ctx, int replace),
00073                  void *ctx, struct wpa_sm *sm)
00074 {
00075         return (void *) -1;
00076 }
00077 
00078 static inline void pmksa_cache_deinit(struct rsn_pmksa_cache *pmksa)
00079 {
00080 }
00081 
00082 static inline struct rsn_pmksa_cache_entry *
00083 pmksa_cache_get(struct rsn_pmksa_cache *pmksa, const u8 *aa, const u8 *pmkid,
00084                 const void *network_ctx)
00085 {
00086         return NULL;
00087 }
00088 
00089 static inline struct rsn_pmksa_cache_entry *
00090 pmksa_cache_get_current(struct wpa_sm *sm)
00091 {
00092         return NULL;
00093 }
00094 
00095 static inline int pmksa_cache_list(struct rsn_pmksa_cache *pmksa, char *buf,
00096                                    size_t len)
00097 {
00098         return -1;
00099 }
00100 
00101 static inline struct rsn_pmksa_cache_entry *
00102 pmksa_cache_add(struct rsn_pmksa_cache *pmksa, const u8 *pmk, size_t pmk_len,
00103                 const u8 *aa, const u8 *spa, void *network_ctx, int akmp)
00104 {
00105         return NULL;
00106 }
00107 
00108 static inline void pmksa_cache_clear_current(struct wpa_sm *sm)
00109 {
00110 }
00111 
00112 static inline int pmksa_cache_set_current(struct wpa_sm *sm, const u8 *pmkid,
00113                                           const u8 *bssid,
00114                                           void *network_ctx,
00115                                           int try_opportunistic)
00116 {
00117         return -1;
00118 }
00119 
00120 static inline void pmksa_cache_flush(struct rsn_pmksa_cache *pmksa,
00121                                      void *network_ctx)
00122 {
00123 }
00124 
00125 #endif /* IEEE8021X_EAPOL and !CONFIG_NO_WPA2 */
00126 
00127 #endif /* PMKSA_CACHE_H */
00128 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines