Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
be8fab9
build(datarouter): make configurator_commands and libdrconfighdrs public
rmaddikery Nov 19, 2026
c70e0c5
build(datarouter): make unixdomain_common public
rmaddikery Nov 19, 2026
68db466
build(datarouter): drop visibility entries naming an external package
rmaddikery Nov 19, 2026
c2bdbe8
fix(datarouter): make data_router_cfg.h self-contained
rmaddikery Nov 19, 2026
8de1121
build(datarouter): make dlt_filetransfer_trigger_lib public
rmaddikery Nov 19, 2026
d761836
docs(datarouter): rename DatarouterConf in IPC diagram
rmaddikery Nov 19, 2026
0235e58
build(datarouter): alias libdrconfighdrs to data_router_cfg
rmaddikery Nov 19, 2026
3e1d2e2
build(datarouter): use data_router_cfg and its full include path in-repo
rmaddikery Nov 19, 2026
a41c6fd
build(datarouter): drop stale filetransfer message visibility
rmaddikery Nov 19, 2026
591d692
build(datarouter): add unixdomain_internal and use it in-repo
rmaddikery Nov 19, 2026
7db9c05
refactor(datarouter): narrow unix_domain_common.h to the client API
rmaddikery Nov 19, 2026
20925c2
build(datarouter): use implementation_deps in unixdomain_common
rmaddikery Nov 19, 2026
2e34cb9
refactor(datarouter): move unix domain API to unix_domain namespace
rmaddikery Nov 19, 2026
4acead9
docs(datarouter): use an identifier as the IPC diagram node name
rmaddikery Nov 19, 2026
286a93b
build(datarouter): remove unused libstructdatasource and its header
rmaddikery Nov 20, 2026
6fad91f
docs(datarouter): document wire layout of SocketMessangerHeader
rmaddikery Nov 20, 2026
e8759d0
Adds deprecation warning for legacy label
rmaddikery Nov 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 51 additions & 27 deletions score/datarouter/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,38 @@ cc_library(
cc_library(
name = "unixdomain_common",
srcs = [
"include/unix_domain/unix_domain_internal.h",
"src/unix_domain/unix_domain_common.cpp",
],
hdrs = [
"include/unix_domain/unix_domain_common.h",
],
features = COMPILER_WARNING_FEATURES,
implementation_deps = [
"@score_baselibs//score/os:socket",
"@score_baselibs//score/os/utils:signal",
"@score_baselibs//score/quality/compiler_warnings",
],
strip_include_prefix = "include",
visibility = [
"//platform/aas/log_and_trace/datarouterconf:__subpackages__",
"@score_logging//score/datarouter:__subpackages__",
# Public: socket send/receive helpers used by datarouter clients.
visibility = ["//visibility:public"],
deps = [
"@score_baselibs//score/language/futurecpp",
],
)

cc_library(
name = "unixdomain_internal",
hdrs = [
"include/unix_domain/unix_domain_internal.h",
],
features = COMPILER_WARNING_FEATURES,
strip_include_prefix = "include",
visibility = ["@score_logging//score/datarouter:__subpackages__"],
deps = [
":unixdomain_common",
"@score_baselibs//score/language/futurecpp",
"@score_baselibs//score/os:socket",
"@score_baselibs//score/os/utils:signal",
"@score_baselibs//score/quality/compiler_warnings",
],
)

Expand All @@ -96,8 +112,12 @@ cc_library(
visibility = ["//visibility:private"],
deps = [
":unixdomain_common",
":unixdomain_internal",
"@score_baselibs//score/language/futurecpp",
"@score_baselibs//score/os:pthread",
"@score_baselibs//score/os:socket",
"@score_baselibs//score/os:unistd",
"@score_baselibs//score/os/utils:signal",
],
)

Expand All @@ -117,9 +137,13 @@ cc_library(
],
deps = [
":unixdomain_common",
":unixdomain_internal",
"//score/datarouter/src/configuration/dynamic_config:i_session",
"@score_baselibs//score/os:pthread",
"@score_baselibs//score/os:socket",
"@score_baselibs//score/os:sys_poll",
"@score_baselibs//score/os:unistd",
"@score_baselibs//score/os/utils:signal",
"@score_baselibs//score/quality/compiler_warnings",
],
)
Expand All @@ -137,9 +161,13 @@ cc_library(
visibility = ["//score/datarouter/test:__subpackages__"],
deps = [
":unixdomain_client",
":unixdomain_internal",
"//score/datarouter/src/configuration/dynamic_config:i_session",
"@score_baselibs//score/os:pthread",
"@score_baselibs//score/os:socket",
"@score_baselibs//score/os:sys_poll",
"@score_baselibs//score/os:unistd",
"@score_baselibs//score/os/utils:signal",
"@score_baselibs//score/quality/compiler_warnings",
],
)
Expand All @@ -158,6 +186,7 @@ cc_library(
],
deps = [
":unixdomain_common",
":unixdomain_internal",
"//score/datarouter/src/configuration/dynamic_config:i_session",
"@googletest//:gtest_main",
],
Expand Down Expand Up @@ -281,13 +310,21 @@ cc_library(
## ---------------------------------------------------------------------------

cc_library(
name = "libdrconfighdrs",
name = "data_router_cfg",
hdrs = ["include/daemon/data_router_cfg.h"],
features = COMPILER_WARNING_FEATURES,
strip_include_prefix = "include/daemon",
visibility = [
"//platform/aas/log_and_trace/datarouterconf:__subpackages__",
],
# Transitional: keeps the short include "data_router_cfg.h" working until consumers use the full path.
includes = ["include/daemon"],
# Public: socket and client names shared with datarouter clients.
visibility = ["//visibility:public"],
)

# Legacy label, kept until consumers depend on :data_router_cfg.
alias(
name = "libdrconfighdrs",
actual = ":data_router_cfg",
deprecation = "Usage of target '@score_logging//score/datarouter:libdrconfighdrs' is deprecated. Please use '@score_logging//score/datarouter:data_router_cfg' instead.",
visibility = ["//visibility:public"],
Comment thread
hoppe-and-dreams marked this conversation as resolved.
Resolved
)

## ===========================================================================
Expand All @@ -310,17 +347,6 @@ cc_library(
],
)

cc_library(
name = "libstructdatasource",
hdrs = ["include/StructDataSource"],
features = COMPILER_WARNING_FEATURES,
strip_include_prefix = "include",
visibility = ["//visibility:private"],
deps = [
":libdrconfighdrs",
],
)

## ===========================================================================
## Datarouter
## ---------------------------------------------------------------------------
Expand All @@ -330,10 +356,8 @@ cc_library(
hdrs = [
"include/daemon/configurator_commands.h",
],
visibility = [
"//platform/aas/log_and_trace/datarouterconf:__subpackages__",
"@score_logging//score/datarouter:__subpackages__",
],
# Public: command and return codes shared with datarouter clients.
visibility = ["//visibility:public"],
)

filegroup(
Expand Down Expand Up @@ -580,10 +604,10 @@ cc_library(
visibility = ["//visibility:private"],
deps = [
":configurator_commands",
":data_router_cfg",
":datarouter_feature_config",
":dlt_log_channel_lib",
":dltserver_common",
":libdrconfighdrs",
":log_entry_deserialization",
":log_sender",
":logchannel_utility",
Expand Down Expand Up @@ -1036,12 +1060,12 @@ cc_library(
":udpoutput_mock",
# buildifier on
":unixdomain_mock",
":data_router_cfg",
":datarouter_feature_config_testing",
":datarouter_types",
":diagnostic_job_handler_mock",
":diagnostic_job_parser_mock",
":dlt_log_server_mock",
":libdrconfighdrs",
":log_entry_deserialization",
":log_sender_mock",
":logparser_testing",
Expand Down
12 changes: 2 additions & 10 deletions score/datarouter/dlt_filetransfer_trigger_lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,8 @@ cc_library(
"include/ifile_transfer.h",
],
features = COMPILER_WARNING_FEATURES,
visibility = [
"//platform/aas/log_and_trace/datarouterconf/src/services:__pkg__",
"//platform/aas/pas/crash_handler:__pkg__",
"//platform/aas/test/pas:__subpackages__",
"//score/datarouter/test:__subpackages__",
"//score/test/component:__subpackages__",
"@score_baselibs//score/logging:__pkg__",
],
# Public: client API to trigger DLT file transfers.
visibility = ["//visibility:public"],
deps = [
"filetransfer_message_types",
"//score/mw/log/legacy_non_verbose_api",
Expand All @@ -49,8 +43,6 @@ cc_library(
],
features = COMPILER_WARNING_FEATURES,
visibility = [
"//platform/aas/log_and_trace/datarouterconf/src/filetransfer:__subpackages__",
"//platform/aas/pas/crash_handler:__subpackages__",
"//score/mw/log/legacy_non_verbose_api:__pkg__",
"@score_logging//score/datarouter:__subpackages__",
],
Expand Down
2 changes: 1 addition & 1 deletion score/datarouter/doc/design/uml/detail-ipc.puml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ node "Datarouter" {
component UnixDomainServer
}

node "DatarouterConf" {
node "DatarouterConfiguratorClient" {
component UnixDomainClient as config_client
}

Expand Down
5 changes: 4 additions & 1 deletion score/datarouter/doc/design/uml/package-datarouter.puml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ package "score::platform::internal" {
class MessagePassingServer
class MessagePassingServer::ISession
class UnixDomainClient
class UnixDomainSockAddr
class UnixDomainServer
class UnixDomainServer::SessionHandle
class UnixDomainServer::SessionWrapper
}

package "score::platform::unix_domain" {
class UnixDomainSockAddr
}

package "score::logging::dltserver" {
class DltLogServer
class DltVerboseHandler
Expand Down
14 changes: 0 additions & 14 deletions score/datarouter/include/StructDataSource

This file was deleted.

6 changes: 4 additions & 2 deletions score/datarouter/include/daemon/data_router_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#ifndef SCORE_DATAROUTER_INCLUDE_DAEMON_DATA_ROUTER_CFG_H
#define SCORE_DATAROUTER_INCLUDE_DAEMON_DATA_ROUTER_CFG_H

#include <string>

#include <score/string_view.hpp>

namespace score
Expand All @@ -22,8 +24,8 @@ namespace logging
{
namespace config
{
static const std::string kSocketAddress{"datarouter_socket"};
static constexpr const score::cpp::string_view kDltConfigClientName{"_dlt_config"};
inline const std::string kSocketAddress{"datarouter_socket"};
inline constexpr score::cpp::string_view kDltConfigClientName{"_dlt_config"};
} // namespace config
} // namespace logging
} // namespace score
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#ifndef SCORE_DATAROUTER_INCLUDE_UNIX_DOMAIN_UNIX_DOMAIN_CLIENT_H
#define SCORE_DATAROUTER_INCLUDE_UNIX_DOMAIN_UNIX_DOMAIN_CLIENT_H

#include "unix_domain/unix_domain_common.h"
#include "unix_domain/unix_domain_internal.h"

#include <unistd.h>

Expand Down
30 changes: 2 additions & 28 deletions score/datarouter/include/unix_domain/unix_domain_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,14 @@
#include <score/span.hpp>
#include <score/string_view.hpp>

#include "score/os/utils/signal.h"

namespace score
{
namespace platform
{
namespace internal
namespace unix_domain
{
using SharedMemoryFileHandle = std::int32_t;

enum class MessageType : std::uint8_t
{
kDefault = 0,
kSharedMemoryFileHandle = 1,
};

struct SocketMessangerHeader // __attribute__((packed)) // TODO: deal with packed
{
uint16_t len;
MessageType type;
std::int32_t pid;
};

class UnixDomainSockAddr
{
public:
Expand Down Expand Up @@ -74,9 +59,6 @@ void SendSocketMessage(std::int32_t connection_file_descriptor,
std::string_view message,
score::cpp::optional<SharedMemoryFileHandle> file_handle = score::cpp::nullopt);

/* @data - data to be send over the socket */
void SendAncillaryDataOverSocket(int connection_file_descriptor, score::cpp::span<std::uint8_t> data);

/* Returns: Message string. Possibly zero-sized when pinging or timeout occurs. score::cpp::nullopt is returned when error
* occurs.
* @ancillary_data_process - callback may be used to convert ancillary data to file descriptor but it is not the only
Expand All @@ -87,15 +69,7 @@ std::optional<std::string> RecvSocketMessage(
std::int32_t socket_fd,
AncillaryDataFileHandleReceptionCallback ancillary_data_process = AncillaryDataFileHandleReceptionCallback{});

std::optional<std::string> RecvSocketMessage(
std::int32_t socket_fd,
score::cpp::optional<SharedMemoryFileHandle>& file_handle,
score::cpp::optional<std::int32_t>& peer_pid,
AncillaryDataFileHandleReceptionCallback ancillary_data_process = AncillaryDataFileHandleReceptionCallback{});

void SetupSignals(const std::unique_ptr<score::os::Signal>& signal);

} // namespace internal
} // namespace unix_domain
} // namespace platform
} // namespace score

Expand Down
Loading
Loading