Hi all,
i m trying to add a new header in the common header of packets in order to
use it in QOS.
i want to set the value of the new field by the command eval \$udp($src) set
priority_ 1
the name of the field that i want to add is Priority
First, i added a field in packet.h
i added
----
int priority_; // priority packet
inline int& priority() { return (priority_); }
-----
then i added in udp.cc
----------------
UdpAgent::UdpAgent() : Agent(PT_UDP), seqno_(-1)
{
bind("packetSize_", &size_);
bind("priority_", &priority_);
}
UdpAgent::UdpAgent(packet_t type) : Agent(type)
{
bind("packetSize_", &size_);
bind("priority_", &priority_);
}
-------------
and //modification du champ priorite
hdr_cmn::access(p)->priority() = priority_;
////fin
in order to access to the field and modify it.
this doesn t work and i got segmentation error
can anyone help me please