Update to the latest version and update for the patches, tested only on amd64.
emulators/dynagen (depends on python2.7) briefly tested diff refs/heads/master refs/heads/gns3 commit - 37e0f4d6fac927ffe838b99ae6a1cd263e2d1b09 commit + dcaa6820e1d4cc6fecd85dcf2ec9dc05450ca695 blob - 3b1bdf0941e37e307178c1c617e2c0ebadcf4e19 blob + be5fa7166f110294be29bef9cc3797d66dd13864 --- emulators/dynamips/Makefile +++ emulators/dynamips/Makefile @@ -2,13 +2,13 @@ DISTNAME= dynamips-0.2.8-RC2 USE_WXNEEDED= Yes -DISTNAME= dynamips-0.2.8-RC2 -PKGNAME= ${DISTNAME:S/-RC/rc/} -REVISION= 9 +GH_ACCOUNT= GNS3 +GH_PROJECT= dynamips +GH_TAGNAME= v0.2.23 + CATEGORIES= emulators HOMEPAGE= http://www.gns3.net/dynamips/ -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=gns-3/} # GPL PERMIT_PACKAGE= Yes @@ -16,8 +16,8 @@ MAKE_ENV= DYNAMIPS_ARCH=${DYNAMIPS_ARCH} WANTLIB= c elf>=2 pcap pthread MAKE_ENV= DYNAMIPS_ARCH=${DYNAMIPS_ARCH} +MODULES= devel/cmake -USE_GMAKE= Yes NO_TEST= Yes .if ${MACHINE_ARCH} == "i386" @@ -28,9 +28,11 @@ post-install: DYNAMIPS_ARCH= "nojit" .endif +CONFIGURE_ARGS += -DDYNAMIPS_ARCH=${DYNAMIPS_ARCH} + post-install: ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/dynamips -.for i in ChangeLog README README.hypervisor TODO +.for i in ChangeLog README.md README.hypervisor TODO ${INSTALL_DATA} ${WRKSRC}/$i ${PREFIX}/share/doc/dynamips .endfor blob - d3ccc77190bfc33262364943d97662c531d0c859 blob + b2913e7fd7237e89c613fd570c20eb5b5d977116 --- emulators/dynamips/distinfo +++ emulators/dynamips/distinfo @@ -1,2 +1,2 @@ -SHA256 (dynamips-0.2.8-RC2.tar.gz) = qLN3zmMRGeKFxAH9t8tNC8xgChVQi9/88zdUaVfiUt4= -SIZE (dynamips-0.2.8-RC2.tar.gz) = 578935 +SHA256 (dynamips-0.2.23.tar.gz) = UDu7UsA/kZAOqNvovQuAS3bi4o0LckJiTg08Ut2kQaE= +SIZE (dynamips-0.2.23.tar.gz) = 835736 blob - c0d41858e45dac99b393fc209a3048b14ed64a58 (mode 644) blob + /dev/null --- emulators/dynamips/patches/patch-Makefile +++ /dev/null @@ -1,116 +0,0 @@ -Index: Makefile ---- Makefile.orig -+++ Makefile -@@ -35,8 +35,8 @@ LEX=flex - MIPS64_ARCH_INC_FILE=\"mips64_$(DYNAMIPS_ARCH)_trans.h\" - PPC32_ARCH_INC_FILE=\"ppc32_$(DYNAMIPS_ARCH)_trans.h\" - --CFLAGS+=-g -Wall -O3 -fomit-frame-pointer \ -- -DJIT_ARCH=\"$(DYNAMIPS_ARCH)\" -DJIT_CPU=CPU_$(DYNAMIPS_ARCH) \ -+CFLAGS?=-g -O3 -fomit-frame-pointer -+CFLAGS+=-Wall -DJIT_ARCH=\"$(DYNAMIPS_ARCH)\" -DJIT_CPU=CPU_$(DYNAMIPS_ARCH) \ - -DMIPS64_ARCH_INC_FILE=$(MIPS64_ARCH_INC_FILE) \ - -DPPC32_ARCH_INC_FILE=$(PPC32_ARCH_INC_FILE) \ - -DDYNAMIPS_VERSION=\"$(VERSION)\" \ -@@ -47,6 +47,12 @@ CFLAGS+=-g -Wall -O3 -fomit-frame-pointer \ - #PCAP_LIB=/usr/local/lib/libpcap.a - PCAP_LIB=-lpcap - -+ifeq ($(shell uname), OpenBSD) -+ PTHREAD_LIBS?=-pthread -+ PCAP_LIB=-lpcap -+ CFLAGS+=$(PTHREAD_CFLAGS) -+ LIBS=-L. -lelf $(PTHREAD_LIBS) -+else - ifeq ($(shell uname), FreeBSD) - PTHREAD_LIBS?=-pthread - LOCALBASE?=/usr/local -@@ -85,6 +91,7 @@ endif - endif - endif - endif -+endif - - PROG=dynamips$(BIN_EXT) - PACKAGE=$(PROG)-$(VERSION) -@@ -217,20 +224,20 @@ all: $(PROG) nvram_export - - $(PROG): mips64_microcode_dump.inc ppc32_microcode_dump.inc \ - $(LEX_C) $(C_OBJS) $(A_OBJS) -- @echo "Linking $@" -- @$(CC) -o $@ $(C_OBJS) $(A_OBJS) $(LIBS) -+ @#echo "Linking $@" -+ $(CC) -o $@ $(C_OBJS) $(A_OBJS) $(LIBS) - - udp_send$(BIN_EXT): udp_send.c net.c crc.c -- @echo "Linking $@" -- @$(CC) -Wall $(CFLAGS) -o $@ udp_send.c net.c crc.c $(LIBS) -+ @#echo "Linking $@" -+ $(CC) -Wall $(CFLAGS) -o $@ udp_send.c net.c crc.c $(LIBS) - - udp_recv$(BIN_EXT): udp_recv.c net.c crc.c -- @echo "Linking $@" -- @$(CC) -Wall $(CFLAGS) -o $@ udp_recv.c net.c crc.c $(LIBS) -+ @#echo "Linking $@" -+ $(CC) -Wall $(CFLAGS) -o $@ udp_recv.c net.c crc.c $(LIBS) - - rom2c$(BIN_EXT): rom2c.c -- @echo "Linking $@" -- @$(CC) -Wall $(CFLAGS) -o $@ rom2c.c $(LIBS) -+ @#echo "Linking $@" -+ $(CC) -Wall $(CFLAGS) -o $@ rom2c.c $(LIBS) - - mips64_microcode_dump.inc: rom2c$(BIN_EXT) mips64_microcode - @./rom2c mips64_microcode mips64_microcode_dump.inc 0xbfc00000 -@@ -239,24 +246,24 @@ ppc32_microcode_dump.inc: rom2c$(BIN_EXT) ppc32_microc - @./rom2c ppc32_microcode ppc32_microcode_dump.inc 0xfff00000 - - asmdefs$(BIN_EXT): asmdefs.c mips64.h -- @echo "Linking $@" -- @$(CC) -Wall $(CFLAGS) -o $@ asmdefs.c -+ @#echo "Linking $@" -+ $(CC) -Wall $(CFLAGS) -o $@ asmdefs.c - - asmdefs.h: asmdefs$(BIN_EXT) -- @echo "Building assembly definitions header file" -+ @#echo "Building assembly definitions header file" - @./asmdefs - - nvram_export$(BIN_EXT): nvram_export.c -- @echo "Linking $@" -- @$(CC) -Wall $(CFLAGS) -o $@ nvram_export.c -+ @#echo "Linking $@" -+ $(CC) -Wall $(CFLAGS) -o $@ nvram_export.c - - install: $(PROG) nvram_export - @echo "Installing" -- install -d $(DESTDIR)/bin $(DESTDIR)/man/man1 $(DESTDIR)/man/man7 $(DESTDIR)/etc -- install dynamips nvram_export $(DESTDIR)/bin -- install -m644 dynamips.1 $(DESTDIR)/man/man1 -- install -m644 nvram_export.1 $(DESTDIR)/man/man1 -- install -m644 hypervisor_mode.7 $(DESTDIR)/man/man7 -+ install -d $(PREFIX)/bin $(PREFIX)/man/man1 $(PREFIX)/man/man7 $(DESTDIR)/etc -+ install dynamips nvram_export $(PREFIX)/bin -+ install -m644 dynamips.1 $(PREFIX)/man/man1 -+ install -m644 nvram_export.1 $(PREFIX)/man/man1 -+ install -m644 hypervisor_mode.7 $(PREFIX)/man/man7 - # install -m644 example $(DESTDIR)/etc/dynamips - - -@@ -281,12 +288,12 @@ packdev: - .SUFFIXES: .c .h .S .l .y .o - - .S.o: -- @echo "Assembling $<" -- @$(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $< -+ @#echo "Assembling $<" -+ $(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $< - - .c.o: -- @echo "Compiling $<" -- @$(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $< -+ @#echo "Compiling $<" -+ $(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $< - - .l.c: - $(LEX) -o$*.c $< blob - /dev/null blob + 98a441d06002efd8e33cd376e29bc0ebd6caa46a (mode 644) --- /dev/null +++ emulators/dynamips/patches/patch-common_net_io_filter_c @@ -0,0 +1,17 @@ +Index: common/net_io_filter.c +--- common/net_io_filter.c.orig ++++ common/net_io_filter.c +@@ -227,9 +227,12 @@ static int pf_capture_pkt_handler(netio_desc_t *nio,vo + { + struct netio_filter_capture *c = opt; + struct pcap_pkthdr pkt_hdr; ++ struct timeval tv; + + if (c != NULL) { +- gettimeofday(&pkt_hdr.ts,0); ++ gettimeofday(&tv,0); ++ pkt_hdr.ts.tv_sec = tv.tv_sec; ++ pkt_hdr.ts.tv_usec = tv.tv_usec; + pkt_hdr.caplen = m_min(len, (u_int)pcap_snapshot(c->desc)); + pkt_hdr.len = len; + blob - 7db372e37a3228216f4e6b22f0a5876441c7a7af (mode 644) blob + /dev/null --- emulators/dynamips/patches/patch-mips64_x86_trans_h +++ /dev/null @@ -1,12 +0,0 @@ ---- mips64_x86_trans.h.orig Sun Sep 2 11:41:38 2007 -+++ mips64_x86_trans.h Sun Sep 2 11:41:58 2007 -@@ -53,8 +53,7 @@ void mips64_jit_tcb_exec(cpu_mips_t *cpu,mips64_jit_tc - return; - } - -- asm volatile ("movl %0,%%edi"::"r"(cpu): -- "esi","edi","eax","ebx","ecx","edx"); -+ asm volatile ("movl %0,%%edi"::"r"(cpu)); - jit_code(); - } - blob - /dev/null blob + 777c591981f30f6bc5dd202eba406c12959a5592 (mode 644) --- /dev/null +++ emulators/dynamips/patches/patch-common_ppc32_x86_trans_h @@ -0,0 +1,13 @@ +Index: common/ppc32_x86_trans.h +--- common/ppc32_x86_trans.h.orig ++++ common/ppc32_x86_trans.h +@@ -60,8 +60,7 @@ void ppc32_jit_tcb_exec(cpu_ppc_t *cpu,ppc32_jit_tcb_t + } + } + +- asm volatile ("movl %0,%%edi"::"r"(cpu): +- "esi","edi","eax","ebx","ecx","edx"); ++ asm volatile ("movl %0,%%edi"::"r"(cpu)); + jit_code(); + } + blob - 7d59a84075f6614b2e6e9bf68f45bf51edbb31c6 (mode 644) blob + /dev/null --- emulators/dynamips/patches/patch-net_io_filter_c +++ /dev/null @@ -1,17 +0,0 @@ -Index: net_io_filter.c ---- net_io_filter.c.orig -+++ net_io_filter.c -@@ -211,9 +211,12 @@ static int pf_capture_pkt_handler(netio_desc_t *nio,vo - { - struct netio_filter_capture *c = opt; - struct pcap_pkthdr pkt_hdr; -+ struct timeval tv; - - if (c != NULL) { -- gettimeofday(&pkt_hdr.ts,0); -+ gettimeofday(&tv,0); -+ pkt_hdr.ts.tv_sec = tv.tv_sec; -+ pkt_hdr.ts.tv_usec = tv.tv_usec; - pkt_hdr.caplen = len; - pkt_hdr.len = len; - blob - /dev/null blob + d040496d9a6e4c52fd580dbbc4ec86f0ef716904 (mode 644) --- /dev/null +++ emulators/dynamips/patches/patch-stable_mips64_x86_trans_h @@ -0,0 +1,13 @@ +Index: stable/mips64_x86_trans.h +--- stable/mips64_x86_trans.h.orig ++++ stable/mips64_x86_trans.h +@@ -53,8 +53,7 @@ void mips64_jit_tcb_exec(cpu_mips_t *cpu,mips64_jit_tc + return; + } + +- asm volatile ("movl %0,%%edi"::"r"(cpu): +- "esi","edi","eax","ebx","ecx","edx"); ++ asm volatile ("movl %0,%%edi"::"r"(cpu)); + jit_code(); + } + blob - 6296d308c22dedf764bae27e66e41b3767b5176f (mode 644) blob + /dev/null --- emulators/dynamips/patches/patch-ppc32_x86_trans_h +++ /dev/null @@ -1,12 +0,0 @@ ---- ppc32_x86_trans.h.orig Sun Sep 2 11:43:03 2007 -+++ ppc32_x86_trans.h Sun Sep 2 11:43:07 2007 -@@ -60,8 +60,7 @@ void ppc32_jit_tcb_exec(cpu_ppc_t *cpu,ppc32_jit_tcb_t - } - } - -- asm volatile ("movl %0,%%edi"::"r"(cpu): -- "esi","edi","eax","ebx","ecx","edx"); -+ asm volatile ("movl %0,%%edi"::"r"(cpu)); - jit_code(); - } - blob - /dev/null blob + cb7710efb4035b800f4e20d8d7f3e4cd9e038646 (mode 644) --- /dev/null +++ emulators/dynamips/patches/patch-stable_utils_h @@ -0,0 +1,37 @@ +Index: stable/utils.h +--- stable/utils.h.orig ++++ stable/utils.h +@@ -183,12 +185,15 @@ static inline u_int normalize_size(u_int val,u_int nb, + return(((val+nb-1) & ~(nb-1)) >> shift); + } + ++#ifndef swap16 + /* Convert a 16-bit number between little and big endian */ + static forced_inline m_uint16_t swap16(m_uint16_t value) + { + return((value >> 8) | ((value & 0xFF) << 8)); + } ++#endif + ++#ifndef swap32 + /* Convert a 32-bit number between little and big endian */ + static forced_inline m_uint32_t swap32(m_uint32_t value) + { +@@ -200,7 +205,9 @@ static forced_inline m_uint32_t swap32(m_uint32_t valu + result |= (value & 0xff) << 24; + return(result); + } ++#endif + ++#ifndef swap64 + /* Convert a 64-bit number between little and big endian */ + static forced_inline m_uint64_t swap64(m_uint64_t value) + { +@@ -210,6 +217,7 @@ static forced_inline m_uint64_t swap64(m_uint64_t valu + result |= swap32(value >> 32); + return(result); + } ++#endif + + /* Get current time in number of msec since epoch */ + static inline m_tmcnt_t m_gettime(void) blob - 989c94bc1eb178b15441fdf74a71cfbc5ea50172 (mode 644) blob + /dev/null --- emulators/dynamips/patches/patch-utils_c +++ /dev/null @@ -1,10 +0,0 @@ ---- utils.c.orig Thu Jan 4 21:49:43 2007 -+++ utils.c Thu Jan 4 21:49:54 2007 -@@ -12,6 +12,7 @@ - #include <stdarg.h> - #include <unistd.h> - #include <time.h> -+#include <pthread.h> - #include <signal.h> - #include <sys/time.h> - #include <sys/ioctl.h> blob - b26b6b7dcb83e02b9a0d052ac59375bc0c1bb920 (mode 644) blob + /dev/null --- emulators/dynamips/patches/patch-utils_h +++ /dev/null @@ -1,81 +0,0 @@ -Index: utils.h ---- utils.h.orig -+++ utils.h -@@ -14,6 +14,7 @@ - #include <netinet/in.h> - #include <pthread.h> - #include <signal.h> -+#include <endian.h> - - /* True/False definitions */ - #ifndef FALSE -@@ -42,6 +43,9 @@ - #define ARCH_BIG_ENDIAN 0x4321 - #define ARCH_LITTLE_ENDIAN 0x1234 - -+#ifdef BYTE_ORDER -+#define ARCH_BYTE_ORDER BYTE_ORDER -+#else - #if defined(PPC) || defined(__powerpc__) || defined(__ppc__) - #define ARCH_BYTE_ORDER ARCH_BIG_ENDIAN - #elif defined(__sparc) || defined(__sparc__) -@@ -55,6 +59,7 @@ - #elif defined(__ia64__) - #define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN - #endif -+#endif - - #ifndef ARCH_BYTE_ORDER - #error Please define your architecture in utils.h! -@@ -80,11 +85,16 @@ - #endif - - /* Useful attributes for functions */ -+#if defined(__i386__) - #define asmlinkage __attribute__((regparm(0))) - #define fastcall __attribute__((regparm(3))) -+#else -+#define asmlinkage -+#define fastcall -+#endif - - #if __GNUC__ > 2 --#define forced_inline inline __attribute__((always_inline)) -+#define forced_inline inline __attribute__ ((always_inline)) - #define no_inline __attribute__ ((noinline)) - #else - #define forced_inline inline -@@ -255,12 +265,15 @@ static inline u_int normalize_size(u_int val,u_int nb, - return(((val+nb-1) & ~(nb-1)) >> shift); - } - -+#ifndef swap16 - /* Convert a 16-bit number between little and big endian */ - static forced_inline m_uint16_t swap16(m_uint16_t value) - { - return((value >> 8) | ((value & 0xFF) << 8)); - } -+#endif - -+#ifndef swap32 - /* Convert a 32-bit number between little and big endian */ - static forced_inline m_uint32_t swap32(m_uint32_t value) - { -@@ -272,7 +285,9 @@ static forced_inline m_uint32_t swap32(m_uint32_t valu - result |= (value & 0xff) << 24; - return(result); - } -+#endif - -+#ifndef swap64 - /* Convert a 64-bit number between little and big endian */ - static forced_inline m_uint64_t swap64(m_uint64_t value) - { -@@ -282,6 +297,7 @@ static forced_inline m_uint64_t swap64(m_uint64_t valu - result |= swap32(value >> 32); - return(result); - } -+#endif - - /* Get current time in number of msec since epoch */ - static inline m_tmcnt_t m_gettime(void) blob - 805b7060cd4286c8265a8d4f6c358e417ea86327 blob + 3278b2cd3a56aca82d21e5785207aa3e394a0feb --- emulators/dynamips/pkg/MESSAGE +++ emulators/dynamips/pkg/MESSAGE @@ -1,7 +1,6 @@ By default, a dynamips instance will take 100% of the host CPU. To -avoid this, please read the "idle-pc" section in the README file -(${PREFIX}/share/doc/dynamips/README). The configuration generator -"dynagen" (available separately) can help find a good value. +avoid this, you will need to google "idle-pc dynamips" or use built-in +idle-pc finder in GNS3 or dynagen ports. You can greatly reduce startup times by uncompressing your IOS images with unzip. blob - ce198be2fd371854292a456c373dce31c91294f1 blob + 0942764202d06fdefc2601364773e492e7906359 --- emulators/dynamips/pkg/PLIST +++ emulators/dynamips/pkg/PLIST @@ -4,7 +4,10 @@ share/doc/dynamips/ChangeLog @man man/man1/nvram_export.1 @man man/man7/hypervisor_mode.7 share/doc/dynamips/ +share/doc/dynamips/COPYING share/doc/dynamips/ChangeLog -share/doc/dynamips/README +share/doc/dynamips/MAINTAINERS share/doc/dynamips/README.hypervisor +share/doc/dynamips/README.md +share/doc/dynamips/RELEASE-NOTES share/doc/dynamips/TODO