메뉴
HN
Hacker News • 13일 전

TailTalk: Rust와 Tokio로 만든 현대적인 비동기 유저스페이스 AppleTalk 스택

IMP
5/10
핵심 요약

TailTalk는 Netatalk나 커널 드라이버에 의존하지 않고 순수 Rust로 작성된 완전한 유저스페이스 AppleTalk 프로토콜 스택입니다. Linux, macOS, Windows에서 로우 소켓 또는 TashTalk 호환 장치만으로 구형 매킨토시와 파일 전송, 레거시 프린터 공유(AirPrint/IPP 변환)를 가능하게 합니다. Rust 1.90 이상에서 빌드할 수 있으며 현재 라우터 없는 환경에서 동작하는 프로토타입 단계입니다.

번역된 본문

TailTalk

TailTalk는 Linux, macOS, Windows 시스템에서 EtherTalk 또는 LocalTalk 네트워크를 통해 완전한 유저스페이스 AppleTalk 구현을 구축하기 위한 "툴킷"으로 설계되었습니다. Netatalk나 어떤 커널 드라이버에도 의존하지 않고 처음부터 새로 작성되었습니다. 필요한 것은 로우 소켓 그리고/또는 TashTalk 호환 장치(LocalTalk용)와 까다로운 옛날 컴퓨터를 다룰 인내심뿐입니다. 완전한 AppleTalk 스택을 제공하며, 동일한 머신에서 여러 복사본을 동시에 실행할 수 있습니다.

이 프로젝트를 시작한 이유는 제 오래된 맥과 파일을 주고받고, LaserWriter, ImageWriter, 네트워크 연결된 StyleWriter로 인쇄하며, 이들과 통신하는 현대적인 비동기 소프트웨어를 작성하기 위해서였습니다. 현재 TailTalk는 라우터 없는 설정에서만 동작합니다. 라우터가 있는 네트워크에 자연스럽게 참여하는 기능은 개발 중이지만 아직 메인라인 코드에는 포함되지 않았습니다. 스택의 각 부분은 당시 맥에서 실행되던 것처럼 최대한 "제로 컨피그(설정 불필요)"를 지향합니다. 그냥 꽂고 실행하면 번거로움 없이 바로 동작해야 합니다. 이 프로젝트는 진행 중인 프로토타입이므로 버그와 누락된 기능이 있을 수 있습니다.

TailTalk GUI

이것은 TashTalk USB와 함께 사용하기 위한 현재의 사용자용 프로그램입니다. LocalTalk 포트가 탑재되어 출하된 거의 모든 맥에서 동작해야 하는 AFP 서버를 포함하고 있습니다. 또한 Stuff-It 아카이브와 플로피 디스크 이미지를 임포트하여 리소스 포크(resource fork)를 보존한 채 공유 경로에 로드하고 원격 클라이언트에서 사용할 수 있게 합니다. 추가로 LocalTalk 지원 LaserWriter, ImageWriter, StyleWriter를 현대 네트워크에서 AirPrint / IPP 프린터로 공유하고, 현대 프린터를 클래식 맥에 공유하는 기능도 지원합니다.

최신 릴리스는 여기서 확인할 수 있습니다: https://github.com/FeralFirmware/TailTalk/releases/latest

기능

거의 모든 주요 AppleTalk 프로토콜에 대한 패킷 파서와 완전한 비동기 API를 제공합니다.

  • AppleTalk Address Resolution Protocol (AARP)
  • Datagram Delivery Protocol (DDP)
  • Name Binding Protocol (NBP)
  • AppleTalk Transaction Protocol (ATP)
  • Printer Access Protocol (PAP)
  • AppleTalk Session Protocol (ASP)
  • AppleTalk Filing Protocol (AFP)
  • AppleTalk Data Stream Protocol

또한 TashTalk를 통해 LocalTalk 맥과 함께 실행하는 것을 지원합니다. AARP/DDP 하부 계층은 인프로세스(기본값)로 실행하거나, 인터페이스를 소유하고 Unix 또는 UDP 소켓을 통한 protobuf 프로토콜로 여러 클라이언트에 DDP 소켓, 주소 지정, 라우팅 규칙을 제공하는 공유 데몬 tailtalkd에서 실행할 수 있습니다. TailTalk(TalkStack::builder().daemon_unix(..))이나 일반 C 클라이언트에서 사용할 수 있습니다. docs/daemon-protocol.md를 참고하세요.

빌드

사전 요구 사항

이 프로젝트는 Rust 1.90 이상이 필요하며, rustup.rs에서 설치할 수 있습니다. 기본적으로 사용 중인 OS와 CPU 아키텍처에 맞는 컴파일러가 설치됩니다.

이 프로젝트는 Linux용 AppImage, macOS용 App 번들, Windows용 인스톨러를 빌드하기 위해 cargo-packager를 사용합니다. cargo install cargo-packager로 설치하세요.

Windows 전용

rustup book에 명시된 대로 Windows MSVC 사전 요구 사항이 설치되어 있는지 확인하세요. Windows에는 npcap SDK를 컴퓨터 어딘가에 저장해야 합니다. npcap.com에서 받을 수 있습니다. SDK 압축을 푼 폴더를 LIB 환경 변수로 지정하세요. 예: C:\npcap-sdk-1.13\Lib\x64

빌드 실행

사전 요구 사항이 설치되면 저장소 루트에서 cargo build --release를 실행해 전체를 빌드하거나, TailTalk GUI만 빌드하려면 cargo build -p tailtalk-gui --release를 실행하세요. 빌드 후 바이너리는 target/release/에 위치합니다. 그 다음 OS에 따라 다음을 실행하세요:

Linux

cargo packager --release -f appimage -p tailtalk-gui

macOS

cargo packager --release -p tailtalk-gui

Windows

cargo packager --release -f nsis -p tailtalk-gui

결과물 번들은 dist/에 생성됩니다.

TashTalk USB 빠른 시작 가이드: Setup.md

TashTalk USB는 Silicon Labs CP210x USB-UART 브리지(VID 10c4, PID ea60)를 사용합니다.

Linux

cp210x 커널 모듈은 이미 설치되어 있을 가능성이 높지만, 기본적으로 장치 노드는 root만 접근할 수 있습니다.

