Skip to content

Commit 81a7975

Browse files
authored
Merge branch 'master' into docs
2 parents 1ee317c + 6829f4c commit 81a7975

File tree

176 files changed

+29383
-6072
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+29383
-6072
lines changed

.config/ci/install.sh

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ then
1414
fi
1515

1616
# Install on osx
17-
if [ "${OSTYPE:0:6}" = "darwin" ] || [ "$TRAVIS_OS_NAME" = "osx" ]
17+
if [ "${OSTYPE:0:6}" = "darwin" ]
1818
then
1919
if [ ! -z $SCAPY_USE_LIBPCAP ]
2020
then
@@ -23,30 +23,26 @@ then
2323
fi
2424
fi
2525

26-
# Install wireshark data, ifconfig & vcan
27-
if [ "$OSTYPE" = "linux-gnu" ] || [ "$TRAVIS_OS_NAME" = "linux" ]
26+
# Install wireshark data, ifconfig, vcan, samba
27+
if [ "$OSTYPE" = "linux-gnu" ]
2828
then
2929
sudo apt-get update
3030
sudo apt-get -qy install tshark net-tools || exit 1
3131
sudo apt-get -qy install can-utils || exit 1
3232
sudo apt-get -qy install linux-modules-extra-$(uname -r) || exit 1
33+
sudo apt-get -qy install samba smbclient
3334
# Make sure libpcap is installed
3435
if [ ! -z $SCAPY_USE_LIBPCAP ]
3536
then
3637
sudo apt-get -qy install libpcap-dev || exit 1
3738
fi
3839
fi
3940

40-
# On Travis, "osx" dependencies are installed in .travis.yml
41-
if [ "$TRAVIS_OS_NAME" != "osx" ]
42-
then
43-
# Update pip & setuptools (tox uses those)
44-
python -m pip install --upgrade pip setuptools --ignore-installed
41+
# Update pip & setuptools (tox uses those)
42+
python -m pip install --upgrade pip setuptools wheel --ignore-installed
4543

46-
# Make sure tox is installed and up to date
47-
python -m pip install -U tox --ignore-installed
48-
fi
44+
# Make sure tox is installed and up to date
45+
python -m pip install -U tox --ignore-installed
4946

5047
# Dump Environment (so that we can check PATH, UT_FLAGS, etc.)
51-
openssl version
5248
set

.config/ci/test.sh

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# ./test.sh 3.7 both
88
# ./test.sh 3.9 non_root
99

10-
if [ "$OSTYPE" = "linux-gnu" ] || [ "$TRAVIS_OS_NAME" = "linux" ]
10+
if [ "$OSTYPE" = "linux-gnu" ]
1111
then
1212
# Linux
1313
OSTOX="linux"
@@ -18,13 +18,13 @@ then
1818
sudo modprobe -n -v vcan
1919
if [[ $? -ne 0 ]]
2020
then
21-
# The vcan module is currently unavailable on Travis-CI xenial builds
21+
# The vcan module is currently unavailable on xenial builds
2222
UT_FLAGS+=" -K vcan_socket"
2323
fi
2424
else
2525
UT_FLAGS+=" -K vcan_socket"
2626
fi
27-
elif [[ "$OSTYPE" = "darwin"* ]] || [ "$TRAVIS_OS_NAME" = "osx" ] || [[ "$OSTYPE" = "FreeBSD" ]] || [[ "$OSTYPE" = *"bsd"* ]]
27+
elif [[ "$OSTYPE" = "darwin"* ]] || [[ "$OSTYPE" = "FreeBSD" ]] || [[ "$OSTYPE" = *"bsd"* ]]
2828
then
2929
OSTOX="bsd"
3030
# Travis CI in macOS 10.13+ can't load kexts. Need this for tuntaposx.
@@ -57,6 +57,11 @@ then
5757
export DISABLE_COVERAGE=" "
5858
fi
5959

60+
# macos -k scanner has glitchy coverage. skip it
61+
if [ "$OSTOX" = "bsd" ] && [[ "$UT_FLAGS" = *"-k scanner"* ]]; then
62+
export DISABLE_COVERAGE=" "
63+
fi
64+
6065
# libpcap
6166
if [[ ! -z "$SCAPY_USE_LIBPCAP" ]]; then
6267
UT_FLAGS+=" -K veth"
@@ -84,25 +89,32 @@ if [ -z $TOXENV ]
8489
then
8590
case ${SCAPY_TOX_CHOSEN} in
8691
both)
87-
export TOXENV="${TESTVER}_non_root,${TESTVER}_root"
92+
export TOXENV="${TESTVER}-non_root,${TESTVER}-root"
8893
;;
8994
root)
90-
export TOXENV="${TESTVER}_root"
95+
export TOXENV="${TESTVER}-root"
9196
;;
9297
*)
93-
export TOXENV="${TESTVER}_non_root"
98+
export TOXENV="${TESTVER}-non_root"
9499
;;
95100
esac
96101
fi
97102

98103
# Configure OpenSSL
99104
export OPENSSL_CONF=$(${PYTHON:=python} `dirname $BASH_SOURCE`/openssl.py)
100105

101-
# Dump vars (the others were already dumped in install.sh)
106+
# Dump vars (environment is already entirely dumped in install.sh)
107+
echo OSTOX=$OSTOX
102108
echo UT_FLAGS=$UT_FLAGS
103109
echo TOXENV=$TOXENV
104110
echo OPENSSL_CONF=$OPENSSL_CONF
105111
echo OPENSSL_VER=$(openssl version)
112+
echo COVERAGE=$([ -z "$DISABLE_COVERAGE" ] && echo "enabled" || echo "disabled")
113+
114+
if [ "$OSTYPE" = "linux-gnu" ]
115+
then
116+
echo SMBCLIENT=$(smbclient -V)
117+
fi
106118

107119
# Launch Scapy unit tests
108120
TOX_PARALLEL_NO_SPINNER=1 tox -- ${UT_FLAGS} || exit 1

.config/codespell_ignore.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
aci
22
ans
3-
archtypes
43
applikation
4+
archtypes
55
ba
6+
browseable
67
byteorder
78
cace
89
cas
910
componet
11+
comversion
1012
cros
1113
delt
1214
doas
@@ -18,8 +20,9 @@ funktion
1820
gost
1921
hart
2022
iff
21-
interaktive
23+
implementors
2224
inout
25+
interaktive
2326
microsof
2427
mitre
2528
nd

.config/mypy/mypy.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
ignore_errors = True
77
ignore_missing_imports = True
88

9+
[mypy-scapy.libs.rfc3961]
10+
warn_return_any = False
11+
912
# Layers specific config
1013

1114
[mypy-scapy.arch.*]

.config/mypy/mypy_enabled.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ scapy/__main__.py
1010
scapy/all.py
1111
scapy/ansmachine.py
1212
scapy/arch/__init__.py
13+
scapy/arch/bpf/__init__.py
14+
scapy/arch/bpf/consts.py
15+
scapy/arch/bpf/core.py
16+
scapy/arch/bpf/supersocket.py
1317
scapy/arch/common.py
1418
scapy/arch/libpcap.py
1519
scapy/arch/linux.py
16-
scapy/arch/unix.py
1720
scapy/arch/solaris.py
21+
scapy/arch/unix.py
1822
scapy/arch/windows/__init__.py
1923
scapy/arch/windows/native.py
2024
scapy/arch/windows/structures.py
@@ -87,7 +91,13 @@ scapy/contrib/roce.py
8791
scapy/contrib/tcpao.py
8892

8993
# LIBS
94+
scapy/libs/__init__.py
95+
scapy/libs/ethertypes.py
9096
scapy/libs/extcap.py
97+
scapy/libs/matplot.py
98+
scapy/libs/rfc3961.py
99+
scapy/libs/structures.py
100+
scapy/libs/test_pyx.py
91101

92102
# TEST
93103
test/testsocket.py

.github/workflows/unittests.yml

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout Scapy
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
- name: Setup Python
21-
uses: actions/setup-python@v4
21+
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.10"
23+
python-version: "3.12"
2424
- name: Install tox
2525
run: pip install tox
2626
- name: Run flake8 tests
@@ -32,15 +32,16 @@ jobs:
3232
- name: Run gitarchive check
3333
run: tox -e gitarchive
3434
docs:
35+
# 'runs-on' and 'python-version' should match the ones defined in .readthedocs.yml
3536
name: Build doc
36-
runs-on: ubuntu-latest
37+
runs-on: ubuntu-22.04
3738
steps:
3839
- name: Checkout Scapy
39-
uses: actions/checkout@v3
40+
uses: actions/checkout@v4
4041
- name: Setup Python
41-
uses: actions/setup-python@v4
42+
uses: actions/setup-python@v5
4243
with:
43-
python-version: "3.10"
44+
python-version: "3.12"
4445
- name: Install tox
4546
run: pip install tox
4647
- name: Build docs
@@ -50,11 +51,11 @@ jobs:
5051
runs-on: ubuntu-latest
5152
steps:
5253
- name: Checkout Scapy
53-
uses: actions/checkout@v3
54+
uses: actions/checkout@v4
5455
- name: Setup Python
55-
uses: actions/setup-python@v4
56+
uses: actions/setup-python@v5
5657
with:
57-
python-version: "3.11"
58+
python-version: "3.12"
5859
- name: Install tox
5960
run: pip install tox
6061
- name: Run mypy
@@ -69,15 +70,15 @@ jobs:
6970
fail-fast: false
7071
matrix:
7172
os: [ubuntu-latest]
72-
python: ["3.7", "3.8", "3.9", "3.10"]
73+
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
7374
mode: [non_root]
7475
installmode: ['']
7576
flags: [" -K scanner"]
7677
allow-failure: ['false']
7778
include:
7879
# Linux root tests
7980
- os: ubuntu-latest
80-
python: "3.10"
81+
python: "3.12"
8182
mode: root
8283
flags: " -K scanner"
8384
# PyPy tests: root only
@@ -87,18 +88,18 @@ jobs:
8788
flags: " -K scanner"
8889
# Libpcap test
8990
- os: ubuntu-latest
90-
python: "3.10"
91+
python: "3.12"
9192
mode: root
9293
installmode: 'libpcap'
9394
flags: " -K scanner"
9495
# macOS tests
9596
- os: macos-12
96-
python: "3.10"
97+
python: "3.12"
9798
mode: both
9899
flags: " -K scanner"
99100
# Scanner tests
100101
- os: ubuntu-latest
101-
python: "3.10"
102+
python: "3.12"
102103
mode: root
103104
allow-failure: 'true'
104105
flags: " -k scanner"
@@ -108,37 +109,37 @@ jobs:
108109
allow-failure: 'true'
109110
flags: " -k scanner"
110111
- os: macos-12
111-
python: "3.10"
112+
python: "3.12"
112113
mode: both
113114
allow-failure: 'true'
114115
flags: " -k scanner"
115116
steps:
116117
- name: Checkout Scapy
117-
uses: actions/checkout@v3
118+
uses: actions/checkout@v4
118119
# Codecov requires a fetch-depth > 1
119120
with:
120121
fetch-depth: 2
121122
- name: Setup Python
122-
uses: actions/setup-python@v4
123+
uses: actions/setup-python@v5
123124
with:
124125
python-version: ${{ matrix.python }}
125126
- name: Install Tox and any other packages
126127
run: ./.config/ci/install.sh ${{ matrix.installmode }}
127128
- name: Run Tox
128129
run: UT_FLAGS="${{ matrix.flags }}" ./.config/ci/test.sh ${{ matrix.python }} ${{ matrix.mode }}
129130
- name: Codecov
130-
uses: codecov/codecov-action@v3
131+
uses: codecov/codecov-action@v4.0.0-beta.3
131132

