mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-05 08:37:31 -04:00
unix: create types_illumos.go
create a new types_illumos.go for illumos specific constants and structs, bring in those needed for wireguard-go Change-Id: I68117abcae66127b617faea1f4cc2568b8b28d58 GitHub-Last-Rev: 3003e04e7e1c8d0e0677a98b89dac3f682a1ed22 GitHub-Pull-Request: golang/sys#100 Reviewed-on: https://go-review.googlesource.com/c/sys/+/301713 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
committed by
Tobias Klauser
parent
77fc1eacc6
commit
390168757d
+1
-1
@@ -199,7 +199,7 @@ illumos_amd64)
|
|||||||
mksyscall="go run mksyscall_solaris.go"
|
mksyscall="go run mksyscall_solaris.go"
|
||||||
mkerrors=
|
mkerrors=
|
||||||
mksysnum=
|
mksysnum=
|
||||||
mktypes=
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2
|
echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
// Copyright 2021 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:build ignore
|
||||||
|
// +build ignore
|
||||||
|
|
||||||
|
/*
|
||||||
|
Input to cgo -godefs. See README.md
|
||||||
|
*/
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
/*
|
||||||
|
#include <net/if.h>
|
||||||
|
#include <sys/sockio.h>
|
||||||
|
#include <sys/stropts.h>
|
||||||
|
|
||||||
|
// Many illumos distributions ship a 3rd party tun/tap driver
|
||||||
|
// from https://github.com/kaizawa/tuntap
|
||||||
|
// It supports a pair of IOCTLs defined at
|
||||||
|
// https://github.com/kaizawa/tuntap/blob/master/if_tun.h#L91-L93
|
||||||
|
#define TUNNEWPPA (('T'<<16) | 0x0001)
|
||||||
|
#define TUNSETPPA (('T'<<16) | 0x0002)
|
||||||
|
*/
|
||||||
|
import "C"
|
||||||
|
|
||||||
|
const (
|
||||||
|
TUNNEWPPA = C.TUNNEWPPA
|
||||||
|
TUNSETPPA = C.TUNSETPPA
|
||||||
|
|
||||||
|
// sys/stropts.h:
|
||||||
|
I_STR = C.I_STR
|
||||||
|
I_POP = C.I_POP
|
||||||
|
I_PUSH = C.I_PUSH
|
||||||
|
I_PLINK = C.I_PLINK
|
||||||
|
I_PUNLINK = C.I_PUNLINK
|
||||||
|
|
||||||
|
// sys/sockio.h:
|
||||||
|
IF_UNITSEL = C.IF_UNITSEL
|
||||||
|
)
|
||||||
|
|
||||||
|
type strbuf C.struct_strbuf
|
||||||
|
|
||||||
|
type strioctl C.struct_strioctl
|
||||||
|
|
||||||
|
type lifreq C.struct_lifreq
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
// cgo -godefs types_illumos.go | go run mkpost.go
|
||||||
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
|
//go:build amd64 && illumos
|
||||||
|
// +build amd64,illumos
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
const (
|
||||||
|
TUNNEWPPA = 0x540001
|
||||||
|
TUNSETPPA = 0x540002
|
||||||
|
|
||||||
|
I_STR = 0x5308
|
||||||
|
I_POP = 0x5303
|
||||||
|
I_PUSH = 0x5302
|
||||||
|
I_PLINK = 0x5316
|
||||||
|
I_PUNLINK = 0x5317
|
||||||
|
|
||||||
|
IF_UNITSEL = -0x7ffb8cca
|
||||||
|
)
|
||||||
|
|
||||||
|
type strbuf struct {
|
||||||
|
Maxlen int32
|
||||||
|
Len int32
|
||||||
|
Buf *int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type strioctl struct {
|
||||||
|
Cmd int32
|
||||||
|
Timout int32
|
||||||
|
Len int32
|
||||||
|
Dp *int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type lifreq struct {
|
||||||
|
Name [32]int8
|
||||||
|
Lifru1 [4]byte
|
||||||
|
Type uint32
|
||||||
|
Lifru [336]byte
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user