• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision9a05ad81f81bdbb8e40a3f4e19934efd48b98fa0 (tree)
l'heure2015-12-04 12:30:03
AuteurRuben Agin <phabrics@phab...>
CommiterRuben Agin

Message de Log

Fix for TAP windows ethernet. Updated docs for OpenVPN. New version.

Change Summary

Modification

--- a/contrib/tme-0.8/configure.ac
+++ b/contrib/tme-0.8/configure.ac
@@ -34,7 +34,7 @@ dnl POSSIBILITY OF SUCH DAMAGE.
3434 dnl Checks that we are given a good source directory.
3535 AC_PREREQ([2.68])
3636 m4_include(version.m4)
37-AC_INIT([tme], [0.12beta12])
37+AC_INIT([tme], [0.12beta14])
3838 AC_CONFIG_SRCDIR([ic/m68k/m68k-impl.h])
3939 AC_CONFIG_MACRO_DIR([m4])
4040 AC_CANONICAL_TARGET
--- a/contrib/tme-0.8/host/eth/eth-impl.c
+++ b/contrib/tme-0.8/host/eth/eth-impl.c
@@ -286,6 +286,8 @@ _tme_eth_th_reader(struct tme_ethernet *eth)
286286 }
287287
288288 #elif defined(OPENVPN_ETH)
289+ event_reset(eth->tme_eth_event_set);
290+
289291 flags = EVENT_READ;
290292
291293 can_write = eth->tme_eth_can_write;
@@ -321,20 +323,27 @@ _tme_eth_th_reader(struct tme_ethernet *eth)
321323 eth->tme_eth_buffer,
322324 eth->tme_eth_buffer_size);
323325 #endif
326+ tme_mutex_lock(&eth->tme_eth_mutex);
327+
328+#ifdef OPENVPN_ETH
329+ if(can_write && !eth->tme_eth_can_write) {
330+ /* signal transition that we can write */
331+ eth->tme_eth_can_write = TRUE;
332+ //_tme_eth_callout(eth, TME_ETH_CALLOUT_CTRL);
333+ }
334+#endif
335+
324336 /* if the read failed: */
325- if (buffer_end <= 0
337+ if(buffer_end <= 0) {
326338 #ifdef OPENVPN_ETH
327- && !can_write
339+ if(!can_write)
328340 #endif
329- ) {
330- tme_log(&eth->tme_eth_element->tme_element_log_handle, 1, errno,
331- (&eth->tme_eth_element->tme_element_log_handle,
332- _("failed to read/write packets")));
333- tme_mutex_lock(&eth->tme_eth_mutex);
341+ tme_log(&eth->tme_eth_element->tme_element_log_handle, 1, errno,
342+ (&eth->tme_eth_element->tme_element_log_handle,
343+ _("failed to read/write packets")));
334344 continue;
335345 }
336346
337-
338347 /* Filter out multicast packets we sent or unicast packets not destined for us.
339348 This should remove all duplicate packets on, i.e., tap interfaces...
340349 */
@@ -352,19 +361,9 @@ _tme_eth_th_reader(struct tme_ethernet *eth)
352361 tme_log(&eth->tme_eth_element->tme_element_log_handle, 1, TME_OK,
353362 (&eth->tme_eth_element->tme_element_log_handle,
354363 _("read %ld bytes of packets"), (long) buffer_end));
355- tme_mutex_lock(&eth->tme_eth_mutex);
356364 eth->tme_eth_buffer_offset = 0;
357365 eth->tme_eth_buffer_end = buffer_end;
358366 _tme_eth_callout(eth, TME_ETH_CALLOUT_CTRL);
359- } else {
360- tme_mutex_lock(&eth->tme_eth_mutex);
361-#ifdef OPENVPN_ETH
362- if(can_write && !eth->tme_eth_can_write) {
363- /* signal transition that we can write */
364- eth->tme_eth_can_write = TRUE;
365- //_tme_eth_callout(eth, TME_ETH_CALLOUT_CTRL);
366- }
367-#endif
368367 }
369368 }
370369 /* NOTREACHED */
--- a/contrib/tme-0.8/host/posix/posix-disk.c
+++ b/contrib/tme-0.8/host/posix/posix-disk.c
@@ -59,6 +59,9 @@ _TME_RCSID("$Id: posix-disk.c,v 1.6 2010/06/05 14:28:57 fredette Exp $");
5959 #else
6060 #include "mman.h"
6161 #endif
62+#ifdef WIN32
63+#include <windows.h>
64+#endif
6265 #ifdef HAVE_STDARG_H
6366 #include <stdarg.h>
6467 #else /* HAVE_STDARG_H */
@@ -716,6 +719,10 @@ _tme_posix_disk_open(struct tme_posix_disk *posix_disk,
716719 page_size = sysconf(_SC_PAGESIZE);
717720 #elif defined(_SC_PAGE_SIZE)
718721 page_size = sysconf(_SC_PAGE_SIZE);
722+#elif defined(WIN32)
723+ SYSTEM_INFO si;
724+ GetSystemInfo(&si);
725+ page_size = si.dwPageSize;
719726 #else
720727 page_size = 4096;
721728 #endif
--- a/contrib/tme-0.8/libtme/host/recode-mmap.c
+++ b/contrib/tme-0.8/libtme/host/recode-mmap.c
@@ -49,6 +49,9 @@ _TME_RCSID("$Id: recode-mmap.c,v 1.2 2008/07/01 02:00:53 fredette Exp $");
4949 #else
5050 #include "mman.h"
5151 #endif
52+#ifdef WIN32
53+#include <windows.h>
54+#endif
5255
5356 /* this host function allocates memory for building and running thunks: */
5457 void
@@ -64,6 +67,10 @@ tme_recode_host_thunks_alloc(struct tme_recode_ic *ic,
6467 size_page = sysconf(_SC_PAGESIZE);
6568 #elif defined(_SC_PAGE_SIZE)
6669 size_page = sysconf(_SC_PAGE_SIZE);
70+#elif defined(WIN32)
71+ SYSTEM_INFO si;
72+ GetSystemInfo(&si);
73+ size_page = si.dwPageSize;
6774 #else
6875 size_page = 4096;
6976 #endif
--- a/contrib/tme-0.8/machine/sun2/SUN2-MULTIBUS
+++ b/contrib/tme-0.8/machine/sun2/SUN2-MULTIBUS
@@ -54,9 +54,22 @@ scsibus0 at sc0: tme/scsi/bus
5454 #mie0 memory 0xa0000 at mbmem0 addr 0xa0000
5555 #ie0 at mie0: tme/ic/i82586
5656 #bpf1 at ie0: tme/host/bsd/bpf delay 10000
57+
5758 # OR enable tap ethernet device, an alternative method for network access
58-# if you have read/write permission on tap device or have cap_net_admin+ep capability (on Linux)
59+# 2 ways to access a tap device: native or openvpn (respectively below)
60+# both require setuid or equivalent permissions, which should be set up at build time
5961 #tap1 at ie0: tme/host/tun/tap inet 10.0.77.1 netmask 255.255.255.0 bcast 10.0.77.255
62+#tap1 at ie0: tme/host/openvpn/tap --dev tap --ifconfig 10.0.77.1 255.255.255.0 --tun-ipv6 --ifconfig-ipv6 "2001:db8::1/64" "2001:db8::2"
63+
64+# You can enable "networking" multiple machines using the following line,
65+# while removing the " at ie0" from the one of the previous 2 lines that is used
66+# to set up the tap device.
67+#tap1 at tap1
68+
69+# This creates a master configuration that can be used with different slave
70+# configurations that only need the second line below to connect to the tap network
71+# via bpf. Note that the master requires this line, too...
72+#bpf1 at ie0: tme/host/bsd/bpf interface tap0
6073
6174 ## the Sun bwtwo Multibus board, Sun type-2 keyboard and mouse, and
6275 ## the GTK-based display to drive them all:
--- a/contrib/tme-0.8/machine/sun3/SUN3-CARRERA
+++ b/contrib/tme-0.8/machine/sun3/SUN3-CARRERA
@@ -33,8 +33,20 @@ mainbus0 intreg at obio0 addr 0x0A0000
3333 #ie0 at obie0: tme/ic/i82586
3434 #bpf1 at ie0: tme/host/bsd/bpf
3535 # OR enable tap ethernet device, an alternative method for network access
36-# if you have read/write permission on tap device or have cap_net_admin+ep capability (on Linux)
36+# 2 ways to access a tap device: native or openvpn (respectively below)
37+# both require setuid or equivalent permissions, which should be set up at build time
3738 #tap1 at ie0: tme/host/tun/tap inet 10.0.77.1 netmask 255.255.255.0 bcast 10.0.77.255
39+#tap1 at ie0: tme/host/openvpn/tap --dev tap --ifconfig 10.0.77.1 255.255.255.0 --tun-ipv6 --ifconfig-ipv6 "2001:db8::1/64" "2001:db8::2"
40+
41+# You can enable "networking" multiple machines using the following line,
42+# while removing the " at ie0" from the one of the previous 2 lines that is used
43+# to set up the tap device.
44+#tap1 at tap1
45+
46+# This creates a master configuration that can be used with different slave
47+# configurations that only need the second line below to connect to the tap network
48+# via bpf. Note that the master requires this line, too...
49+#bpf1 at ie0: tme/host/bsd/bpf interface tap0
3850
3951 ## the Sun type-3 keyboard and mouse:
4052 ##
--- a/contrib/tme-0.8/machine/sun4/SUN4-75
+++ b/contrib/tme-0.8/machine/sun4/SUN4-75
@@ -74,8 +74,20 @@ scsibus0 at ncr0: tme/scsi/bus
7474 le0 at sbus0 slot 0 offset 0xc00000 ipl 5 dma-offset 0xff000000: tme/ic/am7990
7575 #bpf0 at le0: tme/host/bsd/bpf
7676 # OR enable tap ethernet device, an alternative method for network access
77-# if you have read/write permission on tap device or have cap_net_admin+ep capability (on Linux)
77+# 2 ways to access a tap device: native or openvpn (respectively below)
78+# both require setuid or equivalent permissions, which should be set up at build time
7879 #tap0 at le0: tme/host/tun/tap inet 10.0.77.1 netmask 255.255.255.0 bcast 10.0.77.255
80+#tap0 at le0: tme/host/openvpn/tap --dev tap --ifconfig 10.0.77.1 255.255.255.0 --tun-ipv6 --ifconfig-ipv6 "2001:db8::1/64" "2001:db8::2"
81+
82+# You can enable "networking" multiple machines using the following line,
83+# while removing the " at le0" from the one of the previous 2 lines that is used
84+# to set up the tap device.
85+#tap0 at tap0
86+
87+# This creates a master configuration that can be used with different slave
88+# configurations that only need the second line below to connect to the tap network
89+# via bpf. Note that the master requires this line, too...
90+#bpf0 at le0: tme/host/bsd/bpf interface tap0
7991
8092 ## an SBus cgthree:
8193 ##
--- a/contrib/tme-0.8/machine/sun4u/SUN-ULTRA-1
+++ b/contrib/tme-0.8/machine/sun4u/SUN-ULTRA-1
@@ -77,8 +77,20 @@ ledma0 at sbus0 slot 14 offset 0x8c00000
7777 le0 at ledma0 master: tme/ic/am7990
7878 #bpf0 at le0: tme/host/bsd/bpf
7979 # OR enable tap ethernet device, an alternative method for network access
80-# if you have read/write permission on tap device or have cap_net_admin+ep capability (on Linux)
80+# 2 ways to access a tap device: native or openvpn (respectively below)
81+# both require setuid or equivalent permissions, which should be set up at build time
8182 #tap0 at le0: tme/host/tun/tap inet 10.0.77.1 netmask 255.255.255.0 bcast 10.0.77.255
83+#tap0 at le0: tme/host/openvpn/tap --dev tap --ifconfig 10.0.77.1 255.255.255.0 --tun-ipv6 --ifconfig-ipv6 "2001:db8::1/64" "2001:db8::2"
84+
85+# You can enable "networking" multiple machines using the following line,
86+# while removing the " at le0" from the one of the previous 2 lines that is used
87+# to set up the tap device.
88+#tap0 at tap0
89+
90+# This creates a master configuration that can be used with different slave
91+# configurations that only need the second line below to connect to the tap network
92+# via bpf. Note that the master requires this line, too...
93+#bpf0 at le0: tme/host/bsd/bpf interface tap0
8294
8395 ## the SBus parallel port:
8496 ##
--- a/contrib/tme-0.8/tme/tme.texi
+++ b/contrib/tme-0.8/tme/tme.texi
@@ -97,6 +97,7 @@ Networking
9797 * PPP::
9898 * IPv4 Network Address Translation::
9999 * Proxy ARP/NDP::
100+* OpenVPN::
100101 * Network Descriptions::
101102 * Network Services::
102103
@@ -233,8 +234,8 @@ Windows - Preliminary support for building/running on Windows
233234 platforms is provided through Cygwin. It should work out of the
234235 box. See below for details. It should also build (natively or cross)
235236 on MinGW, and run under the Wine emulator (use --without-x
236---enable-threads=glib configure options). No Ethernet support is
237-available for Windows, yet.
237+--enable-threads=glib configure options). Preliminary Ethernet support is
238+available for Windows, using OpenVPN.
238239
239240 @item
240241 Other - It should work on any POSIX platforms, sans whatever features
@@ -519,6 +520,7 @@ is the topic of the next section.
519520 * PPP::
520521 * IPv4 Network Address Translation::
521522 * Proxy ARP/NDP::
523+* OpenVPN::
522524 * Network Descriptions::
523525 * Network Services::
524526 @end menu
@@ -880,6 +882,24 @@ apply, with commands used for IPv6 instead (ip -6). If your router
880882 doesn't have a route to your host, this may be needed to use IPv6
881883 networking.
882884
885+@node OpenVPN
886+@subsection OpenVPN
887+
888+Preliminary support for OpenVPN is now provided for the purposes of
889+creating and using TAP devices on multiple platforms. OpenVPN is
890+compiled in as another host module, with a special tap leaf interface,
891+that uses the same options as OpenVPN itself. See the OpenVPN docs
892+for further information.
893+
894+In particular, it can be used to configure tap interfaces with IP
895+or IPv6 addresses. Here is a sample line that can be used to accomplish
896+this:
897+
898+@code{tap0 at le0: tme/host/openvpn/tap --dev tap --ifconfig 10.0.77.1 255.255.255.0 --ifconfig-ipv6 "2001:db8::1/64" "2001:db8::2" --tun-ipv6}
899+
900+Note that this is currently the only way to get networking support
901+under Windows.
902+
883903 @node Network Descriptions
884904 @subsection Network Descriptions
885905