Add events websocket endpoint
This change adds a new websocket endpoint for database events. The events
endpoint allows clients to stream events as they happen in GARM. Events
are defined as a structure containning the event type (create, update, delete),
the database entity involved (instances, pools, repos, etc) and the payload
consisting of the object involved in the event. The payload translates
to the types normally returned by the API and can be deserialized as one
of the types present in the params package.
The events endpoint is a websocket endpoint and it accepts filters as
a simple json send over the websocket connection. The filters allows the
user to specify which entities are of interest, and which operations should
be returned. For example, you may be interested in changes made to pools
or runners, in which case you could create a filter that only returns
update operations for pools. Or update and delete operations.
The filters can be defined as:
{
"filters": [
{
"entity_type": "instance",
"operations": ["update", "delete"]
},
{
"entity_type": "pool"
},
],
"send_everything": false
}
This would return only update and delete events for instances and all events
for pools. Alternatively you can ask GARM to send you everything:
{
"send_everything": true
}
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
dd1740c189
commit
9f8659abd6
91 changed files with 9549 additions and 4544 deletions
|
|
@ -28,6 +28,7 @@ import (
|
||||||
|
|
||||||
gErrors "github.com/cloudbase/garm-provider-common/errors"
|
gErrors "github.com/cloudbase/garm-provider-common/errors"
|
||||||
"github.com/cloudbase/garm-provider-common/util"
|
"github.com/cloudbase/garm-provider-common/util"
|
||||||
|
"github.com/cloudbase/garm/apiserver/events"
|
||||||
"github.com/cloudbase/garm/apiserver/params"
|
"github.com/cloudbase/garm/apiserver/params"
|
||||||
"github.com/cloudbase/garm/auth"
|
"github.com/cloudbase/garm/auth"
|
||||||
"github.com/cloudbase/garm/metrics"
|
"github.com/cloudbase/garm/metrics"
|
||||||
|
|
@ -163,6 +164,43 @@ func (a *APIController) WebhookHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *APIController) EventsHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
ctx := r.Context()
|
||||||
|
if !auth.IsAdmin(ctx) {
|
||||||
|
w.WriteHeader(http.StatusForbidden)
|
||||||
|
if _, err := w.Write([]byte("events are available to admin users")); err != nil {
|
||||||
|
slog.With(slog.Any("error", err)).ErrorContext(ctx, "failed to encode response")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
conn, err := a.upgrader.Upgrade(w, r, nil)
|
||||||
|
if err != nil {
|
||||||
|
slog.With(slog.Any("error", err)).ErrorContext(ctx, "error upgrading to websockets")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
|
wsClient, err := wsWriter.NewClient(ctx, conn)
|
||||||
|
if err != nil {
|
||||||
|
slog.With(slog.Any("error", err)).ErrorContext(ctx, "failed to create new client")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer wsClient.Stop()
|
||||||
|
|
||||||
|
eventHandler, err := events.NewHandler(ctx, wsClient)
|
||||||
|
if err != nil {
|
||||||
|
slog.With(slog.Any("error", err)).ErrorContext(ctx, "failed to create new event handler")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := eventHandler.Start(); err != nil {
|
||||||
|
slog.With(slog.Any("error", err)).ErrorContext(ctx, "failed to start event handler")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
<-eventHandler.Done()
|
||||||
|
}
|
||||||
|
|
||||||
func (a *APIController) WSHandler(writer http.ResponseWriter, req *http.Request) {
|
func (a *APIController) WSHandler(writer http.ResponseWriter, req *http.Request) {
|
||||||
ctx := req.Context()
|
ctx := req.Context()
|
||||||
if !auth.IsAdmin(ctx) {
|
if !auth.IsAdmin(ctx) {
|
||||||
|
|
|
||||||
174
apiserver/events/events.go
Normal file
174
apiserver/events/events.go
Normal file
|
|
@ -0,0 +1,174 @@
|
||||||
|
package events
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"log/slog"
|
||||||
|
"sync"
|
||||||
|
|
||||||
|
runnerErrors "github.com/cloudbase/garm-provider-common/errors"
|
||||||
|
commonUtil "github.com/cloudbase/garm-provider-common/util"
|
||||||
|
"github.com/cloudbase/garm/auth"
|
||||||
|
"github.com/cloudbase/garm/database/common"
|
||||||
|
"github.com/cloudbase/garm/database/watcher"
|
||||||
|
"github.com/cloudbase/garm/websocket"
|
||||||
|
)
|
||||||
|
|
||||||
|
func NewHandler(ctx context.Context, client *websocket.Client) (*EventHandler, error) {
|
||||||
|
if client == nil {
|
||||||
|
return nil, runnerErrors.ErrUnauthorized
|
||||||
|
}
|
||||||
|
|
||||||
|
newID := commonUtil.NewID()
|
||||||
|
userID := auth.UserID(ctx)
|
||||||
|
if userID == "" {
|
||||||
|
return nil, runnerErrors.ErrUnauthorized
|
||||||
|
}
|
||||||
|
consumerID := fmt.Sprintf("ws-event-watcher-%s-%s", userID, newID)
|
||||||
|
consumer, err := watcher.RegisterConsumer(
|
||||||
|
// Filter everything by default. Users should set up filters
|
||||||
|
// after registration.
|
||||||
|
ctx, consumerID, watcher.WithNone())
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
handler := &EventHandler{
|
||||||
|
client: client,
|
||||||
|
ctx: ctx,
|
||||||
|
consumer: consumer,
|
||||||
|
done: make(chan struct{}),
|
||||||
|
}
|
||||||
|
client.SetMessageHandler(handler.HandleClientMessages)
|
||||||
|
|
||||||
|
return handler, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type EventHandler struct {
|
||||||
|
client *websocket.Client
|
||||||
|
consumer common.Consumer
|
||||||
|
|
||||||
|
ctx context.Context
|
||||||
|
done chan struct{}
|
||||||
|
running bool
|
||||||
|
|
||||||
|
mux sync.Mutex
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EventHandler) loop() {
|
||||||
|
defer e.Stop()
|
||||||
|
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case <-e.ctx.Done():
|
||||||
|
slog.DebugContext(e.ctx, "context done, stopping event handler")
|
||||||
|
return
|
||||||
|
case <-e.client.Done():
|
||||||
|
slog.DebugContext(e.ctx, "client done, stopping event handler")
|
||||||
|
return
|
||||||
|
case <-e.Done():
|
||||||
|
slog.DebugContext(e.ctx, "done channel closed, stopping event handler")
|
||||||
|
case event, ok := <-e.consumer.Watch():
|
||||||
|
if !ok {
|
||||||
|
slog.DebugContext(e.ctx, "watcher closed, stopping event handler")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
asJs, err := json.Marshal(event)
|
||||||
|
if err != nil {
|
||||||
|
slog.ErrorContext(e.ctx, "failed to marshal event", "error", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if _, err := e.client.Write(asJs); err != nil {
|
||||||
|
slog.ErrorContext(e.ctx, "failed to write event", "error", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EventHandler) Start() error {
|
||||||
|
e.mux.Lock()
|
||||||
|
defer e.mux.Unlock()
|
||||||
|
|
||||||
|
if e.running {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := e.client.Start(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
e.running = true
|
||||||
|
go e.loop()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EventHandler) Stop() {
|
||||||
|
e.mux.Lock()
|
||||||
|
defer e.mux.Unlock()
|
||||||
|
|
||||||
|
if !e.running {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
e.running = false
|
||||||
|
e.consumer.Close()
|
||||||
|
e.client.Stop()
|
||||||
|
close(e.done)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EventHandler) Done() <-chan struct{} {
|
||||||
|
return e.done
|
||||||
|
}
|
||||||
|
|
||||||
|
// optionsToWatcherFilters converts the Options struct to a PayloadFilterFunc.
|
||||||
|
// The client will send an array of filters that indicates which entities and which
|
||||||
|
// operations the client is interested in. The behavior is that of "any" filter.
|
||||||
|
// Which means that if any of the elements in the array match an event, it will be
|
||||||
|
// sent to the websocket.
|
||||||
|
// Alternatively, clients can choose to get everything.
|
||||||
|
func (e *EventHandler) optionsToWatcherFilters(opt Options) common.PayloadFilterFunc {
|
||||||
|
if opt.SendEverything {
|
||||||
|
return watcher.WithEverything()
|
||||||
|
}
|
||||||
|
|
||||||
|
var funcs []common.PayloadFilterFunc
|
||||||
|
for _, filter := range opt.Filters {
|
||||||
|
var filterFunc []common.PayloadFilterFunc
|
||||||
|
if filter.EntityType == "" {
|
||||||
|
return watcher.WithNone()
|
||||||
|
}
|
||||||
|
filterFunc = append(filterFunc, watcher.WithEntityTypeFilter(filter.EntityType))
|
||||||
|
if len(filter.Operations) > 0 {
|
||||||
|
var opFunc []common.PayloadFilterFunc
|
||||||
|
for _, op := range filter.Operations {
|
||||||
|
opFunc = append(opFunc, watcher.WithOperationTypeFilter(op))
|
||||||
|
}
|
||||||
|
filterFunc = append(filterFunc, watcher.WithAny(opFunc...))
|
||||||
|
}
|
||||||
|
funcs = append(funcs, watcher.WithAll(filterFunc...))
|
||||||
|
}
|
||||||
|
return watcher.WithAny(funcs...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EventHandler) HandleClientMessages(message []byte) error {
|
||||||
|
if e.consumer == nil {
|
||||||
|
return fmt.Errorf("consumer not initialized")
|
||||||
|
}
|
||||||
|
|
||||||
|
var opt Options
|
||||||
|
if err := json.Unmarshal(message, &opt); err != nil {
|
||||||
|
slog.ErrorContext(e.ctx, "failed to unmarshal message from client", "error", err, "message", string(message))
|
||||||
|
// Client is in error. Disconnect.
|
||||||
|
e.client.Write([]byte("failed to unmarshal filter"))
|
||||||
|
e.Stop()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(opt.Filters) == 0 && !opt.SendEverything {
|
||||||
|
slog.DebugContext(e.ctx, "no filters provided; ignoring")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
watcherFilters := e.optionsToWatcherFilters(opt)
|
||||||
|
e.consumer.SetFilters(watcherFilters)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
24
apiserver/events/params.go
Normal file
24
apiserver/events/params.go
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
package events
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/cloudbase/garm/database/common"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Filter struct {
|
||||||
|
Operations []common.OperationType `json:"operations"`
|
||||||
|
EntityType common.DatabaseEntityType `json:"entity_type"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f Filter) Validate() error {
|
||||||
|
switch f.EntityType {
|
||||||
|
case common.RepositoryEntityType, common.OrganizationEntityType, common.EnterpriseEntityType, common.PoolEntityType, common.UserEntityType, common.InstanceEntityType, common.JobEntityType, common.ControllerEntityType, common.GithubCredentialsEntityType, common.GithubEndpointEntityType:
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type Options struct {
|
||||||
|
SendEverything bool `json:"send_everything"`
|
||||||
|
Filters []Filter `json:"filters"`
|
||||||
|
}
|
||||||
|
|
@ -413,6 +413,7 @@ func NewAPIRouter(han *controllers.APIController, authMiddleware, initMiddleware
|
||||||
|
|
||||||
// Websocket log writer
|
// Websocket log writer
|
||||||
apiRouter.Handle("/{ws:ws\\/?}", http.HandlerFunc(han.WSHandler)).Methods("GET")
|
apiRouter.Handle("/{ws:ws\\/?}", http.HandlerFunc(han.WSHandler)).Methods("GET")
|
||||||
|
apiRouter.Handle("/{events:events\\/?}", http.HandlerFunc(han.EventsHandler)).Methods("GET")
|
||||||
|
|
||||||
// NotFound handler
|
// NotFound handler
|
||||||
apiRouter.PathPrefix("/").HandlerFunc(han.NotFoundHandler).Methods("GET", "POST", "PUT", "DELETE", "OPTIONS")
|
apiRouter.PathPrefix("/").HandlerFunc(han.NotFoundHandler).Methods("GET", "POST", "PUT", "DELETE", "OPTIONS")
|
||||||
|
|
|
||||||
96
cmd/garm-cli/cmd/events.go
Normal file
96
cmd/garm-cli/cmd/events.go
Normal file
|
|
@ -0,0 +1,96 @@
|
||||||
|
package cmd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"log/slog"
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/gorilla/websocket"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
"github.com/cloudbase/garm-provider-common/util"
|
||||||
|
garmWs "github.com/cloudbase/garm/websocket"
|
||||||
|
)
|
||||||
|
|
||||||
|
var eventsCmd = &cobra.Command{
|
||||||
|
Use: "debug-events",
|
||||||
|
SilenceUsage: true,
|
||||||
|
Short: "Stream garm events",
|
||||||
|
Long: `Stream all garm events to the terminal.`,
|
||||||
|
RunE: func(_ *cobra.Command, _ []string) error {
|
||||||
|
interrupt := make(chan os.Signal, 1)
|
||||||
|
signal.Notify(interrupt, os.Interrupt)
|
||||||
|
|
||||||
|
conn, err := getWebsocketConnection("/api/v1/events")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
|
done := make(chan struct{})
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
defer close(done)
|
||||||
|
conn.SetReadDeadline(time.Now().Add(pongWait))
|
||||||
|
conn.SetPongHandler(func(string) error { conn.SetReadDeadline(time.Now().Add(pongWait)); return nil })
|
||||||
|
for {
|
||||||
|
_, message, err := conn.ReadMessage()
|
||||||
|
if err != nil {
|
||||||
|
if garmWs.IsErrorOfInterest(err) {
|
||||||
|
slog.With(slog.Any("error", err)).Error("reading event message")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println(util.SanitizeLogEntry(string(message)))
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
if eventsFilters != "" {
|
||||||
|
conn.SetWriteDeadline(time.Now().Add(writeWait))
|
||||||
|
err = conn.WriteMessage(websocket.TextMessage, []byte(eventsFilters))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ticker := time.NewTicker(pingPeriod)
|
||||||
|
defer ticker.Stop()
|
||||||
|
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case <-done:
|
||||||
|
slog.Info("done")
|
||||||
|
return nil
|
||||||
|
case <-ticker.C:
|
||||||
|
conn.SetWriteDeadline(time.Now().Add(writeWait))
|
||||||
|
err := conn.WriteMessage(websocket.PingMessage, nil)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
case <-interrupt:
|
||||||
|
// Cleanly close the connection by sending a close message and then
|
||||||
|
// waiting (with timeout) for the server to close the connection.
|
||||||
|
conn.SetWriteDeadline(time.Now().Add(writeWait))
|
||||||
|
err := conn.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, ""))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
slog.Info("waiting for server to close connection")
|
||||||
|
select {
|
||||||
|
case <-done:
|
||||||
|
slog.Info("done")
|
||||||
|
case <-time.After(time.Second):
|
||||||
|
slog.Info("timeout")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
eventsCmd.Flags().StringVarP(&eventsFilters, "filters", "m", "", "Json with event filters you want to apply")
|
||||||
|
rootCmd.AddCommand(eventsCmd)
|
||||||
|
}
|
||||||
|
|
@ -3,7 +3,6 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
@ -19,6 +18,53 @@ import (
|
||||||
garmWs "github.com/cloudbase/garm/websocket"
|
garmWs "github.com/cloudbase/garm/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var eventsFilters string
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Time allowed to write a message to the peer.
|
||||||
|
writeWait = 10 * time.Second
|
||||||
|
|
||||||
|
// Time allowed to read the next pong message from the peer.
|
||||||
|
pongWait = 30 * time.Second
|
||||||
|
|
||||||
|
// Send pings to peer with this period. Must be less than pongWait.
|
||||||
|
pingPeriod = (pongWait * 9) / 10
|
||||||
|
)
|
||||||
|
|
||||||
|
func getWebsocketConnection(pth string) (*websocket.Conn, error) {
|
||||||
|
parsedURL, err := url.Parse(mgr.BaseURL)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
wsScheme := "ws"
|
||||||
|
if parsedURL.Scheme == "https" {
|
||||||
|
wsScheme = "wss"
|
||||||
|
}
|
||||||
|
u := url.URL{Scheme: wsScheme, Host: parsedURL.Host, Path: pth}
|
||||||
|
slog.Debug("connecting", "url", u.String())
|
||||||
|
|
||||||
|
header := http.Header{}
|
||||||
|
header.Add("Authorization", fmt.Sprintf("Bearer %s", mgr.Token))
|
||||||
|
|
||||||
|
c, response, err := websocket.DefaultDialer.Dial(u.String(), header)
|
||||||
|
if err != nil {
|
||||||
|
var resp apiParams.APIErrorResponse
|
||||||
|
var msg string
|
||||||
|
var status string
|
||||||
|
if response != nil {
|
||||||
|
if response.Body != nil {
|
||||||
|
if err := json.NewDecoder(response.Body).Decode(&resp); err == nil {
|
||||||
|
msg = resp.Details
|
||||||
|
}
|
||||||
|
}
|
||||||
|
status = response.Status
|
||||||
|
}
|
||||||
|
return nil, fmt.Errorf("failed to stream logs: %q %s (%s)", err, msg, status)
|
||||||
|
}
|
||||||
|
return c, nil
|
||||||
|
}
|
||||||
|
|
||||||
var logCmd = &cobra.Command{
|
var logCmd = &cobra.Command{
|
||||||
Use: "debug-log",
|
Use: "debug-log",
|
||||||
SilenceUsage: true,
|
SilenceUsage: true,
|
||||||
|
|
@ -28,44 +74,20 @@ var logCmd = &cobra.Command{
|
||||||
interrupt := make(chan os.Signal, 1)
|
interrupt := make(chan os.Signal, 1)
|
||||||
signal.Notify(interrupt, os.Interrupt)
|
signal.Notify(interrupt, os.Interrupt)
|
||||||
|
|
||||||
parsedURL, err := url.Parse(mgr.BaseURL)
|
conn, err := getWebsocketConnection("/api/v1/ws")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer conn.Close()
|
||||||
wsScheme := "ws"
|
|
||||||
if parsedURL.Scheme == "https" {
|
|
||||||
wsScheme = "wss"
|
|
||||||
}
|
|
||||||
u := url.URL{Scheme: wsScheme, Host: parsedURL.Host, Path: "/api/v1/ws"}
|
|
||||||
slog.Debug("connecting", "url", u.String())
|
|
||||||
|
|
||||||
header := http.Header{}
|
|
||||||
header.Add("Authorization", fmt.Sprintf("Bearer %s", mgr.Token))
|
|
||||||
|
|
||||||
c, response, err := websocket.DefaultDialer.Dial(u.String(), header)
|
|
||||||
if err != nil {
|
|
||||||
var resp apiParams.APIErrorResponse
|
|
||||||
var msg string
|
|
||||||
var status string
|
|
||||||
if response != nil {
|
|
||||||
if response.Body != nil {
|
|
||||||
if err := json.NewDecoder(response.Body).Decode(&resp); err == nil {
|
|
||||||
msg = resp.Details
|
|
||||||
}
|
|
||||||
}
|
|
||||||
status = response.Status
|
|
||||||
}
|
|
||||||
log.Fatalf("failed to stream logs: %q %s (%s)", err, msg, status)
|
|
||||||
}
|
|
||||||
defer c.Close()
|
|
||||||
|
|
||||||
done := make(chan struct{})
|
done := make(chan struct{})
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
defer close(done)
|
defer close(done)
|
||||||
|
conn.SetReadDeadline(time.Now().Add(pongWait))
|
||||||
|
conn.SetPongHandler(func(string) error { conn.SetReadDeadline(time.Now().Add(pongWait)); return nil })
|
||||||
for {
|
for {
|
||||||
_, message, err := c.ReadMessage()
|
_, message, err := conn.ReadMessage()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if garmWs.IsErrorOfInterest(err) {
|
if garmWs.IsErrorOfInterest(err) {
|
||||||
slog.With(slog.Any("error", err)).Error("reading log message")
|
slog.With(slog.Any("error", err)).Error("reading log message")
|
||||||
|
|
@ -76,22 +98,24 @@ var logCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
ticker := time.NewTicker(time.Second)
|
ticker := time.NewTicker(pingPeriod)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-done:
|
case <-done:
|
||||||
return nil
|
return nil
|
||||||
case t := <-ticker.C:
|
case <-ticker.C:
|
||||||
err := c.WriteMessage(websocket.TextMessage, []byte(t.String()))
|
conn.SetWriteDeadline(time.Now().Add(writeWait))
|
||||||
|
err := conn.WriteMessage(websocket.PingMessage, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
case <-interrupt:
|
case <-interrupt:
|
||||||
// Cleanly close the connection by sending a close message and then
|
// Cleanly close the connection by sending a close message and then
|
||||||
// waiting (with timeout) for the server to close the connection.
|
// waiting (with timeout) for the server to close the connection.
|
||||||
err := c.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, ""))
|
conn.SetWriteDeadline(time.Now().Add(writeWait))
|
||||||
|
err := conn.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, ""))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,4 +9,6 @@ var (
|
||||||
ErrConsumerAlreadyRegistered = fmt.Errorf("consumer already registered")
|
ErrConsumerAlreadyRegistered = fmt.Errorf("consumer already registered")
|
||||||
ErrWatcherAlreadyStarted = fmt.Errorf("watcher already started")
|
ErrWatcherAlreadyStarted = fmt.Errorf("watcher already started")
|
||||||
ErrWatcherNotInitialized = fmt.Errorf("watcher not initialized")
|
ErrWatcherNotInitialized = fmt.Errorf("watcher not initialized")
|
||||||
|
ErrInvalidOperation = fmt.Errorf("invalid operation")
|
||||||
|
ErrInvalidEntityType = fmt.Errorf("invalid entity type")
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -188,3 +188,25 @@ func WithUserIDFilter(userID string) dbCommon.PayloadFilterFunc {
|
||||||
return userPayload.ID == userID
|
return userPayload.ID == userID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithNone returns a filter function that always returns false.
|
||||||
|
func WithNone() dbCommon.PayloadFilterFunc {
|
||||||
|
return func(_ dbCommon.ChangePayload) bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithEverything returns a filter function that always returns true.
|
||||||
|
func WithEverything() dbCommon.PayloadFilterFunc {
|
||||||
|
return func(_ dbCommon.ChangePayload) bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithExcludeEntityTypeFilter returns a filter function that filters payloads by excluding
|
||||||
|
// the provided entity type.
|
||||||
|
func WithExcludeEntityTypeFilter(entityType dbCommon.DatabaseEntityType) dbCommon.PayloadFilterFunc {
|
||||||
|
return func(payload dbCommon.ChangePayload) bool {
|
||||||
|
return payload.EntityType != entityType
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,7 @@ func (w *watcher) serviceConsumer(consumer *consumer) {
|
||||||
slog.InfoContext(w.ctx, "removing consumer from watcher", "consumer_id", consumer.id)
|
slog.InfoContext(w.ctx, "removing consumer from watcher", "consumer_id", consumer.id)
|
||||||
delete(w.consumers, consumer.id)
|
delete(w.consumers, consumer.id)
|
||||||
}()
|
}()
|
||||||
|
slog.InfoContext(w.ctx, "starting consumer", "consumer_id", consumer.id)
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-consumer.quit:
|
case <-consumer.quit:
|
||||||
|
|
|
||||||
8
go.mod
8
go.mod
|
|
@ -16,7 +16,7 @@ require (
|
||||||
github.com/google/uuid v1.6.0
|
github.com/google/uuid v1.6.0
|
||||||
github.com/gorilla/handlers v1.5.2
|
github.com/gorilla/handlers v1.5.2
|
||||||
github.com/gorilla/mux v1.8.1
|
github.com/gorilla/mux v1.8.1
|
||||||
github.com/gorilla/websocket v1.5.1
|
github.com/gorilla/websocket v1.5.4-0.20240702125206-a62d9d2a8413
|
||||||
github.com/jedib0t/go-pretty/v6 v6.5.8
|
github.com/jedib0t/go-pretty/v6 v6.5.8
|
||||||
github.com/juju/clock v1.0.3
|
github.com/juju/clock v1.0.3
|
||||||
github.com/juju/retry v1.0.0
|
github.com/juju/retry v1.0.0
|
||||||
|
|
@ -26,7 +26,7 @@ require (
|
||||||
github.com/prometheus/client_golang v1.19.0
|
github.com/prometheus/client_golang v1.19.0
|
||||||
github.com/spf13/cobra v1.8.0
|
github.com/spf13/cobra v1.8.0
|
||||||
github.com/stretchr/testify v1.9.0
|
github.com/stretchr/testify v1.9.0
|
||||||
golang.org/x/crypto v0.22.0
|
golang.org/x/crypto v0.24.0
|
||||||
golang.org/x/oauth2 v0.19.0
|
golang.org/x/oauth2 v0.19.0
|
||||||
golang.org/x/sync v0.7.0
|
golang.org/x/sync v0.7.0
|
||||||
gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0
|
gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0
|
||||||
|
|
@ -83,8 +83,8 @@ require (
|
||||||
go.opentelemetry.io/otel v1.25.0 // indirect
|
go.opentelemetry.io/otel v1.25.0 // indirect
|
||||||
go.opentelemetry.io/otel/metric v1.25.0 // indirect
|
go.opentelemetry.io/otel/metric v1.25.0 // indirect
|
||||||
go.opentelemetry.io/otel/trace v1.25.0 // indirect
|
go.opentelemetry.io/otel/trace v1.25.0 // indirect
|
||||||
golang.org/x/net v0.24.0 // indirect
|
golang.org/x/net v0.26.0 // indirect
|
||||||
golang.org/x/sys v0.19.0 // indirect
|
golang.org/x/sys v0.21.0 // indirect
|
||||||
google.golang.org/protobuf v1.33.0 // indirect
|
google.golang.org/protobuf v1.33.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
|
|
||||||
20
go.sum
20
go.sum
|
|
@ -78,8 +78,8 @@ github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyE
|
||||||
github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w=
|
github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w=
|
||||||
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
||||||
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
||||||
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
|
github.com/gorilla/websocket v1.5.4-0.20240702125206-a62d9d2a8413 h1:0Zn/h+BUQg6QHkybGvjFD7BnIbjjz3oWUObacn//1Go=
|
||||||
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
|
github.com/gorilla/websocket v1.5.4-0.20240702125206-a62d9d2a8413/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||||
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||||
|
|
@ -180,10 +180,10 @@ go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucg
|
||||||
go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
|
go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
|
||||||
go.opentelemetry.io/otel/trace v1.25.0 h1:tqukZGLwQYRIFtSQM2u2+yfMVTgGVeqRLPUYx1Dq6RM=
|
go.opentelemetry.io/otel/trace v1.25.0 h1:tqukZGLwQYRIFtSQM2u2+yfMVTgGVeqRLPUYx1Dq6RM=
|
||||||
go.opentelemetry.io/otel/trace v1.25.0/go.mod h1:hCCs70XM/ljO+BeQkyFnbK28SBIJ/Emuha+ccrCRT7I=
|
go.opentelemetry.io/otel/trace v1.25.0/go.mod h1:hCCs70XM/ljO+BeQkyFnbK28SBIJ/Emuha+ccrCRT7I=
|
||||||
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
|
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
|
||||||
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
|
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
|
||||||
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
|
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
|
||||||
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
|
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
|
||||||
golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg=
|
golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg=
|
||||||
golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8=
|
golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8=
|
||||||
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
||||||
|
|
@ -191,10 +191,10 @@ golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||||
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
|
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||||
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
|
||||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||||
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||||
|
|
|
||||||
20
vendor/github.com/gorilla/websocket/.editorconfig
generated
vendored
20
vendor/github.com/gorilla/websocket/.editorconfig
generated
vendored
|
|
@ -1,20 +0,0 @@
|
||||||
; https://editorconfig.org/
|
|
||||||
|
|
||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
insert_final_newline = true
|
|
||||||
charset = utf-8
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[{Makefile,go.mod,go.sum,*.go,.gitmodules}]
|
|
||||||
indent_style = tab
|
|
||||||
indent_size = 4
|
|
||||||
|
|
||||||
[*.md]
|
|
||||||
indent_size = 4
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
|
|
||||||
eclint_indent_style = unset
|
|
||||||
26
vendor/github.com/gorilla/websocket/.gitignore
generated
vendored
26
vendor/github.com/gorilla/websocket/.gitignore
generated
vendored
|
|
@ -1 +1,25 @@
|
||||||
coverage.coverprofile
|
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||||
|
*.o
|
||||||
|
*.a
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Folders
|
||||||
|
_obj
|
||||||
|
_test
|
||||||
|
|
||||||
|
# Architecture specific extensions/prefixes
|
||||||
|
*.[568vq]
|
||||||
|
[568vq].out
|
||||||
|
|
||||||
|
*.cgo1.go
|
||||||
|
*.cgo2.c
|
||||||
|
_cgo_defun.c
|
||||||
|
_cgo_gotypes.go
|
||||||
|
_cgo_export.*
|
||||||
|
|
||||||
|
_testmain.go
|
||||||
|
|
||||||
|
*.exe
|
||||||
|
|
||||||
|
.idea/
|
||||||
|
*.iml
|
||||||
|
|
|
||||||
3
vendor/github.com/gorilla/websocket/.golangci.yml
generated
vendored
3
vendor/github.com/gorilla/websocket/.golangci.yml
generated
vendored
|
|
@ -1,3 +0,0 @@
|
||||||
run:
|
|
||||||
skip-dirs:
|
|
||||||
- examples/*.go
|
|
||||||
9
vendor/github.com/gorilla/websocket/AUTHORS
generated
vendored
Normal file
9
vendor/github.com/gorilla/websocket/AUTHORS
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
# This is the official list of Gorilla WebSocket authors for copyright
|
||||||
|
# purposes.
|
||||||
|
#
|
||||||
|
# Please keep the list sorted.
|
||||||
|
|
||||||
|
Gary Burd <gary@beagledreams.com>
|
||||||
|
Google LLC (https://opensource.google.com/)
|
||||||
|
Joachim Bauch <mail@joachim-bauch.de>
|
||||||
|
|
||||||
39
vendor/github.com/gorilla/websocket/LICENSE
generated
vendored
39
vendor/github.com/gorilla/websocket/LICENSE
generated
vendored
|
|
@ -1,27 +1,22 @@
|
||||||
Copyright (c) 2023 The Gorilla Authors. All rights reserved.
|
Copyright (c) 2013 The Gorilla WebSocket Authors. All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are
|
modification, are permitted provided that the following conditions are met:
|
||||||
met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright
|
Redistributions of source code must retain the above copyright notice, this
|
||||||
notice, this list of conditions and the following disclaimer.
|
list of conditions and the following disclaimer.
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the following disclaimer
|
|
||||||
in the documentation and/or other materials provided with the
|
|
||||||
distribution.
|
|
||||||
* Neither the name of Google Inc. nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived from
|
|
||||||
this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
Redistributions in binary form must reproduce the above copyright notice,
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
this list of conditions and the following disclaimer in the documentation
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
and/or other materials provided with the distribution.
|
||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
|
||||||
34
vendor/github.com/gorilla/websocket/Makefile
generated
vendored
34
vendor/github.com/gorilla/websocket/Makefile
generated
vendored
|
|
@ -1,34 +0,0 @@
|
||||||
GO_LINT=$(shell which golangci-lint 2> /dev/null || echo '')
|
|
||||||
GO_LINT_URI=github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
|
||||||
|
|
||||||
GO_SEC=$(shell which gosec 2> /dev/null || echo '')
|
|
||||||
GO_SEC_URI=github.com/securego/gosec/v2/cmd/gosec@latest
|
|
||||||
|
|
||||||
GO_VULNCHECK=$(shell which govulncheck 2> /dev/null || echo '')
|
|
||||||
GO_VULNCHECK_URI=golang.org/x/vuln/cmd/govulncheck@latest
|
|
||||||
|
|
||||||
.PHONY: golangci-lint
|
|
||||||
golangci-lint:
|
|
||||||
$(if $(GO_LINT), ,go install $(GO_LINT_URI))
|
|
||||||
@echo "##### Running golangci-lint"
|
|
||||||
golangci-lint run -v
|
|
||||||
|
|
||||||
.PHONY: gosec
|
|
||||||
gosec:
|
|
||||||
$(if $(GO_SEC), ,go install $(GO_SEC_URI))
|
|
||||||
@echo "##### Running gosec"
|
|
||||||
gosec -exclude-dir examples ./...
|
|
||||||
|
|
||||||
.PHONY: govulncheck
|
|
||||||
govulncheck:
|
|
||||||
$(if $(GO_VULNCHECK), ,go install $(GO_VULNCHECK_URI))
|
|
||||||
@echo "##### Running govulncheck"
|
|
||||||
govulncheck ./...
|
|
||||||
|
|
||||||
.PHONY: verify
|
|
||||||
verify: golangci-lint gosec govulncheck
|
|
||||||
|
|
||||||
.PHONY: test
|
|
||||||
test:
|
|
||||||
@echo "##### Running tests"
|
|
||||||
go test -race -cover -coverprofile=coverage.coverprofile -covermode=atomic -v ./...
|
|
||||||
24
vendor/github.com/gorilla/websocket/README.md
generated
vendored
24
vendor/github.com/gorilla/websocket/README.md
generated
vendored
|
|
@ -1,23 +1,19 @@
|
||||||
# gorilla/websocket
|
# Gorilla WebSocket
|
||||||
|
|
||||||

|
[](https://godoc.org/github.com/gorilla/websocket)
|
||||||
[](https://codecov.io/github/gorilla/websocket)
|
[](https://circleci.com/gh/gorilla/websocket)
|
||||||
[](https://godoc.org/github.com/gorilla/websocket)
|
|
||||||
[](https://sourcegraph.com/github.com/gorilla/websocket?badge)
|
|
||||||
|
|
||||||
Gorilla WebSocket is a [Go](http://golang.org/) implementation of the [WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol.
|
Gorilla WebSocket is a [Go](http://golang.org/) implementation of the
|
||||||
|
[WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol.
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
### Documentation
|
### Documentation
|
||||||
|
|
||||||
* [API Reference](https://pkg.go.dev/github.com/gorilla/websocket?tab=doc)
|
* [API Reference](https://pkg.go.dev/github.com/gorilla/websocket?tab=doc)
|
||||||
* [Chat example](https://github.com/gorilla/websocket/tree/master/examples/chat)
|
* [Chat example](https://github.com/gorilla/websocket/tree/main/examples/chat)
|
||||||
* [Command example](https://github.com/gorilla/websocket/tree/master/examples/command)
|
* [Command example](https://github.com/gorilla/websocket/tree/main/examples/command)
|
||||||
* [Client and server example](https://github.com/gorilla/websocket/tree/master/examples/echo)
|
* [Client and server example](https://github.com/gorilla/websocket/tree/main/examples/echo)
|
||||||
* [File watch example](https://github.com/gorilla/websocket/tree/master/examples/filewatch)
|
* [File watch example](https://github.com/gorilla/websocket/tree/main/examples/filewatch)
|
||||||
* [Write buffer pool example](https://github.com/gorilla/websocket/tree/master/examples/bufferpool)
|
|
||||||
|
|
||||||
### Status
|
### Status
|
||||||
|
|
||||||
|
|
@ -33,4 +29,4 @@ package API is stable.
|
||||||
|
|
||||||
The Gorilla WebSocket package passes the server tests in the [Autobahn Test
|
The Gorilla WebSocket package passes the server tests in the [Autobahn Test
|
||||||
Suite](https://github.com/crossbario/autobahn-testsuite) using the application in the [examples/autobahn
|
Suite](https://github.com/crossbario/autobahn-testsuite) using the application in the [examples/autobahn
|
||||||
subdirectory](https://github.com/gorilla/websocket/tree/master/examples/autobahn).
|
subdirectory](https://github.com/gorilla/websocket/tree/main/examples/autobahn).
|
||||||
|
|
|
||||||
83
vendor/github.com/gorilla/websocket/client.go
generated
vendored
83
vendor/github.com/gorilla/websocket/client.go
generated
vendored
|
|
@ -11,16 +11,12 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
|
||||||
|
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptrace"
|
"net/http/httptrace"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"golang.org/x/net/proxy"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ErrBadHandshake is returned when the server response to opening handshake is
|
// ErrBadHandshake is returned when the server response to opening handshake is
|
||||||
|
|
@ -56,7 +52,7 @@ func NewClient(netConn net.Conn, u *url.URL, requestHeader http.Header, readBufS
|
||||||
// It is safe to call Dialer's methods concurrently.
|
// It is safe to call Dialer's methods concurrently.
|
||||||
type Dialer struct {
|
type Dialer struct {
|
||||||
// NetDial specifies the dial function for creating TCP connections. If
|
// NetDial specifies the dial function for creating TCP connections. If
|
||||||
// NetDial is nil, net.Dial is used.
|
// NetDial is nil, net.Dialer DialContext is used.
|
||||||
NetDial func(network, addr string) (net.Conn, error)
|
NetDial func(network, addr string) (net.Conn, error)
|
||||||
|
|
||||||
// NetDialContext specifies the dial function for creating TCP connections. If
|
// NetDialContext specifies the dial function for creating TCP connections. If
|
||||||
|
|
@ -228,7 +224,6 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
|
||||||
k == "Connection" ||
|
k == "Connection" ||
|
||||||
k == "Sec-Websocket-Key" ||
|
k == "Sec-Websocket-Key" ||
|
||||||
k == "Sec-Websocket-Version" ||
|
k == "Sec-Websocket-Version" ||
|
||||||
//#nosec G101 (CWE-798): Potential HTTP request smuggling via parameter pollution
|
|
||||||
k == "Sec-Websocket-Extensions" ||
|
k == "Sec-Websocket-Extensions" ||
|
||||||
(k == "Sec-Websocket-Protocol" && len(d.Subprotocols) > 0):
|
(k == "Sec-Websocket-Protocol" && len(d.Subprotocols) > 0):
|
||||||
return nil, nil, errors.New("websocket: duplicate header not allowed: " + k)
|
return nil, nil, errors.New("websocket: duplicate header not allowed: " + k)
|
||||||
|
|
@ -249,54 +244,31 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
|
||||||
defer cancel()
|
defer cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get network dial function.
|
var netDial netDialerFunc
|
||||||
var netDial func(network, add string) (net.Conn, error)
|
switch {
|
||||||
|
case u.Scheme == "https" && d.NetDialTLSContext != nil:
|
||||||
switch u.Scheme {
|
netDial = d.NetDialTLSContext
|
||||||
case "http":
|
case d.NetDialContext != nil:
|
||||||
if d.NetDialContext != nil {
|
netDial = d.NetDialContext
|
||||||
netDial = func(network, addr string) (net.Conn, error) {
|
case d.NetDial != nil:
|
||||||
return d.NetDialContext(ctx, network, addr)
|
netDial = func(ctx context.Context, net, addr string) (net.Conn, error) {
|
||||||
}
|
return d.NetDial(net, addr)
|
||||||
} else if d.NetDial != nil {
|
|
||||||
netDial = d.NetDial
|
|
||||||
}
|
|
||||||
case "https":
|
|
||||||
if d.NetDialTLSContext != nil {
|
|
||||||
netDial = func(network, addr string) (net.Conn, error) {
|
|
||||||
return d.NetDialTLSContext(ctx, network, addr)
|
|
||||||
}
|
|
||||||
} else if d.NetDialContext != nil {
|
|
||||||
netDial = func(network, addr string) (net.Conn, error) {
|
|
||||||
return d.NetDialContext(ctx, network, addr)
|
|
||||||
}
|
|
||||||
} else if d.NetDial != nil {
|
|
||||||
netDial = d.NetDial
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return nil, nil, errMalformedURL
|
netDial = (&net.Dialer{}).DialContext
|
||||||
}
|
|
||||||
|
|
||||||
if netDial == nil {
|
|
||||||
netDialer := &net.Dialer{}
|
|
||||||
netDial = func(network, addr string) (net.Conn, error) {
|
|
||||||
return netDialer.DialContext(ctx, network, addr)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If needed, wrap the dial function to set the connection deadline.
|
// If needed, wrap the dial function to set the connection deadline.
|
||||||
if deadline, ok := ctx.Deadline(); ok {
|
if deadline, ok := ctx.Deadline(); ok {
|
||||||
forwardDial := netDial
|
forwardDial := netDial
|
||||||
netDial = func(network, addr string) (net.Conn, error) {
|
netDial = func(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||||
c, err := forwardDial(network, addr)
|
c, err := forwardDial(ctx, network, addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
err = c.SetDeadline(deadline)
|
err = c.SetDeadline(deadline)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err := c.Close(); err != nil {
|
c.Close()
|
||||||
log.Printf("websocket: failed to close network connection: %v", err)
|
|
||||||
}
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return c, nil
|
return c, nil
|
||||||
|
|
@ -310,11 +282,10 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
if proxyURL != nil {
|
if proxyURL != nil {
|
||||||
dialer, err := proxy.FromURL(proxyURL, netDialerFunc(netDial))
|
netDial, err = proxyFromURL(proxyURL, netDial)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
netDial = dialer.Dial
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -324,7 +295,7 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
|
||||||
trace.GetConn(hostPort)
|
trace.GetConn(hostPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
netConn, err := netDial("tcp", hostPort)
|
netConn, err := netDial(ctx, "tcp", hostPort)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -336,9 +307,7 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if netConn != nil {
|
if netConn != nil {
|
||||||
if err := netConn.Close(); err != nil {
|
netConn.Close()
|
||||||
log.Printf("websocket: failed to close network connection: %v", err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
@ -429,16 +398,26 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
|
||||||
resp.Body = io.NopCloser(bytes.NewReader([]byte{}))
|
resp.Body = io.NopCloser(bytes.NewReader([]byte{}))
|
||||||
conn.subprotocol = resp.Header.Get("Sec-Websocket-Protocol")
|
conn.subprotocol = resp.Header.Get("Sec-Websocket-Protocol")
|
||||||
|
|
||||||
if err := netConn.SetDeadline(time.Time{}); err != nil {
|
netConn.SetDeadline(time.Time{})
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
netConn = nil // to avoid close in defer.
|
netConn = nil // to avoid close in defer.
|
||||||
return conn, resp, nil
|
return conn, resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func cloneTLSConfig(cfg *tls.Config) *tls.Config {
|
func cloneTLSConfig(cfg *tls.Config) *tls.Config {
|
||||||
if cfg == nil {
|
if cfg == nil {
|
||||||
return &tls.Config{MinVersion: tls.VersionTLS12}
|
return &tls.Config{}
|
||||||
}
|
}
|
||||||
return cfg.Clone()
|
return cfg.Clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func doHandshake(ctx context.Context, tlsConn *tls.Conn, cfg *tls.Config) error {
|
||||||
|
if err := tlsConn.HandshakeContext(ctx); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if !cfg.InsecureSkipVerify {
|
||||||
|
if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
|
||||||
9
vendor/github.com/gorilla/websocket/compression.go
generated
vendored
9
vendor/github.com/gorilla/websocket/compression.go
generated
vendored
|
|
@ -8,7 +8,6 @@ import (
|
||||||
"compress/flate"
|
"compress/flate"
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
@ -34,9 +33,7 @@ func decompressNoContextTakeover(r io.Reader) io.ReadCloser {
|
||||||
"\x01\x00\x00\xff\xff"
|
"\x01\x00\x00\xff\xff"
|
||||||
|
|
||||||
fr, _ := flateReaderPool.Get().(io.ReadCloser)
|
fr, _ := flateReaderPool.Get().(io.ReadCloser)
|
||||||
if err := fr.(flate.Resetter).Reset(io.MultiReader(r, strings.NewReader(tail)), nil); err != nil {
|
fr.(flate.Resetter).Reset(io.MultiReader(r, strings.NewReader(tail)), nil)
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
return &flateReadWrapper{fr}
|
return &flateReadWrapper{fr}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -135,9 +132,7 @@ func (r *flateReadWrapper) Read(p []byte) (int, error) {
|
||||||
// Preemptively place the reader back in the pool. This helps with
|
// Preemptively place the reader back in the pool. This helps with
|
||||||
// scenarios where the application does not call NextReader() soon after
|
// scenarios where the application does not call NextReader() soon after
|
||||||
// this final read.
|
// this final read.
|
||||||
if err := r.Close(); err != nil {
|
r.Close()
|
||||||
log.Printf("websocket: flateReadWrapper.Close() returned error: %v", err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return n, err
|
return n, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
77
vendor/github.com/gorilla/websocket/conn.go
generated
vendored
77
vendor/github.com/gorilla/websocket/conn.go
generated
vendored
|
|
@ -10,7 +10,6 @@ import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
|
||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -193,13 +192,6 @@ func newMaskKey() [4]byte {
|
||||||
return k
|
return k
|
||||||
}
|
}
|
||||||
|
|
||||||
func hideTempErr(err error) error {
|
|
||||||
if e, ok := err.(net.Error); ok {
|
|
||||||
err = &netError{msg: e.Error(), timeout: e.Timeout()}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func isControl(frameType int) bool {
|
func isControl(frameType int) bool {
|
||||||
return frameType == CloseMessage || frameType == PingMessage || frameType == PongMessage
|
return frameType == CloseMessage || frameType == PingMessage || frameType == PongMessage
|
||||||
}
|
}
|
||||||
|
|
@ -365,7 +357,6 @@ func (c *Conn) RemoteAddr() net.Addr {
|
||||||
// Write methods
|
// Write methods
|
||||||
|
|
||||||
func (c *Conn) writeFatal(err error) error {
|
func (c *Conn) writeFatal(err error) error {
|
||||||
err = hideTempErr(err)
|
|
||||||
c.writeErrMu.Lock()
|
c.writeErrMu.Lock()
|
||||||
if c.writeErr == nil {
|
if c.writeErr == nil {
|
||||||
c.writeErr = err
|
c.writeErr = err
|
||||||
|
|
@ -379,9 +370,7 @@ func (c *Conn) read(n int) ([]byte, error) {
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
err = errUnexpectedEOF
|
err = errUnexpectedEOF
|
||||||
}
|
}
|
||||||
if _, err := c.br.Discard(len(p)); err != nil {
|
c.br.Discard(len(p))
|
||||||
return p, err
|
|
||||||
}
|
|
||||||
return p, err
|
return p, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -396,9 +385,7 @@ func (c *Conn) write(frameType int, deadline time.Time, buf0, buf1 []byte) error
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := c.conn.SetWriteDeadline(deadline); err != nil {
|
c.conn.SetWriteDeadline(deadline)
|
||||||
return c.writeFatal(err)
|
|
||||||
}
|
|
||||||
if len(buf1) == 0 {
|
if len(buf1) == 0 {
|
||||||
_, err = c.conn.Write(buf0)
|
_, err = c.conn.Write(buf0)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -408,7 +395,7 @@ func (c *Conn) write(frameType int, deadline time.Time, buf0, buf1 []byte) error
|
||||||
return c.writeFatal(err)
|
return c.writeFatal(err)
|
||||||
}
|
}
|
||||||
if frameType == CloseMessage {
|
if frameType == CloseMessage {
|
||||||
_ = c.writeFatal(ErrCloseSent)
|
c.writeFatal(ErrCloseSent)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -449,7 +436,7 @@ func (c *Conn) WriteControl(messageType int, data []byte, deadline time.Time) er
|
||||||
|
|
||||||
d := 1000 * time.Hour
|
d := 1000 * time.Hour
|
||||||
if !deadline.IsZero() {
|
if !deadline.IsZero() {
|
||||||
d = time.Until(deadline)
|
d = deadline.Sub(time.Now())
|
||||||
if d < 0 {
|
if d < 0 {
|
||||||
return errWriteTimeout
|
return errWriteTimeout
|
||||||
}
|
}
|
||||||
|
|
@ -471,15 +458,13 @@ func (c *Conn) WriteControl(messageType int, data []byte, deadline time.Time) er
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := c.conn.SetWriteDeadline(deadline); err != nil {
|
c.conn.SetWriteDeadline(deadline)
|
||||||
return c.writeFatal(err)
|
|
||||||
}
|
|
||||||
_, err = c.conn.Write(buf)
|
_, err = c.conn.Write(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.writeFatal(err)
|
return c.writeFatal(err)
|
||||||
}
|
}
|
||||||
if messageType == CloseMessage {
|
if messageType == CloseMessage {
|
||||||
_ = c.writeFatal(ErrCloseSent)
|
c.writeFatal(ErrCloseSent)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -490,9 +475,7 @@ func (c *Conn) beginMessage(mw *messageWriter, messageType int) error {
|
||||||
// probably better to return an error in this situation, but we cannot
|
// probably better to return an error in this situation, but we cannot
|
||||||
// change this without breaking existing applications.
|
// change this without breaking existing applications.
|
||||||
if c.writer != nil {
|
if c.writer != nil {
|
||||||
if err := c.writer.Close(); err != nil {
|
c.writer.Close()
|
||||||
log.Printf("websocket: discarding writer close error: %v", err)
|
|
||||||
}
|
|
||||||
c.writer = nil
|
c.writer = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -645,7 +628,7 @@ func (w *messageWriter) flushFrame(final bool, extra []byte) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if final {
|
if final {
|
||||||
_ = w.endMessage(errWriteClosed)
|
w.endMessage(errWriteClosed)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -832,9 +815,7 @@ func (c *Conn) advanceFrame() (int, error) {
|
||||||
rsv2 := p[0]&rsv2Bit != 0
|
rsv2 := p[0]&rsv2Bit != 0
|
||||||
rsv3 := p[0]&rsv3Bit != 0
|
rsv3 := p[0]&rsv3Bit != 0
|
||||||
mask := p[1]&maskBit != 0
|
mask := p[1]&maskBit != 0
|
||||||
if err := c.setReadRemaining(int64(p[1] & 0x7f)); err != nil {
|
c.setReadRemaining(int64(p[1] & 0x7f))
|
||||||
return noFrame, err
|
|
||||||
}
|
|
||||||
|
|
||||||
c.readDecompress = false
|
c.readDecompress = false
|
||||||
if rsv1 {
|
if rsv1 {
|
||||||
|
|
@ -939,9 +920,7 @@ func (c *Conn) advanceFrame() (int, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.readLimit > 0 && c.readLength > c.readLimit {
|
if c.readLimit > 0 && c.readLength > c.readLimit {
|
||||||
if err := c.WriteControl(CloseMessage, FormatCloseMessage(CloseMessageTooBig, ""), time.Now().Add(writeWait)); err != nil {
|
c.WriteControl(CloseMessage, FormatCloseMessage(CloseMessageTooBig, ""), time.Now().Add(writeWait))
|
||||||
return noFrame, err
|
|
||||||
}
|
|
||||||
return noFrame, ErrReadLimit
|
return noFrame, ErrReadLimit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -953,9 +932,7 @@ func (c *Conn) advanceFrame() (int, error) {
|
||||||
var payload []byte
|
var payload []byte
|
||||||
if c.readRemaining > 0 {
|
if c.readRemaining > 0 {
|
||||||
payload, err = c.read(int(c.readRemaining))
|
payload, err = c.read(int(c.readRemaining))
|
||||||
if err := c.setReadRemaining(0); err != nil {
|
c.setReadRemaining(0)
|
||||||
return noFrame, err
|
|
||||||
}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return noFrame, err
|
return noFrame, err
|
||||||
}
|
}
|
||||||
|
|
@ -1002,9 +979,7 @@ func (c *Conn) handleProtocolError(message string) error {
|
||||||
if len(data) > maxControlFramePayloadSize {
|
if len(data) > maxControlFramePayloadSize {
|
||||||
data = data[:maxControlFramePayloadSize]
|
data = data[:maxControlFramePayloadSize]
|
||||||
}
|
}
|
||||||
if err := c.WriteControl(CloseMessage, data, time.Now().Add(writeWait)); err != nil {
|
c.WriteControl(CloseMessage, data, time.Now().Add(writeWait))
|
||||||
return err
|
|
||||||
}
|
|
||||||
return errors.New("websocket: " + message)
|
return errors.New("websocket: " + message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1021,9 +996,7 @@ func (c *Conn) handleProtocolError(message string) error {
|
||||||
func (c *Conn) NextReader() (messageType int, r io.Reader, err error) {
|
func (c *Conn) NextReader() (messageType int, r io.Reader, err error) {
|
||||||
// Close previous reader, only relevant for decompression.
|
// Close previous reader, only relevant for decompression.
|
||||||
if c.reader != nil {
|
if c.reader != nil {
|
||||||
if err := c.reader.Close(); err != nil {
|
c.reader.Close()
|
||||||
log.Printf("websocket: discarding reader close error: %v", err)
|
|
||||||
}
|
|
||||||
c.reader = nil
|
c.reader = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1033,7 +1006,7 @@ func (c *Conn) NextReader() (messageType int, r io.Reader, err error) {
|
||||||
for c.readErr == nil {
|
for c.readErr == nil {
|
||||||
frameType, err := c.advanceFrame()
|
frameType, err := c.advanceFrame()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.readErr = hideTempErr(err)
|
c.readErr = err
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1073,15 +1046,13 @@ func (r *messageReader) Read(b []byte) (int, error) {
|
||||||
b = b[:c.readRemaining]
|
b = b[:c.readRemaining]
|
||||||
}
|
}
|
||||||
n, err := c.br.Read(b)
|
n, err := c.br.Read(b)
|
||||||
c.readErr = hideTempErr(err)
|
c.readErr = err
|
||||||
if c.isServer {
|
if c.isServer {
|
||||||
c.readMaskPos = maskBytes(c.readMaskKey, c.readMaskPos, b[:n])
|
c.readMaskPos = maskBytes(c.readMaskKey, c.readMaskPos, b[:n])
|
||||||
}
|
}
|
||||||
rem := c.readRemaining
|
rem := c.readRemaining
|
||||||
rem -= int64(n)
|
rem -= int64(n)
|
||||||
if err := c.setReadRemaining(rem); err != nil {
|
c.setReadRemaining(rem)
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
if c.readRemaining > 0 && c.readErr == io.EOF {
|
if c.readRemaining > 0 && c.readErr == io.EOF {
|
||||||
c.readErr = errUnexpectedEOF
|
c.readErr = errUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
|
@ -1096,7 +1067,7 @@ func (r *messageReader) Read(b []byte) (int, error) {
|
||||||
frameType, err := c.advanceFrame()
|
frameType, err := c.advanceFrame()
|
||||||
switch {
|
switch {
|
||||||
case err != nil:
|
case err != nil:
|
||||||
c.readErr = hideTempErr(err)
|
c.readErr = err
|
||||||
case frameType == TextMessage || frameType == BinaryMessage:
|
case frameType == TextMessage || frameType == BinaryMessage:
|
||||||
c.readErr = errors.New("websocket: internal error, unexpected text or binary in Reader")
|
c.readErr = errors.New("websocket: internal error, unexpected text or binary in Reader")
|
||||||
}
|
}
|
||||||
|
|
@ -1163,9 +1134,7 @@ func (c *Conn) SetCloseHandler(h func(code int, text string) error) {
|
||||||
if h == nil {
|
if h == nil {
|
||||||
h = func(code int, text string) error {
|
h = func(code int, text string) error {
|
||||||
message := FormatCloseMessage(code, "")
|
message := FormatCloseMessage(code, "")
|
||||||
if err := c.WriteControl(CloseMessage, message, time.Now().Add(writeWait)); err != nil {
|
c.WriteControl(CloseMessage, message, time.Now().Add(writeWait))
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1187,13 +1156,9 @@ func (c *Conn) PingHandler() func(appData string) error {
|
||||||
func (c *Conn) SetPingHandler(h func(appData string) error) {
|
func (c *Conn) SetPingHandler(h func(appData string) error) {
|
||||||
if h == nil {
|
if h == nil {
|
||||||
h = func(message string) error {
|
h = func(message string) error {
|
||||||
err := c.WriteControl(PongMessage, []byte(message), time.Now().Add(writeWait))
|
// Make a best effort to send the pong mesage.
|
||||||
if err == ErrCloseSent {
|
_ = c.WriteControl(PongMessage, []byte(message), time.Now().Add(writeWait))
|
||||||
return nil
|
return nil
|
||||||
} else if _, ok := err.(net.Error); ok {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
c.handlePing = h
|
c.handlePing = h
|
||||||
|
|
|
||||||
4
vendor/github.com/gorilla/websocket/mask.go
generated
vendored
4
vendor/github.com/gorilla/websocket/mask.go
generated
vendored
|
|
@ -9,7 +9,6 @@ package websocket
|
||||||
|
|
||||||
import "unsafe"
|
import "unsafe"
|
||||||
|
|
||||||
// #nosec G103 -- (CWE-242) Has been audited
|
|
||||||
const wordSize = int(unsafe.Sizeof(uintptr(0)))
|
const wordSize = int(unsafe.Sizeof(uintptr(0)))
|
||||||
|
|
||||||
func maskBytes(key [4]byte, pos int, b []byte) int {
|
func maskBytes(key [4]byte, pos int, b []byte) int {
|
||||||
|
|
@ -23,7 +22,6 @@ func maskBytes(key [4]byte, pos int, b []byte) int {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mask one byte at a time to word boundary.
|
// Mask one byte at a time to word boundary.
|
||||||
//#nosec G103 -- (CWE-242) Has been audited
|
|
||||||
if n := int(uintptr(unsafe.Pointer(&b[0]))) % wordSize; n != 0 {
|
if n := int(uintptr(unsafe.Pointer(&b[0]))) % wordSize; n != 0 {
|
||||||
n = wordSize - n
|
n = wordSize - n
|
||||||
for i := range b[:n] {
|
for i := range b[:n] {
|
||||||
|
|
@ -38,13 +36,11 @@ func maskBytes(key [4]byte, pos int, b []byte) int {
|
||||||
for i := range k {
|
for i := range k {
|
||||||
k[i] = key[(pos+i)&3]
|
k[i] = key[(pos+i)&3]
|
||||||
}
|
}
|
||||||
//#nosec G103 -- (CWE-242) Has been audited
|
|
||||||
kw := *(*uintptr)(unsafe.Pointer(&k))
|
kw := *(*uintptr)(unsafe.Pointer(&k))
|
||||||
|
|
||||||
// Mask one word at a time.
|
// Mask one word at a time.
|
||||||
n := (len(b) / wordSize) * wordSize
|
n := (len(b) / wordSize) * wordSize
|
||||||
for i := 0; i < n; i += wordSize {
|
for i := 0; i < n; i += wordSize {
|
||||||
//#nosec G103 -- (CWE-242) Has been audited
|
|
||||||
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&b[0])) + uintptr(i))) ^= kw
|
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&b[0])) + uintptr(i))) ^= kw
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
59
vendor/github.com/gorilla/websocket/proxy.go
generated
vendored
59
vendor/github.com/gorilla/websocket/proxy.go
generated
vendored
|
|
@ -6,9 +6,10 @@ package websocket
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
|
"bytes"
|
||||||
|
"context"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"errors"
|
"errors"
|
||||||
"log"
|
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
@ -17,26 +18,40 @@ import (
|
||||||
"golang.org/x/net/proxy"
|
"golang.org/x/net/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
type netDialerFunc func(network, addr string) (net.Conn, error)
|
type netDialerFunc func(ctx context.Context, network, addr string) (net.Conn, error)
|
||||||
|
|
||||||
func (fn netDialerFunc) Dial(network, addr string) (net.Conn, error) {
|
func (fn netDialerFunc) Dial(network, addr string) (net.Conn, error) {
|
||||||
return fn(network, addr)
|
return fn(context.Background(), network, addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func (fn netDialerFunc) DialContext(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||||
proxy.RegisterDialerType("http", func(proxyURL *url.URL, forwardDialer proxy.Dialer) (proxy.Dialer, error) {
|
return fn(ctx, network, addr)
|
||||||
return &httpProxyDialer{proxyURL: proxyURL, forwardDial: forwardDialer.Dial}, nil
|
}
|
||||||
})
|
|
||||||
|
func proxyFromURL(proxyURL *url.URL, forwardDial netDialerFunc) (netDialerFunc, error) {
|
||||||
|
if proxyURL.Scheme == "http" {
|
||||||
|
return (&httpProxyDialer{proxyURL: proxyURL, forwardDial: forwardDial}).DialContext, nil
|
||||||
|
}
|
||||||
|
dialer, err := proxy.FromURL(proxyURL, forwardDial)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if d, ok := dialer.(proxy.ContextDialer); ok {
|
||||||
|
return d.DialContext, nil
|
||||||
|
}
|
||||||
|
return func(ctx context.Context, net, addr string) (net.Conn, error) {
|
||||||
|
return dialer.Dial(net, addr)
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type httpProxyDialer struct {
|
type httpProxyDialer struct {
|
||||||
proxyURL *url.URL
|
proxyURL *url.URL
|
||||||
forwardDial func(network, addr string) (net.Conn, error)
|
forwardDial netDialerFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
func (hpd *httpProxyDialer) Dial(network string, addr string) (net.Conn, error) {
|
func (hpd *httpProxyDialer) DialContext(ctx context.Context, network string, addr string) (net.Conn, error) {
|
||||||
hostPort, _ := hostPortNoPort(hpd.proxyURL)
|
hostPort, _ := hostPortNoPort(hpd.proxyURL)
|
||||||
conn, err := hpd.forwardDial(network, hostPort)
|
conn, err := hpd.forwardDial(ctx, network, hostPort)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -58,9 +73,7 @@ func (hpd *httpProxyDialer) Dial(network string, addr string) (net.Conn, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := connectReq.Write(conn); err != nil {
|
if err := connectReq.Write(conn); err != nil {
|
||||||
if err := conn.Close(); err != nil {
|
conn.Close()
|
||||||
log.Printf("httpProxyDialer: failed to close connection: %v", err)
|
|
||||||
}
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,16 +82,22 @@ func (hpd *httpProxyDialer) Dial(network string, addr string) (net.Conn, error)
|
||||||
br := bufio.NewReader(conn)
|
br := bufio.NewReader(conn)
|
||||||
resp, err := http.ReadResponse(br, connectReq)
|
resp, err := http.ReadResponse(br, connectReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err := conn.Close(); err != nil {
|
conn.Close()
|
||||||
log.Printf("httpProxyDialer: failed to close connection: %v", err)
|
|
||||||
}
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp.StatusCode != 200 {
|
// Close the response body to silence false positives from linters. Reset
|
||||||
if err := conn.Close(); err != nil {
|
// the buffered reader first to ensure that Close() does not read from
|
||||||
log.Printf("httpProxyDialer: failed to close connection: %v", err)
|
// conn.
|
||||||
}
|
// Note: Applications must call resp.Body.Close() on a response returned
|
||||||
|
// http.ReadResponse to inspect trailers or read another response from the
|
||||||
|
// buffered reader. The call to resp.Body.Close() does not release
|
||||||
|
// resources.
|
||||||
|
br.Reset(bytes.NewReader(nil))
|
||||||
|
_ = resp.Body.Close()
|
||||||
|
|
||||||
|
if resp.StatusCode != http.StatusOK {
|
||||||
|
_ = conn.Close()
|
||||||
f := strings.SplitN(resp.Status, " ", 2)
|
f := strings.SplitN(resp.Status, " ", 2)
|
||||||
return nil, errors.New(f[1])
|
return nil, errors.New(f[1])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
120
vendor/github.com/gorilla/websocket/server.go
generated
vendored
120
vendor/github.com/gorilla/websocket/server.go
generated
vendored
|
|
@ -6,9 +6,7 @@ package websocket
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"errors"
|
"net"
|
||||||
"io"
|
|
||||||
"log"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -102,8 +100,8 @@ func checkSameOrigin(r *http.Request) bool {
|
||||||
func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header) string {
|
func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header) string {
|
||||||
if u.Subprotocols != nil {
|
if u.Subprotocols != nil {
|
||||||
clientProtocols := Subprotocols(r)
|
clientProtocols := Subprotocols(r)
|
||||||
for _, serverProtocol := range u.Subprotocols {
|
for _, clientProtocol := range clientProtocols {
|
||||||
for _, clientProtocol := range clientProtocols {
|
for _, serverProtocol := range u.Subprotocols {
|
||||||
if clientProtocol == serverProtocol {
|
if clientProtocol == serverProtocol {
|
||||||
return clientProtocol
|
return clientProtocol
|
||||||
}
|
}
|
||||||
|
|
@ -131,7 +129,8 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
|
||||||
}
|
}
|
||||||
|
|
||||||
if !tokenListContainsValue(r.Header, "Upgrade", "websocket") {
|
if !tokenListContainsValue(r.Header, "Upgrade", "websocket") {
|
||||||
return u.returnError(w, r, http.StatusBadRequest, badHandshake+"'websocket' token not found in 'Upgrade' header")
|
w.Header().Set("Upgrade", "websocket")
|
||||||
|
return u.returnError(w, r, http.StatusUpgradeRequired, badHandshake+"'websocket' token not found in 'Upgrade' header")
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.Method != http.MethodGet {
|
if r.Method != http.MethodGet {
|
||||||
|
|
@ -173,30 +172,25 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h, ok := w.(http.Hijacker)
|
netConn, brw, err := http.NewResponseController(w).Hijack()
|
||||||
if !ok {
|
|
||||||
return u.returnError(w, r, http.StatusInternalServerError, "websocket: response does not implement http.Hijacker")
|
|
||||||
}
|
|
||||||
var brw *bufio.ReadWriter
|
|
||||||
netConn, brw, err := h.Hijack()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return u.returnError(w, r, http.StatusInternalServerError, err.Error())
|
return u.returnError(w, r, http.StatusInternalServerError,
|
||||||
}
|
"websocket: hijack: "+err.Error())
|
||||||
|
|
||||||
if brw.Reader.Buffered() > 0 {
|
|
||||||
if err := netConn.Close(); err != nil {
|
|
||||||
log.Printf("websocket: failed to close network connection: %v", err)
|
|
||||||
}
|
|
||||||
return nil, errors.New("websocket: client sent data before handshake is complete")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var br *bufio.Reader
|
var br *bufio.Reader
|
||||||
if u.ReadBufferSize == 0 && bufioReaderSize(netConn, brw.Reader) > 256 {
|
if u.ReadBufferSize == 0 && brw.Reader.Size() > 256 {
|
||||||
// Reuse hijacked buffered reader as connection reader.
|
// Use hijacked buffered reader as the connection reader.
|
||||||
br = brw.Reader
|
br = brw.Reader
|
||||||
|
} else if brw.Reader.Buffered() > 0 {
|
||||||
|
// Wrap the network connection to read buffered data in brw.Reader
|
||||||
|
// before reading from the network connection. This should be rare
|
||||||
|
// because a client must not send message data before receiving the
|
||||||
|
// handshake response.
|
||||||
|
netConn = &brNetConn{br: brw.Reader, Conn: netConn}
|
||||||
}
|
}
|
||||||
|
|
||||||
buf := bufioWriterBuffer(netConn, brw.Writer)
|
buf := brw.Writer.AvailableBuffer()
|
||||||
|
|
||||||
var writeBuf []byte
|
var writeBuf []byte
|
||||||
if u.WriteBufferPool == nil && u.WriteBufferSize == 0 && len(buf) >= maxFrameHeaderSize+256 {
|
if u.WriteBufferPool == nil && u.WriteBufferSize == 0 && len(buf) >= maxFrameHeaderSize+256 {
|
||||||
|
|
@ -251,34 +245,17 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
|
||||||
p = append(p, "\r\n"...)
|
p = append(p, "\r\n"...)
|
||||||
|
|
||||||
// Clear deadlines set by HTTP server.
|
// Clear deadlines set by HTTP server.
|
||||||
if err := netConn.SetDeadline(time.Time{}); err != nil {
|
netConn.SetDeadline(time.Time{})
|
||||||
if err := netConn.Close(); err != nil {
|
|
||||||
log.Printf("websocket: failed to close network connection: %v", err)
|
|
||||||
}
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if u.HandshakeTimeout > 0 {
|
if u.HandshakeTimeout > 0 {
|
||||||
if err := netConn.SetWriteDeadline(time.Now().Add(u.HandshakeTimeout)); err != nil {
|
netConn.SetWriteDeadline(time.Now().Add(u.HandshakeTimeout))
|
||||||
if err := netConn.Close(); err != nil {
|
|
||||||
log.Printf("websocket: failed to close network connection: %v", err)
|
|
||||||
}
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if _, err = netConn.Write(p); err != nil {
|
if _, err = netConn.Write(p); err != nil {
|
||||||
if err := netConn.Close(); err != nil {
|
netConn.Close()
|
||||||
log.Printf("websocket: failed to close network connection: %v", err)
|
|
||||||
}
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if u.HandshakeTimeout > 0 {
|
if u.HandshakeTimeout > 0 {
|
||||||
if err := netConn.SetWriteDeadline(time.Time{}); err != nil {
|
netConn.SetWriteDeadline(time.Time{})
|
||||||
if err := netConn.Close(); err != nil {
|
|
||||||
log.Printf("websocket: failed to close network connection: %v", err)
|
|
||||||
}
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return c, nil
|
return c, nil
|
||||||
|
|
@ -347,43 +324,28 @@ func IsWebSocketUpgrade(r *http.Request) bool {
|
||||||
tokenListContainsValue(r.Header, "Upgrade", "websocket")
|
tokenListContainsValue(r.Header, "Upgrade", "websocket")
|
||||||
}
|
}
|
||||||
|
|
||||||
// bufioReaderSize size returns the size of a bufio.Reader.
|
type brNetConn struct {
|
||||||
func bufioReaderSize(originalReader io.Reader, br *bufio.Reader) int {
|
br *bufio.Reader
|
||||||
// This code assumes that peek on a reset reader returns
|
net.Conn
|
||||||
// bufio.Reader.buf[:0].
|
}
|
||||||
// TODO: Use bufio.Reader.Size() after Go 1.10
|
|
||||||
br.Reset(originalReader)
|
func (b *brNetConn) Read(p []byte) (n int, err error) {
|
||||||
if p, err := br.Peek(0); err == nil {
|
if b.br != nil {
|
||||||
return cap(p)
|
// Limit read to buferred data.
|
||||||
|
if n := b.br.Buffered(); len(p) > n {
|
||||||
|
p = p[:n]
|
||||||
|
}
|
||||||
|
n, err = b.br.Read(p)
|
||||||
|
if b.br.Buffered() == 0 {
|
||||||
|
b.br = nil
|
||||||
|
}
|
||||||
|
return n, err
|
||||||
}
|
}
|
||||||
return 0
|
return b.Conn.Read(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
// writeHook is an io.Writer that records the last slice passed to it vio
|
// NetConn returns the underlying connection that is wrapped by b.
|
||||||
// io.Writer.Write.
|
func (b *brNetConn) NetConn() net.Conn {
|
||||||
type writeHook struct {
|
return b.Conn
|
||||||
p []byte
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (wh *writeHook) Write(p []byte) (int, error) {
|
|
||||||
wh.p = p
|
|
||||||
return len(p), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// bufioWriterBuffer grabs the buffer from a bufio.Writer.
|
|
||||||
func bufioWriterBuffer(originalWriter io.Writer, bw *bufio.Writer) []byte {
|
|
||||||
// This code assumes that bufio.Writer.buf[:1] is passed to the
|
|
||||||
// bufio.Writer's underlying writer.
|
|
||||||
var wh writeHook
|
|
||||||
bw.Reset(&wh)
|
|
||||||
if err := bw.WriteByte(0); err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
if err := bw.Flush(); err != nil {
|
|
||||||
log.Printf("websocket: bufioWriterBuffer: Flush: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
bw.Reset(originalWriter)
|
|
||||||
|
|
||||||
return wh.p[:cap(wh.p)]
|
|
||||||
}
|
|
||||||
|
|
|
||||||
18
vendor/github.com/gorilla/websocket/tls_handshake.go
generated
vendored
18
vendor/github.com/gorilla/websocket/tls_handshake.go
generated
vendored
|
|
@ -1,18 +0,0 @@
|
||||||
package websocket
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"crypto/tls"
|
|
||||||
)
|
|
||||||
|
|
||||||
func doHandshake(ctx context.Context, tlsConn *tls.Conn, cfg *tls.Config) error {
|
|
||||||
if err := tlsConn.HandshakeContext(ctx); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if !cfg.InsecureSkipVerify {
|
|
||||||
if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
4
vendor/github.com/gorilla/websocket/util.go
generated
vendored
4
vendor/github.com/gorilla/websocket/util.go
generated
vendored
|
|
@ -6,7 +6,7 @@ package websocket
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"crypto/sha1" //#nosec G505 -- (CWE-327) https://datatracker.ietf.org/doc/html/rfc6455#page-54
|
"crypto/sha1"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
@ -17,7 +17,7 @@ import (
|
||||||
var keyGUID = []byte("258EAFA5-E914-47DA-95CA-C5AB0DC85B11")
|
var keyGUID = []byte("258EAFA5-E914-47DA-95CA-C5AB0DC85B11")
|
||||||
|
|
||||||
func computeAcceptKey(challengeKey string) string {
|
func computeAcceptKey(challengeKey string) string {
|
||||||
h := sha1.New() //#nosec G401 -- (CWE-326) https://datatracker.ietf.org/doc/html/rfc6455#page-54
|
h := sha1.New()
|
||||||
h.Write([]byte(challengeKey))
|
h.Write([]byte(challengeKey))
|
||||||
h.Write(keyGUID)
|
h.Write(keyGUID)
|
||||||
return base64.StdEncoding.EncodeToString(h.Sum(nil))
|
return base64.StdEncoding.EncodeToString(h.Sum(nil))
|
||||||
|
|
|
||||||
8
vendor/golang.org/x/net/proxy/per_host.go
generated
vendored
8
vendor/golang.org/x/net/proxy/per_host.go
generated
vendored
|
|
@ -137,9 +137,7 @@ func (p *PerHost) AddNetwork(net *net.IPNet) {
|
||||||
// AddZone specifies a DNS suffix that will use the bypass proxy. A zone of
|
// AddZone specifies a DNS suffix that will use the bypass proxy. A zone of
|
||||||
// "example.com" matches "example.com" and all of its subdomains.
|
// "example.com" matches "example.com" and all of its subdomains.
|
||||||
func (p *PerHost) AddZone(zone string) {
|
func (p *PerHost) AddZone(zone string) {
|
||||||
if strings.HasSuffix(zone, ".") {
|
zone = strings.TrimSuffix(zone, ".")
|
||||||
zone = zone[:len(zone)-1]
|
|
||||||
}
|
|
||||||
if !strings.HasPrefix(zone, ".") {
|
if !strings.HasPrefix(zone, ".") {
|
||||||
zone = "." + zone
|
zone = "." + zone
|
||||||
}
|
}
|
||||||
|
|
@ -148,8 +146,6 @@ func (p *PerHost) AddZone(zone string) {
|
||||||
|
|
||||||
// AddHost specifies a host name that will use the bypass proxy.
|
// AddHost specifies a host name that will use the bypass proxy.
|
||||||
func (p *PerHost) AddHost(host string) {
|
func (p *PerHost) AddHost(host string) {
|
||||||
if strings.HasSuffix(host, ".") {
|
host = strings.TrimSuffix(host, ".")
|
||||||
host = host[:len(host)-1]
|
|
||||||
}
|
|
||||||
p.bypassHosts = append(p.bypassHosts, host)
|
p.bypassHosts = append(p.bypassHosts, host)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/cpu/cpu.go
generated
vendored
1
vendor/golang.org/x/sys/cpu/cpu.go
generated
vendored
|
|
@ -103,6 +103,7 @@ var ARM64 struct {
|
||||||
HasASIMDDP bool // Advanced SIMD double precision instruction set
|
HasASIMDDP bool // Advanced SIMD double precision instruction set
|
||||||
HasSHA512 bool // SHA512 hardware implementation
|
HasSHA512 bool // SHA512 hardware implementation
|
||||||
HasSVE bool // Scalable Vector Extensions
|
HasSVE bool // Scalable Vector Extensions
|
||||||
|
HasSVE2 bool // Scalable Vector Extensions 2
|
||||||
HasASIMDFHM bool // Advanced SIMD multiplication FP16 to FP32
|
HasASIMDFHM bool // Advanced SIMD multiplication FP16 to FP32
|
||||||
_ CacheLinePad
|
_ CacheLinePad
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
vendor/golang.org/x/sys/cpu/cpu_arm64.go
generated
vendored
10
vendor/golang.org/x/sys/cpu/cpu_arm64.go
generated
vendored
|
|
@ -28,6 +28,7 @@ func initOptions() {
|
||||||
{Name: "sm3", Feature: &ARM64.HasSM3},
|
{Name: "sm3", Feature: &ARM64.HasSM3},
|
||||||
{Name: "sm4", Feature: &ARM64.HasSM4},
|
{Name: "sm4", Feature: &ARM64.HasSM4},
|
||||||
{Name: "sve", Feature: &ARM64.HasSVE},
|
{Name: "sve", Feature: &ARM64.HasSVE},
|
||||||
|
{Name: "sve2", Feature: &ARM64.HasSVE2},
|
||||||
{Name: "crc32", Feature: &ARM64.HasCRC32},
|
{Name: "crc32", Feature: &ARM64.HasCRC32},
|
||||||
{Name: "atomics", Feature: &ARM64.HasATOMICS},
|
{Name: "atomics", Feature: &ARM64.HasATOMICS},
|
||||||
{Name: "asimdhp", Feature: &ARM64.HasASIMDHP},
|
{Name: "asimdhp", Feature: &ARM64.HasASIMDHP},
|
||||||
|
|
@ -164,6 +165,15 @@ func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) {
|
||||||
switch extractBits(pfr0, 32, 35) {
|
switch extractBits(pfr0, 32, 35) {
|
||||||
case 1:
|
case 1:
|
||||||
ARM64.HasSVE = true
|
ARM64.HasSVE = true
|
||||||
|
|
||||||
|
parseARM64SVERegister(getzfr0())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func parseARM64SVERegister(zfr0 uint64) {
|
||||||
|
switch extractBits(zfr0, 0, 3) {
|
||||||
|
case 1:
|
||||||
|
ARM64.HasSVE2 = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
8
vendor/golang.org/x/sys/cpu/cpu_arm64.s
generated
vendored
8
vendor/golang.org/x/sys/cpu/cpu_arm64.s
generated
vendored
|
|
@ -29,3 +29,11 @@ TEXT ·getpfr0(SB),NOSPLIT,$0-8
|
||||||
WORD $0xd5380400
|
WORD $0xd5380400
|
||||||
MOVD R0, ret+0(FP)
|
MOVD R0, ret+0(FP)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
|
// func getzfr0() uint64
|
||||||
|
TEXT ·getzfr0(SB),NOSPLIT,$0-8
|
||||||
|
// get SVE Feature Register 0 into x0
|
||||||
|
// mrs x0, ID_AA64ZFR0_EL1 = d5380480
|
||||||
|
WORD $0xd5380480
|
||||||
|
MOVD R0, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go
generated
vendored
1
vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go
generated
vendored
|
|
@ -9,3 +9,4 @@ package cpu
|
||||||
func getisar0() uint64
|
func getisar0() uint64
|
||||||
func getisar1() uint64
|
func getisar1() uint64
|
||||||
func getpfr0() uint64
|
func getpfr0() uint64
|
||||||
|
func getzfr0() uint64
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
generated
vendored
5
vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
generated
vendored
|
|
@ -35,6 +35,8 @@ const (
|
||||||
hwcap_SHA512 = 1 << 21
|
hwcap_SHA512 = 1 << 21
|
||||||
hwcap_SVE = 1 << 22
|
hwcap_SVE = 1 << 22
|
||||||
hwcap_ASIMDFHM = 1 << 23
|
hwcap_ASIMDFHM = 1 << 23
|
||||||
|
|
||||||
|
hwcap2_SVE2 = 1 << 1
|
||||||
)
|
)
|
||||||
|
|
||||||
// linuxKernelCanEmulateCPUID reports whether we're running
|
// linuxKernelCanEmulateCPUID reports whether we're running
|
||||||
|
|
@ -104,6 +106,9 @@ func doinit() {
|
||||||
ARM64.HasSHA512 = isSet(hwCap, hwcap_SHA512)
|
ARM64.HasSHA512 = isSet(hwCap, hwcap_SHA512)
|
||||||
ARM64.HasSVE = isSet(hwCap, hwcap_SVE)
|
ARM64.HasSVE = isSet(hwCap, hwcap_SVE)
|
||||||
ARM64.HasASIMDFHM = isSet(hwCap, hwcap_ASIMDFHM)
|
ARM64.HasASIMDFHM = isSet(hwCap, hwcap_ASIMDFHM)
|
||||||
|
|
||||||
|
// HWCAP2 feature bits
|
||||||
|
ARM64.HasSVE2 = isSet(hwCap2, hwcap2_SVE2)
|
||||||
}
|
}
|
||||||
|
|
||||||
func isSet(hwc uint, value uint) bool {
|
func isSet(hwc uint, value uint) bool {
|
||||||
|
|
|
||||||
675
vendor/golang.org/x/sys/unix/asm_zos_s390x.s
generated
vendored
675
vendor/golang.org/x/sys/unix/asm_zos_s390x.s
generated
vendored
|
|
@ -9,9 +9,11 @@
|
||||||
#define PSALAA 1208(R0)
|
#define PSALAA 1208(R0)
|
||||||
#define GTAB64(x) 80(x)
|
#define GTAB64(x) 80(x)
|
||||||
#define LCA64(x) 88(x)
|
#define LCA64(x) 88(x)
|
||||||
|
#define SAVSTACK_ASYNC(x) 336(x) // in the LCA
|
||||||
#define CAA(x) 8(x)
|
#define CAA(x) 8(x)
|
||||||
#define EDCHPXV(x) 1016(x) // in the CAA
|
#define CEECAATHDID(x) 976(x) // in the CAA
|
||||||
#define SAVSTACK_ASYNC(x) 336(x) // in the LCA
|
#define EDCHPXV(x) 1016(x) // in the CAA
|
||||||
|
#define GOCB(x) 1104(x) // in the CAA
|
||||||
|
|
||||||
// SS_*, where x=SAVSTACK_ASYNC
|
// SS_*, where x=SAVSTACK_ASYNC
|
||||||
#define SS_LE(x) 0(x)
|
#define SS_LE(x) 0(x)
|
||||||
|
|
@ -19,394 +21,125 @@
|
||||||
#define SS_ERRNO(x) 16(x)
|
#define SS_ERRNO(x) 16(x)
|
||||||
#define SS_ERRNOJR(x) 20(x)
|
#define SS_ERRNOJR(x) 20(x)
|
||||||
|
|
||||||
#define LE_CALL BYTE $0x0D; BYTE $0x76; // BL R7, R6
|
// Function Descriptor Offsets
|
||||||
|
#define __errno 0x156*16
|
||||||
|
#define __err2ad 0x16C*16
|
||||||
|
|
||||||
TEXT ·clearErrno(SB),NOSPLIT,$0-0
|
// Call Instructions
|
||||||
BL addrerrno<>(SB)
|
#define LE_CALL BYTE $0x0D; BYTE $0x76 // BL R7, R6
|
||||||
MOVD $0, 0(R3)
|
#define SVC_LOAD BYTE $0x0A; BYTE $0x08 // SVC 08 LOAD
|
||||||
|
#define SVC_DELETE BYTE $0x0A; BYTE $0x09 // SVC 09 DELETE
|
||||||
|
|
||||||
|
DATA zosLibVec<>(SB)/8, $0
|
||||||
|
GLOBL zosLibVec<>(SB), NOPTR, $8
|
||||||
|
|
||||||
|
TEXT ·initZosLibVec(SB), NOSPLIT|NOFRAME, $0-0
|
||||||
|
MOVW PSALAA, R8
|
||||||
|
MOVD LCA64(R8), R8
|
||||||
|
MOVD CAA(R8), R8
|
||||||
|
MOVD EDCHPXV(R8), R8
|
||||||
|
MOVD R8, zosLibVec<>(SB)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·GetZosLibVec(SB), NOSPLIT|NOFRAME, $0-0
|
||||||
|
MOVD zosLibVec<>(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·clearErrno(SB), NOSPLIT, $0-0
|
||||||
|
BL addrerrno<>(SB)
|
||||||
|
MOVD $0, 0(R3)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
// Returns the address of errno in R3.
|
// Returns the address of errno in R3.
|
||||||
TEXT addrerrno<>(SB),NOSPLIT|NOFRAME,$0-0
|
TEXT addrerrno<>(SB), NOSPLIT|NOFRAME, $0-0
|
||||||
// Get library control area (LCA).
|
// Get library control area (LCA).
|
||||||
MOVW PSALAA, R8
|
MOVW PSALAA, R8
|
||||||
MOVD LCA64(R8), R8
|
MOVD LCA64(R8), R8
|
||||||
|
|
||||||
// Get __errno FuncDesc.
|
// Get __errno FuncDesc.
|
||||||
MOVD CAA(R8), R9
|
MOVD CAA(R8), R9
|
||||||
MOVD EDCHPXV(R9), R9
|
MOVD EDCHPXV(R9), R9
|
||||||
ADD $(0x156*16), R9
|
ADD $(__errno), R9
|
||||||
LMG 0(R9), R5, R6
|
LMG 0(R9), R5, R6
|
||||||
|
|
||||||
// Switch to saved LE stack.
|
// Switch to saved LE stack.
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
MOVD SAVSTACK_ASYNC(R8), R9
|
||||||
MOVD 0(R9), R4
|
MOVD 0(R9), R4
|
||||||
MOVD $0, 0(R9)
|
MOVD $0, 0(R9)
|
||||||
|
|
||||||
// Call __errno function.
|
// Call __errno function.
|
||||||
LE_CALL
|
LE_CALL
|
||||||
NOPH
|
NOPH
|
||||||
|
|
||||||
// Switch back to Go stack.
|
// Switch back to Go stack.
|
||||||
XOR R0, R0 // Restore R0 to $0.
|
XOR R0, R0 // Restore R0 to $0.
|
||||||
MOVD R4, 0(R9) // Save stack pointer.
|
MOVD R4, 0(R9) // Save stack pointer.
|
||||||
RET
|
|
||||||
|
|
||||||
TEXT ·syscall_syscall(SB),NOSPLIT,$0-56
|
|
||||||
BL runtime·entersyscall(SB)
|
|
||||||
MOVD a1+8(FP), R1
|
|
||||||
MOVD a2+16(FP), R2
|
|
||||||
MOVD a3+24(FP), R3
|
|
||||||
|
|
||||||
// Get library control area (LCA).
|
|
||||||
MOVW PSALAA, R8
|
|
||||||
MOVD LCA64(R8), R8
|
|
||||||
|
|
||||||
// Get function.
|
|
||||||
MOVD CAA(R8), R9
|
|
||||||
MOVD EDCHPXV(R9), R9
|
|
||||||
MOVD trap+0(FP), R5
|
|
||||||
SLD $4, R5
|
|
||||||
ADD R5, R9
|
|
||||||
LMG 0(R9), R5, R6
|
|
||||||
|
|
||||||
// Restore LE stack.
|
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
|
||||||
MOVD 0(R9), R4
|
|
||||||
MOVD $0, 0(R9)
|
|
||||||
|
|
||||||
// Call function.
|
|
||||||
LE_CALL
|
|
||||||
NOPH
|
|
||||||
XOR R0, R0 // Restore R0 to $0.
|
|
||||||
MOVD R4, 0(R9) // Save stack pointer.
|
|
||||||
|
|
||||||
MOVD R3, r1+32(FP)
|
|
||||||
MOVD R0, r2+40(FP)
|
|
||||||
MOVD R0, err+48(FP)
|
|
||||||
MOVW R3, R4
|
|
||||||
CMP R4, $-1
|
|
||||||
BNE done
|
|
||||||
BL addrerrno<>(SB)
|
|
||||||
MOVWZ 0(R3), R3
|
|
||||||
MOVD R3, err+48(FP)
|
|
||||||
done:
|
|
||||||
BL runtime·exitsyscall(SB)
|
|
||||||
RET
|
|
||||||
|
|
||||||
TEXT ·syscall_rawsyscall(SB),NOSPLIT,$0-56
|
|
||||||
MOVD a1+8(FP), R1
|
|
||||||
MOVD a2+16(FP), R2
|
|
||||||
MOVD a3+24(FP), R3
|
|
||||||
|
|
||||||
// Get library control area (LCA).
|
|
||||||
MOVW PSALAA, R8
|
|
||||||
MOVD LCA64(R8), R8
|
|
||||||
|
|
||||||
// Get function.
|
|
||||||
MOVD CAA(R8), R9
|
|
||||||
MOVD EDCHPXV(R9), R9
|
|
||||||
MOVD trap+0(FP), R5
|
|
||||||
SLD $4, R5
|
|
||||||
ADD R5, R9
|
|
||||||
LMG 0(R9), R5, R6
|
|
||||||
|
|
||||||
// Restore LE stack.
|
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
|
||||||
MOVD 0(R9), R4
|
|
||||||
MOVD $0, 0(R9)
|
|
||||||
|
|
||||||
// Call function.
|
|
||||||
LE_CALL
|
|
||||||
NOPH
|
|
||||||
XOR R0, R0 // Restore R0 to $0.
|
|
||||||
MOVD R4, 0(R9) // Save stack pointer.
|
|
||||||
|
|
||||||
MOVD R3, r1+32(FP)
|
|
||||||
MOVD R0, r2+40(FP)
|
|
||||||
MOVD R0, err+48(FP)
|
|
||||||
MOVW R3, R4
|
|
||||||
CMP R4, $-1
|
|
||||||
BNE done
|
|
||||||
BL addrerrno<>(SB)
|
|
||||||
MOVWZ 0(R3), R3
|
|
||||||
MOVD R3, err+48(FP)
|
|
||||||
done:
|
|
||||||
RET
|
|
||||||
|
|
||||||
TEXT ·syscall_syscall6(SB),NOSPLIT,$0-80
|
|
||||||
BL runtime·entersyscall(SB)
|
|
||||||
MOVD a1+8(FP), R1
|
|
||||||
MOVD a2+16(FP), R2
|
|
||||||
MOVD a3+24(FP), R3
|
|
||||||
|
|
||||||
// Get library control area (LCA).
|
|
||||||
MOVW PSALAA, R8
|
|
||||||
MOVD LCA64(R8), R8
|
|
||||||
|
|
||||||
// Get function.
|
|
||||||
MOVD CAA(R8), R9
|
|
||||||
MOVD EDCHPXV(R9), R9
|
|
||||||
MOVD trap+0(FP), R5
|
|
||||||
SLD $4, R5
|
|
||||||
ADD R5, R9
|
|
||||||
LMG 0(R9), R5, R6
|
|
||||||
|
|
||||||
// Restore LE stack.
|
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
|
||||||
MOVD 0(R9), R4
|
|
||||||
MOVD $0, 0(R9)
|
|
||||||
|
|
||||||
// Fill in parameter list.
|
|
||||||
MOVD a4+32(FP), R12
|
|
||||||
MOVD R12, (2176+24)(R4)
|
|
||||||
MOVD a5+40(FP), R12
|
|
||||||
MOVD R12, (2176+32)(R4)
|
|
||||||
MOVD a6+48(FP), R12
|
|
||||||
MOVD R12, (2176+40)(R4)
|
|
||||||
|
|
||||||
// Call function.
|
|
||||||
LE_CALL
|
|
||||||
NOPH
|
|
||||||
XOR R0, R0 // Restore R0 to $0.
|
|
||||||
MOVD R4, 0(R9) // Save stack pointer.
|
|
||||||
|
|
||||||
MOVD R3, r1+56(FP)
|
|
||||||
MOVD R0, r2+64(FP)
|
|
||||||
MOVD R0, err+72(FP)
|
|
||||||
MOVW R3, R4
|
|
||||||
CMP R4, $-1
|
|
||||||
BNE done
|
|
||||||
BL addrerrno<>(SB)
|
|
||||||
MOVWZ 0(R3), R3
|
|
||||||
MOVD R3, err+72(FP)
|
|
||||||
done:
|
|
||||||
BL runtime·exitsyscall(SB)
|
|
||||||
RET
|
|
||||||
|
|
||||||
TEXT ·syscall_rawsyscall6(SB),NOSPLIT,$0-80
|
|
||||||
MOVD a1+8(FP), R1
|
|
||||||
MOVD a2+16(FP), R2
|
|
||||||
MOVD a3+24(FP), R3
|
|
||||||
|
|
||||||
// Get library control area (LCA).
|
|
||||||
MOVW PSALAA, R8
|
|
||||||
MOVD LCA64(R8), R8
|
|
||||||
|
|
||||||
// Get function.
|
|
||||||
MOVD CAA(R8), R9
|
|
||||||
MOVD EDCHPXV(R9), R9
|
|
||||||
MOVD trap+0(FP), R5
|
|
||||||
SLD $4, R5
|
|
||||||
ADD R5, R9
|
|
||||||
LMG 0(R9), R5, R6
|
|
||||||
|
|
||||||
// Restore LE stack.
|
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
|
||||||
MOVD 0(R9), R4
|
|
||||||
MOVD $0, 0(R9)
|
|
||||||
|
|
||||||
// Fill in parameter list.
|
|
||||||
MOVD a4+32(FP), R12
|
|
||||||
MOVD R12, (2176+24)(R4)
|
|
||||||
MOVD a5+40(FP), R12
|
|
||||||
MOVD R12, (2176+32)(R4)
|
|
||||||
MOVD a6+48(FP), R12
|
|
||||||
MOVD R12, (2176+40)(R4)
|
|
||||||
|
|
||||||
// Call function.
|
|
||||||
LE_CALL
|
|
||||||
NOPH
|
|
||||||
XOR R0, R0 // Restore R0 to $0.
|
|
||||||
MOVD R4, 0(R9) // Save stack pointer.
|
|
||||||
|
|
||||||
MOVD R3, r1+56(FP)
|
|
||||||
MOVD R0, r2+64(FP)
|
|
||||||
MOVD R0, err+72(FP)
|
|
||||||
MOVW R3, R4
|
|
||||||
CMP R4, $-1
|
|
||||||
BNE done
|
|
||||||
BL ·rrno<>(SB)
|
|
||||||
MOVWZ 0(R3), R3
|
|
||||||
MOVD R3, err+72(FP)
|
|
||||||
done:
|
|
||||||
RET
|
|
||||||
|
|
||||||
TEXT ·syscall_syscall9(SB),NOSPLIT,$0
|
|
||||||
BL runtime·entersyscall(SB)
|
|
||||||
MOVD a1+8(FP), R1
|
|
||||||
MOVD a2+16(FP), R2
|
|
||||||
MOVD a3+24(FP), R3
|
|
||||||
|
|
||||||
// Get library control area (LCA).
|
|
||||||
MOVW PSALAA, R8
|
|
||||||
MOVD LCA64(R8), R8
|
|
||||||
|
|
||||||
// Get function.
|
|
||||||
MOVD CAA(R8), R9
|
|
||||||
MOVD EDCHPXV(R9), R9
|
|
||||||
MOVD trap+0(FP), R5
|
|
||||||
SLD $4, R5
|
|
||||||
ADD R5, R9
|
|
||||||
LMG 0(R9), R5, R6
|
|
||||||
|
|
||||||
// Restore LE stack.
|
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
|
||||||
MOVD 0(R9), R4
|
|
||||||
MOVD $0, 0(R9)
|
|
||||||
|
|
||||||
// Fill in parameter list.
|
|
||||||
MOVD a4+32(FP), R12
|
|
||||||
MOVD R12, (2176+24)(R4)
|
|
||||||
MOVD a5+40(FP), R12
|
|
||||||
MOVD R12, (2176+32)(R4)
|
|
||||||
MOVD a6+48(FP), R12
|
|
||||||
MOVD R12, (2176+40)(R4)
|
|
||||||
MOVD a7+56(FP), R12
|
|
||||||
MOVD R12, (2176+48)(R4)
|
|
||||||
MOVD a8+64(FP), R12
|
|
||||||
MOVD R12, (2176+56)(R4)
|
|
||||||
MOVD a9+72(FP), R12
|
|
||||||
MOVD R12, (2176+64)(R4)
|
|
||||||
|
|
||||||
// Call function.
|
|
||||||
LE_CALL
|
|
||||||
NOPH
|
|
||||||
XOR R0, R0 // Restore R0 to $0.
|
|
||||||
MOVD R4, 0(R9) // Save stack pointer.
|
|
||||||
|
|
||||||
MOVD R3, r1+80(FP)
|
|
||||||
MOVD R0, r2+88(FP)
|
|
||||||
MOVD R0, err+96(FP)
|
|
||||||
MOVW R3, R4
|
|
||||||
CMP R4, $-1
|
|
||||||
BNE done
|
|
||||||
BL addrerrno<>(SB)
|
|
||||||
MOVWZ 0(R3), R3
|
|
||||||
MOVD R3, err+96(FP)
|
|
||||||
done:
|
|
||||||
BL runtime·exitsyscall(SB)
|
|
||||||
RET
|
|
||||||
|
|
||||||
TEXT ·syscall_rawsyscall9(SB),NOSPLIT,$0
|
|
||||||
MOVD a1+8(FP), R1
|
|
||||||
MOVD a2+16(FP), R2
|
|
||||||
MOVD a3+24(FP), R3
|
|
||||||
|
|
||||||
// Get library control area (LCA).
|
|
||||||
MOVW PSALAA, R8
|
|
||||||
MOVD LCA64(R8), R8
|
|
||||||
|
|
||||||
// Get function.
|
|
||||||
MOVD CAA(R8), R9
|
|
||||||
MOVD EDCHPXV(R9), R9
|
|
||||||
MOVD trap+0(FP), R5
|
|
||||||
SLD $4, R5
|
|
||||||
ADD R5, R9
|
|
||||||
LMG 0(R9), R5, R6
|
|
||||||
|
|
||||||
// Restore LE stack.
|
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
|
||||||
MOVD 0(R9), R4
|
|
||||||
MOVD $0, 0(R9)
|
|
||||||
|
|
||||||
// Fill in parameter list.
|
|
||||||
MOVD a4+32(FP), R12
|
|
||||||
MOVD R12, (2176+24)(R4)
|
|
||||||
MOVD a5+40(FP), R12
|
|
||||||
MOVD R12, (2176+32)(R4)
|
|
||||||
MOVD a6+48(FP), R12
|
|
||||||
MOVD R12, (2176+40)(R4)
|
|
||||||
MOVD a7+56(FP), R12
|
|
||||||
MOVD R12, (2176+48)(R4)
|
|
||||||
MOVD a8+64(FP), R12
|
|
||||||
MOVD R12, (2176+56)(R4)
|
|
||||||
MOVD a9+72(FP), R12
|
|
||||||
MOVD R12, (2176+64)(R4)
|
|
||||||
|
|
||||||
// Call function.
|
|
||||||
LE_CALL
|
|
||||||
NOPH
|
|
||||||
XOR R0, R0 // Restore R0 to $0.
|
|
||||||
MOVD R4, 0(R9) // Save stack pointer.
|
|
||||||
|
|
||||||
MOVD R3, r1+80(FP)
|
|
||||||
MOVD R0, r2+88(FP)
|
|
||||||
MOVD R0, err+96(FP)
|
|
||||||
MOVW R3, R4
|
|
||||||
CMP R4, $-1
|
|
||||||
BNE done
|
|
||||||
BL addrerrno<>(SB)
|
|
||||||
MOVWZ 0(R3), R3
|
|
||||||
MOVD R3, err+96(FP)
|
|
||||||
done:
|
|
||||||
RET
|
RET
|
||||||
|
|
||||||
// func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64)
|
// func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64)
|
||||||
TEXT ·svcCall(SB),NOSPLIT,$0
|
TEXT ·svcCall(SB), NOSPLIT, $0
|
||||||
BL runtime·save_g(SB) // Save g and stack pointer
|
BL runtime·save_g(SB) // Save g and stack pointer
|
||||||
MOVW PSALAA, R8
|
MOVW PSALAA, R8
|
||||||
MOVD LCA64(R8), R8
|
MOVD LCA64(R8), R8
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
MOVD SAVSTACK_ASYNC(R8), R9
|
||||||
MOVD R15, 0(R9)
|
MOVD R15, 0(R9)
|
||||||
|
|
||||||
MOVD argv+8(FP), R1 // Move function arguments into registers
|
MOVD argv+8(FP), R1 // Move function arguments into registers
|
||||||
MOVD dsa+16(FP), g
|
MOVD dsa+16(FP), g
|
||||||
MOVD fnptr+0(FP), R15
|
MOVD fnptr+0(FP), R15
|
||||||
|
|
||||||
BYTE $0x0D // Branch to function
|
BYTE $0x0D // Branch to function
|
||||||
BYTE $0xEF
|
BYTE $0xEF
|
||||||
|
|
||||||
BL runtime·load_g(SB) // Restore g and stack pointer
|
BL runtime·load_g(SB) // Restore g and stack pointer
|
||||||
MOVW PSALAA, R8
|
MOVW PSALAA, R8
|
||||||
MOVD LCA64(R8), R8
|
MOVD LCA64(R8), R8
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
MOVD SAVSTACK_ASYNC(R8), R9
|
||||||
MOVD 0(R9), R15
|
MOVD 0(R9), R15
|
||||||
|
|
||||||
RET
|
RET
|
||||||
|
|
||||||
// func svcLoad(name *byte) unsafe.Pointer
|
// func svcLoad(name *byte) unsafe.Pointer
|
||||||
TEXT ·svcLoad(SB),NOSPLIT,$0
|
TEXT ·svcLoad(SB), NOSPLIT, $0
|
||||||
MOVD R15, R2 // Save go stack pointer
|
MOVD R15, R2 // Save go stack pointer
|
||||||
MOVD name+0(FP), R0 // Move SVC args into registers
|
MOVD name+0(FP), R0 // Move SVC args into registers
|
||||||
MOVD $0x80000000, R1
|
MOVD $0x80000000, R1
|
||||||
MOVD $0, R15
|
MOVD $0, R15
|
||||||
BYTE $0x0A // SVC 08 LOAD
|
SVC_LOAD
|
||||||
BYTE $0x08
|
MOVW R15, R3 // Save return code from SVC
|
||||||
MOVW R15, R3 // Save return code from SVC
|
MOVD R2, R15 // Restore go stack pointer
|
||||||
MOVD R2, R15 // Restore go stack pointer
|
CMP R3, $0 // Check SVC return code
|
||||||
CMP R3, $0 // Check SVC return code
|
BNE error
|
||||||
BNE error
|
|
||||||
|
|
||||||
MOVD $-2, R3 // Reset last bit of entry point to zero
|
MOVD $-2, R3 // Reset last bit of entry point to zero
|
||||||
AND R0, R3
|
AND R0, R3
|
||||||
MOVD R3, addr+8(FP) // Return entry point returned by SVC
|
MOVD R3, ret+8(FP) // Return entry point returned by SVC
|
||||||
CMP R0, R3 // Check if last bit of entry point was set
|
CMP R0, R3 // Check if last bit of entry point was set
|
||||||
BNE done
|
BNE done
|
||||||
|
|
||||||
MOVD R15, R2 // Save go stack pointer
|
MOVD R15, R2 // Save go stack pointer
|
||||||
MOVD $0, R15 // Move SVC args into registers (entry point still in r0 from SVC 08)
|
MOVD $0, R15 // Move SVC args into registers (entry point still in r0 from SVC 08)
|
||||||
BYTE $0x0A // SVC 09 DELETE
|
SVC_DELETE
|
||||||
BYTE $0x09
|
MOVD R2, R15 // Restore go stack pointer
|
||||||
MOVD R2, R15 // Restore go stack pointer
|
|
||||||
|
|
||||||
error:
|
error:
|
||||||
MOVD $0, addr+8(FP) // Return 0 on failure
|
MOVD $0, ret+8(FP) // Return 0 on failure
|
||||||
|
|
||||||
done:
|
done:
|
||||||
XOR R0, R0 // Reset r0 to 0
|
XOR R0, R0 // Reset r0 to 0
|
||||||
RET
|
RET
|
||||||
|
|
||||||
// func svcUnload(name *byte, fnptr unsafe.Pointer) int64
|
// func svcUnload(name *byte, fnptr unsafe.Pointer) int64
|
||||||
TEXT ·svcUnload(SB),NOSPLIT,$0
|
TEXT ·svcUnload(SB), NOSPLIT, $0
|
||||||
MOVD R15, R2 // Save go stack pointer
|
MOVD R15, R2 // Save go stack pointer
|
||||||
MOVD name+0(FP), R0 // Move SVC args into registers
|
MOVD name+0(FP), R0 // Move SVC args into registers
|
||||||
MOVD addr+8(FP), R15
|
MOVD fnptr+8(FP), R15
|
||||||
BYTE $0x0A // SVC 09
|
SVC_DELETE
|
||||||
BYTE $0x09
|
XOR R0, R0 // Reset r0 to 0
|
||||||
XOR R0, R0 // Reset r0 to 0
|
MOVD R15, R1 // Save SVC return code
|
||||||
MOVD R15, R1 // Save SVC return code
|
MOVD R2, R15 // Restore go stack pointer
|
||||||
MOVD R2, R15 // Restore go stack pointer
|
MOVD R1, ret+16(FP) // Return SVC return code
|
||||||
MOVD R1, rc+0(FP) // Return SVC return code
|
|
||||||
RET
|
RET
|
||||||
|
|
||||||
// func gettid() uint64
|
// func gettid() uint64
|
||||||
|
|
@ -417,7 +150,233 @@ TEXT ·gettid(SB), NOSPLIT, $0
|
||||||
|
|
||||||
// Get CEECAATHDID
|
// Get CEECAATHDID
|
||||||
MOVD CAA(R8), R9
|
MOVD CAA(R8), R9
|
||||||
MOVD 0x3D0(R9), R9
|
MOVD CEECAATHDID(R9), R9
|
||||||
MOVD R9, ret+0(FP)
|
MOVD R9, ret+0(FP)
|
||||||
|
|
||||||
RET
|
RET
|
||||||
|
|
||||||
|
//
|
||||||
|
// Call LE function, if the return is -1
|
||||||
|
// errno and errno2 is retrieved
|
||||||
|
//
|
||||||
|
TEXT ·CallLeFuncWithErr(SB), NOSPLIT, $0
|
||||||
|
MOVW PSALAA, R8
|
||||||
|
MOVD LCA64(R8), R8
|
||||||
|
MOVD CAA(R8), R9
|
||||||
|
MOVD g, GOCB(R9)
|
||||||
|
|
||||||
|
// Restore LE stack.
|
||||||
|
MOVD SAVSTACK_ASYNC(R8), R9 // R9-> LE stack frame saving address
|
||||||
|
MOVD 0(R9), R4 // R4-> restore previously saved stack frame pointer
|
||||||
|
|
||||||
|
MOVD parms_base+8(FP), R7 // R7 -> argument array
|
||||||
|
MOVD parms_len+16(FP), R8 // R8 number of arguments
|
||||||
|
|
||||||
|
// arg 1 ---> R1
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
SUB $1, R8
|
||||||
|
MOVD 0(R7), R1
|
||||||
|
|
||||||
|
// arg 2 ---> R2
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
SUB $1, R8
|
||||||
|
ADD $8, R7
|
||||||
|
MOVD 0(R7), R2
|
||||||
|
|
||||||
|
// arg 3 --> R3
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
SUB $1, R8
|
||||||
|
ADD $8, R7
|
||||||
|
MOVD 0(R7), R3
|
||||||
|
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
MOVD $2176+16, R6 // starting LE stack address-8 to store 4th argument
|
||||||
|
|
||||||
|
repeat:
|
||||||
|
ADD $8, R7
|
||||||
|
MOVD 0(R7), R0 // advance arg pointer by 8 byte
|
||||||
|
ADD $8, R6 // advance LE argument address by 8 byte
|
||||||
|
MOVD R0, (R4)(R6*1) // copy argument from go-slice to le-frame
|
||||||
|
SUB $1, R8
|
||||||
|
CMP R8, $0
|
||||||
|
BNE repeat
|
||||||
|
|
||||||
|
docall:
|
||||||
|
MOVD funcdesc+0(FP), R8 // R8-> function descriptor
|
||||||
|
LMG 0(R8), R5, R6
|
||||||
|
MOVD $0, 0(R9) // R9 address of SAVSTACK_ASYNC
|
||||||
|
LE_CALL // balr R7, R6 (return #1)
|
||||||
|
NOPH
|
||||||
|
MOVD R3, ret+32(FP)
|
||||||
|
CMP R3, $-1 // compare result to -1
|
||||||
|
BNE done
|
||||||
|
|
||||||
|
// retrieve errno and errno2
|
||||||
|
MOVD zosLibVec<>(SB), R8
|
||||||
|
ADD $(__errno), R8
|
||||||
|
LMG 0(R8), R5, R6
|
||||||
|
LE_CALL // balr R7, R6 __errno (return #3)
|
||||||
|
NOPH
|
||||||
|
MOVWZ 0(R3), R3
|
||||||
|
MOVD R3, err+48(FP)
|
||||||
|
MOVD zosLibVec<>(SB), R8
|
||||||
|
ADD $(__err2ad), R8
|
||||||
|
LMG 0(R8), R5, R6
|
||||||
|
LE_CALL // balr R7, R6 __err2ad (return #2)
|
||||||
|
NOPH
|
||||||
|
MOVW (R3), R2 // retrieve errno2
|
||||||
|
MOVD R2, errno2+40(FP) // store in return area
|
||||||
|
|
||||||
|
done:
|
||||||
|
MOVD R4, 0(R9) // Save stack pointer.
|
||||||
|
RET
|
||||||
|
|
||||||
|
//
|
||||||
|
// Call LE function, if the return is 0
|
||||||
|
// errno and errno2 is retrieved
|
||||||
|
//
|
||||||
|
TEXT ·CallLeFuncWithPtrReturn(SB), NOSPLIT, $0
|
||||||
|
MOVW PSALAA, R8
|
||||||
|
MOVD LCA64(R8), R8
|
||||||
|
MOVD CAA(R8), R9
|
||||||
|
MOVD g, GOCB(R9)
|
||||||
|
|
||||||
|
// Restore LE stack.
|
||||||
|
MOVD SAVSTACK_ASYNC(R8), R9 // R9-> LE stack frame saving address
|
||||||
|
MOVD 0(R9), R4 // R4-> restore previously saved stack frame pointer
|
||||||
|
|
||||||
|
MOVD parms_base+8(FP), R7 // R7 -> argument array
|
||||||
|
MOVD parms_len+16(FP), R8 // R8 number of arguments
|
||||||
|
|
||||||
|
// arg 1 ---> R1
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
SUB $1, R8
|
||||||
|
MOVD 0(R7), R1
|
||||||
|
|
||||||
|
// arg 2 ---> R2
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
SUB $1, R8
|
||||||
|
ADD $8, R7
|
||||||
|
MOVD 0(R7), R2
|
||||||
|
|
||||||
|
// arg 3 --> R3
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
SUB $1, R8
|
||||||
|
ADD $8, R7
|
||||||
|
MOVD 0(R7), R3
|
||||||
|
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
MOVD $2176+16, R6 // starting LE stack address-8 to store 4th argument
|
||||||
|
|
||||||
|
repeat:
|
||||||
|
ADD $8, R7
|
||||||
|
MOVD 0(R7), R0 // advance arg pointer by 8 byte
|
||||||
|
ADD $8, R6 // advance LE argument address by 8 byte
|
||||||
|
MOVD R0, (R4)(R6*1) // copy argument from go-slice to le-frame
|
||||||
|
SUB $1, R8
|
||||||
|
CMP R8, $0
|
||||||
|
BNE repeat
|
||||||
|
|
||||||
|
docall:
|
||||||
|
MOVD funcdesc+0(FP), R8 // R8-> function descriptor
|
||||||
|
LMG 0(R8), R5, R6
|
||||||
|
MOVD $0, 0(R9) // R9 address of SAVSTACK_ASYNC
|
||||||
|
LE_CALL // balr R7, R6 (return #1)
|
||||||
|
NOPH
|
||||||
|
MOVD R3, ret+32(FP)
|
||||||
|
CMP R3, $0 // compare result to 0
|
||||||
|
BNE done
|
||||||
|
|
||||||
|
// retrieve errno and errno2
|
||||||
|
MOVD zosLibVec<>(SB), R8
|
||||||
|
ADD $(__errno), R8
|
||||||
|
LMG 0(R8), R5, R6
|
||||||
|
LE_CALL // balr R7, R6 __errno (return #3)
|
||||||
|
NOPH
|
||||||
|
MOVWZ 0(R3), R3
|
||||||
|
MOVD R3, err+48(FP)
|
||||||
|
MOVD zosLibVec<>(SB), R8
|
||||||
|
ADD $(__err2ad), R8
|
||||||
|
LMG 0(R8), R5, R6
|
||||||
|
LE_CALL // balr R7, R6 __err2ad (return #2)
|
||||||
|
NOPH
|
||||||
|
MOVW (R3), R2 // retrieve errno2
|
||||||
|
MOVD R2, errno2+40(FP) // store in return area
|
||||||
|
XOR R2, R2
|
||||||
|
MOVWZ R2, (R3) // clear errno2
|
||||||
|
|
||||||
|
done:
|
||||||
|
MOVD R4, 0(R9) // Save stack pointer.
|
||||||
|
RET
|
||||||
|
|
||||||
|
//
|
||||||
|
// function to test if a pointer can be safely dereferenced (content read)
|
||||||
|
// return 0 for succces
|
||||||
|
//
|
||||||
|
TEXT ·ptrtest(SB), NOSPLIT, $0-16
|
||||||
|
MOVD arg+0(FP), R10 // test pointer in R10
|
||||||
|
|
||||||
|
// set up R2 to point to CEECAADMC
|
||||||
|
BYTE $0xE3; BYTE $0x20; BYTE $0x04; BYTE $0xB8; BYTE $0x00; BYTE $0x17 // llgt 2,1208
|
||||||
|
BYTE $0xB9; BYTE $0x17; BYTE $0x00; BYTE $0x22 // llgtr 2,2
|
||||||
|
BYTE $0xA5; BYTE $0x26; BYTE $0x7F; BYTE $0xFF // nilh 2,32767
|
||||||
|
BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x58; BYTE $0x00; BYTE $0x04 // lg 2,88(2)
|
||||||
|
BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x08; BYTE $0x00; BYTE $0x04 // lg 2,8(2)
|
||||||
|
BYTE $0x41; BYTE $0x22; BYTE $0x03; BYTE $0x68 // la 2,872(2)
|
||||||
|
|
||||||
|
// set up R5 to point to the "shunt" path which set 1 to R3 (failure)
|
||||||
|
BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x33 // xgr 3,3
|
||||||
|
BYTE $0xA7; BYTE $0x55; BYTE $0x00; BYTE $0x04 // bras 5,lbl1
|
||||||
|
BYTE $0xA7; BYTE $0x39; BYTE $0x00; BYTE $0x01 // lghi 3,1
|
||||||
|
|
||||||
|
// if r3 is not zero (failed) then branch to finish
|
||||||
|
BYTE $0xB9; BYTE $0x02; BYTE $0x00; BYTE $0x33 // lbl1 ltgr 3,3
|
||||||
|
BYTE $0xA7; BYTE $0x74; BYTE $0x00; BYTE $0x08 // brc b'0111',lbl2
|
||||||
|
|
||||||
|
// stomic store shunt address in R5 into CEECAADMC
|
||||||
|
BYTE $0xE3; BYTE $0x52; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 5,0(2)
|
||||||
|
|
||||||
|
// now try reading from the test pointer in R10, if it fails it branches to the "lghi" instruction above
|
||||||
|
BYTE $0xE3; BYTE $0x9A; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x04 // lg 9,0(10)
|
||||||
|
|
||||||
|
// finish here, restore 0 into CEECAADMC
|
||||||
|
BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x99 // lbl2 xgr 9,9
|
||||||
|
BYTE $0xE3; BYTE $0x92; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 9,0(2)
|
||||||
|
MOVD R3, ret+8(FP) // result in R3
|
||||||
|
RET
|
||||||
|
|
||||||
|
//
|
||||||
|
// function to test if a untptr can be loaded from a pointer
|
||||||
|
// return 1: the 8-byte content
|
||||||
|
// 2: 0 for success, 1 for failure
|
||||||
|
//
|
||||||
|
// func safeload(ptr uintptr) ( value uintptr, error uintptr)
|
||||||
|
TEXT ·safeload(SB), NOSPLIT, $0-24
|
||||||
|
MOVD ptr+0(FP), R10 // test pointer in R10
|
||||||
|
MOVD $0x0, R6
|
||||||
|
BYTE $0xE3; BYTE $0x20; BYTE $0x04; BYTE $0xB8; BYTE $0x00; BYTE $0x17 // llgt 2,1208
|
||||||
|
BYTE $0xB9; BYTE $0x17; BYTE $0x00; BYTE $0x22 // llgtr 2,2
|
||||||
|
BYTE $0xA5; BYTE $0x26; BYTE $0x7F; BYTE $0xFF // nilh 2,32767
|
||||||
|
BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x58; BYTE $0x00; BYTE $0x04 // lg 2,88(2)
|
||||||
|
BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x08; BYTE $0x00; BYTE $0x04 // lg 2,8(2)
|
||||||
|
BYTE $0x41; BYTE $0x22; BYTE $0x03; BYTE $0x68 // la 2,872(2)
|
||||||
|
BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x33 // xgr 3,3
|
||||||
|
BYTE $0xA7; BYTE $0x55; BYTE $0x00; BYTE $0x04 // bras 5,lbl1
|
||||||
|
BYTE $0xA7; BYTE $0x39; BYTE $0x00; BYTE $0x01 // lghi 3,1
|
||||||
|
BYTE $0xB9; BYTE $0x02; BYTE $0x00; BYTE $0x33 // lbl1 ltgr 3,3
|
||||||
|
BYTE $0xA7; BYTE $0x74; BYTE $0x00; BYTE $0x08 // brc b'0111',lbl2
|
||||||
|
BYTE $0xE3; BYTE $0x52; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 5,0(2)
|
||||||
|
BYTE $0xE3; BYTE $0x6A; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x04 // lg 6,0(10)
|
||||||
|
BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x99 // lbl2 xgr 9,9
|
||||||
|
BYTE $0xE3; BYTE $0x92; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 9,0(2)
|
||||||
|
MOVD R6, value+8(FP) // result in R6
|
||||||
|
MOVD R3, error+16(FP) // error in R3
|
||||||
|
RET
|
||||||
|
|
|
||||||
657
vendor/golang.org/x/sys/unix/bpxsvc_zos.go
generated
vendored
Normal file
657
vendor/golang.org/x/sys/unix/bpxsvc_zos.go
generated
vendored
Normal file
|
|
@ -0,0 +1,657 @@
|
||||||
|
// Copyright 2024 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:build zos
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"fmt"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:noescape
|
||||||
|
func bpxcall(plist []unsafe.Pointer, bpx_offset int64)
|
||||||
|
|
||||||
|
//go:noescape
|
||||||
|
func A2e([]byte)
|
||||||
|
|
||||||
|
//go:noescape
|
||||||
|
func E2a([]byte)
|
||||||
|
|
||||||
|
const (
|
||||||
|
BPX4STA = 192 // stat
|
||||||
|
BPX4FST = 104 // fstat
|
||||||
|
BPX4LST = 132 // lstat
|
||||||
|
BPX4OPN = 156 // open
|
||||||
|
BPX4CLO = 72 // close
|
||||||
|
BPX4CHR = 500 // chattr
|
||||||
|
BPX4FCR = 504 // fchattr
|
||||||
|
BPX4LCR = 1180 // lchattr
|
||||||
|
BPX4CTW = 492 // cond_timed_wait
|
||||||
|
BPX4GTH = 1056 // __getthent
|
||||||
|
BPX4PTQ = 412 // pthread_quiesc
|
||||||
|
BPX4PTR = 320 // ptrace
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
//options
|
||||||
|
//byte1
|
||||||
|
BPX_OPNFHIGH = 0x80
|
||||||
|
//byte2
|
||||||
|
BPX_OPNFEXEC = 0x80
|
||||||
|
//byte3
|
||||||
|
BPX_O_NOLARGEFILE = 0x08
|
||||||
|
BPX_O_LARGEFILE = 0x04
|
||||||
|
BPX_O_ASYNCSIG = 0x02
|
||||||
|
BPX_O_SYNC = 0x01
|
||||||
|
//byte4
|
||||||
|
BPX_O_CREXCL = 0xc0
|
||||||
|
BPX_O_CREAT = 0x80
|
||||||
|
BPX_O_EXCL = 0x40
|
||||||
|
BPX_O_NOCTTY = 0x20
|
||||||
|
BPX_O_TRUNC = 0x10
|
||||||
|
BPX_O_APPEND = 0x08
|
||||||
|
BPX_O_NONBLOCK = 0x04
|
||||||
|
BPX_FNDELAY = 0x04
|
||||||
|
BPX_O_RDWR = 0x03
|
||||||
|
BPX_O_RDONLY = 0x02
|
||||||
|
BPX_O_WRONLY = 0x01
|
||||||
|
BPX_O_ACCMODE = 0x03
|
||||||
|
BPX_O_GETFL = 0x0f
|
||||||
|
|
||||||
|
//mode
|
||||||
|
// byte1 (file type)
|
||||||
|
BPX_FT_DIR = 1
|
||||||
|
BPX_FT_CHARSPEC = 2
|
||||||
|
BPX_FT_REGFILE = 3
|
||||||
|
BPX_FT_FIFO = 4
|
||||||
|
BPX_FT_SYMLINK = 5
|
||||||
|
BPX_FT_SOCKET = 6
|
||||||
|
//byte3
|
||||||
|
BPX_S_ISUID = 0x08
|
||||||
|
BPX_S_ISGID = 0x04
|
||||||
|
BPX_S_ISVTX = 0x02
|
||||||
|
BPX_S_IRWXU1 = 0x01
|
||||||
|
BPX_S_IRUSR = 0x01
|
||||||
|
//byte4
|
||||||
|
BPX_S_IRWXU2 = 0xc0
|
||||||
|
BPX_S_IWUSR = 0x80
|
||||||
|
BPX_S_IXUSR = 0x40
|
||||||
|
BPX_S_IRWXG = 0x38
|
||||||
|
BPX_S_IRGRP = 0x20
|
||||||
|
BPX_S_IWGRP = 0x10
|
||||||
|
BPX_S_IXGRP = 0x08
|
||||||
|
BPX_S_IRWXOX = 0x07
|
||||||
|
BPX_S_IROTH = 0x04
|
||||||
|
BPX_S_IWOTH = 0x02
|
||||||
|
BPX_S_IXOTH = 0x01
|
||||||
|
|
||||||
|
CW_INTRPT = 1
|
||||||
|
CW_CONDVAR = 32
|
||||||
|
CW_TIMEOUT = 64
|
||||||
|
|
||||||
|
PGTHA_NEXT = 2
|
||||||
|
PGTHA_CURRENT = 1
|
||||||
|
PGTHA_FIRST = 0
|
||||||
|
PGTHA_LAST = 3
|
||||||
|
PGTHA_PROCESS = 0x80
|
||||||
|
PGTHA_CONTTY = 0x40
|
||||||
|
PGTHA_PATH = 0x20
|
||||||
|
PGTHA_COMMAND = 0x10
|
||||||
|
PGTHA_FILEDATA = 0x08
|
||||||
|
PGTHA_THREAD = 0x04
|
||||||
|
PGTHA_PTAG = 0x02
|
||||||
|
PGTHA_COMMANDLONG = 0x01
|
||||||
|
PGTHA_THREADFAST = 0x80
|
||||||
|
PGTHA_FILEPATH = 0x40
|
||||||
|
PGTHA_THDSIGMASK = 0x20
|
||||||
|
// thread quiece mode
|
||||||
|
QUIESCE_TERM int32 = 1
|
||||||
|
QUIESCE_FORCE int32 = 2
|
||||||
|
QUIESCE_QUERY int32 = 3
|
||||||
|
QUIESCE_FREEZE int32 = 4
|
||||||
|
QUIESCE_UNFREEZE int32 = 5
|
||||||
|
FREEZE_THIS_THREAD int32 = 6
|
||||||
|
FREEZE_EXIT int32 = 8
|
||||||
|
QUIESCE_SRB int32 = 9
|
||||||
|
)
|
||||||
|
|
||||||
|
type Pgtha struct {
|
||||||
|
Pid uint32 // 0
|
||||||
|
Tid0 uint32 // 4
|
||||||
|
Tid1 uint32
|
||||||
|
Accesspid byte // C
|
||||||
|
Accesstid byte // D
|
||||||
|
Accessasid uint16 // E
|
||||||
|
Loginname [8]byte // 10
|
||||||
|
Flag1 byte // 18
|
||||||
|
Flag1b2 byte // 19
|
||||||
|
}
|
||||||
|
|
||||||
|
type Bpxystat_t struct { // DSECT BPXYSTAT
|
||||||
|
St_id [4]uint8 // 0
|
||||||
|
St_length uint16 // 0x4
|
||||||
|
St_version uint16 // 0x6
|
||||||
|
St_mode uint32 // 0x8
|
||||||
|
St_ino uint32 // 0xc
|
||||||
|
St_dev uint32 // 0x10
|
||||||
|
St_nlink uint32 // 0x14
|
||||||
|
St_uid uint32 // 0x18
|
||||||
|
St_gid uint32 // 0x1c
|
||||||
|
St_size uint64 // 0x20
|
||||||
|
St_atime uint32 // 0x28
|
||||||
|
St_mtime uint32 // 0x2c
|
||||||
|
St_ctime uint32 // 0x30
|
||||||
|
St_rdev uint32 // 0x34
|
||||||
|
St_auditoraudit uint32 // 0x38
|
||||||
|
St_useraudit uint32 // 0x3c
|
||||||
|
St_blksize uint32 // 0x40
|
||||||
|
St_createtime uint32 // 0x44
|
||||||
|
St_auditid [4]uint32 // 0x48
|
||||||
|
St_res01 uint32 // 0x58
|
||||||
|
Ft_ccsid uint16 // 0x5c
|
||||||
|
Ft_flags uint16 // 0x5e
|
||||||
|
St_res01a [2]uint32 // 0x60
|
||||||
|
St_res02 uint32 // 0x68
|
||||||
|
St_blocks uint32 // 0x6c
|
||||||
|
St_opaque [3]uint8 // 0x70
|
||||||
|
St_visible uint8 // 0x73
|
||||||
|
St_reftime uint32 // 0x74
|
||||||
|
St_fid uint64 // 0x78
|
||||||
|
St_filefmt uint8 // 0x80
|
||||||
|
St_fspflag2 uint8 // 0x81
|
||||||
|
St_res03 [2]uint8 // 0x82
|
||||||
|
St_ctimemsec uint32 // 0x84
|
||||||
|
St_seclabel [8]uint8 // 0x88
|
||||||
|
St_res04 [4]uint8 // 0x90
|
||||||
|
// end of version 1
|
||||||
|
_ uint32 // 0x94
|
||||||
|
St_atime64 uint64 // 0x98
|
||||||
|
St_mtime64 uint64 // 0xa0
|
||||||
|
St_ctime64 uint64 // 0xa8
|
||||||
|
St_createtime64 uint64 // 0xb0
|
||||||
|
St_reftime64 uint64 // 0xb8
|
||||||
|
_ uint64 // 0xc0
|
||||||
|
St_res05 [16]uint8 // 0xc8
|
||||||
|
// end of version 2
|
||||||
|
}
|
||||||
|
|
||||||
|
type BpxFilestatus struct {
|
||||||
|
Oflag1 byte
|
||||||
|
Oflag2 byte
|
||||||
|
Oflag3 byte
|
||||||
|
Oflag4 byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type BpxMode struct {
|
||||||
|
Ftype byte
|
||||||
|
Mode1 byte
|
||||||
|
Mode2 byte
|
||||||
|
Mode3 byte
|
||||||
|
}
|
||||||
|
|
||||||
|
// Thr attribute structure for extended attributes
|
||||||
|
type Bpxyatt_t struct { // DSECT BPXYATT
|
||||||
|
Att_id [4]uint8
|
||||||
|
Att_version uint16
|
||||||
|
Att_res01 [2]uint8
|
||||||
|
Att_setflags1 uint8
|
||||||
|
Att_setflags2 uint8
|
||||||
|
Att_setflags3 uint8
|
||||||
|
Att_setflags4 uint8
|
||||||
|
Att_mode uint32
|
||||||
|
Att_uid uint32
|
||||||
|
Att_gid uint32
|
||||||
|
Att_opaquemask [3]uint8
|
||||||
|
Att_visblmaskres uint8
|
||||||
|
Att_opaque [3]uint8
|
||||||
|
Att_visibleres uint8
|
||||||
|
Att_size_h uint32
|
||||||
|
Att_size_l uint32
|
||||||
|
Att_atime uint32
|
||||||
|
Att_mtime uint32
|
||||||
|
Att_auditoraudit uint32
|
||||||
|
Att_useraudit uint32
|
||||||
|
Att_ctime uint32
|
||||||
|
Att_reftime uint32
|
||||||
|
// end of version 1
|
||||||
|
Att_filefmt uint8
|
||||||
|
Att_res02 [3]uint8
|
||||||
|
Att_filetag uint32
|
||||||
|
Att_res03 [8]uint8
|
||||||
|
// end of version 2
|
||||||
|
Att_atime64 uint64
|
||||||
|
Att_mtime64 uint64
|
||||||
|
Att_ctime64 uint64
|
||||||
|
Att_reftime64 uint64
|
||||||
|
Att_seclabel [8]uint8
|
||||||
|
Att_ver3res02 [8]uint8
|
||||||
|
// end of version 3
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxOpen(name string, options *BpxFilestatus, mode *BpxMode) (rv int32, rc int32, rn int32) {
|
||||||
|
if len(name) < 1024 {
|
||||||
|
var namebuf [1024]byte
|
||||||
|
sz := int32(copy(namebuf[:], name))
|
||||||
|
A2e(namebuf[:sz])
|
||||||
|
var parms [7]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&sz)
|
||||||
|
parms[1] = unsafe.Pointer(&namebuf[0])
|
||||||
|
parms[2] = unsafe.Pointer(options)
|
||||||
|
parms[3] = unsafe.Pointer(mode)
|
||||||
|
parms[4] = unsafe.Pointer(&rv)
|
||||||
|
parms[5] = unsafe.Pointer(&rc)
|
||||||
|
parms[6] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4OPN)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
return -1, -1, -1
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxClose(fd int32) (rv int32, rc int32, rn int32) {
|
||||||
|
var parms [4]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&fd)
|
||||||
|
parms[1] = unsafe.Pointer(&rv)
|
||||||
|
parms[2] = unsafe.Pointer(&rc)
|
||||||
|
parms[3] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4CLO)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxFileFStat(fd int32, st *Bpxystat_t) (rv int32, rc int32, rn int32) {
|
||||||
|
st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3}
|
||||||
|
st.St_version = 2
|
||||||
|
stat_sz := uint32(unsafe.Sizeof(*st))
|
||||||
|
var parms [6]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&fd)
|
||||||
|
parms[1] = unsafe.Pointer(&stat_sz)
|
||||||
|
parms[2] = unsafe.Pointer(st)
|
||||||
|
parms[3] = unsafe.Pointer(&rv)
|
||||||
|
parms[4] = unsafe.Pointer(&rc)
|
||||||
|
parms[5] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4FST)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxFileStat(name string, st *Bpxystat_t) (rv int32, rc int32, rn int32) {
|
||||||
|
if len(name) < 1024 {
|
||||||
|
var namebuf [1024]byte
|
||||||
|
sz := int32(copy(namebuf[:], name))
|
||||||
|
A2e(namebuf[:sz])
|
||||||
|
st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3}
|
||||||
|
st.St_version = 2
|
||||||
|
stat_sz := uint32(unsafe.Sizeof(*st))
|
||||||
|
var parms [7]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&sz)
|
||||||
|
parms[1] = unsafe.Pointer(&namebuf[0])
|
||||||
|
parms[2] = unsafe.Pointer(&stat_sz)
|
||||||
|
parms[3] = unsafe.Pointer(st)
|
||||||
|
parms[4] = unsafe.Pointer(&rv)
|
||||||
|
parms[5] = unsafe.Pointer(&rc)
|
||||||
|
parms[6] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4STA)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
return -1, -1, -1
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxFileLStat(name string, st *Bpxystat_t) (rv int32, rc int32, rn int32) {
|
||||||
|
if len(name) < 1024 {
|
||||||
|
var namebuf [1024]byte
|
||||||
|
sz := int32(copy(namebuf[:], name))
|
||||||
|
A2e(namebuf[:sz])
|
||||||
|
st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3}
|
||||||
|
st.St_version = 2
|
||||||
|
stat_sz := uint32(unsafe.Sizeof(*st))
|
||||||
|
var parms [7]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&sz)
|
||||||
|
parms[1] = unsafe.Pointer(&namebuf[0])
|
||||||
|
parms[2] = unsafe.Pointer(&stat_sz)
|
||||||
|
parms[3] = unsafe.Pointer(st)
|
||||||
|
parms[4] = unsafe.Pointer(&rv)
|
||||||
|
parms[5] = unsafe.Pointer(&rc)
|
||||||
|
parms[6] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4LST)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
return -1, -1, -1
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxChattr(path string, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) {
|
||||||
|
if len(path) >= 1024 {
|
||||||
|
return -1, -1, -1
|
||||||
|
}
|
||||||
|
var namebuf [1024]byte
|
||||||
|
sz := int32(copy(namebuf[:], path))
|
||||||
|
A2e(namebuf[:sz])
|
||||||
|
attr_sz := uint32(unsafe.Sizeof(*attr))
|
||||||
|
var parms [7]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&sz)
|
||||||
|
parms[1] = unsafe.Pointer(&namebuf[0])
|
||||||
|
parms[2] = unsafe.Pointer(&attr_sz)
|
||||||
|
parms[3] = unsafe.Pointer(attr)
|
||||||
|
parms[4] = unsafe.Pointer(&rv)
|
||||||
|
parms[5] = unsafe.Pointer(&rc)
|
||||||
|
parms[6] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4CHR)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxLchattr(path string, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) {
|
||||||
|
if len(path) >= 1024 {
|
||||||
|
return -1, -1, -1
|
||||||
|
}
|
||||||
|
var namebuf [1024]byte
|
||||||
|
sz := int32(copy(namebuf[:], path))
|
||||||
|
A2e(namebuf[:sz])
|
||||||
|
attr_sz := uint32(unsafe.Sizeof(*attr))
|
||||||
|
var parms [7]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&sz)
|
||||||
|
parms[1] = unsafe.Pointer(&namebuf[0])
|
||||||
|
parms[2] = unsafe.Pointer(&attr_sz)
|
||||||
|
parms[3] = unsafe.Pointer(attr)
|
||||||
|
parms[4] = unsafe.Pointer(&rv)
|
||||||
|
parms[5] = unsafe.Pointer(&rc)
|
||||||
|
parms[6] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4LCR)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxFchattr(fd int32, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) {
|
||||||
|
attr_sz := uint32(unsafe.Sizeof(*attr))
|
||||||
|
var parms [6]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&fd)
|
||||||
|
parms[1] = unsafe.Pointer(&attr_sz)
|
||||||
|
parms[2] = unsafe.Pointer(attr)
|
||||||
|
parms[3] = unsafe.Pointer(&rv)
|
||||||
|
parms[4] = unsafe.Pointer(&rc)
|
||||||
|
parms[5] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4FCR)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxCondTimedWait(sec uint32, nsec uint32, events uint32, secrem *uint32, nsecrem *uint32) (rv int32, rc int32, rn int32) {
|
||||||
|
var parms [8]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&sec)
|
||||||
|
parms[1] = unsafe.Pointer(&nsec)
|
||||||
|
parms[2] = unsafe.Pointer(&events)
|
||||||
|
parms[3] = unsafe.Pointer(secrem)
|
||||||
|
parms[4] = unsafe.Pointer(nsecrem)
|
||||||
|
parms[5] = unsafe.Pointer(&rv)
|
||||||
|
parms[6] = unsafe.Pointer(&rc)
|
||||||
|
parms[7] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4CTW)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
func BpxGetthent(in *Pgtha, outlen *uint32, out unsafe.Pointer) (rv int32, rc int32, rn int32) {
|
||||||
|
var parms [7]unsafe.Pointer
|
||||||
|
inlen := uint32(26) // nothing else will work. Go says Pgtha is 28-byte because of alignment, but Pgtha is "packed" and must be 26-byte
|
||||||
|
parms[0] = unsafe.Pointer(&inlen)
|
||||||
|
parms[1] = unsafe.Pointer(&in)
|
||||||
|
parms[2] = unsafe.Pointer(outlen)
|
||||||
|
parms[3] = unsafe.Pointer(&out)
|
||||||
|
parms[4] = unsafe.Pointer(&rv)
|
||||||
|
parms[5] = unsafe.Pointer(&rc)
|
||||||
|
parms[6] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4GTH)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
func ZosJobname() (jobname string, err error) {
|
||||||
|
var pgtha Pgtha
|
||||||
|
pgtha.Pid = uint32(Getpid())
|
||||||
|
pgtha.Accesspid = PGTHA_CURRENT
|
||||||
|
pgtha.Flag1 = PGTHA_PROCESS
|
||||||
|
var out [256]byte
|
||||||
|
var outlen uint32
|
||||||
|
outlen = 256
|
||||||
|
rv, rc, rn := BpxGetthent(&pgtha, &outlen, unsafe.Pointer(&out[0]))
|
||||||
|
if rv == 0 {
|
||||||
|
gthc := []byte{0x87, 0xa3, 0x88, 0x83} // 'gthc' in ebcdic
|
||||||
|
ix := bytes.Index(out[:], gthc)
|
||||||
|
if ix == -1 {
|
||||||
|
err = fmt.Errorf("BPX4GTH: gthc return data not found")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
jn := out[ix+80 : ix+88] // we didn't declare Pgthc, but jobname is 8-byte at offset 80
|
||||||
|
E2a(jn)
|
||||||
|
jobname = string(bytes.TrimRight(jn, " "))
|
||||||
|
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("BPX4GTH: rc=%d errno=%d reason=code=0x%x", rv, rc, rn)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
func Bpx4ptq(code int32, data string) (rv int32, rc int32, rn int32) {
|
||||||
|
var userdata [8]byte
|
||||||
|
var parms [5]unsafe.Pointer
|
||||||
|
copy(userdata[:], data+" ")
|
||||||
|
A2e(userdata[:])
|
||||||
|
parms[0] = unsafe.Pointer(&code)
|
||||||
|
parms[1] = unsafe.Pointer(&userdata[0])
|
||||||
|
parms[2] = unsafe.Pointer(&rv)
|
||||||
|
parms[3] = unsafe.Pointer(&rc)
|
||||||
|
parms[4] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4PTQ)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
PT_TRACE_ME = 0 // Debug this process
|
||||||
|
PT_READ_I = 1 // Read a full word
|
||||||
|
PT_READ_D = 2 // Read a full word
|
||||||
|
PT_READ_U = 3 // Read control info
|
||||||
|
PT_WRITE_I = 4 //Write a full word
|
||||||
|
PT_WRITE_D = 5 //Write a full word
|
||||||
|
PT_CONTINUE = 7 //Continue the process
|
||||||
|
PT_KILL = 8 //Terminate the process
|
||||||
|
PT_READ_GPR = 11 // Read GPR, CR, PSW
|
||||||
|
PT_READ_FPR = 12 // Read FPR
|
||||||
|
PT_READ_VR = 13 // Read VR
|
||||||
|
PT_WRITE_GPR = 14 // Write GPR, CR, PSW
|
||||||
|
PT_WRITE_FPR = 15 // Write FPR
|
||||||
|
PT_WRITE_VR = 16 // Write VR
|
||||||
|
PT_READ_BLOCK = 17 // Read storage
|
||||||
|
PT_WRITE_BLOCK = 19 // Write storage
|
||||||
|
PT_READ_GPRH = 20 // Read GPRH
|
||||||
|
PT_WRITE_GPRH = 21 // Write GPRH
|
||||||
|
PT_REGHSET = 22 // Read all GPRHs
|
||||||
|
PT_ATTACH = 30 // Attach to a process
|
||||||
|
PT_DETACH = 31 // Detach from a process
|
||||||
|
PT_REGSET = 32 // Read all GPRs
|
||||||
|
PT_REATTACH = 33 // Reattach to a process
|
||||||
|
PT_LDINFO = 34 // Read loader info
|
||||||
|
PT_MULTI = 35 // Multi process mode
|
||||||
|
PT_LD64INFO = 36 // RMODE64 Info Area
|
||||||
|
PT_BLOCKREQ = 40 // Block request
|
||||||
|
PT_THREAD_INFO = 60 // Read thread info
|
||||||
|
PT_THREAD_MODIFY = 61
|
||||||
|
PT_THREAD_READ_FOCUS = 62
|
||||||
|
PT_THREAD_WRITE_FOCUS = 63
|
||||||
|
PT_THREAD_HOLD = 64
|
||||||
|
PT_THREAD_SIGNAL = 65
|
||||||
|
PT_EXPLAIN = 66
|
||||||
|
PT_EVENTS = 67
|
||||||
|
PT_THREAD_INFO_EXTENDED = 68
|
||||||
|
PT_REATTACH2 = 71
|
||||||
|
PT_CAPTURE = 72
|
||||||
|
PT_UNCAPTURE = 73
|
||||||
|
PT_GET_THREAD_TCB = 74
|
||||||
|
PT_GET_ALET = 75
|
||||||
|
PT_SWAPIN = 76
|
||||||
|
PT_EXTENDED_EVENT = 98
|
||||||
|
PT_RECOVER = 99 // Debug a program check
|
||||||
|
PT_GPR0 = 0 // General purpose register 0
|
||||||
|
PT_GPR1 = 1 // General purpose register 1
|
||||||
|
PT_GPR2 = 2 // General purpose register 2
|
||||||
|
PT_GPR3 = 3 // General purpose register 3
|
||||||
|
PT_GPR4 = 4 // General purpose register 4
|
||||||
|
PT_GPR5 = 5 // General purpose register 5
|
||||||
|
PT_GPR6 = 6 // General purpose register 6
|
||||||
|
PT_GPR7 = 7 // General purpose register 7
|
||||||
|
PT_GPR8 = 8 // General purpose register 8
|
||||||
|
PT_GPR9 = 9 // General purpose register 9
|
||||||
|
PT_GPR10 = 10 // General purpose register 10
|
||||||
|
PT_GPR11 = 11 // General purpose register 11
|
||||||
|
PT_GPR12 = 12 // General purpose register 12
|
||||||
|
PT_GPR13 = 13 // General purpose register 13
|
||||||
|
PT_GPR14 = 14 // General purpose register 14
|
||||||
|
PT_GPR15 = 15 // General purpose register 15
|
||||||
|
PT_FPR0 = 16 // Floating point register 0
|
||||||
|
PT_FPR1 = 17 // Floating point register 1
|
||||||
|
PT_FPR2 = 18 // Floating point register 2
|
||||||
|
PT_FPR3 = 19 // Floating point register 3
|
||||||
|
PT_FPR4 = 20 // Floating point register 4
|
||||||
|
PT_FPR5 = 21 // Floating point register 5
|
||||||
|
PT_FPR6 = 22 // Floating point register 6
|
||||||
|
PT_FPR7 = 23 // Floating point register 7
|
||||||
|
PT_FPR8 = 24 // Floating point register 8
|
||||||
|
PT_FPR9 = 25 // Floating point register 9
|
||||||
|
PT_FPR10 = 26 // Floating point register 10
|
||||||
|
PT_FPR11 = 27 // Floating point register 11
|
||||||
|
PT_FPR12 = 28 // Floating point register 12
|
||||||
|
PT_FPR13 = 29 // Floating point register 13
|
||||||
|
PT_FPR14 = 30 // Floating point register 14
|
||||||
|
PT_FPR15 = 31 // Floating point register 15
|
||||||
|
PT_FPC = 32 // Floating point control register
|
||||||
|
PT_PSW = 40 // PSW
|
||||||
|
PT_PSW0 = 40 // Left half of the PSW
|
||||||
|
PT_PSW1 = 41 // Right half of the PSW
|
||||||
|
PT_CR0 = 42 // Control register 0
|
||||||
|
PT_CR1 = 43 // Control register 1
|
||||||
|
PT_CR2 = 44 // Control register 2
|
||||||
|
PT_CR3 = 45 // Control register 3
|
||||||
|
PT_CR4 = 46 // Control register 4
|
||||||
|
PT_CR5 = 47 // Control register 5
|
||||||
|
PT_CR6 = 48 // Control register 6
|
||||||
|
PT_CR7 = 49 // Control register 7
|
||||||
|
PT_CR8 = 50 // Control register 8
|
||||||
|
PT_CR9 = 51 // Control register 9
|
||||||
|
PT_CR10 = 52 // Control register 10
|
||||||
|
PT_CR11 = 53 // Control register 11
|
||||||
|
PT_CR12 = 54 // Control register 12
|
||||||
|
PT_CR13 = 55 // Control register 13
|
||||||
|
PT_CR14 = 56 // Control register 14
|
||||||
|
PT_CR15 = 57 // Control register 15
|
||||||
|
PT_GPRH0 = 58 // GP High register 0
|
||||||
|
PT_GPRH1 = 59 // GP High register 1
|
||||||
|
PT_GPRH2 = 60 // GP High register 2
|
||||||
|
PT_GPRH3 = 61 // GP High register 3
|
||||||
|
PT_GPRH4 = 62 // GP High register 4
|
||||||
|
PT_GPRH5 = 63 // GP High register 5
|
||||||
|
PT_GPRH6 = 64 // GP High register 6
|
||||||
|
PT_GPRH7 = 65 // GP High register 7
|
||||||
|
PT_GPRH8 = 66 // GP High register 8
|
||||||
|
PT_GPRH9 = 67 // GP High register 9
|
||||||
|
PT_GPRH10 = 68 // GP High register 10
|
||||||
|
PT_GPRH11 = 69 // GP High register 11
|
||||||
|
PT_GPRH12 = 70 // GP High register 12
|
||||||
|
PT_GPRH13 = 71 // GP High register 13
|
||||||
|
PT_GPRH14 = 72 // GP High register 14
|
||||||
|
PT_GPRH15 = 73 // GP High register 15
|
||||||
|
PT_VR0 = 74 // Vector register 0
|
||||||
|
PT_VR1 = 75 // Vector register 1
|
||||||
|
PT_VR2 = 76 // Vector register 2
|
||||||
|
PT_VR3 = 77 // Vector register 3
|
||||||
|
PT_VR4 = 78 // Vector register 4
|
||||||
|
PT_VR5 = 79 // Vector register 5
|
||||||
|
PT_VR6 = 80 // Vector register 6
|
||||||
|
PT_VR7 = 81 // Vector register 7
|
||||||
|
PT_VR8 = 82 // Vector register 8
|
||||||
|
PT_VR9 = 83 // Vector register 9
|
||||||
|
PT_VR10 = 84 // Vector register 10
|
||||||
|
PT_VR11 = 85 // Vector register 11
|
||||||
|
PT_VR12 = 86 // Vector register 12
|
||||||
|
PT_VR13 = 87 // Vector register 13
|
||||||
|
PT_VR14 = 88 // Vector register 14
|
||||||
|
PT_VR15 = 89 // Vector register 15
|
||||||
|
PT_VR16 = 90 // Vector register 16
|
||||||
|
PT_VR17 = 91 // Vector register 17
|
||||||
|
PT_VR18 = 92 // Vector register 18
|
||||||
|
PT_VR19 = 93 // Vector register 19
|
||||||
|
PT_VR20 = 94 // Vector register 20
|
||||||
|
PT_VR21 = 95 // Vector register 21
|
||||||
|
PT_VR22 = 96 // Vector register 22
|
||||||
|
PT_VR23 = 97 // Vector register 23
|
||||||
|
PT_VR24 = 98 // Vector register 24
|
||||||
|
PT_VR25 = 99 // Vector register 25
|
||||||
|
PT_VR26 = 100 // Vector register 26
|
||||||
|
PT_VR27 = 101 // Vector register 27
|
||||||
|
PT_VR28 = 102 // Vector register 28
|
||||||
|
PT_VR29 = 103 // Vector register 29
|
||||||
|
PT_VR30 = 104 // Vector register 30
|
||||||
|
PT_VR31 = 105 // Vector register 31
|
||||||
|
PT_PSWG = 106 // PSWG
|
||||||
|
PT_PSWG0 = 106 // Bytes 0-3
|
||||||
|
PT_PSWG1 = 107 // Bytes 4-7
|
||||||
|
PT_PSWG2 = 108 // Bytes 8-11 (IA high word)
|
||||||
|
PT_PSWG3 = 109 // Bytes 12-15 (IA low word)
|
||||||
|
)
|
||||||
|
|
||||||
|
func Bpx4ptr(request int32, pid int32, addr unsafe.Pointer, data unsafe.Pointer, buffer unsafe.Pointer) (rv int32, rc int32, rn int32) {
|
||||||
|
var parms [8]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&request)
|
||||||
|
parms[1] = unsafe.Pointer(&pid)
|
||||||
|
parms[2] = unsafe.Pointer(&addr)
|
||||||
|
parms[3] = unsafe.Pointer(&data)
|
||||||
|
parms[4] = unsafe.Pointer(&buffer)
|
||||||
|
parms[5] = unsafe.Pointer(&rv)
|
||||||
|
parms[6] = unsafe.Pointer(&rc)
|
||||||
|
parms[7] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4PTR)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyU8(val uint8, dest []uint8) int {
|
||||||
|
if len(dest) < 1 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
dest[0] = val
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyU8Arr(src, dest []uint8) int {
|
||||||
|
if len(dest) < len(src) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
for i, v := range src {
|
||||||
|
dest[i] = v
|
||||||
|
}
|
||||||
|
return len(src)
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyU16(val uint16, dest []uint16) int {
|
||||||
|
if len(dest) < 1 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
dest[0] = val
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyU32(val uint32, dest []uint32) int {
|
||||||
|
if len(dest) < 1 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
dest[0] = val
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyU32Arr(src, dest []uint32) int {
|
||||||
|
if len(dest) < len(src) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
for i, v := range src {
|
||||||
|
dest[i] = v
|
||||||
|
}
|
||||||
|
return len(src)
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyU64(val uint64, dest []uint64) int {
|
||||||
|
if len(dest) < 1 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
dest[0] = val
|
||||||
|
return 1
|
||||||
|
}
|
||||||
192
vendor/golang.org/x/sys/unix/bpxsvc_zos.s
generated
vendored
Normal file
192
vendor/golang.org/x/sys/unix/bpxsvc_zos.s
generated
vendored
Normal file
|
|
@ -0,0 +1,192 @@
|
||||||
|
// Copyright 2024 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.
|
||||||
|
|
||||||
|
#include "go_asm.h"
|
||||||
|
#include "textflag.h"
|
||||||
|
|
||||||
|
// function to call USS assembly language services
|
||||||
|
//
|
||||||
|
// doc: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_3.1.0/com.ibm.zos.v3r1.bpxb100/bit64env.htm
|
||||||
|
//
|
||||||
|
// arg1 unsafe.Pointer array that ressembles an OS PLIST
|
||||||
|
//
|
||||||
|
// arg2 function offset as in
|
||||||
|
// doc: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_3.1.0/com.ibm.zos.v3r1.bpxb100/bpx2cr_List_of_offsets.htm
|
||||||
|
//
|
||||||
|
// func bpxcall(plist []unsafe.Pointer, bpx_offset int64)
|
||||||
|
|
||||||
|
TEXT ·bpxcall(SB), NOSPLIT|NOFRAME, $0
|
||||||
|
MOVD plist_base+0(FP), R1 // r1 points to plist
|
||||||
|
MOVD bpx_offset+24(FP), R2 // r2 offset to BPX vector table
|
||||||
|
MOVD R14, R7 // save r14
|
||||||
|
MOVD R15, R8 // save r15
|
||||||
|
MOVWZ 16(R0), R9
|
||||||
|
MOVWZ 544(R9), R9
|
||||||
|
MOVWZ 24(R9), R9 // call vector in r9
|
||||||
|
ADD R2, R9 // add offset to vector table
|
||||||
|
MOVWZ (R9), R9 // r9 points to entry point
|
||||||
|
BYTE $0x0D // BL R14,R9 --> basr r14,r9
|
||||||
|
BYTE $0xE9 // clobbers 0,1,14,15
|
||||||
|
MOVD R8, R15 // restore 15
|
||||||
|
JMP R7 // return via saved return address
|
||||||
|
|
||||||
|
// func A2e(arr [] byte)
|
||||||
|
// code page conversion from 819 to 1047
|
||||||
|
TEXT ·A2e(SB), NOSPLIT|NOFRAME, $0
|
||||||
|
MOVD arg_base+0(FP), R2 // pointer to arry of characters
|
||||||
|
MOVD arg_len+8(FP), R3 // count
|
||||||
|
XOR R0, R0
|
||||||
|
XOR R1, R1
|
||||||
|
BYTE $0xA7; BYTE $0x15; BYTE $0x00; BYTE $0x82 // BRAS 1,(2+(256/2))
|
||||||
|
|
||||||
|
// ASCII -> EBCDIC conversion table:
|
||||||
|
BYTE $0x00; BYTE $0x01; BYTE $0x02; BYTE $0x03
|
||||||
|
BYTE $0x37; BYTE $0x2d; BYTE $0x2e; BYTE $0x2f
|
||||||
|
BYTE $0x16; BYTE $0x05; BYTE $0x15; BYTE $0x0b
|
||||||
|
BYTE $0x0c; BYTE $0x0d; BYTE $0x0e; BYTE $0x0f
|
||||||
|
BYTE $0x10; BYTE $0x11; BYTE $0x12; BYTE $0x13
|
||||||
|
BYTE $0x3c; BYTE $0x3d; BYTE $0x32; BYTE $0x26
|
||||||
|
BYTE $0x18; BYTE $0x19; BYTE $0x3f; BYTE $0x27
|
||||||
|
BYTE $0x1c; BYTE $0x1d; BYTE $0x1e; BYTE $0x1f
|
||||||
|
BYTE $0x40; BYTE $0x5a; BYTE $0x7f; BYTE $0x7b
|
||||||
|
BYTE $0x5b; BYTE $0x6c; BYTE $0x50; BYTE $0x7d
|
||||||
|
BYTE $0x4d; BYTE $0x5d; BYTE $0x5c; BYTE $0x4e
|
||||||
|
BYTE $0x6b; BYTE $0x60; BYTE $0x4b; BYTE $0x61
|
||||||
|
BYTE $0xf0; BYTE $0xf1; BYTE $0xf2; BYTE $0xf3
|
||||||
|
BYTE $0xf4; BYTE $0xf5; BYTE $0xf6; BYTE $0xf7
|
||||||
|
BYTE $0xf8; BYTE $0xf9; BYTE $0x7a; BYTE $0x5e
|
||||||
|
BYTE $0x4c; BYTE $0x7e; BYTE $0x6e; BYTE $0x6f
|
||||||
|
BYTE $0x7c; BYTE $0xc1; BYTE $0xc2; BYTE $0xc3
|
||||||
|
BYTE $0xc4; BYTE $0xc5; BYTE $0xc6; BYTE $0xc7
|
||||||
|
BYTE $0xc8; BYTE $0xc9; BYTE $0xd1; BYTE $0xd2
|
||||||
|
BYTE $0xd3; BYTE $0xd4; BYTE $0xd5; BYTE $0xd6
|
||||||
|
BYTE $0xd7; BYTE $0xd8; BYTE $0xd9; BYTE $0xe2
|
||||||
|
BYTE $0xe3; BYTE $0xe4; BYTE $0xe5; BYTE $0xe6
|
||||||
|
BYTE $0xe7; BYTE $0xe8; BYTE $0xe9; BYTE $0xad
|
||||||
|
BYTE $0xe0; BYTE $0xbd; BYTE $0x5f; BYTE $0x6d
|
||||||
|
BYTE $0x79; BYTE $0x81; BYTE $0x82; BYTE $0x83
|
||||||
|
BYTE $0x84; BYTE $0x85; BYTE $0x86; BYTE $0x87
|
||||||
|
BYTE $0x88; BYTE $0x89; BYTE $0x91; BYTE $0x92
|
||||||
|
BYTE $0x93; BYTE $0x94; BYTE $0x95; BYTE $0x96
|
||||||
|
BYTE $0x97; BYTE $0x98; BYTE $0x99; BYTE $0xa2
|
||||||
|
BYTE $0xa3; BYTE $0xa4; BYTE $0xa5; BYTE $0xa6
|
||||||
|
BYTE $0xa7; BYTE $0xa8; BYTE $0xa9; BYTE $0xc0
|
||||||
|
BYTE $0x4f; BYTE $0xd0; BYTE $0xa1; BYTE $0x07
|
||||||
|
BYTE $0x20; BYTE $0x21; BYTE $0x22; BYTE $0x23
|
||||||
|
BYTE $0x24; BYTE $0x25; BYTE $0x06; BYTE $0x17
|
||||||
|
BYTE $0x28; BYTE $0x29; BYTE $0x2a; BYTE $0x2b
|
||||||
|
BYTE $0x2c; BYTE $0x09; BYTE $0x0a; BYTE $0x1b
|
||||||
|
BYTE $0x30; BYTE $0x31; BYTE $0x1a; BYTE $0x33
|
||||||
|
BYTE $0x34; BYTE $0x35; BYTE $0x36; BYTE $0x08
|
||||||
|
BYTE $0x38; BYTE $0x39; BYTE $0x3a; BYTE $0x3b
|
||||||
|
BYTE $0x04; BYTE $0x14; BYTE $0x3e; BYTE $0xff
|
||||||
|
BYTE $0x41; BYTE $0xaa; BYTE $0x4a; BYTE $0xb1
|
||||||
|
BYTE $0x9f; BYTE $0xb2; BYTE $0x6a; BYTE $0xb5
|
||||||
|
BYTE $0xbb; BYTE $0xb4; BYTE $0x9a; BYTE $0x8a
|
||||||
|
BYTE $0xb0; BYTE $0xca; BYTE $0xaf; BYTE $0xbc
|
||||||
|
BYTE $0x90; BYTE $0x8f; BYTE $0xea; BYTE $0xfa
|
||||||
|
BYTE $0xbe; BYTE $0xa0; BYTE $0xb6; BYTE $0xb3
|
||||||
|
BYTE $0x9d; BYTE $0xda; BYTE $0x9b; BYTE $0x8b
|
||||||
|
BYTE $0xb7; BYTE $0xb8; BYTE $0xb9; BYTE $0xab
|
||||||
|
BYTE $0x64; BYTE $0x65; BYTE $0x62; BYTE $0x66
|
||||||
|
BYTE $0x63; BYTE $0x67; BYTE $0x9e; BYTE $0x68
|
||||||
|
BYTE $0x74; BYTE $0x71; BYTE $0x72; BYTE $0x73
|
||||||
|
BYTE $0x78; BYTE $0x75; BYTE $0x76; BYTE $0x77
|
||||||
|
BYTE $0xac; BYTE $0x69; BYTE $0xed; BYTE $0xee
|
||||||
|
BYTE $0xeb; BYTE $0xef; BYTE $0xec; BYTE $0xbf
|
||||||
|
BYTE $0x80; BYTE $0xfd; BYTE $0xfe; BYTE $0xfb
|
||||||
|
BYTE $0xfc; BYTE $0xba; BYTE $0xae; BYTE $0x59
|
||||||
|
BYTE $0x44; BYTE $0x45; BYTE $0x42; BYTE $0x46
|
||||||
|
BYTE $0x43; BYTE $0x47; BYTE $0x9c; BYTE $0x48
|
||||||
|
BYTE $0x54; BYTE $0x51; BYTE $0x52; BYTE $0x53
|
||||||
|
BYTE $0x58; BYTE $0x55; BYTE $0x56; BYTE $0x57
|
||||||
|
BYTE $0x8c; BYTE $0x49; BYTE $0xcd; BYTE $0xce
|
||||||
|
BYTE $0xcb; BYTE $0xcf; BYTE $0xcc; BYTE $0xe1
|
||||||
|
BYTE $0x70; BYTE $0xdd; BYTE $0xde; BYTE $0xdb
|
||||||
|
BYTE $0xdc; BYTE $0x8d; BYTE $0x8e; BYTE $0xdf
|
||||||
|
|
||||||
|
retry:
|
||||||
|
WORD $0xB9931022 // TROO 2,2,b'0001'
|
||||||
|
BVS retry
|
||||||
|
RET
|
||||||
|
|
||||||
|
// func e2a(arr [] byte)
|
||||||
|
// code page conversion from 1047 to 819
|
||||||
|
TEXT ·E2a(SB), NOSPLIT|NOFRAME, $0
|
||||||
|
MOVD arg_base+0(FP), R2 // pointer to arry of characters
|
||||||
|
MOVD arg_len+8(FP), R3 // count
|
||||||
|
XOR R0, R0
|
||||||
|
XOR R1, R1
|
||||||
|
BYTE $0xA7; BYTE $0x15; BYTE $0x00; BYTE $0x82 // BRAS 1,(2+(256/2))
|
||||||
|
|
||||||
|
// EBCDIC -> ASCII conversion table:
|
||||||
|
BYTE $0x00; BYTE $0x01; BYTE $0x02; BYTE $0x03
|
||||||
|
BYTE $0x9c; BYTE $0x09; BYTE $0x86; BYTE $0x7f
|
||||||
|
BYTE $0x97; BYTE $0x8d; BYTE $0x8e; BYTE $0x0b
|
||||||
|
BYTE $0x0c; BYTE $0x0d; BYTE $0x0e; BYTE $0x0f
|
||||||
|
BYTE $0x10; BYTE $0x11; BYTE $0x12; BYTE $0x13
|
||||||
|
BYTE $0x9d; BYTE $0x0a; BYTE $0x08; BYTE $0x87
|
||||||
|
BYTE $0x18; BYTE $0x19; BYTE $0x92; BYTE $0x8f
|
||||||
|
BYTE $0x1c; BYTE $0x1d; BYTE $0x1e; BYTE $0x1f
|
||||||
|
BYTE $0x80; BYTE $0x81; BYTE $0x82; BYTE $0x83
|
||||||
|
BYTE $0x84; BYTE $0x85; BYTE $0x17; BYTE $0x1b
|
||||||
|
BYTE $0x88; BYTE $0x89; BYTE $0x8a; BYTE $0x8b
|
||||||
|
BYTE $0x8c; BYTE $0x05; BYTE $0x06; BYTE $0x07
|
||||||
|
BYTE $0x90; BYTE $0x91; BYTE $0x16; BYTE $0x93
|
||||||
|
BYTE $0x94; BYTE $0x95; BYTE $0x96; BYTE $0x04
|
||||||
|
BYTE $0x98; BYTE $0x99; BYTE $0x9a; BYTE $0x9b
|
||||||
|
BYTE $0x14; BYTE $0x15; BYTE $0x9e; BYTE $0x1a
|
||||||
|
BYTE $0x20; BYTE $0xa0; BYTE $0xe2; BYTE $0xe4
|
||||||
|
BYTE $0xe0; BYTE $0xe1; BYTE $0xe3; BYTE $0xe5
|
||||||
|
BYTE $0xe7; BYTE $0xf1; BYTE $0xa2; BYTE $0x2e
|
||||||
|
BYTE $0x3c; BYTE $0x28; BYTE $0x2b; BYTE $0x7c
|
||||||
|
BYTE $0x26; BYTE $0xe9; BYTE $0xea; BYTE $0xeb
|
||||||
|
BYTE $0xe8; BYTE $0xed; BYTE $0xee; BYTE $0xef
|
||||||
|
BYTE $0xec; BYTE $0xdf; BYTE $0x21; BYTE $0x24
|
||||||
|
BYTE $0x2a; BYTE $0x29; BYTE $0x3b; BYTE $0x5e
|
||||||
|
BYTE $0x2d; BYTE $0x2f; BYTE $0xc2; BYTE $0xc4
|
||||||
|
BYTE $0xc0; BYTE $0xc1; BYTE $0xc3; BYTE $0xc5
|
||||||
|
BYTE $0xc7; BYTE $0xd1; BYTE $0xa6; BYTE $0x2c
|
||||||
|
BYTE $0x25; BYTE $0x5f; BYTE $0x3e; BYTE $0x3f
|
||||||
|
BYTE $0xf8; BYTE $0xc9; BYTE $0xca; BYTE $0xcb
|
||||||
|
BYTE $0xc8; BYTE $0xcd; BYTE $0xce; BYTE $0xcf
|
||||||
|
BYTE $0xcc; BYTE $0x60; BYTE $0x3a; BYTE $0x23
|
||||||
|
BYTE $0x40; BYTE $0x27; BYTE $0x3d; BYTE $0x22
|
||||||
|
BYTE $0xd8; BYTE $0x61; BYTE $0x62; BYTE $0x63
|
||||||
|
BYTE $0x64; BYTE $0x65; BYTE $0x66; BYTE $0x67
|
||||||
|
BYTE $0x68; BYTE $0x69; BYTE $0xab; BYTE $0xbb
|
||||||
|
BYTE $0xf0; BYTE $0xfd; BYTE $0xfe; BYTE $0xb1
|
||||||
|
BYTE $0xb0; BYTE $0x6a; BYTE $0x6b; BYTE $0x6c
|
||||||
|
BYTE $0x6d; BYTE $0x6e; BYTE $0x6f; BYTE $0x70
|
||||||
|
BYTE $0x71; BYTE $0x72; BYTE $0xaa; BYTE $0xba
|
||||||
|
BYTE $0xe6; BYTE $0xb8; BYTE $0xc6; BYTE $0xa4
|
||||||
|
BYTE $0xb5; BYTE $0x7e; BYTE $0x73; BYTE $0x74
|
||||||
|
BYTE $0x75; BYTE $0x76; BYTE $0x77; BYTE $0x78
|
||||||
|
BYTE $0x79; BYTE $0x7a; BYTE $0xa1; BYTE $0xbf
|
||||||
|
BYTE $0xd0; BYTE $0x5b; BYTE $0xde; BYTE $0xae
|
||||||
|
BYTE $0xac; BYTE $0xa3; BYTE $0xa5; BYTE $0xb7
|
||||||
|
BYTE $0xa9; BYTE $0xa7; BYTE $0xb6; BYTE $0xbc
|
||||||
|
BYTE $0xbd; BYTE $0xbe; BYTE $0xdd; BYTE $0xa8
|
||||||
|
BYTE $0xaf; BYTE $0x5d; BYTE $0xb4; BYTE $0xd7
|
||||||
|
BYTE $0x7b; BYTE $0x41; BYTE $0x42; BYTE $0x43
|
||||||
|
BYTE $0x44; BYTE $0x45; BYTE $0x46; BYTE $0x47
|
||||||
|
BYTE $0x48; BYTE $0x49; BYTE $0xad; BYTE $0xf4
|
||||||
|
BYTE $0xf6; BYTE $0xf2; BYTE $0xf3; BYTE $0xf5
|
||||||
|
BYTE $0x7d; BYTE $0x4a; BYTE $0x4b; BYTE $0x4c
|
||||||
|
BYTE $0x4d; BYTE $0x4e; BYTE $0x4f; BYTE $0x50
|
||||||
|
BYTE $0x51; BYTE $0x52; BYTE $0xb9; BYTE $0xfb
|
||||||
|
BYTE $0xfc; BYTE $0xf9; BYTE $0xfa; BYTE $0xff
|
||||||
|
BYTE $0x5c; BYTE $0xf7; BYTE $0x53; BYTE $0x54
|
||||||
|
BYTE $0x55; BYTE $0x56; BYTE $0x57; BYTE $0x58
|
||||||
|
BYTE $0x59; BYTE $0x5a; BYTE $0xb2; BYTE $0xd4
|
||||||
|
BYTE $0xd6; BYTE $0xd2; BYTE $0xd3; BYTE $0xd5
|
||||||
|
BYTE $0x30; BYTE $0x31; BYTE $0x32; BYTE $0x33
|
||||||
|
BYTE $0x34; BYTE $0x35; BYTE $0x36; BYTE $0x37
|
||||||
|
BYTE $0x38; BYTE $0x39; BYTE $0xb3; BYTE $0xdb
|
||||||
|
BYTE $0xdc; BYTE $0xd9; BYTE $0xda; BYTE $0x9f
|
||||||
|
|
||||||
|
retry:
|
||||||
|
WORD $0xB9931022 // TROO 2,2,b'0001'
|
||||||
|
BVS retry
|
||||||
|
RET
|
||||||
220
vendor/golang.org/x/sys/unix/epoll_zos.go
generated
vendored
220
vendor/golang.org/x/sys/unix/epoll_zos.go
generated
vendored
|
|
@ -1,220 +0,0 @@
|
||||||
// Copyright 2020 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
//go:build zos && s390x
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
import (
|
|
||||||
"sync"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This file simulates epoll on z/OS using poll.
|
|
||||||
|
|
||||||
// Analogous to epoll_event on Linux.
|
|
||||||
// TODO(neeilan): Pad is because the Linux kernel expects a 96-bit struct. We never pass this to the kernel; remove?
|
|
||||||
type EpollEvent struct {
|
|
||||||
Events uint32
|
|
||||||
Fd int32
|
|
||||||
Pad int32
|
|
||||||
}
|
|
||||||
|
|
||||||
const (
|
|
||||||
EPOLLERR = 0x8
|
|
||||||
EPOLLHUP = 0x10
|
|
||||||
EPOLLIN = 0x1
|
|
||||||
EPOLLMSG = 0x400
|
|
||||||
EPOLLOUT = 0x4
|
|
||||||
EPOLLPRI = 0x2
|
|
||||||
EPOLLRDBAND = 0x80
|
|
||||||
EPOLLRDNORM = 0x40
|
|
||||||
EPOLLWRBAND = 0x200
|
|
||||||
EPOLLWRNORM = 0x100
|
|
||||||
EPOLL_CTL_ADD = 0x1
|
|
||||||
EPOLL_CTL_DEL = 0x2
|
|
||||||
EPOLL_CTL_MOD = 0x3
|
|
||||||
// The following constants are part of the epoll API, but represent
|
|
||||||
// currently unsupported functionality on z/OS.
|
|
||||||
// EPOLL_CLOEXEC = 0x80000
|
|
||||||
// EPOLLET = 0x80000000
|
|
||||||
// EPOLLONESHOT = 0x40000000
|
|
||||||
// EPOLLRDHUP = 0x2000 // Typically used with edge-triggered notis
|
|
||||||
// EPOLLEXCLUSIVE = 0x10000000 // Exclusive wake-up mode
|
|
||||||
// EPOLLWAKEUP = 0x20000000 // Relies on Linux's BLOCK_SUSPEND capability
|
|
||||||
)
|
|
||||||
|
|
||||||
// TODO(neeilan): We can eliminate these epToPoll / pToEpoll calls by using identical mask values for POLL/EPOLL
|
|
||||||
// constants where possible The lower 16 bits of epoll events (uint32) can fit any system poll event (int16).
|
|
||||||
|
|
||||||
// epToPollEvt converts epoll event field to poll equivalent.
|
|
||||||
// In epoll, Events is a 32-bit field, while poll uses 16 bits.
|
|
||||||
func epToPollEvt(events uint32) int16 {
|
|
||||||
var ep2p = map[uint32]int16{
|
|
||||||
EPOLLIN: POLLIN,
|
|
||||||
EPOLLOUT: POLLOUT,
|
|
||||||
EPOLLHUP: POLLHUP,
|
|
||||||
EPOLLPRI: POLLPRI,
|
|
||||||
EPOLLERR: POLLERR,
|
|
||||||
}
|
|
||||||
|
|
||||||
var pollEvts int16 = 0
|
|
||||||
for epEvt, pEvt := range ep2p {
|
|
||||||
if (events & epEvt) != 0 {
|
|
||||||
pollEvts |= pEvt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return pollEvts
|
|
||||||
}
|
|
||||||
|
|
||||||
// pToEpollEvt converts 16 bit poll event bitfields to 32-bit epoll event fields.
|
|
||||||
func pToEpollEvt(revents int16) uint32 {
|
|
||||||
var p2ep = map[int16]uint32{
|
|
||||||
POLLIN: EPOLLIN,
|
|
||||||
POLLOUT: EPOLLOUT,
|
|
||||||
POLLHUP: EPOLLHUP,
|
|
||||||
POLLPRI: EPOLLPRI,
|
|
||||||
POLLERR: EPOLLERR,
|
|
||||||
}
|
|
||||||
|
|
||||||
var epollEvts uint32 = 0
|
|
||||||
for pEvt, epEvt := range p2ep {
|
|
||||||
if (revents & pEvt) != 0 {
|
|
||||||
epollEvts |= epEvt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return epollEvts
|
|
||||||
}
|
|
||||||
|
|
||||||
// Per-process epoll implementation.
|
|
||||||
type epollImpl struct {
|
|
||||||
mu sync.Mutex
|
|
||||||
epfd2ep map[int]*eventPoll
|
|
||||||
nextEpfd int
|
|
||||||
}
|
|
||||||
|
|
||||||
// eventPoll holds a set of file descriptors being watched by the process. A process can have multiple epoll instances.
|
|
||||||
// On Linux, this is an in-kernel data structure accessed through a fd.
|
|
||||||
type eventPoll struct {
|
|
||||||
mu sync.Mutex
|
|
||||||
fds map[int]*EpollEvent
|
|
||||||
}
|
|
||||||
|
|
||||||
// epoll impl for this process.
|
|
||||||
var impl epollImpl = epollImpl{
|
|
||||||
epfd2ep: make(map[int]*eventPoll),
|
|
||||||
nextEpfd: 0,
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *epollImpl) epollcreate(size int) (epfd int, err error) {
|
|
||||||
e.mu.Lock()
|
|
||||||
defer e.mu.Unlock()
|
|
||||||
epfd = e.nextEpfd
|
|
||||||
e.nextEpfd++
|
|
||||||
|
|
||||||
e.epfd2ep[epfd] = &eventPoll{
|
|
||||||
fds: make(map[int]*EpollEvent),
|
|
||||||
}
|
|
||||||
return epfd, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *epollImpl) epollcreate1(flag int) (fd int, err error) {
|
|
||||||
return e.epollcreate(4)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *epollImpl) epollctl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|
||||||
e.mu.Lock()
|
|
||||||
defer e.mu.Unlock()
|
|
||||||
|
|
||||||
ep, ok := e.epfd2ep[epfd]
|
|
||||||
if !ok {
|
|
||||||
|
|
||||||
return EBADF
|
|
||||||
}
|
|
||||||
|
|
||||||
switch op {
|
|
||||||
case EPOLL_CTL_ADD:
|
|
||||||
// TODO(neeilan): When we make epfds and fds disjoint, detect epoll
|
|
||||||
// loops here (instances watching each other) and return ELOOP.
|
|
||||||
if _, ok := ep.fds[fd]; ok {
|
|
||||||
return EEXIST
|
|
||||||
}
|
|
||||||
ep.fds[fd] = event
|
|
||||||
case EPOLL_CTL_MOD:
|
|
||||||
if _, ok := ep.fds[fd]; !ok {
|
|
||||||
return ENOENT
|
|
||||||
}
|
|
||||||
ep.fds[fd] = event
|
|
||||||
case EPOLL_CTL_DEL:
|
|
||||||
if _, ok := ep.fds[fd]; !ok {
|
|
||||||
return ENOENT
|
|
||||||
}
|
|
||||||
delete(ep.fds, fd)
|
|
||||||
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Must be called while holding ep.mu
|
|
||||||
func (ep *eventPoll) getFds() []int {
|
|
||||||
fds := make([]int, len(ep.fds))
|
|
||||||
for fd := range ep.fds {
|
|
||||||
fds = append(fds, fd)
|
|
||||||
}
|
|
||||||
return fds
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *epollImpl) epollwait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
|
||||||
e.mu.Lock() // in [rare] case of concurrent epollcreate + epollwait
|
|
||||||
ep, ok := e.epfd2ep[epfd]
|
|
||||||
|
|
||||||
if !ok {
|
|
||||||
e.mu.Unlock()
|
|
||||||
return 0, EBADF
|
|
||||||
}
|
|
||||||
|
|
||||||
pollfds := make([]PollFd, 4)
|
|
||||||
for fd, epollevt := range ep.fds {
|
|
||||||
pollfds = append(pollfds, PollFd{Fd: int32(fd), Events: epToPollEvt(epollevt.Events)})
|
|
||||||
}
|
|
||||||
e.mu.Unlock()
|
|
||||||
|
|
||||||
n, err = Poll(pollfds, msec)
|
|
||||||
if err != nil {
|
|
||||||
return n, err
|
|
||||||
}
|
|
||||||
|
|
||||||
i := 0
|
|
||||||
for _, pFd := range pollfds {
|
|
||||||
if pFd.Revents != 0 {
|
|
||||||
events[i] = EpollEvent{Fd: pFd.Fd, Events: pToEpollEvt(pFd.Revents)}
|
|
||||||
i++
|
|
||||||
}
|
|
||||||
|
|
||||||
if i == n {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return n, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func EpollCreate(size int) (fd int, err error) {
|
|
||||||
return impl.epollcreate(size)
|
|
||||||
}
|
|
||||||
|
|
||||||
func EpollCreate1(flag int) (fd int, err error) {
|
|
||||||
return impl.epollcreate1(flag)
|
|
||||||
}
|
|
||||||
|
|
||||||
func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|
||||||
return impl.epollctl(epfd, op, fd, event)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Because EpollWait mutates events, the caller is expected to coordinate
|
|
||||||
// concurrent access if calling with the same epfd from multiple goroutines.
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
|
||||||
return impl.epollwait(epfd, events, msec)
|
|
||||||
}
|
|
||||||
163
vendor/golang.org/x/sys/unix/fstatfs_zos.go
generated
vendored
163
vendor/golang.org/x/sys/unix/fstatfs_zos.go
generated
vendored
|
|
@ -1,163 +0,0 @@
|
||||||
// Copyright 2020 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
//go:build zos && s390x
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
import (
|
|
||||||
"unsafe"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This file simulates fstatfs on z/OS using fstatvfs and w_getmntent.
|
|
||||||
|
|
||||||
func Fstatfs(fd int, stat *Statfs_t) (err error) {
|
|
||||||
var stat_v Statvfs_t
|
|
||||||
err = Fstatvfs(fd, &stat_v)
|
|
||||||
if err == nil {
|
|
||||||
// populate stat
|
|
||||||
stat.Type = 0
|
|
||||||
stat.Bsize = stat_v.Bsize
|
|
||||||
stat.Blocks = stat_v.Blocks
|
|
||||||
stat.Bfree = stat_v.Bfree
|
|
||||||
stat.Bavail = stat_v.Bavail
|
|
||||||
stat.Files = stat_v.Files
|
|
||||||
stat.Ffree = stat_v.Ffree
|
|
||||||
stat.Fsid = stat_v.Fsid
|
|
||||||
stat.Namelen = stat_v.Namemax
|
|
||||||
stat.Frsize = stat_v.Frsize
|
|
||||||
stat.Flags = stat_v.Flag
|
|
||||||
for passn := 0; passn < 5; passn++ {
|
|
||||||
switch passn {
|
|
||||||
case 0:
|
|
||||||
err = tryGetmntent64(stat)
|
|
||||||
break
|
|
||||||
case 1:
|
|
||||||
err = tryGetmntent128(stat)
|
|
||||||
break
|
|
||||||
case 2:
|
|
||||||
err = tryGetmntent256(stat)
|
|
||||||
break
|
|
||||||
case 3:
|
|
||||||
err = tryGetmntent512(stat)
|
|
||||||
break
|
|
||||||
case 4:
|
|
||||||
err = tryGetmntent1024(stat)
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
break
|
|
||||||
}
|
|
||||||
//proceed to return if: err is nil (found), err is nonnil but not ERANGE (another error occurred)
|
|
||||||
if err == nil || err != nil && err != ERANGE {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func tryGetmntent64(stat *Statfs_t) (err error) {
|
|
||||||
var mnt_ent_buffer struct {
|
|
||||||
header W_Mnth
|
|
||||||
filesys_info [64]W_Mntent
|
|
||||||
}
|
|
||||||
var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
|
|
||||||
fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = ERANGE //return ERANGE if no match is found in this batch
|
|
||||||
for i := 0; i < fs_count; i++ {
|
|
||||||
if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
|
|
||||||
stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
|
|
||||||
err = nil
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func tryGetmntent128(stat *Statfs_t) (err error) {
|
|
||||||
var mnt_ent_buffer struct {
|
|
||||||
header W_Mnth
|
|
||||||
filesys_info [128]W_Mntent
|
|
||||||
}
|
|
||||||
var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
|
|
||||||
fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = ERANGE //return ERANGE if no match is found in this batch
|
|
||||||
for i := 0; i < fs_count; i++ {
|
|
||||||
if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
|
|
||||||
stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
|
|
||||||
err = nil
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func tryGetmntent256(stat *Statfs_t) (err error) {
|
|
||||||
var mnt_ent_buffer struct {
|
|
||||||
header W_Mnth
|
|
||||||
filesys_info [256]W_Mntent
|
|
||||||
}
|
|
||||||
var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
|
|
||||||
fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = ERANGE //return ERANGE if no match is found in this batch
|
|
||||||
for i := 0; i < fs_count; i++ {
|
|
||||||
if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
|
|
||||||
stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
|
|
||||||
err = nil
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func tryGetmntent512(stat *Statfs_t) (err error) {
|
|
||||||
var mnt_ent_buffer struct {
|
|
||||||
header W_Mnth
|
|
||||||
filesys_info [512]W_Mntent
|
|
||||||
}
|
|
||||||
var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
|
|
||||||
fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = ERANGE //return ERANGE if no match is found in this batch
|
|
||||||
for i := 0; i < fs_count; i++ {
|
|
||||||
if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
|
|
||||||
stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
|
|
||||||
err = nil
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func tryGetmntent1024(stat *Statfs_t) (err error) {
|
|
||||||
var mnt_ent_buffer struct {
|
|
||||||
header W_Mnth
|
|
||||||
filesys_info [1024]W_Mntent
|
|
||||||
}
|
|
||||||
var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
|
|
||||||
fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = ERANGE //return ERANGE if no match is found in this batch
|
|
||||||
for i := 0; i < fs_count; i++ {
|
|
||||||
if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
|
|
||||||
stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
|
|
||||||
err = nil
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
2
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
2
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
|
|
@ -263,6 +263,7 @@ struct ltchars {
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/seccomp.h>
|
#include <linux/seccomp.h>
|
||||||
#include <linux/serial.h>
|
#include <linux/serial.h>
|
||||||
|
#include <linux/sock_diag.h>
|
||||||
#include <linux/sockios.h>
|
#include <linux/sockios.h>
|
||||||
#include <linux/taskstats.h>
|
#include <linux/taskstats.h>
|
||||||
#include <linux/tipc.h>
|
#include <linux/tipc.h>
|
||||||
|
|
@ -549,6 +550,7 @@ ccflags="$@"
|
||||||
$2 !~ "NLA_TYPE_MASK" &&
|
$2 !~ "NLA_TYPE_MASK" &&
|
||||||
$2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ &&
|
$2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ &&
|
||||||
$2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ ||
|
$2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ ||
|
||||||
|
$2 ~ /^SOCK_|SK_DIAG_|SKNLGRP_$/ ||
|
||||||
$2 ~ /^FIORDCHK$/ ||
|
$2 ~ /^FIORDCHK$/ ||
|
||||||
$2 ~ /^SIOC/ ||
|
$2 ~ /^SIOC/ ||
|
||||||
$2 ~ /^TIOC/ ||
|
$2 ~ /^TIOC/ ||
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/pagesize_unix.go
generated
vendored
2
vendor/golang.org/x/sys/unix/pagesize_unix.go
generated
vendored
|
|
@ -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.
|
||||||
|
|
||||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
|
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||||
|
|
||||||
// For Unix, get the pagesize from the runtime.
|
// For Unix, get the pagesize from the runtime.
|
||||||
|
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/readdirent_getdirentries.go
generated
vendored
2
vendor/golang.org/x/sys/unix/readdirent_getdirentries.go
generated
vendored
|
|
@ -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.
|
||||||
|
|
||||||
//go:build darwin
|
//go:build darwin || zos
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
58
vendor/golang.org/x/sys/unix/sockcmsg_zos.go
generated
vendored
Normal file
58
vendor/golang.org/x/sys/unix/sockcmsg_zos.go
generated
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
// Copyright 2024 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.
|
||||||
|
|
||||||
|
// Socket control messages
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import "unsafe"
|
||||||
|
|
||||||
|
// UnixCredentials encodes credentials into a socket control message
|
||||||
|
// for sending to another process. This can be used for
|
||||||
|
// authentication.
|
||||||
|
func UnixCredentials(ucred *Ucred) []byte {
|
||||||
|
b := make([]byte, CmsgSpace(SizeofUcred))
|
||||||
|
h := (*Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||||
|
h.Level = SOL_SOCKET
|
||||||
|
h.Type = SCM_CREDENTIALS
|
||||||
|
h.SetLen(CmsgLen(SizeofUcred))
|
||||||
|
*(*Ucred)(h.data(0)) = *ucred
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
|
// ParseUnixCredentials decodes a socket control message that contains
|
||||||
|
// credentials in a Ucred structure. To receive such a message, the
|
||||||
|
// SO_PASSCRED option must be enabled on the socket.
|
||||||
|
func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) {
|
||||||
|
if m.Header.Level != SOL_SOCKET {
|
||||||
|
return nil, EINVAL
|
||||||
|
}
|
||||||
|
if m.Header.Type != SCM_CREDENTIALS {
|
||||||
|
return nil, EINVAL
|
||||||
|
}
|
||||||
|
ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0]))
|
||||||
|
return &ucred, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// PktInfo4 encodes Inet4Pktinfo into a socket control message of type IP_PKTINFO.
|
||||||
|
func PktInfo4(info *Inet4Pktinfo) []byte {
|
||||||
|
b := make([]byte, CmsgSpace(SizeofInet4Pktinfo))
|
||||||
|
h := (*Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||||
|
h.Level = SOL_IP
|
||||||
|
h.Type = IP_PKTINFO
|
||||||
|
h.SetLen(CmsgLen(SizeofInet4Pktinfo))
|
||||||
|
*(*Inet4Pktinfo)(h.data(0)) = *info
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
|
// PktInfo6 encodes Inet6Pktinfo into a socket control message of type IPV6_PKTINFO.
|
||||||
|
func PktInfo6(info *Inet6Pktinfo) []byte {
|
||||||
|
b := make([]byte, CmsgSpace(SizeofInet6Pktinfo))
|
||||||
|
h := (*Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||||
|
h.Level = SOL_IPV6
|
||||||
|
h.Type = IPV6_PKTINFO
|
||||||
|
h.SetLen(CmsgLen(SizeofInet6Pktinfo))
|
||||||
|
*(*Inet6Pktinfo)(h.data(0)) = *info
|
||||||
|
return b
|
||||||
|
}
|
||||||
75
vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s
generated
vendored
Normal file
75
vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s
generated
vendored
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
// Copyright 2024 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:build zos && s390x && gc
|
||||||
|
|
||||||
|
#include "textflag.h"
|
||||||
|
|
||||||
|
// provide the address of function variable to be fixed up.
|
||||||
|
|
||||||
|
TEXT ·getPipe2Addr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Pipe2(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_FlockAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Flock(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_GetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Getxattr(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_NanosleepAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Nanosleep(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_SetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Setxattr(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_Wait4Addr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Wait4(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_MountAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Mount(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_UnmountAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Unmount(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_UtimesNanoAtAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·UtimesNanoAt(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_UtimesNanoAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·UtimesNano(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_MkfifoatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Mkfifoat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_ChtagAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Chtag(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_ReadlinkatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Readlinkat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
1509
vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
generated
vendored
1509
vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
generated
vendored
File diff suppressed because it is too large
Load diff
2
vendor/golang.org/x/sys/unix/sysvshm_unix.go
generated
vendored
2
vendor/golang.org/x/sys/unix/sysvshm_unix.go
generated
vendored
|
|
@ -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.
|
||||||
|
|
||||||
//go:build (darwin && !ios) || linux
|
//go:build (darwin && !ios) || linux || zos
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/sysvshm_unix_other.go
generated
vendored
2
vendor/golang.org/x/sys/unix/sysvshm_unix_other.go
generated
vendored
|
|
@ -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.
|
||||||
|
|
||||||
//go:build darwin && !ios
|
//go:build (darwin && !ios) || zos
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
29
vendor/golang.org/x/sys/unix/zerrors_linux.go
generated
vendored
29
vendor/golang.org/x/sys/unix/zerrors_linux.go
generated
vendored
|
|
@ -491,6 +491,7 @@ const (
|
||||||
BPF_F_REPLACE = 0x4
|
BPF_F_REPLACE = 0x4
|
||||||
BPF_F_SLEEPABLE = 0x10
|
BPF_F_SLEEPABLE = 0x10
|
||||||
BPF_F_STRICT_ALIGNMENT = 0x1
|
BPF_F_STRICT_ALIGNMENT = 0x1
|
||||||
|
BPF_F_TEST_REG_INVARIANTS = 0x80
|
||||||
BPF_F_TEST_RND_HI32 = 0x4
|
BPF_F_TEST_RND_HI32 = 0x4
|
||||||
BPF_F_TEST_RUN_ON_CPU = 0x1
|
BPF_F_TEST_RUN_ON_CPU = 0x1
|
||||||
BPF_F_TEST_STATE_FREQ = 0x8
|
BPF_F_TEST_STATE_FREQ = 0x8
|
||||||
|
|
@ -501,6 +502,7 @@ const (
|
||||||
BPF_IMM = 0x0
|
BPF_IMM = 0x0
|
||||||
BPF_IND = 0x40
|
BPF_IND = 0x40
|
||||||
BPF_JA = 0x0
|
BPF_JA = 0x0
|
||||||
|
BPF_JCOND = 0xe0
|
||||||
BPF_JEQ = 0x10
|
BPF_JEQ = 0x10
|
||||||
BPF_JGE = 0x30
|
BPF_JGE = 0x30
|
||||||
BPF_JGT = 0x20
|
BPF_JGT = 0x20
|
||||||
|
|
@ -656,6 +658,9 @@ const (
|
||||||
CAN_NPROTO = 0x8
|
CAN_NPROTO = 0x8
|
||||||
CAN_RAW = 0x1
|
CAN_RAW = 0x1
|
||||||
CAN_RAW_FILTER_MAX = 0x200
|
CAN_RAW_FILTER_MAX = 0x200
|
||||||
|
CAN_RAW_XL_VCID_RX_FILTER = 0x4
|
||||||
|
CAN_RAW_XL_VCID_TX_PASS = 0x2
|
||||||
|
CAN_RAW_XL_VCID_TX_SET = 0x1
|
||||||
CAN_RTR_FLAG = 0x40000000
|
CAN_RTR_FLAG = 0x40000000
|
||||||
CAN_SFF_ID_BITS = 0xb
|
CAN_SFF_ID_BITS = 0xb
|
||||||
CAN_SFF_MASK = 0x7ff
|
CAN_SFF_MASK = 0x7ff
|
||||||
|
|
@ -1338,6 +1343,7 @@ const (
|
||||||
F_OFD_SETLK = 0x25
|
F_OFD_SETLK = 0x25
|
||||||
F_OFD_SETLKW = 0x26
|
F_OFD_SETLKW = 0x26
|
||||||
F_OK = 0x0
|
F_OK = 0x0
|
||||||
|
F_SEAL_EXEC = 0x20
|
||||||
F_SEAL_FUTURE_WRITE = 0x10
|
F_SEAL_FUTURE_WRITE = 0x10
|
||||||
F_SEAL_GROW = 0x4
|
F_SEAL_GROW = 0x4
|
||||||
F_SEAL_SEAL = 0x1
|
F_SEAL_SEAL = 0x1
|
||||||
|
|
@ -1626,6 +1632,7 @@ const (
|
||||||
IP_FREEBIND = 0xf
|
IP_FREEBIND = 0xf
|
||||||
IP_HDRINCL = 0x3
|
IP_HDRINCL = 0x3
|
||||||
IP_IPSEC_POLICY = 0x10
|
IP_IPSEC_POLICY = 0x10
|
||||||
|
IP_LOCAL_PORT_RANGE = 0x33
|
||||||
IP_MAXPACKET = 0xffff
|
IP_MAXPACKET = 0xffff
|
||||||
IP_MAX_MEMBERSHIPS = 0x14
|
IP_MAX_MEMBERSHIPS = 0x14
|
||||||
IP_MF = 0x2000
|
IP_MF = 0x2000
|
||||||
|
|
@ -1652,6 +1659,7 @@ const (
|
||||||
IP_PMTUDISC_OMIT = 0x5
|
IP_PMTUDISC_OMIT = 0x5
|
||||||
IP_PMTUDISC_PROBE = 0x3
|
IP_PMTUDISC_PROBE = 0x3
|
||||||
IP_PMTUDISC_WANT = 0x1
|
IP_PMTUDISC_WANT = 0x1
|
||||||
|
IP_PROTOCOL = 0x34
|
||||||
IP_RECVERR = 0xb
|
IP_RECVERR = 0xb
|
||||||
IP_RECVERR_RFC4884 = 0x1a
|
IP_RECVERR_RFC4884 = 0x1a
|
||||||
IP_RECVFRAGSIZE = 0x19
|
IP_RECVFRAGSIZE = 0x19
|
||||||
|
|
@ -1697,6 +1705,7 @@ const (
|
||||||
KEXEC_ARCH_S390 = 0x160000
|
KEXEC_ARCH_S390 = 0x160000
|
||||||
KEXEC_ARCH_SH = 0x2a0000
|
KEXEC_ARCH_SH = 0x2a0000
|
||||||
KEXEC_ARCH_X86_64 = 0x3e0000
|
KEXEC_ARCH_X86_64 = 0x3e0000
|
||||||
|
KEXEC_FILE_DEBUG = 0x8
|
||||||
KEXEC_FILE_NO_INITRAMFS = 0x4
|
KEXEC_FILE_NO_INITRAMFS = 0x4
|
||||||
KEXEC_FILE_ON_CRASH = 0x2
|
KEXEC_FILE_ON_CRASH = 0x2
|
||||||
KEXEC_FILE_UNLOAD = 0x1
|
KEXEC_FILE_UNLOAD = 0x1
|
||||||
|
|
@ -1898,6 +1907,7 @@ const (
|
||||||
MNT_DETACH = 0x2
|
MNT_DETACH = 0x2
|
||||||
MNT_EXPIRE = 0x4
|
MNT_EXPIRE = 0x4
|
||||||
MNT_FORCE = 0x1
|
MNT_FORCE = 0x1
|
||||||
|
MNT_ID_REQ_SIZE_VER0 = 0x18
|
||||||
MODULE_INIT_COMPRESSED_FILE = 0x4
|
MODULE_INIT_COMPRESSED_FILE = 0x4
|
||||||
MODULE_INIT_IGNORE_MODVERSIONS = 0x1
|
MODULE_INIT_IGNORE_MODVERSIONS = 0x1
|
||||||
MODULE_INIT_IGNORE_VERMAGIC = 0x2
|
MODULE_INIT_IGNORE_VERMAGIC = 0x2
|
||||||
|
|
@ -2166,7 +2176,7 @@ const (
|
||||||
NFT_SECMARK_CTX_MAXLEN = 0x100
|
NFT_SECMARK_CTX_MAXLEN = 0x100
|
||||||
NFT_SET_MAXNAMELEN = 0x100
|
NFT_SET_MAXNAMELEN = 0x100
|
||||||
NFT_SOCKET_MAX = 0x3
|
NFT_SOCKET_MAX = 0x3
|
||||||
NFT_TABLE_F_MASK = 0x3
|
NFT_TABLE_F_MASK = 0x7
|
||||||
NFT_TABLE_MAXNAMELEN = 0x100
|
NFT_TABLE_MAXNAMELEN = 0x100
|
||||||
NFT_TRACETYPE_MAX = 0x3
|
NFT_TRACETYPE_MAX = 0x3
|
||||||
NFT_TUNNEL_F_MASK = 0x7
|
NFT_TUNNEL_F_MASK = 0x7
|
||||||
|
|
@ -2302,6 +2312,7 @@ const (
|
||||||
PERF_AUX_FLAG_PARTIAL = 0x4
|
PERF_AUX_FLAG_PARTIAL = 0x4
|
||||||
PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK = 0xff00
|
PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK = 0xff00
|
||||||
PERF_AUX_FLAG_TRUNCATED = 0x1
|
PERF_AUX_FLAG_TRUNCATED = 0x1
|
||||||
|
PERF_BRANCH_ENTRY_INFO_BITS_MAX = 0x21
|
||||||
PERF_BR_ARM64_DEBUG_DATA = 0x7
|
PERF_BR_ARM64_DEBUG_DATA = 0x7
|
||||||
PERF_BR_ARM64_DEBUG_EXIT = 0x5
|
PERF_BR_ARM64_DEBUG_EXIT = 0x5
|
||||||
PERF_BR_ARM64_DEBUG_HALT = 0x4
|
PERF_BR_ARM64_DEBUG_HALT = 0x4
|
||||||
|
|
@ -2399,6 +2410,7 @@ const (
|
||||||
PERF_RECORD_MISC_USER = 0x2
|
PERF_RECORD_MISC_USER = 0x2
|
||||||
PERF_SAMPLE_BRANCH_PLM_ALL = 0x7
|
PERF_SAMPLE_BRANCH_PLM_ALL = 0x7
|
||||||
PERF_SAMPLE_WEIGHT_TYPE = 0x1004000
|
PERF_SAMPLE_WEIGHT_TYPE = 0x1004000
|
||||||
|
PID_FS_MAGIC = 0x50494446
|
||||||
PIPEFS_MAGIC = 0x50495045
|
PIPEFS_MAGIC = 0x50495045
|
||||||
PPPIOCGNPMODE = 0xc008744c
|
PPPIOCGNPMODE = 0xc008744c
|
||||||
PPPIOCNEWUNIT = 0xc004743e
|
PPPIOCNEWUNIT = 0xc004743e
|
||||||
|
|
@ -2892,8 +2904,9 @@ const (
|
||||||
RWF_APPEND = 0x10
|
RWF_APPEND = 0x10
|
||||||
RWF_DSYNC = 0x2
|
RWF_DSYNC = 0x2
|
||||||
RWF_HIPRI = 0x1
|
RWF_HIPRI = 0x1
|
||||||
|
RWF_NOAPPEND = 0x20
|
||||||
RWF_NOWAIT = 0x8
|
RWF_NOWAIT = 0x8
|
||||||
RWF_SUPPORTED = 0x1f
|
RWF_SUPPORTED = 0x3f
|
||||||
RWF_SYNC = 0x4
|
RWF_SYNC = 0x4
|
||||||
RWF_WRITE_LIFE_NOT_SET = 0x0
|
RWF_WRITE_LIFE_NOT_SET = 0x0
|
||||||
SCHED_BATCH = 0x3
|
SCHED_BATCH = 0x3
|
||||||
|
|
@ -2914,7 +2927,9 @@ const (
|
||||||
SCHED_RESET_ON_FORK = 0x40000000
|
SCHED_RESET_ON_FORK = 0x40000000
|
||||||
SCHED_RR = 0x2
|
SCHED_RR = 0x2
|
||||||
SCM_CREDENTIALS = 0x2
|
SCM_CREDENTIALS = 0x2
|
||||||
|
SCM_PIDFD = 0x4
|
||||||
SCM_RIGHTS = 0x1
|
SCM_RIGHTS = 0x1
|
||||||
|
SCM_SECURITY = 0x3
|
||||||
SCM_TIMESTAMP = 0x1d
|
SCM_TIMESTAMP = 0x1d
|
||||||
SC_LOG_FLUSH = 0x100000
|
SC_LOG_FLUSH = 0x100000
|
||||||
SECCOMP_ADDFD_FLAG_SEND = 0x2
|
SECCOMP_ADDFD_FLAG_SEND = 0x2
|
||||||
|
|
@ -3047,6 +3062,8 @@ const (
|
||||||
SIOCSMIIREG = 0x8949
|
SIOCSMIIREG = 0x8949
|
||||||
SIOCSRARP = 0x8962
|
SIOCSRARP = 0x8962
|
||||||
SIOCWANDEV = 0x894a
|
SIOCWANDEV = 0x894a
|
||||||
|
SK_DIAG_BPF_STORAGE_MAX = 0x3
|
||||||
|
SK_DIAG_BPF_STORAGE_REQ_MAX = 0x1
|
||||||
SMACK_MAGIC = 0x43415d53
|
SMACK_MAGIC = 0x43415d53
|
||||||
SMART_AUTOSAVE = 0xd2
|
SMART_AUTOSAVE = 0xd2
|
||||||
SMART_AUTO_OFFLINE = 0xdb
|
SMART_AUTO_OFFLINE = 0xdb
|
||||||
|
|
@ -3067,6 +3084,8 @@ const (
|
||||||
SOCKFS_MAGIC = 0x534f434b
|
SOCKFS_MAGIC = 0x534f434b
|
||||||
SOCK_BUF_LOCK_MASK = 0x3
|
SOCK_BUF_LOCK_MASK = 0x3
|
||||||
SOCK_DCCP = 0x6
|
SOCK_DCCP = 0x6
|
||||||
|
SOCK_DESTROY = 0x15
|
||||||
|
SOCK_DIAG_BY_FAMILY = 0x14
|
||||||
SOCK_IOC_TYPE = 0x89
|
SOCK_IOC_TYPE = 0x89
|
||||||
SOCK_PACKET = 0xa
|
SOCK_PACKET = 0xa
|
||||||
SOCK_RAW = 0x3
|
SOCK_RAW = 0x3
|
||||||
|
|
@ -3168,6 +3187,7 @@ const (
|
||||||
STATX_GID = 0x10
|
STATX_GID = 0x10
|
||||||
STATX_INO = 0x100
|
STATX_INO = 0x100
|
||||||
STATX_MNT_ID = 0x1000
|
STATX_MNT_ID = 0x1000
|
||||||
|
STATX_MNT_ID_UNIQUE = 0x4000
|
||||||
STATX_MODE = 0x2
|
STATX_MODE = 0x2
|
||||||
STATX_MTIME = 0x40
|
STATX_MTIME = 0x40
|
||||||
STATX_NLINK = 0x4
|
STATX_NLINK = 0x4
|
||||||
|
|
@ -3255,6 +3275,7 @@ const (
|
||||||
TCP_MAX_WINSHIFT = 0xe
|
TCP_MAX_WINSHIFT = 0xe
|
||||||
TCP_MD5SIG = 0xe
|
TCP_MD5SIG = 0xe
|
||||||
TCP_MD5SIG_EXT = 0x20
|
TCP_MD5SIG_EXT = 0x20
|
||||||
|
TCP_MD5SIG_FLAG_IFINDEX = 0x2
|
||||||
TCP_MD5SIG_FLAG_PREFIX = 0x1
|
TCP_MD5SIG_FLAG_PREFIX = 0x1
|
||||||
TCP_MD5SIG_MAXKEYLEN = 0x50
|
TCP_MD5SIG_MAXKEYLEN = 0x50
|
||||||
TCP_MSS = 0x200
|
TCP_MSS = 0x200
|
||||||
|
|
@ -3562,12 +3583,16 @@ const (
|
||||||
XDP_RX_RING = 0x2
|
XDP_RX_RING = 0x2
|
||||||
XDP_SHARED_UMEM = 0x1
|
XDP_SHARED_UMEM = 0x1
|
||||||
XDP_STATISTICS = 0x7
|
XDP_STATISTICS = 0x7
|
||||||
|
XDP_TXMD_FLAGS_CHECKSUM = 0x2
|
||||||
|
XDP_TXMD_FLAGS_TIMESTAMP = 0x1
|
||||||
|
XDP_TX_METADATA = 0x2
|
||||||
XDP_TX_RING = 0x3
|
XDP_TX_RING = 0x3
|
||||||
XDP_UMEM_COMPLETION_RING = 0x6
|
XDP_UMEM_COMPLETION_RING = 0x6
|
||||||
XDP_UMEM_FILL_RING = 0x5
|
XDP_UMEM_FILL_RING = 0x5
|
||||||
XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000
|
XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000
|
||||||
XDP_UMEM_PGOFF_FILL_RING = 0x100000000
|
XDP_UMEM_PGOFF_FILL_RING = 0x100000000
|
||||||
XDP_UMEM_REG = 0x4
|
XDP_UMEM_REG = 0x4
|
||||||
|
XDP_UMEM_TX_SW_CSUM = 0x2
|
||||||
XDP_UMEM_UNALIGNED_CHUNK_FLAG = 0x1
|
XDP_UMEM_UNALIGNED_CHUNK_FLAG = 0x1
|
||||||
XDP_USE_NEED_WAKEUP = 0x8
|
XDP_USE_NEED_WAKEUP = 0x8
|
||||||
XDP_USE_SG = 0x10
|
XDP_USE_SG = 0x10
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/zerrors_linux_386.go
generated
vendored
1
vendor/golang.org/x/sys/unix/zerrors_linux_386.go
generated
vendored
|
|
@ -118,6 +118,7 @@ const (
|
||||||
IXOFF = 0x1000
|
IXOFF = 0x1000
|
||||||
IXON = 0x400
|
IXON = 0x400
|
||||||
MAP_32BIT = 0x40
|
MAP_32BIT = 0x40
|
||||||
|
MAP_ABOVE4G = 0x80
|
||||||
MAP_ANON = 0x20
|
MAP_ANON = 0x20
|
||||||
MAP_ANONYMOUS = 0x20
|
MAP_ANONYMOUS = 0x20
|
||||||
MAP_DENYWRITE = 0x800
|
MAP_DENYWRITE = 0x800
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
generated
vendored
1
vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
generated
vendored
|
|
@ -118,6 +118,7 @@ const (
|
||||||
IXOFF = 0x1000
|
IXOFF = 0x1000
|
||||||
IXON = 0x400
|
IXON = 0x400
|
||||||
MAP_32BIT = 0x40
|
MAP_32BIT = 0x40
|
||||||
|
MAP_ABOVE4G = 0x80
|
||||||
MAP_ANON = 0x20
|
MAP_ANON = 0x20
|
||||||
MAP_ANONYMOUS = 0x20
|
MAP_ANONYMOUS = 0x20
|
||||||
MAP_DENYWRITE = 0x800
|
MAP_DENYWRITE = 0x800
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
generated
vendored
1
vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
generated
vendored
|
|
@ -87,6 +87,7 @@ const (
|
||||||
FICLONE = 0x40049409
|
FICLONE = 0x40049409
|
||||||
FICLONERANGE = 0x4020940d
|
FICLONERANGE = 0x4020940d
|
||||||
FLUSHO = 0x1000
|
FLUSHO = 0x1000
|
||||||
|
FPMR_MAGIC = 0x46504d52
|
||||||
FPSIMD_MAGIC = 0x46508001
|
FPSIMD_MAGIC = 0x46508001
|
||||||
FS_IOC_ENABLE_VERITY = 0x40806685
|
FS_IOC_ENABLE_VERITY = 0x40806685
|
||||||
FS_IOC_GETFLAGS = 0x80086601
|
FS_IOC_GETFLAGS = 0x80086601
|
||||||
|
|
|
||||||
233
vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go
generated
vendored
233
vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go
generated
vendored
|
|
@ -10,41 +10,99 @@
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
const (
|
const (
|
||||||
BRKINT = 0x0001
|
BRKINT = 0x0001
|
||||||
CLOCK_MONOTONIC = 0x1
|
CLOCAL = 0x1
|
||||||
CLOCK_PROCESS_CPUTIME_ID = 0x2
|
CLOCK_MONOTONIC = 0x1
|
||||||
CLOCK_REALTIME = 0x0
|
CLOCK_PROCESS_CPUTIME_ID = 0x2
|
||||||
CLOCK_THREAD_CPUTIME_ID = 0x3
|
CLOCK_REALTIME = 0x0
|
||||||
CS8 = 0x0030
|
CLOCK_THREAD_CPUTIME_ID = 0x3
|
||||||
CSIZE = 0x0030
|
CLONE_NEWIPC = 0x08000000
|
||||||
ECHO = 0x00000008
|
CLONE_NEWNET = 0x40000000
|
||||||
ECHONL = 0x00000001
|
CLONE_NEWNS = 0x00020000
|
||||||
FD_CLOEXEC = 0x01
|
CLONE_NEWPID = 0x20000000
|
||||||
FD_CLOFORK = 0x02
|
CLONE_NEWUTS = 0x04000000
|
||||||
FNDELAY = 0x04
|
CLONE_PARENT = 0x00008000
|
||||||
F_CLOSFD = 9
|
CS8 = 0x0030
|
||||||
F_CONTROL_CVT = 13
|
CSIZE = 0x0030
|
||||||
F_DUPFD = 0
|
ECHO = 0x00000008
|
||||||
F_DUPFD2 = 8
|
ECHONL = 0x00000001
|
||||||
F_GETFD = 1
|
EFD_SEMAPHORE = 0x00002000
|
||||||
F_GETFL = 259
|
EFD_CLOEXEC = 0x00001000
|
||||||
F_GETLK = 5
|
EFD_NONBLOCK = 0x00000004
|
||||||
F_GETOWN = 10
|
EPOLL_CLOEXEC = 0x00001000
|
||||||
F_OK = 0x0
|
EPOLL_CTL_ADD = 0
|
||||||
F_RDLCK = 1
|
EPOLL_CTL_MOD = 1
|
||||||
F_SETFD = 2
|
EPOLL_CTL_DEL = 2
|
||||||
F_SETFL = 4
|
EPOLLRDNORM = 0x0001
|
||||||
F_SETLK = 6
|
EPOLLRDBAND = 0x0002
|
||||||
F_SETLKW = 7
|
EPOLLIN = 0x0003
|
||||||
F_SETOWN = 11
|
EPOLLOUT = 0x0004
|
||||||
F_SETTAG = 12
|
EPOLLWRBAND = 0x0008
|
||||||
F_UNLCK = 3
|
EPOLLPRI = 0x0010
|
||||||
F_WRLCK = 2
|
EPOLLERR = 0x0020
|
||||||
FSTYPE_ZFS = 0xe9 //"Z"
|
EPOLLHUP = 0x0040
|
||||||
FSTYPE_HFS = 0xc8 //"H"
|
EPOLLEXCLUSIVE = 0x20000000
|
||||||
FSTYPE_NFS = 0xd5 //"N"
|
EPOLLONESHOT = 0x40000000
|
||||||
FSTYPE_TFS = 0xe3 //"T"
|
FD_CLOEXEC = 0x01
|
||||||
FSTYPE_AUTOMOUNT = 0xc1 //"A"
|
FD_CLOFORK = 0x02
|
||||||
|
FD_SETSIZE = 0x800
|
||||||
|
FNDELAY = 0x04
|
||||||
|
F_CLOSFD = 9
|
||||||
|
F_CONTROL_CVT = 13
|
||||||
|
F_DUPFD = 0
|
||||||
|
F_DUPFD2 = 8
|
||||||
|
F_GETFD = 1
|
||||||
|
F_GETFL = 259
|
||||||
|
F_GETLK = 5
|
||||||
|
F_GETOWN = 10
|
||||||
|
F_OK = 0x0
|
||||||
|
F_RDLCK = 1
|
||||||
|
F_SETFD = 2
|
||||||
|
F_SETFL = 4
|
||||||
|
F_SETLK = 6
|
||||||
|
F_SETLKW = 7
|
||||||
|
F_SETOWN = 11
|
||||||
|
F_SETTAG = 12
|
||||||
|
F_UNLCK = 3
|
||||||
|
F_WRLCK = 2
|
||||||
|
FSTYPE_ZFS = 0xe9 //"Z"
|
||||||
|
FSTYPE_HFS = 0xc8 //"H"
|
||||||
|
FSTYPE_NFS = 0xd5 //"N"
|
||||||
|
FSTYPE_TFS = 0xe3 //"T"
|
||||||
|
FSTYPE_AUTOMOUNT = 0xc1 //"A"
|
||||||
|
GRND_NONBLOCK = 1
|
||||||
|
GRND_RANDOM = 2
|
||||||
|
HUPCL = 0x0100 // Hang up on last close
|
||||||
|
IN_CLOEXEC = 0x00001000
|
||||||
|
IN_NONBLOCK = 0x00000004
|
||||||
|
IN_ACCESS = 0x00000001
|
||||||
|
IN_MODIFY = 0x00000002
|
||||||
|
IN_ATTRIB = 0x00000004
|
||||||
|
IN_CLOSE_WRITE = 0x00000008
|
||||||
|
IN_CLOSE_NOWRITE = 0x00000010
|
||||||
|
IN_OPEN = 0x00000020
|
||||||
|
IN_MOVED_FROM = 0x00000040
|
||||||
|
IN_MOVED_TO = 0x00000080
|
||||||
|
IN_CREATE = 0x00000100
|
||||||
|
IN_DELETE = 0x00000200
|
||||||
|
IN_DELETE_SELF = 0x00000400
|
||||||
|
IN_MOVE_SELF = 0x00000800
|
||||||
|
IN_UNMOUNT = 0x00002000
|
||||||
|
IN_Q_OVERFLOW = 0x00004000
|
||||||
|
IN_IGNORED = 0x00008000
|
||||||
|
IN_CLOSE = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE)
|
||||||
|
IN_MOVE = (IN_MOVED_FROM | IN_MOVED_TO)
|
||||||
|
IN_ALL_EVENTS = (IN_ACCESS | IN_MODIFY | IN_ATTRIB |
|
||||||
|
IN_CLOSE | IN_OPEN | IN_MOVE |
|
||||||
|
IN_CREATE | IN_DELETE | IN_DELETE_SELF |
|
||||||
|
IN_MOVE_SELF)
|
||||||
|
IN_ONLYDIR = 0x01000000
|
||||||
|
IN_DONT_FOLLOW = 0x02000000
|
||||||
|
IN_EXCL_UNLINK = 0x04000000
|
||||||
|
IN_MASK_CREATE = 0x10000000
|
||||||
|
IN_MASK_ADD = 0x20000000
|
||||||
|
IN_ISDIR = 0x40000000
|
||||||
|
IN_ONESHOT = 0x80000000
|
||||||
IP6F_MORE_FRAG = 0x0001
|
IP6F_MORE_FRAG = 0x0001
|
||||||
IP6F_OFF_MASK = 0xfff8
|
IP6F_OFF_MASK = 0xfff8
|
||||||
IP6F_RESERVED_MASK = 0x0006
|
IP6F_RESERVED_MASK = 0x0006
|
||||||
|
|
@ -152,10 +210,18 @@ const (
|
||||||
IP_PKTINFO = 101
|
IP_PKTINFO = 101
|
||||||
IP_RECVPKTINFO = 102
|
IP_RECVPKTINFO = 102
|
||||||
IP_TOS = 2
|
IP_TOS = 2
|
||||||
IP_TTL = 3
|
IP_TTL = 14
|
||||||
IP_UNBLOCK_SOURCE = 11
|
IP_UNBLOCK_SOURCE = 11
|
||||||
|
ICMP6_FILTER = 1
|
||||||
|
MCAST_INCLUDE = 0
|
||||||
|
MCAST_EXCLUDE = 1
|
||||||
|
MCAST_JOIN_GROUP = 40
|
||||||
|
MCAST_LEAVE_GROUP = 41
|
||||||
|
MCAST_JOIN_SOURCE_GROUP = 42
|
||||||
|
MCAST_LEAVE_SOURCE_GROUP = 43
|
||||||
|
MCAST_BLOCK_SOURCE = 44
|
||||||
|
MCAST_UNBLOCK_SOURCE = 46
|
||||||
ICANON = 0x0010
|
ICANON = 0x0010
|
||||||
ICMP6_FILTER = 0x26
|
|
||||||
ICRNL = 0x0002
|
ICRNL = 0x0002
|
||||||
IEXTEN = 0x0020
|
IEXTEN = 0x0020
|
||||||
IGNBRK = 0x0004
|
IGNBRK = 0x0004
|
||||||
|
|
@ -165,10 +231,10 @@ const (
|
||||||
ISTRIP = 0x0080
|
ISTRIP = 0x0080
|
||||||
IXON = 0x0200
|
IXON = 0x0200
|
||||||
IXOFF = 0x0100
|
IXOFF = 0x0100
|
||||||
LOCK_SH = 0x1 // Not exist on zOS
|
LOCK_SH = 0x1
|
||||||
LOCK_EX = 0x2 // Not exist on zOS
|
LOCK_EX = 0x2
|
||||||
LOCK_NB = 0x4 // Not exist on zOS
|
LOCK_NB = 0x4
|
||||||
LOCK_UN = 0x8 // Not exist on zOS
|
LOCK_UN = 0x8
|
||||||
POLLIN = 0x0003
|
POLLIN = 0x0003
|
||||||
POLLOUT = 0x0004
|
POLLOUT = 0x0004
|
||||||
POLLPRI = 0x0010
|
POLLPRI = 0x0010
|
||||||
|
|
@ -182,15 +248,29 @@ const (
|
||||||
MAP_PRIVATE = 0x1 // changes are private
|
MAP_PRIVATE = 0x1 // changes are private
|
||||||
MAP_SHARED = 0x2 // changes are shared
|
MAP_SHARED = 0x2 // changes are shared
|
||||||
MAP_FIXED = 0x4 // place exactly
|
MAP_FIXED = 0x4 // place exactly
|
||||||
MCAST_JOIN_GROUP = 40
|
__MAP_MEGA = 0x8
|
||||||
MCAST_LEAVE_GROUP = 41
|
__MAP_64 = 0x10
|
||||||
MCAST_JOIN_SOURCE_GROUP = 42
|
MAP_ANON = 0x20
|
||||||
MCAST_LEAVE_SOURCE_GROUP = 43
|
MAP_ANONYMOUS = 0x20
|
||||||
MCAST_BLOCK_SOURCE = 44
|
|
||||||
MCAST_UNBLOCK_SOURCE = 45
|
|
||||||
MS_SYNC = 0x1 // msync - synchronous writes
|
MS_SYNC = 0x1 // msync - synchronous writes
|
||||||
MS_ASYNC = 0x2 // asynchronous writes
|
MS_ASYNC = 0x2 // asynchronous writes
|
||||||
MS_INVALIDATE = 0x4 // invalidate mappings
|
MS_INVALIDATE = 0x4 // invalidate mappings
|
||||||
|
MS_BIND = 0x00001000
|
||||||
|
MS_MOVE = 0x00002000
|
||||||
|
MS_NOSUID = 0x00000002
|
||||||
|
MS_PRIVATE = 0x00040000
|
||||||
|
MS_REC = 0x00004000
|
||||||
|
MS_REMOUNT = 0x00008000
|
||||||
|
MS_RDONLY = 0x00000001
|
||||||
|
MS_UNBINDABLE = 0x00020000
|
||||||
|
MNT_DETACH = 0x00000004
|
||||||
|
ZOSDSFS_SUPER_MAGIC = 0x44534653 // zOS DSFS
|
||||||
|
NFS_SUPER_MAGIC = 0x6969 // NFS
|
||||||
|
NSFS_MAGIC = 0x6e736673 // PROCNS
|
||||||
|
PROC_SUPER_MAGIC = 0x9fa0 // proc FS
|
||||||
|
ZOSTFS_SUPER_MAGIC = 0x544653 // zOS TFS
|
||||||
|
ZOSUFS_SUPER_MAGIC = 0x554653 // zOS UFS
|
||||||
|
ZOSZFS_SUPER_MAGIC = 0x5A4653 // zOS ZFS
|
||||||
MTM_RDONLY = 0x80000000
|
MTM_RDONLY = 0x80000000
|
||||||
MTM_RDWR = 0x40000000
|
MTM_RDWR = 0x40000000
|
||||||
MTM_UMOUNT = 0x10000000
|
MTM_UMOUNT = 0x10000000
|
||||||
|
|
@ -205,13 +285,20 @@ const (
|
||||||
MTM_REMOUNT = 0x00000100
|
MTM_REMOUNT = 0x00000100
|
||||||
MTM_NOSECURITY = 0x00000080
|
MTM_NOSECURITY = 0x00000080
|
||||||
NFDBITS = 0x20
|
NFDBITS = 0x20
|
||||||
|
ONLRET = 0x0020 // NL performs CR function
|
||||||
O_ACCMODE = 0x03
|
O_ACCMODE = 0x03
|
||||||
O_APPEND = 0x08
|
O_APPEND = 0x08
|
||||||
O_ASYNCSIG = 0x0200
|
O_ASYNCSIG = 0x0200
|
||||||
O_CREAT = 0x80
|
O_CREAT = 0x80
|
||||||
|
O_DIRECT = 0x00002000
|
||||||
|
O_NOFOLLOW = 0x00004000
|
||||||
|
O_DIRECTORY = 0x00008000
|
||||||
|
O_PATH = 0x00080000
|
||||||
|
O_CLOEXEC = 0x00001000
|
||||||
O_EXCL = 0x40
|
O_EXCL = 0x40
|
||||||
O_GETFL = 0x0F
|
O_GETFL = 0x0F
|
||||||
O_LARGEFILE = 0x0400
|
O_LARGEFILE = 0x0400
|
||||||
|
O_NDELAY = 0x4
|
||||||
O_NONBLOCK = 0x04
|
O_NONBLOCK = 0x04
|
||||||
O_RDONLY = 0x02
|
O_RDONLY = 0x02
|
||||||
O_RDWR = 0x03
|
O_RDWR = 0x03
|
||||||
|
|
@ -248,6 +335,7 @@ const (
|
||||||
AF_IUCV = 17
|
AF_IUCV = 17
|
||||||
AF_LAT = 14
|
AF_LAT = 14
|
||||||
AF_LINK = 18
|
AF_LINK = 18
|
||||||
|
AF_LOCAL = AF_UNIX // AF_LOCAL is an alias for AF_UNIX
|
||||||
AF_MAX = 30
|
AF_MAX = 30
|
||||||
AF_NBS = 7
|
AF_NBS = 7
|
||||||
AF_NDD = 23
|
AF_NDD = 23
|
||||||
|
|
@ -285,15 +373,33 @@ const (
|
||||||
RLIMIT_AS = 5
|
RLIMIT_AS = 5
|
||||||
RLIMIT_NOFILE = 6
|
RLIMIT_NOFILE = 6
|
||||||
RLIMIT_MEMLIMIT = 7
|
RLIMIT_MEMLIMIT = 7
|
||||||
|
RLIMIT_MEMLOCK = 0x8
|
||||||
RLIM_INFINITY = 2147483647
|
RLIM_INFINITY = 2147483647
|
||||||
|
SCHED_FIFO = 0x2
|
||||||
|
SCM_CREDENTIALS = 0x2
|
||||||
SCM_RIGHTS = 0x01
|
SCM_RIGHTS = 0x01
|
||||||
SF_CLOSE = 0x00000002
|
SF_CLOSE = 0x00000002
|
||||||
SF_REUSE = 0x00000001
|
SF_REUSE = 0x00000001
|
||||||
|
SHM_RND = 0x2
|
||||||
|
SHM_RDONLY = 0x1
|
||||||
|
SHMLBA = 0x1000
|
||||||
|
IPC_STAT = 0x3
|
||||||
|
IPC_SET = 0x2
|
||||||
|
IPC_RMID = 0x1
|
||||||
|
IPC_PRIVATE = 0x0
|
||||||
|
IPC_CREAT = 0x1000000
|
||||||
|
__IPC_MEGA = 0x4000000
|
||||||
|
__IPC_SHAREAS = 0x20000000
|
||||||
|
__IPC_BELOWBAR = 0x10000000
|
||||||
|
IPC_EXCL = 0x2000000
|
||||||
|
__IPC_GIGA = 0x8000000
|
||||||
SHUT_RD = 0
|
SHUT_RD = 0
|
||||||
SHUT_RDWR = 2
|
SHUT_RDWR = 2
|
||||||
SHUT_WR = 1
|
SHUT_WR = 1
|
||||||
|
SOCK_CLOEXEC = 0x00001000
|
||||||
SOCK_CONN_DGRAM = 6
|
SOCK_CONN_DGRAM = 6
|
||||||
SOCK_DGRAM = 2
|
SOCK_DGRAM = 2
|
||||||
|
SOCK_NONBLOCK = 0x800
|
||||||
SOCK_RAW = 3
|
SOCK_RAW = 3
|
||||||
SOCK_RDM = 4
|
SOCK_RDM = 4
|
||||||
SOCK_SEQPACKET = 5
|
SOCK_SEQPACKET = 5
|
||||||
|
|
@ -378,8 +484,6 @@ const (
|
||||||
S_IFMST = 0x00FF0000
|
S_IFMST = 0x00FF0000
|
||||||
TCP_KEEPALIVE = 0x8
|
TCP_KEEPALIVE = 0x8
|
||||||
TCP_NODELAY = 0x1
|
TCP_NODELAY = 0x1
|
||||||
TCP_INFO = 0xb
|
|
||||||
TCP_USER_TIMEOUT = 0x1
|
|
||||||
TIOCGWINSZ = 0x4008a368
|
TIOCGWINSZ = 0x4008a368
|
||||||
TIOCSWINSZ = 0x8008a367
|
TIOCSWINSZ = 0x8008a367
|
||||||
TIOCSBRK = 0x2000a77b
|
TIOCSBRK = 0x2000a77b
|
||||||
|
|
@ -427,7 +531,10 @@ const (
|
||||||
VSUSP = 9
|
VSUSP = 9
|
||||||
VTIME = 10
|
VTIME = 10
|
||||||
WCONTINUED = 0x4
|
WCONTINUED = 0x4
|
||||||
|
WEXITED = 0x8
|
||||||
WNOHANG = 0x1
|
WNOHANG = 0x1
|
||||||
|
WNOWAIT = 0x20
|
||||||
|
WSTOPPED = 0x10
|
||||||
WUNTRACED = 0x2
|
WUNTRACED = 0x2
|
||||||
_BPX_SWAP = 1
|
_BPX_SWAP = 1
|
||||||
_BPX_NONSWAP = 2
|
_BPX_NONSWAP = 2
|
||||||
|
|
@ -452,8 +559,28 @@ const (
|
||||||
MADV_FREE = 15 // for Linux compatibility -- no zos semantics
|
MADV_FREE = 15 // for Linux compatibility -- no zos semantics
|
||||||
MADV_WIPEONFORK = 16 // for Linux compatibility -- no zos semantics
|
MADV_WIPEONFORK = 16 // for Linux compatibility -- no zos semantics
|
||||||
MADV_KEEPONFORK = 17 // for Linux compatibility -- no zos semantics
|
MADV_KEEPONFORK = 17 // for Linux compatibility -- no zos semantics
|
||||||
AT_SYMLINK_NOFOLLOW = 1 // for Unix compatibility -- no zos semantics
|
AT_SYMLINK_FOLLOW = 0x400
|
||||||
AT_FDCWD = 2 // for Unix compatibility -- no zos semantics
|
AT_SYMLINK_NOFOLLOW = 0x100
|
||||||
|
XATTR_CREATE = 0x1
|
||||||
|
XATTR_REPLACE = 0x2
|
||||||
|
P_PID = 0
|
||||||
|
P_PGID = 1
|
||||||
|
P_ALL = 2
|
||||||
|
PR_SET_NAME = 15
|
||||||
|
PR_GET_NAME = 16
|
||||||
|
PR_SET_NO_NEW_PRIVS = 38
|
||||||
|
PR_GET_NO_NEW_PRIVS = 39
|
||||||
|
PR_SET_DUMPABLE = 4
|
||||||
|
PR_GET_DUMPABLE = 3
|
||||||
|
PR_SET_PDEATHSIG = 1
|
||||||
|
PR_GET_PDEATHSIG = 2
|
||||||
|
PR_SET_CHILD_SUBREAPER = 36
|
||||||
|
PR_GET_CHILD_SUBREAPER = 37
|
||||||
|
AT_FDCWD = -100
|
||||||
|
AT_EACCESS = 0x200
|
||||||
|
AT_EMPTY_PATH = 0x1000
|
||||||
|
AT_REMOVEDIR = 0x200
|
||||||
|
RENAME_NOREPLACE = 1 << 0
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -476,6 +603,7 @@ const (
|
||||||
EMLINK = Errno(125)
|
EMLINK = Errno(125)
|
||||||
ENAMETOOLONG = Errno(126)
|
ENAMETOOLONG = Errno(126)
|
||||||
ENFILE = Errno(127)
|
ENFILE = Errno(127)
|
||||||
|
ENOATTR = Errno(265)
|
||||||
ENODEV = Errno(128)
|
ENODEV = Errno(128)
|
||||||
ENOENT = Errno(129)
|
ENOENT = Errno(129)
|
||||||
ENOEXEC = Errno(130)
|
ENOEXEC = Errno(130)
|
||||||
|
|
@ -700,7 +828,7 @@ var errorList = [...]struct {
|
||||||
{145, "EDC5145I", "The parameter list is too long, or the message to receive was too large for the buffer."},
|
{145, "EDC5145I", "The parameter list is too long, or the message to receive was too large for the buffer."},
|
||||||
{146, "EDC5146I", "Too many levels of symbolic links."},
|
{146, "EDC5146I", "Too many levels of symbolic links."},
|
||||||
{147, "EDC5147I", "Illegal byte sequence."},
|
{147, "EDC5147I", "Illegal byte sequence."},
|
||||||
{148, "", ""},
|
{148, "EDC5148I", "The named attribute or data not available."},
|
||||||
{149, "EDC5149I", "Value Overflow Error."},
|
{149, "EDC5149I", "Value Overflow Error."},
|
||||||
{150, "EDC5150I", "UNIX System Services is not active."},
|
{150, "EDC5150I", "UNIX System Services is not active."},
|
||||||
{151, "EDC5151I", "Dynamic allocation error."},
|
{151, "EDC5151I", "Dynamic allocation error."},
|
||||||
|
|
@ -743,6 +871,7 @@ var errorList = [...]struct {
|
||||||
{259, "EDC5259I", "A CUN_RS_NO_CONVERSION error was issued by Unicode Services."},
|
{259, "EDC5259I", "A CUN_RS_NO_CONVERSION error was issued by Unicode Services."},
|
||||||
{260, "EDC5260I", "A CUN_RS_TABLE_NOT_ALIGNED error was issued by Unicode Services."},
|
{260, "EDC5260I", "A CUN_RS_TABLE_NOT_ALIGNED error was issued by Unicode Services."},
|
||||||
{262, "EDC5262I", "An iconv() function encountered an unexpected error while using Unicode Services."},
|
{262, "EDC5262I", "An iconv() function encountered an unexpected error while using Unicode Services."},
|
||||||
|
{265, "EDC5265I", "The named attribute not available."},
|
||||||
{1000, "EDC8000I", "A bad socket-call constant was found in the IUCV header."},
|
{1000, "EDC8000I", "A bad socket-call constant was found in the IUCV header."},
|
||||||
{1001, "EDC8001I", "An error was found in the IUCV header."},
|
{1001, "EDC8001I", "An error was found in the IUCV header."},
|
||||||
{1002, "EDC8002I", "A socket descriptor is out of range."},
|
{1002, "EDC8002I", "A socket descriptor is out of range."},
|
||||||
|
|
|
||||||
364
vendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s
generated
vendored
Normal file
364
vendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s
generated
vendored
Normal file
|
|
@ -0,0 +1,364 @@
|
||||||
|
// go run mksyscall_zos_s390x.go -o_sysnum zsysnum_zos_s390x.go -o_syscall zsyscall_zos_s390x.go -i_syscall syscall_zos_s390x.go -o_asm zsymaddr_zos_s390x.s
|
||||||
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
|
//go:build zos && s390x
|
||||||
|
#include "textflag.h"
|
||||||
|
|
||||||
|
// provide the address of function variable to be fixed up.
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_FlistxattrAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Flistxattr(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_FremovexattrAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Fremovexattr(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_FgetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Fgetxattr(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_FsetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Fsetxattr(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_accept4Addr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·accept4(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_RemovexattrAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Removexattr(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_Dup3Addr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Dup3(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_DirfdAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Dirfd(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_EpollCreateAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·EpollCreate(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_EpollCreate1Addr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·EpollCreate1(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_EpollCtlAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·EpollCtl(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_EpollPwaitAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·EpollPwait(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_EpollWaitAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·EpollWait(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_EventfdAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Eventfd(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_FaccessatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Faccessat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_FchmodatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Fchmodat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_FchownatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Fchownat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_FdatasyncAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Fdatasync(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_fstatatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·fstatat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_LgetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Lgetxattr(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_LsetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Lsetxattr(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_FstatfsAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Fstatfs(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_FutimesAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Futimes(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_FutimesatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Futimesat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_GetrandomAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Getrandom(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_InotifyInitAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·InotifyInit(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_InotifyInit1Addr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·InotifyInit1(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_InotifyAddWatchAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·InotifyAddWatch(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_InotifyRmWatchAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·InotifyRmWatch(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_ListxattrAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Listxattr(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_LlistxattrAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Llistxattr(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_LremovexattrAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Lremovexattr(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_LutimesAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Lutimes(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_StatfsAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Statfs(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_SyncfsAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Syncfs(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_UnshareAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Unshare(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_LinkatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Linkat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_MkdiratAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Mkdirat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_MknodatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Mknodat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_PivotRootAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·PivotRoot(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_PrctlAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Prctl(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_PrlimitAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Prlimit(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_RenameatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Renameat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_Renameat2Addr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Renameat2(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_SethostnameAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Sethostname(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_SetnsAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Setns(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_SymlinkatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Symlinkat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_UnlinkatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Unlinkat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_openatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·openat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_openat2Addr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·openat2(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
TEXT ·get_utimensatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·utimensat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
2837
vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go
generated
vendored
2837
vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go
generated
vendored
File diff suppressed because it is too large
Load diff
5
vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
generated
vendored
|
|
@ -452,4 +452,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 454
|
SYS_FUTEX_WAKE = 454
|
||||||
SYS_FUTEX_WAIT = 455
|
SYS_FUTEX_WAIT = 455
|
||||||
SYS_FUTEX_REQUEUE = 456
|
SYS_FUTEX_REQUEUE = 456
|
||||||
|
SYS_STATMOUNT = 457
|
||||||
|
SYS_LISTMOUNT = 458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 460
|
||||||
|
SYS_LSM_LIST_MODULES = 461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
generated
vendored
|
|
@ -374,4 +374,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 454
|
SYS_FUTEX_WAKE = 454
|
||||||
SYS_FUTEX_WAIT = 455
|
SYS_FUTEX_WAIT = 455
|
||||||
SYS_FUTEX_REQUEUE = 456
|
SYS_FUTEX_REQUEUE = 456
|
||||||
|
SYS_STATMOUNT = 457
|
||||||
|
SYS_LISTMOUNT = 458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 460
|
||||||
|
SYS_LSM_LIST_MODULES = 461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
generated
vendored
|
|
@ -416,4 +416,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 454
|
SYS_FUTEX_WAKE = 454
|
||||||
SYS_FUTEX_WAIT = 455
|
SYS_FUTEX_WAIT = 455
|
||||||
SYS_FUTEX_REQUEUE = 456
|
SYS_FUTEX_REQUEUE = 456
|
||||||
|
SYS_STATMOUNT = 457
|
||||||
|
SYS_LISTMOUNT = 458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 460
|
||||||
|
SYS_LSM_LIST_MODULES = 461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
generated
vendored
|
|
@ -319,4 +319,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 454
|
SYS_FUTEX_WAKE = 454
|
||||||
SYS_FUTEX_WAIT = 455
|
SYS_FUTEX_WAIT = 455
|
||||||
SYS_FUTEX_REQUEUE = 456
|
SYS_FUTEX_REQUEUE = 456
|
||||||
|
SYS_STATMOUNT = 457
|
||||||
|
SYS_LISTMOUNT = 458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 460
|
||||||
|
SYS_LSM_LIST_MODULES = 461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go
generated
vendored
|
|
@ -313,4 +313,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 454
|
SYS_FUTEX_WAKE = 454
|
||||||
SYS_FUTEX_WAIT = 455
|
SYS_FUTEX_WAIT = 455
|
||||||
SYS_FUTEX_REQUEUE = 456
|
SYS_FUTEX_REQUEUE = 456
|
||||||
|
SYS_STATMOUNT = 457
|
||||||
|
SYS_LISTMOUNT = 458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 460
|
||||||
|
SYS_LSM_LIST_MODULES = 461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
generated
vendored
|
|
@ -436,4 +436,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 4454
|
SYS_FUTEX_WAKE = 4454
|
||||||
SYS_FUTEX_WAIT = 4455
|
SYS_FUTEX_WAIT = 4455
|
||||||
SYS_FUTEX_REQUEUE = 4456
|
SYS_FUTEX_REQUEUE = 4456
|
||||||
|
SYS_STATMOUNT = 4457
|
||||||
|
SYS_LISTMOUNT = 4458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 4459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 4460
|
||||||
|
SYS_LSM_LIST_MODULES = 4461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
generated
vendored
|
|
@ -366,4 +366,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 5454
|
SYS_FUTEX_WAKE = 5454
|
||||||
SYS_FUTEX_WAIT = 5455
|
SYS_FUTEX_WAIT = 5455
|
||||||
SYS_FUTEX_REQUEUE = 5456
|
SYS_FUTEX_REQUEUE = 5456
|
||||||
|
SYS_STATMOUNT = 5457
|
||||||
|
SYS_LISTMOUNT = 5458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 5459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 5460
|
||||||
|
SYS_LSM_LIST_MODULES = 5461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
generated
vendored
|
|
@ -366,4 +366,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 5454
|
SYS_FUTEX_WAKE = 5454
|
||||||
SYS_FUTEX_WAIT = 5455
|
SYS_FUTEX_WAIT = 5455
|
||||||
SYS_FUTEX_REQUEUE = 5456
|
SYS_FUTEX_REQUEUE = 5456
|
||||||
|
SYS_STATMOUNT = 5457
|
||||||
|
SYS_LISTMOUNT = 5458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 5459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 5460
|
||||||
|
SYS_LSM_LIST_MODULES = 5461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
generated
vendored
|
|
@ -436,4 +436,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 4454
|
SYS_FUTEX_WAKE = 4454
|
||||||
SYS_FUTEX_WAIT = 4455
|
SYS_FUTEX_WAIT = 4455
|
||||||
SYS_FUTEX_REQUEUE = 4456
|
SYS_FUTEX_REQUEUE = 4456
|
||||||
|
SYS_STATMOUNT = 4457
|
||||||
|
SYS_LISTMOUNT = 4458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 4459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 4460
|
||||||
|
SYS_LSM_LIST_MODULES = 4461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go
generated
vendored
|
|
@ -443,4 +443,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 454
|
SYS_FUTEX_WAKE = 454
|
||||||
SYS_FUTEX_WAIT = 455
|
SYS_FUTEX_WAIT = 455
|
||||||
SYS_FUTEX_REQUEUE = 456
|
SYS_FUTEX_REQUEUE = 456
|
||||||
|
SYS_STATMOUNT = 457
|
||||||
|
SYS_LISTMOUNT = 458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 460
|
||||||
|
SYS_LSM_LIST_MODULES = 461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
generated
vendored
|
|
@ -415,4 +415,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 454
|
SYS_FUTEX_WAKE = 454
|
||||||
SYS_FUTEX_WAIT = 455
|
SYS_FUTEX_WAIT = 455
|
||||||
SYS_FUTEX_REQUEUE = 456
|
SYS_FUTEX_REQUEUE = 456
|
||||||
|
SYS_STATMOUNT = 457
|
||||||
|
SYS_LISTMOUNT = 458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 460
|
||||||
|
SYS_LSM_LIST_MODULES = 461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
generated
vendored
|
|
@ -415,4 +415,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 454
|
SYS_FUTEX_WAKE = 454
|
||||||
SYS_FUTEX_WAIT = 455
|
SYS_FUTEX_WAIT = 455
|
||||||
SYS_FUTEX_REQUEUE = 456
|
SYS_FUTEX_REQUEUE = 456
|
||||||
|
SYS_STATMOUNT = 457
|
||||||
|
SYS_LISTMOUNT = 458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 460
|
||||||
|
SYS_LSM_LIST_MODULES = 461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
generated
vendored
|
|
@ -320,4 +320,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 454
|
SYS_FUTEX_WAKE = 454
|
||||||
SYS_FUTEX_WAIT = 455
|
SYS_FUTEX_WAIT = 455
|
||||||
SYS_FUTEX_REQUEUE = 456
|
SYS_FUTEX_REQUEUE = 456
|
||||||
|
SYS_STATMOUNT = 457
|
||||||
|
SYS_LISTMOUNT = 458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 460
|
||||||
|
SYS_LSM_LIST_MODULES = 461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
generated
vendored
|
|
@ -381,4 +381,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 454
|
SYS_FUTEX_WAKE = 454
|
||||||
SYS_FUTEX_WAIT = 455
|
SYS_FUTEX_WAIT = 455
|
||||||
SYS_FUTEX_REQUEUE = 456
|
SYS_FUTEX_REQUEUE = 456
|
||||||
|
SYS_STATMOUNT = 457
|
||||||
|
SYS_LISTMOUNT = 458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 460
|
||||||
|
SYS_LSM_LIST_MODULES = 461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
generated
vendored
5
vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
generated
vendored
|
|
@ -394,4 +394,9 @@ const (
|
||||||
SYS_FUTEX_WAKE = 454
|
SYS_FUTEX_WAKE = 454
|
||||||
SYS_FUTEX_WAIT = 455
|
SYS_FUTEX_WAIT = 455
|
||||||
SYS_FUTEX_REQUEUE = 456
|
SYS_FUTEX_REQUEUE = 456
|
||||||
|
SYS_STATMOUNT = 457
|
||||||
|
SYS_LISTMOUNT = 458
|
||||||
|
SYS_LSM_GET_SELF_ATTR = 459
|
||||||
|
SYS_LSM_SET_SELF_ATTR = 460
|
||||||
|
SYS_LSM_LIST_MODULES = 461
|
||||||
)
|
)
|
||||||
|
|
|
||||||
5507
vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go
generated
vendored
5507
vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go
generated
vendored
File diff suppressed because it is too large
Load diff
59
vendor/golang.org/x/sys/unix/ztypes_linux.go
generated
vendored
59
vendor/golang.org/x/sys/unix/ztypes_linux.go
generated
vendored
|
|
@ -1178,7 +1178,8 @@ const (
|
||||||
PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT = 0x10
|
PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT = 0x10
|
||||||
PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 0x11
|
PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 0x11
|
||||||
PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT = 0x12
|
PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT = 0x12
|
||||||
PERF_SAMPLE_BRANCH_MAX_SHIFT = 0x13
|
PERF_SAMPLE_BRANCH_COUNTERS = 0x80000
|
||||||
|
PERF_SAMPLE_BRANCH_MAX_SHIFT = 0x14
|
||||||
PERF_SAMPLE_BRANCH_USER = 0x1
|
PERF_SAMPLE_BRANCH_USER = 0x1
|
||||||
PERF_SAMPLE_BRANCH_KERNEL = 0x2
|
PERF_SAMPLE_BRANCH_KERNEL = 0x2
|
||||||
PERF_SAMPLE_BRANCH_HV = 0x4
|
PERF_SAMPLE_BRANCH_HV = 0x4
|
||||||
|
|
@ -1198,7 +1199,7 @@ const (
|
||||||
PERF_SAMPLE_BRANCH_TYPE_SAVE = 0x10000
|
PERF_SAMPLE_BRANCH_TYPE_SAVE = 0x10000
|
||||||
PERF_SAMPLE_BRANCH_HW_INDEX = 0x20000
|
PERF_SAMPLE_BRANCH_HW_INDEX = 0x20000
|
||||||
PERF_SAMPLE_BRANCH_PRIV_SAVE = 0x40000
|
PERF_SAMPLE_BRANCH_PRIV_SAVE = 0x40000
|
||||||
PERF_SAMPLE_BRANCH_MAX = 0x80000
|
PERF_SAMPLE_BRANCH_MAX = 0x100000
|
||||||
PERF_BR_UNKNOWN = 0x0
|
PERF_BR_UNKNOWN = 0x0
|
||||||
PERF_BR_COND = 0x1
|
PERF_BR_COND = 0x1
|
||||||
PERF_BR_UNCOND = 0x2
|
PERF_BR_UNCOND = 0x2
|
||||||
|
|
@ -2481,6 +2482,15 @@ type XDPMmapOffsets struct {
|
||||||
Cr XDPRingOffset
|
Cr XDPRingOffset
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type XDPUmemReg struct {
|
||||||
|
Addr uint64
|
||||||
|
Len uint64
|
||||||
|
Chunk_size uint32
|
||||||
|
Headroom uint32
|
||||||
|
Flags uint32
|
||||||
|
Tx_metadata_len uint32
|
||||||
|
}
|
||||||
|
|
||||||
type XDPStatistics struct {
|
type XDPStatistics struct {
|
||||||
Rx_dropped uint64
|
Rx_dropped uint64
|
||||||
Rx_invalid_descs uint64
|
Rx_invalid_descs uint64
|
||||||
|
|
@ -2935,7 +2945,7 @@ const (
|
||||||
BPF_TCP_LISTEN = 0xa
|
BPF_TCP_LISTEN = 0xa
|
||||||
BPF_TCP_CLOSING = 0xb
|
BPF_TCP_CLOSING = 0xb
|
||||||
BPF_TCP_NEW_SYN_RECV = 0xc
|
BPF_TCP_NEW_SYN_RECV = 0xc
|
||||||
BPF_TCP_MAX_STATES = 0xd
|
BPF_TCP_MAX_STATES = 0xe
|
||||||
TCP_BPF_IW = 0x3e9
|
TCP_BPF_IW = 0x3e9
|
||||||
TCP_BPF_SNDCWND_CLAMP = 0x3ea
|
TCP_BPF_SNDCWND_CLAMP = 0x3ea
|
||||||
TCP_BPF_DELACK_MAX = 0x3eb
|
TCP_BPF_DELACK_MAX = 0x3eb
|
||||||
|
|
@ -3211,7 +3221,7 @@ const (
|
||||||
DEVLINK_CMD_LINECARD_NEW = 0x50
|
DEVLINK_CMD_LINECARD_NEW = 0x50
|
||||||
DEVLINK_CMD_LINECARD_DEL = 0x51
|
DEVLINK_CMD_LINECARD_DEL = 0x51
|
||||||
DEVLINK_CMD_SELFTESTS_GET = 0x52
|
DEVLINK_CMD_SELFTESTS_GET = 0x52
|
||||||
DEVLINK_CMD_MAX = 0x53
|
DEVLINK_CMD_MAX = 0x54
|
||||||
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
||||||
DEVLINK_PORT_TYPE_AUTO = 0x1
|
DEVLINK_PORT_TYPE_AUTO = 0x1
|
||||||
DEVLINK_PORT_TYPE_ETH = 0x2
|
DEVLINK_PORT_TYPE_ETH = 0x2
|
||||||
|
|
@ -4595,7 +4605,7 @@ const (
|
||||||
NL80211_ATTR_MAC_HINT = 0xc8
|
NL80211_ATTR_MAC_HINT = 0xc8
|
||||||
NL80211_ATTR_MAC_MASK = 0xd7
|
NL80211_ATTR_MAC_MASK = 0xd7
|
||||||
NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca
|
NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca
|
||||||
NL80211_ATTR_MAX = 0x146
|
NL80211_ATTR_MAX = 0x14a
|
||||||
NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4
|
NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4
|
||||||
NL80211_ATTR_MAX_CSA_COUNTERS = 0xce
|
NL80211_ATTR_MAX_CSA_COUNTERS = 0xce
|
||||||
NL80211_ATTR_MAX_MATCH_SETS = 0x85
|
NL80211_ATTR_MAX_MATCH_SETS = 0x85
|
||||||
|
|
@ -4861,7 +4871,7 @@ const (
|
||||||
NL80211_BSS_FREQUENCY_OFFSET = 0x14
|
NL80211_BSS_FREQUENCY_OFFSET = 0x14
|
||||||
NL80211_BSS_INFORMATION_ELEMENTS = 0x6
|
NL80211_BSS_INFORMATION_ELEMENTS = 0x6
|
||||||
NL80211_BSS_LAST_SEEN_BOOTTIME = 0xf
|
NL80211_BSS_LAST_SEEN_BOOTTIME = 0xf
|
||||||
NL80211_BSS_MAX = 0x16
|
NL80211_BSS_MAX = 0x18
|
||||||
NL80211_BSS_MLD_ADDR = 0x16
|
NL80211_BSS_MLD_ADDR = 0x16
|
||||||
NL80211_BSS_MLO_LINK_ID = 0x15
|
NL80211_BSS_MLO_LINK_ID = 0x15
|
||||||
NL80211_BSS_PAD = 0x10
|
NL80211_BSS_PAD = 0x10
|
||||||
|
|
@ -4965,7 +4975,7 @@ const (
|
||||||
NL80211_CMD_LEAVE_IBSS = 0x2c
|
NL80211_CMD_LEAVE_IBSS = 0x2c
|
||||||
NL80211_CMD_LEAVE_MESH = 0x45
|
NL80211_CMD_LEAVE_MESH = 0x45
|
||||||
NL80211_CMD_LEAVE_OCB = 0x6d
|
NL80211_CMD_LEAVE_OCB = 0x6d
|
||||||
NL80211_CMD_MAX = 0x9a
|
NL80211_CMD_MAX = 0x9b
|
||||||
NL80211_CMD_MICHAEL_MIC_FAILURE = 0x29
|
NL80211_CMD_MICHAEL_MIC_FAILURE = 0x29
|
||||||
NL80211_CMD_MODIFY_LINK_STA = 0x97
|
NL80211_CMD_MODIFY_LINK_STA = 0x97
|
||||||
NL80211_CMD_NAN_MATCH = 0x78
|
NL80211_CMD_NAN_MATCH = 0x78
|
||||||
|
|
@ -5199,7 +5209,7 @@ const (
|
||||||
NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf
|
NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf
|
||||||
NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe
|
NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe
|
||||||
NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf
|
NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf
|
||||||
NL80211_FREQUENCY_ATTR_MAX = 0x1c
|
NL80211_FREQUENCY_ATTR_MAX = 0x20
|
||||||
NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6
|
NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6
|
||||||
NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11
|
NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11
|
||||||
NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc
|
NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc
|
||||||
|
|
@ -5693,7 +5703,7 @@ const (
|
||||||
NL80211_STA_FLAG_ASSOCIATED = 0x7
|
NL80211_STA_FLAG_ASSOCIATED = 0x7
|
||||||
NL80211_STA_FLAG_AUTHENTICATED = 0x5
|
NL80211_STA_FLAG_AUTHENTICATED = 0x5
|
||||||
NL80211_STA_FLAG_AUTHORIZED = 0x1
|
NL80211_STA_FLAG_AUTHORIZED = 0x1
|
||||||
NL80211_STA_FLAG_MAX = 0x7
|
NL80211_STA_FLAG_MAX = 0x8
|
||||||
NL80211_STA_FLAG_MAX_OLD_API = 0x6
|
NL80211_STA_FLAG_MAX_OLD_API = 0x6
|
||||||
NL80211_STA_FLAG_MFP = 0x4
|
NL80211_STA_FLAG_MFP = 0x4
|
||||||
NL80211_STA_FLAG_SHORT_PREAMBLE = 0x2
|
NL80211_STA_FLAG_SHORT_PREAMBLE = 0x2
|
||||||
|
|
@ -5991,3 +6001,34 @@ type CachestatRange struct {
|
||||||
Off uint64
|
Off uint64
|
||||||
Len uint64
|
Len uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
SK_MEMINFO_RMEM_ALLOC = 0x0
|
||||||
|
SK_MEMINFO_RCVBUF = 0x1
|
||||||
|
SK_MEMINFO_WMEM_ALLOC = 0x2
|
||||||
|
SK_MEMINFO_SNDBUF = 0x3
|
||||||
|
SK_MEMINFO_FWD_ALLOC = 0x4
|
||||||
|
SK_MEMINFO_WMEM_QUEUED = 0x5
|
||||||
|
SK_MEMINFO_OPTMEM = 0x6
|
||||||
|
SK_MEMINFO_BACKLOG = 0x7
|
||||||
|
SK_MEMINFO_DROPS = 0x8
|
||||||
|
SK_MEMINFO_VARS = 0x9
|
||||||
|
SKNLGRP_NONE = 0x0
|
||||||
|
SKNLGRP_INET_TCP_DESTROY = 0x1
|
||||||
|
SKNLGRP_INET_UDP_DESTROY = 0x2
|
||||||
|
SKNLGRP_INET6_TCP_DESTROY = 0x3
|
||||||
|
SKNLGRP_INET6_UDP_DESTROY = 0x4
|
||||||
|
SK_DIAG_BPF_STORAGE_REQ_NONE = 0x0
|
||||||
|
SK_DIAG_BPF_STORAGE_REQ_MAP_FD = 0x1
|
||||||
|
SK_DIAG_BPF_STORAGE_REP_NONE = 0x0
|
||||||
|
SK_DIAG_BPF_STORAGE = 0x1
|
||||||
|
SK_DIAG_BPF_STORAGE_NONE = 0x0
|
||||||
|
SK_DIAG_BPF_STORAGE_PAD = 0x1
|
||||||
|
SK_DIAG_BPF_STORAGE_MAP_ID = 0x2
|
||||||
|
SK_DIAG_BPF_STORAGE_MAP_VALUE = 0x3
|
||||||
|
)
|
||||||
|
|
||||||
|
type SockDiagReq struct {
|
||||||
|
Family uint8
|
||||||
|
Protocol uint8
|
||||||
|
}
|
||||||
|
|
|
||||||
8
vendor/golang.org/x/sys/unix/ztypes_linux_386.go
generated
vendored
8
vendor/golang.org/x/sys/unix/ztypes_linux_386.go
generated
vendored
|
|
@ -477,14 +477,6 @@ const (
|
||||||
BLKPG = 0x1269
|
BLKPG = 0x1269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]int8
|
Name [64]int8
|
||||||
Driver_name [64]int8
|
Driver_name [64]int8
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
generated
vendored
9
vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
generated
vendored
|
|
@ -492,15 +492,6 @@ const (
|
||||||
BLKPG = 0x1269
|
BLKPG = 0x1269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
_ [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]int8
|
Name [64]int8
|
||||||
Driver_name [64]int8
|
Driver_name [64]int8
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
generated
vendored
9
vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
generated
vendored
|
|
@ -470,15 +470,6 @@ const (
|
||||||
BLKPG = 0x1269
|
BLKPG = 0x1269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
_ [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]uint8
|
Name [64]uint8
|
||||||
Driver_name [64]uint8
|
Driver_name [64]uint8
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
generated
vendored
9
vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
generated
vendored
|
|
@ -471,15 +471,6 @@ const (
|
||||||
BLKPG = 0x1269
|
BLKPG = 0x1269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
_ [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]int8
|
Name [64]int8
|
||||||
Driver_name [64]int8
|
Driver_name [64]int8
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go
generated
vendored
9
vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go
generated
vendored
|
|
@ -472,15 +472,6 @@ const (
|
||||||
BLKPG = 0x1269
|
BLKPG = 0x1269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
_ [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]int8
|
Name [64]int8
|
||||||
Driver_name [64]int8
|
Driver_name [64]int8
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
generated
vendored
9
vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
generated
vendored
|
|
@ -476,15 +476,6 @@ const (
|
||||||
BLKPG = 0x20001269
|
BLKPG = 0x20001269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
_ [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]int8
|
Name [64]int8
|
||||||
Driver_name [64]int8
|
Driver_name [64]int8
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
generated
vendored
9
vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
generated
vendored
|
|
@ -474,15 +474,6 @@ const (
|
||||||
BLKPG = 0x20001269
|
BLKPG = 0x20001269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
_ [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]int8
|
Name [64]int8
|
||||||
Driver_name [64]int8
|
Driver_name [64]int8
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
generated
vendored
9
vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
generated
vendored
|
|
@ -474,15 +474,6 @@ const (
|
||||||
BLKPG = 0x20001269
|
BLKPG = 0x20001269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
_ [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]int8
|
Name [64]int8
|
||||||
Driver_name [64]int8
|
Driver_name [64]int8
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
generated
vendored
9
vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
generated
vendored
|
|
@ -476,15 +476,6 @@ const (
|
||||||
BLKPG = 0x20001269
|
BLKPG = 0x20001269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
_ [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]int8
|
Name [64]int8
|
||||||
Driver_name [64]int8
|
Driver_name [64]int8
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go
generated
vendored
9
vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go
generated
vendored
|
|
@ -482,15 +482,6 @@ const (
|
||||||
BLKPG = 0x20001269
|
BLKPG = 0x20001269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
_ [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]uint8
|
Name [64]uint8
|
||||||
Driver_name [64]uint8
|
Driver_name [64]uint8
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
generated
vendored
9
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
generated
vendored
|
|
@ -481,15 +481,6 @@ const (
|
||||||
BLKPG = 0x20001269
|
BLKPG = 0x20001269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
_ [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]uint8
|
Name [64]uint8
|
||||||
Driver_name [64]uint8
|
Driver_name [64]uint8
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
generated
vendored
9
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
generated
vendored
|
|
@ -481,15 +481,6 @@ const (
|
||||||
BLKPG = 0x20001269
|
BLKPG = 0x20001269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
_ [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]uint8
|
Name [64]uint8
|
||||||
Driver_name [64]uint8
|
Driver_name [64]uint8
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go
generated
vendored
9
vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go
generated
vendored
|
|
@ -499,15 +499,6 @@ const (
|
||||||
BLKPG = 0x1269
|
BLKPG = 0x1269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
_ [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]uint8
|
Name [64]uint8
|
||||||
Driver_name [64]uint8
|
Driver_name [64]uint8
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
generated
vendored
9
vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
generated
vendored
|
|
@ -495,15 +495,6 @@ const (
|
||||||
BLKPG = 0x1269
|
BLKPG = 0x1269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
_ [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]int8
|
Name [64]int8
|
||||||
Driver_name [64]int8
|
Driver_name [64]int8
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go
generated
vendored
9
vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go
generated
vendored
|
|
@ -476,15 +476,6 @@ const (
|
||||||
BLKPG = 0x20001269
|
BLKPG = 0x20001269
|
||||||
)
|
)
|
||||||
|
|
||||||
type XDPUmemReg struct {
|
|
||||||
Addr uint64
|
|
||||||
Len uint64
|
|
||||||
Size uint32
|
|
||||||
Headroom uint32
|
|
||||||
Flags uint32
|
|
||||||
_ [4]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
type CryptoUserAlg struct {
|
type CryptoUserAlg struct {
|
||||||
Name [64]int8
|
Name [64]int8
|
||||||
Driver_name [64]int8
|
Driver_name [64]int8
|
||||||
|
|
|
||||||
146
vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go
generated
vendored
146
vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go
generated
vendored
|
|
@ -25,10 +25,13 @@ const (
|
||||||
SizeofIPv6Mreq = 20
|
SizeofIPv6Mreq = 20
|
||||||
SizeofICMPv6Filter = 32
|
SizeofICMPv6Filter = 32
|
||||||
SizeofIPv6MTUInfo = 32
|
SizeofIPv6MTUInfo = 32
|
||||||
|
SizeofInet4Pktinfo = 8
|
||||||
|
SizeofInet6Pktinfo = 20
|
||||||
SizeofLinger = 8
|
SizeofLinger = 8
|
||||||
SizeofSockaddrInet4 = 16
|
SizeofSockaddrInet4 = 16
|
||||||
SizeofSockaddrInet6 = 28
|
SizeofSockaddrInet6 = 28
|
||||||
SizeofTCPInfo = 0x68
|
SizeofTCPInfo = 0x68
|
||||||
|
SizeofUcred = 12
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
|
@ -69,12 +72,17 @@ type Utimbuf struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Utsname struct {
|
type Utsname struct {
|
||||||
Sysname [65]byte
|
Sysname [16]byte
|
||||||
Nodename [65]byte
|
Nodename [32]byte
|
||||||
Release [65]byte
|
Release [8]byte
|
||||||
Version [65]byte
|
Version [8]byte
|
||||||
Machine [65]byte
|
Machine [16]byte
|
||||||
Domainname [65]byte
|
}
|
||||||
|
|
||||||
|
type Ucred struct {
|
||||||
|
Pid int32
|
||||||
|
Uid uint32
|
||||||
|
Gid uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
type RawSockaddrInet4 struct {
|
type RawSockaddrInet4 struct {
|
||||||
|
|
@ -325,7 +333,7 @@ type Statvfs_t struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Statfs_t struct {
|
type Statfs_t struct {
|
||||||
Type uint32
|
Type uint64
|
||||||
Bsize uint64
|
Bsize uint64
|
||||||
Blocks uint64
|
Blocks uint64
|
||||||
Bfree uint64
|
Bfree uint64
|
||||||
|
|
@ -336,6 +344,7 @@ type Statfs_t struct {
|
||||||
Namelen uint64
|
Namelen uint64
|
||||||
Frsize uint64
|
Frsize uint64
|
||||||
Flags uint64
|
Flags uint64
|
||||||
|
_ [4]uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
type direntLE struct {
|
type direntLE struct {
|
||||||
|
|
@ -412,3 +421,126 @@ type W_Mntent struct {
|
||||||
Quiesceowner [8]byte
|
Quiesceowner [8]byte
|
||||||
_ [38]byte
|
_ [38]byte
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type EpollEvent struct {
|
||||||
|
Events uint32
|
||||||
|
_ int32
|
||||||
|
Fd int32
|
||||||
|
Pad int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type InotifyEvent struct {
|
||||||
|
Wd int32
|
||||||
|
Mask uint32
|
||||||
|
Cookie uint32
|
||||||
|
Len uint32
|
||||||
|
Name string
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
SizeofInotifyEvent = 0x10
|
||||||
|
)
|
||||||
|
|
||||||
|
type ConsMsg2 struct {
|
||||||
|
Cm2Format uint16
|
||||||
|
Cm2R1 uint16
|
||||||
|
Cm2Msglength uint32
|
||||||
|
Cm2Msg *byte
|
||||||
|
Cm2R2 [4]byte
|
||||||
|
Cm2R3 [4]byte
|
||||||
|
Cm2Routcde *uint32
|
||||||
|
Cm2Descr *uint32
|
||||||
|
Cm2Msgflag uint32
|
||||||
|
Cm2Token uint32
|
||||||
|
Cm2Msgid *uint32
|
||||||
|
Cm2R4 [4]byte
|
||||||
|
Cm2DomToken uint32
|
||||||
|
Cm2DomMsgid *uint32
|
||||||
|
Cm2ModCartptr *byte
|
||||||
|
Cm2ModConsidptr *byte
|
||||||
|
Cm2MsgCart [8]byte
|
||||||
|
Cm2MsgConsid [4]byte
|
||||||
|
Cm2R5 [12]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
CC_modify = 1
|
||||||
|
CC_stop = 2
|
||||||
|
CONSOLE_FORMAT_2 = 2
|
||||||
|
CONSOLE_FORMAT_3 = 3
|
||||||
|
CONSOLE_HRDCPY = 0x80000000
|
||||||
|
)
|
||||||
|
|
||||||
|
type OpenHow struct {
|
||||||
|
Flags uint64
|
||||||
|
Mode uint64
|
||||||
|
Resolve uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
const SizeofOpenHow = 0x18
|
||||||
|
|
||||||
|
const (
|
||||||
|
RESOLVE_CACHED = 0x20
|
||||||
|
RESOLVE_BENEATH = 0x8
|
||||||
|
RESOLVE_IN_ROOT = 0x10
|
||||||
|
RESOLVE_NO_MAGICLINKS = 0x2
|
||||||
|
RESOLVE_NO_SYMLINKS = 0x4
|
||||||
|
RESOLVE_NO_XDEV = 0x1
|
||||||
|
)
|
||||||
|
|
||||||
|
type Siginfo struct {
|
||||||
|
Signo int32
|
||||||
|
Errno int32
|
||||||
|
Code int32
|
||||||
|
Pid int32
|
||||||
|
Uid uint32
|
||||||
|
_ [44]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type SysvIpcPerm struct {
|
||||||
|
Uid uint32
|
||||||
|
Gid uint32
|
||||||
|
Cuid uint32
|
||||||
|
Cgid uint32
|
||||||
|
Mode int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type SysvShmDesc struct {
|
||||||
|
Perm SysvIpcPerm
|
||||||
|
_ [4]byte
|
||||||
|
Lpid int32
|
||||||
|
Cpid int32
|
||||||
|
Nattch uint32
|
||||||
|
_ [4]byte
|
||||||
|
_ [4]byte
|
||||||
|
_ [4]byte
|
||||||
|
_ int32
|
||||||
|
_ uint8
|
||||||
|
_ uint8
|
||||||
|
_ uint16
|
||||||
|
_ *byte
|
||||||
|
Segsz uint64
|
||||||
|
Atime Time_t
|
||||||
|
Dtime Time_t
|
||||||
|
Ctime Time_t
|
||||||
|
}
|
||||||
|
|
||||||
|
type SysvShmDesc64 struct {
|
||||||
|
Perm SysvIpcPerm
|
||||||
|
_ [4]byte
|
||||||
|
Lpid int32
|
||||||
|
Cpid int32
|
||||||
|
Nattch uint32
|
||||||
|
_ [4]byte
|
||||||
|
_ [4]byte
|
||||||
|
_ [4]byte
|
||||||
|
_ int32
|
||||||
|
_ byte
|
||||||
|
_ uint8
|
||||||
|
_ uint16
|
||||||
|
_ *byte
|
||||||
|
Segsz uint64
|
||||||
|
Atime int64
|
||||||
|
Dtime int64
|
||||||
|
Ctime int64
|
||||||
|
}
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/windows/aliases.go
generated
vendored
2
vendor/golang.org/x/sys/windows/aliases.go
generated
vendored
|
|
@ -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.
|
||||||
|
|
||||||
//go:build windows && go1.9
|
//go:build windows
|
||||||
|
|
||||||
package windows
|
package windows
|
||||||
|
|
||||||
|
|
|
||||||
8
vendor/golang.org/x/sys/windows/empty.s
generated
vendored
8
vendor/golang.org/x/sys/windows/empty.s
generated
vendored
|
|
@ -1,8 +0,0 @@
|
||||||
// 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.
|
|
||||||
|
|
||||||
//go:build !go1.12
|
|
||||||
|
|
||||||
// This file is here to allow bodyless functions with go:linkname for Go 1.11
|
|
||||||
// and earlier (see https://golang.org/issue/23311).
|
|
||||||
1
vendor/golang.org/x/sys/windows/security_windows.go
generated
vendored
1
vendor/golang.org/x/sys/windows/security_windows.go
generated
vendored
|
|
@ -68,6 +68,7 @@ type UserInfo10 struct {
|
||||||
//sys NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) = netapi32.NetUserGetInfo
|
//sys NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) = netapi32.NetUserGetInfo
|
||||||
//sys NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) = netapi32.NetGetJoinInformation
|
//sys NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) = netapi32.NetGetJoinInformation
|
||||||
//sys NetApiBufferFree(buf *byte) (neterr error) = netapi32.NetApiBufferFree
|
//sys NetApiBufferFree(buf *byte) (neterr error) = netapi32.NetApiBufferFree
|
||||||
|
//sys NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) = netapi32.NetUserEnum
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// do not reorder
|
// do not reorder
|
||||||
|
|
|
||||||
9
vendor/golang.org/x/sys/windows/zsyscall_windows.go
generated
vendored
9
vendor/golang.org/x/sys/windows/zsyscall_windows.go
generated
vendored
|
|
@ -401,6 +401,7 @@ var (
|
||||||
procTransmitFile = modmswsock.NewProc("TransmitFile")
|
procTransmitFile = modmswsock.NewProc("TransmitFile")
|
||||||
procNetApiBufferFree = modnetapi32.NewProc("NetApiBufferFree")
|
procNetApiBufferFree = modnetapi32.NewProc("NetApiBufferFree")
|
||||||
procNetGetJoinInformation = modnetapi32.NewProc("NetGetJoinInformation")
|
procNetGetJoinInformation = modnetapi32.NewProc("NetGetJoinInformation")
|
||||||
|
procNetUserEnum = modnetapi32.NewProc("NetUserEnum")
|
||||||
procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo")
|
procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo")
|
||||||
procNtCreateFile = modntdll.NewProc("NtCreateFile")
|
procNtCreateFile = modntdll.NewProc("NtCreateFile")
|
||||||
procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile")
|
procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile")
|
||||||
|
|
@ -3486,6 +3487,14 @@ func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (nete
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) {
|
||||||
|
r0, _, _ := syscall.Syscall9(procNetUserEnum.Addr(), 8, uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle)), 0)
|
||||||
|
if r0 != 0 {
|
||||||
|
neterr = syscall.Errno(r0)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) {
|
func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) {
|
||||||
r0, _, _ := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0)
|
r0, _, _ := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0)
|
||||||
if r0 != 0 {
|
if r0 != 0 {
|
||||||
|
|
|
||||||
8
vendor/modules.txt
vendored
8
vendor/modules.txt
vendored
|
|
@ -114,7 +114,7 @@ github.com/gorilla/handlers
|
||||||
# github.com/gorilla/mux v1.8.1
|
# github.com/gorilla/mux v1.8.1
|
||||||
## explicit; go 1.20
|
## explicit; go 1.20
|
||||||
github.com/gorilla/mux
|
github.com/gorilla/mux
|
||||||
# github.com/gorilla/websocket v1.5.1
|
# github.com/gorilla/websocket v1.5.4-0.20240702125206-a62d9d2a8413
|
||||||
## explicit; go 1.20
|
## explicit; go 1.20
|
||||||
github.com/gorilla/websocket
|
github.com/gorilla/websocket
|
||||||
# github.com/inconshreveable/mousetrap v1.1.0
|
# github.com/inconshreveable/mousetrap v1.1.0
|
||||||
|
|
@ -266,7 +266,7 @@ go.opentelemetry.io/otel/metric/embedded
|
||||||
## explicit; go 1.21
|
## explicit; go 1.21
|
||||||
go.opentelemetry.io/otel/trace
|
go.opentelemetry.io/otel/trace
|
||||||
go.opentelemetry.io/otel/trace/embedded
|
go.opentelemetry.io/otel/trace/embedded
|
||||||
# golang.org/x/crypto v0.22.0
|
# golang.org/x/crypto v0.24.0
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
golang.org/x/crypto/bcrypt
|
golang.org/x/crypto/bcrypt
|
||||||
golang.org/x/crypto/blowfish
|
golang.org/x/crypto/blowfish
|
||||||
|
|
@ -275,7 +275,7 @@ golang.org/x/crypto/chacha20poly1305
|
||||||
golang.org/x/crypto/hkdf
|
golang.org/x/crypto/hkdf
|
||||||
golang.org/x/crypto/internal/alias
|
golang.org/x/crypto/internal/alias
|
||||||
golang.org/x/crypto/internal/poly1305
|
golang.org/x/crypto/internal/poly1305
|
||||||
# golang.org/x/net v0.24.0
|
# golang.org/x/net v0.26.0
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
golang.org/x/net/internal/socks
|
golang.org/x/net/internal/socks
|
||||||
golang.org/x/net/proxy
|
golang.org/x/net/proxy
|
||||||
|
|
@ -286,7 +286,7 @@ golang.org/x/oauth2/internal
|
||||||
# golang.org/x/sync v0.7.0
|
# golang.org/x/sync v0.7.0
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
golang.org/x/sync/errgroup
|
golang.org/x/sync/errgroup
|
||||||
# golang.org/x/sys v0.19.0
|
# golang.org/x/sys v0.21.0
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
golang.org/x/sys/cpu
|
golang.org/x/sys/cpu
|
||||||
golang.org/x/sys/unix
|
golang.org/x/sys/unix
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
"net"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -66,9 +67,10 @@ type Client struct {
|
||||||
id string
|
id string
|
||||||
conn *websocket.Conn
|
conn *websocket.Conn
|
||||||
// Buffered channel of outbound messages.
|
// Buffered channel of outbound messages.
|
||||||
send chan []byte
|
send chan []byte
|
||||||
mux sync.Mutex
|
mux sync.Mutex
|
||||||
ctx context.Context
|
writeMux sync.Mutex
|
||||||
|
ctx context.Context
|
||||||
|
|
||||||
userID string
|
userID string
|
||||||
passwordGeneration uint
|
passwordGeneration uint
|
||||||
|
|
@ -93,6 +95,7 @@ func (c *Client) Stop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
c.running = false
|
c.running = false
|
||||||
|
c.writeMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, ""))
|
||||||
c.conn.Close()
|
c.conn.Close()
|
||||||
close(c.send)
|
close(c.send)
|
||||||
close(c.done)
|
close(c.done)
|
||||||
|
|
@ -176,6 +179,18 @@ func (c *Client) clientReader() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Client) writeMessage(messageType int, message []byte) error {
|
||||||
|
c.writeMux.Lock()
|
||||||
|
defer c.writeMux.Unlock()
|
||||||
|
if err := c.conn.SetWriteDeadline(time.Now().Add(writeWait)); err != nil {
|
||||||
|
return fmt.Errorf("failed to set write deadline: %w", err)
|
||||||
|
}
|
||||||
|
if err := c.conn.WriteMessage(messageType, message); err != nil {
|
||||||
|
return fmt.Errorf("failed to write message: %w", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// clientWriter
|
// clientWriter
|
||||||
func (c *Client) clientWriter() {
|
func (c *Client) clientWriter() {
|
||||||
ticker := time.NewTicker(pingPeriod)
|
ticker := time.NewTicker(pingPeriod)
|
||||||
|
|
@ -191,12 +206,9 @@ func (c *Client) clientWriter() {
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case message, ok := <-c.send:
|
case message, ok := <-c.send:
|
||||||
if err := c.conn.SetWriteDeadline(time.Now().Add(writeWait)); err != nil {
|
|
||||||
slog.With(slog.Any("error", err)).Error("failed to set write deadline")
|
|
||||||
}
|
|
||||||
if !ok {
|
if !ok {
|
||||||
// The hub closed the channel.
|
// The hub closed the channel.
|
||||||
if err := c.conn.WriteMessage(websocket.CloseMessage, []byte{}); err != nil {
|
if err := c.writeMessage(websocket.CloseMessage, []byte{}); err != nil {
|
||||||
if IsErrorOfInterest(err) {
|
if IsErrorOfInterest(err) {
|
||||||
slog.With(slog.Any("error", err)).Error("failed to write message")
|
slog.With(slog.Any("error", err)).Error("failed to write message")
|
||||||
}
|
}
|
||||||
|
|
@ -204,17 +216,14 @@ func (c *Client) clientWriter() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := c.conn.WriteMessage(websocket.TextMessage, message); err != nil {
|
if err := c.writeMessage(websocket.TextMessage, message); err != nil {
|
||||||
if IsErrorOfInterest(err) {
|
if IsErrorOfInterest(err) {
|
||||||
slog.With(slog.Any("error", err)).Error("error sending message")
|
slog.With(slog.Any("error", err)).Error("error sending message")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
if err := c.conn.SetWriteDeadline(time.Now().Add(writeWait)); err != nil {
|
if err := c.writeMessage(websocket.PingMessage, nil); err != nil {
|
||||||
slog.With(slog.Any("error", err)).Error("failed to set write deadline")
|
|
||||||
}
|
|
||||||
if err := c.conn.WriteMessage(websocket.PingMessage, nil); err != nil {
|
|
||||||
if IsErrorOfInterest(err) {
|
if IsErrorOfInterest(err) {
|
||||||
slog.With(slog.Any("error", err)).Error("failed to write ping message")
|
slog.With(slog.Any("error", err)).Error("failed to write ping message")
|
||||||
}
|
}
|
||||||
|
|
@ -245,26 +254,34 @@ func (c *Client) runWatcher() {
|
||||||
slog.InfoContext(c.ctx, "watcher closed")
|
slog.InfoContext(c.ctx, "watcher closed")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
go func(event common.ChangePayload) {
|
if event.EntityType != common.UserEntityType {
|
||||||
if event.EntityType != common.UserEntityType {
|
continue
|
||||||
return
|
}
|
||||||
}
|
|
||||||
|
|
||||||
user, ok := event.Payload.(params.User)
|
user, ok := event.Payload.(params.User)
|
||||||
if !ok {
|
if !ok {
|
||||||
slog.ErrorContext(c.ctx, "failed to cast payload to user")
|
slog.ErrorContext(c.ctx, "failed to cast payload to user")
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if user.ID != c.userID {
|
if user.ID != c.userID {
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if user.Generation != c.passwordGeneration {
|
if event.Operation == common.DeleteOperation {
|
||||||
slog.InfoContext(c.ctx, "password generation mismatch; closing connection")
|
slog.InfoContext(c.ctx, "user deleted; closing connection")
|
||||||
c.Stop()
|
c.Stop()
|
||||||
}
|
}
|
||||||
}(event)
|
|
||||||
|
if !user.Enabled {
|
||||||
|
slog.InfoContext(c.ctx, "user disabled; closing connection")
|
||||||
|
c.Stop()
|
||||||
|
}
|
||||||
|
|
||||||
|
if user.Generation != c.passwordGeneration {
|
||||||
|
slog.InfoContext(c.ctx, "password generation mismatch; closing connection")
|
||||||
|
c.Stop()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -282,6 +299,10 @@ func IsErrorOfInterest(err error) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if errors.Is(err, net.ErrClosed) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
asCloseErr, ok := err.(*websocket.CloseError)
|
asCloseErr, ok := err.(*websocket.CloseError)
|
||||||
if ok {
|
if ok {
|
||||||
switch asCloseErr.Code {
|
switch asCloseErr.Code {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue