Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

eap_archie.hxx

Go to the documentation of this file.
00001 /* BEGIN_COPYRIGHT                                                        */
00002 /*                                                                        */
00003 /* Open Diameter: Open-source software for the Diameter and               */
00004 /*                Diameter related protocols                              */
00005 /*                                                                        */
00006 /* Copyright (C) 2002-2004 Open Diameter Project                          */
00007 /*                                                                        */
00008 /* This library is free software; you can redistribute it and/or modify   */
00009 /* it under the terms of the GNU Lesser General Public License as         */
00010 /* published by the Free Software Foundation; either version 2.1 of the   */
00011 /* License, or (at your option) any later version.                        */
00012 /*                                                                        */
00013 /* This library is distributed in the hope that it will be useful,        */
00014 /* but WITHOUT ANY WARRANTY; without even the implied warranty of         */
00015 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      */
00016 /* Lesser General Public License for more details.                        */
00017 /*                                                                        */
00018 /* You should have received a copy of the GNU Lesser General Public       */
00019 /* License along with this library; if not, write to the Free Software    */
00020 /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307    */
00021 /* USA.                                                                   */
00022 /*                                                                        */
00023 /* In addition, when you copy and redistribute some or the entire part of */
00024 /* the source code of this software with or without modification, you     */
00025 /* MUST include this copyright notice in each copy.                       */
00026 /*                                                                        */
00027 /* If you make any changes that are appeared to be useful, please send    */
00028 /* sources that include the changed part to                               */
00029 /* diameter-developers@lists.sourceforge.net so that we can reflect your  */
00030 /* changes to one unified version of this software.                       */
00031 /*                                                                        */
00032 /* END_COPYRIGHT                                                          */
00033 /* $Id: eap_archie.hxx,v 1.5 2004/06/17 21:13:36 yohba Exp $ */
00034 /* 
00035    EAP Archie message format.
00036 
00037    Written by Yoshihiro Ohba
00038    
00039 */
00040 
00042 
00043 #ifndef __EAP_ARCHIE_HXX__
00044 #define __EAP_ARCHIE_HXX__
00045 
00046 #include <ace/Basic_Types.h>
00047 #include "eap.hxx"
00048 #include "eap_log.hxx"
00049 
00053 #ifdef WIN32
00054    #if defined(EAP_ARCHIE_EXPORT)
00055        #define EAP_ARCHIE_EXPORTS __declspec(dllexport)
00056    #else
00057        #define EAP_ARCHIE_EXPORTS __declspec(dllimport)
00058    #endif
00059 #else
00060    #define EAP_ARCHIE_EXPORTS
00061    #define EAP_ARCHIE_IMPORTS
00062 #endif
00063 
00066 #define ARCHIE_METHOD_TYPE  100
00067 
00069 class EAP_ARCHIE_EXPORTS EapRequestArchie: public EapRequest
00070 {
00071 public:
00072   EapRequestArchie(ACE_Byte msgID) : 
00073     EapRequest(EapType(ARCHIE_METHOD_TYPE)), msgID(msgID) {}
00074 
00076   ACE_Byte& MsgID() { return msgID; }
00077 
00079   enum messageID {
00080     Request,    
00081     Response,   
00082     Confirm,    
00083     Finish      
00084   };
00085 
00086 protected:
00088   ACE_Byte msgID;
00089 };
00090 
00092 class EAP_ARCHIE_EXPORTS EapResponseArchie: public EapRequestArchie 
00093 {
00094 public:
00095   EapResponseArchie(ACE_Byte msgID) : EapRequestArchie(msgID) {}
00096 };
00097 
00099 class EAP_ARCHIE_EXPORTS EapRequestArchieRequest: public EapRequestArchie
00100 {
00101 public:
00103   EapRequestArchieRequest() : EapRequestArchie(1) {}
00104                               
00106   std::string& AuthID() { return authID; }
00107   
00109   std::string& SessionID() { return sessionID; }
00110   
00111 protected:
00112 
00115   ACE_Byte naiLength;
00116 
00120   std::string authID;
00121 
00123   std::string sessionID;
00124 };
00125 
00128 class EAP_ARCHIE_EXPORTS ArchieBinding
00129 {
00130 public:
00131   ArchieBinding() : bType(0), sLength(0), pLength(0),
00132                     addrS(std::string(256, '\0')),
00133                     addrP(std::string(256, '\0')) {}
00135   ACE_UINT16 bType;
00136 
00138   ACE_Byte sLength;
00139 
00141   ACE_Byte pLength;
00142 
00144   std::string addrS;
00145 
00147   std::string addrP;
00148 };
00149 
00151 class EAP_ARCHIE_EXPORTS EapResponseArchieResponse: public EapResponseArchie
00152 {
00153 public:
00155   EapResponseArchieResponse() : EapResponseArchie(2) {}
00156 
00158   std::string& SessionID() { return sessionID; }
00159 
00161   std::string& PeerID() { return peerID; }
00162   
00164   std::string& NonceP() { return nonceP; }
00165 
00167   ArchieBinding& Binding() { return binding; }
00168 
00170   std::string& Mac1() { return mac1; }
00171 private:
00172 
00174   std::string sessionID;
00175 
00177   std::string peerID;
00178 
00180   std::string nonceP;
00181 
00183   ArchieBinding binding;
00184 
00186   std::string mac1;
00187 };
00188 
00190 class EAP_ARCHIE_EXPORTS EapRequestArchieConfirm: public EapRequestArchie
00191 {
00192 public:
00194   EapRequestArchieConfirm() : EapRequestArchie(3) {}
00195 
00197   std::string& SessionID() { return sessionID; }
00198 
00200   std::string& NonceA() { return nonceA; }
00201 
00203   ArchieBinding& Binding() { return binding; }
00204 
00206   std::string& Mac2() { return mac2; }
00207 
00208 private:
00209 
00211   std::string sessionID;
00212 
00214   std::string nonceA;
00215 
00217   ArchieBinding binding;
00218 
00220   std::string mac2;
00221 };
00222 
00224 class EAP_ARCHIE_EXPORTS EapResponseArchieFinish: public EapResponseArchie
00225 {
00226 public:
00228   EapResponseArchieFinish() : EapResponseArchie(4) {}
00229 
00231   std::string& SessionID() { return sessionID; }
00232 
00234   std::string& Mac3() { return mac3; }
00235 
00236 private:
00238   std::string sessionID;
00239 
00241   std::string mac3;
00242 };
00243 
00244 #endif // __EAP_ARCHIE_HXX__

Generated on Fri Jun 25 19:16:16 2004 for EAP State Machine by doxygen 1.3.5