Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

pana_client.h

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 
00034 #ifndef __PANA_CLIENT_H__
00035 #define __PANA_CLIENT_H__
00036 
00037 #include "pana_exports.h"
00038 #include "pana_session.h"
00039 #include "pana_provider_info.h"
00040 
00041 class PANA_EXPORT PANA_ClientEventInterface : public PANA_SessionEventInterface
00042 {
00043    public:
00044       virtual void EapStart() = 0;
00045       virtual void ChooseISP(const PANA_CfgProviderList &list,
00046                              PANA_CfgProviderInfo *&choice) = 0;
00047       virtual void EapRequest(AAAMessageBlock *request,
00048                               PANA_PINFO provider = PANA_PINFO_NONE,
00049                               const PANA_CfgProviderInfo *pInfo = NULL) = 0;
00050       virtual void EapRequest(AAAMessageBlock *request,
00051                               ACE_UINT32 resultCode,
00052                               ACE_UINT32 pcap,
00053                               PANA_DeviceIdContainer &epId) = 0;
00054       virtual void AuthorizePeer(PANA_DeviceId &peer, bool reAuth) {};
00055 };
00056 
00057 class PANA_EXPORT PANA_Client : public PANA_Session
00058 {
00059    public:
00060       PANA_Client(PANA_SessionTxInterface &tp,
00061                   PANA_SessionTimerInterface &tm,
00062                   PANA_ClientEventInterface &ev) :
00063              PANA_Session(tp, tm, ev),
00064             m_IspSelected(false),
00065             m_RegenerateKey(true) { }
00066       virtual ~PANA_Client() { }
00067 
00068       virtual void SendDiscover();
00069 
00070       virtual void ReceiveStartRequest();
00071       virtual void SendStartAnswer(AAAMessageBlock *response);
00072 
00073       virtual void ReceiveEapRequest();
00074       virtual void SendEapResponse(AAAMessageBlock *response);
00075 
00076       virtual void ReceiveBindRequest();
00077       virtual void SendBindAnswer();
00078 
00079       virtual void ReceiveEapReAuthRequest();
00080 
00081       virtual void RetryDiscover();
00082       virtual void RetryStartAnswer();
00083 
00084       virtual void SendEapMessage(AAAMessageBlock *response) {
00085           (m_InStatefulDiscovery) ? SendStartAnswer(response) :
00086                                     SendEapResponse(response);
00087       }
00088 
00089       virtual void MSK(diameter_octetstring_t &m) {
00090           if (m_RegenerateKey) {
00091               m_SA.MSK(m, m_InitialPacTsec, m_InitialPaaTsec);
00092               m_RegenerateKey = false;
00093           }
00094       }
00095     
00096    private:
00097       virtual void DestinationAddressFormatting(PANA_Message &msg,
00098                                     AAAMessageBlock *eapPayload = NULL);
00099       virtual bool IspSelection(AAAAvpContainer* isp);
00100 
00101    private:
00102       // Pac specific variables
00103       bool m_IspSelected;
00104       bool m_RegenerateKey;
00105       diameter_octetstring_t m_Cookie;
00106 };
00107 
00108 #endif /* __PANA_CLIENT_H__ */
00109 

Generated on Fri Jun 25 19:18:29 2004 for PANA by doxygen 1.3.5