You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
4.4 KiB

  1. #
  2. # Copyright (C) 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. PKG_NAME:=tcpreplay
  9. PKG_VERSION:=4.4.1
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=https://github.com/appneta/tcpreplay/releases/download/v$(PKG_VERSION)
  13. PKG_HASH:=51f70ed14be5913f19c25cdfa530e98c14cedab1c76fbdd26eca7b61b57344f2
  14. PKG_LICENSE:=GPL-3.0
  15. PKG_LICENSE_FILES:=docs/LICENSE
  16. PKG_CPE_ID:=cpe:/a:appneta:tcpreplay
  17. PKG_FIXUP:=autoreconf
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. TCPREPLAY_MODULES:= \
  22. tcpbridge tcpcapinfo tcpliveplay tcpprep \
  23. tcpreplay tcpreplay-edit tcprewrite
  24. define Package/tcpreplay/default
  25. SUBMENU:=Tcpreplay
  26. SECTION:=net
  27. CATEGORY:=Network
  28. URL:=http://tcpreplay.appneta.com/
  29. MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
  30. DEPENDS:=+librt +libpcap +libdnet +USE_MUSL:musl-fts
  31. endef
  32. define Package/tcpbridge
  33. $(call Package/tcpreplay/default)
  34. TITLE:=Bridge network traffic across two interfaces
  35. endef
  36. define Package/tcpcapinfo
  37. $(call Package/tcpreplay/default)
  38. TITLE:=Pcap file dissector for debugging broken pcap files
  39. endef
  40. define Package/tcpliveplay
  41. $(call Package/tcpreplay/default)
  42. TITLE:=Replays network traffic stored in a pcap file on live networks using new TCP connections
  43. endef
  44. define Package/tcpprep
  45. $(call Package/tcpreplay/default)
  46. TITLE:=Create a tcpreplay cache file from a pcap file
  47. endef
  48. define Package/tcpreplay
  49. $(call Package/tcpreplay/default)
  50. TITLE:=Replay network traffic stored in pcap files
  51. endef
  52. define Package/tcpreplay-edit
  53. $(call Package/tcpreplay/default)
  54. TITLE:=Replay network traffic stored in pcap files
  55. endef
  56. define Package/tcprewrite
  57. $(call Package/tcpreplay/default)
  58. TITLE:=Rewrite the packets in a pcap file
  59. endef
  60. define Package/tcpreplay-all
  61. $(call Package/tcpreplay/default)
  62. TITLE:=Pcap editing and replaying utilities
  63. DEPENDS:=$(foreach m,$(TCPREPLAY_MODULES),+$(m))
  64. endef
  65. define Package/tcpbridge/description
  66. tcpbridge is a tool for selectively briding network traffic across two
  67. interfaces and optionally modifying the packets in between
  68. endef
  69. define Package/tcpcapinfo/description
  70. tcpcapinfo is a tool for decoding the structure of a pcap(3) file with a
  71. focus on finding broken pcap files and determining how two related pcap
  72. files might differ.
  73. endef
  74. define Package/tcpliveplay/description
  75. This program, 'tcpliveplay' replays a captured set of packets using new TCP
  76. connections with the captured TCP payloads against a remote host in order
  77. to do comprehensive vulnerability testings.
  78. endef
  79. define Package/tcpprep/description
  80. tcpprep is a ``pcap(3)'' file pre-processor which creates a cache file
  81. which provides "rules" for ``tcprewrite(1)'' and ``tcpreplay(1)'' on how to
  82. process and send packets.
  83. endef
  84. define Package/tcpreplay/description
  85. tcpreplay is a tool for replaying network traffic from files saved with
  86. tcpdump or other tools which write pcap(3) files.
  87. endef
  88. define Package/tcpreplay-edit/description
  89. tcpreplay-edit includes all the functionality of both tcpreplay
  90. and tcprewrite.
  91. endef
  92. define Package/tcprewrite/description
  93. Rewrite/edit the packets in a pcap file
  94. endef
  95. define Package/tcpreplay-all/description
  96. Tcpreplay is a suite of free Open Source utilities for
  97. editing and replaying previously captured network traffic.
  98. Originally designed to replay malicious traffic patterns to
  99. Intrusion Detection/Prevention Systems, it has seen many evolutions
  100. including capabilities to replay to web servers.
  101. Version 4.0.0 introduces features and performance enhancements
  102. to support switches, routers, and IP Flow/NetFlow appliances.
  103. endef
  104. ifneq ($(CONFIG_USE_MUSL),)
  105. TARGET_LDFLAGS+= -lfts
  106. endif
  107. CONFIGURE_VARS += \
  108. ac_cv_lib_nl_nl_cache_alloc=no \
  109. ac_cv_lib_nl_genl_3_genl_connect=no \
  110. ac_cv_lib_nl_3_nl_cache_alloc=no \
  111. ac_cv_lib_dbus_1_dbus_malloc=no \
  112. ac_cv_path_pcncfg=no
  113. CONFIGURE_ARGS += \
  114. --enable-force-pf \
  115. --enable-dynamic-link \
  116. --with-libdnet="$(STAGING_DIR)/usr" \
  117. --with-libpcap="$(STAGING_DIR)/usr"
  118. define tcpreplayTemplate
  119. define Package/$(1)/install
  120. $(INSTALL_DIR) $$(1)/usr/bin ; \
  121. $(CP) $$(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin
  122. endef
  123. endef
  124. define Package/tcpreplay-all/install
  125. :
  126. endef
  127. $(foreach m, $(TCPREPLAY_MODULES), \
  128. $(eval $(call tcpreplayTemplate,$(m))) \
  129. $(eval $(call BuildPackage,$(m))) \
  130. )
  131. $(eval $(call BuildPackage,tcpreplay-all))