| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2006-2016 OpenWrt.org |
| 3 | # |
| 4 | # This is free software, licensed under the GNU General Public License v2. |
| 5 | # See /LICENSE for more information. |
| 6 | # |
| 7 | |
| 8 | include $(TOPDIR)/rules.mk |
| 9 | include $(INCLUDE_DIR)/kernel.mk |
| 10 | |
| 11 | PKG_NAME:=iptables |
| 12 | PKG_VERSION:=1.8.7 |
| 13 | PKG_RELEASE:=2 |
| 14 | |
| 15 | PKG_SOURCE_URL:=https://netfilter.org/projects/iptables/files |
| 16 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 |
| 17 | PKG_HASH:=c109c96bb04998cd44156622d36f8e04b140701ec60531a10668cfdff5e8d8f0 |
| 18 | |
| 19 | PKG_FIXUP:=autoreconf |
| 20 | PKG_FLAGS:=nonshared |
| 21 | |
| 22 | PKG_INSTALL:=1 |
| 23 | PKG_BUILD_FLAGS:=gc-sections no-lto |
| 24 | PKG_BUILD_PARALLEL:=1 |
| 25 | PKG_LICENSE:=GPL-2.0 |
| 26 | PKG_CPE_ID:=cpe:/a:netfilter:iptables |
| 27 | |
| 28 | include $(INCLUDE_DIR)/package.mk |
| 29 | ifeq ($(DUMP),) |
| 30 | -include $(LINUX_DIR)/.config |
| 31 | include $(INCLUDE_DIR)/netfilter.mk |
| 32 | STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell grep 'NETFILTER' $(LINUX_DIR)/.config | $(MKHASH) md5) |
| 33 | endif |
| 34 | |
| 35 | |
| 36 | define Package/iptables/Default |
| 37 | SECTION:=net |
| 38 | CATEGORY:=Network |
| 39 | SUBMENU:=Firewall |
| 40 | URL:=https://netfilter.org/ |
| 41 | endef |
| 42 | |
| 43 | define Package/iptables/Module |
| 44 | $(call Package/iptables/Default) |
| 45 | DEPENDS:=iptables $(1) |
| 46 | endef |
| 47 | |
| 48 | define Package/iptables |
| 49 | $(call Package/iptables/Default) |
| 50 | TITLE:=IP firewall administration tool |
| 51 | MENU:=1 |
| 52 | DEPENDS+= +(!MODULE_BUILDIN):kmod-ipt-core +libip4tc +IPV6:libip6tc +libxtables |
| 53 | endef |
| 54 | |
| 55 | define Package/iptables/config |
| 56 | config IPTABLES_CONNLABEL |
| 57 | bool "Enable Connlabel support" |
| 58 | default n |
| 59 | help |
| 60 | This enable connlabel support in iptables. |
| 61 | |
| 62 | config IPTABLES_NFTABLES |
| 63 | bool "Enable Nftables support" |
| 64 | default n |
| 65 | help |
| 66 | This enable nftables support in iptables. |
| 67 | endef |
| 68 | |
| 69 | define Package/iptables/description |
| 70 | IP firewall administration tool. |
| 71 | |
| 72 | Matches: |
| 73 | - icmp |
| 74 | - tcp |
| 75 | - udp |
| 76 | - comment |
| 77 | - conntrack |
| 78 | - limit |
| 79 | - mac |
| 80 | - mark |
| 81 | - multiport |
| 82 | - set |
| 83 | - state |
| 84 | - time |
| 85 | |
| 86 | Targets: |
| 87 | - ACCEPT |
| 88 | - CT |
| 89 | - DNAT |
| 90 | - DROP |
| 91 | - REJECT |
| 92 | - FLOWOFFLOAD |
| 93 | - LOG |
| 94 | - MARK |
| 95 | - MASQUERADE |
| 96 | - REDIRECT |
| 97 | - SET |
| 98 | - SNAT |
| 99 | - TCPMSS |
| 100 | |
| 101 | Tables: |
| 102 | - filter |
| 103 | - mangle |
| 104 | - nat |
| 105 | - raw |
| 106 | |
| 107 | endef |
| 108 | |
| 109 | define Package/iptables-nft |
| 110 | $(call Package/iptables/Default) |
| 111 | TITLE:=IP firewall administration tool nft |
| 112 | DEPENDS:=iptables @IPTABLES_NFTABLES +libxtables-nft |
| 113 | endef |
| 114 | |
| 115 | define Package/iptables-nft/description |
| 116 | Extra iptables nftables nft binaries. |
| 117 | iptables-nft |
| 118 | iptables-nft-restore |
| 119 | iptables-nft-save |
| 120 | iptables-translate |
| 121 | iptables-restore-translate |
| 122 | endef |
| 123 | |
| 124 | define Package/iptables-mod-conntrack-extra |
| 125 | $(call Package/iptables/Module, +kmod-ipt-conntrack-extra +kmod-ipt-raw) |
| 126 | TITLE:=Extra connection tracking extensions |
| 127 | endef |
| 128 | |
| 129 | define Package/iptables-mod-conntrack-extra/description |
| 130 | Extra iptables extensions for connection tracking. |
| 131 | |
| 132 | Matches: |
| 133 | - connbytes |
| 134 | - connlimit |
| 135 | - connmark |
| 136 | - recent |
| 137 | - helper |
| 138 | |
| 139 | Targets: |
| 140 | - CONNMARK |
| 141 | |
| 142 | endef |
| 143 | |
| 144 | define Package/iptables-mod-conntrack-label |
| 145 | $(call Package/iptables/Module, +kmod-ipt-conntrack-label @IPTABLES_CONNLABEL) |
| 146 | TITLE:=Connection tracking labeling extension |
| 147 | DEFAULT:=y if IPTABLES_CONNLABEL |
| 148 | endef |
| 149 | |
| 150 | define Package/iptables-mod-conntrack-label/description |
| 151 | Match and set label(s) on connection tracking entries |
| 152 | |
| 153 | Matches: |
| 154 | - connlabel |
| 155 | |
| 156 | endef |
| 157 | |
| 158 | define Package/iptables-mod-filter |
| 159 | $(call Package/iptables/Module, +kmod-ipt-filter) |
| 160 | TITLE:=Content inspection extensions |
| 161 | endef |
| 162 | |
| 163 | define Package/iptables-mod-filter/description |
| 164 | iptables extensions for packet content inspection. |
| 165 | Includes support for: |
| 166 | |
| 167 | Matches: |
| 168 | - string |
| 169 | - bpf |
| 170 | |
| 171 | endef |
| 172 | |
| 173 | define Package/iptables-mod-ipopt |
| 174 | $(call Package/iptables/Module, +(!MODULE_BUILDIN):kmod-ipt-ipopt) |
| 175 | TITLE:=IP/Packet option extensions |
| 176 | endef |
| 177 | |
| 178 | define Package/iptables-mod-ipopt/description |
| 179 | iptables extensions for matching/changing IP packet options. |
| 180 | |
| 181 | Matches: |
| 182 | - dscp |
| 183 | - ecn |
| 184 | - length |
| 185 | - statistic |
| 186 | - tcpmss |
| 187 | - unclean |
| 188 | - hl |
| 189 | |
| 190 | Targets: |
| 191 | - DSCP |
| 192 | - CLASSIFY |
| 193 | - ECN |
| 194 | - HL |
| 195 | |
| 196 | endef |
| 197 | |
| 198 | define Package/iptables-mod-ipsec |
| 199 | $(call Package/iptables/Module, +kmod-ipt-ipsec) |
| 200 | TITLE:=IPsec extensions |
| 201 | endef |
| 202 | |
| 203 | define Package/iptables-mod-ipsec/description |
| 204 | iptables extensions for matching ipsec traffic. |
| 205 | |
| 206 | Matches: |
| 207 | - ah |
| 208 | - esp |
| 209 | - policy |
| 210 | |
| 211 | endef |
| 212 | |
| 213 | define Package/iptables-mod-nat-extra |
| 214 | $(call Package/iptables/Module, +kmod-ipt-nat-extra) |
| 215 | TITLE:=Extra NAT extensions |
| 216 | endef |
| 217 | |
| 218 | define Package/iptables-mod-nat-extra/description |
| 219 | iptables extensions for extra NAT targets. |
| 220 | |
| 221 | Targets: |
| 222 | - MIRROR |
| 223 | - NETMAP |
| 224 | endef |
| 225 | |
| 226 | define Package/iptables-mod-nflog |
| 227 | $(call Package/iptables/Module, +kmod-nfnetlink-log +kmod-ipt-nflog) |
| 228 | TITLE:=Netfilter NFLOG target |
| 229 | endef |
| 230 | |
| 231 | define Package/iptables-mod-nflog/description |
| 232 | iptables extension for user-space logging via NFNETLINK. |
| 233 | |
| 234 | Includes: |
| 235 | - libxt_NFLOG |
| 236 | |
| 237 | endef |
| 238 | |
| 239 | define Package/iptables-mod-trace |
| 240 | $(call Package/iptables/Module, +kmod-ipt-debug) |
| 241 | TITLE:=Netfilter TRACE target |
| 242 | endef |
| 243 | |
| 244 | define Package/iptables-mod-trace/description |
| 245 | iptables extension for TRACE target |
| 246 | |
| 247 | Includes: |
| 248 | - libxt_TRACE |
| 249 | |
| 250 | endef |
| 251 | |
| 252 | |
| 253 | define Package/iptables-mod-nfqueue |
| 254 | $(call Package/iptables/Module, +kmod-nfnetlink-queue +kmod-ipt-nfqueue) |
| 255 | TITLE:=Netfilter NFQUEUE target |
| 256 | endef |
| 257 | |
| 258 | define Package/iptables-mod-nfqueue/description |
| 259 | iptables extension for user-space queuing via NFNETLINK. |
| 260 | |
| 261 | Includes: |
| 262 | - libxt_NFQUEUE |
| 263 | |
| 264 | endef |
| 265 | |
| 266 | define Package/iptables-mod-hashlimit |
| 267 | $(call Package/iptables/Module, +kmod-ipt-hashlimit) |
| 268 | TITLE:=hashlimit matching |
| 269 | endef |
| 270 | |
| 271 | define Package/iptables-mod-hashlimit/description |
| 272 | iptables extensions for hashlimit matching |
| 273 | |
| 274 | Matches: |
| 275 | - hashlimit |
| 276 | |
| 277 | endef |
| 278 | |
| 279 | define Package/iptables-mod-rpfilter |
| 280 | $(call Package/iptables/Module, +kmod-ipt-rpfilter) |
| 281 | TITLE:=rpfilter iptables extension |
| 282 | endef |
| 283 | |
| 284 | define Package/iptables-mod-rpfilter/description |
| 285 | iptables extensions for reverse path filter test on a packet |
| 286 | |
| 287 | Matches: |
| 288 | - rpfilter |
| 289 | |
| 290 | endef |
| 291 | |
| 292 | define Package/iptables-mod-iprange |
| 293 | $(call Package/iptables/Module, +kmod-ipt-iprange) |
| 294 | TITLE:=IP range extension |
| 295 | endef |
| 296 | |
| 297 | define Package/iptables-mod-iprange/description |
| 298 | iptables extensions for matching ip ranges. |
| 299 | |
| 300 | Matches: |
| 301 | - iprange |
| 302 | |
| 303 | endef |
| 304 | |
| 305 | define Package/iptables-mod-cluster |
| 306 | $(call Package/iptables/Module, +kmod-ipt-cluster) |
| 307 | TITLE:=Match cluster extension |
| 308 | endef |
| 309 | |
| 310 | define Package/iptables-mod-cluster/description |
| 311 | iptables extensions for matching cluster. |
| 312 | |
| 313 | Netfilter (IPv4/IPv6) module for matching cluster |
| 314 | This option allows you to build work-load-sharing clusters of |
| 315 | network servers/stateful firewalls without having a dedicated |
| 316 | load-balancing router/server/switch. Basically, this match returns |
| 317 | true when the packet must be handled by this cluster node. Thus, |
| 318 | all nodes see all packets and this match decides which node handles |
| 319 | what packets. The work-load sharing algorithm is based on source |
| 320 | address hashing. |
| 321 | |
| 322 | This module is usable for ipv4 and ipv6. |
| 323 | |
| 324 | If you select it, it enables kmod-ipt-cluster. |
| 325 | |
| 326 | see `iptables -m cluster --help` for more information. |
| 327 | endef |
| 328 | |
| 329 | define Package/iptables-mod-clusterip |
| 330 | $(call Package/iptables/Module, +kmod-ipt-clusterip) |
| 331 | TITLE:=Clusterip extension |
| 332 | endef |
| 333 | |
| 334 | define Package/iptables-mod-clusterip/description |
| 335 | iptables extensions for CLUSTERIP. |
| 336 | The CLUSTERIP target allows you to build load-balancing clusters of |
| 337 | network servers without having a dedicated load-balancing |
| 338 | router/server/switch. |
| 339 | |
| 340 | If you select it, it enables kmod-ipt-clusterip. |
| 341 | |
| 342 | see `iptables -j CLUSTERIP --help` for more information. |
| 343 | endef |
| 344 | |
| 345 | define Package/iptables-mod-extra |
| 346 | $(call Package/iptables/Module, +kmod-ipt-extra) |
| 347 | TITLE:=Other extra iptables extensions |
| 348 | endef |
| 349 | |
| 350 | define Package/iptables-mod-extra/description |
| 351 | Other extra iptables extensions. |
| 352 | |
| 353 | Matches: |
| 354 | - addrtype |
| 355 | - condition |
| 356 | - owner |
| 357 | - pkttype |
| 358 | - quota |
| 359 | |
| 360 | endef |
| 361 | |
| 362 | define Package/iptables-mod-physdev |
| 363 | $(call Package/iptables/Module, +kmod-ipt-physdev) |
| 364 | TITLE:=physdev iptables extension |
| 365 | endef |
| 366 | |
| 367 | define Package/iptables-mod-physdev/description |
| 368 | The iptables physdev match. |
| 369 | endef |
| 370 | |
| 371 | define Package/iptables-mod-led |
| 372 | $(call Package/iptables/Module, +kmod-ipt-led) |
| 373 | TITLE:=LED trigger iptables extension |
| 374 | endef |
| 375 | |
| 376 | define Package/iptables-mod-led/description |
| 377 | iptables extension for triggering a LED. |
| 378 | |
| 379 | Targets: |
| 380 | - LED |
| 381 | |
| 382 | endef |
| 383 | |
| 384 | define Package/iptables-mod-socket |
| 385 | $(call Package/iptables/Module, +kmod-ipt-socket) |
| 386 | TITLE:=Socket match iptables extensions |
| 387 | endef |
| 388 | |
| 389 | define Package/iptables-mod-socket/description |
| 390 | Socket match iptables extensions. |
| 391 | |
| 392 | Matches: |
| 393 | - socket |
| 394 | |
| 395 | endef |
| 396 | |
| 397 | define Package/iptables-mod-tproxy |
| 398 | $(call Package/iptables/Module, +kmod-ipt-tproxy) |
| 399 | TITLE:=Transparent proxy iptables extensions |
| 400 | endef |
| 401 | |
| 402 | define Package/iptables-mod-tproxy/description |
| 403 | Transparent proxy iptables extensions. |
| 404 | |
| 405 | Targets: |
| 406 | - TPROXY |
| 407 | |
| 408 | endef |
| 409 | |
| 410 | define Package/iptables-mod-tee |
| 411 | $(call Package/iptables/Module, +kmod-ipt-tee) |
| 412 | TITLE:=TEE iptables extensions |
| 413 | endef |
| 414 | |
| 415 | define Package/iptables-mod-tee/description |
| 416 | TEE iptables extensions. |
| 417 | |
| 418 | Targets: |
| 419 | - TEE |
| 420 | |
| 421 | endef |
| 422 | |
| 423 | define Package/iptables-mod-u32 |
| 424 | $(call Package/iptables/Module, +kmod-ipt-u32) |
| 425 | TITLE:=U32 iptables extensions |
| 426 | endef |
| 427 | |
| 428 | define Package/iptables-mod-u32/description |
| 429 | U32 iptables extensions. |
| 430 | |
| 431 | Matches: |
| 432 | - u32 |
| 433 | |
| 434 | endef |
| 435 | |
| 436 | define Package/iptables-mod-checksum |
| 437 | $(call Package/iptables/Module, +kmod-ipt-checksum) |
| 438 | TITLE:=IP CHECKSUM target extension |
| 439 | endef |
| 440 | |
| 441 | define Package/iptables-mod-checksum/description |
| 442 | iptables extension for the CHECKSUM calculation target |
| 443 | endef |
| 444 | |
| 445 | define Package/ip6tables |
| 446 | $(call Package/iptables/Default) |
| 447 | DEPENDS:=@IPV6 +(!MODULE_BUILDIN):kmod-ip6tables +iptables |
| 448 | CATEGORY:=Network |
| 449 | TITLE:=IPv6 firewall administration tool |
| 450 | MENU:=1 |
| 451 | endef |
| 452 | |
| 453 | define Package/ip6tables-nft |
| 454 | $(call Package/iptables/Default) |
| 455 | DEPENDS:=ip6tables @IPTABLES_NFTABLES +libxtables-nft |
| 456 | TITLE:=IP firewall administration tool nft |
| 457 | endef |
| 458 | |
| 459 | define Package/ip6tables-nft/description |
| 460 | Extra ip6tables nftables nft binaries. |
| 461 | iptables-nft |
| 462 | iptables-nft-restore |
| 463 | iptables-nft-save |
| 464 | iptables-translate |
| 465 | iptables-restore-translate |
| 466 | endef |
| 467 | |
| 468 | define Package/ip6tables-extra |
| 469 | $(call Package/iptables/Default) |
| 470 | DEPENDS:=ip6tables +kmod-ip6tables-extra |
| 471 | TITLE:=IPv6 header matching modules |
| 472 | endef |
| 473 | |
| 474 | define Package/ip6tables-mod-extra/description |
| 475 | iptables header matching modules for IPv6 |
| 476 | endef |
| 477 | |
| 478 | define Package/ip6tables-mod-nat |
| 479 | $(call Package/iptables/Default) |
| 480 | DEPENDS:=ip6tables +kmod-ipt-nat6 |
| 481 | TITLE:=IPv6 NAT extensions |
| 482 | endef |
| 483 | |
| 484 | define Package/ip6tables-mod-nat/description |
| 485 | iptables extensions for IPv6-NAT targets. |
| 486 | endef |
| 487 | |
| 488 | define Package/libip4tc |
| 489 | $(call Package/iptables/Default) |
| 490 | SECTION:=libs |
| 491 | CATEGORY:=Libraries |
| 492 | TITLE:=IPv4 firewall - shared libiptc library |
| 493 | ABI_VERSION:=2 |
| 494 | DEPENDS:=+libxtables |
| 495 | endef |
| 496 | |
| 497 | define Package/libip6tc |
| 498 | $(call Package/iptables/Default) |
| 499 | SECTION:=libs |
| 500 | CATEGORY:=Libraries |
| 501 | TITLE:=IPv6 firewall - shared libiptc library |
| 502 | ABI_VERSION:=2 |
| 503 | DEPENDS:=+libxtables |
| 504 | endef |
| 505 | |
| 506 | define Package/libxtables |
| 507 | $(call Package/iptables/Default) |
| 508 | SECTION:=libs |
| 509 | CATEGORY:=Libraries |
| 510 | TITLE:=IPv4/IPv6 firewall - shared xtables library |
| 511 | ABI_VERSION:=12 |
| 512 | DEPENDS:= \ |
| 513 | +IPTABLES_CONNLABEL:libnetfilter-conntrack \ |
| 514 | +IPTABLES_NFTABLES:libnftnl |
| 515 | endef |
| 516 | |
| 517 | define Package/libxtables-nft |
| 518 | $(call Package/iptables/Default) |
| 519 | SECTION:=libs |
| 520 | CATEGORY:=Libraries |
| 521 | TITLE:=IPv4/IPv6 firewall - shared xtables nft library |
| 522 | ABI_VERSION:=12 |
| 523 | DEPENDS:=libxtables |
| 524 | endef |
| 525 | |
| 526 | TARGET_CPPFLAGS := \ |
| 527 | -I$(PKG_BUILD_DIR)/include \ |
| 528 | -I$(LINUX_DIR)/user_headers/include \ |
| 529 | $(TARGET_CPPFLAGS) |
| 530 | |
| 531 | TARGET_CFLAGS += \ |
| 532 | -I$(PKG_BUILD_DIR)/include \ |
| 533 | -I$(LINUX_DIR)/user_headers/include \ |
| 534 | -ffunction-sections -fdata-sections \ |
| 535 | -DNO_LEGACY |
| 536 | |
| 537 | TARGET_LDFLAGS += \ |
| 538 | -Wl,--gc-sections |
| 539 | |
| 540 | CONFIGURE_ARGS += \ |
| 541 | --enable-shared \ |
| 542 | --enable-static \ |
| 543 | --enable-devel \ |
| 544 | --with-kernel="$(LINUX_DIR)/user_headers" \ |
| 545 | --with-xtlibdir=/usr/lib/iptables \ |
| 546 | --with-xt-lock-name=/var/run/xtables.lock \ |
| 547 | $(if $(CONFIG_IPTABLES_CONNLABEL),,--disable-connlabel) \ |
| 548 | $(if $(CONFIG_IPTABLES_NFTABLES),,--disable-nftables) \ |
| 549 | $(if $(CONFIG_IPV6),,--disable-ipv6) |
| 550 | |
| 551 | MAKE_FLAGS := \ |
| 552 | $(TARGET_CONFIGURE_OPTS) \ |
| 553 | COPT_FLAGS="$(TARGET_CFLAGS)" \ |
| 554 | KERNEL_DIR="$(LINUX_DIR)/user_headers/" PREFIX=/usr \ |
| 555 | KBUILD_OUTPUT="$(LINUX_DIR)" \ |
| 556 | BUILTIN_MODULES="$(patsubst ip6t_%,%,$(patsubst ipt_%,%,$(patsubst xt_%,%,$(IPT_BUILTIN) $(IPT_CONNTRACK-m) $(IPT_NAT-m))))" |
| 557 | |
| 558 | ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED))) |
| 559 | define Build/Configure/rebuild |
| 560 | $(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.\?o -or -name \*.a | $(XARGS) rm -f |
| 561 | rm -f $(PKG_BUILD_DIR)/.config_* |
| 562 | rm -f $(PKG_BUILD_DIR)/.configured_* |
| 563 | touch $(subst .configured_,.config_,$(STAMP_CONFIGURED)) |
| 564 | endef |
| 565 | endif |
| 566 | |
| 567 | define Build/Configure |
| 568 | $(Build/Configure/rebuild) |
| 569 | $(Build/Configure/Default) |
| 570 | endef |
| 571 | |
| 572 | define Build/InstallDev |
| 573 | $(INSTALL_DIR) $(1)/usr/include |
| 574 | $(INSTALL_DIR) $(1)/usr/include/iptables |
| 575 | $(INSTALL_DIR) $(1)/usr/include/net/netfilter |
| 576 | |
| 577 | # XXX: iptables header fixup, some headers are not installed by iptables anymore |
| 578 | $(CP) $(PKG_BUILD_DIR)/include/iptables/*.h $(1)/usr/include/iptables/ |
| 579 | $(CP) $(PKG_BUILD_DIR)/include/iptables.h $(1)/usr/include/ |
| 580 | $(CP) $(PKG_BUILD_DIR)/include/ip6tables.h $(1)/usr/include/ |
| 581 | $(CP) $(PKG_BUILD_DIR)/include/libipulog $(1)/usr/include/ |
| 582 | $(CP) $(PKG_BUILD_DIR)/include/libiptc $(1)/usr/include/ |
| 583 | |
| 584 | $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ |
| 585 | $(INSTALL_DIR) $(1)/usr/lib |
| 586 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxtables.so* $(1)/usr/lib/ |
| 587 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libip*tc.so* $(1)/usr/lib/ |
| 588 | $(INSTALL_DIR) $(1)/usr/lib/pkgconfig |
| 589 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/xtables.pc $(1)/usr/lib/pkgconfig/ |
| 590 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libip*tc.pc $(1)/usr/lib/pkgconfig/ |
| 591 | |
| 592 | # XXX: needed by firewall3 |
| 593 | $(CP) $(PKG_BUILD_DIR)/extensions/libiptext*.so $(1)/usr/lib/ |
| 594 | endef |
| 595 | |
| 596 | define Package/iptables/install |
| 597 | $(INSTALL_DIR) $(1)/usr/sbin |
| 598 | $(CP) $(PKG_INSTALL_DIR)/usr/sbin/xtables-legacy-multi $(1)/usr/sbin/ |
| 599 | $(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables{,-restore,-save} $(1)/usr/sbin/ |
| 600 | $(INSTALL_DIR) $(1)/usr/lib/iptables |
| 601 | endef |
| 602 | |
| 603 | define Package/iptables-nft/install |
| 604 | $(INSTALL_DIR) $(1)/usr/sbin |
| 605 | $(CP) $(PKG_INSTALL_DIR)/usr/sbin/xtables-nft-multi $(1)/usr/sbin/ |
| 606 | $(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables-nft{,-restore,-save} $(1)/usr/sbin/ |
| 607 | $(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables{,-restore}-translate $(1)/usr/sbin/ |
| 608 | endef |
| 609 | |
| 610 | define Package/ip6tables/install |
| 611 | $(INSTALL_DIR) $(1)/usr/sbin |
| 612 | $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ip6tables{,-restore,-save} $(1)/usr/sbin/ |
| 613 | endef |
| 614 | |
| 615 | define Package/ip6tables-nft/install |
| 616 | $(INSTALL_DIR) $(1)/usr/sbin |
| 617 | $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ip6tables-nft{,-restore,-save} $(1)/usr/sbin/ |
| 618 | $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ip6tables{,-restore}-translate $(1)/usr/sbin/ |
| 619 | endef |
| 620 | |
| 621 | define Package/libip4tc/install |
| 622 | $(INSTALL_DIR) $(1)/usr/lib |
| 623 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libip4tc.so.* $(1)/usr/lib/ |
| 624 | $(CP) $(PKG_BUILD_DIR)/extensions/libiptext4.so $(1)/usr/lib/ |
| 625 | endef |
| 626 | |
| 627 | define Package/libip6tc/install |
| 628 | $(INSTALL_DIR) $(1)/usr/lib |
| 629 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libip6tc.so.* $(1)/usr/lib/ |
| 630 | $(CP) $(PKG_BUILD_DIR)/extensions/libiptext6.so $(1)/usr/lib/ |
| 631 | endef |
| 632 | |
| 633 | define Package/libxtables/install |
| 634 | $(INSTALL_DIR) $(1)/usr/lib |
| 635 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxtables.so.* $(1)/usr/lib/ |
| 636 | $(CP) $(PKG_BUILD_DIR)/extensions/libiptext.so $(1)/usr/lib/ |
| 637 | endef |
| 638 | |
| 639 | define Package/libxtables-nft/install |
| 640 | $(INSTALL_DIR) $(1)/usr/lib |
| 641 | $(CP) $(PKG_BUILD_DIR)/extensions/libiptext_*.so $(1)/usr/lib/ |
| 642 | endef |
| 643 | |
| 644 | define BuildPlugin |
| 645 | define Package/$(1)/install |
| 646 | $(INSTALL_DIR) $$(1)/usr/lib/iptables |
| 647 | for m in $(patsubst xt_%,ipt_%,$(2)) $(patsubst ipt_%,xt_%,$(2)) $(patsubst xt_%,ip6t_%,$(2)) $(patsubst ip6t_%,xt_%,$(2)); do \ |
| 648 | if [ -f $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so ]; then \ |
| 649 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so $$(1)/usr/lib/iptables/ ; \ |
| 650 | fi; \ |
| 651 | done |
| 652 | $(3) |
| 653 | endef |
| 654 | |
| 655 | $$(eval $$(call BuildPackage,$(1))) |
| 656 | endef |
| 657 | |
| 658 | $(eval $(call BuildPackage,libxtables)) |
| 659 | $(eval $(call BuildPackage,libxtables-nft)) |
| 660 | $(eval $(call BuildPackage,libip4tc)) |
| 661 | $(eval $(call BuildPackage,libip6tc)) |
| 662 | $(eval $(call BuildPackage,iptables)) |
| 663 | $(eval $(call BuildPackage,iptables-nft)) |
| 664 | $(eval $(call BuildPlugin,iptables-mod-conntrack-extra,$(IPT_CONNTRACK_EXTRA-m))) |
| 665 | $(eval $(call BuildPlugin,iptables-mod-conntrack-label,$(IPT_CONNTRACK_LABEL-m))) |
| 666 | $(eval $(call BuildPlugin,iptables-mod-extra,$(IPT_EXTRA-m))) |
| 667 | $(eval $(call BuildPlugin,iptables-mod-physdev,$(IPT_PHYSDEV-m))) |
| 668 | $(eval $(call BuildPlugin,iptables-mod-filter,$(IPT_FILTER-m))) |
| 669 | $(eval $(call BuildPlugin,iptables-mod-ipopt,$(IPT_IPOPT-m))) |
| 670 | $(eval $(call BuildPlugin,iptables-mod-ipsec,$(IPT_IPSEC-m))) |
| 671 | $(eval $(call BuildPlugin,iptables-mod-nat-extra,$(IPT_NAT_EXTRA-m))) |
| 672 | $(eval $(call BuildPlugin,iptables-mod-iprange,$(IPT_IPRANGE-m))) |
| 673 | $(eval $(call BuildPlugin,iptables-mod-cluster,$(IPT_CLUSTER-m))) |
| 674 | $(eval $(call BuildPlugin,iptables-mod-clusterip,$(IPT_CLUSTERIP-m))) |
| 675 | $(eval $(call BuildPlugin,iptables-mod-hashlimit,$(IPT_HASHLIMIT-m))) |
| 676 | $(eval $(call BuildPlugin,iptables-mod-rpfilter,$(IPT_RPFILTER-m))) |
| 677 | $(eval $(call BuildPlugin,iptables-mod-led,$(IPT_LED-m))) |
| 678 | $(eval $(call BuildPlugin,iptables-mod-socket,$(IPT_SOCKET-m))) |
| 679 | $(eval $(call BuildPlugin,iptables-mod-tproxy,$(IPT_TPROXY-m))) |
| 680 | $(eval $(call BuildPlugin,iptables-mod-tee,$(IPT_TEE-m))) |
| 681 | $(eval $(call BuildPlugin,iptables-mod-u32,$(IPT_U32-m))) |
| 682 | $(eval $(call BuildPlugin,iptables-mod-nflog,$(IPT_NFLOG-m))) |
| 683 | $(eval $(call BuildPlugin,iptables-mod-trace,$(IPT_DEBUG-m))) |
| 684 | $(eval $(call BuildPlugin,iptables-mod-nfqueue,$(IPT_NFQUEUE-m))) |
| 685 | $(eval $(call BuildPlugin,iptables-mod-checksum,$(IPT_CHECKSUM-m))) |
| 686 | $(eval $(call BuildPackage,ip6tables)) |
| 687 | $(eval $(call BuildPackage,ip6tables-nft)) |
| 688 | $(eval $(call BuildPlugin,ip6tables-extra,$(IPT_IPV6_EXTRA-m))) |
| 689 | $(eval $(call BuildPlugin,ip6tables-mod-nat,$(IPT_NAT6-m))) |
| 690 | |