summaryrefslogtreecommitdiff
path: root/src/nslcd_proto/io.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-08-26 20:25:52 -0600
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-08-26 20:25:52 -0600
commit13bb2e14fcdd260d060b7240357d4a8a80002114 (patch)
tree8bd49d988aa597c98578833b0b82b952b203c98b /src/nslcd_proto/io.go
parenta6ac8f680062069b2821214f5b74cc96673ee4ca (diff)
work
Diffstat (limited to 'src/nslcd_proto/io.go')
-rw-r--r--src/nslcd_proto/io.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/nslcd_proto/io.go b/src/nslcd_proto/io.go
index 0804e98..e31aabc 100644
--- a/src/nslcd_proto/io.go
+++ b/src/nslcd_proto/io.go
@@ -6,11 +6,9 @@ import (
"io"
"net"
"reflect"
+ "syscall"
)
-//#include <sys/socket.h>
-import "C"
-
type NslcdObject interface {
NslcdWrite(fd io.Writer)
}
@@ -46,9 +44,9 @@ func write(fd io.Writer, data interface{}) {
var af int32 = -1
switch len(data) {
case net.IPv4len:
- af = C.AF_INET
+ af = syscall.AF_INET
case net.IPv6len:
- af = C.AF_INET6
+ af = syscall.AF_INET6
}
var bytes []byte
if af < 0 {
@@ -112,9 +110,9 @@ func read(fd io.Reader, data interface{}) {
read(fd, &af)
var _len int32
switch af {
- case C.AF_INET:
+ case syscall.AF_INET:
_len = net.IPv4len
- case C.AF_INET6:
+ case syscall.AF_INET6:
_len = net.IPv6len
default:
panic(NslcdError(fmt.Sprintf("incorrect address family specified: %d", af)))