[BangPypers] Handling bit sized fields in network headers
vsapre80 at gmail.com
Mon May 7 10:44:53 CEST 2012
On Mon, May 7, 2012 at 1:34 PM, Balachandran Sivakumar <benignbala at gmail.com
> On Mon, May 7, 2012 at 1:02 PM, Vishal <vsapre80 at gmail.com> wrote:
> > One more thing...once you read the incoming bytes as strings, you'll have
> > to convert them to numbers (using struct.unpack or array.tolist() or
> > something else) before using the code fragments !!
> Yeah, got that part already :) Thanks
> Thank you
> Balachandran Sivakumar
> Arise Awake and stop not till the goal is reached.
> - Swami
> Mail: benignbala at gmail.com
> Blog: http://benignbala.wordpress.com/
> BangPypers mailing list
> BangPypers at python.org
Ok good. One more very important thing (I hope this is the last caveat :))
)...the byte order assumed is little-endian here. Network byte order is
mostly big-endian. So you'll have to interpret the string as number in
big-endian format, covert it to little-endian and then use the code
Thanks and best regards,
"Life is 10% how you make it, and 90% how you take it"
"बहुजन हिताय, बहुजन सुखाय (Benefit for most people, Happiness for most
Please DONT print this email, unless you really need to.
Save Energy & Paper. Save the Earth.
More information about the BangPypers