I resubmitted the patch, fixing the issues the maintainer brought up. We'll see how it goes.
import logging
import time
import signal
import sys
import tashrouter.netlog
from tashrouter.port.ethertalk.tap import TapPort
from tashrouter.port.localtalk.ltoudp import LtoudpPort
from tashrouter.port.localtalk.tashtalk import TashTalkPort
from tashrouter.router.router import Router
def sigterm_handler(_signo, _stack_frame):
# Raises SystemExit(0):
sys.exit(0)
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s: %(message)s')
#tashrouter.netlog.set_log_str_func(logging.debug) # comment this line for speed and reduced spam
router = Router('router', ports=(
LtoudpPort(seed_network=1, seed_zone_name=b'LToUDP Network'),
TashTalkPort(serial_port='/dev/ttyAMA0', seed_network=2, seed_zone_name=b'TashTalk Network'),
TapPort(tap_name='tap2', hw_addr=b'\xDE\xAD\xBE\xEF\xCA\xFE', seed_network_min=3, seed_network_max=5, seed_zone_names=[b'EtherTalk Network']),
))
print('router away!')
router.start()
signal.signal(signal.SIGTERM, sigterm_handler)
try:
while True: time.sleep(1)
except (KeyboardInterrupt, SystemExit):
router.stop()
Cool! I hope this'll be useful to Apple II fans. Need to give it a try myself with the old IIgs sometime, too...TashRouter has been officially integrated into A2SERVER!
Thanks, added this change to the example in the README.Here are the changes to allow systemd to terminate TashRouter cleanly.
MacvtapPort uses a different kind of network interface from a tap, a macvtap. Documentation on macvtaps is a bit scanty, but it's a sort of combination of a tap and a bridge. As for switching, it's just another method of getting EtherTalk connectivity, not necessarily better nor worse - if it ain't broke, don't fix it. =)I have been away from Apples for a bit, but just got back to pickup the thread here again. I notice the latest TashRouter has a new interface called MacvtapPort but still retains the older TapPort. My startup program uses the latter. What is the difference between them? Is there a reason I'd want to switch?
This was extraordinarily helpful, and has Netatalk successfully communicating with both Mini vMac and LocalTalk devices connected to a TashTalk hat.OK, here is my TashRouter/netatalk on the same machine setup. [...]
tap0 -seed -phase 2 -net 3 -zone "A2SERVER"
eth0 -seed -phase 2 -net 2 -zone "A2SERVER"
Wow, you're right -- switching those two lines did the trick! Amazing to have a 660av, 512k, and Mini vMac all on the same network talking to the same netatalk server! Thanks to you and all the rest who have contributed to these efforts...the infamous Linux AppleTalk broadcast kernel bug