1# Copyright (c) 2024 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# http://www.apache.org/licenses/LICENSE-2.0
6# Unless required by applicable law or agreed to in writing, software
7# distributed under the License is distributed on an "AS IS" BASIS,
8# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9# See the License for the specific language governing permissions and
10# limitations under the License.
11
12import("//build/ohos.gni")
13import("//foundation/communication/netmanager_ext/netmanager_ext_config.gni")
14
15ohos_shared_library("netfirewall") {
16  include_dirs = [
17    "include",
18    "include/context",
19  ]
20
21  sources = [
22    "src/context/add_netfirewall_rule_context.cpp",
23    "src/context/delete_netfirewall_rule_context.cpp",
24    "src/context/get_all_intercept_records_context.cpp",
25    "src/context/get_all_netfirewall_rules_context.cpp",
26    "src/context/get_netfirewall_policy_context.cpp",
27    "src/context/get_netfirewall_rule_context.cpp",
28    "src/context/net_firewall_param_check.cpp",
29    "src/context/net_firewall_rule_parse.cpp",
30    "src/context/set_netfirewall_policy_context.cpp",
31    "src/context/update_netfirewall_rule_context.cpp",
32    "src/net_firewall_async_work.cpp",
33    "src/net_firewall_exec.cpp",
34    "src/netfirewall_module.cpp",
35  ]
36
37  cflags = [
38    "-fstack-protector-strong",
39    "-D_FORTIFY_SOURCE=2",
40    "-O2",
41  ]
42
43  cflags_cc = [
44    "-fstack-protector-strong",
45    "-D_FORTIFY_SOURCE=2",
46    "-O2",
47  ]
48
49  deps = [ "$NETMANAGER_EXT_ROOT/interfaces/innerkits/netfirewallclient:netfirewall_manager_if" ]
50
51  external_deps = [
52    "c_utils:utils",
53    "hilog:libhilog",
54    "ipc:ipc_core",
55    "napi:ace_napi",
56    "netmanager_base:napi_utils",
57    "netmanager_base:net_manager_common",
58    "netmanager_base:net_native_manager_if",
59  ]
60
61  relative_install_dir = "module/net"
62  part_name = "netmanager_ext"
63  subsystem_name = "communication"
64}
65