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
bf41d9ad
Commit
bf41d9ad
authored
15 years ago
by
Phil
Browse files
Options
Downloads
Patches
Plain Diff
Have Packet.show() indent field values represented on several lines
parent
922b21f9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scapy/packet.py
+10
-4
10 additions, 4 deletions
scapy/packet.py
with
10 additions
and
4 deletions
scapy/packet.py
+
10
−
4
View file @
bf41d9ad
...
...
@@ -801,10 +801,16 @@ Creates an EPS file describing a packet. If filename is not provided a temporary
for
fvalue
in
fvalue_gen
:
fvalue
.
show
(
indent
=
indent
,
label_lvl
=
label_lvl
+
lvl
+
"
|
"
)
else
:
print
"
%s %-10s%s %s
"
%
(
label_lvl
+
lvl
,
ncol
(
f
.
name
),
ct
.
punct
(
"
=
"
),
vcol
(
f
.
i2repr
(
self
,
fvalue
)))
begn
=
"
%s %-10s%s
"
%
(
label_lvl
+
lvl
,
ncol
(
f
.
name
),
ct
.
punct
(
"
=
"
),)
reprval
=
f
.
i2repr
(
self
,
fvalue
)
if
type
(
reprval
)
is
str
:
reprval
=
reprval
.
replace
(
"
\n
"
,
"
\n
"
+
"
"
*
(
len
(
label_lvl
)
+
len
(
lvl
)
+
len
(
f
.
name
)
+
4
))
print
"
%s%s
"
%
(
begn
,
vcol
(
reprval
))
self
.
payload
.
show
(
indent
=
indent
,
lvl
=
lvl
+
(
"
"
*
indent
*
self
.
show_indent
),
label_lvl
=
label_lvl
)
def
show2
(
self
):
"""
Prints a hierarchical view of an assembled version of the packet, so that automatic fields are calculated (checksums, etc.)
"""
...
...
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