Hi Murphy,

You were right!!
I registered the port_status_event function in my coreapi and now all the 
values 
are printed correctly. 


Thank You!

regards,
Sachin Sharma




________________________________
From: Murphy McCauley <jam...@nau.edu>
To: sachin sharma <sharon_sac...@yahoo.co.in>
Cc: nox-dev@noxrepo.org
Sent: Thu, 25 November, 2010 8:32:56 AM
Subject: Re: [nox-dev] State variable of ofp_phy_port on port status change

handle_port_status in openflow-event.cc is an internal function, not a 
user-facing function.  It is called with the data as it is read off the wire.  
On x86, this means that byte orders are wrong.  The port number is a 16 bit 
value, so an 8 bit shift is exactly what you'd expect to see here, and the 
state 
field is a 32 bit value, so a 24 bit shift is exactly what you'd expect to see 
there.

But you shouldn't really care what's going on in this internal function.  If 
you 
register an event handler for port status events, the handler is called with a 
Port_status_event object as the parameter, and this object will contain a Port 
object, and the values in this should all be properly byteswapped.  Print THOSE 
out, and you should get the values you're expecting.

-- Murphy

On Nov 24, 2010, at 5:44 AM, sachin sharma wrote:

> Hi McCauley,
> 
> First thanks for your concern.
> 
> But this may not be byte order problem. Because other variables are not 
> shifted 
>by same patterns as the state variable.  I found that state variable is left 
>shifted by 24 bit and port number is  left shifted by 8 bit. For example if 
>port 
>number is 1 then nox will show it as 0x100 and if port number is 2 then nox 
>will 
>show it as 0x200 and so on. 
>
> 
> I have printed these value at c++ code of  nox.  
> 
> When there is change in port status then handle_port_status function is 
> called 
>from file nox/src/lib/openflow-event.cc.  ofp_port_status *ops is present 
>there 
>as a function parameter. I have printed values of  variables present in this 
>structure by using printf function available in stdio.h.
> 
> Regards,
> Sachin
> 
> 
> 
> 
> From: Murphy McCauley <jam...@nau.edu>
> To: sachin sharma <sharon_sac...@yahoo.co.in>
> Cc: nox-dev@noxrepo.org
> Sent: Wed, 24 November, 2010 2:36:12 AM
> Subject: Re: [nox-dev] State variable of ofp_phy_port on port status change
> 
> This actually seems like it might be a byte order problem, though it's sort 
> of 
>hard to believe it would have slipped by until now, so I'm sort of surprised.
> 
> Are you seeing this in C++ or in Python?  On x86?  Can you send some sample 
>code which shows the issue?
> 
> -- Murphy
> 
> On Nov 23, 2010, at 1:56 AM, sachin sharma wrote:
> 
> > Hi All,
> > 
> > I am using  openvswitch-1.1.0pre2.tar.gz and nox version 0.6.  I found that 
>when there is change in port status then openvswitch sends port status change 
>to 
>nox. I have printed the state and config variable of ofp_phy_port. and found 
>that when link is down then openvswitch sends "state =0x1" and when link is up 
>then it sends "state=0x0".  I have read the openflow specification and found 
>that these values are correct according to link change.
> > 
> > But when I printed these value at nox, I found different values of state 
>variable. When link is down then nox receives an event with "state=0x1000000" 
>and when link is up, nox receives "state=0x0". I suppose that someone is doing 
>left shift of this state variable. Am I right?  If this is so, then why this 
>is 
>done?
> > 
> > Thank You for reply,
> > 
> > Regards,
> > Sachin
> > 
> > _______________________________________________
> > nox-dev mailing list
> > nox-dev@noxrepo.org
> > http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
> 
> 
> 

_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org

Reply via email to