Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scapy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
scapy
Commits
c1742620
Commit
c1742620
authored
8 years ago
by
Pierre LALET
Browse files
Options
Downloads
Patches
Plain Diff
Add regression tests for `Dest{MAC,IP,IPv6}Field`s
parent
d1c18724
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/regression.uts
+22
-0
22 additions, 0 deletions
test/regression.uts
with
22 additions
and
0 deletions
test/regression.uts
+
22
−
0
View file @
c1742620
...
@@ -4495,3 +4495,25 @@ assert bpkt.chksum == 0xf0bc and bpkt.payload.chksum == 0xbb17
...
@@ -4495,3 +4495,25 @@ assert bpkt.chksum == 0xf0bc and bpkt.payload.chksum == 0xbb17
pkt = IP(len=42, ihl=6, options=[IPOption_RR()]) / UDP() / ("A" * 10)
pkt = IP(len=42, ihl=6, options=[IPOption_RR()]) / UDP() / ("A" * 10)
bpkt = IP(str(pkt))
bpkt = IP(str(pkt))
assert bpkt.chksum == 0xf0bc and bpkt.payload.chksum == 0xbb17
assert bpkt.chksum == 0xf0bc and bpkt.payload.chksum == 0xbb17
= Layer binding
* Test DestMACField & DestIPField
pkt = Ether(str(Ether()/IP()/UDP(dport=5353)/DNS()))
assert isinstance(pkt, Ether) and pkt.dst == '01:00:5e:00:00:fb'
pkt = pkt.payload
assert isinstance(pkt, IP) and pkt.dst == '224.0.0.251'
pkt = pkt.payload
assert isinstance(pkt, UDP) and pkt.dport == 5353
pkt = pkt.payload
assert isinstance(pkt, DNS) and isinstance(pkt.payload, NoPayload)
* Same with IPv6
pkt = Ether(str(Ether()/IPv6()/UDP(dport=5353)/DNS()))
assert isinstance(pkt, Ether) and pkt.dst == '33:33:00:00:00:fb'
pkt = pkt.payload
assert isinstance(pkt, IPv6) and pkt.dst == 'ff02::fb'
pkt = pkt.payload
assert isinstance(pkt, UDP) and pkt.dport == 5353
pkt = pkt.payload
assert isinstance(pkt, DNS) and isinstance(pkt.payload, NoPayload)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment