View | Details | Raw Unified | Return to bug 116344
Collapse All | Expand All

(-)/usr/ports/emulators/dynamips-devel/Makefile (-1 / +3 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	dynamips
8
PORTNAME=	dynamips
9
DISTVERSION=	0.2.7-RC3
9
DISTVERSION=	0.2.8-RC1
10
CATEGORIES=	emulators
10
CATEGORIES=	emulators
11
MASTER_SITES=	http://www.ipflow.utc.fr/dynamips/
11
MASTER_SITES=	http://www.ipflow.utc.fr/dynamips/
12
PKGNAMESUFFIX=	-devel
12
PKGNAMESUFFIX=	-devel
Lines 15-20 Link Here
15
COMMENT=	Cisco 3600/7200 Simulator
15
COMMENT=	Cisco 3600/7200 Simulator
16
16
17
LIB_DEPENDS=	elf.0:${PORTSDIR}/devel/libelf
17
LIB_DEPENDS=	elf.0:${PORTSDIR}/devel/libelf
18
19
CONFLICTS=	dynamips-[0-9]*
18
20
19
USE_GMAKE=	yes
21
USE_GMAKE=	yes
20
USE_GCC=	3.2+
22
USE_GCC=	3.2+
(-)/usr/ports/emulators/dynamips-devel/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (dynamips-0.2.7-RC3.tar.gz) = 9d1d5ab929fda30ea3b4b8d9284edc70
1
MD5 (dynamips-0.2.8-RC1.tar.gz) = 39d08f2d20cdd78ef05c50ae86c4b522
2
SHA256 (dynamips-0.2.7-RC3.tar.gz) = cd1d23fa0122bcec70a4028ce60ae100fbe3d7a599f1bbb1f30f34faa35546c1
2
SHA256 (dynamips-0.2.8-RC1.tar.gz) = 266cd3fe12f643f8c6aaf59ec8b99b20d6fb53ed8032c1984477065ca97ee994
3
SIZE (dynamips-0.2.7-RC3.tar.gz) = 522645
3
SIZE (dynamips-0.2.8-RC1.tar.gz) = 569599
(-)/usr/ports/emulators/dynamips-devel/files/patch-Makefile (-31 / +7 lines)
Lines 1-34 Link Here
1
--- Makefile.orig	Thu Feb  8 15:23:36 2007
1
--- Makefile.orig	Thu Sep 13 19:55:14 2007
2
+++ Makefile	Thu Feb  8 15:34:39 2007
2
+++ Makefile	Thu Sep 13 19:55:30 2007
3
@@ -12,6 +12,9 @@
3
@@ -52,7 +52,7 @@
4
 # (WinPcap is used for Cygwin)
4
    LOCALBASE?=/usr/local
5
 HAS_PCAP?=1
5
    CFLAGS+=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/libelf \
6
 
6
 	$(PTHREAD_CFLAGS) -D_FILE_OFFSET_BITS=64
7
+# Change this to 1 if your system has posix_memalign
7
-   LIBS=-L$(LOCALBASE)/lib -L. -ldl -lelf $(PTHREAD_LIBS) $(LDFLAGS)
8
+HAS_POSIX_MEMALIGN?=0
9
+
10
 # Current dynamips release
11
 VERSION_TRAIN=0.2.6
12
 VERSION_SUB=-RC5
13
@@ -34,16 +37,17 @@
14
 	-DJIT_ARCH=\"$(DYNAMIPS_ARCH)\" \
15
 	-DARCH_INC_FILE=$(ARCH_INC_FILE) -DDYNAMIPS_VERSION=\"$(VERSION)\" \
16
 	-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
17
-	-DHAS_RFC2553=$(HAS_RFC2553)
18
+	-DHAS_RFC2553=$(HAS_RFC2553) -DHAS_POSIX_MEMALIGN=$(HAS_POSIX_MEMALIGN)
19
 
20
-PCAP_LIB=/usr/local/lib/libpcap.a
21
-#PCAP_LIB=-lpcap
22
+#PCAP_LIB=/usr/local/lib/libpcap.a
23
+PCAP_LIB=-lpcap
24
 
25
 ifeq ($(shell uname), FreeBSD)
26
    PTHREAD_LIBS?=-pthread
27
-   CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf $(PTHREAD_CFLAGS) \
28
+   LOCALBASE?=/usr/local
29
+   CFLAGS+=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/libelf $(PTHREAD_CFLAGS) \
30
          -D_FILE_OFFSET_BITS=64
31
-   LIBS=-L/usr/local/lib -L. -lelf $(PTHREAD_LIBS)
32
+   LIBS=-L$(LOCALBASE)/lib -L. -lelf $(PTHREAD_LIBS) $(LDFLAGS)
8
+   LIBS=-L$(LOCALBASE)/lib -L. -lelf $(PTHREAD_LIBS) $(LDFLAGS)
33
 else
9
 else
34
 ifeq ($(shell uname), Linux)
10
 ifeq ($(shell uname), Linux)
(-)/usr/ports/emulators/dynamips-devel/files/patch-README (-3 / +8 lines)
Lines 1-6 Link Here
1
--- README.orig	Fri Apr  6 20:53:59 2007
1
--- README.orig	Wed Sep 12 14:35:13 2007
2
+++ README	Fri Apr  6 20:57:02 2007
2
+++ README	Thu Sep 13 19:47:58 2007
3
@@ -50,7 +50,7 @@
3
@@ -52,11 +52,12 @@
4
   -R <rom_file>      : Load an alternate ROM (default: embedded)
4
   -R <rom_file>      : Load an alternate ROM (default: embedded)
5
   -k <clock_div>     : Set the clock divisor (default: 4)
5
   -k <clock_div>     : Set the clock divisor (default: 4)
6
 
6
 
Lines 8-11 Link Here
8
+  -T [ip_address:]<port> : Console is on TCP <port>
8
+  -T [ip_address:]<port> : Console is on TCP <port>
9
   -U <si_desc>       : Console in on serial interface <si_desc>
9
   -U <si_desc>       : Console in on serial interface <si_desc>
10
                        (default is on the terminal)
10
                        (default is on the terminal)
11
 
12
   -A <port>          : AUX is on TCP <port>
13
+                       (AUX binding IP == Console binding IP)
14
   -B <si_desc>       : AUX is on serial interface <si_desc>
15
                        (default is no AUX port)
11
 
16
 
(-)/usr/ports/emulators/dynamips-devel/files/patch-README.hypervisor (-11 lines)
Lines 1-11 Link Here
1
--- README.hypervisor.orig	Wed Mar 21 10:00:28 2007
2
+++ README.hypervisor	Wed Mar 21 10:01:22 2007
3
@@ -8,7 +8,7 @@
4
 Running dynamips in hypervisor mode
5
 ===================================
6
 
7
-dynamips -H <tcp_port>
8
+dynamips -H [ip_address:]<tcp_port>
9
 
10
 Managing the hypervisor
11
 =======================
(-)/usr/ports/emulators/dynamips-devel/files/patch-dev_vtty.c (-9 / +6 lines)
Lines 1-5 Link Here
1
--- dev_vtty.c.orig	Fri Apr  6 16:44:07 2007
1
--- dev_vtty.c.orig	Fri Sep  7 12:03:11 2007
2
+++ dev_vtty.c	Fri Apr  6 19:43:37 2007
2
+++ dev_vtty.c	Fri Sep 14 10:24:02 2007
3
@@ -24,6 +24,8 @@
3
@@ -24,6 +24,8 @@
4
 #include <fcntl.h>
4
 #include <fcntl.h>
5
 #include <errno.h>
5
 #include <errno.h>
Lines 13-33 Link Here
13
 #include "dev_c2600.h"
13
 #include "dev_c2600.h"
14
 #include "dev_vtty.h"
14
 #include "dev_vtty.h"
15
 
15
 
16
+extern char hypervisor_ip_address[];
16
+extern char *hypervisor_ip_address;
17
+
17
+
18
 /* VTTY list */
18
 /* VTTY list */
19
 static pthread_mutex_t vtty_list_mutex = PTHREAD_MUTEX_INITIALIZER;
19
 static pthread_mutex_t vtty_list_mutex = PTHREAD_MUTEX_INITIALIZER;
20
 static vtty_t *vtty_list = NULL;
20
 static vtty_t *vtty_list = NULL;
21
@@ -132,7 +136,11 @@
21
@@ -132,7 +136,8 @@
22
 
22
 
23
    memset(&serv,0,sizeof(serv));
23
    memset(&serv,0,sizeof(serv));
24
    serv.sin_family = AF_INET;
24
    serv.sin_family = AF_INET;
25
-   serv.sin_addr.s_addr = htonl(INADDR_ANY);
25
-   serv.sin_addr.s_addr = htonl(INADDR_ANY);
26
+   if (strlen(hypervisor_ip_address) != 0 &&
26
+   if (hypervisor_ip_address && strlen(hypervisor_ip_address))
27
+	inet_addr(hypervisor_ip_address) != INADDR_NONE)
27
+      serv.sin_addr.s_addr = inet_addr(hypervisor_ip_address);
28
+		serv.sin_addr.s_addr = inet_addr(hypervisor_ip_address);
29
+   else
30
+	serv.sin_addr.s_addr = htonl(INADDR_ANY);
31
    serv.sin_port = htons(vtty->tcp_port);
28
    serv.sin_port = htons(vtty->tcp_port);
32
 
29
 
33
    if (bind(vtty->accept_fd,(struct sockaddr *)&serv,sizeof(serv)) < 0) {
30
    if (bind(vtty->accept_fd,(struct sockaddr *)&serv,sizeof(serv)) < 0) {
(-)/usr/ports/emulators/dynamips-devel/files/patch-dynamips.1 (-4 / +12 lines)
Lines 1-11 Link Here
1
--- dynamips.1.orig	Wed Feb 14 20:37:58 2007
1
--- dynamips.1.orig	Thu Sep 13 18:45:02 2007
2
+++ dynamips.1	Fri Apr  6 20:59:41 2007
2
+++ dynamips.1	Thu Sep 13 19:45:49 2007
3
@@ -44,7 +44,7 @@
3
@@ -44,7 +44,7 @@
4
 .SH OPTIONS
4
 .SH OPTIONS
5
 A summary of options is included below.
5
 A summary of options is included below.
6
 .TP
6
 .TP
7
-.B -H <tcp_port>
7
-.B -H <tcp_port>
8
+.B -H [ip_address:]<tcp_port>
8
+.B -H [<ip_address>:]<tcp_port>
9
 Enable hypervisor mode.
9
 Enable hypervisor mode.
10
 .br
10
 .br
11
 The hypervisor mode of dynamips allows you to run simultaneously
11
 The hypervisor mode of dynamips allows you to run simultaneously
Lines 14-20 Link Here
14
 
14
 
15
 .TP
15
 .TP
16
-.B -T <port>
16
-.B -T <port>
17
+.B -T [ip_address:]<port>
17
+.B -T [<ip_address>:]<port>
18
 Console is on TCP <port>
18
 Console is on TCP <port>
19
 .TP
19
 .TP
20
 .B -U <si_desc>
20
 .B -U <si_desc>
21
@@ -141,6 +141,7 @@
22
 .TP
23
 .B -A <port>
24
 AUX is on TCP <port>
25
+AUX binding IP == Console binding IP
26
 .TP
27
 .B -B <si_desc>
28
 AUX is on serial interface <si_desc> (default is no AUX port)
(-)/usr/ports/emulators/dynamips-devel/files/patch-dynamips.c (-64 / +33 lines)
Lines 1-87 Link Here
1
--- dynamips.c.orig	Wed Feb 14 20:37:58 2007
1
--- dynamips.c.orig	Fri Sep  7 12:03:11 2007
2
+++ dynamips.c	Fri Apr  6 21:11:38 2007
2
+++ dynamips.c	Fri Sep 14 10:18:10 2007
3
@@ -61,6 +61,7 @@
3
@@ -193,7 +193,7 @@
4
 /* Hypervisor */
5
 int hypervisor_mode = 0;
6
 int hypervisor_tcp_port = 0;
7
+char hypervisor_ip_address[263]="\000"; /* 256(MAXHOSTNAMELEN)+1(:)+5(port)+NULL */
8
 
9
 /* Log file */
10
 char *log_file_name = NULL;
11
@@ -227,7 +228,7 @@
12
    printf("Usage: %s [options] <ios_image>\n\n",argv[0]);
13
    
14
    printf("Available options:\n"
15
-          "  -H <tcp_port>      : Run in hypervisor mode\n\n"
16
+          "  -H [ip_address:]<tcp_port> : Run in hypervisor mode\n\n"
17
           "  -P <platform>      : Platform to emulate (7200, 3600, "
18
           "2691, 3725 or 3745) "
19
           "(default: 7200)\n\n"
20
@@ -254,7 +255,7 @@
21
           "  -R <rom_file>      : Load an alternate ROM (default: embedded)\n"
4
           "  -R <rom_file>      : Load an alternate ROM (default: embedded)\n"
22
           "  -k <clock_div>     : Set the clock divisor (default: %d)\n"
5
           "  -k <clock_div>     : Set the clock divisor (default: %d)\n"
23
           "\n"
6
           "\n"
24
-          "  -T <port>          : Console is on TCP <port>\n"
7
-          "  -T <port>          : Console is on TCP <port>\n"
25
+          "  -T [ip_address:]<port> : Console is on TCP <port>\n"
8
+          "  -T [<ip_address>:]<port> : Console is on TCP <port>\n"
26
           "  -U <si_desc>       : Console in on serial interface <si_desc>\n"
9
           "  -U <si_desc>       : Console in on serial interface <si_desc>\n"
27
           "                       (default is on the terminal)\n"
10
           "                       (default is on the terminal)\n"
28
           "\n"
11
           "\n"
29
@@ -780,6 +781,7 @@
12
@@ -374,6 +374,8 @@
30
    int instance_id;
13
    int instance_id;
31
    int res,option;
14
    int option;
32
    char *str;
15
    char *str;
33
+   char *index;
16
+   char *index;
17
+   size_t len;
34
 
18
 
35
    /* Get the instance ID */
19
    /* Get the instance ID */
36
    instance_id = 0;
20
    instance_id = 0;
37
@@ -944,7 +946,15 @@
21
@@ -541,7 +543,25 @@
38
          /* TCP server for Console Port */
22
          /* TCP server for Console Port */
39
          case 'T':
23
          case 'T':
40
             vm->vtty_con_type = VTTY_TYPE_TCP;
24
             vm->vtty_con_type = VTTY_TYPE_TCP;
41
-            vm->vtty_con_tcp_port = atoi(optarg);
25
-            vm->vtty_con_tcp_port = atoi(optarg);
42
+	    strncpy(hypervisor_ip_address,optarg,sizeof(hypervisor_ip_address));
26
+
43
+	    index=strrchr(hypervisor_ip_address,':');
27
+            index = strrchr(optarg,':');
44
+	    if (index != NULL) {
28
+
45
+		*index++='\000';
29
+            if (!index) {
46
+		vm->vtty_con_tcp_port = atoi(index);
30
+               vm->vtty_con_tcp_port = atoi(optarg);
47
+	    } else {
31
+            } else {
48
+		vm->vtty_con_tcp_port = atoi(hypervisor_ip_address);
32
+               len = index - optarg;
49
+		hypervisor_ip_address[0]='\000';
33
+               hypervisor_ip_address = malloc(len + 1);
50
+	    }
34
+
35
+               if (!hypervisor_ip_address) {
36
+                  fprintf(stderr,"Unable to set console IP address!\n");
37
+                  exit(EXIT_FAILURE);
38
+               }
39
+
40
+               memcpy(hypervisor_ip_address,optarg,len);
41
+               hypervisor_ip_address[len] = '\0';
42
+
43
+	       vm->vtty_con_tcp_port = atoi(++index);
44
+            }
51
             break;
45
             break;
52
 
46
 
53
          /* Serial interface for Console port */
47
          /* Serial interface for Console port */
54
@@ -1061,6 +1071,7 @@
48
@@ -687,6 +707,8 @@
55
 static int run_hypervisor(int argc,char *argv[])
56
 {
57
    char *options_list = "H:l:hN:";
58
+   char *index;
59
    int i,option;
60
 
49
 
61
    for(i=1;i<argc;i++)
50
                memcpy(hypervisor_ip_address,optarg,len);
62
@@ -1079,7 +1090,15 @@
51
                hypervisor_ip_address[len] = '\0';
63
       {
52
+
64
          /* Hypervisor TCP port */
53
+	       hypervisor_tcp_port = atoi(++index);
65
          case 'H':
54
             }
66
-            hypervisor_tcp_port = atoi(optarg);
67
+	    strncpy(hypervisor_ip_address,optarg,sizeof(hypervisor_ip_address));
68
+	    index=strrchr(hypervisor_ip_address,':');
69
+	    if (index != NULL) {
70
+		*index++='\000';
71
+            	hypervisor_tcp_port = atoi(index);
72
+	    } else {
73
+		hypervisor_tcp_port = atoi(hypervisor_ip_address);
74
+		hypervisor_ip_address[0]='\000';
75
+	    }
76
             break;
55
             break;
77
 
56
 
78
          /* Log file */
79
@@ -1244,7 +1263,7 @@
80
       /* Free resources used by instance */
81
       vm_release(vm);
82
    } else {
83
-      hypervisor_tcp_server(hypervisor_tcp_port);
84
+      hypervisor_tcp_server(hypervisor_ip_address,hypervisor_tcp_port);
85
    }
86
 
87
    dynamips_reset();
(-)/usr/ports/emulators/dynamips-devel/files/patch-hypervisor.c (-20 lines)
Lines 1-20 Link Here
1
--- hypervisor.c.orig	Wed Mar 21 11:11:12 2007
2
+++ hypervisor.c	Wed Mar 21 11:29:55 2007
3
@@ -535,7 +535,7 @@
4
 }
5
 
6
 /* Hypervisor TCP server */
7
-int hypervisor_tcp_server(int tcp_port)
8
+int hypervisor_tcp_server(char* ip_address,int tcp_port)
9
 {
10
    int fd_array[HYPERVISOR_MAX_FD];
11
    struct sockaddr_storage remote_addr;
12
@@ -565,7 +565,7 @@
13
    if (!tcp_port)
14
       tcp_port = HYPERVISOR_TCP_PORT;
15
 
16
-   fd_count = ip_listen(tcp_port,SOCK_STREAM,HYPERVISOR_MAX_FD,fd_array);
17
+   fd_count = ip_listen(ip_address,tcp_port,SOCK_STREAM,HYPERVISOR_MAX_FD,fd_array);
18
 
19
    if (fd_count <= 0) {
20
       fprintf(stderr,"Hypervisor: unable to create TCP sockets.\n");
(-)/usr/ports/emulators/dynamips-devel/files/patch-hypervisor.h (-10 lines)
Lines 1-10 Link Here
1
--- hypervisor.h.orig	Wed Mar 21 10:58:06 2007
2
+++ hypervisor.h	Wed Mar 21 11:09:40 2007
3
@@ -136,6 +136,6 @@
4
 int hypervisor_stopsig(void);
5
 
6
 /* Hypervisor TCP server */
7
-int hypervisor_tcp_server(int tcp_port);
8
+int hypervisor_tcp_server(char *ip_address,int tcp_port);
9
 
10
 #endif
(-)/usr/ports/emulators/dynamips-devel/files/patch-net.c (-38 lines)
Lines 1-38 Link Here
1
--- net.c.orig	Wed Mar 21 11:34:17 2007
2
+++ net.c	Wed Mar 21 11:55:29 2007
3
@@ -353,7 +353,7 @@
4
 
5
 #if HAS_RFC2553
6
 /* Listen on the specified port */
7
-int ip_listen(int port,int sock_type,int max_fd,int fd_array[])
8
+int ip_listen(char *ip_address,int port,int sock_type,int max_fd,int fd_array[])
9
 {
10
    struct addrinfo hints,*res,*res0;
11
    char port_str[20];
12
@@ -370,7 +370,7 @@
13
 
14
    snprintf(port_str,sizeof(port_str),"%d",port);
15
 
16
-   if ((error = getaddrinfo(NULL,port_str,&hints,&res0)) != 0) {
17
+   if ((error = getaddrinfo((strlen(ip_address)==0)?NULL:ip_address,port_str,&hints,&res0)) != 0) {
18
       fprintf(stderr,"ip_listen: %s", gai_strerror(error));
19
       return(-1);
20
    }
21
@@ -405,7 +405,7 @@
22
 }
23
 #else
24
 /* Listen on the specified port */
25
-int ip_listen(int port,int sock_type,int max_fd,int fd_array[])
26
+int ip_listen(char *ip_address,int port,int sock_type,int max_fd,int fd_array[])
27
 {
28
    struct sockaddr_in sin;
29
    int i,sck,reuse=1;
30
@@ -422,6 +422,8 @@
31
    memset(&sin,0,sizeof(sin));
32
    sin.sin_family = PF_INET;
33
    sin.sin_port   = htons(port);
34
+   if (strlen(ip_address) != 0 && inet_addr(ip_address) != INADDR_NONE) 
35
+	   sin.sin_addr = inet_addr(ip_address);
36
 
37
    setsockopt(fd_array[0],SOL_SOCKET,SO_REUSEADDR,&reuse,sizeof(reuse));
38
 
(-)/usr/ports/emulators/dynamips-devel/files/patch-net.h (-10 lines)
Lines 1-10 Link Here
1
--- net.h.orig	Wed Mar 21 11:32:05 2007
2
+++ net.h	Wed Mar 21 11:33:28 2007
3
@@ -218,6 +218,6 @@
4
 int udp_connect(int local_port,char *remote_host,int remote_port);
5
 
6
 /* Listen on the specified port */
7
-int ip_listen(int port,int sock_type,int max_fd,int fd_array[]);
8
+int ip_listen(char *ip_address,int port,int sock_type,int max_fd,int fd_array[]);
9
 
10
 #endif
(-)/usr/ports/emulators/dynamips-devel/files/patch-utils.c (-11 lines)
Lines 1-11 Link Here
1
--- utils.c.orig	Wed Mar  8 22:53:21 2006
2
+++ utils.c	Wed Mar  8 22:53:37 2006
3
@@ -187,7 +187,7 @@
4
 {
5
    void *p;
6
 
7
-#ifdef __linux__
8
+#if defined(__linux__) || HAS_POSIX_MEMALIGN
9
    if (posix_memalign((void *)&p,boundary,size))
10
 #else
11
 #ifdef __CYGWIN__
(-)/usr/ports/emulators/dynamips-devel/files/patch-utils.h (-20 lines)
Lines 1-20 Link Here
1
--- utils.h.orig	Wed Feb 14 20:37:58 2007
2
+++ utils.h	Tue Feb 20 18:56:54 2007
3
@@ -12,6 +12,8 @@
4
 #include <sys/time.h>
5
 #include <time.h>
6
 #include <netinet/in.h>
7
+#include <pthread.h>
8
+#include <signal.h>
9
 
10
 /* True/False definitions */
11
 #ifndef FALSE
12
@@ -35,6 +37,8 @@
13
 #elif defined(__i386) || defined(__i386__) || defined(i386)
14
 #define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
15
 #elif defined(__x86_64__)
16
+#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
17
+#elif defined(__ia64__)
18
 #define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
19
 #endif
20
 

Return to bug 116344