[BangPypers] Handling bit sized fields in network headers

Saager Mhatre saager.mhatre at gmail.com
Fri May 4 13:39:29 CEST 2012


On Fri, May 4, 2012 at 3:40 PM, Balachandran Sivakumar <benignbala at gmail.com
> wrote:

> Hi,
>
>          What is the best way to handle bit sized fileds in network
> headers, if the data is binary ? The struct module doesn't support
> sizes in bits, and I have scenarios where there are fields of 2 bits,
> 3 bits and 5 bits in size. Thanks


While I never got around to using it much, I remember from PyCon last year
that Scapy [http://pypi.python.org/pypi/Scapy] had a pretty extensive
library for network packet manipulation.

HTH
- d


More information about the BangPypers mailing list