132133
cryptography:
133134
name: pyca/cryptography test
134135
runs-on: ubuntu-latest
135136
steps:
136137
- name: Checkout repository
137-
uses: actions/checkout@v3
138+
uses: actions/checkout@v4
138139
- name: Setup Python
139-
uses: actions/setup-python@v4
140+
uses: actions/setup-python@v5
140141
with:
141-
python-version: "3.10"
142+
python-version: "3.12"
142143
- name: Install tox
143144
run: pip install tox
144145
# pyca/cryptography's CI installs cryptography
@@ -156,12 +157,12 @@ jobs:
156157
security-events: write
157158
steps:
158159
- name: Checkout repository
159-
uses: actions/checkout@v3
160+
uses: actions/checkout@v4
160161
with:
161162
fetch-depth: 2
162163
- name: Initialize CodeQL
163-
uses: github/codeql-action/init@v2
164+
uses: github/codeql-action/init@v3
164165
with:
165166
languages: 'python'
166167
- name: Perform CodeQL Analysis
167-
uses: github/codeql-action/analyze@v2
168+
uses: github/codeql-action/analyze@v3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ coverage.xml
1111
.ipynb_checkpoints
1212
.mypy_cache
1313
.vscode
14+
.DS_Store
1415
[.]venv/
1516
__pycache__/
1617
doc/scapy/_build

.readthedocs.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@ formats:
99
- pdf
1010

1111
build:
12-
os: ubuntu-20.04
12+
os: ubuntu-22.04
1313
tools:
14-
python: "3.9"
14+
python: "3.12"
15+
# To show the correct Scapy version, we must unshallow
16+
# https://docs.readthedocs.io/en/stable/build-customization.html#unshallow-git-clone
17+
jobs:
18+
post_checkout:
19+
- git fetch --unshallow || true
1520

21+
# https://docs.readthedocs.io/en/stable/config-file/v2.html#python
1622
python:
1723
install:
1824
- method: pip
1925
path: .
2026
extra_requirements:
21-
- docs
27+
- doc

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# <img src="https://github.com/secdev/scapy/raw/master/doc/scapy/graphics/scapy_logo.png" width="64" valign="middle" alt="Scapy" />&nbsp;&nbsp; Scapy
44

5-
[![Scapy unit tests](https://github.com/secdev/scapy/workflows/Scapy%20unit%20tests/badge.svg?event=push)](https://github.com/secdev/scapy/actions?query=workflow%3A%22Scapy+unit+tests%22+branch%3Amaster+event%3Apush) <!-- ignore_ppi -->
5+
[![Scapy unit tests](https://github.com/secdev/scapy/actions/workflows/unittests.yml/badge.svg?branch=master&event=push)](https://github.com/secdev/scapy/actions/workflows/unittests.yml?query=event%3Apush) <!-- ignore_ppi -->
66
[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/os03daotfja0wtp7/branch/master?svg=true)](https://ci.appveyor.com/project/secdev/scapy/branch/master) <!-- ignore_ppi -->
77
[![Codecov Status](https://codecov.io/gh/secdev/scapy/branch/master/graph/badge.svg)](https://codecov.io/gh/secdev/scapy) <!-- ignore_ppi -->
88
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/30ee6772bb264a689a2604f5cdb0437b)](https://www.codacy.com/app/secdev/scapy) <!-- ignore_ppi -->
@@ -26,7 +26,7 @@ handle, like sending invalid frames, injecting your own 802.11 frames, combining
2626
techniques (VLAN hopping+ARP cache poisoning, VoIP decoding on WEP protected
2727
channel, ...), etc.
2828

29-
Scapy supports Python 2.7 and Python 3 (3.4 to 3.9). It's intended to
29+
Scapy supports Python 3.7+. It's intended to
3030
be cross platform, and runs on many different platforms (Linux, OSX,
3131
\*BSD, and Windows).
3232

0 commit comments

Comments
 (0)