2006-10-28 22:43:08 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2006-08-03 11:39:18 +00:00
|
|
|
# $Id$
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=knock
|
|
|
|
PKG_VERSION:=0.5
|
|
|
|
PKG_RELEASE:=1
|
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
2006-10-28 22:43:08 +00:00
|
|
|
PKG_SOURCE_URL:=http://www.zeroflux.org/knock/files/
|
|
|
|
PKG_MD5SUM:=ca09d61458974cff90a700aba6120891
|
2006-08-03 11:39:18 +00:00
|
|
|
PKG_CAT:=zcat
|
|
|
|
|
|
|
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
|
|
|
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
|
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
2006-10-28 22:43:08 +00:00
|
|
|
define Package/knock/Default
|
2006-08-03 11:39:18 +00:00
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
|
|
|
DEPENDS:=+libpcap
|
2006-10-28 22:43:08 +00:00
|
|
|
TITLE:=Port-knocking
|
|
|
|
DESCRIPTION:=\
|
|
|
|
It listens to all traffic on an ethernet (or PPP) interface, \\\
|
|
|
|
looking for special "knock" sequences of port-hits. A client \\\
|
|
|
|
makes these port-hits by sending a TCP (or UDP) packet to a \\\
|
|
|
|
port on the server. This port need not be open -- since \\\
|
|
|
|
knockd listens at the link-layer level, it sees all traffic \\\
|
|
|
|
even if it's destined for a closed port. When the server \\\
|
|
|
|
detects a specific sequence of port-hits, it runs a command \\\
|
|
|
|
defined in its configuration file. This can be used to open \\\
|
|
|
|
up holes in a firewall for quick access.
|
2006-08-03 11:39:18 +00:00
|
|
|
URL:=http://www.zeroflux.org/cgi-bin/cvstrac/knock/wiki
|
|
|
|
endef
|
|
|
|
|
2006-10-28 22:43:08 +00:00
|
|
|
define Package/knock
|
|
|
|
$(call Package/knock/Default)
|
|
|
|
TITLE+= client
|
|
|
|
DESCRIPTION+=\\\
|
|
|
|
\\\
|
|
|
|
This package contains the port-knocking client.
|
|
|
|
endef
|
|
|
|
|
2006-08-03 11:39:18 +00:00
|
|
|
define Package/knockd
|
2006-10-28 22:43:08 +00:00
|
|
|
$(call Package/knock/Default)
|
|
|
|
TITLE+= server
|
|
|
|
DESCRIPTION+=\\\
|
|
|
|
\\\
|
|
|
|
This package contains the port-knocking server.
|
2006-08-03 11:39:18 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/knockd/conffiles
|
|
|
|
/etc/knockd.conf
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Configure
|
2006-10-28 22:43:08 +00:00
|
|
|
$(call Build/Configure/Default, \
|
|
|
|
, \
|
|
|
|
CFLAGS="$$$$CFLAGS $$$$CPPFLAGS" \
|
2006-08-03 11:39:18 +00:00
|
|
|
ac_cv_lib_pcap_pcap_open_live=yes \
|
2006-10-28 22:43:08 +00:00
|
|
|
)
|
2006-08-03 11:39:18 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Compile
|
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
|
|
|
DESTDIR="$(PKG_INSTALL_DIR)" \
|
|
|
|
all install
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/knock/install
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
2006-08-03 11:39:18 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/knock $(1)/usr/bin/
|
|
|
|
endef
|
|
|
|
|
2006-12-13 11:51:43 +00:00
|
|
|
define Package/knockd/install
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/etc
|
2007-01-05 15:24:20 +00:00
|
|
|
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knockd.conf $(1)/etc/
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
2006-08-03 11:39:18 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/knockd $(1)/usr/sbin/
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,knock))
|
|
|
|
$(eval $(call BuildPackage,knockd))
|