Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SPDX-License-Identifier: GPL-2.0-only to Python source files using scapy #5111

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jafingerhut
Copy link
Contributor

@jafingerhut jafingerhut commented Jan 25, 2025

Updated comment as of commit 4:

I have reduced this PR to only adding GPL-2.0-only license to 6 Python test programs. They use Scapy pretty extensively. They might be made to work with bf_pktpy in the future, but that is work we might attempt another day. Until then, we should call a spade a spade, and mark these files with the license they should have.

Reminder: These files are only used at test time. They are never included as part of any p4c executable.

…g scapy

either by directly importing scapy, or by importing a package that
imports scapy.

Remove the one Scapy method call in tools/testutils.py that existed,
so that it no longer needs to import scapy, reducing the number of
Python files that are GPL-2.0-only.

Signed-off-by: Andy Fingerhut <[email protected]>
@jafingerhut jafingerhut marked this pull request as draft January 25, 2025 08:51
@fruffy fruffy added the documentation Topics related to compiler documentation. label Jan 26, 2025
Copy link
Contributor

github-actions bot commented Jan 26, 2025

githubloading A preview of this PR is available at: Preview Link
📂 View the source code here: View Source Code
🔧 Commit used for deployment: b9dc0a3dcdfc146af98ec772b2b14dafb542f9ad

Note: Changes may take a few seconds to appear on GitHub Pages. Please refresh the page if you do not see the updates immediately.

@jafingerhut jafingerhut marked this pull request as ready for review February 8, 2025 22:04
@jafingerhut
Copy link
Contributor Author

I think this is ready for review now.

@jafingerhut jafingerhut marked this pull request as draft February 17, 2025 13:40
@jafingerhut
Copy link
Contributor Author

Putting this back in draft mode for now.

I know how to modify 2 or 3 of the Python source files that import scapy, currently modified by this PR, so that they no longer need to import scapy, but it requires a non-scapy implementation of a PcapWriter class and a rdpcap function. See this PR for one possible implementation of this (and older version of PcapWriter has been in ptf since it was derived from oftest in 2015, but it needed a little bit of generalization): p4lang/ptf#214

The ebpf and ubpf test program that use Scapy use its packet header construction capabilities quite heavily. MAYBE they can be updated to use bf_pktpy instead, but again, THEY ARE ONLY TEST PROGRAMS that do not affect the contents of the p4c executables.

@jafingerhut jafingerhut marked this pull request as ready for review February 21, 2025 02:13
@jafingerhut
Copy link
Contributor Author

OK, I have the set of files in the p4c repo that import Scapy down to only 6. They are definitely all only used at test time.

I have added a comment in each of these files that if some day, someone eliminates the dependence upon Scapy, then they can be relicensed to Apache-2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Topics related to compiler documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants