1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-02 06:03:50 +00:00

Cisco 1700/2600/3600/3700/7200 simulator.

WWW:	http://www.gns3.net/content/dynamips-028-rc3-community-version-released

PR:		ports/156454
Submitted by:	Pavel I Volkov <pavelivolkov@googlemail.com>
This commit is contained in:
Dennis Herrmann 2011-04-24 07:55:01 +00:00
parent d1a2403af3
commit c63bd304c9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=273124
8 changed files with 176 additions and 0 deletions

View File

@ -32,6 +32,7 @@
SUBDIR += dynagen
SUBDIR += dynagui
SUBDIR += dynamips
SUBDIR += dynamips-community
SUBDIR += dynamips-devel
SUBDIR += e-uae
SUBDIR += extract-xiso

View File

@ -0,0 +1,93 @@
# New ports collection makefile for: dynamips
# Date created: 17 Apr 2011
# Whom: Pavel I Volkov <pavelivolkov@googlemail.com>
#
# $FreeBSD$
#
PORTNAME= dynamips
PORTVERSION= 0.2.8
CATEGORIES= emulators
MASTER_SITES= SF/gns-3/Dynamips/${PORTVERSION}-RC3${PKGNAMESUFFIX}
PKGNAMESUFFIX= -community
DISTNAME= ${PORTNAME}-${PORTVERSION}-RC3${PKGNAMESUFFIX}
MAINTAINER= pavelivolkov@googlemail.com
COMMENT= Cisco 1700/2600/3600/3700/7200 Simulator
LIB_DEPENDS= elf.0:${PORTSDIR}/devel/libelf \
uuid.1:${PORTSDIR}/misc/e2fsprogs-libuuid
LICENSE= GPLv2
CONFLICTS= dynamips-[0-9]* dynamips-devel-[0-9]*
USE_GMAKE= yes
MAKE_JOBS_UNSAFE= yes
OPTIONS= UNSTABLE "development code (x64 Mac)" off
LDFLAGS+= -luuid
MAKE_ENV= \
DYNAMIPS_CODE=${DYNAMIPS_CODE} \
DYNAMIPS_ARCH=${DYNAMIPS_ARCH} \
PTHREAD_CFLAGS=${PTHREAD_CFLAGS} \
PTHREAD_LIBS=${PTHREAD_LIBS} \
LDFLAGS="${LDFLAGS}"
.include <bsd.port.pre.mk>
PLIST_FILES= bin/${PORTNAME} bin/nvram_export
PORTDOCS= *
.if !defined(NO_INSTALL_MANPAGES)
MAN1= ${PORTNAME}.1 nvram_export.1
MAN7= hypervisor_mode.7
.endif
.if defined(WITH_UNSTABLE)
DYNAMIPS_CODE= "unstable"
.else
DYNAMIPS_CODE= "stable"
.endif
.if ${ARCH} == "i386"
DYNAMIPS_ARCH= "x86"
.elif ${ARCH} == "amd64"
DYNAMIPS_ARCH= "amd64"
.elif ${ARCH} == "sparc64"
BROKEN= Does not compile
.elif ${ARCH} == "powerpc"
DYNAMIPS_ARCH= "ppc32"
.else
DYNAMIPS_ARCH= "nojit"
.endif
# It required libpcap version 0.9.4 or is higher.
.if ${OSVERSION} < 602100 || (${OSVERSION} >= 700000 && ${OSVERSION} < 700021)
BUILD_DEPENDS+= ${LOCALBASE}/lib/libpcap.a:${PORTSDIR}/net/libpcap
MAKE_ENV+= PCAP_LIB=${LOCALBASE}/lib/libpcap.a
#.warning Do not overlook, make libpcap with LIBPCAP_OVERWRITE_BASE parameter, for use with shared library.
#LIB_DEPENDS+= pcap.\(0.9.\)?[2-9]:${PORTSDIR}/net/libpcap
#MAKE_ENV+= PCAP_LIB=-lpcap.2
.endif
.if ${OSVERSION} < 700013
MAKE_ENV+= HAS_POSIX_MEMALIGN=0
.endif
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME}.${DYNAMIPS_CODE} ${PREFIX}/bin/${PORTNAME}
${INSTALL_PROGRAM} ${WRKSRC}/${DYNAMIPS_CODE}/nvram_export ${PREFIX}/bin
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README.community ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README.hypervisor ${DOCSDIR}
.endif
.if !defined(NO_INSTALL_MANPAGES)
${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${PREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/nvram_export.1 ${PREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/hypervisor_mode.7 ${PREFIX}/man/man7
.endif
.include <bsd.port.post.mk>

View File

@ -0,0 +1,2 @@
SHA256 (dynamips-0.2.8-RC3-community.tar.gz) = e808a50b6b9d24a90604885f90699f46b26a49e6ce9cf542aa288f135b2508ac
SIZE (dynamips-0.2.8-RC3-community.tar.gz) = 818199

View File

@ -0,0 +1,26 @@
--- common/gen_eth.c.orig 2011-04-17 11:32:08.000000000 +0400
+++ common/gen_eth.c 2011-04-17 11:36:47.000000000 +0400
@@ -22,6 +22,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
+#include <sys/ioctl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <pthread.h>
@@ -45,8 +46,13 @@
if (!(p = pcap_open_live(device,2048,TRUE,10,pcap_errbuf)))
goto pcap_error;
- /* Accept only incoming packets */
- pcap_setdirection(p,PCAP_D_IN);
+ pcap_setdirection(p,PCAP_D_INOUT);
+#ifdef BIOCFEEDBACK
+ {
+ int on = 1;
+ ioctl(pcap_fileno(p), BIOCFEEDBACK, &on);
+ }
+#endif
#else
p = pcap_open(device,2048,
PCAP_OPENFLAG_PROMISCUOUS |

View File

@ -0,0 +1,11 @@
--- nvram_export.1.orig Thu May 3 12:46:51 2007
+++ nvram_export.1 Thu May 3 12:47:10 2007
@@ -13,7 +13,7 @@
Please send bug reports to http://www.ipflow.utc.fr/bts/
.SH SEE ALSO
.br
-\fBdynmips\fP(1), \fBhypervisor_mode\fP(7)
+\fBdynamips\fP(1), \fBhypervisor_mode\fP(7)
.br
.UR
http://www.ipflow.utc.fr/index.php/

View File

@ -0,0 +1,20 @@
--- stable/Makefile.orig 2011-04-17 11:08:00.000000000 +0400
+++ stable/Makefile 2011-04-17 11:11:30.000000000 +0400
@@ -61,7 +61,7 @@
-DHAS_POSIX_MEMALIGN=$(HAS_POSIX_MEMALIGN)
#PCAP_LIB=/usr/local/lib/libpcap.a
-PCAP_LIB=-lpcap
+PCAP_LIB?=-lpcap
ifeq ($(shell uname), FreeBSD)
PTHREAD_LIBS?=-pthread
@@ -69,7 +69,7 @@
OSNAME=FreeBSD
CFLAGS+=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/libelf \
$(PTHREAD_CFLAGS) -D_FILE_OFFSET_BITS=64
- LIBS=-L$(LOCALBASE)/lib -L. -ldl -lelf $(PTHREAD_LIBS) $(LDFLAGS)
+ LIBS=-L$(LOCALBASE)/lib -L. -lelf $(PTHREAD_LIBS) $(LDFLAGS)
else
ifeq ($(shell uname), Linux)
PTHREAD_LIBS?=-lpthread

View File

@ -0,0 +1,20 @@
--- unstable/Makefile.orig 2011-04-17 11:26:40.000000000 +0400
+++ unstable/Makefile 2011-04-17 11:27:29.000000000 +0400
@@ -61,7 +61,7 @@
-DUSE_UNSTABLE
#PCAP_LIB=/usr/local/lib/libpcap.a
-PCAP_LIB=-lpcap
+PCAP_LIB?=-lpcap
ifeq ($(shell uname), FreeBSD)
PTHREAD_LIBS?=-pthread
@@ -69,7 +69,7 @@
OSNAME=FreeBSD
CFLAGS+=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/libelf \
$(PTHREAD_CFLAGS) -D_FILE_OFFSET_BITS=64
- LIBS=-L$(LOCALBASE)/lib -L. -ldl -lelf $(PTHREAD_LIBS) $(LDFLAGS)
+ LIBS=-L$(LOCALBASE)/lib -L. -lelf $(PTHREAD_LIBS) $(LDFLAGS)
else
ifeq ($(shell uname), Linux)
PTHREAD_LIBS?=-lpthread

View File

@ -0,0 +1,3 @@
Cisco 1700/2600/3600/3700/7200 simulator.
WWW: http://www.gns3.net/content/dynamips-028-rc3-community-version-released