~ubuntu-branches/ubuntu/saucy/wpasupplicant/saucy

« back to all changes in this revision

Viewing changes to src/rsn_supp/wpa.h

  • Committer: Bazaar Package Importer
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2010-11-22 09:43:43 UTC
  • mfrom: (1.1.16 upstream)
  • Revision ID: james.westby@ubuntu.com-20101122094343-qgsxaojvmswfri77
Tags: 0.7.3-0ubuntu1
* Get wpasupplicant 0.7.3 from Debian's SVN. Leaving 0.7.3-1 as unreleased
  for now.
* Build-Depend on debhelper 8, since the packaging from Debian uses compat 8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#ifndef WPA_H
16
16
#define WPA_H
17
17
 
18
 
#include "defs.h"
19
 
#include "eapol_common.h"
20
 
#include "wpa_common.h"
21
 
 
22
 
#ifndef ETH_P_EAPOL
23
 
#define ETH_P_EAPOL 0x888e
24
 
#endif
25
 
 
26
 
#ifndef ETH_P_RSN_PREAUTH
27
 
#define ETH_P_RSN_PREAUTH 0x88c7
28
 
#endif
 
18
#include "common/defs.h"
 
19
#include "common/eapol_common.h"
 
20
#include "common/wpa_common.h"
29
21
 
30
22
struct wpa_sm;
31
23
struct eapol_sm;
33
25
 
34
26
struct wpa_sm_ctx {
35
27
        void *ctx; /* pointer to arbitrary upper level context */
 
28
        void *msg_ctx; /* upper level context for wpa_msg() calls */
36
29
 
37
 
        void (*set_state)(void *ctx, wpa_states state);
38
 
        wpa_states (*get_state)(void *ctx);
 
30
        void (*set_state)(void *ctx, enum wpa_states state);
 
31
        enum wpa_states (*get_state)(void *ctx);
39
32
        void (*deauthenticate)(void * ctx, int reason_code); 
40
33
        void (*disassociate)(void *ctx, int reason_code);
41
 
        int (*set_key)(void *ctx, wpa_alg alg,
 
34
        int (*set_key)(void *ctx, enum wpa_alg alg,
42
35
                       const u8 *addr, int key_idx, int set_tx,
43
36
                       const u8 *seq, size_t seq_len,
44
37
                       const u8 *key, size_t key_len);
61
54
                             size_t ies_len);
62
55
        int (*send_ft_action)(void *ctx, u8 action, const u8 *target_ap,
63
56
                              const u8 *ies, size_t ies_len);
 
57
        int (*mark_authenticated)(void *ctx, const u8 *target_ap);
64
58
};
65
59
 
66
60
 
73
67
        WPA_PARAM_GROUP,
74
68
        WPA_PARAM_KEY_MGMT,
75
69
        WPA_PARAM_MGMT_GROUP,
76
 
        WPA_PARAM_RSN_ENABLED
 
70
        WPA_PARAM_RSN_ENABLED,
 
71
        WPA_PARAM_MFP
77
72
};
78
73
 
79
74
struct rsn_supp_config {
127
122
int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr,
128
123
                    const u8 *buf, size_t len);
129
124
int wpa_sm_parse_own_wpa_ie(struct wpa_sm *sm, struct wpa_ie_data *data);
 
125
int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len);
 
126
void wpa_sm_drop_sa(struct wpa_sm *sm);
 
127
int wpa_sm_has_ptk(struct wpa_sm *sm);
130
128
 
131
129
#else /* CONFIG_NO_WPA */
132
130
 
258
256
        return -1;
259
257
}
260
258
 
 
259
static inline int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf,
 
260
                                          size_t len)
 
261
{
 
262
        return -1;
 
263
}
 
264
 
 
265
static inline void wpa_sm_drop_sa(struct wpa_sm *sm)
 
266
{
 
267
}
 
268
 
 
269
static inline int wpa_sm_has_ptk(struct wpa_sm *sm)
 
270
{
 
271
        return 0;
 
272
}
 
273
 
261
274
#endif /* CONFIG_NO_WPA */
262
275
 
263
276
#ifdef CONFIG_PEERKEY
271
284
 
272
285
#ifdef CONFIG_IEEE80211R
273
286
 
274
 
int wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *mobility_domain,
275
 
                         const u8 *r0kh_id, size_t r0kh_id_len,
276
 
                         const u8 *r1kh_id);
277
 
int wpa_ft_prepare_auth_request(struct wpa_sm *sm);
 
287
int wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *ies, size_t ies_len);
 
288
int wpa_ft_prepare_auth_request(struct wpa_sm *sm, const u8 *mdie);
278
289
int wpa_ft_process_response(struct wpa_sm *sm, const u8 *ies, size_t ies_len,
279
 
                            int ft_action, const u8 *target_ap);
 
290
                            int ft_action, const u8 *target_ap,
 
291
                            const u8 *ric_ies, size_t ric_ies_len);
280
292
int wpa_ft_is_completed(struct wpa_sm *sm);
281
293
int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies,
282
294
                                 size_t ies_len, const u8 *src_addr);
283
 
int wpa_ft_start_over_ds(struct wpa_sm *sm, const u8 *target_ap);
 
295
int wpa_ft_start_over_ds(struct wpa_sm *sm, const u8 *target_ap,
 
296
                         const u8 *mdie);
284
297
 
285
298
#else /* CONFIG_IEEE80211R */
286
299
 
287
300
static inline int
288
 
wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *mobility_domain,
289
 
                     const u8 *r0kh_id, const u8 *r1kh_id)
 
301
wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *ies, size_t ies_len)
290
302
{
291
303
        return 0;
292
304
}
293
305
 
294
 
static inline int wpa_ft_prepare_auth_request(struct wpa_sm *sm)
 
306
static inline int wpa_ft_prepare_auth_request(struct wpa_sm *sm,
 
307
                                              const u8 *mdie)
295
308
{
296
309
        return 0;
297
310
}