summaryrefslogtreecommitdiff
path: root/src/pkg/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/net')
-rw-r--r--src/pkg/net/Makefile97
-rw-r--r--src/pkg/net/dialgoogle_test.go11
-rw-r--r--src/pkg/net/dnsclient.go1
-rw-r--r--src/pkg/net/dnsconfig.go1
-rw-r--r--src/pkg/net/dnsmsg.go1
-rw-r--r--src/pkg/net/fd.go4
-rw-r--r--src/pkg/net/fd_darwin.go1
-rw-r--r--src/pkg/net/fd_linux.go1
-rw-r--r--src/pkg/net/ip.go1
-rw-r--r--src/pkg/net/ip_test.go1
-rw-r--r--src/pkg/net/net.go4
-rw-r--r--src/pkg/net/net_test.go3
-rw-r--r--src/pkg/net/parse_test.go1
-rw-r--r--src/pkg/net/port.go1
-rw-r--r--src/pkg/net/port_test.go1
-rw-r--r--src/pkg/net/server_test.go5
-rw-r--r--src/pkg/net/timeout_test.go3
17 files changed, 22 insertions, 115 deletions
diff --git a/src/pkg/net/Makefile b/src/pkg/net/Makefile
index 77056198a..a56f7c9b3 100644
--- a/src/pkg/net/Makefile
+++ b/src/pkg/net/Makefile
@@ -2,89 +2,18 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-
-# DO NOT EDIT. Automatically generated by gobuild.
-# gobuild -m dnsclient.go dnsconfig.go dnsmsg.go fd.go fd_${GOOS}.go ip.go net.go parse.go port.go >Makefile
-
-D=
-
include $(GOROOT)/src/Make.$(GOARCH)
-AR=gopack
-
-default: packages
-
-clean:
- rm -rf *.[$(OS)] *.a [$(OS)].out _obj
-
-test: packages
- gotest
-
-coverage: packages
- gotest
- 6cov -g $$(pwd) | grep -v '_test\.go:'
-
-%.$O: %.go
- $(GC) -I_obj $*.go
-
-%.$O: %.c
- $(CC) $*.c
-
-%.$O: %.s
- $(AS) $*.s
-
-O1=\
- fd_$(GOOS).$O\
- parse.$O\
-
-O2=\
- fd.$O\
- ip.$O\
-
-O3=\
- dnsconfig.$O\
- dnsmsg.$O\
- net.$O\
-
-O4=\
- dnsclient.$O\
- port.$O\
-
-
-phases: a1 a2 a3 a4
-_obj$D/net.a: phases
-
-a1: $(O1)
- $(AR) grc _obj$D/net.a fd_$(GOOS).$O parse.$O
- rm -f $(O1)
-
-a2: $(O2)
- $(AR) grc _obj$D/net.a fd.$O ip.$O
- rm -f $(O2)
-
-a3: $(O3)
- $(AR) grc _obj$D/net.a dnsconfig.$O dnsmsg.$O net.$O
- rm -f $(O3)
-
-a4: $(O4)
- $(AR) grc _obj$D/net.a dnsclient.$O port.$O
- rm -f $(O4)
-
-
-newpkg: clean
- mkdir -p _obj$D
- $(AR) grc _obj$D/net.a
-
-$(O1): newpkg
-$(O2): a1
-$(O3): a2
-$(O4): a3
-$(O5): a4
-
-nuke: clean
- rm -f $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/net.a
-
-packages: _obj$D/net.a
-install: packages
- test -d $(GOROOT)/pkg && mkdir -p $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D
- cp _obj$D/net.a $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/net.a
+TARG=net
+GOFILES=\
+ dnsclient.go\
+ dnsconfig.go\
+ dnsmsg.go\
+ fd.go\
+ fd_$(GOOS).go\
+ ip.go\
+ net.go\
+ parse.go\
+ port.go\
+
+include $(GOROOT)/src/Make.pkg
diff --git a/src/pkg/net/dialgoogle_test.go b/src/pkg/net/dialgoogle_test.go
index e65aaac30..cb5389aad 100644
--- a/src/pkg/net/dialgoogle_test.go
+++ b/src/pkg/net/dialgoogle_test.go
@@ -7,7 +7,6 @@ package net
import (
"flag";
"io";
- "net";
"os";
"strings";
"syscall";
@@ -19,7 +18,7 @@ var ipv6 = flag.Bool("ipv6", false, "assume ipv6 tunnel is present")
// fd is already connected to the destination, port 80.
// Run an HTTP request to fetch the appropriate page.
-func fetchGoogle(t *testing.T, fd net.Conn, network, addr string) {
+func fetchGoogle(t *testing.T, fd Conn, network, addr string) {
req := strings.Bytes("GET /intl/en/privacy.html HTTP/1.0\r\nHost: www.google.com\r\n\r\n");
n, err := fd.Write(req);
@@ -33,9 +32,9 @@ func fetchGoogle(t *testing.T, fd net.Conn, network, addr string) {
}
func doDial(t *testing.T, network, addr string) {
- fd, err := net.Dial(network, "", addr);
+ fd, err := Dial(network, "", addr);
if err != nil {
- t.Errorf("net.Dial(%q, %q, %q) = _, %v", network, "", addr, err);
+ t.Errorf("Dial(%q, %q, %q) = _, %v", network, "", addr, err);
return
}
fetchGoogle(t, fd, network, addr);
@@ -43,9 +42,9 @@ func doDial(t *testing.T, network, addr string) {
}
func doDialTCP(t *testing.T, network, addr string) {
- fd, err := net.DialTCP(network, "", addr);
+ fd, err := DialTCP(network, "", addr);
if err != nil {
- t.Errorf("net.DialTCP(%q, %q, %q) = _, %v", network, "", addr, err);
+ t.Errorf("DialTCP(%q, %q, %q) = _, %v", network, "", addr, err);
} else {
fetchGoogle(t, fd, network, addr);
}
diff --git a/src/pkg/net/dnsclient.go b/src/pkg/net/dnsclient.go
index 7e82855a1..859bef33a 100644
--- a/src/pkg/net/dnsclient.go
+++ b/src/pkg/net/dnsclient.go
@@ -17,7 +17,6 @@ package net
import (
"io";
- "net";
"once";
"os";
"strings";
diff --git a/src/pkg/net/dnsconfig.go b/src/pkg/net/dnsconfig.go
index 7e455d5f8..5cbfbc4e0 100644
--- a/src/pkg/net/dnsconfig.go
+++ b/src/pkg/net/dnsconfig.go
@@ -8,7 +8,6 @@ package net
import (
"io";
- "net";
"os";
"strconv";
)
diff --git a/src/pkg/net/dnsmsg.go b/src/pkg/net/dnsmsg.go
index c7fb07f6d..a166c9661 100644
--- a/src/pkg/net/dnsmsg.go
+++ b/src/pkg/net/dnsmsg.go
@@ -25,7 +25,6 @@ package net
import (
"fmt";
- "net";
"os";
"reflect";
)
diff --git a/src/pkg/net/fd.go b/src/pkg/net/fd.go
index 0917c50fc..ec125f228 100644
--- a/src/pkg/net/fd.go
+++ b/src/pkg/net/fd.go
@@ -7,7 +7,6 @@
package net
import (
- "net";
"once";
"os";
"sync";
@@ -73,7 +72,6 @@ type pollServer struct {
poll *pollster; // low-level OS hooks
deadline int64; // next deadline (nsec since 1970)
}
-func (s *pollServer) Run();
func newPollServer() (s *pollServer, err os.Error) {
s = new(pollServer);
@@ -324,8 +322,6 @@ func isEAGAIN(e os.Error) bool {
return e == os.EAGAIN;
}
-func sockaddrToString(sa syscall.Sockaddr) (name string, err os.Error)
-
func (fd *netFD) addr() string {
sa, e := syscall.Getsockname(fd.fd);
if e != 0 {
diff --git a/src/pkg/net/fd_darwin.go b/src/pkg/net/fd_darwin.go
index c5b38eb3b..8de8ce300 100644
--- a/src/pkg/net/fd_darwin.go
+++ b/src/pkg/net/fd_darwin.go
@@ -7,7 +7,6 @@
package net
import (
- "net";
"os";
"syscall";
)
diff --git a/src/pkg/net/fd_linux.go b/src/pkg/net/fd_linux.go
index 04cf8eac4..5f4b5a9a2 100644
--- a/src/pkg/net/fd_linux.go
+++ b/src/pkg/net/fd_linux.go
@@ -7,7 +7,6 @@
package net
import (
- "net";
"os";
"syscall";
)
diff --git a/src/pkg/net/ip.go b/src/pkg/net/ip.go
index 8c52ede1e..8efdb5778 100644
--- a/src/pkg/net/ip.go
+++ b/src/pkg/net/ip.go
@@ -13,7 +13,6 @@
package net
import (
- "net"
)
// IP address lengths (bytes).
diff --git a/src/pkg/net/ip_test.go b/src/pkg/net/ip_test.go
index fb2ae8216..32840a886 100644
--- a/src/pkg/net/ip_test.go
+++ b/src/pkg/net/ip_test.go
@@ -5,7 +5,6 @@
package net
import (
- "net";
"testing"
)
diff --git a/src/pkg/net/net.go b/src/pkg/net/net.go
index 46efa6e58..c8d533206 100644
--- a/src/pkg/net/net.go
+++ b/src/pkg/net/net.go
@@ -5,7 +5,6 @@
package net
import (
- "net";
"os";
"reflect";
"strconv";
@@ -158,9 +157,6 @@ func listenBacklog() int {
return syscall.SOMAXCONN
}
-func LookupHost(name string) (cname string, addrs []string, err os.Error)
-func LookupPort(network, service string) (port int, err os.Error)
-
// Split "host:port" into "host" and "port".
// Host cannot contain colons unless it is bracketed.
func splitHostPort(hostport string) (host, port string, err os.Error) {
diff --git a/src/pkg/net/net_test.go b/src/pkg/net/net_test.go
index ec2037fe9..3430efb9a 100644
--- a/src/pkg/net/net_test.go
+++ b/src/pkg/net/net_test.go
@@ -5,7 +5,6 @@
package net
import (
- "net";
"os";
"regexp";
"testing";
@@ -55,7 +54,7 @@ var dialErrorTests = []DialErrorTest {
func TestDialError(t *testing.T) {
for i, tt := range dialErrorTests {
- c, e := net.Dial(tt.Net, tt.Laddr, tt.Raddr);
+ c, e := Dial(tt.Net, tt.Laddr, tt.Raddr);
if c != nil {
c.Close();
}
diff --git a/src/pkg/net/parse_test.go b/src/pkg/net/parse_test.go
index ce0bb4709..227ae55f1 100644
--- a/src/pkg/net/parse_test.go
+++ b/src/pkg/net/parse_test.go
@@ -6,7 +6,6 @@ package net
import (
"bufio";
- "net";
"os";
"testing";
)
diff --git a/src/pkg/net/port.go b/src/pkg/net/port.go
index a9cd98daf..c5789adc9 100644
--- a/src/pkg/net/port.go
+++ b/src/pkg/net/port.go
@@ -8,7 +8,6 @@ package net
import (
"io";
- "net";
"once";
"os";
)
diff --git a/src/pkg/net/port_test.go b/src/pkg/net/port_test.go
index c535d4caa..aa2a3a7a6 100644
--- a/src/pkg/net/port_test.go
+++ b/src/pkg/net/port_test.go
@@ -5,7 +5,6 @@
package net
import (
- "net";
"testing";
)
diff --git a/src/pkg/net/server_test.go b/src/pkg/net/server_test.go
index 92ed68338..c2be68a0d 100644
--- a/src/pkg/net/server_test.go
+++ b/src/pkg/net/server_test.go
@@ -6,7 +6,6 @@ package net
import (
"io";
- "net";
"os";
"strings";
"syscall";
@@ -27,7 +26,7 @@ func runEcho(fd io.ReadWriter, done chan<- int) {
}
func runServe(t *testing.T, network, addr string, listening chan<- string, done chan<- int) {
- l, err := net.Listen(network, addr);
+ l, err := Listen(network, addr);
if err != nil {
t.Fatalf("net.Listen(%q, %q) = _, %v", network, addr, err);
}
@@ -47,7 +46,7 @@ func runServe(t *testing.T, network, addr string, listening chan<- string, done
}
func connect(t *testing.T, network, addr string) {
- fd, err := net.Dial(network, "", addr);
+ fd, err := Dial(network, "", addr);
if err != nil {
t.Fatalf("net.Dial(%q, %q, %q) = _, %v", network, "", addr, err);
}
diff --git a/src/pkg/net/timeout_test.go b/src/pkg/net/timeout_test.go
index 0aebce88a..bc49dadf4 100644
--- a/src/pkg/net/timeout_test.go
+++ b/src/pkg/net/timeout_test.go
@@ -5,14 +5,13 @@
package net
import (
- "net";
"os";
"testing";
"time";
)
func testTimeout(t *testing.T, network, addr string) {
- fd, err := net.Dial(network, "", addr);
+ fd, err := Dial(network, "", addr);
defer fd.Close();
if err != nil {
t.Errorf("dial %s %s failed: %v", network, addr, err);