Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
0015e8eb
Commit
0015e8eb
authored
Jun 03, 2011
by
Mikio Hara
Committed by
Russ Cox
Jun 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: fix windows build
R=rsc CC=golang-dev
https://golang.org/cl/4539108
parent
518331df
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
44 deletions
+114
-44
interface.go
src/pkg/net/interface.go
+0
-44
interface_bsd.go
src/pkg/net/interface_bsd.go
+43
-0
interface_linux.go
src/pkg/net/interface_linux.go
+43
-0
interface_stub.go
src/pkg/net/interface_stub.go
+28
-0
No files found.
src/pkg/net/interface.go
View file @
0015e8eb
...
...
@@ -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
{
...
...
src/pkg/net/interface_bsd.go
View file @
0015e8eb
...
...
@@ -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.
...
...
src/pkg/net/interface_linux.go
View file @
0015e8eb
...
...
@@ -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.
...
...
src/pkg/net/interface_stub.go
View file @
0015e8eb
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment