- Add dynamips-devel

Cisco 3600/7200 simulator.

PR:             110614
Submitted by:   Pavel Volkov<pol@opk.ru>
Repocopy by:    marcus
This commit is contained in:
Martin Wilke 2007-03-26 09:37:11 +00:00
parent 6e3ad7831e
commit 82ddba6e7c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=188372
15 changed files with 217 additions and 40 deletions

View file

@ -27,6 +27,7 @@
SUBDIR += dtcyber
SUBDIR += dynagen
SUBDIR += dynamips
SUBDIR += dynamips-devel
SUBDIR += e-uae
SUBDIR += extract-xiso
SUBDIR += fceu

View file

@ -1,17 +1,17 @@
# New ports collection makefile for: dynamips
# Date created: 31 Jan 2006
# Whom: Max Khon <fjoe@FreeBSD.org>
# Date created: 21 Mar 2007
# Whom: Pavel Volkov <pol@opk.ru>
#
# $FreeBSD$
#
PORTNAME= dynamips
PORTVERSION= 0.2.5
PORTREVISION= 2
DISTVERSION= 0.2.7-RC1
CATEGORIES= emulators
MASTER_SITES= http://www.ipflow.utc.fr/dynamips/
PKGNAMESUFFIX= -devel
MAINTAINER= fjoe@FreeBSD.org
MAINTAINER= pol@opk.ru
COMMENT= Cisco 3600/7200 Simulator
LIB_DEPENDS= elf.0:${PORTSDIR}/devel/libelf
@ -19,22 +19,33 @@ LIB_DEPENDS= elf.0:${PORTSDIR}/devel/libelf
USE_GMAKE= yes
USE_GCC= 3.2+
USE_GETOPT_LONG=yes
ALL_TARGET= ${PORTNAME}
ALL_TARGET= ${PORTNAME} nvram_export
MAKE_ENV= DYNAMIPS_ARCH=${DYNAMIPS_ARCH}\
PTHREAD_CFLAGS=${PTHREAD_CFLAGS}\
PTHREAD_LIBS=${PTHREAD_LIBS}\
LDFLAGS="${LDFLAGS}"
PLIST_FILES= bin/${PORTNAME}
PLIST_FILES= bin/${PORTNAME} bin/nvram_export
.if !defined(NOPORTDOCS)
PORTDOCS= README
PORTDOCS= README README.hypervisor
.endif
.if !defined(NO_INSTALL_MANPAGES)
MAN1= ${PORTNAME}.1 nvram_export.1
MAN7= hypervisor_mode.7
.endif
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/nvram_export ${PREFIX}/bin
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README ${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.pre.mk>

View file

@ -1,3 +1,3 @@
MD5 (dynamips-0.2.5.tar.gz) = b87ef442f7537373ccbe69c3f6dca301
SHA256 (dynamips-0.2.5.tar.gz) = eab3f45b0e040be5748523a4ae0f2fae28ee9dd3068b56663459c7e84451de75
SIZE (dynamips-0.2.5.tar.gz) = 312130
MD5 (dynamips-0.2.7-RC1.tar.gz) = 1e736add1285fef3bf7671f6217aee4c
SHA256 (dynamips-0.2.7-RC1.tar.gz) = 6ff4458853b07ac63c6f83dcbea687db2b97d38177e15701da7153cd037bf80a
SIZE (dynamips-0.2.7-RC1.tar.gz) = 480761

View file

@ -1,5 +1,5 @@
--- Makefile.orig Thu Sep 14 17:59:13 2006
+++ Makefile Tue Nov 14 10:27:26 2006
--- Makefile.orig Thu Feb 8 15:23:36 2007
+++ Makefile Thu Feb 8 15:34:39 2007
@@ -12,6 +12,9 @@
# (WinPcap is used for Cygwin)
HAS_PCAP?=1
@ -8,14 +8,14 @@
+HAS_POSIX_MEMALIGN?=0
+
# Current dynamips release
VERSION=0.2.5
VERSION_DEV=$(VERSION)-$(shell date +%Y%m%d-%H)
@@ -30,15 +33,16 @@
VERSION_TRAIN=0.2.6
VERSION_SUB=-RC5
@@ -34,16 +37,17 @@
-DJIT_ARCH=\"$(DYNAMIPS_ARCH)\" \
-DARCH_INC_FILE=$(ARCH_INC_FILE) -DDYNAMIPS_VERSION=\"$(VERSION)\" \
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
- -DHAS_RFC2553=$(HAS_RFC2553)
+ -DHAS_RFC2553=$(HAS_RFC2553) -DHAS_POSIX_MEMALIGN=$(HAS_POSIX_MEMALIGN)
+ -DHAS_RFC2553=$(HAS_RFC2553) -DHAS_POSIX_MEMALIGN=$(HAS_POSIX_MEMALIGN)
-PCAP_LIB=/usr/local/lib/libpcap.a
-#PCAP_LIB=-lpcap
@ -24,11 +24,12 @@
ifeq ($(shell uname), FreeBSD)
PTHREAD_LIBS?=-pthread
- CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf $(PTHREAD_CFLAGS)
- LIBS=-L/usr/local/lib -L. -lelf $(PTHREAD_LIBS)
- CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf $(PTHREAD_CFLAGS) \
+ LOCALBASE?=/usr/local
+ CFLAGS+=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/libelf $(PTHREAD_CFLAGS)
+ CFLAGS+=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/libelf $(PTHREAD_CFLAGS) \
-D_FILE_OFFSET_BITS=64
- LIBS=-L/usr/local/lib -L. -lelf $(PTHREAD_LIBS)
+ LIBS=-L$(LOCALBASE)/lib -L. -lelf $(PTHREAD_LIBS) $(LDFLAGS)
else
ifeq ($(shell uname -s), Darwin)
CFLAGS+=-I/usr/local/include -mdynamic-no-pic
ifeq ($(shell uname), Linux)
PTHREAD_LIBS?=-lpthread

View file

@ -0,0 +1,11 @@
--- README.hypervisor.orig Wed Mar 21 10:00:28 2007
+++ README.hypervisor Wed Mar 21 10:01:22 2007
@@ -8,7 +8,7 @@
Running dynamips in hypervisor mode
===================================
-dynamips -H <tcp_port>
+dynamips -H [ip_address:]<tcp_port>
Managing the hypervisor
=======================

View file

@ -0,0 +1,11 @@
--- dynamips.1.orig Wed Mar 21 14:26:01 2007
+++ dynamips.1 Wed Mar 21 14:26:30 2007
@@ -44,7 +44,7 @@
.SH OPTIONS
A summary of options is included below.
.TP
-.B -H <tcp_port>
+.B -H [ip_address:]<tcp_port>
Enable hypervisor mode.
.br
The hypervisor mode of dynamips allows you to run simultaneously

View file

@ -0,0 +1,53 @@
--- dynamips.c.orig Wed Mar 21 10:07:17 2007
+++ dynamips.c Wed Mar 21 13:39:57 2007
@@ -61,6 +61,7 @@
/* Hypervisor */
int hypervisor_mode = 0;
int hypervisor_tcp_port = 0;
+char hypervisor_ip_address[263]; /* 256(MAXHOSTNAMELEN)+1(:)+5(port)+NULL */
/* Log file */
char *log_file_name = NULL;
@@ -227,7 +228,7 @@
printf("Usage: %s [options] <ios_image>\n\n",argv[0]);
printf("Available options:\n"
- " -H <tcp_port> : Run in hypervisor mode\n\n"
+ " -H [ip_address:]<tcp_port> : Run in hypervisor mode\n\n"
" -P <platform> : Platform to emulate (7200, 3600, "
"2691, 3725 or 3745) "
"(default: 7200)\n\n"
@@ -1061,6 +1062,7 @@
static int run_hypervisor(int argc,char *argv[])
{
char *options_list = "H:l:hN:";
+ char *index;
int i,option;
for(i=1;i<argc;i++)
@@ -1079,7 +1081,15 @@
{
/* Hypervisor TCP port */
case 'H':
- hypervisor_tcp_port = atoi(optarg);
+ strncpy(hypervisor_ip_address,optarg,sizeof(hypervisor_ip_address));
+ index=strrchr(hypervisor_ip_address,':');
+ if (index != NULL) {
+ *index++='\000';
+ hypervisor_tcp_port = atoi(index);
+ } else {
+ hypervisor_tcp_port = atoi(hypervisor_ip_address);
+ hypervisor_ip_address[0]='\000';
+ }
break;
/* Log file */
@@ -1244,7 +1254,7 @@
/* Free resources used by instance */
vm_release(vm);
} else {
- hypervisor_tcp_server(hypervisor_tcp_port);
+ hypervisor_tcp_server(hypervisor_ip_address,hypervisor_tcp_port);
}
dynamips_reset();

View file

@ -0,0 +1,20 @@
--- hypervisor.c.orig Wed Mar 21 11:11:12 2007
+++ hypervisor.c Wed Mar 21 11:29:55 2007
@@ -535,7 +535,7 @@
}
/* Hypervisor TCP server */
-int hypervisor_tcp_server(int tcp_port)
+int hypervisor_tcp_server(char* ip_address,int tcp_port)
{
int fd_array[HYPERVISOR_MAX_FD];
struct sockaddr_storage remote_addr;
@@ -565,7 +565,7 @@
if (!tcp_port)
tcp_port = HYPERVISOR_TCP_PORT;
- fd_count = ip_listen(tcp_port,SOCK_STREAM,HYPERVISOR_MAX_FD,fd_array);
+ fd_count = ip_listen(ip_address,tcp_port,SOCK_STREAM,HYPERVISOR_MAX_FD,fd_array);
if (fd_count <= 0) {
fprintf(stderr,"Hypervisor: unable to create TCP sockets.\n");

View file

@ -0,0 +1,10 @@
--- hypervisor.h.orig Wed Mar 21 10:58:06 2007
+++ hypervisor.h Wed Mar 21 11:09:40 2007
@@ -136,6 +136,6 @@
int hypervisor_stopsig(void);
/* Hypervisor TCP server */
-int hypervisor_tcp_server(int tcp_port);
+int hypervisor_tcp_server(char *ip_address,int tcp_port);
#endif

View file

@ -0,0 +1,11 @@
--- hypervisor_mode.7.orig Wed Mar 21 11:02:14 2007
+++ hypervisor_mode.7 Wed Mar 21 11:02:40 2007
@@ -5,7 +5,7 @@
or Frame-Relay networks.
.SH SYNOPSIS
.B dynamips -H
-\fItcp_port\fP
+\fI[ip_address:]tcp_port\fP
.SH DESCRIPTION
You can connect directly to the TCP control port with telnet, or use

View file

@ -0,0 +1,38 @@
--- net.c.orig Wed Mar 21 11:34:17 2007
+++ net.c Wed Mar 21 11:55:29 2007
@@ -353,7 +353,7 @@
#if HAS_RFC2553
/* Listen on the specified port */
-int ip_listen(int port,int sock_type,int max_fd,int fd_array[])
+int ip_listen(char *ip_address,int port,int sock_type,int max_fd,int fd_array[])
{
struct addrinfo hints,*res,*res0;
char port_str[20];
@@ -370,7 +370,7 @@
snprintf(port_str,sizeof(port_str),"%d",port);
- if ((error = getaddrinfo(NULL,port_str,&hints,&res0)) != 0) {
+ if ((error = getaddrinfo((strlen(ip_address)==0)?NULL:ip_address,port_str,&hints,&res0)) != 0) {
fprintf(stderr,"ip_listen: %s", gai_strerror(error));
return(-1);
}
@@ -405,7 +405,7 @@
}
#else
/* Listen on the specified port */
-int ip_listen(int port,int sock_type,int max_fd,int fd_array[])
+int ip_listen(char *ip_address,int port,int sock_type,int max_fd,int fd_array[])
{
struct sockaddr_in sin;
int i,sck,reuse=1;
@@ -422,6 +422,8 @@
memset(&sin,0,sizeof(sin));
sin.sin_family = PF_INET;
sin.sin_port = htons(port);
+ if (strlen(ip_address) != 0 && inet_addr(ip_address) != INADDR_NONE)
+ sin.sin_addr = inet_addr(ip_address);
setsockopt(fd_array[0],SOL_SOCKET,SO_REUSEADDR,&reuse,sizeof(reuse));

View file

@ -0,0 +1,10 @@
--- net.h.orig Wed Mar 21 11:32:05 2007
+++ net.h Wed Mar 21 11:33:28 2007
@@ -218,6 +218,6 @@
int udp_connect(int local_port,char *remote_host,int remote_port);
/* Listen on the specified port */
-int ip_listen(int port,int sock_type,int max_fd,int fd_array[]);
+int ip_listen(char *ip_address,int port,int sock_type,int max_fd,int fd_array[]);
#endif

View file

@ -1,11 +0,0 @@
--- nojit_trans.c.orig Tue Nov 14 04:12:11 2006
+++ nojit_trans.c Tue Nov 14 04:12:21 2006
@@ -51,7 +51,7 @@
EMPTY(void mips64_set_pc(insn_block_t *b,m_uint64_t new_pc));
EMPTY(void mips64_set_ra(insn_block_t *b,m_uint64_t ret_pc));
EMPTY(void mips64_emit_breakpoint(insn_block_t *b));
-EMPTY(void mips64_emit_invalid_delay_slot(insn_block_t *b));
+EMPTY(int mips64_emit_invalid_delay_slot(insn_block_t *b));
EMPTY(void mips64_inc_cp0_count_reg(insn_block_t *b));
EMPTY(void mips64_check_pending_irq(insn_block_t *b));
EMPTY(void mips64_inc_perf_counter(insn_block_t *b));

View file

@ -1,11 +1,20 @@
--- utils.h.orig Fri Feb 24 06:59:58 2006
+++ utils.h Fri Feb 24 07:00:14 2006
@@ -34,6 +34,8 @@
--- utils.h.orig Wed Feb 14 20:37:58 2007
+++ utils.h Tue Feb 20 18:56:54 2007
@@ -12,6 +12,8 @@
#include <sys/time.h>
#include <time.h>
#include <netinet/in.h>
+#include <pthread.h>
+#include <signal.h>
/* True/False definitions */
#ifndef FALSE
@@ -35,6 +37,8 @@
#elif defined(__i386) || defined(__i386__) || defined(i386)
#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
#elif defined(__x86_64__)
#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
+#elif defined(__ia64__)
+#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
+#elif defined(__ia64__)
#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
#endif
#ifndef ARCH_BYTE_ORDER

View file

@ -1,3 +1,5 @@
Cisco 3600/7200 simulator.
WWW: http://www.ipflow.utc.fr/index.php/Cisco_7200_Simulator
http://www.ipflow.utc.fr/blog/
http://hacki.at/7200emu/index.php