mirror of
https://github.com/tinygo-org/net.git
synced 2026-08-21 12:59:00 +00:00
netdev: improve documentation
Call out netdev as L3/L4 interface for TinyGo, to differentiate between netlink which is stricly L2.
This commit is contained in:
committed by
deadprogram
parent
044dc8d374
commit
8612dcd77b
@@ -1,3 +1,5 @@
|
|||||||
|
// L3/L4 network/transport layer
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -28,20 +30,19 @@ func useNetdev(dev netdever) {
|
|||||||
netdev = dev
|
netdev = dev
|
||||||
}
|
}
|
||||||
|
|
||||||
// Netdev is TinyGo's network device driver model. Network drivers implement
|
// netdever is TinyGo's OSI L3/L4 network/transport layer interface. Network
|
||||||
// the netdever interface, providing a common network I/O interface to TinyGo's
|
// drivers implement the netdever interface, providing a common network L3/L4
|
||||||
// "net" package. The interface is modeled after the BSD socket interface.
|
// interface to TinyGo's "net" package. net.Conn implementations (TCPConn,
|
||||||
// net.Conn implementations (TCPConn, UDPConn, and TLSConn) use the netdev
|
// UDPConn, and TLSConn) use the netdever interface for device I/O access.
|
||||||
// interface for device I/O access.
|
|
||||||
//
|
//
|
||||||
// A netdever is passed to the "net" package using net.useNetdev().
|
// A netdever is passed to the "net" package using net.useNetdev().
|
||||||
//
|
//
|
||||||
// Just like a net.Conn, multiple goroutines may invoke methods on a netdever
|
// Just like a net.Conn, multiple goroutines may invoke methods on a netdever
|
||||||
// simultaneously.
|
// simultaneously.
|
||||||
//
|
//
|
||||||
// NOTE: The netdever interface is mirrored in drivers/netdev.go.
|
// NOTE: The netdever interface is mirrored in drivers/netdev/netdev.go.
|
||||||
// NOTE: If making changes to this interface, mirror the changes in
|
// NOTE: If making changes to this interface, mirror the changes in
|
||||||
// NOTE: drivers/netdev.go, and vice-versa.
|
// NOTE: drivers/netdev/netdev.go, and vice-versa.
|
||||||
|
|
||||||
type netdever interface {
|
type netdever interface {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user