# Copyright (c) 2024 Huawei Device Co., Ltd. # 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. import("//build/ohos.gni") import("//foundation/communication/netmanager_ext/netmanager_ext_config.gni") ohos_shared_library("netfirewall") { include_dirs = [ "include", "include/context", ] sources = [ "src/context/add_netfirewall_rule_context.cpp", "src/context/delete_netfirewall_rule_context.cpp", "src/context/get_all_intercept_records_context.cpp", "src/context/get_all_netfirewall_rules_context.cpp", "src/context/get_netfirewall_policy_context.cpp", "src/context/get_netfirewall_rule_context.cpp", "src/context/net_firewall_param_check.cpp", "src/context/net_firewall_rule_parse.cpp", "src/context/set_netfirewall_policy_context.cpp", "src/context/update_netfirewall_rule_context.cpp", "src/net_firewall_async_work.cpp", "src/net_firewall_exec.cpp", "src/netfirewall_module.cpp", ] cflags = [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] deps = [ "$NETMANAGER_EXT_ROOT/interfaces/innerkits/netfirewallclient:netfirewall_manager_if" ] external_deps = [ "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "netmanager_base:napi_utils", "netmanager_base:net_manager_common", "netmanager_base:net_native_manager_if", ] relative_install_dir = "module/net" part_name = "netmanager_ext" subsystem_name = "communication" }