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
5a5bea6a
Commit
5a5bea6a
authored
8 years ago
by
Pierre Lalet
Browse files
Options
Downloads
Plain Diff
Merge pull request #113 from guedou/arch_refactoring
scapy/arch refactoring
parents
1689f5f1
6d6dba22
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
scapy/arch/__init__.py
+14
-10
14 additions, 10 deletions
scapy/arch/__init__.py
scapy/arch/bsd.py
+1
-3
1 addition, 3 deletions
scapy/arch/bsd.py
scapy/arch/unix.py
+1
-4
1 addition, 4 deletions
scapy/arch/unix.py
with
16 additions
and
17 deletions
scapy/arch/__init__.py
+
14
−
10
View file @
5a5bea6a
...
...
@@ -40,7 +40,6 @@ def str2mac(s):
return
(
"
%02x:
"
*
6
)[:
-
1
]
%
tuple
(
map
(
ord
,
s
))
def
get_if_addr
(
iff
):
return
socket
.
inet_ntoa
(
get_if_raw_addr
(
iff
))
...
...
@@ -52,13 +51,14 @@ def get_if_hwaddr(iff):
raise
Scapy_Exception
(
"
Unsupported address family (%i) for interface [%s]
"
%
(
addrfamily
,
iff
))
LINUX
=
sys
.
platform
.
startswith
(
"
linux
"
)
OPENBSD
=
sys
.
platform
.
startswith
(
"
openbsd
"
)
FREEBSD
=
"
freebsd
"
in
sys
.
platform
NETBSD
=
sys
.
platform
.
startswith
(
"
netbsd
"
)
DARWIN
=
sys
.
platform
.
startswith
(
"
darwin
"
)
SOLARIS
=
sys
.
platform
.
startswith
(
"
sunos
"
)
WINDOWS
=
sys
.
platform
.
startswith
(
"
win32
"
)
LINUX
=
sys
.
platform
.
startswith
(
"
linux
"
)
OPENBSD
=
sys
.
platform
.
startswith
(
"
openbsd
"
)
FREEBSD
=
"
freebsd
"
in
sys
.
platform
NETBSD
=
sys
.
platform
.
startswith
(
"
netbsd
"
)
DARWIN
=
sys
.
platform
.
startswith
(
"
darwin
"
)
SOLARIS
=
sys
.
platform
.
startswith
(
"
sunos
"
)
WINDOWS
=
sys
.
platform
.
startswith
(
"
win32
"
)
BSD
=
DARWIN
or
FREEBSD
or
OPENBSD
or
NETBSD
X86_64
=
not
WINDOWS
and
(
os
.
uname
()[
4
]
==
'
x86_64
'
)
ARM_64
=
not
WINDOWS
and
(
os
.
uname
()[
4
]
==
'
aarch64
'
)
...
...
@@ -81,8 +81,12 @@ if LINUX:
from
linux
import
*
if
scapy
.
config
.
conf
.
use_pcap
or
scapy
.
config
.
conf
.
use_dnet
:
from
pcapdnet
import
*
elif
OPENBSD
or
FREEBSD
or
NETBSD
or
DARWIN
:
from
bsd
import
*
elif
BSD
:
from
bsd
import
LOOPBACK_NAME
from
unix
import
read_routes
,
read_routes6
,
in6_getifaddr
scapy
.
config
.
conf
.
use_pcap
=
True
scapy
.
config
.
conf
.
use_dnet
=
True
from
pcapdnet
import
*
elif
SOLARIS
:
from
solaris
import
*
elif
WINDOWS
:
...
...
This diff is collapsed.
Click to expand it.
scapy/arch/bsd.py
+
1
−
3
View file @
5a5bea6a
...
...
@@ -7,6 +7,4 @@
Support for BSD-like operating systems such as FreeBSD, OpenBSD and Mac OS X.
"""
LOOPBACK_NAME
=
"
lo0
"
from
unix
import
*
LOOPBACK_NAME
=
"
lo0
"
This diff is collapsed.
Click to expand it.
scapy/arch/unix.py
+
1
−
4
View file @
5a5bea6a
...
...
@@ -14,10 +14,7 @@ import scapy.config
import
scapy.utils
import
scapy.utils6
import
scapy.arch
scapy
.
config
.
conf
.
use_pcap
=
1
scapy
.
config
.
conf
.
use_dnet
=
1
from
pcapdnet
import
*
from
scapy.config
import
conf
##################
...
...
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