Comments (1)
I am assuming that you are doing something like this:
for ts, buf in pcap:
print ts
And then you observe the timestamp to be "1408173480.93" instead
of "1408173480.936543", as shown in wireshark. This is because the print
function in python limits float to two decimal places.
Example:
>>> x = 1258494066.119061
>>> x
1258494066.119061
>>> print x
1258494066.12
If you really need to print the full value, use format:
>>> "{0:.6f}".format(x)
'1258494066.119061'
If you have a nanosecond capture file, the place you will need to make the
change is in the __iter__() function of the pcap.py module. Instead of dividing
hdr.tv_usec by 1000000.0, you will need to divide it by 1000000000.0
Original comment by [email protected]
on 25 Dec 2014 at 7:00
- Changed state: Duplicate
from dpkt.
Related Issues (20)
- [patch] dns.unpack_name improvements
- Common DNS RR types missing (patch included)
- FCS field on dpkt.ethernet.Ethernet HOT 4
- ssl.py TLSMultiFactory recursion causes stack overflow HOT 2
- IEEE80211 - Management Frame Subtype Support HOT 11
- IEEE 802.11 Packets - Random Parsing Crashing HOT 2
- cannot install HOT 3
- Example Request - Control Type Packets - Destination/Source Addresses HOT 4
- Unsupported Control Packet Subtypes HOT 3
- Time stamp problem in dpkt HOT 3
- ip total length header field not stored correctly
- Patch for /trunk/dpkt/pcap.py
- IPv6 doesn't handle ESP packets sanely
- multiple IPv6 extension headers of the same type aren't handled
- time and size of packet HOT 3
- Contents of the pkt is cut
- Record Fragmentation not handled in TLSMultiFactory(buf)
- lldp parser should stop at end tlv HOT 1
- [patch] Made http.py return ordered headers
- Check if a given dpkt-layer is part of the packet
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dpkt.