Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 139 by
anders.a...@gmail.com: Check if a given dpkt-layer is part
of the packet
https://code.google.com/p/dpkt/issues/detail?id=139
Is there a standard method for searching the data-portion of a packet for a
given layer?
I have started to build a decoder for EtherNet/IP. When I sniff packets I
usually need to filter for a given layer (ex. ForwardOpen etc). I did not
find a method for this so I created the following two methods in
dpkt.Packet:
dpkt.Packet.HasLayer( LayerClass )
dpkt.Packet.GetLayer( LayerClass )
They are basically recursive methods that check the Type of the data
attribute of the packet.
The first one return True/False if the layer is located somewhere in the
current packet, and the second of course return the layer in question (The
first on actually run the second).
I'm running Python 2.7.5 on windows 7 and 1.8 of dpkt.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings