Makefile 18 KB

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