X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=include%2Fanna%2Fdiameter.comm%2FMessage.hpp;h=9fc265a83ae8c20b95e0d2d847bac5d392e9da41;hb=8a597c7ccbe2986f505fd70258e4b59ecef4166f;hp=7e007ca6e82f0c03cfb39b9340016a064ec698aa;hpb=6e1b37527452c6e59433144d6770db26253862eb;p=anna.git diff --git a/include/anna/diameter.comm/Message.hpp b/include/anna/diameter.comm/Message.hpp index 7e007ca..9fc265a 100644 --- a/include/anna/diameter.comm/Message.hpp +++ b/include/anna/diameter.comm/Message.hpp @@ -48,7 +48,7 @@ public: /** * Define las acciones a realizar en caso de que el temporizador de la petici�n expire. */ - struct OnExpiry { enum _v { Abandon, Ignore }; }; + struct OnExpiry { enum _v { Abandon, Ignore, Retransmit }; }; /** Constructor. @@ -105,14 +105,33 @@ public: void setRequestEndToEnd(EndToEnd ete) throw() { a_requestEndToEnd = ete; } CommandId getCommandId(bool &isRequest) const throw(); CommandId getCommandId() const throw() { bool dummy; return getCommandId(dummy); } + ApplicationId getApplicationId() const throw(); bool fixRequestSequence(HopByHop hbh, EndToEnd ete) throw(); - /** Diameter agents CANNOT modify the end-to-end. True value stands for intermediate agents, false for request originators */ - bool isProxied() const throw() { return a_proxied; } + // http://diameter-protocol.blogspot.com.es/2011/05/diameter-message-structure-and-message.html - /** Diameter agents CANNOT modify the end-to-end. True value stands for intermediate agents, false for request originators */ - void setProxied(bool proxied = true) throw() { a_proxied = proxied; } + /** + * In general, diameter nodes will sequence the End-To-End value when sending new requests. + * A 'false' value stands for intermediate agents (must keep end-to-end during 4 minutes even upon reboots). + */ + bool endToEndSequenced() const throw() { return a_endToEndSequenced; } + + /** + * By default, the diameter::comm message will sequence the end-to-end increasing the initial value created + * during session establishment. Anyway you could change this behaviour with this method. + * + * @see sequenceEndToEnd + */ + void forwardEndToEnd() throw() { a_endToEndSequenced = false; } + + /** + * By default, the diameter::comm message will sequence the end-to-end increasing the initial value created + * during session establishment. Anyway you could set again this behaviour with this method. + * + * @see forwardEndToEnd + */ + void sequenceEndToEnd() throw() { a_endToEndSequenced = true; } // Statistics @@ -135,12 +154,12 @@ public: /** Initializes class information */ void initialize() throw() { - a_retries = 0; + a_retries = 1; a_requestServerSessionKey = -1; // means unknown/unset a_requestClientSessionKey = ""; // means unknown/unset a_requestHopByHop = 0; a_requestEndToEnd = 0; - a_proxied = false; + a_endToEndSequenced = true; } @@ -164,7 +183,7 @@ private: std::string a_requestClientSessionKey; // idem for request which was received from servers HopByHop a_requestHopByHop; // application backup for hop-by-hop in order to restore on answer receive EndToEnd a_requestEndToEnd; // application backup for end-to-end in order to restore on answer receive - bool a_proxied; // end-to-end will be kept + bool a_endToEndSequenced; // end-to-end will be sequenced by default (true) void send(ClientSession&) const throw(anna::RuntimeException); void send(ServerSession&) const throw(anna::RuntimeException);