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_huawei_Message_hpp
38 #define anna_diameter_app_dcca_huawei_Message_hpp
42 #include <anna/diameter/app/dcca/Message.hpp>
45 #include <anna/diameter/helpers/huawei/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 {
79 Avp PS-Information pointer reference
80 @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).
82 const anna::diameter::codec::Avp * getPSInformation(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
84 return getAvp(helpers::tgpp::AVPID__Service_Information)->
85 getAvp(helpers::tgpp::AVPID__PS_Information);
90 Avp Called-Station-Id data-part pointer reference
91 @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).
93 const UTF8String * getCalledStationId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
95 return getAvp(helpers::tgpp::AVPID__Service_Information)->
96 getAvp(helpers::tgpp::AVPID__PS_Information)->
97 getAvp(helpers::radius::AVPID__Called_Station_Id)->getUTF8String();
102 Avp 3GPP-PDP-Type data-part pointer reference
103 @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).
105 const Unsigned32 * get3GPPPDPType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
107 return getAvp(helpers::tgpp::AVPID__Service_Information)->
108 getAvp(helpers::tgpp::AVPID__PS_Information)->
109 getAvp(helpers::tgpp::AVPID__3GPP_PDP_Type)->getUnsigned32();
114 Avp 3GPP-SGSN-MCC-MNC data-part pointer reference
115 @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).
117 const UTF8String * get3GPPSGSNMCCMNC(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
119 return getAvp(helpers::tgpp::AVPID__Service_Information)->
120 getAvp(helpers::tgpp::AVPID__PS_Information)->
121 getAvp(helpers::tgpp::AVPID__3GPP_SGSN_MCC_MNC)->getUTF8String();
126 Avp 3GPP-Charging-Characteristics data-part pointer reference
127 @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).
129 const UTF8String * get3GPPChargingCharacteristics(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
131 return getAvp(helpers::tgpp::AVPID__Service_Information)->
132 getAvp(helpers::tgpp::AVPID__PS_Information)->
133 getAvp(helpers::tgpp::AVPID__3GPP_Charging_Characteristics)->getUTF8String();
138 Avp 3GPP-GPRS-Neg-QoS-Profile data-part pointer reference
139 @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).
141 const UTF8String * get3GPPGPRSNegQoSProfile(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
143 return getAvp(helpers::tgpp::AVPID__Service_Information)->
144 getAvp(helpers::tgpp::AVPID__PS_Information)->
145 getAvp(helpers::tgpp::AVPID__3GPP_GPRS_Neg_QoS_Profile)->getUTF8String();
150 Avp CG-Address data-part pointer reference
151 @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).
153 const Address * getCGAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
155 return getAvp(helpers::tgpp::AVPID__Service_Information)->
156 getAvp(helpers::tgpp::AVPID__PS_Information)->
157 getAvp(helpers::tgpp::AVPID__CG_Address)->getAddress();
162 Avp 3GPP-Rat-Type data-part pointer reference
163 @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).
165 const OctetString * get3GPPRatType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
167 return getAvp(helpers::tgpp::AVPID__Service_Information)->
168 getAvp(helpers::tgpp::AVPID__PS_Information)->
169 getAvp(helpers::tgpp::AVPID__3GPP_Rat_Type)->getOctetString();
174 Avp SGSN-Address data-part pointer reference
175 @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).
177 const Address * getSGSNAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
179 return getAvp(helpers::tgpp::AVPID__Service_Information)->
180 getAvp(helpers::tgpp::AVPID__PS_Information)->
181 getAvp(helpers::tgpp::AVPID__SGSN_Address)->getAddress();
186 Avp GGSN-Address data-part pointer reference
187 @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).
189 const Address * getGGSNAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
191 return getAvp(helpers::tgpp::AVPID__Service_Information)->
192 getAvp(helpers::tgpp::AVPID__PS_Information)->
193 getAvp(helpers::tgpp::AVPID__GGSN_Address)->getAddress();
198 Avp 3GPP-Charging-Id data-part pointer reference
199 @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).
201 const Unsigned32 * get3GPPChargingId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
203 return getAvp(helpers::tgpp::AVPID__Service_Information)->
204 getAvp(helpers::tgpp::AVPID__PS_Information)->
205 getAvp(helpers::tgpp::AVPID__3GPP_Charging_Id)->getUnsigned32();
210 Avp Reporting-Reason data-part pointer reference
211 @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).
213 const Enumerated * getReportingReason(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
214 ASSERT_APP_GETAVP(return getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->getAvp(helpers::tgpp::AVPID__Reporting_Reason)->getEnumerated());
218 Avp Trigger-Type data-part pointer reference
219 @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 Enumerated * getTriggerType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
223 return getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->
224 getAvp(helpers::tgpp::AVPID__Trigger)->
225 getAvp(helpers::tgpp::AVPID__Trigger_Type)->getEnumerated();
230 Avp PS-Furnish-Charging-Information pointer reference
231 @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).
233 const anna::diameter::codec::Avp * getPSFurnishChargingInformation(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
235 return getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->
236 getAvp(helpers::tgpp::AVPID__PS_Furnish_Charging_Information);
241 Avp PS-Free-Format-Data data-part pointer reference
242 @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).
244 const OctetString * getPSFreeFormatData(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
246 return getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->
247 getAvp(helpers::tgpp::AVPID__PS_Furnish_Charging_Information)->
248 getAvp(helpers::tgpp::AVPID__PS_Free_Format_Data)->getOctetString();
253 Avp PS-Append-Free-Format-Data data-part pointer reference
254 @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).
256 const Enumerated * getPSAppendFreeFormatData(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
258 return getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->
259 getAvp(helpers::tgpp::AVPID__PS_Furnish_Charging_Information)->
260 getAvp(helpers::tgpp::AVPID__PS_Append_Free_Format_Data)->getEnumerated();
265 Avp n-th PDP-Address pointer reference
266 @param ocurrence Select the n-th PDP-Address within the PS-Information. First by default.
267 @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).
269 const Address * getPDPAddress(int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
271 return getAvp(helpers::tgpp::AVPID__Service_Information)->
272 getAvp(helpers::tgpp::AVPID__PS_Information)->
273 getAvp(helpers::tgpp::AVPID__PDP_Address)->getAddress();