NDPMon is an equivalent of ArpWatch for IPv6.

NDPMon, Neighbor Discovery Protocol Monitor, is a tool working with
ICMPv6 packets. NDPMon observes the local network to see if nodes
using neighbor discovery messages behave properly. When it detects
a suspicious Neighbor Discovery message, it notifies the administrator
by writing in the syslog and in some cases by sending an email
report.

WWW: http://ndpmon.sourceforge.net

Janos Mohacsi <janos.mohacsi@bsd.hu>

PR:		ports/106840
Submitted by:	janos.mohacsi at bsd.hu
This commit is contained in:
Martin Wilke 2006-12-21 20:20:49 +00:00
parent 165ff1ee24
commit 9a676e7dbc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=180384
18 changed files with 302 additions and 0 deletions

View file

@ -99,6 +99,7 @@
SUBDIR += nat
SUBDIR += nav
SUBDIR += nbtscan
SUBDIR += ndpmon
SUBDIR += nefu
SUBDIR += net-snmp
SUBDIR += net-snmp-tkmib

48
net-mgmt/ndpmon/Makefile Normal file
View file

@ -0,0 +1,48 @@
# New ports collection makefile for: ndpmon
# Date created: 2006-12-17
# Whom: janos.mohacsi@bsd.hu
#
# $FreeBSD$
#
PORTNAME= ndpmon
PORTVERSION= 1.0
CATEGORIES= net-mgmt ipv6
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
DISTFILES= ${PORTNAME}-${PORTVERSION}b.tgz
MAINTAINER= janos.mohacsi@bsd.hu
COMMENT= On-link icmpv6 message monitoring and reporting daemon
USE_GNOME= libxml2
GNU_CONFIGURE= yes
MAN8= ndpmon.8
PORTDOCS= INSTALL README
post-patch:
@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
${WRKSRC}/ndpmon.c \
${WRKSRC}/ndpmon.8 \
${WRKSRC}/config_ndpmon.xml \
${WRKSRC}/neighbor_list.xml
do-install:
${INSTALL_MAN} ${WRKSRC}/ndpmon.8 ${PREFIX}/man/man8
${INSTALL_PROGRAM} ${WRKSRC}/ndpmon ${PREFIX}/sbin
${MKDIR} ${DATADIR}
${INSTALL_DATA} ${WRKSRC}/*.dtd \
${DATADIR}
${INSTALL_DATA} ${WRKSRC}/config_ndpmon.xml ${PREFIX}/etc/config_ndpmon.xml-dist
${MKDIR} ${PREFIX}/var
${INSTALL_DATA} ${WRKSRC}/neighbor_list.xml ${PREFIX}/var/ndpmon_neighbor_list.xml
.if !defined(NOPORTDOCS)
post-install:
${MKDIR} ${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif
.include <bsd.port.mk>

3
net-mgmt/ndpmon/distinfo Normal file
View file

@ -0,0 +1,3 @@
MD5 (ndpmon-1.0b.tgz) = 80c2076de3399fde5fd9959d487538c1
SHA256 (ndpmon-1.0b.tgz) = c8e26f1bdf69a9609b482afe05dacbab5c129fc80964b0fdf1e272948f098651
SIZE (ndpmon-1.0b.tgz) = 49818

View file

@ -0,0 +1,12 @@
$FreeBSD$
--- config_ndpmon.xml.orig
+++ config_ndpmon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE config_ndpmon SYSTEM "config_ndpmon.dtd">
+<!DOCTYPE config_ndpmon SYSTEM "%%PREFIX%%/share/ndpmon/config_ndpmon.dtd">
<config_ndpmon>
<ignor_autoconf>1</ignor_autoconf>
<syslog_facility>LOG_LOCAL1</syslog_facility>

View file

@ -0,0 +1,16 @@
$FreeBSD$
--- monitoring.h.orig
+++ monitoring.h
@@ -36,8 +36,9 @@
#include <time.h>
+#include <sys/types.h>
#include <netinet/in.h>
-#include <netinet/ether.h>
+#include <net/ethernet.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
#include <string.h>

View file

@ -0,0 +1,16 @@
$FreeBSD$
--- monitoring_na.h.orig
+++ monitoring_na.h
@@ -34,7 +34,9 @@
#ifndef _MONITORING_NA_
#define _MONITORING_NA_ 1
-#include <netinet/ether.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <net/ethernet.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>

View file

@ -0,0 +1,16 @@
$FreeBSD$
--- monitoring_ns.h.orig
+++ monitoring_ns.h
@@ -33,7 +33,9 @@
#ifndef _MONITORING_NS_
#define _MONITORING_NS_ 1
-#include <netinet/ether.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <net/ethernet.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
#include <netinet/in.h>

View file

@ -0,0 +1,16 @@
$FreeBSD$
--- monitoring_ra.h.orig
+++ monitoring_ra.h
@@ -33,7 +33,9 @@
#ifndef _MONITORING_RA_
#define _MONITORING_RA_ 1
-#include <netinet/ether.h>
+#include <sys/types.h>
+#include <net/ethernet.h>
+#include <netinet/in.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>

View file

@ -0,0 +1,16 @@
$FreeBSD$
--- monitoring_rd.h.orig
+++ monitoring_rd.h
@@ -33,7 +33,9 @@
#ifndef _MONITORING_RD_
#define _MONITORING_RD_ 1
-#include <netinet/ether.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <net/ethernet.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>

View file

@ -0,0 +1,35 @@
$FreeBSD$
--- ndpmon.8.orig
+++ ndpmon.8
@@ -57,12 +57,12 @@
.B -f
flag is used to change the path of the configuration file.
The default is
-.IR /usr/local/ndpmon/config_ndpmon.xml
+.IR %%PREFIX%%/etc/config_ndpmon.xml
.LP
The
.B -e
flag is used to change the path to the DTD file for the configuration file. The default is
-.I /usr/local/ndpmon/config_ndpmon.dtd
+.I %%PREFIX%%/share/ndpmon/config_ndpmon.dtd
.LP
The
.B -n
@@ -83,12 +83,12 @@
The
.B -d
flag is used to change the path to the DTD file for the neighbor cache. The default is
-.I /usr/local/ndpmon/neighbor_list.dtd
+.I %%PREFIX%%/share/ndpmon/neighbor_list.dtd
.LP
The
.B -g
flag is used to change the path to the neighbor cache. The default is
-.I /usr/local/ndpmon/neighbor_list.xml
+.I %%PREFIX%%/var/ndpmon_neighbor_list.xml
.LP
Note that an empty
.I neighbor_cache.xml

View file

@ -0,0 +1,29 @@
$FreeBSD$
--- ndpmon.c.orig
+++ ndpmon.c
@@ -43,10 +43,10 @@
char admin_mail[128] = "";
char syslog_facility[16] = "";
int ignor_autoconf = 0;
-char config_path[128] = "/usr/local/ndpmon/config_ndpmon.xml";
-char cache_path[128] = "/usr/local/ndpmon/neighbor_list.xml";
-char dtd_path[128] = "/usr/local/ndpmon/neighbor_list.dtd";
-char dtd_config_path[128] = "/usr/local/ndpmon/config_ndpmon.dtd";
+char config_path[128] = "%%PREFIX%%/etc/config_ndpmon.xml";
+char cache_path[128] = "%%PREFIX%%/var/ndpmon_neighbor_list.xml";
+char dtd_path[128] = "%%PREFIX%%/share/ndpmon/neighbor_list.dtd";
+char dtd_config_path[128] = "%%PREFIX%%/share/ndpmon/config_ndpmon.dtd";
#ifdef _MACRESOLUTION_
manufacturer_t *manuf = NULL;
@@ -438,7 +438,7 @@
/* open device for reading */
- descr = pcap_open_live(interface,BUFSIZ,1,-1,errbuf);
+ descr = pcap_open_live(interface,BUFSIZ,1,1000,errbuf);
if(descr == NULL)
{
fprintf(stderr,"pcap_open_live(): %s\n",errbuf); exit(1);

View file

@ -0,0 +1,14 @@
$FreeBSD$
--- ndpmon.h.orig
+++ ndpmon.h
@@ -38,7 +38,7 @@
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <netinet/ether.h>
+#include <net/ethernet.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
#include <net/ethernet.h>

View file

@ -0,0 +1,12 @@
$FreeBSD$
--- neighbor_list.xml.orig
+++ neighbor_list.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE neighbor_list
-SYSTEM "/usr/local/ndpmon/neighbor_list.dtd">
+SYSTEM "%%PREFIX%%/share/ndpmon/neighbor_list.dtd">
<neighbor_list>
</neighbor_list>

View file

@ -0,0 +1,19 @@
$FreeBSD$
--- parser.c.orig
+++ parser.c
@@ -65,11 +65,13 @@
/** note: it may be a good option to save values, and restore
* them when exiting
*/
+ /*
write_proc("/proc/sys/net/ipv6/conf/all/autoconf",flag);
write_proc("/proc/sys/net/ipv6/conf/all/accept_ra",flag);
write_proc("/proc/sys/net/ipv6/conf/all/accept_ra_defrtr",flag);
write_proc("/proc/sys/net/ipv6/conf/all/accept_ra_pinfo",flag);
write_proc("/proc/sys/net/ipv6/conf/all/accept_redirects",flag);
+ */
}
xmlXPathFreeObject (xmlobject);

