diff options
Diffstat (limited to 'libgo/go/net/iprawsock_plan9.go')
-rw-r--r-- | libgo/go/net/iprawsock_plan9.go | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/libgo/go/net/iprawsock_plan9.go b/libgo/go/net/iprawsock_plan9.go index 58df607..859153c 100644 --- a/libgo/go/net/iprawsock_plan9.go +++ b/libgo/go/net/iprawsock_plan9.go @@ -32,13 +32,13 @@ func (c *IPConn) SetWriteDeadline(t time.Time) error { // Implementation of the Conn interface - see Conn for documentation. -// Read implements the net.Conn Read method. -func (c *IPConn) Read(b []byte) (n int, err error) { +// Read implements the Conn Read method. +func (c *IPConn) Read(b []byte) (int, error) { return 0, os.EPLAN9 } -// Write implements the net.Conn Write method. -func (c *IPConn) Write(b []byte) (n int, err error) { +// Write implements the Conn Write method. +func (c *IPConn) Write(b []byte) (int, error) { return 0, os.EPLAN9 } @@ -59,10 +59,20 @@ func (c *IPConn) RemoteAddr() Addr { // IP-specific methods. -// ReadFrom implements the net.PacketConn ReadFrom method. -func (c *IPConn) ReadFrom(b []byte) (n int, addr Addr, err error) { - err = os.EPLAN9 - return +// ReadFromIP reads a IP packet from c, copying the payload into b. +// It returns the number of bytes copied into b and the return address +// that was on the packet. +// +// ReadFromIP can be made to time out and return an error with +// Timeout() == true after a fixed time limit; see SetDeadline and +// SetReadDeadline. +func (c *IPConn) ReadFromIP(b []byte) (int, *IPAddr, error) { + return 0, nil, os.EPLAN9 +} + +// ReadFrom implements the PacketConn ReadFrom method. +func (c *IPConn) ReadFrom(b []byte) (int, Addr, error) { + return 0, nil, os.EPLAN9 } // WriteToIP writes a IP packet to addr via c, copying the payload from b. @@ -71,23 +81,18 @@ func (c *IPConn) ReadFrom(b []byte) (n int, addr Addr, err error) { // an error with Timeout() == true after a fixed time limit; // see SetDeadline and SetWriteDeadline. // On packet-oriented connections, write timeouts are rare. -func (c *IPConn) WriteToIP(b []byte, addr *IPAddr) (n int, err error) { +func (c *IPConn) WriteToIP(b []byte, addr *IPAddr) (int, error) { return 0, os.EPLAN9 } -// WriteTo implements the net.PacketConn WriteTo method. -func (c *IPConn) WriteTo(b []byte, addr Addr) (n int, err error) { +// WriteTo implements the PacketConn WriteTo method. +func (c *IPConn) WriteTo(b []byte, addr Addr) (int, error) { return 0, os.EPLAN9 } -func splitNetProto(netProto string) (net string, proto int, err error) { - err = os.EPLAN9 - return -} - // DialIP connects to the remote address raddr on the network protocol netProto, // which must be "ip", "ip4", or "ip6" followed by a colon and a protocol number or name. -func DialIP(netProto string, laddr, raddr *IPAddr) (c *IPConn, err error) { +func DialIP(netProto string, laddr, raddr *IPAddr) (*IPConn, error) { return nil, os.EPLAN9 } @@ -95,6 +100,6 @@ func DialIP(netProto string, laddr, raddr *IPAddr) (c *IPConn, err error) { // local address laddr. The returned connection c's ReadFrom // and WriteTo methods can be used to receive and send IP // packets with per-packet addressing. -func ListenIP(netProto string, laddr *IPAddr) (c *IPConn, err error) { +func ListenIP(netProto string, laddr *IPAddr) (*IPConn, error) { return nil, os.EPLAN9 } |