From c345fe66bd3d704c52a8c811c763fce53de6f243 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 2 May 2025 22:14:02 +0200 Subject: [PATCH] updated to ZenohUTransport and updated copyright notices --- CMakeLists.txt | 27 +-- pubsub/CMakeLists.txt | 37 ++-- pubsub/include/common.h | 27 +-- pubsub/src/UTransportDomainSockets.cpp | 208 ------------------ pubsub/src/UTransportDomainSockets.h | 48 ---- pubsub/src/main_pub.cpp | 48 ++-- pubsub/src/main_sub.cpp | 48 ++-- .../DEFAULT_CONFIG.json5 | 0 rpc/CMakeLists.txt | 27 +-- rpc/include/common.h | 27 +-- rpc/src/main_rpc_client.cpp | 35 +-- rpc/src/main_rpc_server.cpp | 34 +-- 12 files changed, 111 insertions(+), 455 deletions(-) delete mode 100644 pubsub/src/UTransportDomainSockets.cpp delete mode 100644 pubsub/src/UTransportDomainSockets.h rename {rpc/resources => resources}/DEFAULT_CONFIG.json5 (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index d06b51f..0511324 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,25 +1,14 @@ -# Copyright (c) 2024 General Motors GTO LLC +# SPDX-FileCopyrightText: 2025 Contributors to the Eclipse Foundation # -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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 +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. # -# http://www.apache.org/licenses/LICENSE-2.0 +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-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-FileType: SOURCE -# SPDX-FileCopyrightText: 2024 General Motors GTO LLC -# SPDX-License-Identifier: Apache-2.0 - cmake_minimum_required(VERSION 3.20) project(samples VERSION 0.1.0 LANGUAGES CXX DESCRIPTION "C++ Examples for uProtocol") diff --git a/pubsub/CMakeLists.txt b/pubsub/CMakeLists.txt index e7e2547..f45adc0 100644 --- a/pubsub/CMakeLists.txt +++ b/pubsub/CMakeLists.txt @@ -1,25 +1,14 @@ -# Copyright (c) 2024 General Motors GTO LLC +# SPDX-FileCopyrightText: 2025 Contributors to the Eclipse Foundation # -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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 +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. # -# http://www.apache.org/licenses/LICENSE-2.0 +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-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-FileType: SOURCE -# SPDX-FileCopyrightText: 2024 General Motors GTO LLC -# SPDX-License-Identifier: Apache-2.0 - cmake_minimum_required(VERSION 3.20) project(pubsub VERSION 0.1.0 LANGUAGES CXX) @@ -30,23 +19,25 @@ find_package(up-transport-zenoh-cpp REQUIRED) add_definitions(-DSPDLOG_FMT_EXTERNAL) # sub -add_executable(sub src/main_sub.cpp src/UTransportDomainSockets.cpp) +add_executable(sub src/main_sub.cpp) target_link_libraries(sub PUBLIC spdlog::spdlog up-cpp::up-cpp - up-core-api::up-core-api) + up-core-api::up-core-api + up-transport-zenoh-cpp::up-transport-zenoh-cpp) target_include_directories(sub PRIVATE include) # pub -add_executable(pub src/main_pub.cpp src/UTransportDomainSockets.cpp) +add_executable(pub src/main_pub.cpp) target_link_libraries(pub PUBLIC spdlog::spdlog up-cpp::up-cpp - up-core-api::up-core-api) + up-core-api::up-core-api + up-transport-zenoh-cpp::up-transport-zenoh-cpp) target_include_directories(pub PRIVATE include) diff --git a/pubsub/include/common.h b/pubsub/include/common.h index 0a3ecca..4403650 100644 --- a/pubsub/include/common.h +++ b/pubsub/include/common.h @@ -1,25 +1,14 @@ -// Copyright (c) 2024 General Motors GTO LLC +// SPDX-FileCopyrightText: 2025 Contributors to the Eclipse Foundation // -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. // -// http://www.apache.org/licenses/LICENSE-2.0 +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: Apache-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-FileType: SOURCE -// SPDX-FileCopyrightText: 2024 General Motors GTO LLC -// SPDX-License-Identifier: Apache-2.0 - #ifndef PUBSUB_COMMON_H #define PUBSUB_COMMON_H diff --git a/pubsub/src/UTransportDomainSockets.cpp b/pubsub/src/UTransportDomainSockets.cpp deleted file mode 100644 index 0aa3881..0000000 --- a/pubsub/src/UTransportDomainSockets.cpp +++ /dev/null @@ -1,208 +0,0 @@ -// SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation -// -// See the NOTICE file(s) distributed with this work for additional -// information regarding copyright ownership. -// -// This program and the accompanying materials are made available under the -// terms of the Apache License Version 2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: Apache-2.0 - -#include "UTransportDomainSockets.h" - -#include -#include -#include -#include -#include -#include -#include - -UTransportDomainSockets::UTransportDomainSockets(const v1::UUri& uuri) - : transport::UTransport(uuri), - send_count_(0), - fdClient_(-1), - stopFlag_(false) { - socketPath_ = std::filesystem::canonical("/proc/self/exe") - .parent_path() - .append(uuri.authority_name()); - fdSocket_ = socket(AF_UNIX, SOCK_STREAM, 0); - if (fdSocket_ == -1) { - spdlog::error("Error on socket creation\n"); - } -} - -UTransportDomainSockets::~UTransportDomainSockets() { - stopFlag_ = true; - - if (listener_thread_.joinable()) { - listener_thread_.join(); - } - if (fdClient_ != -1) { - spdlog::info("Closing client socket"); - close(fdClient_); - } - if (fdSocket_ != -1) { - spdlog::info("Closing socket"); - close(fdSocket_); - unlink(socketPath_.c_str()); - } -} - -v1::UStatus UTransportDomainSockets::sendImpl(const v1::UMessage& message) { - v1::UStatus retval; - - retval.set_code(v1::UCode::UNKNOWN); - - if (fdClient_ == -1) { - // Bind the socket, and await client connection - int len = 0; - struct sockaddr_un local; - int nIncomingConnections = 1; - - local.sun_family = AF_UNIX; - strcpy(local.sun_path, socketPath_.c_str()); - unlink(local.sun_path); - len = strlen(local.sun_path) + sizeof(local.sun_family); - if (bind(fdSocket_, (struct sockaddr*)&local, len) != 0) { - spdlog::error("Error on binding socket. Errno={}\n", errno); - return retval; - } - - if (listen(fdSocket_, nIncomingConnections) != 0) { - spdlog::error("Error on listen call. Errno={}\n", errno); - return retval; - } - - spdlog::info("Waiting for client connection\n"); - fdClient_ = accept(fdSocket_, NULL, NULL); - if (fdClient_ == -1) { - spdlog::error("Error on accept call. Errno={}\n", errno); - return retval; - } - } - - // serialize the message - size_t serializedSize = message.ByteSizeLong(); - std::string serializedMessage(serializedSize, 0); - bool success = - message.SerializeToArray(serializedMessage.data(), serializedSize); - spdlog::debug("Serialized message size: {} ; Serialized data: {}", - serializedSize, serializedMessage); - - // Send the serialized UMessage - spdlog::debug("Sending message number {}", send_count_.load()); - - // send length of serialized message - if (::send(fdClient_, &serializedSize, sizeof(serializedSize), 0) == -1) { - spdlog::error("Error sending message size. Errno={}\n", errno); - return retval; - } - // send serialized message - if (::send(fdClient_, serializedMessage.data(), serializedSize, 0) == -1) { - spdlog::error("Error sending serialized data. Errno={}\n", errno); - return retval; - } - - send_count_++; - retval.set_code(v1::UCode::OK); - return retval; -} - -v1::UStatus UTransportDomainSockets::registerListenerImpl( - CallableConn&& listener, const v1::UUri& source_filter /* topic */, - std::optional&& sink_filter) { - v1::UStatus retval; - - // Start the listener thread (if not already started) - if (!listener_thread_.joinable()) { - listener_thread_ = - std::thread(&UTransportDomainSockets::listenThread, this); - } - - // Verify the listener thread is running - if (!listener_thread_.joinable()) { - spdlog::error("Failed to start listener thread. Errno={}\n", errno); - retval.set_code(v1::UCode::UNKNOWN); - return retval; - } - - // Register the listener (place it in the map) - size_t hash = std::hash{}( - uprotocol::datamodel::serializer::uri::AsString::serialize( - source_filter)); - cbListeners_[hash] = listener; - - retval.set_code(v1::UCode::OK); - return retval; -} - -void UTransportDomainSockets::listenThread() { - while (!stopFlag_) { - int data_len; - int connected; - struct sockaddr_un addr; - size_t serializedSize; - - addr.sun_family = AF_UNIX; - strcpy(addr.sun_path, socketPath_.c_str()); - data_len = strlen(addr.sun_path) + sizeof(addr.sun_family); - - spdlog::info("Client: Trying to connect..."); - if ((connected = - connect(fdSocket_, (struct sockaddr*)&addr, data_len)) == -1) { - spdlog::info("Client: Error on connect call. Errno = {}", errno); - sleep(1); - } else { - spdlog::info("Client: Connected"); - } - - while (!stopFlag_ && (connected != -1)) { - v1::UMessage receivedMessage; - - // receive length of serialized message - if (recv(fdSocket_, &serializedSize, sizeof(serializedSize), 0) == - -1) { - spdlog::error("Error receiving message size. Errno={}\n", - errno); - break; - } - - // receive serialized message - std::string serializedMessage(serializedSize, 0); - if (recv(fdSocket_, serializedMessage.data(), serializedSize, 0) == - -1) { - spdlog::error("Error receiving serialized data. Errno={}\n", - errno); - break; - } - - if (!receivedMessage.ParseFromString(serializedMessage)) { - spdlog::error("Failed to parse received message"); - break; - } else { - spdlog::debug("Received message number {}", send_count_.load()); - send_count_++; - notifyListener(receivedMessage); - } - } - } -} - -void UTransportDomainSockets::notifyListener(const v1::UMessage& message) { - // Look up the listener in the map based on the resource_id (each topic has - // a unique resource_id that is used as the key in the map) - size_t hash = std::hash{}( - uprotocol::datamodel::serializer::uri::AsString::serialize( - message.attributes().source())); - auto it = cbListeners_.find(hash); - if (it != cbListeners_.end()) { - it->second(message); - } else { - spdlog::error( - "No listener found for message with source: {}", - uprotocol::datamodel::serializer::uri::AsString::serialize( - message.attributes().source())); - } -} diff --git a/pubsub/src/UTransportDomainSockets.h b/pubsub/src/UTransportDomainSockets.h deleted file mode 100644 index c9dfec9..0000000 --- a/pubsub/src/UTransportDomainSockets.h +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation -// -// See the NOTICE file(s) distributed with this work for additional -// information regarding copyright ownership. -// -// This program and the accompanying materials are made available under the -// terms of the Apache License Version 2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: Apache-2.0 - -#ifndef UTRANSPORT_DOMAIN_SOCKETS_H -#define UTRANSPORT_DOMAIN_SOCKETS_H - -#include - -#include -#include - -using namespace uprotocol; - -class UTransportDomainSockets : public transport::UTransport { -public: - explicit UTransportDomainSockets(const v1::UUri& uuri); - virtual ~UTransportDomainSockets(); - -private: - int fdSocket_; // socket handle - int fdClient_; // connected client handle - std::filesystem::path - socketPath_; // path to the socket file (same as executable) - std::atomic send_count_; - std::thread listener_thread_; - bool stopFlag_; // stop flag for listener thread - std::map cbListeners_; - - [[nodiscard]] v1::UStatus sendImpl(const v1::UMessage& message) override; - - [[nodiscard]] v1::UStatus registerListenerImpl( - CallableConn&& listener, const v1::UUri& source_filter, - std::optional&& sink_filter) override; - - void notifyListener(const v1::UMessage& message); - void listenThread(); // listen for incoming messages (thread) - void cleanupListener(const CallableConn& listener) override {} -}; // class UTransportDomainSockets - -#endif // UTRANSPORT_DOMAIN_SOCKETS_H \ No newline at end of file diff --git a/pubsub/src/main_pub.cpp b/pubsub/src/main_pub.cpp index e4f4a37..144475f 100644 --- a/pubsub/src/main_pub.cpp +++ b/pubsub/src/main_pub.cpp @@ -1,44 +1,32 @@ -/* - * Copyright (c) 2024 General Motors GTO LLC - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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-FileType: SOURCE - * SPDX-FileCopyrightText: 2024 General Motors GTO LLC - * SPDX-License-Identifier: Apache-2.0 - */ +// SPDX-FileCopyrightText: 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: Apache-2.0 +// #include #include #include #include +#include #include #include -#include -#include #include -#include "UTransportDomainSockets.h" #include "common.h" using namespace uprotocol::datamodel::builder; using namespace uprotocol::communication; using namespace uprotocol::v1; +using ZenohUTransport = uprotocol::transport::ZenohUTransport; + bool gTerminate = false; void signalHandler(int signal) { @@ -75,6 +63,12 @@ int main(int argc, char** argv) { (void)argc; (void)argv; + if (argc < 2) { + std::cout << "No Zenoh config has been provided" << std::endl; + std::cout << "Usage: pub " << std::endl; + return 1; + } + signal(SIGINT, signalHandler); signal(SIGPIPE, signalHandler); @@ -84,7 +78,7 @@ int main(int argc, char** argv) { auto topic_time = getTimeUUri(); auto topic_random = getRandomUUri(); auto topic_counter = getCounterUUri(); - auto transport = std::make_shared(source); + auto transport = std::make_shared(source, argv[1]); Publisher publish_time(transport, std::move(topic_time), UPayloadFormat::UPAYLOAD_FORMAT_TEXT); Publisher publish_random(transport, std::move(topic_random), diff --git a/pubsub/src/main_sub.cpp b/pubsub/src/main_sub.cpp index a63966b..b80ac84 100644 --- a/pubsub/src/main_sub.cpp +++ b/pubsub/src/main_sub.cpp @@ -1,41 +1,29 @@ - -/* - * Copyright (c) 2024 General Motors GTO LLC - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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-FileType: SOURCE - * SPDX-FileCopyrightText: 2024 General Motors GTO LLC - * SPDX-License-Identifier: Apache-2.0 - */ - +// SPDX-FileCopyrightText: 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: Apache-2.0 +// #include #include #include +#include #include #include -#include "UTransportDomainSockets.h" #include "common.h" using namespace uprotocol::communication; using namespace uprotocol::v1; +using ZenohUTransport = uprotocol::transport::ZenohUTransport; + bool gTerminate = false; void signalHandler(int signal) { @@ -80,6 +68,12 @@ int main(int argc, char** argv) { (void)argc; (void)argv; + if (argc < 2) { + std::cout << "No Zenoh config has been provided" << std::endl; + std::cout << "Usage: sub " << std::endl; + return 1; + } + signal(SIGINT, signalHandler); signal(SIGPIPE, signalHandler); @@ -88,7 +82,7 @@ int main(int argc, char** argv) { auto topic_time = getTimeUUri(); auto topic_random = getRandomUUri(); auto topic_counter = getCounterUUri(); - auto transport = std::make_shared(source); + auto transport = std::make_shared(source, argv[1]); auto resTime = Subscriber::subscribe(transport, std::move(topic_time), onReceiveTime); diff --git a/rpc/resources/DEFAULT_CONFIG.json5 b/resources/DEFAULT_CONFIG.json5 similarity index 100% rename from rpc/resources/DEFAULT_CONFIG.json5 rename to resources/DEFAULT_CONFIG.json5 diff --git a/rpc/CMakeLists.txt b/rpc/CMakeLists.txt index 77a8e9f..578bbfd 100644 --- a/rpc/CMakeLists.txt +++ b/rpc/CMakeLists.txt @@ -1,25 +1,14 @@ -# Copyright (c) 2024 General Motors GTO LLC +# SPDX-FileCopyrightText: 2025 Contributors to the Eclipse Foundation # -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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 +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. # -# http://www.apache.org/licenses/LICENSE-2.0 +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-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-FileType: SOURCE -# SPDX-FileCopyrightText: 2024 General Motors GTO LLC -# SPDX-License-Identifier: Apache-2.0 - cmake_minimum_required(VERSION 3.20) project(rpc VERSION 0.1.0 LANGUAGES CXX) diff --git a/rpc/include/common.h b/rpc/include/common.h index b90b7a8..039a3d2 100644 --- a/rpc/include/common.h +++ b/rpc/include/common.h @@ -1,25 +1,14 @@ -// Copyright (c) 2024 General Motors GTO LLC +// SPDX-FileCopyrightText: 2025 Contributors to the Eclipse Foundation // -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. // -// http://www.apache.org/licenses/LICENSE-2.0 +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: Apache-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-FileType: SOURCE -// SPDX-FileCopyrightText: 2024 General Motors GTO LLC -// SPDX-License-Identifier: Apache-2.0 - #ifndef RPC_COMMON_H #define RPC_COMMON_H diff --git a/rpc/src/main_rpc_client.cpp b/rpc/src/main_rpc_client.cpp index f5d9146..8ff6ada 100644 --- a/rpc/src/main_rpc_client.cpp +++ b/rpc/src/main_rpc_client.cpp @@ -1,26 +1,15 @@ -/* - * Copyright (c) 2024 General Motors GTO LLC - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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-FileType: SOURCE - * SPDX-FileCopyrightText: 2024 General Motors GTO LLC - * SPDX-License-Identifier: Apache-2.0 - */ +// SPDX-FileCopyrightText: 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: Apache-2.0 +// + #include #include #include diff --git a/rpc/src/main_rpc_server.cpp b/rpc/src/main_rpc_server.cpp index 1c3345d..ba485c8 100644 --- a/rpc/src/main_rpc_server.cpp +++ b/rpc/src/main_rpc_server.cpp @@ -1,26 +1,14 @@ -/* - * Copyright (c) 2024 General Motors GTO LLC - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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-FileType: SOURCE - * SPDX-FileCopyrightText: 2024 General Motors GTO LLC - * SPDX-License-Identifier: Apache-2.0 - */ +// SPDX-FileCopyrightText: 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: Apache-2.0 +// #include #include #include