vintage_net v0.6.0 VintageNet.Technology.Gadget View Source

Support for USB Gadget virtual Ethernet interface configurations

USB Gadget interfaces expose a virtual Ethernet port that has a static IP. This runs a simple DHCP server for assigning an IP address to the computer at the other end of the USB cable. IP addresses are computed based on the hostname and interface name. A /30 subnet is used for the two IP addresses for each side of the cable to try to avoid conflicts with IP subnets used on either computer.

Configurations for this technology are maps with a :type field set to VintageNet.Technology.Gadget. Gadget-specific options are in a map under the :gadget key. These include:

  • :hostname - if non-nil, this overrides the hostname used for computing a unique IP address for this interface. If unset, :inet.gethostname/0 is used.

Most users should specify the following configuration:

%{type: VintageNet.Technology.Gadget}