[ns] accessing queue length in 802.11 MAC
St4Ski0
newbaronelle at hotmail.com
Tue Jun 14 01:28:45 PDT 2011
Hi, anyone as tested this method?
I've insert following code in mac-802_11.cc in recvDATA() but i've
segmentation fault problem...why if i test if the pointer is non-null?
int pkt_in_q = 0;
//Thesis
if ( ((LL *)uptarget_)->ifq()){
//code if non-null
pkt_in_q = ((LL *)uptarget_)->ifq()->length();
printf("non-null queue \n");
} else {
// code if null
printf("null queue \n");
}
M. Shen wrote:
>
>
> Dear guys,
>
> I tried to access queue length in MAC. So I wrote
> int pkt_num = ((LL *)uptarget_)->ifq()->length();
>
> When I run the simulation us gdb, segmentation fault occurs. I shows
> that
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x080c3ad4 in Queue::length() (this=0x0) at queue/queue.h:136
> 136 int length() { return pq_->length(); } /* number of pkts currently
> in
>
> Does any one know how to deal with this problem?
>
> Thank you very much,
> Min
>
>
>
--
View this message in context: http://old.nabble.com/Re%3A-accessing-queue-length-in-802.11-MAC-tp7713314p31833588.html
Sent from the ns-users mailing list archive at Nabble.com.
More information about the Ns-users
mailing list