Skip to content

Commit 7273da1

Browse files
authored
Change license of python programs importing scapy to gpl v2 (#665)
* Move optional steps for testing VMs out of README.md file This may help avoid new users being confused that they must follow those instructions. Signed-off-by: Andy Fingerhut <[email protected]> * Replace Apache-2.0 license on Python files that use Scapy to GPL-2.0-only Also add doc/licenses.md file to list other Python packages that the Python code in this repository depends upon, and why we believe their licenses are compatible with this code being released as Apache-2.0. Signed-off-by: Andy Fingerhut <[email protected]> --------- Signed-off-by: Andy Fingerhut <[email protected]> Signed-off-by: Andy Fingerhut <[email protected]>
1 parent 157cfe3 commit 7273da1

File tree

18 files changed

+92
-17
lines changed

18 files changed

+92
-17
lines changed

Diff for: doc/licenses.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Introduction
2+
3+
The P4 Consortium's strongly recommends that all source files in this
4+
repository be licensed with the Apache-2.0 license, and marked in a
5+
comment with the line:
6+
7+
```
8+
# SPDX-License-Identifier: Apache-2.0
9+
```
10+
11+
Exceptions to this are listed below.
12+
13+
14+
# Not an exception: Files that import packages released under the Apache-2.0 license
15+
16+
That includes this list of Python packages:
17+
18+
+ grpc - https://pypi.org/project/grpc/
19+
+ grpcio - https://pypi.org/project/grpcio/
20+
+ p4.v1 - part of the P4Runtime API Python code, released under Apache-2.0
21+
+ p4.config.v1 - part of the P4Runtime API Python code, released under
22+
Apache-2.0
23+
24+
25+
# Not an exception: Files that import packages released under a BSD license
26+
27+
That includes this list of Python packages:
28+
29+
+ mininet - https://github.com/mininet/mininet/blob/master/LICENSE
30+
+ protobuf - https://pypi.org/project/protobuf/
31+
+ google.rpc package is auto-generated by Google protobuf
32+
+ psutil - https://pypi.org/project/psutil/
33+
34+
These are published under a BSD-3-Clause license. As discussed here:
35+
36+
+ https://github.com/p4lang/p4c/blob/main/docs/licenses-apache-and-bsd.md
37+
38+
we will publish such source files under the Apache-2.0 license, unless
39+
one of the exceptions below applies.
40+
41+
42+
# Exception: Files that import packages released under a GPL license
43+
44+
That includes this list of Python packages:
45+
46+
+ scapy - https://pypi.org/project/scapy/
47+
48+
As discussed here:
49+
50+
+ https://github.com/p4lang/p4c/blob/main/docs/licenses-apache-and-gpl-v2.md
51+
52+
we recommend that any Python source files that import the scapy
53+
package, which is released under the GPL v2 license, also be licensed
54+
as GPL-2.0-only, with this comment line:
55+
56+
```
57+
# SPDX-License-Identifier: GPL-2.0-only
58+
```

Diff for: exercises/basic/receive.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34
import os
45
import sys
56

Diff for: exercises/basic/send.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34
import random
45
import socket
56
import sys

Diff for: exercises/basic_tunnel/myTunnel_header.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# SPDX-License-Identifier: Apache-2.0
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
# Reason-GPL: import-scapy
23

34

45
from scapy.all import *

Diff for: exercises/basic_tunnel/receive.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34
import os
45
import sys
56

Diff for: exercises/basic_tunnel/send.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34
import argparse
45
import random
56
import socket

Diff for: exercises/calc/calc.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34

45
import re
56

Diff for: exercises/ecn/receive.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34
import sys
45

56
from scapy.all import get_if_list, sniff

Diff for: exercises/ecn/send.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34

45
import socket
56
import sys

Diff for: exercises/link_monitor/probe_hdrs.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# SPDX-License-Identifier: Apache-2.0
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
# Reason-GPL: import-scapy
23
from scapy.all import *
34

45
TYPE_PROBE = 0x812

Diff for: exercises/load_balance/receive.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34
import os
45
import sys
56

Diff for: exercises/load_balance/send.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34
import random
45
import socket
56
import sys

Diff for: exercises/mri/receive.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34
import sys
45

56
from scapy.all import (

Diff for: exercises/mri/send.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34

45
import socket
56
import sys

Diff for: exercises/qos/receive.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34

45
import sys
56

Diff for: exercises/qos/send.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34

45
import argparse
56
import socket

Diff for: exercises/source_routing/receive.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34
import sys
45

56
from scapy.all import Ether, IPOption, Packet, bind_layers, get_if_list, sniff

Diff for: exercises/source_routing/send.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
# Reason-GPL: import-scapy
34
import socket
45
import sys
56

0 commit comments

Comments
 (0)