Dynamic lib selection and deployment
[anna.git] / include / anna / diameter.comm / Session.hpp
index e3a8081..b23f8c0 100644 (file)
@@ -1,37 +1,9 @@
-// ANNA - Anna is Not Nothingness Anymore
-//
-// (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo
-//
-// https://bitbucket.org/testillano/anna
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: eduardo.ramos.testillano@gmail.com
-//          cisco.tierra@gmail.com
+// ANNA - Anna is Not Nothingness Anymore                                                         //
+//                                                                                                //
+// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
+//                                                                                                //
+// See project site at http://redmine.teslayout.com/projects/anna-suite                           //
+// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
 
 
 #ifndef anna_diameter_comm_Session_hpp
@@ -115,16 +87,16 @@ public:
 
 
       // Cierre de iniciativa local:
-      // 1. Envio DPR al PCRF y me pongo en estado 'WaitingDPA'. En este estado no habrá keep-alive DWR/DWA.
+      // 1. Envio DPR al PCRF y me pongo en estado 'WaitingDPA'. En este estado no habr keep-alive DWR/DWA.
       // 2. No dejo pasar nuevas peticiones (BLOCK-SEND).
       // 3. Cierro al recibir el DPA.
       // 4. Si expira el DPA, tambien cierro.
       WaitingDPA, /**< After requesting DPR to server, send is blocked over the session: when DPA arrives (or answer expires) the session is closed */
 
       // Cierre de iniciativa remota:
-      // 1. Recibo DPR del PCRF y me pongo en estado 'Disconnecting'. En este estado no habrá keep-alive DWR/DWA.
+      // 1. Recibo DPR del PCRF y me pongo en estado 'Disconnecting'. En este estado no habr keep-alive DWR/DWA.
       // 2. No dejo pasar nuevas peticiones (BLOCK-SEND).
-      // 3. Espero cursar las peticiones pendientes (a más tardar, será una expiracion Tx desde la recepcion del DPR).
+      // 3. Espero cursar las peticiones pendientes (a m�s tardar, ser� una expiracion Tx desde la recepcion del DPR).
       // 4. Envio DPA y activo un temporizador de cierre local (2*Tx) como proteccion (por si el servidor no cierra).
       Disconnecting, /**< After receiving DPR from server, send is blocked over the session: when no pending requests, DPA is sent to the server who will close connection */
 
@@ -218,7 +190,7 @@ public:
 //
 // En caso de enviar una peticion se activara automaticamente un temporizador. Si este llegara a caducar
 // se cancelara la busqueda y se invocara al metodo Session::eventResponse indicado que se ha producido
-// un error de temporización. La duracion del temporizador sera la establecida por
+// un error de temporizacin. La duracion del temporizador sera la establecida por
 // diameter::comm::TimerManager::setTimeout o el valor defecto.
 //
 // \param message Mensaje a enviar al servidor diameter con el que estamos conectados.
@@ -228,8 +200,8 @@ public:
   const Response* send(const Message& message) throw(anna::RuntimeException) { return send(&message); }
 
 // Desconecta del extremo remoto
-// Se notifica la terminación de cada una de las peticiones pendientes invocando al método Session::eventResponse
-// \warning Después de invocar a este método habría que volver a iniciar una sesion.
+// Se notifica la terminaci�n de cada una de las peticiones pendientes invocando al m�todo Session::eventResponse
+// \warning Despu�s de invocar a este m�todo habr�a que volver a iniciar una sesion.
   virtual bool unbind(bool forceDisconnect /* se usa en timer, para el actionTimer del tipo SessionUnbind, etc. */ = false) throw(anna::RuntimeException) = 0;
   // returns true if done at call time (no pendings or ignore pendings, except Disconnecting state by mean DPR/DPA)
 
@@ -356,6 +328,13 @@ protected:
   */
   virtual void eventPeerShutdown() throw() = 0;
 
+  /**
+     Handler about a request retransmission over the session.
+
+     \param request Message retransmitted
+  */
+  virtual void eventRequestRetransmission(Message *request) throw() = 0;
+
   /**
      Handler for diameter session responses
 
@@ -379,6 +358,13 @@ protected:
   */
   virtual void eventUnknownResponse(const anna::DataBlock& response) throw(anna::RuntimeException) = 0;
 
+  /**
+     Handler for diameter session Disconnect-Peer-Answer messages
+
+     \param response Answer data block object without context match
+  */
+  virtual void eventDPA(const anna::DataBlock& response) throw(anna::RuntimeException) = 0;
+
 
 
   /**
@@ -386,8 +372,8 @@ protected:
   */
   virtual void receive(const anna::comm::Message& message) throw(anna::RuntimeException) = 0;
 //PROTOCOL ERRORS
-//The errors at the protocol level are reported in response messages that contain the \93E\94 bit and the error code in the AVP result-Code (various errors having been produced only the first one of them is reported). Examples of these errors are:
-//An unrecognized AVP with the \93M\94 bit is received.
+//The errors at the protocol level are reported in response messages that contain the �E� bit and the error code in the AVP result-Code (various errors having been produced only the first one of them is reported). Examples of these errors are:
+//An unrecognized AVP with the �M� bit is received.
 //An AVP is received with an unrecognized value (in the AVP failed-AVP indicates the attribute that the error caused).
 //An mandatory AVP is not received.
 //Length of operation incorrect.