NASA-AMMOS / NASA-AMMOS/AIT-Core
pcap.py should support nanosecond-resolution pcap files
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 56
- Forks
- 35
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 3
Description
There is code in pcap.py to support the magic number of both microsecond-resolution and nonsecond-resolution pcap files (if values[0] == 0xA1B2C3D4 or values[0] == 0xA1B23C4D), but the code that resolves the timestamp in a packet header assumes microsecond resolution:
@property
def ts (self):
"""Packet timestamp as a float, a combination of ts_sec and ts_usec"""
return float(self.ts_sec) + (float(self.ts_usec) / 1e6)
I think if a nanosecond-resolution global header is found (A1B23C4C or byte-reversed) then the timestamp should be ts_sec + ts_usec/1e9. (And perhaps ts_usec is misnamed. Perhaps ts_frac?)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pcap.py by reading the global-header magic-number handling and the Packet.ts property. Verify how microsecond and nanosecond pcap resolutions are identified, then ensure timestamps use the corresponding precision; done when both resolutions produce correct timestamps and the existing pcap coverage includes each case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100