In the packet constructor, make sure you add an appropriate initializer for
your field.

I've done what you are describing many times with success.

Pedro Vale Estrela


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Takuya Kimura
> Sent: terça-feira, 6 de Junho de 2006 14:37
> To: ns-users@ISI.EDU
> Subject: [ns] Problem when adding new variable in common header
> 
> 
>     [input]   [input]   [input]   [input]  Hi,
> 
> I want to add a new variable in common header as information for any
> routing protocols. I edited common/packet.h as follows.
> 
> struct hdr_cmn {
> ...
> static nsaddr_t new_var_;
> ...
> };
> 
> A node sets value for new_var_ and broadcasts the packet. Any nodes
> receiving this broadcast packet access this new variable to read the value
> of new_var_. Unfortunately, different node gets different value of
> new_var_. I don't know why??? Every node should get the same value because
> it comes from the same packet. I didn't access this varaible elsewhere.
> How did the value change?
> 
> Do I have to add something elsewhere when adding a new variabale in common
> header?
> 
> --tak
> 
> ---------------------------------
> Feel free to call! Free PC-to-PC calls. Low rates on PC-to-Phone.  Get
> Yahoo! Messenger with Voice

Reply via email to