Fixed Failed-AVP bug (feature). Now wrong avps inside grouped are correctly tracked
[anna.git] / include / anna / diameter / codec / functions.hpp
index 3b12419..9108b19 100644 (file)
@@ -45,6 +45,8 @@
 
 // STL
 #include <string>
+#include <vector>
+
 
 //------------------------------------------------------------------------------
 //---------------------------------------------------------------------- #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<anna::diameter::AvpId> AvpsId;
+         std::vector<std::string> 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.
   *