Skip to content

Commit

Permalink
Change license of python programs importing scapy to gpl v2 (#665)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
jafingerhut authored Jan 25, 2025
1 parent 157cfe3 commit 7273da1
Show file tree
Hide file tree
Showing 18 changed files with 92 additions and 17 deletions.
58 changes: 58 additions & 0 deletions doc/licenses.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Introduction

The P4 Consortium's strongly recommends that all source files in this
repository be licensed with the Apache-2.0 license, and marked in a
comment with the line:

```
# SPDX-License-Identifier: Apache-2.0
```

Exceptions to this are listed below.


# Not an exception: Files that import packages released under the Apache-2.0 license

That includes this list of Python packages:

+ grpc - https://pypi.org/project/grpc/
+ grpcio - https://pypi.org/project/grpcio/
+ p4.v1 - part of the P4Runtime API Python code, released under Apache-2.0
+ p4.config.v1 - part of the P4Runtime API Python code, released under
Apache-2.0


# Not an exception: Files that import packages released under a BSD license

That includes this list of Python packages:

+ mininet - https://github.com/mininet/mininet/blob/master/LICENSE
+ protobuf - https://pypi.org/project/protobuf/
+ google.rpc package is auto-generated by Google protobuf
+ psutil - https://pypi.org/project/psutil/

These are published under a BSD-3-Clause license. As discussed here:

+ https://github.com/p4lang/p4c/blob/main/docs/licenses-apache-and-bsd.md

we will publish such source files under the Apache-2.0 license, unless
one of the exceptions below applies.


# Exception: Files that import packages released under a GPL license

That includes this list of Python packages:

+ scapy - https://pypi.org/project/scapy/

As discussed here:

+ https://github.com/p4lang/p4c/blob/main/docs/licenses-apache-and-gpl-v2.md

we recommend that any Python source files that import the scapy
package, which is released under the GPL v2 license, also be licensed
as GPL-2.0-only, with this comment line:

```
# SPDX-License-Identifier: GPL-2.0-only
```
3 changes: 2 additions & 1 deletion exercises/basic/receive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy
import os
import sys

Expand Down
3 changes: 2 additions & 1 deletion exercises/basic/send.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy
import random
import socket
import sys
Expand Down
3 changes: 2 additions & 1 deletion exercises/basic_tunnel/myTunnel_header.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy


from scapy.all import *
Expand Down
3 changes: 2 additions & 1 deletion exercises/basic_tunnel/receive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy
import os
import sys

Expand Down
3 changes: 2 additions & 1 deletion exercises/basic_tunnel/send.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy
import argparse
import random
import socket
Expand Down
3 changes: 2 additions & 1 deletion exercises/calc/calc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy

import re

Expand Down
3 changes: 2 additions & 1 deletion exercises/ecn/receive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy
import sys

from scapy.all import get_if_list, sniff
Expand Down
3 changes: 2 additions & 1 deletion exercises/ecn/send.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy

import socket
import sys
Expand Down
3 changes: 2 additions & 1 deletion exercises/link_monitor/probe_hdrs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy
from scapy.all import *

TYPE_PROBE = 0x812
Expand Down
3 changes: 2 additions & 1 deletion exercises/load_balance/receive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy
import os
import sys

Expand Down
3 changes: 2 additions & 1 deletion exercises/load_balance/send.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy
import random
import socket
import sys
Expand Down
3 changes: 2 additions & 1 deletion exercises/mri/receive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy
import sys

from scapy.all import (
Expand Down
3 changes: 2 additions & 1 deletion exercises/mri/send.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy

import socket
import sys
Expand Down
3 changes: 2 additions & 1 deletion exercises/qos/receive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy

import sys

Expand Down
3 changes: 2 additions & 1 deletion exercises/qos/send.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy

import argparse
import socket
Expand Down
3 changes: 2 additions & 1 deletion exercises/source_routing/receive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy
import sys

from scapy.all import Ether, IPOption, Packet, bind_layers, get_if_list, sniff
Expand Down
3 changes: 2 additions & 1 deletion exercises/source_routing/send.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: GPL-2.0-only
# Reason-GPL: import-scapy
import socket
import sys

Expand Down

0 comments on commit 7273da1

Please sign in to comment.