payload_eap.h

00001 /***************************************************************************
00002 *   Copyright (C) 2005 by                                                 *
00003 *   Pedro J. Fernandez Ruiz    pedroj.fernandez@dif.um.es                 *
00004 *   Alejandro Perez Mendez     alejandro_perez@dif.um.es                  *
00005 *                                                                         *
00006 *   This library is free software; you can redistribute it and/or         *
00007 *   modify it under the terms of the GNU Lesser General Public            *
00008 *   License as published by the Free Software Foundation; either          *
00009 *   version 2.1 of the License, or (at your option) any later version.    *
00010 *                                                                         *
00011 *   This library is distributed in the hope that it will be useful,       *
00012 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014 *   Lesser General Public License for more details.                       *
00015 *                                                                         *
00016 *   You should have received a copy of the GNU Lesser General Public      *
00017 *   License along with this library; if not, write to the Free Software   *
00018 *   Foundation, Inc., 51 Franklin St, Fifth Floor,                        *
00019 *   Boston, MA  02110-1301  USA                                           *
00020 ***************************************************************************/
00021 #ifndef PAYLOAD_EAP_H
00022 #define PAYLOAD_EAP_H
00023 
00024 #ifdef HAVE_CONFIG_H
00025 #include "config.h"
00026 #endif
00027 
00028 #include "payload.h"
00029 
00030 namespace openikev2 {
00031 
00036     class Payload_EAP : public Payload {
00037 
00038             /****************************** ENUMS ******************************/
00039         public:
00041             enum EAP_CODE {
00042                 EAP_CODE_NONE = 0,      
00043                 EAP_CODE_REQUEST = 1,   
00044                 EAP_CODE_RESPONSE = 2,  
00045                 EAP_CODE_SUCCESS = 3,   
00046                 EAP_CODE_FAILURE = 4,   
00047         };
00048 
00050             enum EAP_TYPE {
00051                 EAP_TYPE_NONE = 0,                      
00052                 EAP_TYPE_IDENTITY = 1,                  
00053                 EAP_TYPE_NOTIFICATION = 2,              
00054                 EAP_TYPE_NAK = 3,                       
00055                 EAP_TYPE_MD5_CHALLENGE = 4,             
00056                 EAP_TYPE_ONE_TIME_PASSWD = 5,           
00057                 EAP_TYPE_GENERIC_TOKEN_CARD = 6,        
00058                 EAP_TYPE_RSA_PK_AUTH = 9,               
00059                 EAP_TYPE_DSS_UNILATERAL = 10,           
00060                 EAP_TYPE_KEA = 11,                      
00061                 EAP_TYPE_KEA_VALIDATE = 12,             
00062                 EAP_TYPE_EAP_TLS = 13,                  
00063                 EAP_TYPE_DEFENDER_TOKEN = 14,           
00064                 EAP_TYPE_RSA_SECURID = 15,              
00065                 EAP_TYPE_ARCOT_SYSTEMS = 16,            
00066                 EAP_TYPE_CISCO_WIRELESS = 17,           
00067                 EAP_TYPE_EAP_SIM = 18,                  
00068                 EAP_TYPE_SRP_SHA1 = 19,                 
00069                 EAP_TYPE_EAP_TTLS = 21,                 
00070                 EAP_TYPE_RAS = 22,                      
00071                 EAP_TYPE_EAP_AKA = 23,                  
00072                 EAP_TYPE_EAP_3COM_WIRELESS = 24,        
00073                 EAP_TYPE_PEAP = 25,                     
00074                 EAP_TYPE_MS_EAP_AUTH = 26,              
00075                 EAP_TYPE_MAKE = 27,                     
00076                 EAP_TYPE_CRYPTO_CARD = 28,              
00077                 EAP_TYPE_EAP_MSCHAP_V2 = 29,            
00078                 EAP_TYPE_DYNAM_ID = 30,                 
00079                 EAP_TYPE_ROB_EAP = 31,                  
00080                 EAP_TYPE_POTP = 32,                     
00081                 EAP_TYPE_MS_AUTH_TLV = 33,              
00082                 EAP_TYPE_SENTRINET = 34,                
00083                 EAP_TYPE_EAP_ACTIONTEC_WIRELESS = 35,   
00084                 EAP_TYPE_COGENT_BIO_AUTH = 36,          
00085                 EAP_TYPE_AIRFORTRESS = 37,              
00086                 EAP_TYPE_HTTP_DIGEST = 38,              
00087                 EAP_TYPE_SECURE_SUITE = 39,             
00088                 EAP_TYPE_DEVICE_CONNECT = 40,           
00089                 EAP_TYPE_SPEKE = 41,                    
00090                 EAP_TYPE_MOBAC = 42,                    
00091                 EAP_TYPE_FAST = 43,                     
00092                 EAP_TYPE_ZLXEAP = 44,                   
00093                 EAP_TYPE_LINK = 45,                     
00094                 EAP_TYPE_PAX = 46,                      
00095         };
00096 
00097             /****************************** ATTRIBUTES ******************************/
00098             EAP_CODE code;                      
00099             uint8_t identifier;                 
00100             EAP_TYPE eap_type;                  
00101             auto_ptr<ByteArray> eap_type_data;  
00103             /****************************** METHODS ******************************/
00104         public:
00112             Payload_EAP( EAP_CODE code, uint8_t identifier, EAP_TYPE eap_type, auto_ptr<ByteArray> eap_type_data );
00113 
00119             Payload_EAP( EAP_CODE code, uint8_t identifier );
00120 
00125             Payload_EAP( const Payload_EAP& other );
00126 
00131             Payload_EAP( ByteBuffer& byte_buffer );
00132 
00138             static string EAP_CODE_STR( uint16_t eap_code );
00139 
00145             static string EAP_TYPE_STR( uint16_t eap_type );
00146 
00147             virtual void getBinaryRepresentation( ByteBuffer& byte_buffer ) const;
00148 
00149             virtual string toStringTab( uint8_t tabs ) const ;
00150 
00151             virtual auto_ptr<Payload> clone() const;
00152 
00153             virtual ~Payload_EAP();
00154 
00155     };
00156 }
00157 #endif

Generated on Fri Jul 27 11:04:45 2007 for libopenikev2 by  doxygen 1.5.1