From 6894add397d084afd1a90c4ae3fd5e75ed857ac2 Mon Sep 17 00:00:00 2001 From: Marvin Gudel Date: Wed, 12 Nov 2025 16:03:21 +0100 Subject: [PATCH 1/6] Add minimal rust workflow, add .gitignore Signed-off-by: Marvin Gudel --- .github/workflows/rust.yml | 42 ++++++++++++++++++++++++++++++++++++++ .gitignore | 2 ++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/rust.yml create mode 100644 .gitignore diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..ae4f410 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,42 @@ +name: Rust + +on: + push: + branches: [ "main" ] + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +env: + CARGO_TERM_COLOR: always + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust (stable) with components + uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + - name: rustfmt check + run: cargo fmt --all -- --check + - name: clippy (deny warnings) + run: | + cargo clippy --all-targets --all-features -- -D warnings + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust (stable) with components + uses: dtolnay/rust-toolchain@stable + - name: Cargo Build + run: cargo build --verbose + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust (stable) with components + uses: dtolnay/rust-toolchain@stable + - name: Run tests + run: cargo test --all-features --verbose diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2c96eb1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +target/ +Cargo.lock From 35509a9b349a9997a0a4556081f5d152783e6a2a Mon Sep 17 00:00:00 2001 From: Marvin Gudel Date: Thu, 13 Nov 2025 16:27:28 +0100 Subject: [PATCH 2/6] Apply formatting suggestions, fix clippy warnings Signed-off-by: Marvin Gudel --- src/message/control.rs | 4 ++-- src/message/firmware_update/activate_fw.rs | 2 +- src/message/firmware_update/apply_complete.rs | 2 +- src/message/firmware_update/get_fw_params.rs | 6 +++--- src/message/firmware_update/get_status.rs | 2 +- src/message/firmware_update/pass_component.rs | 6 +++--- src/message/firmware_update/query_devid.rs | 2 +- src/message/firmware_update/request_cancel.rs | 2 +- src/message/firmware_update/request_fw_data.rs | 6 +++--- src/message/firmware_update/request_update.rs | 4 ++-- src/message/firmware_update/transfer_complete.rs | 2 +- src/message/firmware_update/update_component.rs | 4 ++-- src/message/firmware_update/verify_complete.rs | 2 +- 13 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/message/control.rs b/src/message/control.rs index e836b08..7ce815c 100644 --- a/src/message/control.rs +++ b/src/message/control.rs @@ -2,8 +2,8 @@ use crate::error::PldmError; use crate::protocol::base::{ - InstanceId, PldmControlCmd, PldmMsgHeader, PldmMsgType, PldmSupportedType, - TransferOperationFlag, TransferRespFlag, PLDM_MSG_HEADER_LEN, + InstanceId, PLDM_MSG_HEADER_LEN, PldmControlCmd, PldmMsgHeader, PldmMsgType, PldmSupportedType, + TransferOperationFlag, TransferRespFlag, }; use crate::protocol::version::{PldmVersion, ProtocolVersionStr, Ver32}; use zerocopy::{FromBytes, Immutable, IntoBytes}; diff --git a/src/message/firmware_update/activate_fw.rs b/src/message/firmware_update/activate_fw.rs index b7b083a..d2662ec 100644 --- a/src/message/firmware_update/activate_fw.rs +++ b/src/message/firmware_update/activate_fw.rs @@ -1,7 +1,7 @@ // Licensed under the Apache-2.0 license use crate::protocol::base::{ - InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, PLDM_MSG_HEADER_LEN, + InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType, }; use crate::protocol::firmware_update::FwUpdateCmd; use zerocopy::{FromBytes, Immutable, IntoBytes}; diff --git a/src/message/firmware_update/apply_complete.rs b/src/message/firmware_update/apply_complete.rs index 8c6d6b0..d83b2d7 100644 --- a/src/message/firmware_update/apply_complete.rs +++ b/src/message/firmware_update/apply_complete.rs @@ -2,7 +2,7 @@ use crate::error::PldmError; use crate::protocol::base::{ - InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, PLDM_MSG_HEADER_LEN, + InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType, }; use crate::protocol::firmware_update::{ComponentActivationMethods, FwUpdateCmd}; use zerocopy::{FromBytes, Immutable, IntoBytes}; diff --git a/src/message/firmware_update/get_fw_params.rs b/src/message/firmware_update/get_fw_params.rs index c18d92d..1b74310 100644 --- a/src/message/firmware_update/get_fw_params.rs +++ b/src/message/firmware_update/get_fw_params.rs @@ -2,11 +2,11 @@ use crate::codec::{PldmCodec, PldmCodecError}; use crate::protocol::base::{ - InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, PLDM_MSG_HEADER_LEN, + InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType, }; use crate::protocol::firmware_update::{ - ComponentParameterEntry, FirmwareDeviceCapability, FwUpdateCmd, PldmFirmwareString, - MAX_COMPONENT_COUNT, PLDM_FWUP_IMAGE_SET_VER_STR_MAX_LEN, + ComponentParameterEntry, FirmwareDeviceCapability, FwUpdateCmd, MAX_COMPONENT_COUNT, + PLDM_FWUP_IMAGE_SET_VER_STR_MAX_LEN, PldmFirmwareString, }; use zerocopy::{FromBytes, Immutable, IntoBytes}; diff --git a/src/message/firmware_update/get_status.rs b/src/message/firmware_update/get_status.rs index 42c5baa..aeccf55 100644 --- a/src/message/firmware_update/get_status.rs +++ b/src/message/firmware_update/get_status.rs @@ -2,7 +2,7 @@ use crate::error::PldmError; use crate::protocol::base::{ - InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, PLDM_MSG_HEADER_LEN, + InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType, }; use crate::protocol::firmware_update::{FirmwareDeviceState, FwUpdateCmd, UpdateOptionFlags}; use zerocopy::{FromBytes, Immutable, IntoBytes}; diff --git a/src/message/firmware_update/pass_component.rs b/src/message/firmware_update/pass_component.rs index a8d2b7c..baf214c 100644 --- a/src/message/firmware_update/pass_component.rs +++ b/src/message/firmware_update/pass_component.rs @@ -2,12 +2,12 @@ use crate::codec::{PldmCodec, PldmCodecError}; use crate::protocol::base::{ - InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, TransferRespFlag, - PLDM_MSG_HEADER_LEN, + InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType, + TransferRespFlag, }; use crate::protocol::firmware_update::{ ComponentClassification, ComponentResponse, ComponentResponseCode, FwUpdateCmd, - PldmFirmwareString, PLDM_FWUP_IMAGE_SET_VER_STR_MAX_LEN, + PLDM_FWUP_IMAGE_SET_VER_STR_MAX_LEN, PldmFirmwareString, }; use zerocopy::{FromBytes, Immutable, IntoBytes}; diff --git a/src/message/firmware_update/query_devid.rs b/src/message/firmware_update/query_devid.rs index d17a980..a5c2595 100644 --- a/src/message/firmware_update/query_devid.rs +++ b/src/message/firmware_update/query_devid.rs @@ -3,7 +3,7 @@ use crate::codec::{PldmCodec, PldmCodecError}; use crate::error::PldmError; use crate::protocol::base::{ - InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, PLDM_MSG_HEADER_LEN, + InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType, }; use crate::protocol::firmware_update::{Descriptor, FwUpdateCmd}; use zerocopy::{FromBytes, Immutable, IntoBytes}; diff --git a/src/message/firmware_update/request_cancel.rs b/src/message/firmware_update/request_cancel.rs index 905698f..794680b 100644 --- a/src/message/firmware_update/request_cancel.rs +++ b/src/message/firmware_update/request_cancel.rs @@ -2,7 +2,7 @@ use crate::error::PldmError; use crate::protocol::base::{ - InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, PLDM_MSG_HEADER_LEN, + InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType, }; use crate::protocol::firmware_update::FwUpdateCmd; use zerocopy::{FromBytes, Immutable, IntoBytes}; diff --git a/src/message/firmware_update/request_fw_data.rs b/src/message/firmware_update/request_fw_data.rs index 432b124..89d42e4 100644 --- a/src/message/firmware_update/request_fw_data.rs +++ b/src/message/firmware_update/request_fw_data.rs @@ -2,7 +2,7 @@ use crate::codec::{PldmCodec, PldmCodecError}; use crate::protocol::base::{ - InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, PLDM_MSG_HEADER_LEN, + InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType, }; use crate::protocol::firmware_update::FwUpdateCmd; use zerocopy::{FromBytes, Immutable, IntoBytes}; @@ -56,8 +56,8 @@ impl RequestFirmwareDataResponse<'_> { pub fn new( instance_id: InstanceId, completion_code: u8, - data: &[u8], - ) -> RequestFirmwareDataResponse { + data: &'_ [u8], + ) -> RequestFirmwareDataResponse<'_> { let fixed = RequestFirmwareDataResponseFixed { hdr: PldmMsgHeader::new( instance_id, diff --git a/src/message/firmware_update/request_update.rs b/src/message/firmware_update/request_update.rs index 9c8b154..ce8785d 100644 --- a/src/message/firmware_update/request_update.rs +++ b/src/message/firmware_update/request_update.rs @@ -2,10 +2,10 @@ use crate::codec::{PldmCodec, PldmCodecError}; use crate::protocol::base::{ - InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, PLDM_MSG_HEADER_LEN, + InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType, }; use crate::protocol::firmware_update::{ - FwUpdateCmd, PldmFirmwareString, PLDM_FWUP_IMAGE_SET_VER_STR_MAX_LEN, + FwUpdateCmd, PLDM_FWUP_IMAGE_SET_VER_STR_MAX_LEN, PldmFirmwareString, }; use zerocopy::{FromBytes, Immutable, IntoBytes}; diff --git a/src/message/firmware_update/transfer_complete.rs b/src/message/firmware_update/transfer_complete.rs index fae32c8..604c83b 100644 --- a/src/message/firmware_update/transfer_complete.rs +++ b/src/message/firmware_update/transfer_complete.rs @@ -2,7 +2,7 @@ use crate::error::PldmError; use crate::protocol::base::{ - InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, PLDM_MSG_HEADER_LEN, + InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType, }; use crate::protocol::firmware_update::FwUpdateCmd; use zerocopy::{FromBytes, Immutable, IntoBytes}; diff --git a/src/message/firmware_update/update_component.rs b/src/message/firmware_update/update_component.rs index 30f5384..9f48b5d 100644 --- a/src/message/firmware_update/update_component.rs +++ b/src/message/firmware_update/update_component.rs @@ -2,11 +2,11 @@ use crate::codec::{PldmCodec, PldmCodecError}; use crate::protocol::base::{ - InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, PLDM_MSG_HEADER_LEN, + InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType, }; use crate::protocol::firmware_update::{ ComponentClassification, ComponentCompatibilityResponse, ComponentCompatibilityResponseCode, - FwUpdateCmd, PldmFirmwareString, UpdateOptionFlags, PLDM_FWUP_IMAGE_SET_VER_STR_MAX_LEN, + FwUpdateCmd, PLDM_FWUP_IMAGE_SET_VER_STR_MAX_LEN, PldmFirmwareString, UpdateOptionFlags, }; use zerocopy::{FromBytes, Immutable, IntoBytes}; diff --git a/src/message/firmware_update/verify_complete.rs b/src/message/firmware_update/verify_complete.rs index 1e7b0cb..1abbebe 100644 --- a/src/message/firmware_update/verify_complete.rs +++ b/src/message/firmware_update/verify_complete.rs @@ -2,7 +2,7 @@ use crate::error::PldmError; use crate::protocol::base::{ - InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, PLDM_MSG_HEADER_LEN, + InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType, }; use crate::protocol::firmware_update::FwUpdateCmd; use zerocopy::{FromBytes, Immutable, IntoBytes}; From 07273ba2d77f1e5b8bc1b3a00b0b16880f4de2dd Mon Sep 17 00:00:00 2001 From: Marvin Gudel Date: Mon, 17 Nov 2025 13:30:11 +0100 Subject: [PATCH 3/6] Better workflow name Signed-off-by: Marvin Gudel --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ae4f410..2e1c20c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,4 +1,4 @@ -name: Rust +name: Lint, Build and Test on: push: From b4b008d77b63ed20b75423d4b7801a8267d757a0 Mon Sep 17 00:00:00 2001 From: Marvin Gudel Date: Mon, 17 Nov 2025 13:38:35 +0100 Subject: [PATCH 4/6] Add caching for rust builds Signed-off-by: Marvin Gudel --- .github/workflows/rust.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2e1c20c..5e50757 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -18,6 +18,8 @@ jobs: uses: dtolnay/rust-toolchain@stable with: components: clippy, rustfmt + - name: Cache cargo registry and build + uses: Swatinem/rust-cache@v2 - name: rustfmt check run: cargo fmt --all -- --check - name: clippy (deny warnings) @@ -30,6 +32,8 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust (stable) with components uses: dtolnay/rust-toolchain@stable + - name: Cache cargo registry and build + uses: Swatinem/rust-cache@v2 - name: Cargo Build run: cargo build --verbose test: @@ -38,5 +42,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust (stable) with components uses: dtolnay/rust-toolchain@stable + - name: Cache cargo registry and build + uses: Swatinem/rust-cache@v2 - name: Run tests run: cargo test --all-features --verbose From a22297d230bc8dd913e6a9c485342faa31d7dba8 Mon Sep 17 00:00:00 2001 From: Marvin Gudel Date: Mon, 17 Nov 2025 14:15:12 +0100 Subject: [PATCH 5/6] Rename build and test workflow file Signed-off-by: Marvin Gudel --- .github/workflows/{rust.yml => ci.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{rust.yml => ci.yml} (100%) diff --git a/.github/workflows/rust.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/rust.yml rename to .github/workflows/ci.yml From e581c42423ad63341415c3f30d7483dcfc40b880 Mon Sep 17 00:00:00 2001 From: Marvin Gudel Date: Mon, 17 Nov 2025 15:31:41 +0100 Subject: [PATCH 6/6] Add license check workflow, fix license headers Signed-off-by: Marvin Gudel --- .github/workflows/license.yml | 11 +++++++++++ .licenserc.yaml | 12 ++++++++++++ src/codec.rs | 14 +++++++++++++- src/error.rs | 14 +++++++++++++- src/lib.rs | 14 +++++++++++++- src/message/control.rs | 14 +++++++++++++- src/message/firmware_update/activate_fw.rs | 14 +++++++++++++- src/message/firmware_update/apply_complete.rs | 14 +++++++++++++- src/message/firmware_update/get_fw_params.rs | 14 +++++++++++++- src/message/firmware_update/get_status.rs | 14 +++++++++++++- src/message/firmware_update/mod.rs | 14 +++++++++++++- src/message/firmware_update/pass_component.rs | 14 +++++++++++++- src/message/firmware_update/query_devid.rs | 14 +++++++++++++- src/message/firmware_update/request_cancel.rs | 14 +++++++++++++- src/message/firmware_update/request_fw_data.rs | 14 +++++++++++++- src/message/firmware_update/request_update.rs | 14 +++++++++++++- src/message/firmware_update/transfer_complete.rs | 14 +++++++++++++- src/message/firmware_update/update_component.rs | 14 +++++++++++++- src/message/firmware_update/verify_complete.rs | 14 +++++++++++++- src/message/mod.rs | 14 +++++++++++++- src/protocol/base.rs | 14 +++++++++++++- src/protocol/firmware_update.rs | 14 +++++++++++++- src/protocol/mod.rs | 14 +++++++++++++- src/protocol/version.rs | 14 +++++++++++++- src/util/fw_component.rs | 14 +++++++++++++- src/util/mctp_transport.rs | 14 +++++++++++++- src/util/mod.rs | 14 +++++++++++++- 27 files changed, 348 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/license.yml create mode 100644 .licenserc.yaml diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml new file mode 100644 index 0000000..b79837e --- /dev/null +++ b/.github/workflows/license.yml @@ -0,0 +1,11 @@ +name: License Check + +on: pull_request + +jobs: + license: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: License Eye Header + uses: apache/skywalking-eyes@v0.8.0 diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 0000000..4a9d582 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,12 @@ +header: + license: + spdx-id: Apache-2.0 + # No copyright owner until this has been clarified + # copyright-owner: OpenPRoT a Series of LF Projects, LLC + copyright-year: 2025 + software-name: pldm-lib + + paths: + - '**/*.rs' + + comment: on-failure diff --git a/src/codec.rs b/src/codec.rs index 15df19f..7e44b9b 100644 --- a/src/codec.rs +++ b/src/codec.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use zerocopy::{FromBytes, Immutable, IntoBytes}; diff --git a/src/error.rs b/src/error.rs index 17dd6a2..f63b1b7 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. #[derive(Debug, Clone, PartialEq)] pub enum PldmError { diff --git a/src/lib.rs b/src/lib.rs index 660c84c..0e2a808 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. #![cfg_attr(target_arch = "riscv32", no_std)] diff --git a/src/message/control.rs b/src/message/control.rs index 7ce815c..5771cc2 100644 --- a/src/message/control.rs +++ b/src/message/control.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::error::PldmError; use crate::protocol::base::{ diff --git a/src/message/firmware_update/activate_fw.rs b/src/message/firmware_update/activate_fw.rs index d2662ec..5de0c38 100644 --- a/src/message/firmware_update/activate_fw.rs +++ b/src/message/firmware_update/activate_fw.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::protocol::base::{ InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType, diff --git a/src/message/firmware_update/apply_complete.rs b/src/message/firmware_update/apply_complete.rs index d83b2d7..93f64d9 100644 --- a/src/message/firmware_update/apply_complete.rs +++ b/src/message/firmware_update/apply_complete.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::error::PldmError; use crate::protocol::base::{ diff --git a/src/message/firmware_update/get_fw_params.rs b/src/message/firmware_update/get_fw_params.rs index 1b74310..b84b77e 100644 --- a/src/message/firmware_update/get_fw_params.rs +++ b/src/message/firmware_update/get_fw_params.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::codec::{PldmCodec, PldmCodecError}; use crate::protocol::base::{ diff --git a/src/message/firmware_update/get_status.rs b/src/message/firmware_update/get_status.rs index aeccf55..6549008 100644 --- a/src/message/firmware_update/get_status.rs +++ b/src/message/firmware_update/get_status.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::error::PldmError; use crate::protocol::base::{ diff --git a/src/message/firmware_update/mod.rs b/src/message/firmware_update/mod.rs index 859a174..739e54d 100644 --- a/src/message/firmware_update/mod.rs +++ b/src/message/firmware_update/mod.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. pub mod activate_fw; pub mod apply_complete; diff --git a/src/message/firmware_update/pass_component.rs b/src/message/firmware_update/pass_component.rs index baf214c..65de6bd 100644 --- a/src/message/firmware_update/pass_component.rs +++ b/src/message/firmware_update/pass_component.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::codec::{PldmCodec, PldmCodecError}; use crate::protocol::base::{ diff --git a/src/message/firmware_update/query_devid.rs b/src/message/firmware_update/query_devid.rs index a5c2595..14bad32 100644 --- a/src/message/firmware_update/query_devid.rs +++ b/src/message/firmware_update/query_devid.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::codec::{PldmCodec, PldmCodecError}; use crate::error::PldmError; diff --git a/src/message/firmware_update/request_cancel.rs b/src/message/firmware_update/request_cancel.rs index 794680b..7a1bc62 100644 --- a/src/message/firmware_update/request_cancel.rs +++ b/src/message/firmware_update/request_cancel.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::error::PldmError; use crate::protocol::base::{ diff --git a/src/message/firmware_update/request_fw_data.rs b/src/message/firmware_update/request_fw_data.rs index 89d42e4..b5fc953 100644 --- a/src/message/firmware_update/request_fw_data.rs +++ b/src/message/firmware_update/request_fw_data.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::codec::{PldmCodec, PldmCodecError}; use crate::protocol::base::{ diff --git a/src/message/firmware_update/request_update.rs b/src/message/firmware_update/request_update.rs index ce8785d..1813256 100644 --- a/src/message/firmware_update/request_update.rs +++ b/src/message/firmware_update/request_update.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::codec::{PldmCodec, PldmCodecError}; use crate::protocol::base::{ diff --git a/src/message/firmware_update/transfer_complete.rs b/src/message/firmware_update/transfer_complete.rs index 604c83b..4bdadb8 100644 --- a/src/message/firmware_update/transfer_complete.rs +++ b/src/message/firmware_update/transfer_complete.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::error::PldmError; use crate::protocol::base::{ diff --git a/src/message/firmware_update/update_component.rs b/src/message/firmware_update/update_component.rs index 9f48b5d..8260fee 100644 --- a/src/message/firmware_update/update_component.rs +++ b/src/message/firmware_update/update_component.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::codec::{PldmCodec, PldmCodecError}; use crate::protocol::base::{ diff --git a/src/message/firmware_update/verify_complete.rs b/src/message/firmware_update/verify_complete.rs index 1abbebe..8778762 100644 --- a/src/message/firmware_update/verify_complete.rs +++ b/src/message/firmware_update/verify_complete.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::error::PldmError; use crate::protocol::base::{ diff --git a/src/message/mod.rs b/src/message/mod.rs index 0fbfacb..7ca58e0 100644 --- a/src/message/mod.rs +++ b/src/message/mod.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. pub mod control; pub mod firmware_update; diff --git a/src/protocol/base.rs b/src/protocol/base.rs index ccb757a..f8852b3 100644 --- a/src/protocol/base.rs +++ b/src/protocol/base.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::error::PldmError; use bitfield::bitfield; diff --git a/src/protocol/firmware_update.rs b/src/protocol/firmware_update.rs index f959f50..7c303a5 100644 --- a/src/protocol/firmware_update.rs +++ b/src/protocol/firmware_update.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::codec::{PldmCodec, PldmCodecError}; use crate::error::PldmError; diff --git a/src/protocol/mod.rs b/src/protocol/mod.rs index 1622365..ea2f1f5 100644 --- a/src/protocol/mod.rs +++ b/src/protocol/mod.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. pub mod base; pub mod firmware_update; diff --git a/src/protocol/version.rs b/src/protocol/version.rs index bdbe090..d3e9f3f 100644 --- a/src/protocol/version.rs +++ b/src/protocol/version.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::error::PldmError; use core::convert::TryFrom; diff --git a/src/util/fw_component.rs b/src/util/fw_component.rs index 17ff3ff..45b22b8 100644 --- a/src/util/fw_component.rs +++ b/src/util/fw_component.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::message::firmware_update::get_fw_params::FirmwareParameters; use crate::protocol::firmware_update::{ diff --git a/src/util/mctp_transport.rs b/src/util/mctp_transport.rs index 166163a..f9897ef 100644 --- a/src/util/mctp_transport.rs +++ b/src/util/mctp_transport.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. use crate::error::UtilError; use crate::protocol::base::PLDM_MSG_HEADER_LEN; diff --git a/src/util/mod.rs b/src/util/mod.rs index e435fb3..31e42ac 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -1,4 +1,16 @@ -// Licensed under the Apache-2.0 license +// Copyright 2025 +// +// 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. pub mod fw_component; pub mod mctp_transport;