Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

usbarmory/virtio-net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning

This package is now obsolete as it is replaced by go-net and go-net/virtio.

VirtIO Network driver

This Go package implements TCP/IP connectivity through VirtIO Networking to be used with GOOS=tamago as supported by the TamaGo framework for bare metal Go on AMD64/ARM/RISC-V processors.

The package supports TCP/IP networking through gVisor (go branch) tcpip stack pure Go implementation.

The interface TCP/IP stack can be attached to the Go runtime by setting net.SocketFunc to the interface Socket function:

// VirtIO over MMIO
dev := &vnet.Net{
	Transport: &virtio.MMIO{
		Base: vm.VIRTIO_NET0_BASE,
	}
}

// VirtIO over PCI
dev := &vnet.Net{
	Transport: &virtio.PCI{
		Device: pci.Probe(
			0,
			vm.VIRTIO_NET_PCI_VENDOR,
			vm.VIRTIO_NET_PCI_DEVICE,
		),
	}
}

// VirtIO interface
iface := vnet.Interface{}

// initialize IP, Netmask, Gateway
_ = iface.Init(dev, "10.0.0.1", "255.255.255.0", "10.0.0.2")

// Go runtime hook
net.SocketFunc = iface.Socket

See tamago-example for a full integration example.

Authors

Andrea Barisani
andrea@inversepath.com

Andrej Rosano
andrej@inversepath.com

Documentation

The package API documentation can be found on pkg.go.dev.

For more information about TamaGo see its repository and project wiki.

License

tamago | https://github.com/usbarmory/virtio-net
Copyright (c) The virtio-net authors. All Rights Reserved.

These source files are distributed under the BSD-style license found in the LICENSE file.

About

VirtIO Network driver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages