mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-03 23:57:32 -04:00
unix: add godoc for Sockaddr* types
Add rudimentary godoc for all existing Sockaddr* types implementing the Sockaddr interface. Change-Id: Ida7d1e8756477b54fc773f4bc978002c3d4a376d Reviewed-on: https://go-review.googlesource.com/89775 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
90f0fdc418
commit
0346725895
@@ -149,16 +149,19 @@ func Write(fd int, p []byte) (n int, err error) {
|
||||
// creation of IPv6 sockets to return EAFNOSUPPORT.
|
||||
var SocketDisableIPv6 bool
|
||||
|
||||
// Sockaddr represents a socket address.
|
||||
type Sockaddr interface {
|
||||
sockaddr() (ptr unsafe.Pointer, len _Socklen, err error) // lowercase; only we can define Sockaddrs
|
||||
}
|
||||
|
||||
// SockaddrInet4 implements the Sockaddr interface for AF_INET type sockets.
|
||||
type SockaddrInet4 struct {
|
||||
Port int
|
||||
Addr [4]byte
|
||||
raw RawSockaddrInet4
|
||||
}
|
||||
|
||||
// SockaddrInet6 implements the Sockaddr interface for AF_INET6 type sockets.
|
||||
type SockaddrInet6 struct {
|
||||
Port int
|
||||
ZoneId uint32
|
||||
@@ -166,6 +169,7 @@ type SockaddrInet6 struct {
|
||||
raw RawSockaddrInet6
|
||||
}
|
||||
|
||||
// SockaddrUnix implements the Sockaddr interface for AF_UNIX type sockets.
|
||||
type SockaddrUnix struct {
|
||||
Name string
|
||||
raw RawSockaddrUnix
|
||||
|
||||
Reference in New Issue
Block a user