00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
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
00103 bool m_IspSelected;
00104 bool m_RegenerateKey;
00105 diameter_octetstring_t m_Cookie;
00106 };
00107
00108 #endif
00109