~ubuntu-branches/ubuntu/natty/freeradius/natty-updates

« back to all changes in this revision

Viewing changes to src/modules/rlm_eap/rlm_eap.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremie Corbier
  • Date: 2006-07-08 19:41:05 UTC
  • mto: (3.1.8 edgy) (4.1.3 sid) (1.1.14 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060708194105-bxbr4e6m4dfw2x4x
Tags: upstream-1.1.2
ImportĀ upstreamĀ versionĀ 1.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * rlm_eap.h    Local Header file.
3
3
 *
4
 
 * Version:     $Id: rlm_eap.h,v 1.13 2004/03/02 23:57:40 mgriego Exp $
 
4
 * Version:     $Id: rlm_eap.h,v 1.13.4.1 2006/02/06 16:23:53 nbk Exp $
5
5
 *
6
6
 *   This program is free software; you can redistribute it and/or modify
7
7
 *   it under the terms of the GNU General Public License as published by
40
40
 
41
41
/*
42
42
 * This structure contains eap's persistent data.
43
 
 * sessions[] = EAP_HANDLERS, keyed by the first octet of the State
44
 
 *              attribute, and composed of a linked list, ordered from
45
 
 *              oldest to newest.
 
43
 * sessions = remembered sessions, in a tree for speed.
46
44
 * types = All supported EAP-Types
47
45
 * mutex = ensure only one thread is updating the sessions[] struct
48
46
 */
49
47
typedef struct rlm_eap_t {
50
 
        EAP_HANDLER     *sessions[256];
 
48
        rbtree_t        *session_tree;
 
49
        EAP_HANDLER     *session_head, *session_tail;
51
50
        EAP_TYPES       *types[PW_EAP_MAX_TYPES + 1];
52
51
 
53
52
        /*
54
53
         *      Configuration items.
55
54
         */
 
55
        int             timer_limit;
56
56
        char            *default_eap_type_name;
57
 
        int             timer_limit;
58
57
        int             default_eap_type;
59
58
        int             ignore_unknown_eap_types;
60
59
        int             cisco_accounting_username_bug;
61
60
 
62
61
#ifdef HAVE_PTHREAD_H
63
62
        pthread_mutex_t session_mutex;
64
 
        pthread_mutex_t module_mutex;
65
63
#endif
66
64
} rlm_eap_t;
67
65
 
 
66
/*
 
67
 *      For simplicity in the rest of the code.
 
68
 */
 
69
#ifndef HAVE_PTHREAD_H
 
70
/*
 
71
 *      This is easier than ifdef's throughout the code.
 
72
 */
 
73
#define pthread_mutex_init(_x, _y)
 
74
#define pthread_mutex_destroy(_x)
 
75
#define pthread_mutex_lock(_x)
 
76
#define pthread_mutex_unlock(_x)
 
77
#endif
 
78
 
68
79
/* function definitions */
69
80
/* EAP-Type */
70
81
int             eaptype_load(EAP_TYPES **type, int eap_type, CONF_SECTION *cs);
84
95
EAP_HANDLER     *eap_handler_alloc(void);
85
96
void            eap_packet_free(EAP_PACKET **eap_packet);
86
97
void            eap_ds_free(EAP_DS **eap_ds);
87
 
void            eap_handler_free(EAP_HANDLER **handler);
 
98
void            eap_handler_free(EAP_HANDLER *handler);
88
99
 
89
100
int             eaplist_add(rlm_eap_t *inst, EAP_HANDLER *handler);
90
 
void            eaplist_free(rlm_eap_t *inst);
91
101
EAP_HANDLER     *eaplist_find(rlm_eap_t *inst, REQUEST *request,
92
102
                              eap_packet_t *eap_packet);
 
103
void            eaplist_free(rlm_eap_t *inst);
93
104
 
94
105
/* State */
95
106
void            generate_key(void);