[BangPypers] Handling bit sized fields in network headers

Vishal 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
> wrote:

> Hi,
>
> 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
> Vivekananda
>
> Mail: benignbala at gmail.com
> Blog: http://benignbala.wordpress.com/
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>

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
fragments.

-- 
Thanks and best regards,
Vishal Sapre

---
"Life is 10% how you make it, and 90% how you take it"
"बहुजन हिताय, बहुजन सुखाय (Benefit for most people, Happiness for most
people.)"
---
Please DONT print this email, unless you really need to.
Save Energy & Paper. Save the Earth.


More information about the BangPypers mailing list