Added SoH functionality to the PEAP module
[freeradius.git] / src / modules / rlm_eap / types / rlm_eap_peap / eap_peap.h
1 /*
2  * eap_peap.h
3  *
4  * Version:     $Id$
5  *
6  *   This program is free software; you can redistribute it and/or modify
7  *   it under the terms of the GNU General Public License as published by
8  *   the Free Software Foundation; either version 2 of the License, or
9  *   (at your option) any later version.
10  *
11  *   This program is distributed in the hope that it will be useful,
12  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *   GNU General Public License for more details.
15  *
16  *   You should have received a copy of the GNU General Public License
17  *   along with this program; if not, write to the Free Software
18  *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  *
20  * Copyright 2003 Alan DeKok <aland@freeradius.org>
21  * Copyright 2006 The FreeRADIUS server project
22  */
23 #ifndef _EAP_PEAP_H
24 #define _EAP_PEAP_H
25
26 #include <freeradius-devel/ident.h>
27 RCSIDH(eap_peap_h, "$Id$")
28
29 #include "eap_tls.h"
30 #include <freeradius-devel/soh.h>
31
32 typedef struct peap_tunnel_t {
33         VALUE_PAIR      *username;
34         VALUE_PAIR      *state;
35         VALUE_PAIR      *accept_vps;
36         int             status;
37         int             home_access_accept;
38         int             default_eap_type;
39         int             copy_request_to_tunnel;
40         int             use_tunneled_reply;
41         int             proxy_tunneled_request_as_eap;
42         const char      *virtual_server;
43         int             soh;
44         const char      *soh_virtual_server;
45         VALUE_PAIR      *soh_reply_vps;
46         int             session_resumption_state;
47 } peap_tunnel_t;
48
49 #define PEAP_STATUS_INVALID 0
50 #define PEAP_STATUS_SENT_TLV_SUCCESS 1
51 #define PEAP_STATUS_SENT_TLV_FAILURE 2
52 #define PEAP_STATUS_TUNNEL_ESTABLISHED 3
53 #define PEAP_STATUS_INNER_IDENTITY_REQ_SENT 4
54 #define PEAP_STATUS_PHASE2_INIT 5
55 #define PEAP_STATUS_PHASE2 6
56 #define PEAP_STATUS_WAIT_FOR_SOH_RESPONSE 7
57
58 #define PEAP_RESUMPTION_NO      (0)
59 #define PEAP_RESUMPTION_YES     (1)
60 #define PEAP_RESUMPTION_MAYBE   (2)
61
62 #define EAP_TLV_SUCCESS (1)
63 #define EAP_TLV_FAILURE (2)
64 #define EAP_TLV_ACK_RESULT (3)
65
66 #define PW_EAP_TLV 33
67
68 /*
69  *      Process the PEAP portion of an EAP-PEAP request.
70  */
71 int eappeap_process(EAP_HANDLER *handler, tls_session_t *tls_session);
72 #endif /* _EAP_PEAP_H */