From 3b477129dd6b6ee4276237610ff1e0113b81216f Mon Sep 17 00:00:00 2001 From: Motomu Utsumi Date: Wed, 8 Nov 2023 15:22:02 +0900 Subject: [PATCH] Remove service/native/include/Common.h Move the remaining contents of Common.h to clatutils_test.cpp and remove Common.h Bug: 217624062 Test: TH Change-Id: Ie0615b42a3a1bf4c07e9196128fe0850a448fb35 --- service/native/include/Common.h | 24 ------------------- service/native/libs/libclat/Android.bp | 4 ++++ .../native/libs/libclat/clatutils_test.cpp | 4 ++++ 3 files changed, 8 insertions(+), 24 deletions(-) delete mode 100644 service/native/include/Common.h diff --git a/service/native/include/Common.h b/service/native/include/Common.h deleted file mode 100644 index b5f5f0adbf..0000000000 --- a/service/native/include/Common.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * 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. - */ - -#pragma once -// TODO: deduplicate with the constants in NetdConstants.h. -#include -#include "clat_mark.h" - -using aidl::android::net::INetd; - -static_assert(INetd::CLAT_MARK == CLAT_MARK, "must be 0xDEADC1A7"); diff --git a/service/native/libs/libclat/Android.bp b/service/native/libs/libclat/Android.bp index 996706ee11..5c6b12395d 100644 --- a/service/native/libs/libclat/Android.bp +++ b/service/native/libs/libclat/Android.bp @@ -43,11 +43,15 @@ cc_test { srcs: [ "clatutils_test.cpp", ], + header_libs: [ + "bpf_connectivity_headers", + ], static_libs: [ "libbase", "libclat", "libip_checksum", "libnetd_test_tun_interface", + "netd_aidl_interface-lateststable-ndk", ], shared_libs: [ "liblog", diff --git a/service/native/libs/libclat/clatutils_test.cpp b/service/native/libs/libclat/clatutils_test.cpp index f4f97dbdf9..cf6492fb16 100644 --- a/service/native/libs/libclat/clatutils_test.cpp +++ b/service/native/libs/libclat/clatutils_test.cpp @@ -26,6 +26,10 @@ extern "C" { #include "checksum.h" } +#include +#include "clat_mark.h" +static_assert(aidl::android::net::INetd::CLAT_MARK == CLAT_MARK, "must be 0xDEADC1A7"); + // Default translation parameters. static const char kIPv4LocalAddr[] = "192.0.0.4";