5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-14 03:50:26 +00:00

Use whatsapp forks (#750)

This commit is contained in:
Wim 2019-03-02 13:04:28 +01:00 committed by GitHub
parent af00c34aac
commit df3fdc26a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
96 changed files with 1860 additions and 799 deletions

View File

@ -6,9 +6,9 @@ import (
"github.com/42wim/matterbridge/bridge/config" "github.com/42wim/matterbridge/bridge/config"
"github.com/Rhymen/go-whatsapp" "github.com/matterbridge/go-whatsapp"
whatsappExt "maunium.net/go/mautrix-whatsapp/whatsapp-ext" whatsappExt "github.com/matterbridge/mautrix-whatsapp/whatsapp-ext"
) )
/* /*

View File

@ -6,7 +6,7 @@ import (
"os" "os"
qrcodeTerminal "github.com/Baozisoftware/qrcode-terminal-go" qrcodeTerminal "github.com/Baozisoftware/qrcode-terminal-go"
"github.com/Rhymen/go-whatsapp" "github.com/matterbridge/go-whatsapp"
) )
func qrFromTerminal(invert bool) chan string { func qrFromTerminal(invert bool) chan string {

View File

@ -12,9 +12,9 @@ import (
"github.com/42wim/matterbridge/bridge" "github.com/42wim/matterbridge/bridge"
"github.com/42wim/matterbridge/bridge/config" "github.com/42wim/matterbridge/bridge/config"
"github.com/Rhymen/go-whatsapp" "github.com/matterbridge/go-whatsapp"
whatsappExt "maunium.net/go/mautrix-whatsapp/whatsapp-ext" whatsappExt "github.com/matterbridge/mautrix-whatsapp/whatsapp-ext"
) )
const ( const (

4
go.mod
View File

@ -6,7 +6,6 @@ require (
github.com/BurntSushi/toml v0.0.0-20170318202913-d94612f9fc14 // indirect github.com/BurntSushi/toml v0.0.0-20170318202913-d94612f9fc14 // indirect
github.com/Jeffail/gabs v1.1.1 // indirect github.com/Jeffail/gabs v1.1.1 // indirect
github.com/Philipp15b/go-steam v1.0.1-0.20180818081528-681bd9573329 github.com/Philipp15b/go-steam v1.0.1-0.20180818081528-681bd9573329
github.com/Rhymen/go-whatsapp v0.0.0-20190208184307-c9a81e957884
github.com/bwmarrin/discordgo v0.19.0 github.com/bwmarrin/discordgo v0.19.0
github.com/d5/tengo v1.9.2 github.com/d5/tengo v1.9.2
github.com/dfordsoft/golib v0.0.0-20180902042739-76ee6ab99bec github.com/dfordsoft/golib v0.0.0-20180902042739-76ee6ab99bec
@ -28,10 +27,12 @@ require (
github.com/lusis/go-slackbot v0.0.0-20180109053408-401027ccfef5 // indirect github.com/lusis/go-slackbot v0.0.0-20180109053408-401027ccfef5 // indirect
github.com/lusis/slack-test v0.0.0-20180109053238-3c758769bfa6 // indirect github.com/lusis/slack-test v0.0.0-20180109053238-3c758769bfa6 // indirect
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d
github.com/matterbridge/go-whatsapp v0.0.1-0.20190301204034-f2f1b29d441b
github.com/matterbridge/go-xmpp v0.0.0-20180529212104-cd19799fba91 github.com/matterbridge/go-xmpp v0.0.0-20180529212104-cd19799fba91
github.com/matterbridge/gomatrix v0.0.0-20190102230110-6f9631ca6dea github.com/matterbridge/gomatrix v0.0.0-20190102230110-6f9631ca6dea
github.com/matterbridge/gozulipbot v0.0.0-20190212232658-7aa251978a18 github.com/matterbridge/gozulipbot v0.0.0-20190212232658-7aa251978a18
github.com/matterbridge/logrus-prefixed-formatter v0.0.0-20180806162718-01618749af61 github.com/matterbridge/logrus-prefixed-formatter v0.0.0-20180806162718-01618749af61
github.com/matterbridge/mautrix-whatsapp v0.0.0-20190301210046-3539cf52ed6e
github.com/mattermost/mattermost-server v5.5.0+incompatible github.com/mattermost/mattermost-server v5.5.0+incompatible
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/mreiferson/go-httpclient v0.0.0-20160630210159-31f0106b4474 // indirect github.com/mreiferson/go-httpclient v0.0.0-20160630210159-31f0106b4474 // indirect
@ -70,5 +71,4 @@ require (
gopkg.in/fsnotify.v1 v1.4.7 // indirect gopkg.in/fsnotify.v1 v1.4.7 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
maunium.net/go/mautrix-whatsapp v0.0.0-20190127121751-281b3e8f77f3
) )

35
go.sum
View File

@ -8,11 +8,6 @@ github.com/Jeffail/gabs v1.1.1 h1:V0uzR08Hj22EX8+8QMhyI9sX2hwRu+/RJhJUmnwda/E=
github.com/Jeffail/gabs v1.1.1/go.mod h1:6xMvQMK4k33lb7GUUpaAPh6nKMmemQeg5d4gn7/bOXc= github.com/Jeffail/gabs v1.1.1/go.mod h1:6xMvQMK4k33lb7GUUpaAPh6nKMmemQeg5d4gn7/bOXc=
github.com/Philipp15b/go-steam v1.0.1-0.20180818081528-681bd9573329 h1:xZBoq249G9MSt+XuY7sVQzcfONJ6IQuwpCK+KAaOpnY= github.com/Philipp15b/go-steam v1.0.1-0.20180818081528-681bd9573329 h1:xZBoq249G9MSt+XuY7sVQzcfONJ6IQuwpCK+KAaOpnY=
github.com/Philipp15b/go-steam v1.0.1-0.20180818081528-681bd9573329/go.mod h1:HuVM+sZFzumUdKPWiz+IlCMb4RdsKdT3T+nQBKL+sYg= github.com/Philipp15b/go-steam v1.0.1-0.20180818081528-681bd9573329/go.mod h1:HuVM+sZFzumUdKPWiz+IlCMb4RdsKdT3T+nQBKL+sYg=
github.com/Rhymen/go-whatsapp v0.0.0-20181218094654-2ca6af00572c h1:ldRXgMEfKmzBomrZusl3edG9AGEeztA7jovLEQy62us=
github.com/Rhymen/go-whatsapp v0.0.0-20181218094654-2ca6af00572c/go.mod h1:MSDmePOOkbFFbVW2WRRppBcbA+aabwpXRgyIIG7jDFQ=
github.com/Rhymen/go-whatsapp v0.0.0-20190208184307-c9a81e957884 h1:2AxfzkQi2L4QGBvUCZoWD6hQuUJa5MG54wiYyNqJlf4=
github.com/Rhymen/go-whatsapp v0.0.0-20190208184307-c9a81e957884/go.mod h1:rdQr95g2C1xcOfM7QGOhza58HeI3I+tZ/bbluv7VazA=
github.com/alexcesaro/log v0.0.0-20150915221235-61e686294e58 h1:MkpmYfld/S8kXqTYI68DfL8/hHXjHogL120Dy00TIxc=
github.com/alexcesaro/log v0.0.0-20150915221235-61e686294e58/go.mod h1:YNfsMyWSs+h+PaYkxGeMVmVCX75Zj/pqdjbu12ciCYE= github.com/alexcesaro/log v0.0.0-20150915221235-61e686294e58/go.mod h1:YNfsMyWSs+h+PaYkxGeMVmVCX75Zj/pqdjbu12ciCYE=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/bwmarrin/discordgo v0.19.0 h1:kMED/DB0NR1QhRcalb85w0Cu3Ep2OrGAqZH1R5awQiY= github.com/bwmarrin/discordgo v0.19.0 h1:kMED/DB0NR1QhRcalb85w0Cu3Ep2OrGAqZH1R5awQiY=
@ -43,6 +38,7 @@ github.com/gopackage/ddp v0.0.0-20170117053602-652027933df4/go.mod h1:lEO7XoHJ/x
github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f h1:FDM3EtwZLyhW48YRiyqjivNlNZjAObv4xt4NnJaU+NQ= github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f h1:FDM3EtwZLyhW48YRiyqjivNlNZjAObv4xt4NnJaU+NQ=
github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/schema v1.0.2 h1:sAgNfOcNYvdDSrzGHVy9nzCQahG+qmsg+nE8dK85QRA= github.com/gorilla/schema v1.0.2 h1:sAgNfOcNYvdDSrzGHVy9nzCQahG+qmsg+nE8dK85QRA=
github.com/gorilla/schema v1.0.2/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU= github.com/gorilla/schema v1.0.2/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
@ -82,6 +78,8 @@ github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDe
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d h1:F+Sr+C0ojSlYQ37BLylQtSFmyQULe3jbAygcyXQ9mVs= github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d h1:F+Sr+C0ojSlYQ37BLylQtSFmyQULe3jbAygcyXQ9mVs=
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d/go.mod h1:c6MxwqHD+0HvtAJjsHMIdPCiAwGiQwPRPTp69ACMg8A= github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d/go.mod h1:c6MxwqHD+0HvtAJjsHMIdPCiAwGiQwPRPTp69ACMg8A=
github.com/matterbridge/go-whatsapp v0.0.1-0.20190301204034-f2f1b29d441b h1:cO6Z+yj4Ivq/ay/IxSrV90oSIW/SSXWLa+XHsiLKMrw=
github.com/matterbridge/go-whatsapp v0.0.1-0.20190301204034-f2f1b29d441b/go.mod h1:dW19fYkkdUZsBAx7zv9fDh0n6NRqYIaKwB2JEBw8d0U=
github.com/matterbridge/go-xmpp v0.0.0-20180529212104-cd19799fba91 h1:KzDEcy8eDbTx881giW8a6llsAck3e2bJvMyKvh1IK+k= github.com/matterbridge/go-xmpp v0.0.0-20180529212104-cd19799fba91 h1:KzDEcy8eDbTx881giW8a6llsAck3e2bJvMyKvh1IK+k=
github.com/matterbridge/go-xmpp v0.0.0-20180529212104-cd19799fba91/go.mod h1:ECDRehsR9TYTKCAsRS8/wLeOk6UUqDydw47ln7wG41Q= github.com/matterbridge/go-xmpp v0.0.0-20180529212104-cd19799fba91/go.mod h1:ECDRehsR9TYTKCAsRS8/wLeOk6UUqDydw47ln7wG41Q=
github.com/matterbridge/gomatrix v0.0.0-20190102230110-6f9631ca6dea h1:kaADGqpK4gGO2BpzEyJrBxq2Jc57Rsar4i2EUxcACUc= github.com/matterbridge/gomatrix v0.0.0-20190102230110-6f9631ca6dea h1:kaADGqpK4gGO2BpzEyJrBxq2Jc57Rsar4i2EUxcACUc=
@ -90,12 +88,16 @@ github.com/matterbridge/gozulipbot v0.0.0-20190212232658-7aa251978a18 h1:fLhwXtW
github.com/matterbridge/gozulipbot v0.0.0-20190212232658-7aa251978a18/go.mod h1:yAjnZ34DuDyPHMPHHjOsTk/FefW4JJjoMMCGt/8uuQA= github.com/matterbridge/gozulipbot v0.0.0-20190212232658-7aa251978a18/go.mod h1:yAjnZ34DuDyPHMPHHjOsTk/FefW4JJjoMMCGt/8uuQA=
github.com/matterbridge/logrus-prefixed-formatter v0.0.0-20180806162718-01618749af61 h1:R/MgM/eUyRBQx2FiH6JVmXck8PaAuKfe2M1tWIzW7nE= github.com/matterbridge/logrus-prefixed-formatter v0.0.0-20180806162718-01618749af61 h1:R/MgM/eUyRBQx2FiH6JVmXck8PaAuKfe2M1tWIzW7nE=
github.com/matterbridge/logrus-prefixed-formatter v0.0.0-20180806162718-01618749af61/go.mod h1:iXGEotOvwI1R1SjLxRc+BF5rUORTMtE0iMZBT2lxqAU= github.com/matterbridge/logrus-prefixed-formatter v0.0.0-20180806162718-01618749af61/go.mod h1:iXGEotOvwI1R1SjLxRc+BF5rUORTMtE0iMZBT2lxqAU=
github.com/matterbridge/mautrix-whatsapp v0.0.0-20190301210046-3539cf52ed6e h1:1NqciL8sz+0UYeFrd/UQlL8tJPhFxOBmg+a94DN2sJU=
github.com/matterbridge/mautrix-whatsapp v0.0.0-20190301210046-3539cf52ed6e/go.mod h1:DrIFGcFumRlEW5k3PJjWGKPd4+w37d3SwOxlh1ZAL+4=
github.com/mattermost/mattermost-server v5.5.0+incompatible h1:0wcLGgYtd+YImtLDPf2AOfpBHxbU4suATx+6XKw1XbU= github.com/mattermost/mattermost-server v5.5.0+incompatible h1:0wcLGgYtd+YImtLDPf2AOfpBHxbU4suATx+6XKw1XbU=
github.com/mattermost/mattermost-server v5.5.0+incompatible/go.mod h1:5L6MjAec+XXQwMIt791Ganu45GKsSiM+I0tLR9wUj8Y= github.com/mattermost/mattermost-server v5.5.0+incompatible/go.mod h1:5L6MjAec+XXQwMIt791Ganu45GKsSiM+I0tLR9wUj8Y=
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw=
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
@ -138,11 +140,9 @@ github.com/shazow/rateio v0.0.0-20150116013248-e8e00881e5c1 h1:Lx3BlDGFElJt4u/zK
github.com/shazow/rateio v0.0.0-20150116013248-e8e00881e5c1/go.mod h1:vt2jWY/3Qw1bIzle5thrJWucsLuuX9iUNnp20CqCciI= github.com/shazow/rateio v0.0.0-20150116013248-e8e00881e5c1/go.mod h1:vt2jWY/3Qw1bIzle5thrJWucsLuuX9iUNnp20CqCciI=
github.com/shazow/ssh-chat v0.0.0-20190125184227-81d7e1686296 h1:8RLq547MSVc6vhOuCl4Ca0TsAQknj6NX6ZLSZ3+xmio= github.com/shazow/ssh-chat v0.0.0-20190125184227-81d7e1686296 h1:8RLq547MSVc6vhOuCl4Ca0TsAQknj6NX6ZLSZ3+xmio=
github.com/shazow/ssh-chat v0.0.0-20190125184227-81d7e1686296/go.mod h1:1GLXsL4esywkpNId3v4QWuMf3THtWGitWvtQ/L3aSA4= github.com/shazow/ssh-chat v0.0.0-20190125184227-81d7e1686296/go.mod h1:1GLXsL4esywkpNId3v4QWuMf3THtWGitWvtQ/L3aSA4=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME= github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME=
github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/skip2/go-qrcode v0.0.0-20171229120447-cf5f9fa2f0d8/go.mod h1:PLPIyL7ikehBD1OAjmKKiOEhbvWyHGaNDjquXMcYABo=
github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9 h1:lpEzuenPuO1XNTeikEmvqYFcU37GVLl8SRNblzyvGBE= github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9 h1:lpEzuenPuO1XNTeikEmvqYFcU37GVLl8SRNblzyvGBE=
github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9/go.mod h1:PLPIyL7ikehBD1OAjmKKiOEhbvWyHGaNDjquXMcYABo= github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9/go.mod h1:PLPIyL7ikehBD1OAjmKKiOEhbvWyHGaNDjquXMcYABo=
github.com/smartystreets/assertions v0.0.0-20180803164922-886ec427f6b9 h1:lXQ+j+KwZcbwrbgU0Rp4Eglg3EJLHbuZU3BbOqAGBmg= github.com/smartystreets/assertions v0.0.0-20180803164922-886ec427f6b9 h1:lXQ+j+KwZcbwrbgU0Rp4Eglg3EJLHbuZU3BbOqAGBmg=
@ -160,9 +160,7 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn
github.com/spf13/viper v1.3.1 h1:5+8j8FTpnFV4nEImW/ofkzEt8VoOiLXxdYIDsB73T38= github.com/spf13/viper v1.3.1 h1:5+8j8FTpnFV4nEImW/ofkzEt8VoOiLXxdYIDsB73T38=
github.com/spf13/viper v1.3.1/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.3.1/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
@ -197,27 +195,24 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/
go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o= go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o=
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16 h1:y6ce7gCWtnH+m3dCjzQ1PCuwl28DDIc3VNnvY29DlIA=
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664 h1:YbZJ76lQ1BqNhVe7dKTSB67wDrc2VPRR75IyGyyPDX8=
golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613 h1:MQ/ZZiDsUapFFiMS+vzwXkCTeEKaum+Do5rINYJDmxc=
golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f h1:qWFY9ZxP3tfI37wYIs/MnIAqK0vlXp1xnYEa5HxFSSY=
golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/image v0.0.0-20190220214146-31aff87c08e9 h1:+vH8qNweCrORN49012OX3h0oWEXO3p+rRnpAGQinddk= golang.org/x/image v0.0.0-20190220214146-31aff87c08e9 h1:+vH8qNweCrORN49012OX3h0oWEXO3p+rRnpAGQinddk=
golang.org/x/image v0.0.0-20190220214146-31aff87c08e9/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190220214146-31aff87c08e9/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/net v0.0.0-20190110200230-915654e7eabc h1:Yx9JGxI1SBhVLFjpAkWMaO1TF+xyqtHLjZpvQboJGiM= golang.org/x/net v0.0.0-20190110200230-915654e7eabc h1:Yx9JGxI1SBhVLFjpAkWMaO1TF+xyqtHLjZpvQboJGiM=
golang.org/x/net v0.0.0-20190110200230-915654e7eabc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190110200230-915654e7eabc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181212120007-b05ddf57801d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190109145017-48ac38b7c8cb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc h1:WiYx1rIFmx8c0mXAFtv5D/mHyKe1+jmuP7PViuwqwuQ=
golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222171317-cd391775e71e h1:oF7qaQxUH6KzFdKN4ww7NpPdo53SZi4UlcksLrb2y/o=
golang.org/x/sys v0.0.0-20190222171317-cd391775e71e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@ -235,5 +230,3 @@ maunium.net/go/mauflag v1.0.0/go.mod h1:nLivPOpTpHnpzEh8jEdSL9UqO9+/KBJFmNRlwKfk
maunium.net/go/maulogger/v2 v2.0.0/go.mod h1:Hbbkq3NV6jvJodByZu1mgEF3fpT7Kz9z0MjEZ3/BusI= maunium.net/go/maulogger/v2 v2.0.0/go.mod h1:Hbbkq3NV6jvJodByZu1mgEF3fpT7Kz9z0MjEZ3/BusI=
maunium.net/go/mautrix v0.1.0-alpha.3/go.mod h1:GTVu6WDHR+98DKOrYetWsXorvUeKQV3jsSWO6ScbuFI= maunium.net/go/mautrix v0.1.0-alpha.3/go.mod h1:GTVu6WDHR+98DKOrYetWsXorvUeKQV3jsSWO6ScbuFI=
maunium.net/go/mautrix-appservice v0.1.0-alpha.3/go.mod h1:wOnWOIuprYad7ly12rHIo3JLCPh4jwvx1prVrAB9RhM= maunium.net/go/mautrix-appservice v0.1.0-alpha.3/go.mod h1:wOnWOIuprYad7ly12rHIo3JLCPh4jwvx1prVrAB9RhM=
maunium.net/go/mautrix-whatsapp v0.0.0-20190127121751-281b3e8f77f3 h1:A18t5Lp7I3aK0V7B7zdpb0hb/PBlu0X/Ai2AyU/XEk4=
maunium.net/go/mautrix-whatsapp v0.0.0-20190127121751-281b3e8f77f3/go.mod h1:r5E3J4urDEsjfui9OYZYMLBfCliaAqcCwM2xeczta6k=

View File

@ -2,7 +2,7 @@ package binary
import ( import (
"fmt" "fmt"
"github.com/Rhymen/go-whatsapp/binary/token" "github.com/matterbridge/go-whatsapp/binary/token"
"io" "io"
"strconv" "strconv"
) )

View File

@ -2,7 +2,7 @@ package binary
import ( import (
"fmt" "fmt"
"github.com/Rhymen/go-whatsapp/binary/token" "github.com/matterbridge/go-whatsapp/binary/token"
"math" "math"
"strconv" "strconv"
"strings" "strings"

View File

@ -2,7 +2,7 @@ package binary
import ( import (
"fmt" "fmt"
pb "github.com/Rhymen/go-whatsapp/binary/proto" pb "github.com/matterbridge/go-whatsapp/binary/proto"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
) )

View File

@ -14,9 +14,9 @@ import (
"sync" "sync"
"time" "time"
"github.com/Rhymen/go-whatsapp/binary"
"github.com/Rhymen/go-whatsapp/crypto/cbc"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"github.com/matterbridge/go-whatsapp/binary"
"github.com/matterbridge/go-whatsapp/crypto/cbc"
) )
type metric byte type metric byte
@ -128,7 +128,7 @@ func NewConn(timeout time.Duration) (*Conn, error) {
go wac.readPump() go wac.readPump()
go wac.writePump() go wac.writePump()
go wac.keepAlive(20000, 90000) go wac.keepAlive(20000, 60000)
return wac, nil return wac, nil
} }

View File

@ -2,7 +2,7 @@ package whatsapp
import ( import (
"fmt" "fmt"
"github.com/Rhymen/go-whatsapp/binary" "github.com/matterbridge/go-whatsapp/binary"
"strconv" "strconv"
"time" "time"
) )
@ -13,8 +13,8 @@ const (
PresenceAvailable = "available" PresenceAvailable = "available"
PresenceUnavailable = "unavailable" PresenceUnavailable = "unavailable"
PresenceComposing = "composing" PresenceComposing = "composing"
PresenceRecording = "recording" PresenceRecording = "recording"
PresencePaused = "paused" PresencePaused = "paused"
) )
//TODO: filename? WhatsApp uses Store.Contacts for these functions //TODO: filename? WhatsApp uses Store.Contacts for these functions
@ -30,44 +30,11 @@ func (wac *Conn) GetStatus(jid string) (<-chan string, error) {
return wac.write(data) return wac.write(data)
} }
func (wac *Conn) GetGroupMetaData(jid string) (<-chan string, error) {
data := []interface{}{"query", "GroupMetadata", jid}
return wac.write(data)
}
func (wac *Conn) SubscribePresence(jid string) (<-chan string, error) { func (wac *Conn) SubscribePresence(jid string) (<-chan string, error) {
data := []interface{}{"action", "presence", "subscribe", jid} data := []interface{}{"action", "presence", "subscribe", jid}
return wac.write(data) return wac.write(data)
} }
func (wac *Conn) CreateGroup(subject string, participants []string) (<-chan string, error) {
return wac.setGroup("create", "", subject, participants)
}
func (wac *Conn) UpdateGroupSubject(subject string, jid string) (<-chan string, error) {
return wac.setGroup("subject", jid, subject, nil)
}
func (wac *Conn) SetAdmin(jid string, participants []string) (<-chan string, error) {
return wac.setGroup("promote", jid, "", participants)
}
func (wac *Conn) RemoveAdmin(jid string, participants []string) (<-chan string, error) {
return wac.setGroup("demote", jid, "", participants)
}
func (wac *Conn) AddMember(jid string, participants []string) (<-chan string, error) {
return wac.setGroup("add", jid, "", participants)
}
func (wac *Conn) RemoveMember(jid string, participants []string) (<-chan string, error) {
return wac.setGroup("remove", jid, "", participants)
}
func (wac *Conn) LeaveGroup(jid string) (<-chan string, error) {
return wac.setGroup("leave", jid, "", nil)
}
func (wac *Conn) Search(search string, count, page int) (*binary.Node, error) { func (wac *Conn) Search(search string, count, page int) (*binary.Node, error) {
return wac.query("search", "", "", "", "", search, count, page) return wac.query("search", "", "", "", "", search, count, page)
} }

View File

@ -1,4 +1,4 @@
module github.com/Rhymen/go-whatsapp module github.com/matterbridge/go-whatsapp
require ( require (
github.com/golang/protobuf v1.2.0 github.com/golang/protobuf v1.2.0

View File

@ -1,4 +1,7 @@
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613 h1:MQ/ZZiDsUapFFiMS+vzwXkCTeEKaum+Do5rINYJDmxc=
golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

65
vendor/github.com/matterbridge/go-whatsapp/group.go generated vendored Normal file
View File

@ -0,0 +1,65 @@
package whatsapp
import (
"encoding/json"
"fmt"
"time"
)
func (wac *Conn) GetGroupMetaData(jid string) (<-chan string, error) {
data := []interface{}{"query", "GroupMetadata", jid}
return wac.write(data)
}
func (wac *Conn) CreateGroup(subject string, participants []string) (<-chan string, error) {
return wac.setGroup("create", "", subject, participants)
}
func (wac *Conn) UpdateGroupSubject(subject string, jid string) (<-chan string, error) {
return wac.setGroup("subject", jid, subject, nil)
}
func (wac *Conn) SetAdmin(jid string, participants []string) (<-chan string, error) {
return wac.setGroup("promote", jid, "", participants)
}
func (wac *Conn) RemoveAdmin(jid string, participants []string) (<-chan string, error) {
return wac.setGroup("demote", jid, "", participants)
}
func (wac *Conn) AddMember(jid string, participants []string) (<-chan string, error) {
return wac.setGroup("add", jid, "", participants)
}
func (wac *Conn) RemoveMember(jid string, participants []string) (<-chan string, error) {
return wac.setGroup("remove", jid, "", participants)
}
func (wac *Conn) LeaveGroup(jid string) (<-chan string, error) {
return wac.setGroup("leave", jid, "", nil)
}
func (wac *Conn) GroupInviteLink(jid string) (string, error) {
request := []interface{}{"query", "inviteCode", jid}
ch, err := wac.write(request)
if err != nil {
return "", err
}
var response map[string]interface{}
select {
case r := <-ch:
if err := json.Unmarshal([]byte(r), &response); err != nil {
return "", fmt.Errorf("error decoding response message: %v\n", err)
}
case <-time.After(wac.msgTimeout):
return "", fmt.Errorf("request timed out")
}
if int(response["status"].(float64)) != 200 {
return "", fmt.Errorf("request responded with %d", response["status"])
}
return response["code"].(string), nil
}

View File

@ -2,8 +2,8 @@ package whatsapp
import ( import (
"fmt" "fmt"
"github.com/Rhymen/go-whatsapp/binary" "github.com/matterbridge/go-whatsapp/binary"
"github.com/Rhymen/go-whatsapp/binary/proto" "github.com/matterbridge/go-whatsapp/binary/proto"
"os" "os"
) )

View File

@ -8,8 +8,8 @@ import (
"encoding/base64" "encoding/base64"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/Rhymen/go-whatsapp/crypto/cbc" "github.com/matterbridge/go-whatsapp/crypto/cbc"
"github.com/Rhymen/go-whatsapp/crypto/hkdf" "github.com/matterbridge/go-whatsapp/crypto/hkdf"
"io" "io"
"io/ioutil" "io/ioutil"
"mime/multipart" "mime/multipart"

View File

@ -4,8 +4,8 @@ import (
"encoding/hex" "encoding/hex"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/Rhymen/go-whatsapp/binary" "github.com/matterbridge/go-whatsapp/binary"
"github.com/Rhymen/go-whatsapp/binary/proto" "github.com/matterbridge/go-whatsapp/binary/proto"
"io" "io"
"math/rand" "math/rand"
"strconv" "strconv"
@ -363,6 +363,7 @@ type DocumentMessage struct {
Title string Title string
PageCount uint32 PageCount uint32
Type string Type string
FileName string
Thumbnail []byte Thumbnail []byte
Content io.Reader Content io.Reader
url string url string
@ -376,15 +377,16 @@ func getDocumentMessage(msg *proto.WebMessageInfo) DocumentMessage {
doc := msg.GetMessage().GetDocumentMessage() doc := msg.GetMessage().GetDocumentMessage()
return DocumentMessage{ return DocumentMessage{
Info: getMessageInfo(msg), Info: getMessageInfo(msg),
Title: doc.GetTitle(),
PageCount: doc.GetPageCount(),
Type: doc.GetMimetype(),
FileName: doc.GetFileName(),
Thumbnail: doc.GetJpegThumbnail(), Thumbnail: doc.GetJpegThumbnail(),
url: doc.GetUrl(), url: doc.GetUrl(),
mediaKey: doc.GetMediaKey(), mediaKey: doc.GetMediaKey(),
fileEncSha256: doc.GetFileEncSha256(), fileEncSha256: doc.GetFileEncSha256(),
fileSha256: doc.GetFileSha256(), fileSha256: doc.GetFileSha256(),
fileLength: doc.GetFileLength(), fileLength: doc.GetFileLength(),
PageCount: doc.GetPageCount(),
Title: doc.GetTitle(),
Type: doc.GetMimetype(),
} }
} }

View File

@ -9,9 +9,9 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/Rhymen/go-whatsapp/crypto/cbc" "github.com/matterbridge/go-whatsapp/crypto/cbc"
"github.com/Rhymen/go-whatsapp/crypto/curve25519" "github.com/matterbridge/go-whatsapp/crypto/curve25519"
"github.com/Rhymen/go-whatsapp/crypto/hkdf" "github.com/matterbridge/go-whatsapp/crypto/hkdf"
) )
/* /*

View File

@ -1,7 +1,7 @@
package whatsapp package whatsapp
import ( import (
"github.com/Rhymen/go-whatsapp/binary" "github.com/matterbridge/go-whatsapp/binary"
"strings" "strings"
) )

View File

@ -20,7 +20,7 @@ import (
"encoding/json" "encoding/json"
"strings" "strings"
"github.com/Rhymen/go-whatsapp" "github.com/matterbridge/go-whatsapp"
) )
type ChatUpdateCommand string type ChatUpdateCommand string

View File

@ -20,7 +20,7 @@ import (
"encoding/json" "encoding/json"
"strings" "strings"
"github.com/Rhymen/go-whatsapp" "github.com/matterbridge/go-whatsapp"
) )
type CommandType string type CommandType string

View File

@ -19,7 +19,7 @@ package whatsappExt
import ( import (
"encoding/json" "encoding/json"
"github.com/Rhymen/go-whatsapp" "github.com/matterbridge/go-whatsapp"
) )
type ConnInfo struct { type ConnInfo struct {

View File

@ -19,7 +19,7 @@ package whatsappExt
import ( import (
"encoding/json" "encoding/json"
"github.com/Rhymen/go-whatsapp" "github.com/matterbridge/go-whatsapp"
) )
type JSONMessage []json.RawMessage type JSONMessage []json.RawMessage

View File

@ -20,7 +20,7 @@ import (
"encoding/json" "encoding/json"
"strings" "strings"
"github.com/Rhymen/go-whatsapp" "github.com/matterbridge/go-whatsapp"
) )
type MsgInfoCommand string type MsgInfoCommand string

View File

@ -20,7 +20,7 @@ import (
"encoding/json" "encoding/json"
"strings" "strings"
"github.com/Rhymen/go-whatsapp" "github.com/matterbridge/go-whatsapp"
) )
type PresenceType string type PresenceType string

View File

@ -19,7 +19,7 @@ package whatsappExt
import ( import (
"encoding/json" "encoding/json"
"github.com/Rhymen/go-whatsapp" "github.com/matterbridge/go-whatsapp"
) )
type ProtocolProps struct { type ProtocolProps struct {

View File

@ -19,7 +19,7 @@ package whatsappExt
import ( import (
"encoding/json" "encoding/json"
"github.com/Rhymen/go-whatsapp" "github.com/matterbridge/go-whatsapp"
) )
type StreamType string type StreamType string

View File

@ -24,7 +24,7 @@ import (
"net/http" "net/http"
"strings" "strings"
"github.com/Rhymen/go-whatsapp" "github.com/matterbridge/go-whatsapp"
) )
const ( const (

View File

@ -29,6 +29,15 @@ const (
backgroundMask = (backgroundRed | backgroundBlue | backgroundGreen | backgroundIntensity) backgroundMask = (backgroundRed | backgroundBlue | backgroundGreen | backgroundIntensity)
) )
const (
genericRead = 0x80000000
genericWrite = 0x40000000
)
const (
consoleTextmodeBuffer = 0x1
)
type wchar uint16 type wchar uint16
type short int16 type short int16
type dword uint32 type dword uint32
@ -69,14 +78,17 @@ var (
procGetConsoleCursorInfo = kernel32.NewProc("GetConsoleCursorInfo") procGetConsoleCursorInfo = kernel32.NewProc("GetConsoleCursorInfo")
procSetConsoleCursorInfo = kernel32.NewProc("SetConsoleCursorInfo") procSetConsoleCursorInfo = kernel32.NewProc("SetConsoleCursorInfo")
procSetConsoleTitle = kernel32.NewProc("SetConsoleTitleW") procSetConsoleTitle = kernel32.NewProc("SetConsoleTitleW")
procCreateConsoleScreenBuffer = kernel32.NewProc("CreateConsoleScreenBuffer")
) )
// Writer provide colorable Writer to the console // Writer provide colorable Writer to the console
type Writer struct { type Writer struct {
out io.Writer out io.Writer
handle syscall.Handle handle syscall.Handle
oldattr word althandle syscall.Handle
oldpos coord oldattr word
oldpos coord
rest bytes.Buffer
} }
// NewColorable return new instance of Writer which handle escape sequence from File. // NewColorable return new instance of Writer which handle escape sequence from File.
@ -407,7 +419,18 @@ func (w *Writer) Write(data []byte) (n int, err error) {
var csbi consoleScreenBufferInfo var csbi consoleScreenBufferInfo
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
er := bytes.NewReader(data) handle := w.handle
var er *bytes.Reader
if w.rest.Len() > 0 {
var rest bytes.Buffer
w.rest.WriteTo(&rest)
w.rest.Reset()
rest.Write(data)
er = bytes.NewReader(rest.Bytes())
} else {
er = bytes.NewReader(data)
}
var bw [1]byte var bw [1]byte
loop: loop:
for { for {
@ -425,29 +448,55 @@ loop:
break loop break loop
} }
if c2 == ']' { switch c2 {
if err := doTitleSequence(er); err != nil { case '>':
continue
case ']':
w.rest.WriteByte(c1)
w.rest.WriteByte(c2)
er.WriteTo(&w.rest)
if bytes.IndexByte(w.rest.Bytes(), 0x07) == -1 {
break loop break loop
} }
continue er = bytes.NewReader(w.rest.Bytes()[2:])
} err := doTitleSequence(er)
if c2 != 0x5b {
continue
}
var buf bytes.Buffer
var m byte
for {
c, err := er.ReadByte()
if err != nil { if err != nil {
break loop break loop
} }
w.rest.Reset()
continue
// https://github.com/mattn/go-colorable/issues/27
case '7':
procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
w.oldpos = csbi.cursorPosition
continue
case '8':
procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&w.oldpos)))
continue
case 0x5b:
// execute part after switch
default:
continue
}
w.rest.WriteByte(c1)
w.rest.WriteByte(c2)
er.WriteTo(&w.rest)
var buf bytes.Buffer
var m byte
for i, c := range w.rest.Bytes()[2:] {
if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' { if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' {
m = c m = c
er = bytes.NewReader(w.rest.Bytes()[2+i+1:])
w.rest.Reset()
break break
} }
buf.Write([]byte(string(c))) buf.Write([]byte(string(c)))
} }
if m == 0 {
break loop
}
switch m { switch m {
case 'A': case 'A':
@ -455,61 +504,64 @@ loop:
if err != nil { if err != nil {
continue continue
} }
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
csbi.cursorPosition.y -= short(n) csbi.cursorPosition.y -= short(n)
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
case 'B': case 'B':
n, err = strconv.Atoi(buf.String()) n, err = strconv.Atoi(buf.String())
if err != nil { if err != nil {
continue continue
} }
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
csbi.cursorPosition.y += short(n) csbi.cursorPosition.y += short(n)
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
case 'C': case 'C':
n, err = strconv.Atoi(buf.String()) n, err = strconv.Atoi(buf.String())
if err != nil { if err != nil {
continue continue
} }
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
csbi.cursorPosition.x += short(n) csbi.cursorPosition.x += short(n)
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
case 'D': case 'D':
n, err = strconv.Atoi(buf.String()) n, err = strconv.Atoi(buf.String())
if err != nil { if err != nil {
continue continue
} }
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
csbi.cursorPosition.x -= short(n) csbi.cursorPosition.x -= short(n)
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) if csbi.cursorPosition.x < 0 {
csbi.cursorPosition.x = 0
}
procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
case 'E': case 'E':
n, err = strconv.Atoi(buf.String()) n, err = strconv.Atoi(buf.String())
if err != nil { if err != nil {
continue continue
} }
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
csbi.cursorPosition.x = 0 csbi.cursorPosition.x = 0
csbi.cursorPosition.y += short(n) csbi.cursorPosition.y += short(n)
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
case 'F': case 'F':
n, err = strconv.Atoi(buf.String()) n, err = strconv.Atoi(buf.String())
if err != nil { if err != nil {
continue continue
} }
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
csbi.cursorPosition.x = 0 csbi.cursorPosition.x = 0
csbi.cursorPosition.y -= short(n) csbi.cursorPosition.y -= short(n)
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
case 'G': case 'G':
n, err = strconv.Atoi(buf.String()) n, err = strconv.Atoi(buf.String())
if err != nil { if err != nil {
continue continue
} }
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
csbi.cursorPosition.x = short(n - 1) csbi.cursorPosition.x = short(n - 1)
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
case 'H', 'f': case 'H', 'f':
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
if buf.Len() > 0 { if buf.Len() > 0 {
token := strings.Split(buf.String(), ";") token := strings.Split(buf.String(), ";")
switch len(token) { switch len(token) {
@ -534,7 +586,7 @@ loop:
} else { } else {
csbi.cursorPosition.y = 0 csbi.cursorPosition.y = 0
} }
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
case 'J': case 'J':
n := 0 n := 0
if buf.Len() > 0 { if buf.Len() > 0 {
@ -545,20 +597,20 @@ loop:
} }
var count, written dword var count, written dword
var cursor coord var cursor coord
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
switch n { switch n {
case 0: case 0:
cursor = coord{x: csbi.cursorPosition.x, y: csbi.cursorPosition.y} cursor = coord{x: csbi.cursorPosition.x, y: csbi.cursorPosition.y}
count = dword(csbi.size.x - csbi.cursorPosition.x + (csbi.size.y-csbi.cursorPosition.y)*csbi.size.x) count = dword(csbi.size.x) - dword(csbi.cursorPosition.x) + dword(csbi.size.y-csbi.cursorPosition.y)*dword(csbi.size.x)
case 1: case 1:
cursor = coord{x: csbi.window.left, y: csbi.window.top} cursor = coord{x: csbi.window.left, y: csbi.window.top}
count = dword(csbi.size.x - csbi.cursorPosition.x + (csbi.window.top-csbi.cursorPosition.y)*csbi.size.x) count = dword(csbi.size.x) - dword(csbi.cursorPosition.x) + dword(csbi.window.top-csbi.cursorPosition.y)*dword(csbi.size.x)
case 2: case 2:
cursor = coord{x: csbi.window.left, y: csbi.window.top} cursor = coord{x: csbi.window.left, y: csbi.window.top}
count = dword(csbi.size.x - csbi.cursorPosition.x + (csbi.size.y-csbi.cursorPosition.y)*csbi.size.x) count = dword(csbi.size.x) - dword(csbi.cursorPosition.x) + dword(csbi.size.y-csbi.cursorPosition.y)*dword(csbi.size.x)
} }
procFillConsoleOutputCharacter.Call(uintptr(w.handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) procFillConsoleOutputCharacter.Call(uintptr(handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))
procFillConsoleOutputAttribute.Call(uintptr(w.handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) procFillConsoleOutputAttribute.Call(uintptr(handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))
case 'K': case 'K':
n := 0 n := 0
if buf.Len() > 0 { if buf.Len() > 0 {
@ -567,28 +619,28 @@ loop:
continue continue
} }
} }
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
var cursor coord var cursor coord
var count, written dword var count, written dword
switch n { switch n {
case 0: case 0:
cursor = coord{x: csbi.cursorPosition.x + 1, y: csbi.cursorPosition.y} cursor = coord{x: csbi.cursorPosition.x, y: csbi.cursorPosition.y}
count = dword(csbi.size.x - csbi.cursorPosition.x - 1) count = dword(csbi.size.x - csbi.cursorPosition.x)
case 1: case 1:
cursor = coord{x: csbi.window.left, y: csbi.window.top + csbi.cursorPosition.y} cursor = coord{x: csbi.window.left, y: csbi.cursorPosition.y}
count = dword(csbi.size.x - csbi.cursorPosition.x) count = dword(csbi.size.x - csbi.cursorPosition.x)
case 2: case 2:
cursor = coord{x: csbi.window.left, y: csbi.window.top + csbi.cursorPosition.y} cursor = coord{x: csbi.window.left, y: csbi.cursorPosition.y}
count = dword(csbi.size.x) count = dword(csbi.size.x)
} }
procFillConsoleOutputCharacter.Call(uintptr(w.handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) procFillConsoleOutputCharacter.Call(uintptr(handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))
procFillConsoleOutputAttribute.Call(uintptr(w.handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) procFillConsoleOutputAttribute.Call(uintptr(handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))
case 'm': case 'm':
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
attr := csbi.attributes attr := csbi.attributes
cs := buf.String() cs := buf.String()
if cs == "" { if cs == "" {
procSetConsoleTextAttribute.Call(uintptr(w.handle), uintptr(w.oldattr)) procSetConsoleTextAttribute.Call(uintptr(handle), uintptr(w.oldattr))
continue continue
} }
token := strings.Split(cs, ";") token := strings.Split(cs, ";")
@ -627,6 +679,21 @@ loop:
attr |= n256foreAttr[n256] attr |= n256foreAttr[n256]
i += 2 i += 2
} }
} else if len(token) == 5 && token[i+1] == "2" {
var r, g, b int
r, _ = strconv.Atoi(token[i+2])
g, _ = strconv.Atoi(token[i+3])
b, _ = strconv.Atoi(token[i+4])
i += 4
if r > 127 {
attr |= foregroundRed
}
if g > 127 {
attr |= foregroundGreen
}
if b > 127 {
attr |= foregroundBlue
}
} else { } else {
attr = attr & (w.oldattr & backgroundMask) attr = attr & (w.oldattr & backgroundMask)
} }
@ -654,6 +721,21 @@ loop:
attr |= n256backAttr[n256] attr |= n256backAttr[n256]
i += 2 i += 2
} }
} else if len(token) == 5 && token[i+1] == "2" {
var r, g, b int
r, _ = strconv.Atoi(token[i+2])
g, _ = strconv.Atoi(token[i+3])
b, _ = strconv.Atoi(token[i+4])
i += 4
if r > 127 {
attr |= backgroundRed
}
if g > 127 {
attr |= backgroundGreen
}
if b > 127 {
attr |= backgroundBlue
}
} else { } else {
attr = attr & (w.oldattr & foregroundMask) attr = attr & (w.oldattr & foregroundMask)
} }
@ -685,38 +767,52 @@ loop:
attr |= backgroundBlue attr |= backgroundBlue
} }
} }
procSetConsoleTextAttribute.Call(uintptr(w.handle), uintptr(attr)) procSetConsoleTextAttribute.Call(uintptr(handle), uintptr(attr))
} }
} }
case 'h': case 'h':
var ci consoleCursorInfo var ci consoleCursorInfo
cs := buf.String() cs := buf.String()
if cs == "5>" { if cs == "5>" {
procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) procGetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci)))
ci.visible = 0 ci.visible = 0
procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) procSetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci)))
} else if cs == "?25" { } else if cs == "?25" {
procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) procGetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci)))
ci.visible = 1 ci.visible = 1
procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) procSetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci)))
} else if cs == "?1049" {
if w.althandle == 0 {
h, _, _ := procCreateConsoleScreenBuffer.Call(uintptr(genericRead|genericWrite), 0, 0, uintptr(consoleTextmodeBuffer), 0, 0)
w.althandle = syscall.Handle(h)
if w.althandle != 0 {
handle = w.althandle
}
}
} }
case 'l': case 'l':
var ci consoleCursorInfo var ci consoleCursorInfo
cs := buf.String() cs := buf.String()
if cs == "5>" { if cs == "5>" {
procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) procGetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci)))
ci.visible = 1 ci.visible = 1
procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) procSetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci)))
} else if cs == "?25" { } else if cs == "?25" {
procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) procGetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci)))
ci.visible = 0 ci.visible = 0
procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) procSetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci)))
} else if cs == "?1049" {
if w.althandle != 0 {
syscall.CloseHandle(w.althandle)
w.althandle = 0
handle = w.handle
}
} }
case 's': case 's':
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
w.oldpos = csbi.cursorPosition w.oldpos = csbi.cursorPosition
case 'u': case 'u':
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&w.oldpos))) procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&w.oldpos)))
} }
} }

3
vendor/github.com/mattn/go-colorable/go.mod generated vendored Normal file
View File

@ -0,0 +1,3 @@
module github.com/mattn/go-colorable
require github.com/mattn/go-isatty v0.0.5

4
vendor/github.com/mattn/go-colorable/go.sum generated vendored Normal file
View File

@ -0,0 +1,4 @@
github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw=
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

3
vendor/github.com/mattn/go-isatty/go.mod generated vendored Normal file
View File

@ -0,0 +1,3 @@
module github.com/mattn/go-isatty
require golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223

2
vendor/github.com/mattn/go-isatty/go.sum generated vendored Normal file
View File

@ -0,0 +1,2 @@
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

View File

@ -1,15 +0,0 @@
// +build appengine
package isatty
// IsTerminal returns true if the file descriptor is terminal which
// is always false on on appengine classic which is a sandboxed PaaS.
func IsTerminal(fd uintptr) bool {
return false
}
// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2
// terminal. This is also always false on this environment.
func IsCygwinTerminal(fd uintptr) bool {
return false
}

View File

@ -16,3 +16,9 @@ func IsTerminal(fd uintptr) bool {
_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
return err == 0 return err == 0
} }
// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
// terminal. This is also always false on this environment.
func IsCygwinTerminal(fd uintptr) bool {
return false
}

View File

@ -1,18 +1,18 @@
// +build linux // +build linux
// +build !appengine,!ppc64,!ppc64le // +build !appengine
package isatty package isatty
import ( import "golang.org/x/sys/unix"
"syscall"
"unsafe"
)
const ioctlReadTermios = syscall.TCGETS
// IsTerminal return true if the file descriptor is terminal. // IsTerminal return true if the file descriptor is terminal.
func IsTerminal(fd uintptr) bool { func IsTerminal(fd uintptr) bool {
var termios syscall.Termios _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS)
_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) return err == nil
return err == 0 }
// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
// terminal. This is also always false on this environment.
func IsCygwinTerminal(fd uintptr) bool {
return false
} }

View File

@ -1,19 +0,0 @@
// +build linux
// +build ppc64 ppc64le
package isatty
import (
"unsafe"
syscall "golang.org/x/sys/unix"
)
const ioctlReadTermios = syscall.TCGETS
// IsTerminal return true if the file descriptor is terminal.
func IsTerminal(fd uintptr) bool {
var termios syscall.Termios
_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
return err == 0
}

View File

@ -1,9 +1,14 @@
// +build !windows // +build appengine js
// +build !appengine
package isatty package isatty
// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 // IsTerminal returns true if the file descriptor is terminal which
// is always false on js and appengine classic which is a sandboxed PaaS.
func IsTerminal(fd uintptr) bool {
return false
}
// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2
// terminal. This is also always false on this environment. // terminal. This is also always false on this environment.
func IsCygwinTerminal(fd uintptr) bool { func IsCygwinTerminal(fd uintptr) bool {
return false return false

View File

@ -14,3 +14,9 @@ func IsTerminal(fd uintptr) bool {
err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio)
return err == nil return err == nil
} }
// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
// terminal. This is also always false on this environment.
func IsCygwinTerminal(fd uintptr) bool {
return false
}

View File

@ -128,11 +128,7 @@ func (c *Client) Discover(ctx context.Context) (Directory, error) {
return *c.dir, nil return *c.dir, nil
} }
dirURL := c.DirectoryURL res, err := c.get(ctx, c.directoryURL(), wantStatus(http.StatusOK))
if dirURL == "" {
dirURL = LetsEncryptURL
}
res, err := c.get(ctx, dirURL, wantStatus(http.StatusOK))
if err != nil { if err != nil {
return Directory{}, err return Directory{}, err
} }
@ -165,6 +161,13 @@ func (c *Client) Discover(ctx context.Context) (Directory, error) {
return *c.dir, nil return *c.dir, nil
} }
func (c *Client) directoryURL() string {
if c.DirectoryURL != "" {
return c.DirectoryURL
}
return LetsEncryptURL
}
// CreateCert requests a new certificate using the Certificate Signing Request csr encoded in DER format. // CreateCert requests a new certificate using the Certificate Signing Request csr encoded in DER format.
// The exp argument indicates the desired certificate validity duration. CA may issue a certificate // The exp argument indicates the desired certificate validity duration. CA may issue a certificate
// with a different duration. // with a different duration.
@ -711,12 +714,18 @@ func (c *Client) doReg(ctx context.Context, url string, typ string, acct *Accoun
} }
// popNonce returns a nonce value previously stored with c.addNonce // popNonce returns a nonce value previously stored with c.addNonce
// or fetches a fresh one from the given URL. // or fetches a fresh one from a URL by issuing a HEAD request.
// It first tries c.directoryURL() and then the provided url if the former fails.
func (c *Client) popNonce(ctx context.Context, url string) (string, error) { func (c *Client) popNonce(ctx context.Context, url string) (string, error) {
c.noncesMu.Lock() c.noncesMu.Lock()
defer c.noncesMu.Unlock() defer c.noncesMu.Unlock()
if len(c.nonces) == 0 { if len(c.nonces) == 0 {
return c.fetchNonce(ctx, url) dirURL := c.directoryURL()
v, err := c.fetchNonce(ctx, dirURL)
if err != nil && url != dirURL {
v, err = c.fetchNonce(ctx, url)
}
return v, err
} }
var nonce string var nonce string
for nonce = range c.nonces { for nonce = range c.nonces {

View File

@ -3,6 +3,14 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// Package blowfish implements Bruce Schneier's Blowfish encryption algorithm. // Package blowfish implements Bruce Schneier's Blowfish encryption algorithm.
//
// Blowfish is a legacy cipher and its short block size makes it vulnerable to
// birthday bound attacks (see https://sweet32.info). It should only be used
// where compatibility with legacy systems, not security, is the goal.
//
// Deprecated: any new system should use AES (from crypto/aes, if necessary in
// an AEAD mode like crypto/cipher.NewGCM) or XChaCha20-Poly1305 (from
// golang.org/x/crypto/chacha20poly1305).
package blowfish // import "golang.org/x/crypto/blowfish" package blowfish // import "golang.org/x/crypto/blowfish"
// The code is a port of Bruce Schneier's C implementation. // The code is a port of Bruce Schneier's C implementation.

View File

@ -86,7 +86,7 @@ func feFromBytes(dst *fieldElement, src *[32]byte) {
h6 := load3(src[20:]) << 7 h6 := load3(src[20:]) << 7
h7 := load3(src[23:]) << 5 h7 := load3(src[23:]) << 5
h8 := load3(src[26:]) << 4 h8 := load3(src[26:]) << 4
h9 := load3(src[29:]) << 2 h9 := (load3(src[29:]) & 0x7fffff) << 2
var carry [10]int64 var carry [10]int64
carry[9] = (h9 + 1<<24) >> 25 carry[9] = (h9 + 1<<24) >> 25

View File

@ -0,0 +1,308 @@
// Copyright 2018 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.
// +build go1.11
// +build !gccgo,!appengine
#include "textflag.h"
#define NUM_ROUNDS 10
// func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32)
TEXT ·xorKeyStreamVX(SB), NOSPLIT, $0
MOVD dst+0(FP), R1
MOVD src+24(FP), R2
MOVD src_len+32(FP), R3
MOVD key+48(FP), R4
MOVD nonce+56(FP), R6
MOVD counter+64(FP), R7
MOVD $·constants(SB), R10
MOVD $·incRotMatrix(SB), R11
MOVW (R7), R20
AND $~255, R3, R13
ADD R2, R13, R12 // R12 for block end
AND $255, R3, R13
loop:
MOVD $NUM_ROUNDS, R21
VLD1 (R11), [V30.S4, V31.S4]
// load contants
// VLD4R (R10), [V0.S4, V1.S4, V2.S4, V3.S4]
WORD $0x4D60E940
// load keys
// VLD4R 16(R4), [V4.S4, V5.S4, V6.S4, V7.S4]
WORD $0x4DFFE884
// VLD4R 16(R4), [V8.S4, V9.S4, V10.S4, V11.S4]
WORD $0x4DFFE888
SUB $32, R4
// load counter + nonce
// VLD1R (R7), [V12.S4]
WORD $0x4D40C8EC
// VLD3R (R6), [V13.S4, V14.S4, V15.S4]
WORD $0x4D40E8CD
// update counter
VADD V30.S4, V12.S4, V12.S4
chacha:
// V0..V3 += V4..V7
// V12..V15 <<<= ((V12..V15 XOR V0..V3), 16)
VADD V0.S4, V4.S4, V0.S4
VADD V1.S4, V5.S4, V1.S4
VADD V2.S4, V6.S4, V2.S4
VADD V3.S4, V7.S4, V3.S4
VEOR V12.B16, V0.B16, V12.B16
VEOR V13.B16, V1.B16, V13.B16
VEOR V14.B16, V2.B16, V14.B16
VEOR V15.B16, V3.B16, V15.B16
VREV32 V12.H8, V12.H8
VREV32 V13.H8, V13.H8
VREV32 V14.H8, V14.H8
VREV32 V15.H8, V15.H8
// V8..V11 += V12..V15
// V4..V7 <<<= ((V4..V7 XOR V8..V11), 12)
VADD V8.S4, V12.S4, V8.S4
VADD V9.S4, V13.S4, V9.S4
VADD V10.S4, V14.S4, V10.S4
VADD V11.S4, V15.S4, V11.S4
VEOR V8.B16, V4.B16, V16.B16
VEOR V9.B16, V5.B16, V17.B16
VEOR V10.B16, V6.B16, V18.B16
VEOR V11.B16, V7.B16, V19.B16
VSHL $12, V16.S4, V4.S4
VSHL $12, V17.S4, V5.S4
VSHL $12, V18.S4, V6.S4
VSHL $12, V19.S4, V7.S4
VSRI $20, V16.S4, V4.S4
VSRI $20, V17.S4, V5.S4
VSRI $20, V18.S4, V6.S4
VSRI $20, V19.S4, V7.S4
// V0..V3 += V4..V7
// V12..V15 <<<= ((V12..V15 XOR V0..V3), 8)
VADD V0.S4, V4.S4, V0.S4
VADD V1.S4, V5.S4, V1.S4
VADD V2.S4, V6.S4, V2.S4
VADD V3.S4, V7.S4, V3.S4
VEOR V12.B16, V0.B16, V12.B16
VEOR V13.B16, V1.B16, V13.B16
VEOR V14.B16, V2.B16, V14.B16
VEOR V15.B16, V3.B16, V15.B16
VTBL V31.B16, [V12.B16], V12.B16
VTBL V31.B16, [V13.B16], V13.B16
VTBL V31.B16, [V14.B16], V14.B16
VTBL V31.B16, [V15.B16], V15.B16
// V8..V11 += V12..V15
// V4..V7 <<<= ((V4..V7 XOR V8..V11), 7)
VADD V12.S4, V8.S4, V8.S4
VADD V13.S4, V9.S4, V9.S4
VADD V14.S4, V10.S4, V10.S4
VADD V15.S4, V11.S4, V11.S4
VEOR V8.B16, V4.B16, V16.B16
VEOR V9.B16, V5.B16, V17.B16
VEOR V10.B16, V6.B16, V18.B16
VEOR V11.B16, V7.B16, V19.B16
VSHL $7, V16.S4, V4.S4
VSHL $7, V17.S4, V5.S4
VSHL $7, V18.S4, V6.S4
VSHL $7, V19.S4, V7.S4
VSRI $25, V16.S4, V4.S4
VSRI $25, V17.S4, V5.S4
VSRI $25, V18.S4, V6.S4
VSRI $25, V19.S4, V7.S4
// V0..V3 += V5..V7, V4
// V15,V12-V14 <<<= ((V15,V12-V14 XOR V0..V3), 16)
VADD V0.S4, V5.S4, V0.S4
VADD V1.S4, V6.S4, V1.S4
VADD V2.S4, V7.S4, V2.S4
VADD V3.S4, V4.S4, V3.S4
VEOR V15.B16, V0.B16, V15.B16
VEOR V12.B16, V1.B16, V12.B16
VEOR V13.B16, V2.B16, V13.B16
VEOR V14.B16, V3.B16, V14.B16
VREV32 V12.H8, V12.H8
VREV32 V13.H8, V13.H8
VREV32 V14.H8, V14.H8
VREV32 V15.H8, V15.H8
// V10 += V15; V5 <<<= ((V10 XOR V5), 12)
// ...
VADD V15.S4, V10.S4, V10.S4
VADD V12.S4, V11.S4, V11.S4
VADD V13.S4, V8.S4, V8.S4
VADD V14.S4, V9.S4, V9.S4
VEOR V10.B16, V5.B16, V16.B16
VEOR V11.B16, V6.B16, V17.B16
VEOR V8.B16, V7.B16, V18.B16
VEOR V9.B16, V4.B16, V19.B16
VSHL $12, V16.S4, V5.S4
VSHL $12, V17.S4, V6.S4
VSHL $12, V18.S4, V7.S4
VSHL $12, V19.S4, V4.S4
VSRI $20, V16.S4, V5.S4
VSRI $20, V17.S4, V6.S4
VSRI $20, V18.S4, V7.S4
VSRI $20, V19.S4, V4.S4
// V0 += V5; V15 <<<= ((V0 XOR V15), 8)
// ...
VADD V5.S4, V0.S4, V0.S4
VADD V6.S4, V1.S4, V1.S4
VADD V7.S4, V2.S4, V2.S4
VADD V4.S4, V3.S4, V3.S4
VEOR V0.B16, V15.B16, V15.B16
VEOR V1.B16, V12.B16, V12.B16
VEOR V2.B16, V13.B16, V13.B16
VEOR V3.B16, V14.B16, V14.B16
VTBL V31.B16, [V12.B16], V12.B16
VTBL V31.B16, [V13.B16], V13.B16
VTBL V31.B16, [V14.B16], V14.B16
VTBL V31.B16, [V15.B16], V15.B16
// V10 += V15; V5 <<<= ((V10 XOR V5), 7)
// ...
VADD V15.S4, V10.S4, V10.S4
VADD V12.S4, V11.S4, V11.S4
VADD V13.S4, V8.S4, V8.S4
VADD V14.S4, V9.S4, V9.S4
VEOR V10.B16, V5.B16, V16.B16
VEOR V11.B16, V6.B16, V17.B16
VEOR V8.B16, V7.B16, V18.B16
VEOR V9.B16, V4.B16, V19.B16
VSHL $7, V16.S4, V5.S4
VSHL $7, V17.S4, V6.S4
VSHL $7, V18.S4, V7.S4
VSHL $7, V19.S4, V4.S4
VSRI $25, V16.S4, V5.S4
VSRI $25, V17.S4, V6.S4
VSRI $25, V18.S4, V7.S4
VSRI $25, V19.S4, V4.S4
SUB $1, R21
CBNZ R21, chacha
// VLD4R (R10), [V16.S4, V17.S4, V18.S4, V19.S4]
WORD $0x4D60E950
// VLD4R 16(R4), [V20.S4, V21.S4, V22.S4, V23.S4]
WORD $0x4DFFE894
VADD V30.S4, V12.S4, V12.S4
VADD V16.S4, V0.S4, V0.S4
VADD V17.S4, V1.S4, V1.S4
VADD V18.S4, V2.S4, V2.S4
VADD V19.S4, V3.S4, V3.S4
// VLD4R 16(R4), [V24.S4, V25.S4, V26.S4, V27.S4]
WORD $0x4DFFE898
// restore R4
SUB $32, R4
// load counter + nonce
// VLD1R (R7), [V28.S4]
WORD $0x4D40C8FC
// VLD3R (R6), [V29.S4, V30.S4, V31.S4]
WORD $0x4D40E8DD
VADD V20.S4, V4.S4, V4.S4
VADD V21.S4, V5.S4, V5.S4
VADD V22.S4, V6.S4, V6.S4
VADD V23.S4, V7.S4, V7.S4
VADD V24.S4, V8.S4, V8.S4
VADD V25.S4, V9.S4, V9.S4
VADD V26.S4, V10.S4, V10.S4
VADD V27.S4, V11.S4, V11.S4
VADD V28.S4, V12.S4, V12.S4
VADD V29.S4, V13.S4, V13.S4
VADD V30.S4, V14.S4, V14.S4
VADD V31.S4, V15.S4, V15.S4
VZIP1 V1.S4, V0.S4, V16.S4
VZIP2 V1.S4, V0.S4, V17.S4
VZIP1 V3.S4, V2.S4, V18.S4
VZIP2 V3.S4, V2.S4, V19.S4
VZIP1 V5.S4, V4.S4, V20.S4
VZIP2 V5.S4, V4.S4, V21.S4
VZIP1 V7.S4, V6.S4, V22.S4
VZIP2 V7.S4, V6.S4, V23.S4
VZIP1 V9.S4, V8.S4, V24.S4
VZIP2 V9.S4, V8.S4, V25.S4
VZIP1 V11.S4, V10.S4, V26.S4
VZIP2 V11.S4, V10.S4, V27.S4
VZIP1 V13.S4, V12.S4, V28.S4
VZIP2 V13.S4, V12.S4, V29.S4
VZIP1 V15.S4, V14.S4, V30.S4
VZIP2 V15.S4, V14.S4, V31.S4
VZIP1 V18.D2, V16.D2, V0.D2
VZIP2 V18.D2, V16.D2, V4.D2
VZIP1 V19.D2, V17.D2, V8.D2
VZIP2 V19.D2, V17.D2, V12.D2
VLD1.P 64(R2), [V16.B16, V17.B16, V18.B16, V19.B16]
VZIP1 V22.D2, V20.D2, V1.D2
VZIP2 V22.D2, V20.D2, V5.D2
VZIP1 V23.D2, V21.D2, V9.D2
VZIP2 V23.D2, V21.D2, V13.D2
VLD1.P 64(R2), [V20.B16, V21.B16, V22.B16, V23.B16]
VZIP1 V26.D2, V24.D2, V2.D2
VZIP2 V26.D2, V24.D2, V6.D2
VZIP1 V27.D2, V25.D2, V10.D2
VZIP2 V27.D2, V25.D2, V14.D2
VLD1.P 64(R2), [V24.B16, V25.B16, V26.B16, V27.B16]
VZIP1 V30.D2, V28.D2, V3.D2
VZIP2 V30.D2, V28.D2, V7.D2
VZIP1 V31.D2, V29.D2, V11.D2
VZIP2 V31.D2, V29.D2, V15.D2
VLD1.P 64(R2), [V28.B16, V29.B16, V30.B16, V31.B16]
VEOR V0.B16, V16.B16, V16.B16
VEOR V1.B16, V17.B16, V17.B16
VEOR V2.B16, V18.B16, V18.B16
VEOR V3.B16, V19.B16, V19.B16
VST1.P [V16.B16, V17.B16, V18.B16, V19.B16], 64(R1)
VEOR V4.B16, V20.B16, V20.B16
VEOR V5.B16, V21.B16, V21.B16
VEOR V6.B16, V22.B16, V22.B16
VEOR V7.B16, V23.B16, V23.B16
VST1.P [V20.B16, V21.B16, V22.B16, V23.B16], 64(R1)
VEOR V8.B16, V24.B16, V24.B16
VEOR V9.B16, V25.B16, V25.B16
VEOR V10.B16, V26.B16, V26.B16
VEOR V11.B16, V27.B16, V27.B16
VST1.P [V24.B16, V25.B16, V26.B16, V27.B16], 64(R1)
VEOR V12.B16, V28.B16, V28.B16
VEOR V13.B16, V29.B16, V29.B16
VEOR V14.B16, V30.B16, V30.B16
VEOR V15.B16, V31.B16, V31.B16
VST1.P [V28.B16, V29.B16, V30.B16, V31.B16], 64(R1)
ADD $4, R20
MOVW R20, (R7) // update counter
CMP R2, R12
BGT loop
RET
DATA ·constants+0x00(SB)/4, $0x61707865
DATA ·constants+0x04(SB)/4, $0x3320646e
DATA ·constants+0x08(SB)/4, $0x79622d32
DATA ·constants+0x0c(SB)/4, $0x6b206574
GLOBL ·constants(SB), NOPTR|RODATA, $32
DATA ·incRotMatrix+0x00(SB)/4, $0x00000000
DATA ·incRotMatrix+0x04(SB)/4, $0x00000001
DATA ·incRotMatrix+0x08(SB)/4, $0x00000002
DATA ·incRotMatrix+0x0c(SB)/4, $0x00000003
DATA ·incRotMatrix+0x10(SB)/4, $0x02010003
DATA ·incRotMatrix+0x14(SB)/4, $0x06050407
DATA ·incRotMatrix+0x18(SB)/4, $0x0A09080B
DATA ·incRotMatrix+0x1c(SB)/4, $0x0E0D0C0F
GLOBL ·incRotMatrix(SB), NOPTR|RODATA, $32

View File

@ -0,0 +1,31 @@
// Copyright 2018 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.
// +build go1.11
// +build !gccgo
package chacha20
const (
haveAsm = true
bufSize = 256
)
//go:noescape
func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32)
func (c *Cipher) xorKeyStreamAsm(dst, src []byte) {
if len(src) >= bufSize {
xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter)
}
if len(src)%bufSize != 0 {
i := len(src) - len(src)%bufSize
c.buf = [bufSize]byte{}
copy(c.buf[:], src[i:])
xorKeyStreamVX(c.buf[:], c.buf[:], &c.key, &c.nonce, &c.counter)
c.len = bufSize - copy(dst[i:], c.buf[:len(src)%bufSize])
}
}

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build !s390x gccgo appengine // +build !arm64,!s390x arm64,!go1.11 gccgo appengine
package chacha20 package chacha20

View File

@ -32,7 +32,7 @@ To build the files for your current OS and architecture, make sure GOOS and
GOARCH are set correctly and run `mkall.sh`. This will generate the files for GOARCH are set correctly and run `mkall.sh`. This will generate the files for
your specific system. Running `mkall.sh -n` shows the commands that will be run. your specific system. Running `mkall.sh -n` shows the commands that will be run.
Requirements: bash, perl, go Requirements: bash, go
### New Build System (currently for `GOOS == "linux"`) ### New Build System (currently for `GOOS == "linux"`)
@ -52,14 +52,14 @@ system and have your GOOS and GOARCH set accordingly. Running `mkall.sh` will
then generate all of the files for all of the GOOS/GOARCH pairs in the new build then generate all of the files for all of the GOOS/GOARCH pairs in the new build
system. Running `mkall.sh -n` shows the commands that will be run. system. Running `mkall.sh -n` shows the commands that will be run.
Requirements: bash, perl, go, docker Requirements: bash, go, docker
## Component files ## Component files
This section describes the various files used in the code generation process. This section describes the various files used in the code generation process.
It also contains instructions on how to modify these files to add a new It also contains instructions on how to modify these files to add a new
architecture/OS or to add additional syscalls, types, or constants. Note that architecture/OS or to add additional syscalls, types, or constants. Note that
if you are using the new build system, the scripts cannot be called normally. if you are using the new build system, the scripts/programs cannot be called normally.
They must be called from within the docker container. They must be called from within the docker container.
### asm files ### asm files
@ -81,8 +81,8 @@ each GOOS/GOARCH pair.
### mksysnum ### mksysnum
Mksysnum is a script located at `${GOOS}/mksysnum.pl` (or `mksysnum_${GOOS}.pl` Mksysnum is a Go program located at `${GOOS}/mksysnum.go` (or `mksysnum_${GOOS}.go`
for the old system). This script takes in a list of header files containing the for the old system). This program takes in a list of header files containing the
syscall number declarations and parses them to produce the corresponding list of syscall number declarations and parses them to produce the corresponding list of
Go numeric constants. See `zsysnum_${GOOS}_${GOARCH}.go` for the generated Go numeric constants. See `zsysnum_${GOOS}_${GOARCH}.go` for the generated
constants. constants.
@ -92,14 +92,14 @@ new installation of the target OS (or updating the source checkouts for the
new build system). However, depending on the OS, you make need to update the new build system). However, depending on the OS, you make need to update the
parsing in mksysnum. parsing in mksysnum.
### mksyscall.pl ### mksyscall.go
The `syscall.go`, `syscall_${GOOS}.go`, `syscall_${GOOS}_${GOARCH}.go` are The `syscall.go`, `syscall_${GOOS}.go`, `syscall_${GOOS}_${GOARCH}.go` are
hand-written Go files which implement system calls (for unix, the specific OS, hand-written Go files which implement system calls (for unix, the specific OS,
or the specific OS/Architecture pair respectively) that need special handling or the specific OS/Architecture pair respectively) that need special handling
and list `//sys` comments giving prototypes for ones that can be generated. and list `//sys` comments giving prototypes for ones that can be generated.
The mksyscall.pl script takes the `//sys` and `//sysnb` comments and converts The mksyscall.go program takes the `//sys` and `//sysnb` comments and converts
them into syscalls. This requires the name of the prototype in the comment to them into syscalls. This requires the name of the prototype in the comment to
match a syscall number in the `zsysnum_${GOOS}_${GOARCH}.go` file. The function match a syscall number in the `zsysnum_${GOOS}_${GOARCH}.go` file. The function
prototype can be exported (capitalized) or not. prototype can be exported (capitalized) or not.
@ -160,7 +160,7 @@ signal numbers, and constants. Generated by `mkerrors.sh` (see above).
### `zsyscall_${GOOS}_${GOARCH}.go` ### `zsyscall_${GOOS}_${GOARCH}.go`
A file containing all the generated syscalls for a specific GOOS and GOARCH. A file containing all the generated syscalls for a specific GOOS and GOARCH.
Generated by `mksyscall.pl` (see above). Generated by `mksyscall.go` (see above).
### `zsysnum_${GOOS}_${GOARCH}.go` ### `zsysnum_${GOOS}_${GOARCH}.go`

View File

@ -170,7 +170,7 @@ openbsd_arm)
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
;; ;;
solaris_amd64) solaris_amd64)
mksyscall="./mksyscall_solaris.pl" mksyscall="go run mksyscall_solaris.go"
mkerrors="$mkerrors -m64" mkerrors="$mkerrors -m64"
mksysnum= mksysnum=
mktypes="GOARCH=$GOARCH go tool cgo -godefs" mktypes="GOARCH=$GOARCH go tool cgo -godefs"

View File

@ -259,16 +259,6 @@ struct ltchars {
#define FS_KEY_DESC_PREFIX "fscrypt:" #define FS_KEY_DESC_PREFIX "fscrypt:"
#define FS_KEY_DESC_PREFIX_SIZE 8 #define FS_KEY_DESC_PREFIX_SIZE 8
#define FS_MAX_KEY_SIZE 64 #define FS_MAX_KEY_SIZE 64
// XDP socket constants do not appear to be picked up otherwise.
// Copied from samples/bpf/xdpsock_user.c.
#ifndef SOL_XDP
#define SOL_XDP 283
#endif
#ifndef AF_XDP
#define AF_XDP 44
#endif
' '
includes_NetBSD=' includes_NetBSD='
@ -482,6 +472,7 @@ ccflags="$@"
$2 ~ /^ALG_/ || $2 ~ /^ALG_/ ||
$2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE|IOC_(GET|SET)_ENCRYPTION)/ || $2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE|IOC_(GET|SET)_ENCRYPTION)/ ||
$2 ~ /^GRND_/ || $2 ~ /^GRND_/ ||
$2 ~ /^RND/ ||
$2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ || $2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ ||
$2 ~ /^KEYCTL_/ || $2 ~ /^KEYCTL_/ ||
$2 ~ /^PERF_EVENT_IOC_/ || $2 ~ /^PERF_EVENT_IOC_/ ||

View File

@ -88,6 +88,10 @@ func parseParam(p string) Param {
func main() { func main() {
// Get the OS and architecture (using GOARCH_TARGET if it exists) // Get the OS and architecture (using GOARCH_TARGET if it exists)
goos := os.Getenv("GOOS") goos := os.Getenv("GOOS")
if goos == "" {
fmt.Fprintln(os.Stderr, "GOOS not defined in environment")
os.Exit(1)
}
goarch := os.Getenv("GOARCH_TARGET") goarch := os.Getenv("GOARCH_TARGET")
if goarch == "" { if goarch == "" {
goarch = os.Getenv("GOARCH") goarch = os.Getenv("GOARCH")

335
vendor/golang.org/x/sys/unix/mksyscall_solaris.go generated vendored Normal file
View File

@ -0,0 +1,335 @@
// Copyright 2019 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.
// +build ignore
/*
This program reads a file containing function prototypes
(like syscall_solaris.go) and generates system call bodies.
The prototypes are marked by lines beginning with "//sys"
and read like func declarations if //sys is replaced by func, but:
* The parameter lists must give a name for each argument.
This includes return parameters.
* The parameter lists must give a type for each argument:
the (x, y, z int) shorthand is not allowed.
* If the return parameter is an error number, it must be named err.
* If go func name needs to be different than its libc name,
* or the function is not in libc, name could be specified
* at the end, after "=" sign, like
//sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt
*/
package main
import (
"bufio"
"flag"
"fmt"
"os"
"regexp"
"strings"
)
var (
b32 = flag.Bool("b32", false, "32bit big-endian")
l32 = flag.Bool("l32", false, "32bit little-endian")
tags = flag.String("tags", "", "build tags")
)
// cmdLine returns this programs's commandline arguments
func cmdLine() string {
return "go run mksyscall_solaris.go " + strings.Join(os.Args[1:], " ")
}
// buildTags returns build tags
func buildTags() string {
return *tags
}
// Param is function parameter
type Param struct {
Name string
Type string
}
// usage prints the program usage
func usage() {
fmt.Fprintf(os.Stderr, "usage: go run mksyscall_solaris.go [-b32 | -l32] [-tags x,y] [file ...]\n")
os.Exit(1)
}
// parseParamList parses parameter list and returns a slice of parameters
func parseParamList(list string) []string {
list = strings.TrimSpace(list)
if list == "" {
return []string{}
}
return regexp.MustCompile(`\s*,\s*`).Split(list, -1)
}
// parseParam splits a parameter into name and type
func parseParam(p string) Param {
ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p)
if ps == nil {
fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p)
os.Exit(1)
}
return Param{ps[1], ps[2]}
}
func main() {
flag.Usage = usage
flag.Parse()
if len(flag.Args()) <= 0 {
fmt.Fprintf(os.Stderr, "no files to parse provided\n")
usage()
}
endianness := ""
if *b32 {
endianness = "big-endian"
} else if *l32 {
endianness = "little-endian"
}
pack := ""
text := ""
dynimports := ""
linknames := ""
var vars []string
for _, path := range flag.Args() {
file, err := os.Open(path)
if err != nil {
fmt.Fprintf(os.Stderr, err.Error())
os.Exit(1)
}
s := bufio.NewScanner(file)
for s.Scan() {
t := s.Text()
t = strings.TrimSpace(t)
t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `)
if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" {
pack = p[1]
}
nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t)
if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil {
continue
}
// Line must be of the form
// func Open(path string, mode int, perm int) (fd int, err error)
// Split into name, in params, out params.
f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t)
if f == nil {
fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
os.Exit(1)
}
funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6]
// Split argument lists on comma.
in := parseParamList(inps)
out := parseParamList(outps)
inps = strings.Join(in, ", ")
outps = strings.Join(out, ", ")
// Try in vain to keep people from editing this file.
// The theory is that they jump into the middle of the file
// without reading the header.
text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
// So file name.
if modname == "" {
modname = "libc"
}
// System call name.
if sysname == "" {
sysname = funct
}
// System call pointer variable name.
sysvarname := fmt.Sprintf("proc%s", sysname)
strconvfunc := "BytePtrFromString"
strconvtype := "*byte"
sysname = strings.ToLower(sysname) // All libc functions are lowercase.
// Runtime import of function to allow cross-platform builds.
dynimports += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"%s.so\"\n", sysname, sysname, modname)
// Link symbol to proc address variable.
linknames += fmt.Sprintf("//go:linkname %s libc_%s\n", sysvarname, sysname)
// Library proc address variable.
vars = append(vars, sysvarname)
// Go function header.
outlist := strings.Join(out, ", ")
if outlist != "" {
outlist = fmt.Sprintf(" (%s)", outlist)
}
if text != "" {
text += "\n"
}
text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outlist)
// Check if err return available
errvar := ""
for _, param := range out {
p := parseParam(param)
if p.Type == "error" {
errvar = p.Name
continue
}
}
// Prepare arguments to Syscall.
var args []string
n := 0
for _, param := range in {
p := parseParam(param)
if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
args = append(args, "uintptr(unsafe.Pointer("+p.Name+"))")
} else if p.Type == "string" && errvar != "" {
text += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype)
text += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name)
text += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar)
args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
n++
} else if p.Type == "string" {
fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n")
text += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype)
text += fmt.Sprintf("\t_p%d, _ = %s(%s)\n", n, strconvfunc, p.Name)
args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
n++
} else if s := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); s != nil {
// Convert slice into pointer, length.
// Have to be careful not to take address of &a[0] if len == 0:
// pass nil in that case.
text += fmt.Sprintf("\tvar _p%d *%s\n", n, s[1])
text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name)
args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n), fmt.Sprintf("uintptr(len(%s))", p.Name))
n++
} else if p.Type == "int64" && endianness != "" {
if endianness == "big-endian" {
args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
} else {
args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
}
} else if p.Type == "bool" {
text += fmt.Sprintf("\tvar _p%d uint32\n", n)
text += fmt.Sprintf("\tif %s {\n\t\t_p%d = 1\n\t} else {\n\t\t_p%d = 0\n\t}\n", p.Name, n, n)
args = append(args, fmt.Sprintf("uintptr(_p%d)", n))
n++
} else {
args = append(args, fmt.Sprintf("uintptr(%s)", p.Name))
}
}
nargs := len(args)
// Determine which form to use; pad args with zeros.
asm := "sysvicall6"
if nonblock != nil {
asm = "rawSysvicall6"
}
if len(args) <= 6 {
for len(args) < 6 {
args = append(args, "0")
}
} else {
fmt.Fprintf(os.Stderr, "%s: too many arguments to system call\n", path)
os.Exit(1)
}
// Actual call.
arglist := strings.Join(args, ", ")
call := fmt.Sprintf("%s(uintptr(unsafe.Pointer(&%s)), %d, %s)", asm, sysvarname, nargs, arglist)
// Assign return values.
body := ""
ret := []string{"_", "_", "_"}
doErrno := false
for i := 0; i < len(out); i++ {
p := parseParam(out[i])
reg := ""
if p.Name == "err" {
reg = "e1"
ret[2] = reg
doErrno = true
} else {
reg = fmt.Sprintf("r%d", i)
ret[i] = reg
}
if p.Type == "bool" {
reg = fmt.Sprintf("%d != 0", reg)
}
if p.Type == "int64" && endianness != "" {
// 64-bit number in r1:r0 or r0:r1.
if i+2 > len(out) {
fmt.Fprintf(os.Stderr, "%s: not enough registers for int64 return\n", path)
os.Exit(1)
}
if endianness == "big-endian" {
reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i, i+1)
} else {
reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i+1, i)
}
ret[i] = fmt.Sprintf("r%d", i)
ret[i+1] = fmt.Sprintf("r%d", i+1)
}
if reg != "e1" {
body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg)
}
}
if ret[0] == "_" && ret[1] == "_" && ret[2] == "_" {
text += fmt.Sprintf("\t%s\n", call)
} else {
text += fmt.Sprintf("\t%s, %s, %s := %s\n", ret[0], ret[1], ret[2], call)
}
text += body
if doErrno {
text += "\tif e1 != 0 {\n"
text += "\t\terr = e1\n"
text += "\t}\n"
}
text += "\treturn\n"
text += "}\n"
}
if err := s.Err(); err != nil {
fmt.Fprintf(os.Stderr, err.Error())
os.Exit(1)
}
file.Close()
}
imp := ""
if pack != "unix" {
imp = "import \"golang.org/x/sys/unix\"\n"
}
vardecls := "\t" + strings.Join(vars, ",\n\t")
vardecls += " syscallFunc"
fmt.Printf(srcTemplate, cmdLine(), buildTags(), pack, imp, dynimports, linknames, vardecls, text)
}
const srcTemplate = `// %s
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build %s
package %s
import (
"syscall"
"unsafe"
)
%s
%s
%s
var (
%s
)
%s
`

View File

@ -1,294 +0,0 @@
#!/usr/bin/env perl
# Copyright 2009 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.
# This program reads a file containing function prototypes
# (like syscall_solaris.go) and generates system call bodies.
# The prototypes are marked by lines beginning with "//sys"
# and read like func declarations if //sys is replaced by func, but:
# * The parameter lists must give a name for each argument.
# This includes return parameters.
# * The parameter lists must give a type for each argument:
# the (x, y, z int) shorthand is not allowed.
# * If the return parameter is an error number, it must be named err.
# * If go func name needs to be different than its libc name,
# * or the function is not in libc, name could be specified
# * at the end, after "=" sign, like
# //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt
use strict;
my $cmdline = "mksyscall_solaris.pl " . join(' ', @ARGV);
my $errors = 0;
my $_32bit = "";
my $tags = ""; # build tags
binmode STDOUT;
if($ARGV[0] eq "-b32") {
$_32bit = "big-endian";
shift;
} elsif($ARGV[0] eq "-l32") {
$_32bit = "little-endian";
shift;
}
if($ARGV[0] eq "-tags") {
shift;
$tags = $ARGV[0];
shift;
}
if($ARGV[0] =~ /^-/) {
print STDERR "usage: mksyscall_solaris.pl [-b32 | -l32] [-tags x,y] [file ...]\n";
exit 1;
}
sub parseparamlist($) {
my ($list) = @_;
$list =~ s/^\s*//;
$list =~ s/\s*$//;
if($list eq "") {
return ();
}
return split(/\s*,\s*/, $list);
}
sub parseparam($) {
my ($p) = @_;
if($p !~ /^(\S*) (\S*)$/) {
print STDERR "$ARGV:$.: malformed parameter: $p\n";
$errors = 1;
return ("xx", "int");
}
return ($1, $2);
}
my $package = "";
my $text = "";
my $dynimports = "";
my $linknames = "";
my @vars = ();
while(<>) {
chomp;
s/\s+/ /g;
s/^\s+//;
s/\s+$//;
$package = $1 if !$package && /^package (\S+)$/;
my $nonblock = /^\/\/sysnb /;
next if !/^\/\/sys / && !$nonblock;
# Line must be of the form
# func Open(path string, mode int, perm int) (fd int, err error)
# Split into name, in params, out params.
if(!/^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$/) {
print STDERR "$ARGV:$.: malformed //sys declaration\n";
$errors = 1;
next;
}
my ($nb, $func, $in, $out, $modname, $sysname) = ($1, $2, $3, $4, $5, $6);
# Split argument lists on comma.
my @in = parseparamlist($in);
my @out = parseparamlist($out);
# Try in vain to keep people from editing this file.
# The theory is that they jump into the middle of the file
# without reading the header.
$text .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n";
# So file name.
if($modname eq "") {
$modname = "libc";
}
# System call name.
if($sysname eq "") {
$sysname = "$func";
}
# System call pointer variable name.
my $sysvarname = "proc$sysname";
my $strconvfunc = "BytePtrFromString";
my $strconvtype = "*byte";
$sysname =~ y/A-Z/a-z/; # All libc functions are lowercase.
# Runtime import of function to allow cross-platform builds.
$dynimports .= "//go:cgo_import_dynamic libc_${sysname} ${sysname} \"$modname.so\"\n";
# Link symbol to proc address variable.
$linknames .= "//go:linkname ${sysvarname} libc_${sysname}\n";
# Library proc address variable.
push @vars, $sysvarname;
# Go function header.
$out = join(', ', @out);
if($out ne "") {
$out = " ($out)";
}
if($text ne "") {
$text .= "\n"
}
$text .= sprintf "func %s(%s)%s {\n", $func, join(', ', @in), $out;
# Check if err return available
my $errvar = "";
foreach my $p (@out) {
my ($name, $type) = parseparam($p);
if($type eq "error") {
$errvar = $name;
last;
}
}
# Prepare arguments to Syscall.
my @args = ();
my $n = 0;
foreach my $p (@in) {
my ($name, $type) = parseparam($p);
if($type =~ /^\*/) {
push @args, "uintptr(unsafe.Pointer($name))";
} elsif($type eq "string" && $errvar ne "") {
$text .= "\tvar _p$n $strconvtype\n";
$text .= "\t_p$n, $errvar = $strconvfunc($name)\n";
$text .= "\tif $errvar != nil {\n\t\treturn\n\t}\n";
push @args, "uintptr(unsafe.Pointer(_p$n))";
$n++;
} elsif($type eq "string") {
print STDERR "$ARGV:$.: $func uses string arguments, but has no error return\n";
$text .= "\tvar _p$n $strconvtype\n";
$text .= "\t_p$n, _ = $strconvfunc($name)\n";
push @args, "uintptr(unsafe.Pointer(_p$n))";
$n++;
} elsif($type =~ /^\[\](.*)/) {
# Convert slice into pointer, length.
# Have to be careful not to take address of &a[0] if len == 0:
# pass nil in that case.
$text .= "\tvar _p$n *$1\n";
$text .= "\tif len($name) > 0 {\n\t\t_p$n = \&$name\[0]\n\t}\n";
push @args, "uintptr(unsafe.Pointer(_p$n))", "uintptr(len($name))";
$n++;
} elsif($type eq "int64" && $_32bit ne "") {
if($_32bit eq "big-endian") {
push @args, "uintptr($name >> 32)", "uintptr($name)";
} else {
push @args, "uintptr($name)", "uintptr($name >> 32)";
}
} elsif($type eq "bool") {
$text .= "\tvar _p$n uint32\n";
$text .= "\tif $name {\n\t\t_p$n = 1\n\t} else {\n\t\t_p$n = 0\n\t}\n";
push @args, "uintptr(_p$n)";
$n++;
} else {
push @args, "uintptr($name)";
}
}
my $nargs = @args;
# Determine which form to use; pad args with zeros.
my $asm = "sysvicall6";
if ($nonblock) {
$asm = "rawSysvicall6";
}
if(@args <= 6) {
while(@args < 6) {
push @args, "0";
}
} else {
print STDERR "$ARGV:$.: too many arguments to system call\n";
}
# Actual call.
my $args = join(', ', @args);
my $call = "$asm(uintptr(unsafe.Pointer(&$sysvarname)), $nargs, $args)";
# Assign return values.
my $body = "";
my $failexpr = "";
my @ret = ("_", "_", "_");
my @pout= ();
my $do_errno = 0;
for(my $i=0; $i<@out; $i++) {
my $p = $out[$i];
my ($name, $type) = parseparam($p);
my $reg = "";
if($name eq "err") {
$reg = "e1";
$ret[2] = $reg;
$do_errno = 1;
} else {
$reg = sprintf("r%d", $i);
$ret[$i] = $reg;
}
if($type eq "bool") {
$reg = "$reg != 0";
}
if($type eq "int64" && $_32bit ne "") {
# 64-bit number in r1:r0 or r0:r1.
if($i+2 > @out) {
print STDERR "$ARGV:$.: not enough registers for int64 return\n";
}
if($_32bit eq "big-endian") {
$reg = sprintf("int64(r%d)<<32 | int64(r%d)", $i, $i+1);
} else {
$reg = sprintf("int64(r%d)<<32 | int64(r%d)", $i+1, $i);
}
$ret[$i] = sprintf("r%d", $i);
$ret[$i+1] = sprintf("r%d", $i+1);
}
if($reg ne "e1") {
$body .= "\t$name = $type($reg)\n";
}
}
if ($ret[0] eq "_" && $ret[1] eq "_" && $ret[2] eq "_") {
$text .= "\t$call\n";
} else {
$text .= "\t$ret[0], $ret[1], $ret[2] := $call\n";
}
$text .= $body;
if ($do_errno) {
$text .= "\tif e1 != 0 {\n";
$text .= "\t\terr = e1\n";
$text .= "\t}\n";
}
$text .= "\treturn\n";
$text .= "}\n";
}
if($errors) {
exit 1;
}
print <<EOF;
// $cmdline
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build $tags
package $package
import (
"syscall"
"unsafe"
)
EOF
print "import \"golang.org/x/sys/unix\"\n" if $package ne "unix";
my $vardecls = "\t" . join(",\n\t", @vars);
$vardecls .= " syscallFunc";
chomp($_=<<EOF);
$dynimports
$linknames
var (
$vardecls
)
$text
EOF
print $_;
exit 0;

View File

@ -416,6 +416,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys Chmod(path string, mode uint32) (err error) //sys Chmod(path string, mode uint32) (err error)
//sys Chown(path string, uid int, gid int) (err error) //sys Chown(path string, uid int, gid int) (err error)
//sys Chroot(path string) (err error) //sys Chroot(path string) (err error)
//sys ClockGettime(clockid int32, time *Timespec) (err error)
//sys Close(fd int) (err error) //sys Close(fd int) (err error)
//sys Dup(fd int) (nfd int, err error) //sys Dup(fd int) (nfd int, err error)
//sys Dup2(from int, to int) (err error) //sys Dup2(from int, to int) (err error)

View File

@ -14,6 +14,7 @@ package unix
import ( import (
"encoding/binary" "encoding/binary"
"net" "net"
"runtime"
"syscall" "syscall"
"unsafe" "unsafe"
) )
@ -80,6 +81,12 @@ func ioctlSetTermios(fd int, req uint, value *Termios) error {
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
} }
func IoctlSetRTCTime(fd int, value *RTCTime) error {
err := ioctl(fd, RTC_SET_TIME, uintptr(unsafe.Pointer(value)))
runtime.KeepAlive(value)
return err
}
// IoctlGetInt performs an ioctl operation which gets an integer value // IoctlGetInt performs an ioctl operation which gets an integer value
// from fd, using the specified request number. // from fd, using the specified request number.
func IoctlGetInt(fd int, req uint) (int, error) { func IoctlGetInt(fd int, req uint) (int, error) {
@ -100,6 +107,12 @@ func IoctlGetTermios(fd int, req uint) (*Termios, error) {
return &value, err return &value, err
} }
func IoctlGetRTCTime(fd int) (*RTCTime, error) {
var value RTCTime
err := ioctl(fd, RTC_RD_TIME, uintptr(unsafe.Pointer(&value)))
return &value, err
}
//sys Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) //sys Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error)
func Link(oldpath string, newpath string) (err error) { func Link(oldpath string, newpath string) (err error) {
@ -981,6 +994,20 @@ func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq)) return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
} }
// SetsockoptSockFprog attaches a classic BPF or an extended BPF program to a
// socket to filter incoming packets. See 'man 7 socket' for usage information.
func SetsockoptSockFprog(fd, level, opt int, fprog *SockFprog) error {
return setsockopt(fd, level, opt, unsafe.Pointer(fprog), unsafe.Sizeof(*fprog))
}
func SetsockoptCanRawFilter(fd, level, opt int, filter []CanFilter) error {
var p unsafe.Pointer
if len(filter) > 0 {
p = unsafe.Pointer(&filter[0])
}
return setsockopt(fd, level, opt, p, uintptr(len(filter)*SizeofCanFilter))
}
// Keyctl Commands (http://man7.org/linux/man-pages/man2/keyctl.2.html) // Keyctl Commands (http://man7.org/linux/man-pages/man2/keyctl.2.html)
// KeyctlInt calls keyctl commands in which each argument is an int. // KeyctlInt calls keyctl commands in which each argument is an int.

View File

@ -41,7 +41,7 @@ const (
AF_KEY = 0xf AF_KEY = 0xf
AF_LLC = 0x1a AF_LLC = 0x1a
AF_LOCAL = 0x1 AF_LOCAL = 0x1
AF_MAX = 0x2c AF_MAX = 0x2d
AF_MPLS = 0x1c AF_MPLS = 0x1c
AF_NETBEUI = 0xd AF_NETBEUI = 0xd
AF_NETLINK = 0x10 AF_NETLINK = 0x10
@ -707,6 +707,7 @@ const (
IN_ISDIR = 0x40000000 IN_ISDIR = 0x40000000
IN_LOOPBACKNET = 0x7f IN_LOOPBACKNET = 0x7f
IN_MASK_ADD = 0x20000000 IN_MASK_ADD = 0x20000000
IN_MASK_CREATE = 0x10000000
IN_MODIFY = 0x2 IN_MODIFY = 0x2
IN_MOVE = 0xc0 IN_MOVE = 0xc0
IN_MOVED_FROM = 0x40 IN_MOVED_FROM = 0x40
@ -778,6 +779,7 @@ const (
IPV6_MINHOPCOUNT = 0x49 IPV6_MINHOPCOUNT = 0x49
IPV6_MTU = 0x18 IPV6_MTU = 0x18
IPV6_MTU_DISCOVER = 0x17 IPV6_MTU_DISCOVER = 0x17
IPV6_MULTICAST_ALL = 0x1d
IPV6_MULTICAST_HOPS = 0x12 IPV6_MULTICAST_HOPS = 0x12
IPV6_MULTICAST_IF = 0x11 IPV6_MULTICAST_IF = 0x11
IPV6_MULTICAST_LOOP = 0x13 IPV6_MULTICAST_LOOP = 0x13
@ -1537,6 +1539,13 @@ const (
RLIMIT_SIGPENDING = 0xb RLIMIT_SIGPENDING = 0xb
RLIMIT_STACK = 0x3 RLIMIT_STACK = 0x3
RLIM_INFINITY = 0xffffffffffffffff RLIM_INFINITY = 0xffffffffffffffff
RNDADDENTROPY = 0x40085203
RNDADDTOENTCNT = 0x40045201
RNDCLEARPOOL = 0x5206
RNDGETENTCNT = 0x80045200
RNDGETPOOL = 0x80085202
RNDRESEEDCRNG = 0x5207
RNDZAPENTCNT = 0x5204
RTAX_ADVMSS = 0x8 RTAX_ADVMSS = 0x8
RTAX_CC_ALGO = 0x10 RTAX_CC_ALGO = 0x10
RTAX_CWND = 0x7 RTAX_CWND = 0x7
@ -2051,6 +2060,7 @@ const (
TCOOFF = 0x0 TCOOFF = 0x0
TCOON = 0x1 TCOON = 0x1
TCP_CC_INFO = 0x1a TCP_CC_INFO = 0x1a
TCP_CM_INQ = 0x24
TCP_CONGESTION = 0xd TCP_CONGESTION = 0xd
TCP_COOKIE_IN_ALWAYS = 0x1 TCP_COOKIE_IN_ALWAYS = 0x1
TCP_COOKIE_MAX = 0x10 TCP_COOKIE_MAX = 0x10
@ -2065,6 +2075,7 @@ const (
TCP_FASTOPEN_KEY = 0x21 TCP_FASTOPEN_KEY = 0x21
TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_FASTOPEN_NO_COOKIE = 0x22
TCP_INFO = 0xb TCP_INFO = 0xb
TCP_INQ = 0x24
TCP_KEEPCNT = 0x6 TCP_KEEPCNT = 0x6
TCP_KEEPIDLE = 0x4 TCP_KEEPIDLE = 0x4
TCP_KEEPINTVL = 0x5 TCP_KEEPINTVL = 0x5
@ -2084,6 +2095,9 @@ const (
TCP_QUEUE_SEQ = 0x15 TCP_QUEUE_SEQ = 0x15
TCP_QUICKACK = 0xc TCP_QUICKACK = 0xc
TCP_REPAIR = 0x13 TCP_REPAIR = 0x13
TCP_REPAIR_OFF = 0x0
TCP_REPAIR_OFF_NO_WP = -0x1
TCP_REPAIR_ON = 0x1
TCP_REPAIR_OPTIONS = 0x16 TCP_REPAIR_OPTIONS = 0x16
TCP_REPAIR_QUEUE = 0x14 TCP_REPAIR_QUEUE = 0x14
TCP_REPAIR_WINDOW = 0x1d TCP_REPAIR_WINDOW = 0x1d
@ -2098,6 +2112,7 @@ const (
TCP_ULP = 0x1f TCP_ULP = 0x1f
TCP_USER_TIMEOUT = 0x12 TCP_USER_TIMEOUT = 0x12
TCP_WINDOW_CLAMP = 0xa TCP_WINDOW_CLAMP = 0xa
TCP_ZEROCOPY_RECEIVE = 0x23
TCSAFLUSH = 0x2 TCSAFLUSH = 0x2
TCSBRK = 0x5409 TCSBRK = 0x5409
TCSBRKP = 0x5425 TCSBRKP = 0x5425

View File

@ -41,7 +41,7 @@ const (
AF_KEY = 0xf AF_KEY = 0xf
AF_LLC = 0x1a AF_LLC = 0x1a
AF_LOCAL = 0x1 AF_LOCAL = 0x1
AF_MAX = 0x2c AF_MAX = 0x2d
AF_MPLS = 0x1c AF_MPLS = 0x1c
AF_NETBEUI = 0xd AF_NETBEUI = 0xd
AF_NETLINK = 0x10 AF_NETLINK = 0x10
@ -707,6 +707,7 @@ const (
IN_ISDIR = 0x40000000 IN_ISDIR = 0x40000000
IN_LOOPBACKNET = 0x7f IN_LOOPBACKNET = 0x7f
IN_MASK_ADD = 0x20000000 IN_MASK_ADD = 0x20000000
IN_MASK_CREATE = 0x10000000
IN_MODIFY = 0x2 IN_MODIFY = 0x2
IN_MOVE = 0xc0 IN_MOVE = 0xc0
IN_MOVED_FROM = 0x40 IN_MOVED_FROM = 0x40
@ -778,6 +779,7 @@ const (
IPV6_MINHOPCOUNT = 0x49 IPV6_MINHOPCOUNT = 0x49
IPV6_MTU = 0x18 IPV6_MTU = 0x18
IPV6_MTU_DISCOVER = 0x17 IPV6_MTU_DISCOVER = 0x17
IPV6_MULTICAST_ALL = 0x1d
IPV6_MULTICAST_HOPS = 0x12 IPV6_MULTICAST_HOPS = 0x12
IPV6_MULTICAST_IF = 0x11 IPV6_MULTICAST_IF = 0x11
IPV6_MULTICAST_LOOP = 0x13 IPV6_MULTICAST_LOOP = 0x13
@ -1538,6 +1540,13 @@ const (
RLIMIT_SIGPENDING = 0xb RLIMIT_SIGPENDING = 0xb
RLIMIT_STACK = 0x3 RLIMIT_STACK = 0x3
RLIM_INFINITY = 0xffffffffffffffff RLIM_INFINITY = 0xffffffffffffffff
RNDADDENTROPY = 0x40085203
RNDADDTOENTCNT = 0x40045201
RNDCLEARPOOL = 0x5206
RNDGETENTCNT = 0x80045200
RNDGETPOOL = 0x80085202
RNDRESEEDCRNG = 0x5207
RNDZAPENTCNT = 0x5204
RTAX_ADVMSS = 0x8 RTAX_ADVMSS = 0x8
RTAX_CC_ALGO = 0x10 RTAX_CC_ALGO = 0x10
RTAX_CWND = 0x7 RTAX_CWND = 0x7
@ -2052,6 +2061,7 @@ const (
TCOOFF = 0x0 TCOOFF = 0x0
TCOON = 0x1 TCOON = 0x1
TCP_CC_INFO = 0x1a TCP_CC_INFO = 0x1a
TCP_CM_INQ = 0x24
TCP_CONGESTION = 0xd TCP_CONGESTION = 0xd
TCP_COOKIE_IN_ALWAYS = 0x1 TCP_COOKIE_IN_ALWAYS = 0x1
TCP_COOKIE_MAX = 0x10 TCP_COOKIE_MAX = 0x10
@ -2066,6 +2076,7 @@ const (
TCP_FASTOPEN_KEY = 0x21 TCP_FASTOPEN_KEY = 0x21
TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_FASTOPEN_NO_COOKIE = 0x22
TCP_INFO = 0xb TCP_INFO = 0xb
TCP_INQ = 0x24
TCP_KEEPCNT = 0x6 TCP_KEEPCNT = 0x6
TCP_KEEPIDLE = 0x4 TCP_KEEPIDLE = 0x4
TCP_KEEPINTVL = 0x5 TCP_KEEPINTVL = 0x5
@ -2085,6 +2096,9 @@ const (
TCP_QUEUE_SEQ = 0x15 TCP_QUEUE_SEQ = 0x15
TCP_QUICKACK = 0xc TCP_QUICKACK = 0xc
TCP_REPAIR = 0x13 TCP_REPAIR = 0x13
TCP_REPAIR_OFF = 0x0
TCP_REPAIR_OFF_NO_WP = -0x1
TCP_REPAIR_ON = 0x1
TCP_REPAIR_OPTIONS = 0x16 TCP_REPAIR_OPTIONS = 0x16
TCP_REPAIR_QUEUE = 0x14 TCP_REPAIR_QUEUE = 0x14
TCP_REPAIR_WINDOW = 0x1d TCP_REPAIR_WINDOW = 0x1d
@ -2099,6 +2113,7 @@ const (
TCP_ULP = 0x1f TCP_ULP = 0x1f
TCP_USER_TIMEOUT = 0x12 TCP_USER_TIMEOUT = 0x12
TCP_WINDOW_CLAMP = 0xa TCP_WINDOW_CLAMP = 0xa
TCP_ZEROCOPY_RECEIVE = 0x23
TCSAFLUSH = 0x2 TCSAFLUSH = 0x2
TCSBRK = 0x5409 TCSBRK = 0x5409
TCSBRKP = 0x5425 TCSBRKP = 0x5425

View File

@ -41,7 +41,7 @@ const (
AF_KEY = 0xf AF_KEY = 0xf
AF_LLC = 0x1a AF_LLC = 0x1a
AF_LOCAL = 0x1 AF_LOCAL = 0x1
AF_MAX = 0x2c AF_MAX = 0x2d
AF_MPLS = 0x1c AF_MPLS = 0x1c
AF_NETBEUI = 0xd AF_NETBEUI = 0xd
AF_NETLINK = 0x10 AF_NETLINK = 0x10
@ -706,6 +706,7 @@ const (
IN_ISDIR = 0x40000000 IN_ISDIR = 0x40000000
IN_LOOPBACKNET = 0x7f IN_LOOPBACKNET = 0x7f
IN_MASK_ADD = 0x20000000 IN_MASK_ADD = 0x20000000
IN_MASK_CREATE = 0x10000000
IN_MODIFY = 0x2 IN_MODIFY = 0x2
IN_MOVE = 0xc0 IN_MOVE = 0xc0
IN_MOVED_FROM = 0x40 IN_MOVED_FROM = 0x40
@ -777,6 +778,7 @@ const (
IPV6_MINHOPCOUNT = 0x49 IPV6_MINHOPCOUNT = 0x49
IPV6_MTU = 0x18 IPV6_MTU = 0x18
IPV6_MTU_DISCOVER = 0x17 IPV6_MTU_DISCOVER = 0x17
IPV6_MULTICAST_ALL = 0x1d
IPV6_MULTICAST_HOPS = 0x12 IPV6_MULTICAST_HOPS = 0x12
IPV6_MULTICAST_IF = 0x11 IPV6_MULTICAST_IF = 0x11
IPV6_MULTICAST_LOOP = 0x13 IPV6_MULTICAST_LOOP = 0x13
@ -1544,6 +1546,13 @@ const (
RLIMIT_SIGPENDING = 0xb RLIMIT_SIGPENDING = 0xb
RLIMIT_STACK = 0x3 RLIMIT_STACK = 0x3
RLIM_INFINITY = 0xffffffffffffffff RLIM_INFINITY = 0xffffffffffffffff
RNDADDENTROPY = 0x40085203
RNDADDTOENTCNT = 0x40045201
RNDCLEARPOOL = 0x5206
RNDGETENTCNT = 0x80045200
RNDGETPOOL = 0x80085202
RNDRESEEDCRNG = 0x5207
RNDZAPENTCNT = 0x5204
RTAX_ADVMSS = 0x8 RTAX_ADVMSS = 0x8
RTAX_CC_ALGO = 0x10 RTAX_CC_ALGO = 0x10
RTAX_CWND = 0x7 RTAX_CWND = 0x7
@ -2058,6 +2067,7 @@ const (
TCOOFF = 0x0 TCOOFF = 0x0
TCOON = 0x1 TCOON = 0x1
TCP_CC_INFO = 0x1a TCP_CC_INFO = 0x1a
TCP_CM_INQ = 0x24
TCP_CONGESTION = 0xd TCP_CONGESTION = 0xd
TCP_COOKIE_IN_ALWAYS = 0x1 TCP_COOKIE_IN_ALWAYS = 0x1
TCP_COOKIE_MAX = 0x10 TCP_COOKIE_MAX = 0x10
@ -2072,6 +2082,7 @@ const (
TCP_FASTOPEN_KEY = 0x21 TCP_FASTOPEN_KEY = 0x21
TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_FASTOPEN_NO_COOKIE = 0x22
TCP_INFO = 0xb TCP_INFO = 0xb
TCP_INQ = 0x24
TCP_KEEPCNT = 0x6 TCP_KEEPCNT = 0x6
TCP_KEEPIDLE = 0x4 TCP_KEEPIDLE = 0x4
TCP_KEEPINTVL = 0x5 TCP_KEEPINTVL = 0x5
@ -2091,6 +2102,9 @@ const (
TCP_QUEUE_SEQ = 0x15 TCP_QUEUE_SEQ = 0x15
TCP_QUICKACK = 0xc TCP_QUICKACK = 0xc
TCP_REPAIR = 0x13 TCP_REPAIR = 0x13
TCP_REPAIR_OFF = 0x0
TCP_REPAIR_OFF_NO_WP = -0x1
TCP_REPAIR_ON = 0x1
TCP_REPAIR_OPTIONS = 0x16 TCP_REPAIR_OPTIONS = 0x16
TCP_REPAIR_QUEUE = 0x14 TCP_REPAIR_QUEUE = 0x14
TCP_REPAIR_WINDOW = 0x1d TCP_REPAIR_WINDOW = 0x1d
@ -2105,6 +2119,7 @@ const (
TCP_ULP = 0x1f TCP_ULP = 0x1f
TCP_USER_TIMEOUT = 0x12 TCP_USER_TIMEOUT = 0x12
TCP_WINDOW_CLAMP = 0xa TCP_WINDOW_CLAMP = 0xa
TCP_ZEROCOPY_RECEIVE = 0x23
TCSAFLUSH = 0x2 TCSAFLUSH = 0x2
TCSBRK = 0x5409 TCSBRK = 0x5409
TCSBRKP = 0x5425 TCSBRKP = 0x5425

View File

@ -41,7 +41,7 @@ const (
AF_KEY = 0xf AF_KEY = 0xf
AF_LLC = 0x1a AF_LLC = 0x1a
AF_LOCAL = 0x1 AF_LOCAL = 0x1
AF_MAX = 0x2c AF_MAX = 0x2d
AF_MPLS = 0x1c AF_MPLS = 0x1c
AF_NETBEUI = 0xd AF_NETBEUI = 0xd
AF_NETLINK = 0x10 AF_NETLINK = 0x10
@ -709,6 +709,7 @@ const (
IN_ISDIR = 0x40000000 IN_ISDIR = 0x40000000
IN_LOOPBACKNET = 0x7f IN_LOOPBACKNET = 0x7f
IN_MASK_ADD = 0x20000000 IN_MASK_ADD = 0x20000000
IN_MASK_CREATE = 0x10000000
IN_MODIFY = 0x2 IN_MODIFY = 0x2
IN_MOVE = 0xc0 IN_MOVE = 0xc0
IN_MOVED_FROM = 0x40 IN_MOVED_FROM = 0x40
@ -780,6 +781,7 @@ const (
IPV6_MINHOPCOUNT = 0x49 IPV6_MINHOPCOUNT = 0x49
IPV6_MTU = 0x18 IPV6_MTU = 0x18
IPV6_MTU_DISCOVER = 0x17 IPV6_MTU_DISCOVER = 0x17
IPV6_MULTICAST_ALL = 0x1d
IPV6_MULTICAST_HOPS = 0x12 IPV6_MULTICAST_HOPS = 0x12
IPV6_MULTICAST_IF = 0x11 IPV6_MULTICAST_IF = 0x11
IPV6_MULTICAST_LOOP = 0x13 IPV6_MULTICAST_LOOP = 0x13
@ -1528,6 +1530,13 @@ const (
RLIMIT_SIGPENDING = 0xb RLIMIT_SIGPENDING = 0xb
RLIMIT_STACK = 0x3 RLIMIT_STACK = 0x3
RLIM_INFINITY = 0xffffffffffffffff RLIM_INFINITY = 0xffffffffffffffff
RNDADDENTROPY = 0x40085203
RNDADDTOENTCNT = 0x40045201
RNDCLEARPOOL = 0x5206
RNDGETENTCNT = 0x80045200
RNDGETPOOL = 0x80085202
RNDRESEEDCRNG = 0x5207
RNDZAPENTCNT = 0x5204
RTAX_ADVMSS = 0x8 RTAX_ADVMSS = 0x8
RTAX_CC_ALGO = 0x10 RTAX_CC_ALGO = 0x10
RTAX_CWND = 0x7 RTAX_CWND = 0x7
@ -2043,6 +2052,7 @@ const (
TCOOFF = 0x0 TCOOFF = 0x0
TCOON = 0x1 TCOON = 0x1
TCP_CC_INFO = 0x1a TCP_CC_INFO = 0x1a
TCP_CM_INQ = 0x24
TCP_CONGESTION = 0xd TCP_CONGESTION = 0xd
TCP_COOKIE_IN_ALWAYS = 0x1 TCP_COOKIE_IN_ALWAYS = 0x1
TCP_COOKIE_MAX = 0x10 TCP_COOKIE_MAX = 0x10
@ -2057,6 +2067,7 @@ const (
TCP_FASTOPEN_KEY = 0x21 TCP_FASTOPEN_KEY = 0x21
TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_FASTOPEN_NO_COOKIE = 0x22
TCP_INFO = 0xb TCP_INFO = 0xb
TCP_INQ = 0x24
TCP_KEEPCNT = 0x6 TCP_KEEPCNT = 0x6
TCP_KEEPIDLE = 0x4 TCP_KEEPIDLE = 0x4
TCP_KEEPINTVL = 0x5 TCP_KEEPINTVL = 0x5
@ -2076,6 +2087,9 @@ const (
TCP_QUEUE_SEQ = 0x15 TCP_QUEUE_SEQ = 0x15
TCP_QUICKACK = 0xc TCP_QUICKACK = 0xc
TCP_REPAIR = 0x13 TCP_REPAIR = 0x13
TCP_REPAIR_OFF = 0x0
TCP_REPAIR_OFF_NO_WP = -0x1
TCP_REPAIR_ON = 0x1
TCP_REPAIR_OPTIONS = 0x16 TCP_REPAIR_OPTIONS = 0x16
TCP_REPAIR_QUEUE = 0x14 TCP_REPAIR_QUEUE = 0x14
TCP_REPAIR_WINDOW = 0x1d TCP_REPAIR_WINDOW = 0x1d
@ -2090,6 +2104,7 @@ const (
TCP_ULP = 0x1f TCP_ULP = 0x1f
TCP_USER_TIMEOUT = 0x12 TCP_USER_TIMEOUT = 0x12
TCP_WINDOW_CLAMP = 0xa TCP_WINDOW_CLAMP = 0xa
TCP_ZEROCOPY_RECEIVE = 0x23
TCSAFLUSH = 0x2 TCSAFLUSH = 0x2
TCSBRK = 0x5409 TCSBRK = 0x5409
TCSBRKP = 0x5425 TCSBRKP = 0x5425

View File

@ -41,7 +41,7 @@ const (
AF_KEY = 0xf AF_KEY = 0xf
AF_LLC = 0x1a AF_LLC = 0x1a
AF_LOCAL = 0x1 AF_LOCAL = 0x1
AF_MAX = 0x2c AF_MAX = 0x2d
AF_MPLS = 0x1c AF_MPLS = 0x1c
AF_NETBEUI = 0xd AF_NETBEUI = 0xd
AF_NETLINK = 0x10 AF_NETLINK = 0x10
@ -706,6 +706,7 @@ const (
IN_ISDIR = 0x40000000 IN_ISDIR = 0x40000000
IN_LOOPBACKNET = 0x7f IN_LOOPBACKNET = 0x7f
IN_MASK_ADD = 0x20000000 IN_MASK_ADD = 0x20000000
IN_MASK_CREATE = 0x10000000
IN_MODIFY = 0x2 IN_MODIFY = 0x2
IN_MOVE = 0xc0 IN_MOVE = 0xc0
IN_MOVED_FROM = 0x40 IN_MOVED_FROM = 0x40
@ -777,6 +778,7 @@ const (
IPV6_MINHOPCOUNT = 0x49 IPV6_MINHOPCOUNT = 0x49
IPV6_MTU = 0x18 IPV6_MTU = 0x18
IPV6_MTU_DISCOVER = 0x17 IPV6_MTU_DISCOVER = 0x17
IPV6_MULTICAST_ALL = 0x1d
IPV6_MULTICAST_HOPS = 0x12 IPV6_MULTICAST_HOPS = 0x12
IPV6_MULTICAST_IF = 0x11 IPV6_MULTICAST_IF = 0x11
IPV6_MULTICAST_LOOP = 0x13 IPV6_MULTICAST_LOOP = 0x13
@ -1537,6 +1539,13 @@ const (
RLIMIT_SIGPENDING = 0xb RLIMIT_SIGPENDING = 0xb
RLIMIT_STACK = 0x3 RLIMIT_STACK = 0x3
RLIM_INFINITY = 0xffffffffffffffff RLIM_INFINITY = 0xffffffffffffffff
RNDADDENTROPY = 0x80085203
RNDADDTOENTCNT = 0x80045201
RNDCLEARPOOL = 0x20005206
RNDGETENTCNT = 0x40045200
RNDGETPOOL = 0x40085202
RNDRESEEDCRNG = 0x20005207
RNDZAPENTCNT = 0x20005204
RTAX_ADVMSS = 0x8 RTAX_ADVMSS = 0x8
RTAX_CC_ALGO = 0x10 RTAX_CC_ALGO = 0x10
RTAX_CWND = 0x7 RTAX_CWND = 0x7
@ -2051,6 +2060,7 @@ const (
TCOOFF = 0x0 TCOOFF = 0x0
TCOON = 0x1 TCOON = 0x1
TCP_CC_INFO = 0x1a TCP_CC_INFO = 0x1a
TCP_CM_INQ = 0x24
TCP_CONGESTION = 0xd TCP_CONGESTION = 0xd
TCP_COOKIE_IN_ALWAYS = 0x1 TCP_COOKIE_IN_ALWAYS = 0x1
TCP_COOKIE_MAX = 0x10 TCP_COOKIE_MAX = 0x10
@ -2065,6 +2075,7 @@ const (
TCP_FASTOPEN_KEY = 0x21 TCP_FASTOPEN_KEY = 0x21
TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_FASTOPEN_NO_COOKIE = 0x22
TCP_INFO = 0xb TCP_INFO = 0xb
TCP_INQ = 0x24
TCP_KEEPCNT = 0x6 TCP_KEEPCNT = 0x6
TCP_KEEPIDLE = 0x4 TCP_KEEPIDLE = 0x4
TCP_KEEPINTVL = 0x5 TCP_KEEPINTVL = 0x5
@ -2084,6 +2095,9 @@ const (
TCP_QUEUE_SEQ = 0x15 TCP_QUEUE_SEQ = 0x15
TCP_QUICKACK = 0xc TCP_QUICKACK = 0xc
TCP_REPAIR = 0x13 TCP_REPAIR = 0x13
TCP_REPAIR_OFF = 0x0
TCP_REPAIR_OFF_NO_WP = -0x1
TCP_REPAIR_ON = 0x1
TCP_REPAIR_OPTIONS = 0x16 TCP_REPAIR_OPTIONS = 0x16
TCP_REPAIR_QUEUE = 0x14 TCP_REPAIR_QUEUE = 0x14
TCP_REPAIR_WINDOW = 0x1d TCP_REPAIR_WINDOW = 0x1d
@ -2098,6 +2112,7 @@ const (
TCP_ULP = 0x1f TCP_ULP = 0x1f
TCP_USER_TIMEOUT = 0x12 TCP_USER_TIMEOUT = 0x12
TCP_WINDOW_CLAMP = 0xa TCP_WINDOW_CLAMP = 0xa
TCP_ZEROCOPY_RECEIVE = 0x23
TCSAFLUSH = 0x5410 TCSAFLUSH = 0x5410
TCSBRK = 0x5405 TCSBRK = 0x5405
TCSBRKP = 0x5486 TCSBRKP = 0x5486

View File

@ -41,7 +41,7 @@ const (
AF_KEY = 0xf AF_KEY = 0xf
AF_LLC = 0x1a AF_LLC = 0x1a
AF_LOCAL = 0x1 AF_LOCAL = 0x1
AF_MAX = 0x2c AF_MAX = 0x2d
AF_MPLS = 0x1c AF_MPLS = 0x1c
AF_NETBEUI = 0xd AF_NETBEUI = 0xd
AF_NETLINK = 0x10 AF_NETLINK = 0x10
@ -706,6 +706,7 @@ const (
IN_ISDIR = 0x40000000 IN_ISDIR = 0x40000000
IN_LOOPBACKNET = 0x7f IN_LOOPBACKNET = 0x7f
IN_MASK_ADD = 0x20000000 IN_MASK_ADD = 0x20000000
IN_MASK_CREATE = 0x10000000
IN_MODIFY = 0x2 IN_MODIFY = 0x2
IN_MOVE = 0xc0 IN_MOVE = 0xc0
IN_MOVED_FROM = 0x40 IN_MOVED_FROM = 0x40
@ -777,6 +778,7 @@ const (
IPV6_MINHOPCOUNT = 0x49 IPV6_MINHOPCOUNT = 0x49
IPV6_MTU = 0x18 IPV6_MTU = 0x18
IPV6_MTU_DISCOVER = 0x17 IPV6_MTU_DISCOVER = 0x17
IPV6_MULTICAST_ALL = 0x1d
IPV6_MULTICAST_HOPS = 0x12 IPV6_MULTICAST_HOPS = 0x12
IPV6_MULTICAST_IF = 0x11 IPV6_MULTICAST_IF = 0x11
IPV6_MULTICAST_LOOP = 0x13 IPV6_MULTICAST_LOOP = 0x13
@ -1537,6 +1539,13 @@ const (
RLIMIT_SIGPENDING = 0xb RLIMIT_SIGPENDING = 0xb
RLIMIT_STACK = 0x3 RLIMIT_STACK = 0x3
RLIM_INFINITY = 0xffffffffffffffff RLIM_INFINITY = 0xffffffffffffffff
RNDADDENTROPY = 0x80085203
RNDADDTOENTCNT = 0x80045201
RNDCLEARPOOL = 0x20005206
RNDGETENTCNT = 0x40045200
RNDGETPOOL = 0x40085202
RNDRESEEDCRNG = 0x20005207
RNDZAPENTCNT = 0x20005204
RTAX_ADVMSS = 0x8 RTAX_ADVMSS = 0x8
RTAX_CC_ALGO = 0x10 RTAX_CC_ALGO = 0x10
RTAX_CWND = 0x7 RTAX_CWND = 0x7
@ -2051,6 +2060,7 @@ const (
TCOOFF = 0x0 TCOOFF = 0x0
TCOON = 0x1 TCOON = 0x1
TCP_CC_INFO = 0x1a TCP_CC_INFO = 0x1a
TCP_CM_INQ = 0x24
TCP_CONGESTION = 0xd TCP_CONGESTION = 0xd
TCP_COOKIE_IN_ALWAYS = 0x1 TCP_COOKIE_IN_ALWAYS = 0x1
TCP_COOKIE_MAX = 0x10 TCP_COOKIE_MAX = 0x10
@ -2065,6 +2075,7 @@ const (
TCP_FASTOPEN_KEY = 0x21 TCP_FASTOPEN_KEY = 0x21
TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_FASTOPEN_NO_COOKIE = 0x22
TCP_INFO = 0xb TCP_INFO = 0xb
TCP_INQ = 0x24
TCP_KEEPCNT = 0x6 TCP_KEEPCNT = 0x6
TCP_KEEPIDLE = 0x4 TCP_KEEPIDLE = 0x4
TCP_KEEPINTVL = 0x5 TCP_KEEPINTVL = 0x5
@ -2084,6 +2095,9 @@ const (
TCP_QUEUE_SEQ = 0x15 TCP_QUEUE_SEQ = 0x15
TCP_QUICKACK = 0xc TCP_QUICKACK = 0xc
TCP_REPAIR = 0x13 TCP_REPAIR = 0x13
TCP_REPAIR_OFF = 0x0
TCP_REPAIR_OFF_NO_WP = -0x1
TCP_REPAIR_ON = 0x1
TCP_REPAIR_OPTIONS = 0x16 TCP_REPAIR_OPTIONS = 0x16
TCP_REPAIR_QUEUE = 0x14 TCP_REPAIR_QUEUE = 0x14
TCP_REPAIR_WINDOW = 0x1d TCP_REPAIR_WINDOW = 0x1d
@ -2098,6 +2112,7 @@ const (
TCP_ULP = 0x1f TCP_ULP = 0x1f
TCP_USER_TIMEOUT = 0x12 TCP_USER_TIMEOUT = 0x12
TCP_WINDOW_CLAMP = 0xa TCP_WINDOW_CLAMP = 0xa
TCP_ZEROCOPY_RECEIVE = 0x23
TCSAFLUSH = 0x5410 TCSAFLUSH = 0x5410
TCSBRK = 0x5405 TCSBRK = 0x5405
TCSBRKP = 0x5486 TCSBRKP = 0x5486

View File

@ -41,7 +41,7 @@ const (
AF_KEY = 0xf AF_KEY = 0xf
AF_LLC = 0x1a AF_LLC = 0x1a
AF_LOCAL = 0x1 AF_LOCAL = 0x1
AF_MAX = 0x2c AF_MAX = 0x2d
AF_MPLS = 0x1c AF_MPLS = 0x1c
AF_NETBEUI = 0xd AF_NETBEUI = 0xd
AF_NETLINK = 0x10 AF_NETLINK = 0x10
@ -706,6 +706,7 @@ const (
IN_ISDIR = 0x40000000 IN_ISDIR = 0x40000000
IN_LOOPBACKNET = 0x7f IN_LOOPBACKNET = 0x7f
IN_MASK_ADD = 0x20000000 IN_MASK_ADD = 0x20000000
IN_MASK_CREATE = 0x10000000
IN_MODIFY = 0x2 IN_MODIFY = 0x2
IN_MOVE = 0xc0 IN_MOVE = 0xc0
IN_MOVED_FROM = 0x40 IN_MOVED_FROM = 0x40
@ -777,6 +778,7 @@ const (
IPV6_MINHOPCOUNT = 0x49 IPV6_MINHOPCOUNT = 0x49
IPV6_MTU = 0x18 IPV6_MTU = 0x18
IPV6_MTU_DISCOVER = 0x17 IPV6_MTU_DISCOVER = 0x17
IPV6_MULTICAST_ALL = 0x1d
IPV6_MULTICAST_HOPS = 0x12 IPV6_MULTICAST_HOPS = 0x12
IPV6_MULTICAST_IF = 0x11 IPV6_MULTICAST_IF = 0x11
IPV6_MULTICAST_LOOP = 0x13 IPV6_MULTICAST_LOOP = 0x13
@ -1537,6 +1539,13 @@ const (
RLIMIT_SIGPENDING = 0xb RLIMIT_SIGPENDING = 0xb
RLIMIT_STACK = 0x3 RLIMIT_STACK = 0x3
RLIM_INFINITY = 0xffffffffffffffff RLIM_INFINITY = 0xffffffffffffffff
RNDADDENTROPY = 0x80085203
RNDADDTOENTCNT = 0x80045201
RNDCLEARPOOL = 0x20005206
RNDGETENTCNT = 0x40045200
RNDGETPOOL = 0x40085202
RNDRESEEDCRNG = 0x20005207
RNDZAPENTCNT = 0x20005204
RTAX_ADVMSS = 0x8 RTAX_ADVMSS = 0x8
RTAX_CC_ALGO = 0x10 RTAX_CC_ALGO = 0x10
RTAX_CWND = 0x7 RTAX_CWND = 0x7
@ -2051,6 +2060,7 @@ const (
TCOOFF = 0x0 TCOOFF = 0x0
TCOON = 0x1 TCOON = 0x1
TCP_CC_INFO = 0x1a TCP_CC_INFO = 0x1a
TCP_CM_INQ = 0x24
TCP_CONGESTION = 0xd TCP_CONGESTION = 0xd
TCP_COOKIE_IN_ALWAYS = 0x1 TCP_COOKIE_IN_ALWAYS = 0x1
TCP_COOKIE_MAX = 0x10 TCP_COOKIE_MAX = 0x10
@ -2065,6 +2075,7 @@ const (
TCP_FASTOPEN_KEY = 0x21 TCP_FASTOPEN_KEY = 0x21
TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_FASTOPEN_NO_COOKIE = 0x22
TCP_INFO = 0xb TCP_INFO = 0xb
TCP_INQ = 0x24
TCP_KEEPCNT = 0x6 TCP_KEEPCNT = 0x6
TCP_KEEPIDLE = 0x4 TCP_KEEPIDLE = 0x4
TCP_KEEPINTVL = 0x5 TCP_KEEPINTVL = 0x5
@ -2084,6 +2095,9 @@ const (
TCP_QUEUE_SEQ = 0x15 TCP_QUEUE_SEQ = 0x15
TCP_QUICKACK = 0xc TCP_QUICKACK = 0xc
TCP_REPAIR = 0x13 TCP_REPAIR = 0x13
TCP_REPAIR_OFF = 0x0
TCP_REPAIR_OFF_NO_WP = -0x1
TCP_REPAIR_ON = 0x1
TCP_REPAIR_OPTIONS = 0x16 TCP_REPAIR_OPTIONS = 0x16
TCP_REPAIR_QUEUE = 0x14 TCP_REPAIR_QUEUE = 0x14
TCP_REPAIR_WINDOW = 0x1d TCP_REPAIR_WINDOW = 0x1d
@ -2098,6 +2112,7 @@ const (
TCP_ULP = 0x1f TCP_ULP = 0x1f
TCP_USER_TIMEOUT = 0x12 TCP_USER_TIMEOUT = 0x12
TCP_WINDOW_CLAMP = 0xa TCP_WINDOW_CLAMP = 0xa
TCP_ZEROCOPY_RECEIVE = 0x23
TCSAFLUSH = 0x5410 TCSAFLUSH = 0x5410
TCSBRK = 0x5405 TCSBRK = 0x5405
TCSBRKP = 0x5486 TCSBRKP = 0x5486

View File

@ -41,7 +41,7 @@ const (
AF_KEY = 0xf AF_KEY = 0xf
AF_LLC = 0x1a AF_LLC = 0x1a
AF_LOCAL = 0x1 AF_LOCAL = 0x1
AF_MAX = 0x2c AF_MAX = 0x2d
AF_MPLS = 0x1c AF_MPLS = 0x1c
AF_NETBEUI = 0xd AF_NETBEUI = 0xd
AF_NETLINK = 0x10 AF_NETLINK = 0x10
@ -706,6 +706,7 @@ const (
IN_ISDIR = 0x40000000 IN_ISDIR = 0x40000000
IN_LOOPBACKNET = 0x7f IN_LOOPBACKNET = 0x7f
IN_MASK_ADD = 0x20000000 IN_MASK_ADD = 0x20000000
IN_MASK_CREATE = 0x10000000
IN_MODIFY = 0x2 IN_MODIFY = 0x2
IN_MOVE = 0xc0 IN_MOVE = 0xc0
IN_MOVED_FROM = 0x40 IN_MOVED_FROM = 0x40
@ -777,6 +778,7 @@ const (
IPV6_MINHOPCOUNT = 0x49 IPV6_MINHOPCOUNT = 0x49
IPV6_MTU = 0x18 IPV6_MTU = 0x18
IPV6_MTU_DISCOVER = 0x17 IPV6_MTU_DISCOVER = 0x17
IPV6_MULTICAST_ALL = 0x1d
IPV6_MULTICAST_HOPS = 0x12 IPV6_MULTICAST_HOPS = 0x12
IPV6_MULTICAST_IF = 0x11 IPV6_MULTICAST_IF = 0x11
IPV6_MULTICAST_LOOP = 0x13 IPV6_MULTICAST_LOOP = 0x13
@ -1537,6 +1539,13 @@ const (
RLIMIT_SIGPENDING = 0xb RLIMIT_SIGPENDING = 0xb
RLIMIT_STACK = 0x3 RLIMIT_STACK = 0x3
RLIM_INFINITY = 0xffffffffffffffff RLIM_INFINITY = 0xffffffffffffffff
RNDADDENTROPY = 0x80085203
RNDADDTOENTCNT = 0x80045201
RNDCLEARPOOL = 0x20005206
RNDGETENTCNT = 0x40045200
RNDGETPOOL = 0x40085202
RNDRESEEDCRNG = 0x20005207
RNDZAPENTCNT = 0x20005204
RTAX_ADVMSS = 0x8 RTAX_ADVMSS = 0x8
RTAX_CC_ALGO = 0x10 RTAX_CC_ALGO = 0x10
RTAX_CWND = 0x7 RTAX_CWND = 0x7
@ -2051,6 +2060,7 @@ const (
TCOOFF = 0x0 TCOOFF = 0x0
TCOON = 0x1 TCOON = 0x1
TCP_CC_INFO = 0x1a TCP_CC_INFO = 0x1a
TCP_CM_INQ = 0x24
TCP_CONGESTION = 0xd TCP_CONGESTION = 0xd
TCP_COOKIE_IN_ALWAYS = 0x1 TCP_COOKIE_IN_ALWAYS = 0x1
TCP_COOKIE_MAX = 0x10 TCP_COOKIE_MAX = 0x10
@ -2065,6 +2075,7 @@ const (
TCP_FASTOPEN_KEY = 0x21 TCP_FASTOPEN_KEY = 0x21
TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_FASTOPEN_NO_COOKIE = 0x22
TCP_INFO = 0xb TCP_INFO = 0xb
TCP_INQ = 0x24
TCP_KEEPCNT = 0x6 TCP_KEEPCNT = 0x6
TCP_KEEPIDLE = 0x4 TCP_KEEPIDLE = 0x4
TCP_KEEPINTVL = 0x5 TCP_KEEPINTVL = 0x5
@ -2084,6 +2095,9 @@ const (
TCP_QUEUE_SEQ = 0x15 TCP_QUEUE_SEQ = 0x15
TCP_QUICKACK = 0xc TCP_QUICKACK = 0xc
TCP_REPAIR = 0x13 TCP_REPAIR = 0x13
TCP_REPAIR_OFF = 0x0
TCP_REPAIR_OFF_NO_WP = -0x1
TCP_REPAIR_ON = 0x1
TCP_REPAIR_OPTIONS = 0x16 TCP_REPAIR_OPTIONS = 0x16
TCP_REPAIR_QUEUE = 0x14 TCP_REPAIR_QUEUE = 0x14
TCP_REPAIR_WINDOW = 0x1d TCP_REPAIR_WINDOW = 0x1d
@ -2098,6 +2112,7 @@ const (
TCP_ULP = 0x1f TCP_ULP = 0x1f
TCP_USER_TIMEOUT = 0x12 TCP_USER_TIMEOUT = 0x12
TCP_WINDOW_CLAMP = 0xa TCP_WINDOW_CLAMP = 0xa
TCP_ZEROCOPY_RECEIVE = 0x23
TCSAFLUSH = 0x5410 TCSAFLUSH = 0x5410
TCSBRK = 0x5405 TCSBRK = 0x5405
TCSBRKP = 0x5486 TCSBRKP = 0x5486

View File

@ -41,7 +41,7 @@ const (
AF_KEY = 0xf AF_KEY = 0xf
AF_LLC = 0x1a AF_LLC = 0x1a
AF_LOCAL = 0x1 AF_LOCAL = 0x1
AF_MAX = 0x2c AF_MAX = 0x2d
AF_MPLS = 0x1c AF_MPLS = 0x1c
AF_NETBEUI = 0xd AF_NETBEUI = 0xd
AF_NETLINK = 0x10 AF_NETLINK = 0x10
@ -706,6 +706,7 @@ const (
IN_ISDIR = 0x40000000 IN_ISDIR = 0x40000000
IN_LOOPBACKNET = 0x7f IN_LOOPBACKNET = 0x7f
IN_MASK_ADD = 0x20000000 IN_MASK_ADD = 0x20000000
IN_MASK_CREATE = 0x10000000
IN_MODIFY = 0x2 IN_MODIFY = 0x2
IN_MOVE = 0xc0 IN_MOVE = 0xc0
IN_MOVED_FROM = 0x40 IN_MOVED_FROM = 0x40
@ -777,6 +778,7 @@ const (
IPV6_MINHOPCOUNT = 0x49 IPV6_MINHOPCOUNT = 0x49
IPV6_MTU = 0x18 IPV6_MTU = 0x18
IPV6_MTU_DISCOVER = 0x17 IPV6_MTU_DISCOVER = 0x17
IPV6_MULTICAST_ALL = 0x1d
IPV6_MULTICAST_HOPS = 0x12 IPV6_MULTICAST_HOPS = 0x12
IPV6_MULTICAST_IF = 0x11 IPV6_MULTICAST_IF = 0x11
IPV6_MULTICAST_LOOP = 0x13 IPV6_MULTICAST_LOOP = 0x13
@ -1595,6 +1597,13 @@ const (
RLIMIT_SIGPENDING = 0xb RLIMIT_SIGPENDING = 0xb
RLIMIT_STACK = 0x3 RLIMIT_STACK = 0x3
RLIM_INFINITY = 0xffffffffffffffff RLIM_INFINITY = 0xffffffffffffffff
RNDADDENTROPY = 0x80085203
RNDADDTOENTCNT = 0x80045201
RNDCLEARPOOL = 0x20005206
RNDGETENTCNT = 0x40045200
RNDGETPOOL = 0x40085202
RNDRESEEDCRNG = 0x20005207
RNDZAPENTCNT = 0x20005204
RTAX_ADVMSS = 0x8 RTAX_ADVMSS = 0x8
RTAX_CC_ALGO = 0x10 RTAX_CC_ALGO = 0x10
RTAX_CWND = 0x7 RTAX_CWND = 0x7
@ -2107,6 +2116,7 @@ const (
TCOOFF = 0x0 TCOOFF = 0x0
TCOON = 0x1 TCOON = 0x1
TCP_CC_INFO = 0x1a TCP_CC_INFO = 0x1a
TCP_CM_INQ = 0x24
TCP_CONGESTION = 0xd TCP_CONGESTION = 0xd
TCP_COOKIE_IN_ALWAYS = 0x1 TCP_COOKIE_IN_ALWAYS = 0x1
TCP_COOKIE_MAX = 0x10 TCP_COOKIE_MAX = 0x10
@ -2121,6 +2131,7 @@ const (
TCP_FASTOPEN_KEY = 0x21 TCP_FASTOPEN_KEY = 0x21
TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_FASTOPEN_NO_COOKIE = 0x22
TCP_INFO = 0xb TCP_INFO = 0xb
TCP_INQ = 0x24
TCP_KEEPCNT = 0x6 TCP_KEEPCNT = 0x6
TCP_KEEPIDLE = 0x4 TCP_KEEPIDLE = 0x4
TCP_KEEPINTVL = 0x5 TCP_KEEPINTVL = 0x5
@ -2140,6 +2151,9 @@ const (
TCP_QUEUE_SEQ = 0x15 TCP_QUEUE_SEQ = 0x15
TCP_QUICKACK = 0xc TCP_QUICKACK = 0xc
TCP_REPAIR = 0x13 TCP_REPAIR = 0x13
TCP_REPAIR_OFF = 0x0
TCP_REPAIR_OFF_NO_WP = -0x1
TCP_REPAIR_ON = 0x1
TCP_REPAIR_OPTIONS = 0x16 TCP_REPAIR_OPTIONS = 0x16
TCP_REPAIR_QUEUE = 0x14 TCP_REPAIR_QUEUE = 0x14
TCP_REPAIR_WINDOW = 0x1d TCP_REPAIR_WINDOW = 0x1d
@ -2154,6 +2168,7 @@ const (
TCP_ULP = 0x1f TCP_ULP = 0x1f
TCP_USER_TIMEOUT = 0x12 TCP_USER_TIMEOUT = 0x12
TCP_WINDOW_CLAMP = 0xa TCP_WINDOW_CLAMP = 0xa
TCP_ZEROCOPY_RECEIVE = 0x23
TCSAFLUSH = 0x2 TCSAFLUSH = 0x2
TCSBRK = 0x2000741d TCSBRK = 0x2000741d
TCSBRKP = 0x5425 TCSBRKP = 0x5425

View File

@ -41,7 +41,7 @@ const (
AF_KEY = 0xf AF_KEY = 0xf
AF_LLC = 0x1a AF_LLC = 0x1a
AF_LOCAL = 0x1 AF_LOCAL = 0x1
AF_MAX = 0x2c AF_MAX = 0x2d
AF_MPLS = 0x1c AF_MPLS = 0x1c
AF_NETBEUI = 0xd AF_NETBEUI = 0xd
AF_NETLINK = 0x10 AF_NETLINK = 0x10
@ -706,6 +706,7 @@ const (
IN_ISDIR = 0x40000000 IN_ISDIR = 0x40000000
IN_LOOPBACKNET = 0x7f IN_LOOPBACKNET = 0x7f
IN_MASK_ADD = 0x20000000 IN_MASK_ADD = 0x20000000
IN_MASK_CREATE = 0x10000000
IN_MODIFY = 0x2 IN_MODIFY = 0x2
IN_MOVE = 0xc0 IN_MOVE = 0xc0
IN_MOVED_FROM = 0x40 IN_MOVED_FROM = 0x40
@ -777,6 +778,7 @@ const (
IPV6_MINHOPCOUNT = 0x49 IPV6_MINHOPCOUNT = 0x49
IPV6_MTU = 0x18 IPV6_MTU = 0x18
IPV6_MTU_DISCOVER = 0x17 IPV6_MTU_DISCOVER = 0x17
IPV6_MULTICAST_ALL = 0x1d
IPV6_MULTICAST_HOPS = 0x12 IPV6_MULTICAST_HOPS = 0x12
IPV6_MULTICAST_IF = 0x11 IPV6_MULTICAST_IF = 0x11
IPV6_MULTICAST_LOOP = 0x13 IPV6_MULTICAST_LOOP = 0x13
@ -1595,6 +1597,13 @@ const (
RLIMIT_SIGPENDING = 0xb RLIMIT_SIGPENDING = 0xb
RLIMIT_STACK = 0x3 RLIMIT_STACK = 0x3
RLIM_INFINITY = 0xffffffffffffffff RLIM_INFINITY = 0xffffffffffffffff
RNDADDENTROPY = 0x80085203
RNDADDTOENTCNT = 0x80045201
RNDCLEARPOOL = 0x20005206
RNDGETENTCNT = 0x40045200
RNDGETPOOL = 0x40085202
RNDRESEEDCRNG = 0x20005207
RNDZAPENTCNT = 0x20005204
RTAX_ADVMSS = 0x8 RTAX_ADVMSS = 0x8
RTAX_CC_ALGO = 0x10 RTAX_CC_ALGO = 0x10
RTAX_CWND = 0x7 RTAX_CWND = 0x7
@ -2107,6 +2116,7 @@ const (
TCOOFF = 0x0 TCOOFF = 0x0
TCOON = 0x1 TCOON = 0x1
TCP_CC_INFO = 0x1a TCP_CC_INFO = 0x1a
TCP_CM_INQ = 0x24
TCP_CONGESTION = 0xd TCP_CONGESTION = 0xd
TCP_COOKIE_IN_ALWAYS = 0x1 TCP_COOKIE_IN_ALWAYS = 0x1
TCP_COOKIE_MAX = 0x10 TCP_COOKIE_MAX = 0x10
@ -2121,6 +2131,7 @@ const (
TCP_FASTOPEN_KEY = 0x21 TCP_FASTOPEN_KEY = 0x21
TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_FASTOPEN_NO_COOKIE = 0x22
TCP_INFO = 0xb TCP_INFO = 0xb
TCP_INQ = 0x24
TCP_KEEPCNT = 0x6 TCP_KEEPCNT = 0x6
TCP_KEEPIDLE = 0x4 TCP_KEEPIDLE = 0x4
TCP_KEEPINTVL = 0x5 TCP_KEEPINTVL = 0x5
@ -2140,6 +2151,9 @@ const (
TCP_QUEUE_SEQ = 0x15 TCP_QUEUE_SEQ = 0x15
TCP_QUICKACK = 0xc TCP_QUICKACK = 0xc
TCP_REPAIR = 0x13 TCP_REPAIR = 0x13
TCP_REPAIR_OFF = 0x0
TCP_REPAIR_OFF_NO_WP = -0x1
TCP_REPAIR_ON = 0x1
TCP_REPAIR_OPTIONS = 0x16 TCP_REPAIR_OPTIONS = 0x16
TCP_REPAIR_QUEUE = 0x14 TCP_REPAIR_QUEUE = 0x14
TCP_REPAIR_WINDOW = 0x1d TCP_REPAIR_WINDOW = 0x1d
@ -2154,6 +2168,7 @@ const (
TCP_ULP = 0x1f TCP_ULP = 0x1f
TCP_USER_TIMEOUT = 0x12 TCP_USER_TIMEOUT = 0x12
TCP_WINDOW_CLAMP = 0xa TCP_WINDOW_CLAMP = 0xa
TCP_ZEROCOPY_RECEIVE = 0x23
TCSAFLUSH = 0x2 TCSAFLUSH = 0x2
TCSBRK = 0x2000741d TCSBRK = 0x2000741d
TCSBRKP = 0x5425 TCSBRKP = 0x5425

View File

@ -41,7 +41,7 @@ const (
AF_KEY = 0xf AF_KEY = 0xf
AF_LLC = 0x1a AF_LLC = 0x1a
AF_LOCAL = 0x1 AF_LOCAL = 0x1
AF_MAX = 0x2c AF_MAX = 0x2d
AF_MPLS = 0x1c AF_MPLS = 0x1c
AF_NETBEUI = 0xd AF_NETBEUI = 0xd
AF_NETLINK = 0x10 AF_NETLINK = 0x10
@ -706,6 +706,7 @@ const (
IN_ISDIR = 0x40000000 IN_ISDIR = 0x40000000
IN_LOOPBACKNET = 0x7f IN_LOOPBACKNET = 0x7f
IN_MASK_ADD = 0x20000000 IN_MASK_ADD = 0x20000000
IN_MASK_CREATE = 0x10000000
IN_MODIFY = 0x2 IN_MODIFY = 0x2
IN_MOVE = 0xc0 IN_MOVE = 0xc0
IN_MOVED_FROM = 0x40 IN_MOVED_FROM = 0x40
@ -777,6 +778,7 @@ const (
IPV6_MINHOPCOUNT = 0x49 IPV6_MINHOPCOUNT = 0x49
IPV6_MTU = 0x18 IPV6_MTU = 0x18
IPV6_MTU_DISCOVER = 0x17 IPV6_MTU_DISCOVER = 0x17
IPV6_MULTICAST_ALL = 0x1d
IPV6_MULTICAST_HOPS = 0x12 IPV6_MULTICAST_HOPS = 0x12
IPV6_MULTICAST_IF = 0x11 IPV6_MULTICAST_IF = 0x11
IPV6_MULTICAST_LOOP = 0x13 IPV6_MULTICAST_LOOP = 0x13
@ -1525,6 +1527,13 @@ const (
RLIMIT_SIGPENDING = 0xb RLIMIT_SIGPENDING = 0xb
RLIMIT_STACK = 0x3 RLIMIT_STACK = 0x3
RLIM_INFINITY = 0xffffffffffffffff RLIM_INFINITY = 0xffffffffffffffff
RNDADDENTROPY = 0x40085203
RNDADDTOENTCNT = 0x40045201
RNDCLEARPOOL = 0x5206
RNDGETENTCNT = 0x80045200
RNDGETPOOL = 0x80085202
RNDRESEEDCRNG = 0x5207
RNDZAPENTCNT = 0x5204
RTAX_ADVMSS = 0x8 RTAX_ADVMSS = 0x8
RTAX_CC_ALGO = 0x10 RTAX_CC_ALGO = 0x10
RTAX_CWND = 0x7 RTAX_CWND = 0x7
@ -2039,6 +2048,7 @@ const (
TCOOFF = 0x0 TCOOFF = 0x0
TCOON = 0x1 TCOON = 0x1
TCP_CC_INFO = 0x1a TCP_CC_INFO = 0x1a
TCP_CM_INQ = 0x24
TCP_CONGESTION = 0xd TCP_CONGESTION = 0xd
TCP_COOKIE_IN_ALWAYS = 0x1 TCP_COOKIE_IN_ALWAYS = 0x1
TCP_COOKIE_MAX = 0x10 TCP_COOKIE_MAX = 0x10
@ -2053,6 +2063,7 @@ const (
TCP_FASTOPEN_KEY = 0x21 TCP_FASTOPEN_KEY = 0x21
TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_FASTOPEN_NO_COOKIE = 0x22
TCP_INFO = 0xb TCP_INFO = 0xb
TCP_INQ = 0x24
TCP_KEEPCNT = 0x6 TCP_KEEPCNT = 0x6
TCP_KEEPIDLE = 0x4 TCP_KEEPIDLE = 0x4
TCP_KEEPINTVL = 0x5 TCP_KEEPINTVL = 0x5
@ -2072,6 +2083,9 @@ const (
TCP_QUEUE_SEQ = 0x15 TCP_QUEUE_SEQ = 0x15
TCP_QUICKACK = 0xc TCP_QUICKACK = 0xc
TCP_REPAIR = 0x13 TCP_REPAIR = 0x13
TCP_REPAIR_OFF = 0x0
TCP_REPAIR_OFF_NO_WP = -0x1
TCP_REPAIR_ON = 0x1
TCP_REPAIR_OPTIONS = 0x16 TCP_REPAIR_OPTIONS = 0x16
TCP_REPAIR_QUEUE = 0x14 TCP_REPAIR_QUEUE = 0x14
TCP_REPAIR_WINDOW = 0x1d TCP_REPAIR_WINDOW = 0x1d
@ -2086,6 +2100,7 @@ const (
TCP_ULP = 0x1f TCP_ULP = 0x1f
TCP_USER_TIMEOUT = 0x12 TCP_USER_TIMEOUT = 0x12
TCP_WINDOW_CLAMP = 0xa TCP_WINDOW_CLAMP = 0xa
TCP_ZEROCOPY_RECEIVE = 0x23
TCSAFLUSH = 0x2 TCSAFLUSH = 0x2
TCSBRK = 0x5409 TCSBRK = 0x5409
TCSBRKP = 0x5425 TCSBRKP = 0x5425

View File

@ -41,7 +41,7 @@ const (
AF_KEY = 0xf AF_KEY = 0xf
AF_LLC = 0x1a AF_LLC = 0x1a
AF_LOCAL = 0x1 AF_LOCAL = 0x1
AF_MAX = 0x2c AF_MAX = 0x2d
AF_MPLS = 0x1c AF_MPLS = 0x1c
AF_NETBEUI = 0xd AF_NETBEUI = 0xd
AF_NETLINK = 0x10 AF_NETLINK = 0x10
@ -706,6 +706,7 @@ const (
IN_ISDIR = 0x40000000 IN_ISDIR = 0x40000000
IN_LOOPBACKNET = 0x7f IN_LOOPBACKNET = 0x7f
IN_MASK_ADD = 0x20000000 IN_MASK_ADD = 0x20000000
IN_MASK_CREATE = 0x10000000
IN_MODIFY = 0x2 IN_MODIFY = 0x2
IN_MOVE = 0xc0 IN_MOVE = 0xc0
IN_MOVED_FROM = 0x40 IN_MOVED_FROM = 0x40
@ -777,6 +778,7 @@ const (
IPV6_MINHOPCOUNT = 0x49 IPV6_MINHOPCOUNT = 0x49
IPV6_MTU = 0x18 IPV6_MTU = 0x18
IPV6_MTU_DISCOVER = 0x17 IPV6_MTU_DISCOVER = 0x17
IPV6_MULTICAST_ALL = 0x1d
IPV6_MULTICAST_HOPS = 0x12 IPV6_MULTICAST_HOPS = 0x12
IPV6_MULTICAST_IF = 0x11 IPV6_MULTICAST_IF = 0x11
IPV6_MULTICAST_LOOP = 0x13 IPV6_MULTICAST_LOOP = 0x13
@ -1598,6 +1600,13 @@ const (
RLIMIT_SIGPENDING = 0xb RLIMIT_SIGPENDING = 0xb
RLIMIT_STACK = 0x3 RLIMIT_STACK = 0x3
RLIM_INFINITY = 0xffffffffffffffff RLIM_INFINITY = 0xffffffffffffffff
RNDADDENTROPY = 0x40085203
RNDADDTOENTCNT = 0x40045201
RNDCLEARPOOL = 0x5206
RNDGETENTCNT = 0x80045200
RNDGETPOOL = 0x80085202
RNDRESEEDCRNG = 0x5207
RNDZAPENTCNT = 0x5204
RTAX_ADVMSS = 0x8 RTAX_ADVMSS = 0x8
RTAX_CC_ALGO = 0x10 RTAX_CC_ALGO = 0x10
RTAX_CWND = 0x7 RTAX_CWND = 0x7
@ -2112,6 +2121,7 @@ const (
TCOOFF = 0x0 TCOOFF = 0x0
TCOON = 0x1 TCOON = 0x1
TCP_CC_INFO = 0x1a TCP_CC_INFO = 0x1a
TCP_CM_INQ = 0x24
TCP_CONGESTION = 0xd TCP_CONGESTION = 0xd
TCP_COOKIE_IN_ALWAYS = 0x1 TCP_COOKIE_IN_ALWAYS = 0x1
TCP_COOKIE_MAX = 0x10 TCP_COOKIE_MAX = 0x10
@ -2126,6 +2136,7 @@ const (
TCP_FASTOPEN_KEY = 0x21 TCP_FASTOPEN_KEY = 0x21
TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_FASTOPEN_NO_COOKIE = 0x22
TCP_INFO = 0xb TCP_INFO = 0xb
TCP_INQ = 0x24
TCP_KEEPCNT = 0x6 TCP_KEEPCNT = 0x6
TCP_KEEPIDLE = 0x4 TCP_KEEPIDLE = 0x4
TCP_KEEPINTVL = 0x5 TCP_KEEPINTVL = 0x5
@ -2145,6 +2156,9 @@ const (
TCP_QUEUE_SEQ = 0x15 TCP_QUEUE_SEQ = 0x15
TCP_QUICKACK = 0xc TCP_QUICKACK = 0xc
TCP_REPAIR = 0x13 TCP_REPAIR = 0x13
TCP_REPAIR_OFF = 0x0
TCP_REPAIR_OFF_NO_WP = -0x1
TCP_REPAIR_ON = 0x1
TCP_REPAIR_OPTIONS = 0x16 TCP_REPAIR_OPTIONS = 0x16
TCP_REPAIR_QUEUE = 0x14 TCP_REPAIR_QUEUE = 0x14
TCP_REPAIR_WINDOW = 0x1d TCP_REPAIR_WINDOW = 0x1d
@ -2159,6 +2173,7 @@ const (
TCP_ULP = 0x1f TCP_ULP = 0x1f
TCP_USER_TIMEOUT = 0x12 TCP_USER_TIMEOUT = 0x12
TCP_WINDOW_CLAMP = 0xa TCP_WINDOW_CLAMP = 0xa
TCP_ZEROCOPY_RECEIVE = 0x23
TCSAFLUSH = 0x2 TCSAFLUSH = 0x2
TCSBRK = 0x5409 TCSBRK = 0x5409
TCSBRKP = 0x5425 TCSBRKP = 0x5425

View File

@ -41,7 +41,7 @@ const (
AF_KEY = 0xf AF_KEY = 0xf
AF_LLC = 0x1a AF_LLC = 0x1a
AF_LOCAL = 0x1 AF_LOCAL = 0x1
AF_MAX = 0x2c AF_MAX = 0x2d
AF_MPLS = 0x1c AF_MPLS = 0x1c
AF_NETBEUI = 0xd AF_NETBEUI = 0xd
AF_NETLINK = 0x10 AF_NETLINK = 0x10
@ -710,6 +710,7 @@ const (
IN_ISDIR = 0x40000000 IN_ISDIR = 0x40000000
IN_LOOPBACKNET = 0x7f IN_LOOPBACKNET = 0x7f
IN_MASK_ADD = 0x20000000 IN_MASK_ADD = 0x20000000
IN_MASK_CREATE = 0x10000000
IN_MODIFY = 0x2 IN_MODIFY = 0x2
IN_MOVE = 0xc0 IN_MOVE = 0xc0
IN_MOVED_FROM = 0x40 IN_MOVED_FROM = 0x40
@ -781,6 +782,7 @@ const (
IPV6_MINHOPCOUNT = 0x49 IPV6_MINHOPCOUNT = 0x49
IPV6_MTU = 0x18 IPV6_MTU = 0x18
IPV6_MTU_DISCOVER = 0x17 IPV6_MTU_DISCOVER = 0x17
IPV6_MULTICAST_ALL = 0x1d
IPV6_MULTICAST_HOPS = 0x12 IPV6_MULTICAST_HOPS = 0x12
IPV6_MULTICAST_IF = 0x11 IPV6_MULTICAST_IF = 0x11
IPV6_MULTICAST_LOOP = 0x13 IPV6_MULTICAST_LOOP = 0x13
@ -1590,6 +1592,13 @@ const (
RLIMIT_SIGPENDING = 0xb RLIMIT_SIGPENDING = 0xb
RLIMIT_STACK = 0x3 RLIMIT_STACK = 0x3
RLIM_INFINITY = 0xffffffffffffffff RLIM_INFINITY = 0xffffffffffffffff
RNDADDENTROPY = 0x80085203
RNDADDTOENTCNT = 0x80045201
RNDCLEARPOOL = 0x20005206
RNDGETENTCNT = 0x40045200
RNDGETPOOL = 0x40085202
RNDRESEEDCRNG = 0x20005207
RNDZAPENTCNT = 0x20005204
RTAX_ADVMSS = 0x8 RTAX_ADVMSS = 0x8
RTAX_CC_ALGO = 0x10 RTAX_CC_ALGO = 0x10
RTAX_CWND = 0x7 RTAX_CWND = 0x7
@ -2103,6 +2112,7 @@ const (
TCOOFF = 0x0 TCOOFF = 0x0
TCOON = 0x1 TCOON = 0x1
TCP_CC_INFO = 0x1a TCP_CC_INFO = 0x1a
TCP_CM_INQ = 0x24
TCP_CONGESTION = 0xd TCP_CONGESTION = 0xd
TCP_COOKIE_IN_ALWAYS = 0x1 TCP_COOKIE_IN_ALWAYS = 0x1
TCP_COOKIE_MAX = 0x10 TCP_COOKIE_MAX = 0x10
@ -2117,6 +2127,7 @@ const (
TCP_FASTOPEN_KEY = 0x21 TCP_FASTOPEN_KEY = 0x21
TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_FASTOPEN_NO_COOKIE = 0x22
TCP_INFO = 0xb TCP_INFO = 0xb
TCP_INQ = 0x24
TCP_KEEPCNT = 0x6 TCP_KEEPCNT = 0x6
TCP_KEEPIDLE = 0x4 TCP_KEEPIDLE = 0x4
TCP_KEEPINTVL = 0x5 TCP_KEEPINTVL = 0x5
@ -2136,6 +2147,9 @@ const (
TCP_QUEUE_SEQ = 0x15 TCP_QUEUE_SEQ = 0x15
TCP_QUICKACK = 0xc TCP_QUICKACK = 0xc
TCP_REPAIR = 0x13 TCP_REPAIR = 0x13
TCP_REPAIR_OFF = 0x0
TCP_REPAIR_OFF_NO_WP = -0x1
TCP_REPAIR_ON = 0x1
TCP_REPAIR_OPTIONS = 0x16 TCP_REPAIR_OPTIONS = 0x16
TCP_REPAIR_QUEUE = 0x14 TCP_REPAIR_QUEUE = 0x14
TCP_REPAIR_WINDOW = 0x1d TCP_REPAIR_WINDOW = 0x1d
@ -2150,6 +2164,7 @@ const (
TCP_ULP = 0x1f TCP_ULP = 0x1f
TCP_USER_TIMEOUT = 0x12 TCP_USER_TIMEOUT = 0x12
TCP_WINDOW_CLAMP = 0xa TCP_WINDOW_CLAMP = 0xa
TCP_ZEROCOPY_RECEIVE = 0x23
TCSAFLUSH = 0x2 TCSAFLUSH = 0x2
TCSBRK = 0x20005405 TCSBRK = 0x20005405
TCSBRKP = 0x5425 TCSBRKP = 0x5425

View File

@ -943,6 +943,21 @@ func libc_chroot_trampoline()
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ClockGettime(clockid int32, time *Timespec) (err error) {
_, _, e1 := syscall_syscall(funcPC(libc_clock_gettime_trampoline), uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
func libc_clock_gettime_trampoline()
//go:linkname libc_clock_gettime libc_clock_gettime
//go:cgo_import_dynamic libc_clock_gettime clock_gettime "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Close(fd int) (err error) { func Close(fd int) (err error) {
_, _, e1 := syscall_syscall(funcPC(libc_close_trampoline), uintptr(fd), 0, 0) _, _, e1 := syscall_syscall(funcPC(libc_close_trampoline), uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {

View File

@ -108,6 +108,8 @@ TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0
JMP libc_chown(SB) JMP libc_chown(SB)
TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0 TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0
JMP libc_chroot(SB) JMP libc_chroot(SB)
TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0
JMP libc_clock_gettime(SB)
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0 TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
JMP libc_close(SB) JMP libc_close(SB)
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0 TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0

View File

@ -1,4 +1,4 @@
// mksyscall_solaris.pl -tags solaris,amd64 syscall_solaris.go syscall_solaris_amd64.go // go run mksyscall_solaris.go -tags solaris,amd64 syscall_solaris.go syscall_solaris_amd64.go
// Code generated by the command above; see README.md. DO NOT EDIT. // Code generated by the command above; see README.md. DO NOT EDIT.
// +build solaris,amd64 // +build solaris,amd64

View File

@ -1,4 +1,4 @@
// go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/sys/syscall.h // go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/sys/syscall.h
// Code generated by the command above; see README.md. DO NOT EDIT. // Code generated by the command above; see README.md. DO NOT EDIT.
// +build amd64,darwin // +build amd64,darwin
@ -431,6 +431,8 @@ const (
SYS_NTP_ADJTIME = 527 SYS_NTP_ADJTIME = 527
SYS_NTP_GETTIME = 528 SYS_NTP_GETTIME = 528
SYS_OS_FAULT_WITH_PAYLOAD = 529 SYS_OS_FAULT_WITH_PAYLOAD = 529
SYS_MAXSYSCALL = 530 SYS_KQUEUE_WORKLOOP_CTL = 530
SYS___MACH_BRIDGE_REMOTE_TIME = 531
SYS_MAXSYSCALL = 532
SYS_INVALID = 63 SYS_INVALID = 63
) )

View File

@ -405,6 +405,11 @@ type TCPInfo struct {
Total_retrans uint32 Total_retrans uint32
} }
type CanFilter struct {
Id uint32
Mask uint32
}
const ( const (
SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c SizeofSockaddrInet6 = 0x1c
@ -434,6 +439,7 @@ const (
SizeofICMPv6Filter = 0x20 SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc SizeofUcred = 0xc
SizeofTCPInfo = 0x68 SizeofTCPInfo = 0x68
SizeofCanFilter = 0x8
) )
const ( const (
@ -569,6 +575,7 @@ const (
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
) )
type NlMsghdr struct { type NlMsghdr struct {
@ -634,6 +641,17 @@ type RtNexthop struct {
Ifindex int32 Ifindex int32
} }
type NdUseroptmsg struct {
Family uint8
Pad1 uint8
Opts_len uint16
Ifindex int32
Icmp_type uint8
Icmp_code uint8
Pad2 uint16
Pad3 uint32
}
const ( const (
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x8 SizeofSockFprog = 0x8
@ -760,27 +778,30 @@ type Sigset_t struct {
} }
type SignalfdSiginfo struct { type SignalfdSiginfo struct {
Signo uint32 Signo uint32
Errno int32 Errno int32
Code int32 Code int32
Pid uint32 Pid uint32
Uid uint32 Uid uint32
Fd int32 Fd int32
Tid uint32 Tid uint32
Band uint32 Band uint32
Overrun uint32 Overrun uint32
Trapno uint32 Trapno uint32
Status int32 Status int32
Int int32 Int int32
Ptr uint64 Ptr uint64
Utime uint64 Utime uint64
Stime uint64 Stime uint64
Addr uint64 Addr uint64
_ [48]uint8 Addr_lsb uint16
_ uint16
Syscall int32
Call_addr uint64
Arch uint32
_ [28]uint8
} }
const RNDGETENTCNT = 0x80045200
const PERF_IOC_FLAG_GROUP = 0x1 const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct { type Termios struct {

View File

@ -406,6 +406,11 @@ type TCPInfo struct {
Total_retrans uint32 Total_retrans uint32
} }
type CanFilter struct {
Id uint32
Mask uint32
}
const ( const (
SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c SizeofSockaddrInet6 = 0x1c
@ -435,6 +440,7 @@ const (
SizeofICMPv6Filter = 0x20 SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc SizeofUcred = 0xc
SizeofTCPInfo = 0x68 SizeofTCPInfo = 0x68
SizeofCanFilter = 0x8
) )
const ( const (
@ -570,6 +576,7 @@ const (
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
) )
type NlMsghdr struct { type NlMsghdr struct {
@ -635,6 +642,17 @@ type RtNexthop struct {
Ifindex int32 Ifindex int32
} }
type NdUseroptmsg struct {
Family uint8
Pad1 uint8
Opts_len uint16
Ifindex int32
Icmp_type uint8
Icmp_code uint8
Pad2 uint16
Pad3 uint32
}
const ( const (
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x10 SizeofSockFprog = 0x10
@ -773,27 +791,30 @@ type Sigset_t struct {
} }
type SignalfdSiginfo struct { type SignalfdSiginfo struct {
Signo uint32 Signo uint32
Errno int32 Errno int32
Code int32 Code int32
Pid uint32 Pid uint32
Uid uint32 Uid uint32
Fd int32 Fd int32
Tid uint32 Tid uint32
Band uint32 Band uint32
Overrun uint32 Overrun uint32
Trapno uint32 Trapno uint32
Status int32 Status int32
Int int32 Int int32
Ptr uint64 Ptr uint64
Utime uint64 Utime uint64
Stime uint64 Stime uint64
Addr uint64 Addr uint64
_ [48]uint8 Addr_lsb uint16
_ uint16
Syscall int32
Call_addr uint64
Arch uint32
_ [28]uint8
} }
const RNDGETENTCNT = 0x80045200
const PERF_IOC_FLAG_GROUP = 0x1 const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct { type Termios struct {

View File

@ -409,6 +409,11 @@ type TCPInfo struct {
Total_retrans uint32 Total_retrans uint32
} }
type CanFilter struct {
Id uint32
Mask uint32
}
const ( const (
SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c SizeofSockaddrInet6 = 0x1c
@ -438,6 +443,7 @@ const (
SizeofICMPv6Filter = 0x20 SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc SizeofUcred = 0xc
SizeofTCPInfo = 0x68 SizeofTCPInfo = 0x68
SizeofCanFilter = 0x8
) )
const ( const (
@ -573,6 +579,7 @@ const (
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
) )
type NlMsghdr struct { type NlMsghdr struct {
@ -638,6 +645,17 @@ type RtNexthop struct {
Ifindex int32 Ifindex int32
} }
type NdUseroptmsg struct {
Family uint8
Pad1 uint8
Opts_len uint16
Ifindex int32
Icmp_type uint8
Icmp_code uint8
Pad2 uint16
Pad3 uint32
}
const ( const (
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x8 SizeofSockFprog = 0x8
@ -749,27 +767,30 @@ type Sigset_t struct {
} }
type SignalfdSiginfo struct { type SignalfdSiginfo struct {
Signo uint32 Signo uint32
Errno int32 Errno int32
Code int32 Code int32
Pid uint32 Pid uint32
Uid uint32 Uid uint32
Fd int32 Fd int32
Tid uint32 Tid uint32
Band uint32 Band uint32
Overrun uint32 Overrun uint32
Trapno uint32 Trapno uint32
Status int32 Status int32
Int int32 Int int32
Ptr uint64 Ptr uint64
Utime uint64 Utime uint64
Stime uint64 Stime uint64
Addr uint64 Addr uint64
_ [48]uint8 Addr_lsb uint16
_ uint16
Syscall int32
Call_addr uint64
Arch uint32
_ [28]uint8
} }
const RNDGETENTCNT = 0x80045200
const PERF_IOC_FLAG_GROUP = 0x1 const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct { type Termios struct {

View File

@ -407,6 +407,11 @@ type TCPInfo struct {
Total_retrans uint32 Total_retrans uint32
} }
type CanFilter struct {
Id uint32
Mask uint32
}
const ( const (
SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c SizeofSockaddrInet6 = 0x1c
@ -436,6 +441,7 @@ const (
SizeofICMPv6Filter = 0x20 SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc SizeofUcred = 0xc
SizeofTCPInfo = 0x68 SizeofTCPInfo = 0x68
SizeofCanFilter = 0x8
) )
const ( const (
@ -571,6 +577,7 @@ const (
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
) )
type NlMsghdr struct { type NlMsghdr struct {
@ -636,6 +643,17 @@ type RtNexthop struct {
Ifindex int32 Ifindex int32
} }
type NdUseroptmsg struct {
Family uint8
Pad1 uint8
Opts_len uint16
Ifindex int32
Icmp_type uint8
Icmp_code uint8
Pad2 uint16
Pad3 uint32
}
const ( const (
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x10 SizeofSockFprog = 0x10
@ -752,27 +770,30 @@ type Sigset_t struct {
} }
type SignalfdSiginfo struct { type SignalfdSiginfo struct {
Signo uint32 Signo uint32
Errno int32 Errno int32
Code int32 Code int32
Pid uint32 Pid uint32
Uid uint32 Uid uint32
Fd int32 Fd int32
Tid uint32 Tid uint32
Band uint32 Band uint32
Overrun uint32 Overrun uint32
Trapno uint32 Trapno uint32
Status int32 Status int32
Int int32 Int int32
Ptr uint64 Ptr uint64
Utime uint64 Utime uint64
Stime uint64 Stime uint64
Addr uint64 Addr uint64
_ [48]uint8 Addr_lsb uint16
_ uint16
Syscall int32
Call_addr uint64
Arch uint32
_ [28]uint8
} }
const RNDGETENTCNT = 0x80045200
const PERF_IOC_FLAG_GROUP = 0x1 const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct { type Termios struct {

View File

@ -408,6 +408,11 @@ type TCPInfo struct {
Total_retrans uint32 Total_retrans uint32
} }
type CanFilter struct {
Id uint32
Mask uint32
}
const ( const (
SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c SizeofSockaddrInet6 = 0x1c
@ -437,6 +442,7 @@ const (
SizeofICMPv6Filter = 0x20 SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc SizeofUcred = 0xc
SizeofTCPInfo = 0x68 SizeofTCPInfo = 0x68
SizeofCanFilter = 0x8
) )
const ( const (
@ -572,6 +578,7 @@ const (
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
) )
type NlMsghdr struct { type NlMsghdr struct {
@ -637,6 +644,17 @@ type RtNexthop struct {
Ifindex int32 Ifindex int32
} }
type NdUseroptmsg struct {
Family uint8
Pad1 uint8
Opts_len uint16
Ifindex int32
Icmp_type uint8
Icmp_code uint8
Pad2 uint16
Pad3 uint32
}
const ( const (
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x8 SizeofSockFprog = 0x8
@ -754,27 +772,30 @@ type Sigset_t struct {
} }
type SignalfdSiginfo struct { type SignalfdSiginfo struct {
Signo uint32 Signo uint32
Errno int32 Errno int32
Code int32 Code int32
Pid uint32 Pid uint32
Uid uint32 Uid uint32
Fd int32 Fd int32
Tid uint32 Tid uint32
Band uint32 Band uint32
Overrun uint32 Overrun uint32
Trapno uint32 Trapno uint32
Status int32 Status int32
Int int32 Int int32
Ptr uint64 Ptr uint64
Utime uint64 Utime uint64
Stime uint64 Stime uint64
Addr uint64 Addr uint64
_ [48]uint8 Addr_lsb uint16
_ uint16
Syscall int32
Call_addr uint64
Arch uint32
_ [28]uint8
} }
const RNDGETENTCNT = 0x40045200
const PERF_IOC_FLAG_GROUP = 0x1 const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct { type Termios struct {

View File

@ -407,6 +407,11 @@ type TCPInfo struct {
Total_retrans uint32 Total_retrans uint32
} }
type CanFilter struct {
Id uint32
Mask uint32
}
const ( const (
SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c SizeofSockaddrInet6 = 0x1c
@ -436,6 +441,7 @@ const (
SizeofICMPv6Filter = 0x20 SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc SizeofUcred = 0xc
SizeofTCPInfo = 0x68 SizeofTCPInfo = 0x68
SizeofCanFilter = 0x8
) )
const ( const (
@ -571,6 +577,7 @@ const (
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
) )
type NlMsghdr struct { type NlMsghdr struct {
@ -636,6 +643,17 @@ type RtNexthop struct {
Ifindex int32 Ifindex int32
} }
type NdUseroptmsg struct {
Family uint8
Pad1 uint8
Opts_len uint16
Ifindex int32
Icmp_type uint8
Icmp_code uint8
Pad2 uint16
Pad3 uint32
}
const ( const (
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x10 SizeofSockFprog = 0x10
@ -754,27 +772,30 @@ type Sigset_t struct {
} }
type SignalfdSiginfo struct { type SignalfdSiginfo struct {
Signo uint32 Signo uint32
Errno int32 Errno int32
Code int32 Code int32
Pid uint32 Pid uint32
Uid uint32 Uid uint32
Fd int32 Fd int32
Tid uint32 Tid uint32
Band uint32 Band uint32
Overrun uint32 Overrun uint32
Trapno uint32 Trapno uint32
Status int32 Status int32
Int int32 Int int32
Ptr uint64 Ptr uint64
Utime uint64 Utime uint64
Stime uint64 Stime uint64
Addr uint64 Addr uint64
_ [48]uint8 Addr_lsb uint16
_ uint16
Syscall int32
Call_addr uint64
Arch uint32
_ [28]uint8
} }
const RNDGETENTCNT = 0x40045200
const PERF_IOC_FLAG_GROUP = 0x1 const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct { type Termios struct {

View File

@ -407,6 +407,11 @@ type TCPInfo struct {
Total_retrans uint32 Total_retrans uint32
} }
type CanFilter struct {
Id uint32
Mask uint32
}
const ( const (
SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c SizeofSockaddrInet6 = 0x1c
@ -436,6 +441,7 @@ const (
SizeofICMPv6Filter = 0x20 SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc SizeofUcred = 0xc
SizeofTCPInfo = 0x68 SizeofTCPInfo = 0x68
SizeofCanFilter = 0x8
) )
const ( const (
@ -571,6 +577,7 @@ const (
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
) )
type NlMsghdr struct { type NlMsghdr struct {
@ -636,6 +643,17 @@ type RtNexthop struct {
Ifindex int32 Ifindex int32
} }
type NdUseroptmsg struct {
Family uint8
Pad1 uint8
Opts_len uint16
Ifindex int32
Icmp_type uint8
Icmp_code uint8
Pad2 uint16
Pad3 uint32
}
const ( const (
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x10 SizeofSockFprog = 0x10
@ -754,27 +772,30 @@ type Sigset_t struct {
} }
type SignalfdSiginfo struct { type SignalfdSiginfo struct {
Signo uint32 Signo uint32
Errno int32 Errno int32
Code int32 Code int32
Pid uint32 Pid uint32
Uid uint32 Uid uint32
Fd int32 Fd int32
Tid uint32 Tid uint32
Band uint32 Band uint32
Overrun uint32 Overrun uint32
Trapno uint32 Trapno uint32
Status int32 Status int32
Int int32 Int int32
Ptr uint64 Ptr uint64
Utime uint64 Utime uint64
Stime uint64 Stime uint64
Addr uint64 Addr uint64
_ [48]uint8 Addr_lsb uint16
_ uint16
Syscall int32
Call_addr uint64
Arch uint32
_ [28]uint8
} }
const RNDGETENTCNT = 0x40045200
const PERF_IOC_FLAG_GROUP = 0x1 const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct { type Termios struct {

View File

@ -408,6 +408,11 @@ type TCPInfo struct {
Total_retrans uint32 Total_retrans uint32
} }
type CanFilter struct {
Id uint32
Mask uint32
}
const ( const (
SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c SizeofSockaddrInet6 = 0x1c
@ -437,6 +442,7 @@ const (
SizeofICMPv6Filter = 0x20 SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc SizeofUcred = 0xc
SizeofTCPInfo = 0x68 SizeofTCPInfo = 0x68
SizeofCanFilter = 0x8
) )
const ( const (
@ -572,6 +578,7 @@ const (
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
) )
type NlMsghdr struct { type NlMsghdr struct {
@ -637,6 +644,17 @@ type RtNexthop struct {
Ifindex int32 Ifindex int32
} }
type NdUseroptmsg struct {
Family uint8
Pad1 uint8
Opts_len uint16
Ifindex int32
Icmp_type uint8
Icmp_code uint8
Pad2 uint16
Pad3 uint32
}
const ( const (
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x8 SizeofSockFprog = 0x8
@ -754,27 +772,30 @@ type Sigset_t struct {
} }
type SignalfdSiginfo struct { type SignalfdSiginfo struct {
Signo uint32 Signo uint32
Errno int32 Errno int32
Code int32 Code int32
Pid uint32 Pid uint32
Uid uint32 Uid uint32
Fd int32 Fd int32
Tid uint32 Tid uint32
Band uint32 Band uint32
Overrun uint32 Overrun uint32
Trapno uint32 Trapno uint32
Status int32 Status int32
Int int32 Int int32
Ptr uint64 Ptr uint64
Utime uint64 Utime uint64
Stime uint64 Stime uint64
Addr uint64 Addr uint64
_ [48]uint8 Addr_lsb uint16
_ uint16
Syscall int32
Call_addr uint64
Arch uint32
_ [28]uint8
} }
const RNDGETENTCNT = 0x40045200
const PERF_IOC_FLAG_GROUP = 0x1 const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct { type Termios struct {

View File

@ -408,6 +408,11 @@ type TCPInfo struct {
Total_retrans uint32 Total_retrans uint32
} }
type CanFilter struct {
Id uint32
Mask uint32
}
const ( const (
SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c SizeofSockaddrInet6 = 0x1c
@ -437,6 +442,7 @@ const (
SizeofICMPv6Filter = 0x20 SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc SizeofUcred = 0xc
SizeofTCPInfo = 0x68 SizeofTCPInfo = 0x68
SizeofCanFilter = 0x8
) )
const ( const (
@ -572,6 +578,7 @@ const (
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
) )
type NlMsghdr struct { type NlMsghdr struct {
@ -637,6 +644,17 @@ type RtNexthop struct {
Ifindex int32 Ifindex int32
} }
type NdUseroptmsg struct {
Family uint8
Pad1 uint8
Opts_len uint16
Ifindex int32
Icmp_type uint8
Icmp_code uint8
Pad2 uint16
Pad3 uint32
}
const ( const (
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x10 SizeofSockFprog = 0x10
@ -762,27 +780,30 @@ type Sigset_t struct {
} }
type SignalfdSiginfo struct { type SignalfdSiginfo struct {
Signo uint32 Signo uint32
Errno int32 Errno int32
Code int32 Code int32
Pid uint32 Pid uint32
Uid uint32 Uid uint32
Fd int32 Fd int32
Tid uint32 Tid uint32
Band uint32 Band uint32
Overrun uint32 Overrun uint32
Trapno uint32 Trapno uint32
Status int32 Status int32
Int int32 Int int32
Ptr uint64 Ptr uint64
Utime uint64 Utime uint64
Stime uint64 Stime uint64
Addr uint64 Addr uint64
_ [48]uint8 Addr_lsb uint16
_ uint16
Syscall int32
Call_addr uint64
Arch uint32
_ [28]uint8
} }
const RNDGETENTCNT = 0x40045200
const PERF_IOC_FLAG_GROUP = 0x1 const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct { type Termios struct {

View File

@ -408,6 +408,11 @@ type TCPInfo struct {
Total_retrans uint32 Total_retrans uint32
} }
type CanFilter struct {
Id uint32
Mask uint32
}
const ( const (
SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c SizeofSockaddrInet6 = 0x1c
@ -437,6 +442,7 @@ const (
SizeofICMPv6Filter = 0x20 SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc SizeofUcred = 0xc
SizeofTCPInfo = 0x68 SizeofTCPInfo = 0x68
SizeofCanFilter = 0x8
) )
const ( const (
@ -572,6 +578,7 @@ const (
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
) )
type NlMsghdr struct { type NlMsghdr struct {
@ -637,6 +644,17 @@ type RtNexthop struct {
Ifindex int32 Ifindex int32
} }
type NdUseroptmsg struct {
Family uint8
Pad1 uint8
Opts_len uint16
Ifindex int32
Icmp_type uint8
Icmp_code uint8
Pad2 uint16
Pad3 uint32
}
const ( const (
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x10 SizeofSockFprog = 0x10
@ -762,27 +780,30 @@ type Sigset_t struct {
} }
type SignalfdSiginfo struct { type SignalfdSiginfo struct {
Signo uint32 Signo uint32
Errno int32 Errno int32
Code int32 Code int32
Pid uint32 Pid uint32
Uid uint32 Uid uint32
Fd int32 Fd int32
Tid uint32 Tid uint32
Band uint32 Band uint32
Overrun uint32 Overrun uint32
Trapno uint32 Trapno uint32
Status int32 Status int32
Int int32 Int int32
Ptr uint64 Ptr uint64
Utime uint64 Utime uint64
Stime uint64 Stime uint64
Addr uint64 Addr uint64
_ [48]uint8 Addr_lsb uint16
_ uint16
Syscall int32
Call_addr uint64
Arch uint32
_ [28]uint8
} }
const RNDGETENTCNT = 0x40045200
const PERF_IOC_FLAG_GROUP = 0x1 const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct { type Termios struct {

View File

@ -407,6 +407,11 @@ type TCPInfo struct {
Total_retrans uint32 Total_retrans uint32
} }
type CanFilter struct {
Id uint32
Mask uint32
}
const ( const (
SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c SizeofSockaddrInet6 = 0x1c
@ -436,6 +441,7 @@ const (
SizeofICMPv6Filter = 0x20 SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc SizeofUcred = 0xc
SizeofTCPInfo = 0x68 SizeofTCPInfo = 0x68
SizeofCanFilter = 0x8
) )
const ( const (
@ -571,6 +577,7 @@ const (
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
) )
type NlMsghdr struct { type NlMsghdr struct {
@ -636,6 +643,17 @@ type RtNexthop struct {
Ifindex int32 Ifindex int32
} }
type NdUseroptmsg struct {
Family uint8
Pad1 uint8
Opts_len uint16
Ifindex int32
Icmp_type uint8
Icmp_code uint8
Pad2 uint16
Pad3 uint32
}
const ( const (
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x10 SizeofSockFprog = 0x10
@ -779,27 +797,30 @@ type Sigset_t struct {
} }
type SignalfdSiginfo struct { type SignalfdSiginfo struct {
Signo uint32 Signo uint32
Errno int32 Errno int32
Code int32 Code int32
Pid uint32 Pid uint32
Uid uint32 Uid uint32
Fd int32 Fd int32
Tid uint32 Tid uint32
Band uint32 Band uint32
Overrun uint32 Overrun uint32
Trapno uint32 Trapno uint32
Status int32 Status int32
Int int32 Int int32
Ptr uint64 Ptr uint64
Utime uint64 Utime uint64
Stime uint64 Stime uint64
Addr uint64 Addr uint64
_ [48]uint8 Addr_lsb uint16
_ uint16
Syscall int32
Call_addr uint64
Arch uint32
_ [28]uint8
} }
const RNDGETENTCNT = 0x80045200
const PERF_IOC_FLAG_GROUP = 0x1 const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct { type Termios struct {

View File

@ -406,6 +406,11 @@ type TCPInfo struct {
Total_retrans uint32 Total_retrans uint32
} }
type CanFilter struct {
Id uint32
Mask uint32
}
const ( const (
SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c SizeofSockaddrInet6 = 0x1c
@ -435,6 +440,7 @@ const (
SizeofICMPv6Filter = 0x20 SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc SizeofUcred = 0xc
SizeofTCPInfo = 0x68 SizeofTCPInfo = 0x68
SizeofCanFilter = 0x8
) )
const ( const (
@ -570,6 +576,7 @@ const (
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
) )
type NlMsghdr struct { type NlMsghdr struct {
@ -635,6 +642,17 @@ type RtNexthop struct {
Ifindex int32 Ifindex int32
} }
type NdUseroptmsg struct {
Family uint8
Pad1 uint8
Opts_len uint16
Ifindex int32
Icmp_type uint8
Icmp_code uint8
Pad2 uint16
Pad3 uint32
}
const ( const (
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x10 SizeofSockFprog = 0x10
@ -775,27 +793,30 @@ type Sigset_t struct {
} }
type SignalfdSiginfo struct { type SignalfdSiginfo struct {
Signo uint32 Signo uint32
Errno int32 Errno int32
Code int32 Code int32
Pid uint32 Pid uint32
Uid uint32 Uid uint32
Fd int32 Fd int32
Tid uint32 Tid uint32
Band uint32 Band uint32
Overrun uint32 Overrun uint32
Trapno uint32 Trapno uint32
Status int32 Status int32
Int int32 Int int32
Ptr uint64 Ptr uint64
Utime uint64 Utime uint64
Stime uint64 Stime uint64
Addr uint64 Addr uint64
_ [48]uint8 Addr_lsb uint16
_ uint16
Syscall int32
Call_addr uint64
Arch uint32
_ [28]uint8
} }
const RNDGETENTCNT = 0x80045200
const PERF_IOC_FLAG_GROUP = 0x1 const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct { type Termios struct {

View File

@ -410,6 +410,11 @@ type TCPInfo struct {
Total_retrans uint32 Total_retrans uint32
} }
type CanFilter struct {
Id uint32
Mask uint32
}
const ( const (
SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c SizeofSockaddrInet6 = 0x1c
@ -439,6 +444,7 @@ const (
SizeofICMPv6Filter = 0x20 SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc SizeofUcred = 0xc
SizeofTCPInfo = 0x68 SizeofTCPInfo = 0x68
SizeofCanFilter = 0x8
) )
const ( const (
@ -574,6 +580,7 @@ const (
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
) )
type NlMsghdr struct { type NlMsghdr struct {
@ -639,6 +646,17 @@ type RtNexthop struct {
Ifindex int32 Ifindex int32
} }
type NdUseroptmsg struct {
Family uint8
Pad1 uint8
Opts_len uint16
Ifindex int32
Icmp_type uint8
Icmp_code uint8
Pad2 uint16
Pad3 uint32
}
const ( const (
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x10 SizeofSockFprog = 0x10
@ -757,27 +775,30 @@ type Sigset_t struct {
} }
type SignalfdSiginfo struct { type SignalfdSiginfo struct {
Signo uint32 Signo uint32
Errno int32 Errno int32
Code int32 Code int32
Pid uint32 Pid uint32
Uid uint32 Uid uint32
Fd int32 Fd int32
Tid uint32 Tid uint32
Band uint32 Band uint32
Overrun uint32 Overrun uint32
Trapno uint32 Trapno uint32
Status int32 Status int32
Int int32 Int int32
Ptr uint64 Ptr uint64
Utime uint64 Utime uint64
Stime uint64 Stime uint64
Addr uint64 Addr uint64
_ [48]uint8 Addr_lsb uint16
_ uint16
Syscall int32
Call_addr uint64
Arch uint32
_ [28]uint8
} }
const RNDGETENTCNT = 0x40045200
const PERF_IOC_FLAG_GROUP = 0x1 const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct { type Termios struct {

View File

@ -149,7 +149,7 @@ const (
DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS = 0x22b DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS = 0x22b
DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS = 0x22c DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS = 0x22c
DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS = 0x22d DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS = 0x22d
DOMAIN_ALIAS_RID_MONITORING_USERS = 0X22e DOMAIN_ALIAS_RID_MONITORING_USERS = 0x22e
DOMAIN_ALIAS_RID_LOGGING_USERS = 0x22f DOMAIN_ALIAS_RID_LOGGING_USERS = 0x22f
DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS = 0x230 DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS = 0x230
DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS = 0x231 DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS = 0x231

View File

@ -172,6 +172,7 @@ func NewCallbackCDecl(fn interface{}) uintptr {
//sys GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error) //sys GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error)
//sys DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) //sys DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error)
//sys WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) [failretval==0xffffffff] //sys WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) [failretval==0xffffffff]
//sys waitForMultipleObjects(count uint32, handles uintptr, waitAll bool, waitMilliseconds uint32) (event uint32, err error) [failretval==0xffffffff] = WaitForMultipleObjects
//sys GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) = GetTempPathW //sys GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) = GetTempPathW
//sys CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) //sys CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error)
//sys GetFileType(filehandle Handle) (n uint32, err error) //sys GetFileType(filehandle Handle) (n uint32, err error)
@ -589,6 +590,18 @@ func LoadSetFileCompletionNotificationModes() error {
return procSetFileCompletionNotificationModes.Find() return procSetFileCompletionNotificationModes.Find()
} }
func WaitForMultipleObjects(handles []Handle, waitAll bool, waitMilliseconds uint32) (event uint32, err error) {
// Every other win32 array API takes arguments as "pointer, count", except for this function. So we
// can't declare it as a usual [] type, because mksyscall will use the opposite order. We therefore
// trivially stub this ourselves.
var handlePtr *Handle
if len(handles) > 0 {
handlePtr = &handles[0]
}
return waitForMultipleObjects(uint32(len(handles)), uintptr(unsafe.Pointer(handlePtr)), waitAll, waitMilliseconds)
}
// net api calls // net api calls
const socket_error = uintptr(^uint32(0)) const socket_error = uintptr(^uint32(0))

View File

@ -112,6 +112,7 @@ var (
procGetProcessTimes = modkernel32.NewProc("GetProcessTimes") procGetProcessTimes = modkernel32.NewProc("GetProcessTimes")
procDuplicateHandle = modkernel32.NewProc("DuplicateHandle") procDuplicateHandle = modkernel32.NewProc("DuplicateHandle")
procWaitForSingleObject = modkernel32.NewProc("WaitForSingleObject") procWaitForSingleObject = modkernel32.NewProc("WaitForSingleObject")
procWaitForMultipleObjects = modkernel32.NewProc("WaitForMultipleObjects")
procGetTempPathW = modkernel32.NewProc("GetTempPathW") procGetTempPathW = modkernel32.NewProc("GetTempPathW")
procCreatePipe = modkernel32.NewProc("CreatePipe") procCreatePipe = modkernel32.NewProc("CreatePipe")
procGetFileType = modkernel32.NewProc("GetFileType") procGetFileType = modkernel32.NewProc("GetFileType")
@ -1084,6 +1085,25 @@ func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32,
return return
} }
func waitForMultipleObjects(count uint32, handles uintptr, waitAll bool, waitMilliseconds uint32) (event uint32, err error) {
var _p0 uint32
if waitAll {
_p0 = 1
} else {
_p0 = 0
}
r0, _, e1 := syscall.Syscall6(procWaitForMultipleObjects.Addr(), 4, uintptr(count), uintptr(handles), uintptr(_p0), uintptr(waitMilliseconds), 0, 0)
event = uint32(r0)
if event == 0xffffffff {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}
func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) { func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) {
r0, _, e1 := syscall.Syscall(procGetTempPathW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0) r0, _, e1 := syscall.Syscall(procGetTempPathW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0)
n = uint32(r0) n = uint32(r0)

28
vendor/modules.txt vendored
View File

@ -15,14 +15,6 @@ github.com/Philipp15b/go-steam/protocol/gamecoordinator
github.com/Philipp15b/go-steam/protocol/protobuf github.com/Philipp15b/go-steam/protocol/protobuf
github.com/Philipp15b/go-steam/rwu github.com/Philipp15b/go-steam/rwu
github.com/Philipp15b/go-steam/socialcache github.com/Philipp15b/go-steam/socialcache
# github.com/Rhymen/go-whatsapp v0.0.0-20190208184307-c9a81e957884
github.com/Rhymen/go-whatsapp
github.com/Rhymen/go-whatsapp/binary
github.com/Rhymen/go-whatsapp/binary/proto
github.com/Rhymen/go-whatsapp/crypto/cbc
github.com/Rhymen/go-whatsapp/crypto/curve25519
github.com/Rhymen/go-whatsapp/crypto/hkdf
github.com/Rhymen/go-whatsapp/binary/token
# github.com/bwmarrin/discordgo v0.19.0 # github.com/bwmarrin/discordgo v0.19.0
github.com/bwmarrin/discordgo github.com/bwmarrin/discordgo
# github.com/d5/tengo v1.9.2 # github.com/d5/tengo v1.9.2
@ -95,6 +87,14 @@ github.com/magiconair/properties
github.com/matterbridge/Rocket.Chat.Go.SDK/models github.com/matterbridge/Rocket.Chat.Go.SDK/models
github.com/matterbridge/Rocket.Chat.Go.SDK/realtime github.com/matterbridge/Rocket.Chat.Go.SDK/realtime
github.com/matterbridge/Rocket.Chat.Go.SDK/rest github.com/matterbridge/Rocket.Chat.Go.SDK/rest
# github.com/matterbridge/go-whatsapp v0.0.1-0.20190301204034-f2f1b29d441b
github.com/matterbridge/go-whatsapp
github.com/matterbridge/go-whatsapp/binary
github.com/matterbridge/go-whatsapp/binary/proto
github.com/matterbridge/go-whatsapp/crypto/cbc
github.com/matterbridge/go-whatsapp/crypto/curve25519
github.com/matterbridge/go-whatsapp/crypto/hkdf
github.com/matterbridge/go-whatsapp/binary/token
# github.com/matterbridge/go-xmpp v0.0.0-20180529212104-cd19799fba91 # github.com/matterbridge/go-xmpp v0.0.0-20180529212104-cd19799fba91
github.com/matterbridge/go-xmpp github.com/matterbridge/go-xmpp
# github.com/matterbridge/gomatrix v0.0.0-20190102230110-6f9631ca6dea # github.com/matterbridge/gomatrix v0.0.0-20190102230110-6f9631ca6dea
@ -103,14 +103,16 @@ github.com/matterbridge/gomatrix
github.com/matterbridge/gozulipbot github.com/matterbridge/gozulipbot
# github.com/matterbridge/logrus-prefixed-formatter v0.0.0-20180806162718-01618749af61 # github.com/matterbridge/logrus-prefixed-formatter v0.0.0-20180806162718-01618749af61
github.com/matterbridge/logrus-prefixed-formatter github.com/matterbridge/logrus-prefixed-formatter
# github.com/matterbridge/mautrix-whatsapp v0.0.0-20190301210046-3539cf52ed6e
github.com/matterbridge/mautrix-whatsapp/whatsapp-ext
# github.com/mattermost/mattermost-server v5.5.0+incompatible # github.com/mattermost/mattermost-server v5.5.0+incompatible
github.com/mattermost/mattermost-server/model github.com/mattermost/mattermost-server/model
github.com/mattermost/mattermost-server/mlog github.com/mattermost/mattermost-server/mlog
github.com/mattermost/mattermost-server/utils/jsonutils github.com/mattermost/mattermost-server/utils/jsonutils
github.com/mattermost/mattermost-server/utils/markdown github.com/mattermost/mattermost-server/utils/markdown
# github.com/mattn/go-colorable v0.0.9 # github.com/mattn/go-colorable v0.1.1
github.com/mattn/go-colorable github.com/mattn/go-colorable
# github.com/mattn/go-isatty v0.0.4 # github.com/mattn/go-isatty v0.0.5
github.com/mattn/go-isatty github.com/mattn/go-isatty
# github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b # github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
github.com/mgutz/ansi github.com/mgutz/ansi
@ -204,7 +206,7 @@ go.uber.org/zap/internal/bufferpool
go.uber.org/zap/buffer go.uber.org/zap/buffer
go.uber.org/zap/internal/color go.uber.org/zap/internal/color
go.uber.org/zap/internal/exit go.uber.org/zap/internal/exit
# golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613 # golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f
golang.org/x/crypto/ssh/terminal golang.org/x/crypto/ssh/terminal
golang.org/x/crypto/acme/autocert golang.org/x/crypto/acme/autocert
golang.org/x/crypto/nacl/secretbox golang.org/x/crypto/nacl/secretbox
@ -227,7 +229,7 @@ golang.org/x/image/vp8
golang.org/x/image/vp8l golang.org/x/image/vp8l
# golang.org/x/net v0.0.0-20190110200230-915654e7eabc # golang.org/x/net v0.0.0-20190110200230-915654e7eabc
golang.org/x/net/websocket golang.org/x/net/websocket
# golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc # golang.org/x/sys v0.0.0-20190222171317-cd391775e71e
golang.org/x/sys/unix golang.org/x/sys/unix
golang.org/x/sys/windows golang.org/x/sys/windows
# golang.org/x/text v0.3.0 # golang.org/x/text v0.3.0
@ -245,5 +247,3 @@ golang.org/x/text/encoding/internal
gopkg.in/natefinch/lumberjack.v2 gopkg.in/natefinch/lumberjack.v2
# gopkg.in/yaml.v2 v2.2.2 # gopkg.in/yaml.v2 v2.2.2
gopkg.in/yaml.v2 gopkg.in/yaml.v2
# maunium.net/go/mautrix-whatsapp v0.0.0-20190127121751-281b3e8f77f3
maunium.net/go/mautrix-whatsapp/whatsapp-ext