1 // ANNA - Anna is Not 'N' Anymore
3 // (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo
5 // https://bitbucket.org/testillano/anna
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions
11 // * Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 // * Redistributions in binary form must reproduce the above
14 // copyright notice, this list of conditions and the following disclaimer
15 // in the documentation and/or other materials provided with the
17 // * Neither the name of Google Inc. nor the names of its
18 // contributors may be used to endorse or promote products derived from
19 // this software without specific prior written permission.
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 // Authors: eduardo.ramos.testillano@gmail.com
34 // cisco.tierra@gmail.com
37 #ifndef anna_diameter_app_dcca_nokia_Message_hpp
38 #define anna_diameter_app_dcca_nokia_Message_hpp
42 #include <anna/diameter/app/dcca/Message.hpp>
45 #include <anna/diameter/helpers/nokia/defines.hpp>
47 #include <anna/core/RuntimeException.hpp>
50 //------------------------------------------------------------------------------
51 //---------------------------------------------------------------------- #define
52 //------------------------------------------------------------------------------
61 using namespace basetypes;
72 * Diameter message for Nokia DCCA (diameter credit control application)
74 class Message : public anna::diameter::app::dcca::Message {
80 Avp 3GPP-PDP-Type data-part pointer reference
81 @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).
83 const Unsigned32 * get3GPPPDPType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
84 ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_PDP_Type)->getUnsigned32());
89 Avp Framed-IP-Address or Framed-IPv6-Prefix data-part pointer reference, depending on 3GPP-PDP-Type value
90 @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).
92 const OctetString * getFramedIP(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
94 int pdpType = get3GPPPDPType()->getValue();
96 if(pdpType == helpers::tgpp::AVPVALUES__3GPP_PDP_Type::IPV4)
97 return getAvp(helpers::radius::AVPID__Framed_IP_Address)->getOctetString();
98 if(pdpType == helpers::tgpp::AVPVALUES__3GPP_PDP_Type::IPV6)
99 return getAvp(helpers::radius::AVPID__Framed_IPv6_Prefix)->getOctetString();
105 Avp Called-Station-Id data-part pointer reference
106 @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).
108 const UTF8String * getCalledStationId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
109 ASSERT_APP_GETAVP(return getAvp(helpers::radius::AVPID__Called_Station_Id)->getUTF8String());
113 Avp 3GPP-SGSN-MCC-MNC data-part pointer reference
114 @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).
116 const UTF8String * get3GPPSGSNMCCMNC(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
117 ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_SGSN_MCC_MNC)->getUTF8String());
121 Avp 3GPP-SGSN-Address data-part pointer reference
122 @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).
124 const OctetString * get3GPPSGSNAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
125 ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_SGSN_Address)->getOctetString());
129 Avp 3GPP-Charging-Characteristics data-part pointer reference
130 @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).
132 const UTF8String * get3GPPChargingCharacteristics(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
133 ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_Charging_Characteristics)->getUTF8String());
137 Avp 3GPP-CG-Address data-part pointer reference
138 @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).
140 const OctetString * get3GPPCGAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
141 ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_CG_Address)->getOctetString());
145 Avp 3GPP-Rat-Type data-part pointer reference
146 @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).
148 const OctetString * get3GPPRatType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
149 ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_Rat_Type)->getOctetString());
153 Avp Nokia-IMS-Media-Component-Id data-part pointer reference
154 @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).
156 const Unsigned32 * getNokiaIMSMediaComponentId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
157 ASSERT_APP_GETAVP(return getAvp(helpers::nokia::AVPID__Nokia_IMS_Media_Component_Id)->getUnsigned32());
161 Avp Time-Of-Last-Usage data-part pointer reference
162 @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).
164 const Time * getTimeOfLastUsage(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
165 ASSERT_APP_GETAVP(return getAvp(helpers::nokia::AVPID__Time_Of_Last_Usage)->getTime());
169 Avp Time-Of-First-Usage data-part pointer reference
170 @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).
172 const Time * getTimeOfFirstUsage(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
173 ASSERT_APP_GETAVP(return getAvp(helpers::nokia::AVPID__Time_Of_First_Usage)->getTime());
177 Avp Session-Start-Indicator data-part pointer reference
178 @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).
180 const OctetString * getSessionStartIndicator(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
181 ASSERT_APP_GETAVP(return getAvp(helpers::nokia::AVPID__Session_Start_Indicator)->getOctetString());
185 Avp Rule-Base-Id data-part pointer reference
186 @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).
188 const UTF8String * getRuleBaseId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
189 ASSERT_APP_GETAVP(return getAvp(helpers::nokia::AVPID__Rule_Base_Id)->getUTF8String());
193 Avp 3GPP-GGSN-Address data-part pointer reference
194 @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).
196 const OctetString * get3GPPGGSNAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
197 ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_GGSN_Address)->getOctetString());
201 Avp Nokia-Reporting-Reason data-part pointer reference
202 @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).
204 const Enumerated * getNOKIAReportingReason(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
205 ASSERT_APP_GETAVP(return getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->getAvp(helpers::nokia::AVPID__Nokia_Reporting_Reason)->getEnumerated());
209 Avp 3GPP-Charging-Id data-part pointer reference
210 @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).
212 const Unsigned32 * get3GPPChargingId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
213 ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_Charging_Id)->getUnsigned32());
217 Avp 3GPP_GPRS_Neg_QoS_Profile data-part pointer reference
218 @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).
221 const UTF8String * get3GPPGPRSNegQoSProfile(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
222 ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_GPRS_Neg_QoS_Profile)->getUTF8String());