원문 보기
원문 보기 (영어)
TailTalk TailTalk is designed as a "toolkit" for building fully userspace AppleTalk implementations on Linux, Mac OS and Windows systems via EtherTalk or LocalTalk networks. It is built from scratch with zero dependencies on Netatalk or any kernel drivers - All it needs is a raw socket and/or TashTalk compatible device (for LocalTalk) and patience for grumpy old computers. It provides a complete AppleTalk stack, with multiple copies of it able to run on the same machine at the same time. I started this project to be able to copy files to/from my old Macs, print to LaserWriters, ImageWriters and networked StyleWriters, and be able to write modern async software to communicate with them. Currently TailTalk only works in a routerless setup - work is in progress to make it gracefully join router present networks but it is not yet in the mainline code. Each part of the stack is meant to be as "zero config" as possible, just like running on a Mac of the era. Just plug it in, launch and things should just work without any fuss. This project is very much a work in progress prototype, so expect bugs and missing features. TailTalk GUI This is the current user facing program for use with TashTalk USB. It includes an AFP server which should work with just about every Mac that shipped with a LocalTalk port. It also can import Stuff-It archives and floppy disk images and load them in to the share path preserving the resource forks and make them available to remote clients. It additionally supports sharing LocalTalk capable LaserWriters, ImageWriters and StyleWriters to modern networks as AirPrint / IPP printers, and sharing modern printers to classic Macs. The latest release can be found here: https://github.com/FeralFirmware/TailTalk/releases/latest Features Packet parsers and fully async APIs for almost all the major AppleTalk protocols. AppleTalk Address Resolution Protocol (AARP) Datagram Delivery Protocol (DDP) Name Binding Protocol (NBP) AppleTalk Transaction Protocol (ATP) Printer Access Protocol (PAP) AppleTalk Session Protocol (ASP) AppleTalk Filing Protocol (AFP) AppleTalk Data Stream Protocol It additionally supports running with TashTalk for LocalTalk Macs. The AARP/DDP underlay can run either in-process (the default) or in a shared daemon, tailtalkd , which owns the interfaces and serves DDP sockets, addressing, and routing rules to multiple clients over a protobuf protocol on a Unix or UDP socket — usable from TailTalk ( TalkStack::builder().daemon_unix(..) ) or plain C clients. See docs/daemon-protocol.md . Building Prerequisites This project requires Rust 1.90 or above, which can be installed from rustup.rs . This should install a matching compiler for your OS and CPU architecture by default. This project uses cargo-packager for building AppImage for Linux, and App bundles for macOS and installers for Windows. Install it with cargo install cargo-packager . Windows Only Ensure you have the Windows MSVC prerequisites installed as specified in the rustup book . Windows requires the npcap SDK to be saved somewhere on your machine. It is available at npcap.com . Point a LIB environment variable to the folder where you unzipped the SDK, such as: C:\npcap-sdk-1.13\Lib\x64 Running the build Once the prerequisites are installed, run cargo build --release from the root of this repository to build everything, or for just the TailTail GUI run cargo build -p tailtalk-gui --release . After building the binaries should be located at target/release/ . Then run the following based on your OS: # Linux cargo packager --release -f appimage -p tailtalk-gui # macOS cargo packager --release -p tailtalk-gui # Windows cargo packager --release -f nsis -p tailtalk-gui The resulting bundle will be placed in dist/. TashTalk USB Quick start guide: Setup.md TashTalk USB uses a Silicon Labs CP210x USB-to-UART bridge (VID 10c4 , PID ea60 ). Linux The cp210x kernel module is likely installed already but by default the device node is only accessible by root. To grant your user access without requiring root, create a udev rule: echo ' SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", TAG+="uaccess" ' \ | sudo tee /etc/udev/rules.d/99-tashtalk-usb.rules sudo udevadm control --reload-rules && sudo udevadm trigger After running these commands, unplug and re-plug the TashTalk USB device. It will appear as /dev/ttyUSB0 (or similar) and be accessible without root. Windows Install the CP210x VCP Windows driver from Silicon Labs . Install npcap 1.88 from npcap.com MacOS macOS 11 and later includes support for the CP2102N USB chip out of the box. For 10.12 through 10.15 the driver from Silicon Labs is required for the device to be recognised: https://www.silabs.com/software-and-tools/usb-to-uart-bridge-vcp-drivers?tab=downloads EtherTalk EtherTalk is compiled into the GUI by default on macOS, where libpcap ships with the OS. On Linux and Windows it is opt-in: build with cargo build -p tailtalk-gui --features ethertalk once libpcap ( libpcap-dev ) or the npcap SDK is installed. macOS Packet capture and injection go through /dev/bpf* , which is root-only out of the box. To use EtherTalk as a regular user, install the ChmodBPF package that ships inside the Wireshark disk image (or run brew install --cask wireshark-chmodbpf ). It creates an access_bpf group, hands the BPF devices to it, and adds you to the group. Group membership only applies to new login sessions, so log out and back in afterwards. Until then, and if ChmodBPF is not installed at all, the GUI hides the Ethernet Interface picker rather than offering a transport that would fail to start. Existing Programs There are 4 demo programs I have written to verify the functionality of this software as I have developed it: aep-echo - A simple echo program that sends an echo request to a target address and prints the response time. afp-server - An AFP 1.0, 1.1 and 2.0 compatible AFP server. Very much a work in progress but is capable of reading and writing files to classic Mac systems. Basic directory browsing and file operations are supported. nbp-lookup - Performs an NBP lookup based on the provided request string and returns the results pap-print - Sends a PostScript file to a PAP printer. Aimed at LaserWriters, and have only tested on my own 4/600 PS. tailtalkd - The TailTalk underlay daemon. Owns the physical AppleTalk interfaces and serves DDP sockets, addressing, and routing to client applications over a Unix/UDP socket. tailtalk-gui - A simple GUI for sharing a folder as a volume over EtherTalk and/or LocalTalk (via TashTalk). All of the examples run a complete copy of the stack using a raw socket (if EtherTalk is enabled) and thus need to be run as root, or the appropriate setcap applied to the compiled binary (on macOS, ChmodBPF instead, see EtherTalk ). If only using TashTalk then this is not required. Testing Beyond unit tests I have found the best way to test this software is with real hardware. My current test setup consists of: Linux machine running TailTalk PowerBook G3 running Mac OS 9.2 via Ethernet LaserWriter 4/600 PS via AsanteTalk Color StyleWriter 2200 via EtherTalk adapter ImageWriter II with the LocalTalk Option Card Macintosh SE/30 running System 7.1 via AsanteTalk Macintosh Classic running System 6.0.8 via AsanteTalk AsanteTalk When the AsanteTalk is first powered on it "listens" for incoming packets on the Ethernet side before choosing what EtherTalk phase to operate under. If it doesn't see any EtherTalk Phase 2 packets it will default to Phase 1. TailTalk supports Phase 1 and this works just fine for LaserWriters, NBP and some basic operations but does not work with AFP (The Mac will discover the AFP TailTalk server but our responses appear to be dropped). Contributing I'd love to see this project grow into something that can be used to build more complete AppleTalk implementations. All contributions are welcome, but please open an issue first to discuss the changes you'd like to make. Additi