Home | History | Annotate | Download | only in eap_peer
      1 /*
      2  * EAP peer: Method registration
      3  * Copyright (c) 2004-2007, Jouni Malinen <j (at) w1.fi>
      4  *
      5  * This program is free software; you can redistribute it and/or modify
      6  * it under the terms of the GNU General Public License version 2 as
      7  * published by the Free Software Foundation.
      8  *
      9  * Alternatively, this software may be distributed under the terms of BSD
     10  * license.
     11  *
     12  * See README and COPYING for more details.
     13  */
     14 
     15 #ifndef EAP_METHODS_H
     16 #define EAP_METHODS_H
     17 
     18 #include "eap_common/eap_defs.h"
     19 
     20 const struct eap_method * eap_peer_get_eap_method(int vendor, EapType method);
     21 const struct eap_method * eap_peer_get_methods(size_t *count);
     22 
     23 struct eap_method * eap_peer_method_alloc(int version, int vendor,
     24 					  EapType method, const char *name);
     25 void eap_peer_method_free(struct eap_method *method);
     26 int eap_peer_method_register(struct eap_method *method);
     27 
     28 
     29 #ifdef IEEE8021X_EAPOL
     30 
     31 EapType eap_peer_get_type(const char *name, int *vendor);
     32 const char * eap_get_name(int vendor, EapType type);
     33 size_t eap_get_names(char *buf, size_t buflen);
     34 char ** eap_get_names_as_string_array(size_t *num);
     35 void eap_peer_unregister_methods(void);
     36 
     37 #else /* IEEE8021X_EAPOL */
     38 
     39 static inline EapType eap_peer_get_type(const char *name, int *vendor)
     40 {
     41 	*vendor = EAP_VENDOR_IETF;
     42 	return EAP_TYPE_NONE;
     43 }
     44 
     45 static inline const char * eap_get_name(int vendor, EapType type)
     46 {
     47 	return NULL;
     48 }
     49 
     50 static inline size_t eap_get_names(char *buf, size_t buflen)
     51 {
     52 	return 0;
     53 }
     54 
     55 static inline int eap_peer_register_methods(void)
     56 {
     57 	return 0;
     58 }
     59 
     60 static inline void eap_peer_unregister_methods(void)
     61 {
     62 }
     63 
     64 static inline char ** eap_get_names_as_string_array(size_t *num)
     65 {
     66 	return NULL;
     67 }
     68 
     69 #endif /* IEEE8021X_EAPOL */
     70 
     71 
     72 #ifdef CONFIG_DYNAMIC_EAP_METHODS
     73 
     74 int eap_peer_method_load(const char *so);
     75 int eap_peer_method_unload(struct eap_method *method);
     76 
     77 #else /* CONFIG_DYNAMIC_EAP_METHODS */
     78 
     79 static inline int eap_peer_method_load(const char *so)
     80 {
     81 	return 0;
     82 }
     83 
     84 static inline int eap_peer_method_unload(struct eap_method *method)
     85 {
     86 	return 0;
     87 }
     88 
     89 #endif /* CONFIG_DYNAMIC_EAP_METHODS */
     90 
     91 /* EAP peer method registration calls for statically linked in methods */
     92 int eap_peer_md5_register(void);
     93 int eap_peer_tls_register(void);
     94 int eap_peer_mschapv2_register(void);
     95 int eap_peer_peap_register(void);
     96 int eap_peer_ttls_register(void);
     97 int eap_peer_gtc_register(void);
     98 int eap_peer_otp_register(void);
     99 int eap_peer_sim_register(void);
    100 int eap_peer_leap_register(void);
    101 int eap_peer_psk_register(void);
    102 int eap_peer_aka_register(void);
    103 int eap_peer_aka_prime_register(void);
    104 int eap_peer_fast_register(void);
    105 int eap_peer_pax_register(void);
    106 int eap_peer_sake_register(void);
    107 int eap_peer_gpsk_register(void);
    108 int eap_peer_wsc_register(void);
    109 int eap_peer_ikev2_register(void);
    110 int eap_peer_vendor_test_register(void);
    111 int eap_peer_tnc_register(void);
    112 int eap_peer_pwd_register(void);
    113 
    114 #endif /* EAP_METHODS_H */
    115