]> Cypherpunks repositories - gostls13.git/commitdiff
net: fix windows build
authorMikio Hara <mikioh.mikioh@gmail.com>
Fri, 3 Jun 2011 19:16:05 +0000 (15:16 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 3 Jun 2011 19:16:05 +0000 (15:16 -0400)
R=rsc
CC=golang-dev
https://golang.org/cl/4539108

src/pkg/net/interface.go
src/pkg/net/interface_bsd.go
src/pkg/net/interface_linux.go
src/pkg/net/interface_stub.go

index 7463a117134bf118f920f91d562f6b2749384929..f622487ab0b235bedbedfe5f310006ea442d9282 100644 (file)
@@ -10,7 +10,6 @@ import (
        "bytes"
        "fmt"
        "os"
-       "syscall"
 )
 
 // A HardwareAddr represents a physical hardware address.
@@ -38,49 +37,6 @@ type Interface struct {
        rawFlags     int
 }
 
-// IsUp returns true if ifi is up.
-func (ifi *Interface) IsUp() bool {
-       if ifi == nil {
-               return false
-       }
-       return ifi.rawFlags&syscall.IFF_UP != 0
-}
-
-// IsLoopback returns true if ifi is a loopback interface.
-func (ifi *Interface) IsLoopback() bool {
-       if ifi == nil {
-               return false
-       }
-       return ifi.rawFlags&syscall.IFF_LOOPBACK != 0
-}
-
-// CanBroadcast returns true if ifi supports a broadcast access
-// capability.
-func (ifi *Interface) CanBroadcast() bool {
-       if ifi == nil {
-               return false
-       }
-       return ifi.rawFlags&syscall.IFF_BROADCAST != 0
-}
-
-// IsPointToPoint returns true if ifi belongs to a point-to-point
-// link.
-func (ifi *Interface) IsPointToPoint() bool {
-       if ifi == nil {
-               return false
-       }
-       return ifi.rawFlags&syscall.IFF_POINTOPOINT != 0
-}
-
-// CanMulticast returns true if ifi supports a multicast access
-// capability.
-func (ifi *Interface) CanMulticast() bool {
-       if ifi == nil {
-               return false
-       }
-       return ifi.rawFlags&syscall.IFF_MULTICAST != 0
-}
-
 // Addrs returns interface addresses for a specific interface.
 func (ifi *Interface) Addrs() ([]Addr, os.Error) {
        if ifi == nil {
index c410881dd85327b7120bb4e72cf4affc20601f60..0c6ce767cd8362a347a9c2082f326ed2b2ae2a3b 100644 (file)
@@ -11,6 +11,49 @@ import (
        "syscall"
 )
 
+// IsUp returns true if ifi is up.
+func (ifi *Interface) IsUp() bool {
+       if ifi == nil {
+               return false
+       }
+       return ifi.rawFlags&syscall.IFF_UP != 0
+}
+
+// IsLoopback returns true if ifi is a loopback interface.
+func (ifi *Interface) IsLoopback() bool {
+       if ifi == nil {
+               return false
+       }
+       return ifi.rawFlags&syscall.IFF_LOOPBACK != 0
+}
+
+// CanBroadcast returns true if ifi supports a broadcast access
+// capability.
+func (ifi *Interface) CanBroadcast() bool {
+       if ifi == nil {
+               return false
+       }
+       return ifi.rawFlags&syscall.IFF_BROADCAST != 0
+}
+
+// IsPointToPoint returns true if ifi belongs to a point-to-point
+// link.
+func (ifi *Interface) IsPointToPoint() bool {
+       if ifi == nil {
+               return false
+       }
+       return ifi.rawFlags&syscall.IFF_POINTOPOINT != 0
+}
+
+// CanMulticast returns true if ifi supports a multicast access
+// capability.
+func (ifi *Interface) CanMulticast() bool {
+       if ifi == nil {
+               return false
+       }
+       return ifi.rawFlags&syscall.IFF_MULTICAST != 0
+}
+
 // If the ifindex is zero, interfaceTable returns mappings of all
 // network interfaces.  Otheriwse it returns a mapping of a specific
 // interface.
index f41befe69a7cd49ceffcbd21d6c43d4f09256724..5c9657834eda7b21b608d0346d930b52d7cae5bb 100644 (file)
@@ -12,6 +12,49 @@ import (
        "unsafe"
 )
 
+// IsUp returns true if ifi is up.
+func (ifi *Interface) IsUp() bool {
+       if ifi == nil {
+               return false
+       }
+       return ifi.rawFlags&syscall.IFF_UP != 0
+}
+
+// IsLoopback returns true if ifi is a loopback interface.
+func (ifi *Interface) IsLoopback() bool {
+       if ifi == nil {
+               return false
+       }
+       return ifi.rawFlags&syscall.IFF_LOOPBACK != 0
+}
+
+// CanBroadcast returns true if ifi supports a broadcast access
+// capability.
+func (ifi *Interface) CanBroadcast() bool {
+       if ifi == nil {
+               return false
+       }
+       return ifi.rawFlags&syscall.IFF_BROADCAST != 0
+}
+
+// IsPointToPoint returns true if ifi belongs to a point-to-point
+// link.
+func (ifi *Interface) IsPointToPoint() bool {
+       if ifi == nil {
+               return false
+       }
+       return ifi.rawFlags&syscall.IFF_POINTOPOINT != 0
+}
+
+// CanMulticast returns true if ifi supports a multicast access
+// capability.
+func (ifi *Interface) CanMulticast() bool {
+       if ifi == nil {
+               return false
+       }
+       return ifi.rawFlags&syscall.IFF_MULTICAST != 0
+}
+
 // If the ifindex is zero, interfaceTable returns mappings of all
 // network interfaces.  Otheriwse it returns a mapping of a specific
 // interface.
index 24a7431c56ade6f7ba2b3e95c4c543ad12bdce15..feb871bb5b6dd14a34e66b2261cb2481818b13e1 100644 (file)
@@ -8,6 +8,34 @@ package net
 
 import "os"
 
+// IsUp returns true if ifi is up.
+func (ifi *Interface) IsUp() bool {
+       return false
+}
+
+// IsLoopback returns true if ifi is a loopback interface.
+func (ifi *Interface) IsLoopback() bool {
+       return false
+}
+
+// CanBroadcast returns true if ifi supports a broadcast access
+// capability.
+func (ifi *Interface) CanBroadcast() bool {
+       return false
+}
+
+// IsPointToPoint returns true if ifi belongs to a point-to-point
+// link.
+func (ifi *Interface) IsPointToPoint() bool {
+       return false
+}
+
+// CanMulticast returns true if ifi supports a multicast access
+// capability.
+func (ifi *Interface) CanMulticast() bool {
+       return false
+}
+
 // If the ifindex is zero, interfaceTable returns mappings of all
 // network interfaces.  Otheriwse it returns a mapping of a specific
 // interface.