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

« back to all changes in this revision

Viewing changes to src/rsn_supp/wpa_i.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:
1
1
/*
2
 
 * wpa_supplicant - Internal WPA state machine definitions
3
 
 * Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi>
 
2
 * Internal WPA/RSN supplicant state machine definitions
 
3
 * Copyright (c) 2004-2010, Jouni Malinen <j@w1.fi>
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or modify
6
6
 * it under the terms of the GNU General Public License version 2 as
15
15
#ifndef WPA_I_H
16
16
#define WPA_I_H
17
17
 
18
 
struct rsn_pmksa_candidate;
 
18
#include "utils/list.h"
 
19
 
19
20
struct wpa_peerkey;
20
21
struct wpa_eapol_key;
21
22
 
38
39
 
39
40
        struct rsn_pmksa_cache *pmksa; /* PMKSA cache */
40
41
        struct rsn_pmksa_cache_entry *cur_pmksa; /* current PMKSA entry */
41
 
        struct rsn_pmksa_candidate *pmksa_candidates;
 
42
        struct dl_list pmksa_candidates;
42
43
 
43
44
        struct l2_packet_data *l2_preauth;
44
45
        struct l2_packet_data *l2_preauth_br;
81
82
        unsigned int mgmt_group_cipher;
82
83
 
83
84
        int rsn_enabled; /* Whether RSN is enabled in configuration */
 
85
        int mfp; /* 0 = disabled, 1 = optional, 2 = mandatory */
84
86
 
85
87
        u8 *assoc_wpa_ie; /* Own WPA/RSN IE from (Re)AssocReq */
86
88
        size_t assoc_wpa_ie_len;
105
107
        int ft_completed;
106
108
        int over_the_ds_in_progress;
107
109
        u8 target_ap[ETH_ALEN]; /* over-the-DS target AP */
 
110
        int set_ptk_after_assoc;
 
111
        u8 mdie_ft_capab; /* FT Capability and Policy from target AP MDIE */
 
112
        u8 *assoc_resp_ies; /* MDIE and FTIE from (Re)Association Response */
 
113
        size_t assoc_resp_ies_len;
108
114
#endif /* CONFIG_IEEE80211R */
109
115
};
110
116
 
111
117
 
112
 
static inline void wpa_sm_set_state(struct wpa_sm *sm, wpa_states state)
 
118
static inline void wpa_sm_set_state(struct wpa_sm *sm, enum wpa_states state)
113
119
{
114
120
        WPA_ASSERT(sm->ctx->set_state);
115
121
        sm->ctx->set_state(sm->ctx->ctx, state);
116
122
}
117
123
 
118
 
static inline wpa_states wpa_sm_get_state(struct wpa_sm *sm)
 
124
static inline enum wpa_states wpa_sm_get_state(struct wpa_sm *sm)
119
125
{
120
126
        WPA_ASSERT(sm->ctx->get_state);
121
127
        return sm->ctx->get_state(sm->ctx->ctx);
133
139
        sm->ctx->disassociate(sm->ctx->ctx, reason_code);
134
140
}
135
141
 
136
 
static inline int wpa_sm_set_key(struct wpa_sm *sm, wpa_alg alg,
 
142
static inline int wpa_sm_set_key(struct wpa_sm *sm, enum wpa_alg alg,
137
143
                                 const u8 *addr, int key_idx, int set_tx,
138
144
                                 const u8 *seq, size_t seq_len,
139
145
                                 const u8 *key, size_t key_len)
223
229
        return -1;
224
230
}
225
231
 
 
232
static inline int wpa_sm_mark_authenticated(struct wpa_sm *sm,
 
233
                                            const u8 *target_ap)
 
234
{
 
235
        if (sm->ctx->mark_authenticated)
 
236
                return sm->ctx->mark_authenticated(sm->ctx->ctx, target_ap);
 
237
        return -1;
 
238
}
 
239
 
226
240
 
227
241
void wpa_eapol_key_send(struct wpa_sm *sm, const u8 *kck,
228
242
                        int ver, const u8 *dest, u16 proto,