pmksa_cache.h

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

Generated on Sat Nov 21 23:16:48 2009 for hostapd by  doxygen 1.6.1