mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-03 12:53:56 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
0d155c70be
commit
32600acc60
14258 files changed
+3954570
No files matched your search
@@ -0,0 +1,61 @@
|
||||
#
|
||||
# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter project
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tracebox
|
||||
PKG_VERSION:=0.4.4
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_URL:=https://github.com/dreibh/tracebox.git
|
||||
#https://github.com/tracebox/tracebox.git
|
||||
PKG_MAINTAINER:=Ycarus <ycarus@zugaina.org>
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4ad40ea43354038a04ad90aedae5874801c223e8
|
||||
#v0.4.4
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/tracebox
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=tracebox
|
||||
DEPENDS:=+liblua +libpcap +libpthread +librt +curl +libjson-c +libnetfilter-queue +libstdcpp
|
||||
endef
|
||||
|
||||
define Package/tracebox/description
|
||||
Tracebox is a tool that allows to detect middleboxes on any paths, i.e.,
|
||||
between a source and any destination. Tracebox can be viewed as a tool similar
|
||||
to traceroute as it uses ICMP replies to identify changes in the packets.
|
||||
endef
|
||||
|
||||
CONFIGURE_VARS += \
|
||||
ac_cv_header_lua_h=no \
|
||||
ax_header_version_match=yes
|
||||
|
||||
CONFIGURE_ARGS += --enable-sniffer --enable-curl --with-libpcap="$(STAGING_DIR)/usr/include/" --disable-tests
|
||||
|
||||
EXTRA_CPPFLAGS += -fpermissive -Wno-variadic-macros -std=c++14
|
||||
|
||||
TARGET_CFLAGS += -D_GNU_SOURCE
|
||||
|
||||
define Package/tracebox/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/tracebox/tracebox $(1)/usr/sbin/tracebox
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,tracebox))
|
||||
@@ -0,0 +1,10 @@
|
||||
pkt = ip{dst=to} / tcp{dst=65101} / MPCAPABLE
|
||||
function cb(ttl, r_ip, mod)
|
||||
if r_ip == nil then
|
||||
r_ip = "*"
|
||||
end
|
||||
print(ttl .. ": " .. tostring(r_ip) .. " " .. tostring(mod))
|
||||
-- print(tostring(mod:original():ip()))
|
||||
end
|
||||
result = tracebox(pkt, {callback="cb"})
|
||||
print("\nResult:\n" .. tostring(result))
|
||||
@@ -0,0 +1,33 @@
|
||||
diff --git a/noinst/libcrafter/libcrafter/crafter/Fields/NumericFields.cpp b/noinst/libcrafter/libcrafter/crafter/Fields/NumericFields.cpp
|
||||
index 86b77e6..7de1eb7 100644
|
||||
--- a/noinst/libcrafter/libcrafter/crafter/Fields/NumericFields.cpp
|
||||
+++ b/noinst/libcrafter/libcrafter/crafter/Fields/NumericFields.cpp
|
||||
@@ -270,8 +270,15 @@ Int64Field::Int64Field(const std::string& name, size_t nword, size_t nbyte) :
|
||||
offset = nword * 4 + nbyte;
|
||||
}
|
||||
|
||||
+static string genString(uint64_t val)
|
||||
+{
|
||||
+ char temp[21];
|
||||
+ sprintf(temp, "%llu", val);
|
||||
+ return temp;
|
||||
+}
|
||||
+
|
||||
void Int64Field::PrintValue(std::ostream& str) const {
|
||||
- str << GetName() << " = " << dec << (uint64_t)human;
|
||||
+ str << GetName() << " = " << dec << genString(human);
|
||||
}
|
||||
|
||||
FieldInfo* Int64Field::Clone() const {
|
||||
diff --git a/noinst/libcrafter/libcrafter/crafter/Packet.h b/noinst/libcrafter/libcrafter/crafter/Packet.h
|
||||
index 2fa813d..25c0fa1 100644
|
||||
--- a/noinst/libcrafter/libcrafter/crafter/Packet.h
|
||||
+++ b/noinst/libcrafter/libcrafter/crafter/Packet.h
|
||||
@@ -33,6 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <vector>
|
||||
#include <sys/socket.h>
|
||||
#include <pcap.h>
|
||||
+#include <pthread.h>
|
||||
|
||||
#include "Crafter.h"
|
||||
#include "Utils/RawSocket.h"
|
||||
@@ -0,0 +1,19 @@
|
||||
--- a/configure.ac 2018-07-20 16:15:42.284633906 +0200
|
||||
+++ b/configure.ac 2018-07-20 16:16:09.812296939 +0200
|
||||
@@ -162,16 +162,8 @@
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT($withval)
|
||||
- if test -f $withval/pcap.h -a \
|
||||
- -f $withval/libpcap.a -a \
|
||||
- -d $withval/pcap; then
|
||||
- owd=`pwd`
|
||||
- if cd $withval; then withval=`pwd`; cd $owd; fi
|
||||
PCAPINC="-I$withval -I$withval/bpf"
|
||||
PCAPLIB="-L$withval -lpcap"
|
||||
- else
|
||||
- AC_ERROR(pcap.h, net/bpf.h, or libpcap.a not found in $withval)
|
||||
- fi
|
||||
;;
|
||||
esac ],
|
||||
[ if test -f ${prefix}/include/pcap.h; then
|
||||
@@ -0,0 +1,24 @@
|
||||
--- a/noinst/libcrafter/libcrafter/configure.ac.anc 2018-07-20 16:45:10.760534965 +0200
|
||||
+++ b/noinst/libcrafter/libcrafter/configure.ac 2018-07-20 16:46:03.339973975 +0200
|
||||
@@ -29,21 +29,8 @@
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT($withval)
|
||||
- if test -f $withval/pcap.h -a -f $withval/libpcap.a; then
|
||||
- owd=`pwd`
|
||||
- if cd $withval; then withval=`pwd`; cd $owd; fi
|
||||
PCAPINC="-I$withval -I$withval/bpf"
|
||||
PCAPLIB="-L$withval -lpcap"
|
||||
- elif test -f $withval/include/pcap.h -a \
|
||||
- -f $withval/include/net/bpf.h -a \
|
||||
- -f $withval/lib/libpcap.a; then
|
||||
- owd=`pwd`
|
||||
- if cd $withval; then withval=`pwd`; cd $owd; fi
|
||||
- PCAPINC="-I$withval/include"
|
||||
- PCAPLIB="-L$withval/lib -lpcap"
|
||||
- else
|
||||
- AC_ERROR(pcap.h, net/bpf.h, or libpcap.a not found in $withval)
|
||||
- fi
|
||||
;;
|
||||
esac ],
|
||||
[ if test -f ${prefix}/include/pcap.h; then
|
||||
@@ -0,0 +1,31 @@
|
||||
--- a/noinst/libcrafter/libcrafter/crafter/Protocols/DNSQuery.cpp 2018-07-20 17:28:21.252256760 +0200
|
||||
+++ b/noinst/libcrafter/libcrafter/crafter/Protocols/DNSQuery.cpp 2018-07-20 17:28:35.092103432 +0200
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
size_t DNS::DNSQuery::Compress() {
|
||||
/* Put data into the buffer */
|
||||
- int nbytes = ns_name_compress(qname.c_str(), cqname, sizeof(cqname) , NULL,
|
||||
+ int nbytes = dn_comp(qname.c_str(), cqname, sizeof(cqname) , NULL,
|
||||
NULL);
|
||||
if(nbytes == -1)
|
||||
throw std::runtime_error("DNS::DNSQuery::Compress() : Error compressing the domain name provided");
|
||||
--- a/noinst/libcrafter/libcrafter/crafter/Protocols/DNSAnswer.cpp 2018-07-20 17:37:46.614513337 +0200
|
||||
+++ b/noinst/libcrafter/libcrafter/crafter/Protocols/DNSAnswer.cpp 2018-07-20 17:38:24.298131516 +0200
|
||||
@@ -209,7 +209,7 @@
|
||||
|
||||
size_t DNS::DNSAnswer::CompressName() {
|
||||
/* Put data into the buffer */
|
||||
- int nbytes = ns_name_compress(qname.c_str(), cqname, sizeof(cqname), NULL,
|
||||
+ int nbytes = dn_comp(qname.c_str(), cqname, sizeof(cqname), NULL,
|
||||
NULL);
|
||||
if(nbytes == -1)
|
||||
throw std::runtime_error("DNSAnswer::CompressName() : Error compressing the domain name provided");
|
||||
@@ -224,7 +224,7 @@
|
||||
size_t DNS::DNSAnswer::CompressRData() {
|
||||
if (rdata.find_first_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIKKLMNOPQRSTUVWXYZ") != std::string::npos) {
|
||||
/* Put data into the buffer */
|
||||
- int nbytes = ns_name_compress(rdata.c_str(), crdata, sizeof(crdata),
|
||||
+ int nbytes = dn_comp(rdata.c_str(), crdata, sizeof(crdata),
|
||||
NULL, NULL);
|
||||
if(nbytes == -1)
|
||||
throw std::runtime_error("DNSAnswer::CompressRData() : Error compressing the domain name provided");
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/configure.ac 2023-07-04 18:25:34.419067107 +0200
|
||||
+++ b/configure.ac 2023-07-04 18:25:42.558931140 +0200
|
||||
@@ -58,7 +58,6 @@
|
||||
esac ],
|
||||
[
|
||||
AX_PROG_LUA
|
||||
- AX_LUA_HEADERS
|
||||
AX_LUA_LIBS
|
||||
if test x"$LUA_LIB" = x; then
|
||||
AC_MSG_ERROR([Lua library not found. You may try option --with-lua-suffix.])
|
||||
@@ -0,0 +1,32 @@
|
||||
--- a/src/tracebox/lua.cc 2018-07-20 18:03:00.439624791 +0200
|
||||
+++ b/src/tracebox/lua.cc 2018-07-20 18:03:38.035263456 +0200
|
||||
@@ -6,7 +6,12 @@
|
||||
*/
|
||||
|
||||
|
||||
+extern "C" {
|
||||
+#include "lua.h"
|
||||
+#include "lualib.h"
|
||||
+#include "lauxlib.h"
|
||||
+}
|
||||
#include "lua/lua_packet.hpp"
|
||||
#include "config.h"
|
||||
|
||||
extern lua_State* l_init();
|
||||
--- a/src/tracebox/lua/lua_base.hpp 2018-08-06 09:43:49.589813406 +0200
|
||||
+++ b/src/tracebox/lua/lua_base.hpp 2018-08-06 09:44:27.773454118 +0200
|
||||
@@ -13,8 +13,12 @@
|
||||
#include <crafter.h>
|
||||
|
||||
#define LUA_COMPAT_ALL
|
||||
-#include <lua.hpp>
|
||||
-#include <lua.h>
|
||||
+extern "C" {
|
||||
+#include "lua.h"
|
||||
+#include "lualib.h"
|
||||
+#include "lauxlib.h"
|
||||
+}
|
||||
+
|
||||
|
||||
#include "config.h"
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/src/tracebox/lua.cc 2018-07-20 20:04:08.984285796 +0200
|
||||
+++ b/src/tracebox/lua.cc 2018-07-20 20:04:22.336156705 +0200
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "lauxlib.h"
|
||||
}
|
||||
#include "config.h"
|
||||
+#include "PartialHeader.h"
|
||||
|
||||
extern lua_State* l_init();
|
||||
|
||||
Reference in new issue
Block a user