Skip to content

Draft: Add Zenoh 1.0 protocol contrib layer#5043

Open
polybassa wants to merge 4 commits into
secdev:masterfrom
polybassa:implement-zenoh-protocol
Open

Draft: Add Zenoh 1.0 protocol contrib layer#5043
polybassa wants to merge 4 commits into
secdev:masterfrom
polybassa:implement-zenoh-protocol

Conversation

@polybassa

Copy link
Copy Markdown
Contributor

AI-Assisted: yes (Cursor AI)

polybassa and others added 2 commits July 14, 2026 20:54
AI-Assisted: no
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.52217% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.26%. Comparing base (b6de7fa) to head (0139289).
⚠️ Report is 28 commits behind head on master.

Files with missing lines Patch % Lines
scapy/contrib/zenoh.py 98.52% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5043      +/-   ##
==========================================
- Coverage   80.29%   80.26%   -0.03%     
==========================================
  Files         383      389       +6     
  Lines       95172    96670    +1498     
==========================================
+ Hits        76415    77594    +1179     
- Misses      18757    19076     +319     
Files with missing lines Coverage Δ
scapy/contrib/zenoh.py 98.52% <98.52%> (ø)

... and 39 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@polybassa polybassa changed the title Add Zenoh 1.0 protocol contrib layer Draft: Add Zenoh 1.0 protocol contrib layer Jul 14, 2026
@polybassa polybassa requested a review from Copilot July 14, 2026 19:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Scapy contrib dissector for the Zenoh 1.0 wire format and a dedicated UTS test campaign to validate encoding/decoding, message dispatch, and port bindings.

Changes:

  • Introduces scapy.contrib.zenoh with custom varint/bytes/id fields, scouting + transport message layers, and basic network message dispatch.
  • Adds test/contrib/zenoh.uts covering field codecs, message build/dissect roundtrips, dispatch layers, and UDP/TCP bindings on standard Zenoh ports.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
scapy/contrib/zenoh.py New Zenoh contrib protocol layer implementation (fields, packets, dispatch, bindings).
test/contrib/zenoh.uts New regression tests for Zenoh field encoding/decoding and packet parsing/binding behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scapy/contrib/zenoh.py Outdated
Comment thread scapy/contrib/zenoh.py
Comment on lines +69 to +78
def getfield(self, pkt, s):
value = 0
shift = 0
for i in range(len(s)):
b = orb(s[i])
value |= (b & 0x7F) << shift
shift += 7
if not (b & 0x80):
return s[i + 1:], value
return b"", value
Comment thread scapy/contrib/zenoh.py Outdated
Comment thread scapy/contrib/zenoh.py
Comment on lines +59 to +67
def addfield(self, pkt, s, val):
if val is None:
val = 0
data = bytearray()
while val > 0x7F:
data.append((val & 0x7F) | 0x80)
val >>= 7
data.append(val & 0x7F)
return s + bytes(data)
Comment thread scapy/contrib/zenoh.py
Comment on lines +96 to +101
def addfield(self, pkt, s, val):
if val is None:
val = b""
if isinstance(val, str):
val = val.encode()
return s + chb(len(val)) + val
Nils Weiss added 2 commits July 15, 2026 07:21
AI-Assisted: yes (Cursor AI)
AI-Assisted: yes (Cursor AI)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants