Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
superwhd committed Mar 2, 2023
1 parent f062996 commit 5f323b2
Show file tree
Hide file tree
Showing 21 changed files with 1,932 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ jobs:
brew reinstall boost cmake cpputest dbus jsoncpp ninja protobuf pkg-config
- name: Build
run: |
OTBR_OPTIONS='-DOTBR_BORDER_AGENT=OFF -DOTBR_MDNS=OFF -DOT_FIREWALL=OFF -DOTBR_DBUS=OFF' ./script/test build
OTBR_OPTIONS='-DOTBR_BORDER_AGENT=OFF -DOTBR_MDNS=OFF -DOT_FIREWALL=OFF -DOTBR_DBUS=OFF -DOTBR_DNS_DSO=OFF' ./script/test build
10 changes: 10 additions & 0 deletions etc/cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ if(OTBR_NAT64)
target_compile_definitions(otbr-config INTERFACE OTBR_ENABLE_NAT64=1)
endif()

option(OTBR_DNS_DSO "Enable DSO" OFF)
if(OTBR_DNS_DSO)
target_compile_definitions(otbr-config INTERFACE OTBR_ENABLE_DNS_DSO=1)
endif()

option(OTBR_SRP_REPLICATION "Enable SRP Replication" OFF)
if(OTBR_SRP_REPLICATION)
target_compile_definitions(otbr-config INTERFACE OTBR_ENABLE_SRP_REPLICATION=1)
endif()

option(OTBR_VENDOR_INFRA_LINK_SELECT "Enable Vendor-specific infrastructure link selection rules" OFF)
if(OTBR_VENDOR_INFRA_LINK_SELECT)
target_compile_definitions(otbr-config INTERFACE OTBR_ENABLE_VENDOR_INFRA_LINK_SELECT=1)
Expand Down
3 changes: 2 additions & 1 deletion script/test
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ do_build()
"-DOTBR_WEB=ON"
"-DOTBR_UNSECURE_JOIN=ON"
"-DOTBR_TREL=ON"
"-DOTBR_DNS_DSO=ON"
${otbr_options[@]+"${otbr_options[@]}"}
)

Expand All @@ -148,7 +149,7 @@ do_check()
{
(cd "${OTBR_TOP_BUILDDIR}" \
&& ninja && sudo ninja install \
&& CTEST_OUTPUT_ON_FAILURE=1 ninja test)
&& CTEST_OUTPUT_ON_FAILURE=1 sudo ninja test)
}

do_doxygen()
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ add_subdirectory(common)
if(OTBR_FEATURE_FLAGS)
add_subdirectory(proto)
endif()
add_subdirectory(dso)
add_subdirectory(ncp)
add_subdirectory(sdp_proxy)
add_subdirectory(srpl_dnssd)
add_subdirectory(trel_dnssd)

if(OTBR_DBUS)
Expand Down
1 change: 1 addition & 0 deletions src/agent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ target_link_libraries(otbr-agent PRIVATE
openthread-ftd
openthread-spinel-rcp
openthread-hdlc
otbr-dso
otbr-sdp-proxy
otbr-ncp
otbr-common
Expand Down
6 changes: 6 additions & 0 deletions src/agent/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ Application::Application(const std::string &aInterfaceName,
#if OTBR_ENABLE_VENDOR_SERVER
, mVendorServer(mNcp)
#endif
#if OTBR_ENABLE_DNS_DSO
, mDsoAgent()
#endif
{
OTBR_UNUSED_VARIABLE(aRestListenAddress);
}
Expand All @@ -104,6 +107,9 @@ void Application::Init(void)
#if OTBR_ENABLE_VENDOR_SERVER
mVendorServer.Init();
#endif
#if OTBR_ENABLE_DNS_DSO
mDsoAgent.Init(mNcp.GetInstance(), mBackboneInterfaceName);
#endif
}

void Application::Deinit(void)
Expand Down
4 changes: 4 additions & 0 deletions src/agent/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#if OTBR_ENABLE_VENDOR_SERVER
#include "agent/vendor.hpp"
#endif
#include "dso/dso_transport.hpp"
#include "utils/infra_link_selector.hpp"

namespace otbr {
Expand Down Expand Up @@ -144,6 +145,9 @@ class Application : private NonCopyable
#if OTBR_ENABLE_VENDOR_SERVER
vendor::VendorServer mVendorServer;
#endif
#if OTBR_ENABLE_DNS_DSO
Dso::DsoAgent mDsoAgent;
#endif

static std::atomic_bool sShouldTerminate;
};
Expand Down
1 change: 1 addition & 0 deletions src/border_agent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ add_library(otbr-border-agent
target_link_libraries(otbr-border-agent PRIVATE
$<$<BOOL:${OTBR_MDNS}>:otbr-mdns>
$<$<BOOL:${OTBR_BACKBONE_ROUTER}>:otbr-backbone-router>
otbr-srpl-dnssd
otbr-trel-dnssd
otbr-common
)
3 changes: 3 additions & 0 deletions src/border_agent/border_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ BorderAgent::BorderAgent(otbr::Ncp::ControllerOpenThread &aNcp)
#if OTBR_ENABLE_TREL
, mTrelDnssd(aNcp, *mPublisher)
#endif
#if OTBR_ENABLE_SRP_REPLICATION
, mSrplDnssd(aNcp, *mPublisher)
#endif
{
}

Expand Down
4 changes: 4 additions & 0 deletions src/border_agent/border_agent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "ncp/ncp_openthread.hpp"
#include "sdp_proxy/advertising_proxy.hpp"
#include "sdp_proxy/discovery_proxy.hpp"
#include "srpl_dnssd/srpl_dnssd.hpp"
#include "trel_dnssd/trel_dnssd.hpp"

#ifndef OTBR_VENDOR_NAME
Expand Down Expand Up @@ -144,6 +145,9 @@ class BorderAgent : private NonCopyable
#if OTBR_ENABLE_TREL
TrelDnssd::TrelDnssd mTrelDnssd;
#endif
#if OTBR_ENABLE_SRP_REPLICATION
SrplDnssd::SrplDnssd mSrplDnssd;
#endif

std::string mServiceInstanceName;
};
Expand Down
38 changes: 38 additions & 0 deletions src/dso/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# Copyright (c) 2023, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

add_library(otbr-dso
dso_transport.cpp
dso_transport.hpp
)
target_link_libraries(otbr-dso
PUBLIC
mbedtls
otbr-config
otbr-common
)
Loading

0 comments on commit 5f323b2

Please sign in to comment.