• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//foundation/communication/netmanager_base/netmanager_base_config.gni")
16
17config("statistics_config") {
18  visibility = [ ":statistics" ]
19
20  include_dirs = [
21    "include",
22    "include/context",
23    "$NETMANAGER_BASE_ROOT/utils/log/include",
24  ]
25
26  cflags = [
27    "-fstack-protector-strong",
28    "-D_FORTIFY_SOURCE=2",
29    "-O2",
30  ]
31
32  cflags_cc = [
33    "-fstack-protector-strong",
34    "-D_FORTIFY_SOURCE=2",
35    "-O2",
36  ]
37}
38
39ohos_shared_library("statistics") {
40  sanitize = {
41    cfi = true
42    cfi_cross_dso = true
43    boundary_sanitize = true
44    all_ubsan = true
45    debug = false
46  }
47
48  sources = [
49    "src/context/get_cellular_rxbytes_context.cpp",
50    "src/context/get_iface_rxbytes_context.cpp",
51    "src/context/get_iface_stats_context.cpp",
52    "src/context/get_iface_uid_stats_context.cpp",
53    "src/context/get_sockfd_rxbytes_context.cpp",
54    "src/context/get_uid_rxbytes_context.cpp",
55    "src/context/update_iface_stats_context.cpp",
56    "src/statistics_async_work.cpp",
57    "src/statistics_callback_observer.cpp",
58    "src/statistics_exec.cpp",
59    "src/statistics_module.cpp",
60    "src/statistics_observer_wrapper.cpp",
61  ]
62
63  configs = [ ":statistics_config" ]
64
65  deps = [
66    "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if",
67    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
68    "$NETMANAGER_BASE_ROOT/utils/napi_utils:napi_utils",
69  ]
70
71  external_deps = [
72    "c_utils:utils",
73    "hilog:libhilog",
74    "ipc:ipc_core",
75    "napi:ace_napi",
76  ]
77
78  relative_install_dir = "module/net"
79  part_name = "netmanager_base"
80  subsystem_name = "communication"
81}
82