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
3fe45060
Commit
3fe45060
authored
9 years ago
by
Guillaume Valadon
Browse files
Options
Downloads
Plain Diff
Merged in gvaladon/scapy-issues/Issue #5130 (pull request #125)
Support for arm64
parents
29a048a3
1a8d88e2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scapy/arch/__init__.py
+1
-0
1 addition, 0 deletions
scapy/arch/__init__.py
scapy/arch/linux.py
+2
-2
2 additions, 2 deletions
scapy/arch/linux.py
with
3 additions
and
2 deletions
scapy/arch/__init__.py
+
1
−
0
View file @
3fe45060
...
@@ -52,6 +52,7 @@ SOLARIS=sys.platform.startswith("sunos")
...
@@ -52,6 +52,7 @@ SOLARIS=sys.platform.startswith("sunos")
WINDOWS
=
sys
.
platform
.
startswith
(
"
win32
"
)
WINDOWS
=
sys
.
platform
.
startswith
(
"
win32
"
)
X86_64
=
not
WINDOWS
and
(
os
.
uname
()[
4
]
==
'
x86_64
'
)
X86_64
=
not
WINDOWS
and
(
os
.
uname
()[
4
]
==
'
x86_64
'
)
ARM_64
=
not
WINDOWS
and
(
os
.
uname
()[
4
]
==
'
aarch64
'
)
# Next step is to import following architecture specific functions:
# Next step is to import following architecture specific functions:
...
...
This diff is collapsed.
Click to expand it.
scapy/arch/linux.py
+
2
−
2
View file @
3fe45060
...
@@ -132,7 +132,7 @@ def attach_filter(s, filter):
...
@@ -132,7 +132,7 @@ def attach_filter(s, filter):
# XXX. Argl! We need to give the kernel a pointer on the BPF,
# XXX. Argl! We need to give the kernel a pointer on the BPF,
# python object header seems to be 20 bytes. 36 bytes for x86 64bits arch.
# python object header seems to be 20 bytes. 36 bytes for x86 64bits arch.
if
scapy
.
arch
.
X86_64
:
if
scapy
.
arch
.
X86_64
or
scapy
.
arch
.
ARM_64
:
bpfh
=
struct
.
pack
(
"
HL
"
,
nb
,
id
(
bpf
)
+
36
)
bpfh
=
struct
.
pack
(
"
HL
"
,
nb
,
id
(
bpf
)
+
36
)
else
:
else
:
bpfh
=
struct
.
pack
(
"
HI
"
,
nb
,
id
(
bpf
)
+
20
)
bpfh
=
struct
.
pack
(
"
HI
"
,
nb
,
id
(
bpf
)
+
20
)
...
@@ -282,7 +282,7 @@ def get_if(iff,cmd):
...
@@ -282,7 +282,7 @@ def get_if(iff,cmd):
def
get_if_index
(
iff
):
def
get_if_index
(
iff
):
return
int
(
struct
.
unpack
(
"
I
"
,
get_if
(
iff
,
SIOCGIFINDEX
)[
16
:
20
])[
0
])
return
int
(
struct
.
unpack
(
"
I
"
,
get_if
(
iff
,
SIOCGIFINDEX
)[
16
:
20
])[
0
])
if
os
.
uname
()[
4
]
==
'
x86_64
'
:
if
os
.
uname
()[
4
]
in
[
'
x86_64
'
,
'
aarch64
'
]
:
def
get_last_packet_timestamp
(
sock
):
def
get_last_packet_timestamp
(
sock
):
ts
=
ioctl
(
sock
,
SIOCGSTAMP
,
"
1234567890123456
"
)
ts
=
ioctl
(
sock
,
SIOCGSTAMP
,
"
1234567890123456
"
)
s
,
us
=
struct
.
unpack
(
"
QQ
"
,
ts
)
s
,
us
=
struct
.
unpack
(
"
QQ
"
,
ts
)
...
...
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