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") 15 16iptables_path = rebase_path("//third_party/iptables") 17exec_script("install.sh", [ "$iptables_path" ]) 18 19config("iptables_config") { 20 cflags = [ 21 "-D_LARGEFILE_SOURCE=1", 22 "-D_LARGE_FILES", 23 "-D_FILE_OFFSET_BITS=64", 24 "-D_REENTRANT", 25 "-DENABLE_IPV4", 26 "-DENABLE_IPV6", 27 "-Wall", 28 "-Wno-error", 29 "-Wno-pointer-arith", 30 "-Wno-sign-compare", 31 "-Wno-unused-parameter", 32 "-Wno-missing-field-initializers", 33 "-Wno-parentheses-equality", 34 "-DNO_SHARED_LIBS=1", 35 "-DALL_INCLUSIVE", 36 "-DXTABLES_INTERNAL", 37 ] 38} 39 40ohos_executable("iptables") { 41 sources = [ 42 "//third_party/iptables/iptables/ip6tables-standalone.c", 43 "//third_party/iptables/iptables/ip6tables.c", 44 "//third_party/iptables/iptables/iptables-restore.c", 45 "//third_party/iptables/iptables/iptables-save.c", 46 "//third_party/iptables/iptables/iptables-standalone.c", 47 "//third_party/iptables/iptables/iptables-xml.c", 48 "//third_party/iptables/iptables/iptables.c", 49 "//third_party/iptables/iptables/xshared.c", 50 "//third_party/iptables/iptables/xtables-legacy-multi.c", 51 ] 52 53 include_dirs = [ 54 "//third_party/iptables", 55 "//third_party/iptables/extensions", 56 "//third_party/iptables/include", 57 "//third_party/iptables/iptables", 58 "//third_party/iptables/libiptc", 59 ] 60 license_file = "//third_party/iptables/COPYING" 61 configs = [ ":iptables_config" ] 62 63 install_enable = true 64 65 deps = [ 66 "//third_party/iptables/extensions:libext", 67 "//third_party/iptables/extensions:libext4", 68 "//third_party/iptables/extensions:libext6", 69 "//third_party/iptables/libiptc:libip4tc", 70 "//third_party/iptables/libiptc:libip6tc", 71 "//third_party/iptables/libxtables:libxtables", 72 ] 73 74 part_name = "iptables" 75 subsystem_name = "thirdparty" 76} 77 78ohos_executable("iptables-save") { 79 sources = [ 80 "//third_party/iptables/iptables/ip6tables-standalone.c", 81 "//third_party/iptables/iptables/ip6tables.c", 82 "//third_party/iptables/iptables/iptables-restore.c", 83 "//third_party/iptables/iptables/iptables-save.c", 84 "//third_party/iptables/iptables/iptables-standalone.c", 85 "//third_party/iptables/iptables/iptables-xml.c", 86 "//third_party/iptables/iptables/iptables.c", 87 "//third_party/iptables/iptables/xshared.c", 88 "//third_party/iptables/iptables/xtables-legacy-multi.c", 89 ] 90 91 include_dirs = [ 92 "//third_party/iptables", 93 "//third_party/iptables/extensions", 94 "//third_party/iptables/include", 95 "//third_party/iptables/iptables", 96 "//third_party/iptables/libiptc", 97 ] 98 configs = [ ":iptables_config" ] 99 100 install_enable = true 101 102 deps = [ 103 "//third_party/iptables/extensions:libext", 104 "//third_party/iptables/extensions:libext4", 105 "//third_party/iptables/extensions:libext6", 106 "//third_party/iptables/libiptc:libip4tc", 107 "//third_party/iptables/libiptc:libip6tc", 108 "//third_party/iptables/libxtables:libxtables", 109 ] 110 111 part_name = "iptables" 112 subsystem_name = "thirdparty" 113} 114 115ohos_executable("iptables-restore") { 116 sources = [ 117 "//third_party/iptables/iptables/ip6tables-standalone.c", 118 "//third_party/iptables/iptables/ip6tables.c", 119 "//third_party/iptables/iptables/iptables-restore.c", 120 "//third_party/iptables/iptables/iptables-save.c", 121 "//third_party/iptables/iptables/iptables-standalone.c", 122 "//third_party/iptables/iptables/iptables-xml.c", 123 "//third_party/iptables/iptables/iptables.c", 124 "//third_party/iptables/iptables/xshared.c", 125 "//third_party/iptables/iptables/xtables-legacy-multi.c", 126 ] 127 128 include_dirs = [ 129 "//third_party/iptables", 130 "//third_party/iptables/extensions", 131 "//third_party/iptables/include", 132 "//third_party/iptables/iptables", 133 "//third_party/iptables/libiptc", 134 ] 135 configs = [ ":iptables_config" ] 136 137 install_enable = true 138 139 deps = [ 140 "//third_party/iptables/extensions:libext", 141 "//third_party/iptables/extensions:libext4", 142 "//third_party/iptables/extensions:libext6", 143 "//third_party/iptables/libiptc:libip4tc", 144 "//third_party/iptables/libiptc:libip6tc", 145 "//third_party/iptables/libxtables:libxtables", 146 ] 147 148 part_name = "iptables" 149 subsystem_name = "thirdparty" 150} 151