Dear all,
I'm writing a new Agent and use exponential traffic generator to generate
traffic.
In my Agent , I override sendmsg() like following code
void AgentCPU::sendmsg(int nbytes,const char* flag){ Packet
pkt*=allocpkt(); hdr_cmn ch*=hdr_cmn::access(pkt); hdr_task
task*=hdr_task::access(pkt); // my new packet header hdr_ip
ip*=hdr_ip::access(pkt);
ch->ptype()=PT_TASK; ch->size()=size_; ...}
But when I see the trace files , the packet size and type are not same to my
setting.
So, I used the printf to help me debug.
void AgentCPU::sendmsg(int nbytes,const char* flag){ Packet
pkt*=allocpkt(); hdr_cmn ch*=hdr_cmn::access(pkt); hdr_task
task*=hdr_task::access(pkt); // my new packet header hdr_ip
ip*=hdr_ip::access(pkt);
ch->ptype()=PT_TASK; ch->size()=size_;
printf("packet type is %s\n",ch->ptype()); printf("packet size is
%d\n",ch->size()); ...}
And what make me more confuesd is the message showed like
packet type is null
packet size is 1070596096 (my setting is 100)
And I'm sured I have modfied the packet.h like following code
...static const packet_t PT_TASK=73;......name_[PT_TASK]="task";...
My Question is Why I cant set packet type , is anything I did wrong?
Or there is more files I should modify to surrport this sendmsg function?
Any suggestion will be very thanksful!!