Fix local server for multiple applications
[anna.git] / diameter / stack / Vendor.cpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
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 //
7
8
9 // Local
10 #include <anna/diameter/stack/Vendor.hpp>
11
12 #include <anna/core/functions.hpp>
13 #include <anna/xml/xml.hpp>
14
15 //using namespace anna;
16
17 anna_assign_enum(anna::diameter::stack::Vendor::Code) = { "Ietf", "Nokia", "Ericsson", "3GPP", "Telefonicaid", "Etsi", NULL /* list end indicator */};
18
19 //------------------------------------------------------------------------------
20 //----------------------------------------------------------- Vendor::asString()
21 //------------------------------------------------------------------------------
22 std::string anna::diameter::stack::Vendor::asString(void) const throw() {
23   std::string trace;
24   //trace = "Vendor '";
25   trace = "'";
26   trace += a_name;
27   trace += "'(";
28   trace += anna::functions::asString(a_id);
29   trace += ")";
30   return (trace);
31 }
32
33
34 //------------------------------------------------------------------------------
35 //-------------------------------------------------------------- Vendor::asXML()
36 //------------------------------------------------------------------------------
37 anna::xml::Node* anna::diameter::stack::Vendor::asXML(anna::xml::Node* parent) const throw() {
38 //   <!ELEMENT vendor EMPTY>
39 //   <!ATTLIST vendor name CDATA #REQUIRED code CDATA #REQUIRED>
40   anna::xml::Node* result = parent->createChild("vendor");
41   result->createAttribute("name", a_name);
42   result->createAttribute("code", anna::functions::asString(a_id));
43   return result;
44 }
45