[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
about packet unique identifier (uid_)
Hi,
in Ns "Notes and Documentation", chapter 11 (about Packets), it's written: "
The copy() member function creates a new identical copy of a packet with the
exception of uid_ field, wich is unique".
To me it seem not to be true!!
Here is the source code :
inline Packet* Packet::copy() const
{
Packet* p = alloc();
memcpy(p->bits(), bits_, hdrlen_);
if (datalen_) {
p->datalen_ = datalen_;
p->data_ = new unsigned char[datalen_];
memcpy(p->data_, data_, datalen_);
}
return (p);
}
As shown, the copy() function completely duplicates the bits_ buffer which
contains (in the common header) the uid_.
So I think that duplicated packets share the same uid_ !! ( I mean the uid_
in the common header and not the uid_ member of the Event class used by the
Scheduler).
Can someone tell me if I'm right or wrong?? And if I'm wrong, why?
Another little question: the uid_ member of the Event class is used by the
Scheduler, who is the uid_ in the common header used by?
Please answer, thanks a lot!
Luca