Makefile 20 KB

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