// SPDX-FileCopyrightText: © 2022 Jeffrey C. Ollie // SPDX-License-Identifier: MIT //! A TFTP server library: RFC 1350, the option extensions of RFCs 2347, 2348 //! and 2349, and the netascii transfer mode. //! //! `Server` is the entry point. It is generic over an application type that //! decides what each read or write request actually reads from or writes to, //! so the library itself never touches a file system. The netascii codecs are //! exported as well, since they are useful on their own to anything that has //! to speak NVT ASCII. const std = @import("std"); /// The netascii codecs, including the variants for every line ending /// convention rather than only the host's. pub const netascii = @import("lib/netascii.zig"); /// A `std.Io.Writer` that decodes netascii into local text. See `netascii.Decoder`. pub const NetasciiDecoder = netascii.Decoder; /// A `std.Io.Reader` that decodes netascii into local text. See `netascii.DecodeReader`. pub const NetasciiDecodeReader = netascii.DecodeReader; /// A `std.Io.Reader` that encodes local text into netascii. See `netascii.EncodeReader`. pub const NetasciiEncodeReader = netascii.EncodeReader; /// A TFTP packet, and the types it is built from: decoding one from a /// datagram and encoding one into a datagram. pub const Packet = @import("lib/packet.zig").Packet; /// A TFTP client. See `client.Client`. pub const Client = @import("lib/client.zig").Client; const server = @import("lib/server.zig"); /// A TFTP server, generic over the application that serves the files. See /// `server.Server`. pub const Server = server.Server; /// A read or write request, as the application is asked to serve it: what /// was asked for, and the addresses at both ends. See `server.Request`. pub const Request = server.Request; test { _ = std.testing.refAllDecls(@This()); // `refAllDecls` does not recurse, and a test declared inside a type is // compiled only once that type is, so every file and every type holding // tests has to be named here or its tests silently never run. inline for (.{ @import("lib/client.zig"), @import("lib/errorcode.zig"), @import("lib/mode.zig"), @import("lib/netascii.zig"), @import("lib/opcode.zig"), @import("lib/Options.zig"), @import("lib/packet.zig"), @import("lib/pktinfo.zig"), @import("lib/server.zig"), @import("lib/transfer.zig"), }) |file| std.testing.refAllDecls(file); }