[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Determining the packet type



Hi,

I'm somewhat newbie to ns-2.  How can I determine the packet type of a
packet that is enqueued in

    SomeQueueType::enque(Packet *p)

Reading packet.h it seems I can do something like

    int off_cmn_ = hdr_cmn::offset_;
    hdr_cmn* ch = (hdr_cmn*)p->access(off_cmn_);

    type = ch->ptype();

Is that correct?  I need this because I want to implement a queue that
handles packets of diff types differently.  Should I define a new
packet type for diffserv packet or should I use the prio_ field of
hdr_ip for the code point?

Why isn't hdr_cmn not part of the Packet class, so that I could just
do p->ptype?


urs