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