I want to build three simple modules using .xml instead of .ned then build a network using these three modules.
I start with the first simple module (Firewall) but I have a problem in Firewall.cc file:
- it is give an error on #include "cxmlelement.h" and
is it correct to use cXMLElement *xmlPosture; xmlPosture = cPar("Firewall_n").xmlValue(); in initialize method to read the xml file and build the module ?
could any body advise how to start I am still new to omnet++?
the Firewall.cc is:
#include <string.h>
#include <cxmlelement.h>
#include <omnetpp.h>
using namespace omnetpp;
class Firewall : public cSimpleModule
{
protected:
virtual void initialize() override;
virtual void handleMessage(cMessage *msg) override;
};
Define_Module(Firewall);
void Firewall::initialize()
{
cXMLElement *xmlPosture;
xmlPosture = cPar("Firewall_n").xmlValue();
cXMLElementList Entities = xmlPostureW->getElementsByTagName("parameters");
cXMLElementList Entities = xmlPostureW->getElementsByTagName("gates");
}
void Firewall::handleMessage(cMessage *msg)
{ }
the Firewall_n.xml is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<ned-file filename="C:/omnet/omnetpp-5.2/samples/test1/Firewall.ned">
<comment locid="banner" content=" "/>
<simple-module name="Firewall">
<comment locid="trailing" content=" "/>
<parameters>
<param type="int" is-volatile="true" name="number_of_cpu"/>
<param type="string" is-volatile="true" name="memory_type"/>
<param type="int" is-volatile="true" name="memory_size">
<property name="unit">
<property-key>
<literal type="spec" text="GiB" value="GiB"/>
</property-key>
</property>
</param>
<param type="int" is-volatile="true" name="disk_size">
<property name="unit">
<property-key>
<literal type="spec" text="GiB" value="GiB"/>
</property-key>
</property>
</param>
<property name="display">
<property-key>
<literal type="string" text=""i=device/firewall"" value="i=device/firewall"/>
</property-key>
</property>
</parameters>
<gates>
<gate name="out" type="output"/>
</gates>
</simple-module>
--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.