00001 /* BEGIN_COPYRIGHT */ 00002 /* */ 00003 /* OpenDiameter: Open-source software for the Diameter protocol */ 00004 /* */ 00005 /* Copyright (C) 2004 Open Diameter Project */ 00006 /* */ 00007 /* This library is free software; you can redistribute it and/or modify */ 00008 /* it under the terms of the GNU Lesser General Public License as */ 00009 /* published by the Free Software Foundation; either version 2.1 of the */ 00010 /* License, or (at your option) any later version. */ 00011 /* */ 00012 /* This library is distributed in the hope that it will be useful, */ 00013 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 00014 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ 00015 /* Lesser General Public License for more details. */ 00016 /* */ 00017 /* You should have received a copy of the GNU Lesser General Public */ 00018 /* License along with this library; if not, write to the Free Software */ 00019 /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */ 00020 /* USA. */ 00021 /* */ 00022 /* In addition, when you copy and redistribute some or the entire part of */ 00023 /* the source code of this software with or without modification, you */ 00024 /* MUST include this copyright notice in each copy. */ 00025 /* */ 00026 /* If you make any changes that are appeared to be useful, please send */ 00027 /* sources that include the changed part to */ 00028 /* diameter-developers@lists.sourceforge.net so that we can reflect your */ 00029 /* changes to one unified version of this software. */ 00030 /* */ 00031 /* END_COPYRIGHT */ 00032 /* 00033 diameter_mip_ha_client_interface.hxx 00034 Diameter MIP HA client interfacece 00035 Written by Miriam Tauil 00036 Created July 11, 2004. 00037 */ 00038 00039 #ifndef __DIAMETER_MIP_HA_CLIENT_INTERFACE_H__ 00040 #define __DIAMETER_MIP_HA_CLIENT_INTERFACE_H__ 00041 #include "diameter_parser_api.h" 00042 #include "diameter_mip4_ha_client_session.hxx" 00043 #include "mip4_diameter_ha_client_interface.hxx" 00044 00045 /************************************************************************* 00046 The HA Client class specifies an interface of a MIP Home Agent implementation. 00047 Once the HA implementation is implemented with the following interface, 00048 the Diameter MIP HA sample application, will provide a HA implementation 00049 supporting the Diameter MIP Application. 00050 00051 **************************************************************************/ 00052 00053 00054 class HaClientSession { 00055 private: 00056 00057 Mip4DiameterHaClientInterface &_session; 00058 00059 public: 00060 00061 HaClientSession( Mip4DiameterHaClientInterface &s):_session(s){} 00062 00063 virtual ~HaClientSession(){} 00064 00065 // SendMipRegReplay will be called by the diameter-mip4 lib and MUST be 00066 // implemented by the MIP ha implementation. 00067 // diameter lib will provide the information from AMA reply to 00068 // the MIP HA client implementation. MIP Ha will use this info to 00069 // create a Mip replay, will do the address binding(if applicable, 00070 //AMA response was positive), and send it to the MN. 00071 virtual void SendMipRegReply(diameter_unsigned32_t &amaResultCode)=0; 00072 00073 // the derrived class containing the specific MIP HA Client 00074 // implementation MUST 00075 // call LocalRxMipRegReq() when it accepts the MIP registration request 00076 // with the content of the request. 00077 // This is a callback function that will notify the diameter library 00078 // about the event and will propagate the content of the received message 00079 void LocalRxMipRegReq( diameter_octetstring_t &mipRegReq) 00080 { 00081 _session.RxMipRegReq( mipRegReq); 00082 } 00083 00084 // The derrived class will use this interface function to reset any local 00085 // variables, so the specificMipHaClient object can be reuse, 00086 //for a different future mip session. 00087 // Note: the reference to the Mip4DiameterHaClientInterface does not 00088 // need to be reset, since it will be reuse as well. 00089 virtual AAAReturnCode Reset(){ return AAA_ERR_SUCCESS; } 00090 00097 /*** mandatory AMR attributes ***/ 00098 00099 // UserName: if "Home Address" from MIP Registration is not 0.0.0.0 -> 00100 // Home address 00101 // - otherwise NAI extension should be in MIP REgistration and ... 00102 virtual int SetUserName ( diameter_utf8string_t &UserName) = 0; 00103 00104 // SetDestinationRealm based on Home AAA server NAI 00105 virtual int SetDestinationRealm ( diameter_identity_t &DestinationRealm) = 0; 00106 00107 00108 // the following are used to set MipMnAaaAuth 00109 virtual int SetMipMnAaaSpi( diameter_unsigned32_t *mnAaaSpi)=0; 00110 virtual int SetMipAuthInputDataLength( 00111 diameter_unsigned32_t *authInputDataLength)=0; 00112 virtual int SetMipAuthenticatorLength( 00113 diameter_unsigned32_t *authenticatorLength)=0; 00114 virtual int SetMipAuthenticatorOffset( 00115 diameter_unsigned32_t *authenticatorOffset)=0; 00116 00117 /*** optional AMR attributes - start here ***/ 00118 00119 // From Home AAA server NAI 00120 virtual int SetDestinationHost (diameter_identity_t &DestinationHost )=0; 00121 //"Home Address" mobile node's home IP address = type address 00122 virtual int SetMipMobileNodeAddress( diameter_address_t &MipMobileNodeAddress)=0; 00123 // "Home Agent" mobile node's home agent IP address = type address 00124 virtual int SetMipHomeAgentAddress( diameter_address_t &MipHomeAgentAddress)=0; 00125 00126 // IsMnHaKeyRequested() needed to setup flags for MipFeatureVector 00127 // return 1 if MN_HA keye was requested in MIP reg req 00128 // return 0 - otherwise 00129 virtual int IsMnHaKeyRequested()=0; 00130 00131 //"Lifetime" in MIP reg header 00132 virtual int SetAuthorizationLifetime( diameter_unsigned32_t *AuthorizationLifetime)=0; 00133 00134 // dynamic host AVP 00135 // virtual int SetMipCandidateHomeAgentHost( diameter_identity_t CandidateHomeAgentHost)=0; 00136 00137 // Home Agent NAI Or 00138 // Home Agent field provides IP address+DNS host name lookup ?? 00139 virtual int SetMipHomeAgentHost(diameter_identity_t &HomeAgentHost)=0; 00140 00141 // Enforce/Propagate parameters that are coming back in the AMA message 00142 // to the MIP Agent 00143 00144 //If the MH supports security features, it should implement the following 00145 // virtual function, in order to make use of the security parameters 00146 // generated for this session. 00147 virtual void EnforceMipMnToFaMsa 00148 (const mip_mn_to_fa_msa_info_t &mipMnToFaMsa){} 00149 00150 virtual void EnforceMipMnToHaMsa 00151 ( const mip_mn_to_ha_msa_info_t &mipMnToHaMsa){} 00152 00153 virtual void EnforceMipFaToMnMsa 00154 ( const mip_fa_to_mn_msa_info_t &mipFaToMnMsa){} 00155 00156 virtual void EnforceMipFaToHaMsa 00157 ( const mip_fa_to_ha_msa_info_t &mipFaToHaMsa){} 00158 00159 virtual void EnforceMipHaToMnMsa 00160 ( const mip_ha_to_mn_msa_info_t &mipHaToMnMsa){} 00161 00162 virtual void EnforceMipMsaLifetime 00163 ( const diameter_unsigned32_t &mipMsaLifetime){} 00164 00165 // HA to get the AMA error message 00166 virtual void EnforceErrorMessage(const diameter_utf8string_t &errorMessage){} 00167 00168 }; 00169 00170 #endif // __DIAMETER_MIP_HA_CLIENT_INTERFACE_H__ 00171 00172