diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5e50757 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: Lint, Build and Test + +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: Cache cargo registry and build + uses: Swatinem/rust-cache@v2 + - 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: Cache cargo registry and build + uses: Swatinem/rust-cache@v2 + - 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: Cache cargo registry and build + uses: Swatinem/rust-cache@v2 + - name: Run tests + run: cargo test --all-features --verbose 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/.gitignore b/.gitignore new file mode 100644 index 0000000..2c96eb1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +target/ +Cargo.lock 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 e836b08..5771cc2 100644 --- a/src/message/control.rs +++ b/src/message/control.rs @@ -1,9 +1,21 @@ -// 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::{ - 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..5de0c38 100644 --- a/src/message/firmware_update/activate_fw.rs +++ b/src/message/firmware_update/activate_fw.rs @@ -1,7 +1,19 @@ -// 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, 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..93f64d9 100644 --- a/src/message/firmware_update/apply_complete.rs +++ b/src/message/firmware_update/apply_complete.rs @@ -1,8 +1,20 @@ -// 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::{ - 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..b84b77e 100644 --- a/src/message/firmware_update/get_fw_params.rs +++ b/src/message/firmware_update/get_fw_params.rs @@ -1,12 +1,24 @@ -// 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::{ - 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..6549008 100644 --- a/src/message/firmware_update/get_status.rs +++ b/src/message/firmware_update/get_status.rs @@ -1,8 +1,20 @@ -// 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::{ - 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/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 a8d2b7c..65de6bd 100644 --- a/src/message/firmware_update/pass_component.rs +++ b/src/message/firmware_update/pass_component.rs @@ -1,13 +1,25 @@ -// 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::{ - 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..14bad32 100644 --- a/src/message/firmware_update/query_devid.rs +++ b/src/message/firmware_update/query_devid.rs @@ -1,9 +1,21 @@ -// 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; 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..7a1bc62 100644 --- a/src/message/firmware_update/request_cancel.rs +++ b/src/message/firmware_update/request_cancel.rs @@ -1,8 +1,20 @@ -// 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::{ - 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..b5fc953 100644 --- a/src/message/firmware_update/request_fw_data.rs +++ b/src/message/firmware_update/request_fw_data.rs @@ -1,8 +1,20 @@ -// 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::{ - 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 +68,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..1813256 100644 --- a/src/message/firmware_update/request_update.rs +++ b/src/message/firmware_update/request_update.rs @@ -1,11 +1,23 @@ -// 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::{ - 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..4bdadb8 100644 --- a/src/message/firmware_update/transfer_complete.rs +++ b/src/message/firmware_update/transfer_complete.rs @@ -1,8 +1,20 @@ -// 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::{ - 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..8260fee 100644 --- a/src/message/firmware_update/update_component.rs +++ b/src/message/firmware_update/update_component.rs @@ -1,12 +1,24 @@ -// 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::{ - 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..8778762 100644 --- a/src/message/firmware_update/verify_complete.rs +++ b/src/message/firmware_update/verify_complete.rs @@ -1,8 +1,20 @@ -// 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::{ - 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/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;