View file

@ -0,0 +1,16 @@
$FreeBSD$
--- print_packet_info.h.orig
+++ print_packet_info.h
@@ -37,7 +37,9 @@
#include <stdio.h>
#include <stdlib.h>
-#include <netinet/ether.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <net/ethernet.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>

View file

@ -0,0 +1,14 @@
$FreeBSD$
--- utils.h.orig
+++ utils.h
@@ -36,7 +36,7 @@
#define ETHERNET_SIZE 14 /* ethernet headers are 14 bytes */
#define IPV6_SIZE 40 /* ipv6 headers without fragment ... are 40 bytes */
#define ICMP6_HEADER_SIZE 8
-#define ETHERTYPE_IPV6 0x86dd
+/*#define ETHERTYPE_IPV6 0x86dd */
/*Size to build char* address in a readable form*/
#define IP6_STR_SIZE 40 /*xxxx:xxxx:xxx:xxxx:xxxx:xxxx:xxxx:xxxx*/

12
net-mgmt/ndpmon/pkg-descr Normal file
View file

@ -0,0 +1,12 @@
NDPMon is an equivalent of ArpWatch for IPv6.
NDPMon, Neighbor Discovery Protocol Monitor, is a tool working with
ICMPv6 packets. NDPMon observes the local network to see if nodes
using neighbor discovery messages behave properly. When it detects
a suspicious Neighbor Discovery message, it notifies the administrator
by writing in the syslog and in some cases by sending an email
report.
WWW: http://ndpmon.sourceforge.net
Janos Mohacsi <janos.mohacsi@bsd.hu>

View file

@ -0,0 +1,7 @@
sbin/ndpmon
%%DATADIR%%/config_ndpmon.dtd
%%DATADIR%%/neighbor_list.dtd
@dirrmtry %%DATADIR%%
var/ndpmon_neighbor_list.xml
@dirrmtry var
etc/config_ndpmon.xml-dist