X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;ds=sidebyside;f=include%2Fanna%2Fdiameter%2Fcodec%2FMessage.hpp;h=fb519b55c70ba62abe83319a566a62649ee17f49;hb=e5dbc04ac1132e004c1cf6459d02fb2989e048ae;hp=7600b6edf8cbf565aa76f8e00201e9cec68feffe;hpb=884501d2411bc4fdfafae65948262c959e068d7d;p=anna.git diff --git a/include/anna/diameter/codec/Message.hpp b/include/anna/diameter/codec/Message.hpp index 7600b6e..fb519b5 100644 --- a/include/anna/diameter/codec/Message.hpp +++ b/include/anna/diameter/codec/Message.hpp @@ -1,8 +1,8 @@ -// ANNA - Anna is Not 'N' Anymore +// ANNA - Anna is Not Nothingness Anymore // // (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo // -// https://bitbucket.org/testillano/anna +// http://redmine.teslayout.com/projects/anna-suite // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions @@ -14,7 +14,7 @@ // 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 +// * Neither the name of the copyright holder nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // @@ -146,7 +146,9 @@ class Message { bool flagsOK(int &rc) const throw(); // flags coherence regarding dictionary. Only must be called when Message is identified at the dictionary. int addChild(Avp *avp) throw() { return Avp::addChild(a_avps, a_insertionPositionForChilds, avp); } const anna::diameter::stack::Command *getStackCommand(CommandId id) const throw(anna::RuntimeException); - Avp * addFailedAVP() throw(); // returns Failed-AVP if exists, creates it when missing + Avp * addTheFailedAVP() throw(); // returns the Failed-AVP if exists, creates it when missing. The method could be named 'addFailedAVP' + // but we consider this better because only one instance (as RFC 6733 says in section 7.5) will be + // added by internal procedures (although, the application could obviously add more). protected: @@ -406,32 +408,31 @@ public: /** - Adds a new AVP within a Failed-AVP over an answer message (for requests, do nothing). + Adds the wrong AVP within the Failed-AVP over an answer message (for requests, do nothing). If Failed-AVP AVP doesn't exists, is added and then filled (added within) with the value provided (empty AVP id representantion). - If Failed-AVP AVP already exists, is filled (added within) with the value provided (empty AVP id representantion). + If Failed-AVP AVP already exists, is probably filled by a previous found error, but anyway this is verified and if empty then is + filled (added within) with the value provided (empty AVP id representantion). - This method is internally used during #decode and/or #valid procedures in order to build automatic answers. + This method is internally used during #decode and/or #valid procedures in order to build automatic answers, but application + could call this for set another Failed-AVP content no detected by these methods, for example: DIAMETER_CONTRADICTING_AVPS or + DIAMETER_INVALID_AVP_BIT_COMBO). Also, application could add more Failed-AVP avps with other wrong avps, or accumulate wrong + avps inside the one and only Failed-AVP managed by the stack (see section 7.5 of RFC 6733). @param id Avp identifier as pair (code,vendor-id). - @return Pointer to the new AVP added within Failed-AVP, to make easy data-part accessif needed. + @return Pointer to the new AVP added within Failed-AVP, to make easy data-part access if needed. */ - Avp * setNewFailedAvp(AvpId id) throw(anna::RuntimeException) { if(isRequest()) return NULL; return (addFailedAVP()->addAvp(id)); } + Avp * setFailedAvp(AvpId id) throw(anna::RuntimeException); /** - Adds a new AVP within a Failed-AVP over an answer message (for requests, do nothing). - If Failed-AVP AVP doesn't exists, is added and then filled (added within) with the value provided (empty AVP id representantion). - If Failed-AVP AVP already exists, is filled (added within) with the value provided (empty AVP id representantion). - - This method is internally used during #decode and/or #valid procedures in order to build automatic answers, but application - could call this for set another Failed-AVP content no detected by these methods, for example: DIAMETER_CONTRADICTING_AVPS or - DIAMETER_INVALID_AVP_BIT_COMBO). + Same as #setFailedAvp(AvpId id) but providing an avp pointer with the needed information - @param id Avp identifier as pair (code,vendor-id). + @param avp Pointer to the added wrong avp - @return Pointer to the new AVP added within Failed-AVP, to make easy data-part accessif needed. + @return Pointer to the new AVP added within Failed-AVP, to make easy data-part access if needed. */ - Avp * setNewFailedAvp(Avp *avp) throw() { if(!avp || isRequest()) return NULL; return (addFailedAVP()->addAvp(avp)); } + Avp * setFailedAvp(Avp *avp) throw(anna::RuntimeException); + /**