X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=include%2Fanna%2Fdiameter%2Fcodec%2Ffunctions.hpp;h=9108b1971e7561a8bf2c0da812016f1aa2d26e67;hb=08bdffbddf4bc0938eadec51af88de18734beda3;hp=0b012a3486a81cc9d69087758779de0302fc2cb9;hpb=4e12ac57e93c052f716a6305ad8fc099c45899d1;p=anna.git diff --git a/include/anna/diameter/codec/functions.hpp b/include/anna/diameter/codec/functions.hpp index 0b012a3..9108b19 100644 --- a/include/anna/diameter/codec/functions.hpp +++ b/include/anna/diameter/codec/functions.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. // @@ -45,6 +45,8 @@ // STL #include +#include + //------------------------------------------------------------------------------ //---------------------------------------------------------------------- #define @@ -67,6 +69,25 @@ namespace diameter { namespace codec { +// Used for alarms, tracing and Failed-AVP construction: +typedef struct parent { + + // Used on decoding: + anna::diameter::CommandId MessageId; + std::string MessageName; + + std::vector AvpsId; + std::vector AvpsName; + + void setMessage(const anna::diameter::CommandId & mid, const char *mname = NULL /* well known in validation */) throw(); + void addAvp(const anna::diameter::AvpId & aid, const char *aname = NULL /* well known in validation */) throw(); + std::string asString() const throw(); + +} parent_t; + + + + struct functions { // getters & helpers @@ -81,6 +102,7 @@ struct functions { static bool isAnswer(const CommandId & cid) throw() { return (!isRequest(cid)); } static bool isAnswer(const anna::DataBlock & db) throw(anna::RuntimeException) { return (!isRequest(db)); } + /** * Decodes a Command Header. This helper cannot check boundaries. start pointer must be a valid command context. *