go.net/ipv4: update TODOs

TODOs for stub files are unnecessary because they are stubs.
Also adds TODOs that need to be treated for spurious word
boundary access on some CPU architecture such as ARM, Power.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/171110043
This commit is contained in:
Mikio Hara
2014-11-06 13:18:00 +09:00
parent 75d3d53ceb
commit 63ee83b038
6 changed files with 7 additions and 24 deletions

View File

@@ -7,21 +7,17 @@
package ipv4
func setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error {
// TODO(mikio): Implement this
return errOpNoSupport
}
func newControlMessage(opt *rawOpt) []byte {
// TODO(mikio): Implement this
return nil
}
func parseControlMessage(b []byte) (*ControlMessage, error) {
// TODO(mikio): Implement this
return nil, errOpNoSupport
}
func marshalControlMessage(cm *ControlMessage) []byte {
// TODO(mikio): Implement this
return nil
}

View File

@@ -7,21 +7,21 @@ package ipv4
import "syscall"
func setControlMessage(fd syscall.Handle, opt *rawOpt, cf ControlFlags, on bool) error {
// TODO(mikio): Implement this
// TODO(mikio): implement this
return syscall.EWINDOWS
}
func newControlMessage(opt *rawOpt) []byte {
// TODO(mikio): Implement this
// TODO(mikio): implement this
return nil
}
func parseControlMessage(b []byte) (*ControlMessage, error) {
// TODO(mikio): Implement this
// TODO(mikio): implement this
return nil, syscall.EWINDOWS
}
func marshalControlMessage(cm *ControlMessage) []byte {
// TODO(mikio): Implement this
// TODO(mikio): implement this
return nil
}

View File

@@ -9,41 +9,33 @@ package ipv4
import "net"
func (c *dgramOpt) MulticastTTL() (int, error) {
// TODO(mikio): Implement this
return 0, errOpNoSupport
}
func (c *dgramOpt) SetMulticastTTL(ttl int) error {
// TODO(mikio): Implement this
return errOpNoSupport
}
func (c *dgramOpt) MulticastInterface() (*net.Interface, error) {
// TODO(mikio): Implement this
return nil, errOpNoSupport
}
func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error {
// TODO(mikio): Implement this
return errOpNoSupport
}
func (c *dgramOpt) MulticastLoopback() (bool, error) {
// TODO(mikio): Implement this
return false, errOpNoSupport
}
func (c *dgramOpt) SetMulticastLoopback(on bool) error {
// TODO(mikio): Implement this
return errOpNoSupport
}
func (c *dgramOpt) JoinGroup(ifi *net.Interface, grp net.Addr) error {
// TODO(mikio): Implement this
return errOpNoSupport
}
func (c *dgramOpt) LeaveGroup(ifi *net.Interface, grp net.Addr) error {
// TODO(mikio): Implement this
return errOpNoSupport
}

View File

@@ -7,21 +7,17 @@
package ipv4
func (c *genericOpt) TOS() (int, error) {
// TODO(mikio): Implement this
return 0, errOpNoSupport
}
func (c *genericOpt) SetTOS(tos int) error {
// TODO(mikio): Implement this
return errOpNoSupport
}
func (c *genericOpt) TTL() (int, error) {
// TODO(mikio): Implement this
return 0, errOpNoSupport
}
func (c *genericOpt) SetTTL(ttl int) error {
// TODO(mikio): Implement this
return errOpNoSupport
}

View File

@@ -100,6 +100,7 @@ func (h *Header) Marshal() ([]byte, error) {
b[posTotalLen], b[posTotalLen+1] = byte(h.TotalLen>>8), byte(h.TotalLen)
b[posFragOff], b[posFragOff+1] = byte(flagsAndFragOff>>8), byte(flagsAndFragOff)
} else {
// TODO(mikio): fix spurious word boundary access
*(*uint16)(unsafe.Pointer(&b[posTotalLen : posTotalLen+1][0])) = uint16(h.TotalLen)
*(*uint16)(unsafe.Pointer(&b[posFragOff : posFragOff+1][0])) = uint16(flagsAndFragOff)
}
@@ -141,10 +142,12 @@ func ParseHeader(b []byte) (*Header, error) {
h.TotalLen = int(b[posTotalLen])<<8 | int(b[posTotalLen+1])
h.FragOff = int(b[posFragOff])<<8 | int(b[posFragOff+1])
} else {
// TODO(mikio): fix spurious word boundary access
h.TotalLen = int(*(*uint16)(unsafe.Pointer(&b[posTotalLen : posTotalLen+1][0])))
if runtime.GOOS != "freebsd" || freebsdVersion < 1000000 {
h.TotalLen += hdrlen
}
// TODO(mikio): fix spurious word boundary access
h.FragOff = int(*(*uint16)(unsafe.Pointer(&b[posFragOff : posFragOff+1][0])))
}
h.Flags = HeaderFlags(h.FragOff&0xe000) >> 13

View File

@@ -7,21 +7,17 @@
package ipv4
func (c *genericOpt) sysfd() (int, error) {
// TODO(mikio): Implement this
return 0, errOpNoSupport
}
func (c *dgramOpt) sysfd() (int, error) {
// TODO(mikio): Implement this
return 0, errOpNoSupport
}
func (c *payloadHandler) sysfd() (int, error) {
// TODO(mikio): Implement this
return 0, errOpNoSupport
}
func (c *packetHandler) sysfd() (int, error) {
// TODO(mikio): Implement this
return 0, errOpNoSupport
}