aboutsummaryrefslogtreecommitdiff
path: root/security/arpCounterattack
diff options
context:
space:
mode:
authorJohn Marino <marino@FreeBSD.org>2014-07-07 15:16:05 +0000
committerJohn Marino <marino@FreeBSD.org>2014-07-07 15:16:05 +0000
commitb6c08b0df5503be01627016cd107b835b91a8c8d (patch)
tree4311c9ac50ce47a0a3629b7ae3f5511c88c6cf0b /security/arpCounterattack
parent5bca435906847bd7e6a200da8c66e9bf22539335 (diff)
downloadports-b6c08b0df5503be01627016cd107b835b91a8c8d.tar.gz
ports-b6c08b0df5503be01627016cd107b835b91a8c8d.zip
Notes
Diffstat (limited to 'security/arpCounterattack')
-rw-r--r--security/arpCounterattack/Makefile25
-rw-r--r--security/arpCounterattack/files/patch-address.hpp29
-rw-r--r--security/arpCounterattack/files/patch-arpCounterattack.cpp19
-rw-r--r--security/arpCounterattack/files/patch-arpCounterattack.hpp20
-rw-r--r--security/arpCounterattack/files/patch-configuration.hpp10
-rw-r--r--security/arpCounterattack/files/patch-ethernetInfo.hpp22
-rw-r--r--security/arpCounterattack/pkg-descr2
-rw-r--r--security/arpCounterattack/pkg-plist4
8 files changed, 113 insertions, 18 deletions
diff --git a/security/arpCounterattack/Makefile b/security/arpCounterattack/Makefile
index 00f5c064e5b9..0b4f0c7174cb 100644
--- a/security/arpCounterattack/Makefile
+++ b/security/arpCounterattack/Makefile
@@ -3,28 +3,27 @@
PORTNAME= arpCounterattack
PORTVERSION= 1.2.0
+PORTREVISION= 1
CATEGORIES= security
MASTER_SITES= http://isis.poly.edu/~bk/${PORTNAME}/ \
http://bk.macroblock.net/${PORTNAME}/
-EXTRACT_SUFX= .tbz
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= ports@FreeBSD.org
COMMENT= Detects and remedies ARP attacks
-LIB_DEPENDS= dnet.1:${PORTSDIR}/net/libdnet
+LIB_DEPENDS= libdnet.so:${PORTSDIR}/net/libdnet
+USES= compiler:c++11-lib tar:tbz
+USE_CSTD= c++11
SUB_FILES= pkg-message
USE_RC_SUBR= ${PORTNAME}
-NO_STAGE= yes
-.include <bsd.port.pre.mk>
+do-install:
+ @${MKDIR} ${STAGEDIR}${PREFIX}/etc/arpCounterattack
+ ${INSTALL_PROGRAM} ${WRKSRC}/arpCounterattack \
+ ${STAGEDIR}${PREFIX}/sbin
+ ${INSTALL_DATA} ${WRKSRC}/arpCounterattack.conf.sample \
+ ${WRKSRC}/oui.txt ${STAGEDIR}${PREFIX}/etc/arpCounterattack
-post-install:
- @if [ ! -f ${PREFIX}/etc/${PORTNAME}/${PORTNAME}.conf ]; then \
- ${CP} -p ${PREFIX}/etc/${PORTNAME}/${PORTNAME}.conf.sample \
- ${PREFIX}/etc/${PORTNAME}/${PORTNAME}.conf ; \
- fi
- @${CAT} ${PKGMESSAGE}
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/security/arpCounterattack/files/patch-address.hpp b/security/arpCounterattack/files/patch-address.hpp
new file mode 100644
index 000000000000..57fb6a54fa1e
--- /dev/null
+++ b/security/arpCounterattack/files/patch-address.hpp
@@ -0,0 +1,29 @@
+--- address.hpp.orig 2010-09-28 18:12:26.000000000 +0000
++++ address.hpp
+@@ -28,7 +28,7 @@
+ #include <sys/socket.h>
+
+ #include <arpa/inet.h>
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ #include <netinet/if_ether.h>
+ #endif
+ #ifdef __linux__
+@@ -44,7 +44,7 @@
+ std::string textToEthernet(const std::string &textEthernetAddress) {
+ ether_addr binaryEthernetAddress;
+ ether_aton_r(textEthernetAddress.c_str(), &binaryEthernetAddress);
+- #ifdef __FreeBSD__
++ #if defined(__FreeBSD__) || defined(__DragonFly__)
+ return std::string((char*)binaryEthernetAddress.octet, ETHER_ADDR_LEN);
+ #endif
+ #ifdef __linux__
+@@ -60,7 +60,7 @@ std::string textToEthernet(const std::st
+ std::string ethernetToText(const char *binaryEthernetAddress) {
+ ether_addr _binaryEthernetAddress;
+ char textEthernetAddress[17];
+- #ifdef __FreeBSD__
++ #if defined(__FreeBSD__) || defined(__DragonFly__)
+ memcpy(_binaryEthernetAddress.octet, binaryEthernetAddress, ETHER_ADDR_LEN);
+ #endif
+ #ifdef __linux__
diff --git a/security/arpCounterattack/files/patch-arpCounterattack.cpp b/security/arpCounterattack/files/patch-arpCounterattack.cpp
new file mode 100644
index 000000000000..c1a28076eca0
--- /dev/null
+++ b/security/arpCounterattack/files/patch-arpCounterattack.cpp
@@ -0,0 +1,19 @@
+--- arpCounterattack.cpp.orig 2010-11-04 01:26:49.000000000 +0000
++++ arpCounterattack.cpp
+@@ -25,7 +25,7 @@
+ #include <fstream>
+ #include <iostream>
+ #include <queue>
+-#include <tr1/unordered_map>
++#include <unordered_map>
+ #include <vector>
+
+ #ifdef __FreeBSD__
+@@ -47,7 +47,6 @@
+ #include "string.hpp"
+
+ using namespace std;
+-using namespace tr1;
+
+ const string programName = "ARP Counterattack 1.2.0";
+ string pidFileName = "/var/run/arpCounterattack.pid";
diff --git a/security/arpCounterattack/files/patch-arpCounterattack.hpp b/security/arpCounterattack/files/patch-arpCounterattack.hpp
new file mode 100644
index 000000000000..82a500e1e891
--- /dev/null
+++ b/security/arpCounterattack/files/patch-arpCounterattack.hpp
@@ -0,0 +1,20 @@
+--- arpCounterattack.hpp.orig 2010-11-04 01:26:14.000000000 +0000
++++ arpCounterattack.hpp
+@@ -24,7 +24,7 @@
+
+ #include <string>
+ #include <vector>
+-#include <tr1/unordered_map>
++#include <unordered_map>
+
+ #include <sys/socket.h>
+ #include <sys/time.h>
+@@ -55,7 +55,7 @@ struct Interface {
+ std::string replyName;
+ pcap_t *replyDescriptor;
+ ModeType mode;
+- std::tr1::unordered_map <uint32_t, std::string> pairs;
++ std::unordered_map <uint32_t, std::string> pairs;
+ };
+
+ struct ARPCorrection {
diff --git a/security/arpCounterattack/files/patch-configuration.hpp b/security/arpCounterattack/files/patch-configuration.hpp
new file mode 100644
index 000000000000..e145cabf3a80
--- /dev/null
+++ b/security/arpCounterattack/files/patch-configuration.hpp
@@ -0,0 +1,10 @@
+--- configuration.hpp.orig 2010-09-28 18:09:56.000000000 +0000
++++ configuration.hpp
+@@ -26,6 +26,7 @@
+ #define CONFIGURATION_HPP
+
+ #include <fstream>
++#include <stdlib.h>
+ #include <limits>
+ #include <map>
+ #include <string>
diff --git a/security/arpCounterattack/files/patch-ethernetInfo.hpp b/security/arpCounterattack/files/patch-ethernetInfo.hpp
new file mode 100644
index 000000000000..d1ab4447672c
--- /dev/null
+++ b/security/arpCounterattack/files/patch-ethernetInfo.hpp
@@ -0,0 +1,22 @@
+--- ethernetInfo.hpp.orig 2010-10-11 21:46:00.000000000 +0000
++++ ethernetInfo.hpp
+@@ -27,7 +27,7 @@
+
+ #include <fstream>
+ #include <string>
+-#include <tr1/unordered_map>
++#include <unordered_map>
+
+ #include <arpa/inet.h>
+
+@@ -46,8 +46,8 @@ class EthernetInfo {
+ const std::string &find(const std::string oui);
+ const std::string &find(const char *oui);
+ private:
+- std::tr1::unordered_map <std::string, std::string> ouiMap;
+- std::tr1::unordered_map <std::string, std::string>::const_iterator ouiItr;
++ std::unordered_map <std::string, std::string> ouiMap;
++ std::unordered_map <std::string, std::string>::const_iterator ouiItr;
+ std::string _oui;
+ std::string empty;
+ std::string multicast;
diff --git a/security/arpCounterattack/pkg-descr b/security/arpCounterattack/pkg-descr
index 8a166f61316f..e599f08f6cfe 100644
--- a/security/arpCounterattack/pkg-descr
+++ b/security/arpCounterattack/pkg-descr
@@ -11,5 +11,3 @@ and corrective gratuitous ARP reply can be sent from an Ethernet interface
other than the one that the attack was seen on.
WWW: http://acm.poly.edu/wiki/ARP_Counterattack
-
--Boris Kochergin <spawk@acm.poly.edu>
diff --git a/security/arpCounterattack/pkg-plist b/security/arpCounterattack/pkg-plist
index a37a292e0168..722bc19feafa 100644
--- a/security/arpCounterattack/pkg-plist
+++ b/security/arpCounterattack/pkg-plist
@@ -1,6 +1,4 @@
sbin/arpCounterattack
-@unexec if cmp -s %D/etc/arpCounterattack/arpCounterattack.conf.sample %D/etc/arpCounterattack/arpCounterattack.conf; then rm -f %D/etc/arpCounterattack/arpCounterattack.conf; fi
-etc/arpCounterattack/arpCounterattack.conf.sample
-@exec if [ ! -f %D/etc/arpCounterattack/arpCounterattack.conf ] ; then cp -p %D/%F %B/arpCounterattack.conf; fi
+@sample etc/arpCounterattack/arpCounterattack.conf.sample
etc/arpCounterattack/oui.txt
@dirrmtry etc/arpCounterattack