From b99d3d23217803a34537f878bb96b2fa8091c5f2 Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Tue, 11 Feb 2025 14:35:25 +0000 Subject: [PATCH 1/2] Add SPDX license id and copyright banners to source files needing them Signed-off-by: Andy Fingerhut --- CI/check_codegen.sh | 16 ++++++++++++++++ bazel/example/using-bzlmod/hello_p4runtime.cc | 16 ++++++++++++++++ .../example/using-workspace/hello_p4runtime.cc | 16 ++++++++++++++++ codegen/Dockerfile | 16 ++++++++++++++++ codegen/compile_protos.sh | 16 ++++++++++++++++ codegen/update.sh | 16 ++++++++++++++++ docs/tools/Makefile | 18 +++++++++++++++++- docs/v1/Makefile | 18 +++++++++++++++++- docs/v1/resources/theme/p4-stylesheet.css | 3 ++- docs/v1/resources/theme/p4-theme.yml | 16 ++++++++++++++++ proto/p4/config/v1/p4info.proto | 4 +++- proto/p4/config/v1/p4types.proto | 4 +++- proto/p4/v1/p4data.proto | 4 +++- proto/p4/v1/p4runtime.proto | 2 ++ proto/p4runtime_deps.bzl | 16 ++++++++++++++++ py/pyproject.toml | 16 ++++++++++++++++ py/setup.py | 16 ++++++++++++++++ rust/Cargo.toml | 16 ++++++++++++++++ tools/asciidoclint.py | 3 ++- 19 files changed, 225 insertions(+), 7 deletions(-) diff --git a/CI/check_codegen.sh b/CI/check_codegen.sh index 918e303b..16e1d995 100755 --- a/CI/check_codegen.sh +++ b/CI/check_codegen.sh @@ -1,4 +1,20 @@ #!/usr/bin/env bash +# Copyright 2020 Yi Tseng +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + set -eo pipefail diff --git a/bazel/example/using-bzlmod/hello_p4runtime.cc b/bazel/example/using-bzlmod/hello_p4runtime.cc index 779c2f3d..aa39ab15 100644 --- a/bazel/example/using-bzlmod/hello_p4runtime.cc +++ b/bazel/example/using-bzlmod/hello_p4runtime.cc @@ -1,3 +1,19 @@ +// Copyright 2024 Steffen Smolka +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 + #include #include "google/protobuf/text_format.h" diff --git a/bazel/example/using-workspace/hello_p4runtime.cc b/bazel/example/using-workspace/hello_p4runtime.cc index 779c2f3d..aa39ab15 100644 --- a/bazel/example/using-workspace/hello_p4runtime.cc +++ b/bazel/example/using-workspace/hello_p4runtime.cc @@ -1,3 +1,19 @@ +// Copyright 2024 Steffen Smolka +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 + #include #include "google/protobuf/text_format.h" diff --git a/codegen/Dockerfile b/codegen/Dockerfile index 6aab1a1f..dd96829c 100644 --- a/codegen/Dockerfile +++ b/codegen/Dockerfile @@ -1,3 +1,19 @@ +# Copyright 2020 Antonin Bas +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + FROM p4lang/third-party:latest LABEL maintainer="P4 API Working Group " LABEL description="Dockerfile used for CI testing of p4lang/p4runtime" diff --git a/codegen/compile_protos.sh b/codegen/compile_protos.sh index 486e21f9..9b08fac4 100755 --- a/codegen/compile_protos.sh +++ b/codegen/compile_protos.sh @@ -1,4 +1,20 @@ #!/usr/bin/env bash +# Copyright 2020 Antonin Bas +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + # This ensures that the P4Runtime Protobuf files are correct and compile with # the protoc compiler (CPP, gRPC, Python and Go). diff --git a/codegen/update.sh b/codegen/update.sh index 084bc07c..9861324c 100755 --- a/codegen/update.sh +++ b/codegen/update.sh @@ -1,4 +1,20 @@ #!/usr/bin/env bash +# Copyright 2020 Yi Tseng +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + set -e diff --git a/docs/tools/Makefile b/docs/tools/Makefile index 1cda9b14..40d55719 100644 --- a/docs/tools/Makefile +++ b/docs/tools/Makefile @@ -1,3 +1,19 @@ +# Copyright 2025 Davide Scano +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + all: docker build -t p4rt-asciidoc -f Dockerfile.asciidoc . - docker tag p4rt-asciidoc p4lang/p4rt-asciidoc:latest \ No newline at end of file + docker tag p4rt-asciidoc p4lang/p4rt-asciidoc:latest diff --git a/docs/v1/Makefile b/docs/v1/Makefile index afa30127..290e34de 100644 --- a/docs/v1/Makefile +++ b/docs/v1/Makefile @@ -1,3 +1,19 @@ +# Copyright 2018 Antonin Bas +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + SPEC=P4Runtime-Spec ROUGE_STYLE=github @@ -34,4 +50,4 @@ images: build_spec_with_images: images all clean: - /bin/rm -rf build resources/figs/*.png resources/figs/*.svg \ No newline at end of file + /bin/rm -rf build resources/figs/*.png resources/figs/*.svg diff --git a/docs/v1/resources/theme/p4-stylesheet.css b/docs/v1/resources/theme/p4-stylesheet.css index 0ee77e01..4fc604ad 100644 --- a/docs/v1/resources/theme/p4-stylesheet.css +++ b/docs/v1/resources/theme/p4-stylesheet.css @@ -1,4 +1,5 @@ @import url(//cdnjs.cloudflare.com/ajax/libs/font-awesome/3.2.0/css/font-awesome.css); +/* SPDX-License-Identifier: MIT */ /* normalize.css v2.1.1 | MIT License | git.io/normalize */ /* ========================================================================== HTML5 display definitions ========================================================================== */ /** Correct `block` display not defined in IE 8/9. */ @@ -640,4 +641,4 @@ h2 { color: #030303; border-bottom: 1px solid #dddddd; } .quoteblock blockquote { background: url('../images/github/blockquote-arrow.png?1372292342') 0 2px no-repeat; padding-left: 1em; } -.sidebarblock > .content > .title { margin-top: -20px; margin-right: -20px; margin-left: -20px; margin-bottom: 20px; padding: 1em; font-size: 0.8em; background: #eaeaea; } \ No newline at end of file +.sidebarblock > .content > .title { margin-top: -20px; margin-right: -20px; margin-left: -20px; margin-bottom: 20px; padding: 1em; font-size: 0.8em; background: #eaeaea; } diff --git a/docs/v1/resources/theme/p4-theme.yml b/docs/v1/resources/theme/p4-theme.yml index 0f4a9993..11ee1779 100644 --- a/docs/v1/resources/theme/p4-theme.yml +++ b/docs/v1/resources/theme/p4-theme.yml @@ -1,3 +1,19 @@ +# Copyright 2025 Davide Scano +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + extends: ~ font: catalog: diff --git a/proto/p4/config/v1/p4info.proto b/proto/p4/config/v1/p4info.proto index 8119be17..9596d490 100644 --- a/proto/p4/config/v1/p4info.proto +++ b/proto/p4/config/v1/p4info.proto @@ -1,4 +1,4 @@ -// Copyright 2013-present Barefoot Networks, Inc. +// Copyright 2013 Barefoot Networks, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; diff --git a/proto/p4/config/v1/p4types.proto b/proto/p4/config/v1/p4types.proto index ff317b68..b0f9a721 100644 --- a/proto/p4/config/v1/p4types.proto +++ b/proto/p4/config/v1/p4types.proto @@ -1,4 +1,4 @@ -// Copyright 2013-present Barefoot Networks, Inc. +// Copyright 2013 Barefoot Networks, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; diff --git a/proto/p4/v1/p4data.proto b/proto/p4/v1/p4data.proto index f5b80a9e..cdcd62ff 100644 --- a/proto/p4/v1/p4data.proto +++ b/proto/p4/v1/p4data.proto @@ -1,4 +1,4 @@ -// Copyright 2013-present Barefoot Networks, Inc. +// Copyright 2013 Barefoot Networks, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; diff --git a/proto/p4/v1/p4runtime.proto b/proto/p4/v1/p4runtime.proto index 0f4b89d1..74addb3e 100755 --- a/proto/p4/v1/p4runtime.proto +++ b/proto/p4/v1/p4runtime.proto @@ -11,6 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; diff --git a/proto/p4runtime_deps.bzl b/proto/p4runtime_deps.bzl index 60802a8b..1fcb21bc 100644 --- a/proto/p4runtime_deps.bzl +++ b/proto/p4runtime_deps.bzl @@ -1,3 +1,19 @@ +# Copyright 2020 Steffen Smolka +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + """Load dependencies needed to compile p4runtime as a 3rd-party consumer.""" load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") diff --git a/py/pyproject.toml b/py/pyproject.toml index 993e0455..5367d237 100644 --- a/py/pyproject.toml +++ b/py/pyproject.toml @@ -1,3 +1,19 @@ +# Copyright 2022 Antonin Bas +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + [build-system] requires = [ "setuptools", diff --git a/py/setup.py b/py/setup.py index 1abbd068..39bc471e 100644 --- a/py/setup.py +++ b/py/setup.py @@ -1,3 +1,19 @@ +# Copyright 2020 Yi Tseng +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + import setuptools if __name__ == "__main__": diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 8afef638..f695f161 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,3 +1,19 @@ +# Copyright 2024 Campbell He +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + [package] name = "p4runtime" version = "1.4.0" diff --git a/tools/asciidoclint.py b/tools/asciidoclint.py index 3a8b31ae..c1d30134 100755 --- a/tools/asciidoclint.py +++ b/tools/asciidoclint.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright 2024 +# Copyright 2024 Davide Scano # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 # DISCLAIMER: This is a work in progress. This linter was written specifically From c25f121ba971ef4b394f961f4143c899bf80f944 Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Thu, 13 Feb 2025 16:16:22 -0500 Subject: [PATCH 2/2] Update auto-generated files Signed-off-by: Andy Fingerhut --- go/p4/config/v1/p4info.pb.go | 4 +++- go/p4/config/v1/p4types.pb.go | 4 +++- go/p4/v1/p4data.pb.go | 4 +++- go/p4/v1/p4runtime.pb.go | 2 ++ go/p4/v1/p4runtime_grpc.pb.go | 2 ++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/go/p4/config/v1/p4info.pb.go b/go/p4/config/v1/p4info.pb.go index 43c261fc..f6d3e134 100644 --- a/go/p4/config/v1/p4info.pb.go +++ b/go/p4/config/v1/p4info.pb.go @@ -1,4 +1,4 @@ -// Copyright 2013-present Barefoot Networks, Inc. +// Copyright 2013 Barefoot Networks, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 // Code generated by protoc-gen-go. DO NOT EDIT. // versions: diff --git a/go/p4/config/v1/p4types.pb.go b/go/p4/config/v1/p4types.pb.go index fff41698..abb4d924 100644 --- a/go/p4/config/v1/p4types.pb.go +++ b/go/p4/config/v1/p4types.pb.go @@ -1,4 +1,4 @@ -// Copyright 2013-present Barefoot Networks, Inc. +// Copyright 2013 Barefoot Networks, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 // Code generated by protoc-gen-go. DO NOT EDIT. // versions: diff --git a/go/p4/v1/p4data.pb.go b/go/p4/v1/p4data.pb.go index f287fb09..32ab5cb7 100644 --- a/go/p4/v1/p4data.pb.go +++ b/go/p4/v1/p4data.pb.go @@ -1,4 +1,4 @@ -// Copyright 2013-present Barefoot Networks, Inc. +// Copyright 2013 Barefoot Networks, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 // Code generated by protoc-gen-go. DO NOT EDIT. // versions: diff --git a/go/p4/v1/p4runtime.pb.go b/go/p4/v1/p4runtime.pb.go index 7683d886..4cb97fdc 100644 --- a/go/p4/v1/p4runtime.pb.go +++ b/go/p4/v1/p4runtime.pb.go @@ -11,6 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 // Code generated by protoc-gen-go. DO NOT EDIT. // versions: diff --git a/go/p4/v1/p4runtime_grpc.pb.go b/go/p4/v1/p4runtime_grpc.pb.go index dfecbe32..56871b97 100644 --- a/go/p4/v1/p4runtime_grpc.pb.go +++ b/go/p4/v1/p4runtime_grpc.pb.go @@ -11,6 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: