1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #ifndef anna_diameter_app_base_Message_hpp
10 #define anna_diameter_app_base_Message_hpp
14 #include <anna/diameter/codec/Message.hpp>
15 #include <anna/diameter/app/defines.hpp>
18 #include <anna/diameter/helpers/base/defines.hpp>
19 #include <anna/diameter/helpers/radius/defines.hpp>
21 #include <anna/core/RuntimeException.hpp>
25 //------------------------------------------------------------------------------
26 //---------------------------------------------------------------------- #define
27 //------------------------------------------------------------------------------
36 using namespace basetypes;
45 * Diameter base message
47 class Message : public anna::diameter::codec::Message {
52 Avp Session-Id data-part pointer reference
53 @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
55 const UTF8String * getSessionId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
56 ASSERT_APP_GETAVP(return getAvp(helpers::base::AVPID__Session_Id)->getUTF8String());
60 Avp Destination-Host data-part pointer reference
61 @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
63 const DiameterIdentity * getDestinationHost(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
64 ASSERT_APP_GETAVP(return getAvp(helpers::base::AVPID__Destination_Host)->getDiameterIdentity());
68 Avp Destination-Realm data-part pointer reference
69 @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
71 const DiameterIdentity * getDestinationRealm(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
72 ASSERT_APP_GETAVP(return getAvp(helpers::base::AVPID__Destination_Realm)->getDiameterIdentity());
76 Avp User-Name data-part pointer reference
77 @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
79 const UTF8String * getUserName(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
80 ASSERT_APP_GETAVP(return getAvp(helpers::radius::AVPID__User_Name)->getUTF8String());
84 Avp Termination-Cause data-part pointer reference
85 @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
87 const Enumerated * getTerminationCause(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
88 ASSERT_APP_GETAVP(return getAvp(helpers::base::AVPID__Termination_Cause)->getEnumerated());
92 Avp Auth-Application-Id data-part pointer reference
93 @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
95 const Unsigned32 * getAuthApplicationId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
96 ASSERT_APP_GETAVP(return getAvp(helpers::base::AVPID__Auth_Application_Id)->getUnsigned32());
100 Avp Event-Timestamp data-part pointer reference
101 @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
103 const Time * getEventTimestamp(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
104 ASSERT_APP_GETAVP(return getAvp(helpers::radius::AVPID__Event_Timestamp)->getTime());