From ea9d4c337887a42186a24db3816c82fe0d04661a Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sun, 9 Nov 2008 15:33:26 +0000 Subject: [PATCH] Add imsnif and link it against uclibcxx (#2128) SVN-Revision: 13145 --- net/imsnif/Makefile | 58 ++++++++++++++++++++ net/imsnif/files/imsnif | 16 ++++++ net/imsnif/patches/001-openwrt_paths.patch | 62 ++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 net/imsnif/Makefile create mode 100755 net/imsnif/files/imsnif create mode 100644 net/imsnif/patches/001-openwrt_paths.patch diff --git a/net/imsnif/Makefile b/net/imsnif/Makefile new file mode 100644 index 000000000..138d9a46b --- /dev/null +++ b/net/imsnif/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2008 OpenWrt.org +# +# $ Id:$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=imsnif +PKG_VERSION:=0.04 +PKG_RELEASE:=2 +PKG_MD5SUM:=689c456f8edb77b9b4199a25514ac683 + +PKG_SOURCE_URL:=http://kent.dl.sourceforge.net/sourceforge/im-snif +PKG_SOURCE:=$(PKG_NAME)f_$(PKG_VERSION).tgz +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install +PKG_UNPACK:=gzip -dc $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR) -xvf - + +include $(INCLUDE_DIR)/package.mk + +define Package/imsnif + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +uclibcxx + TITLE:=MSN Messenger sniffer + URL:=http://sourceforge.net/projects/im-snif +endef + +define Package/imsnif/description + IMsnif is a simple program to log Instant Message activity + on the network. It uses libpcap to capture packets and + analyzes them, logging conversation, contact lists, etc. +endef + +define Build/Compile + $(TARGET_CROSS)g++ $(TARGET_CPPFLAGS) -fno-builtin -fno-rtti -nostdinc++ \ + -I$(STAGING_DIR)/usr/include/uClibc++ -I$(LINUX_DIR)/include \ + -o $(PKG_BUILD_DIR)/src/imsnif \ + $(PKG_BUILD_DIR)/src/imsniff.cpp \ + $(PKG_BUILD_DIR)/src/util.cpp \ + $(PKG_BUILD_DIR)/src/msn_conntrack.cpp \ + $(PKG_BUILD_DIR)/src/msn_handlers.cpp \ + -L$(STAGING_DIR)/usr/lib -nodefaultlibs -luClibc++ -lgcc_s -lpcap \ + $(PKG_BUILD_DIR)/src/pcap_stuff.cpp +endef + +define Package/imsnif/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/docs/imsniff.conf.sample $(1)/etc/imsnif.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/imsnif $(1)/etc/init.d + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/imsnif $(1)/usr/bin +endef + +$(eval $(call BuildPackage,imsnif)) diff --git a/net/imsnif/files/imsnif b/net/imsnif/files/imsnif new file mode 100755 index 000000000..12c2f28f8 --- /dev/null +++ b/net/imsnif/files/imsnif @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common +#Copyright (C) 2007 RoadRunner.cx +START=85 + +start() { + [ -f /etc/imsnif.conf ] && /usr/bin/imsnif || { + cat <tm_year, stm->tm_mon, stm->tm_mday); ++ sprintf (fn, "%s/imsnif_%04d-%02d-%02d.log", debuglogdir, stm->tm_year, stm->tm_mon, stm->tm_mday); + #else + struct tm stm; + localtime_r (&now, &stm); +- sprintf (fn, "%s/imsniff_%04d-%02d-%02d.log", debuglogdir, stm.tm_year, stm.tm_mon, stm.tm_mday); ++ sprintf (fn, "%s/imsnif_%04d-%02d-%02d.log", debuglogdir, stm.tm_year, stm.tm_mon, stm.tm_mday); + #endif + FILE *o=fopen (fn, "a+t"); + if (o!=NULL) -- 2.30.2