X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=include%2Fanna%2Fdiameter%2Fcodec%2Ffunctions.hpp;h=49ab3797a3f2e83bac0d50a83730b8fd4bb654b0;hb=b9cb59210ce2a02d8246f1a9a1acfcfdcd892f3a;hp=3b124198f1dd2934bbe96d8ec61872108adc844f;hpb=39033fd99e58e994a5e98c1060dcc79e0d81f9c9;p=anna.git diff --git a/include/anna/diameter/codec/functions.hpp b/include/anna/diameter/codec/functions.hpp index 3b12419..49ab379 100644 --- a/include/anna/diameter/codec/functions.hpp +++ b/include/anna/diameter/codec/functions.hpp @@ -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. *