Kaynağa Gözat

优化vendor, 删除没有修改的原始包, 只保留修改的包

niujiuru 1 ay önce
ebeveyn
işleme
1f576e38f0
100 değiştirilmiş dosya ile 2 ekleme ve 22710 silme
  1. 2 0
      go.mod
  2. 0 2
      go.sum
  3. 0 21
      vendor/github.com/alexflint/go-filemutex/LICENSE
  4. 0 31
      vendor/github.com/alexflint/go-filemutex/README.md
  5. 0 5
      vendor/github.com/alexflint/go-filemutex/filemutex.go
  6. 0 63
      vendor/github.com/alexflint/go-filemutex/filemutex_flock.go
  7. 0 63
      vendor/github.com/alexflint/go-filemutex/filemutex_windows.go
  8. 0 11
      vendor/github.com/beevik/ntp/CONTRIBUTORS
  9. 0 24
      vendor/github.com/beevik/ntp/LICENSE
  10. 0 113
      vendor/github.com/beevik/ntp/README.md
  11. 0 207
      vendor/github.com/beevik/ntp/RELEASE_NOTES.md
  12. 0 240
      vendor/github.com/beevik/ntp/auth.go
  13. 0 843
      vendor/github.com/beevik/ntp/ntp.go
  14. 0 354
      vendor/github.com/hashicorp/errwrap/LICENSE
  15. 0 89
      vendor/github.com/hashicorp/errwrap/README.md
  16. 0 169
      vendor/github.com/hashicorp/errwrap/errwrap.go
  17. 0 353
      vendor/github.com/hashicorp/go-multierror/LICENSE
  18. 0 31
      vendor/github.com/hashicorp/go-multierror/Makefile
  19. 0 150
      vendor/github.com/hashicorp/go-multierror/README.md
  20. 0 43
      vendor/github.com/hashicorp/go-multierror/append.go
  21. 0 26
      vendor/github.com/hashicorp/go-multierror/flatten.go
  22. 0 27
      vendor/github.com/hashicorp/go-multierror/format.go
  23. 0 38
      vendor/github.com/hashicorp/go-multierror/group.go
  24. 0 121
      vendor/github.com/hashicorp/go-multierror/multierror.go
  25. 0 37
      vendor/github.com/hashicorp/go-multierror/prefix.go
  26. 0 16
      vendor/github.com/hashicorp/go-multierror/sort.go
  27. 0 13
      vendor/github.com/jlaffaye/ftp/LICENSE
  28. 0 63
      vendor/github.com/jlaffaye/ftp/README.md
  29. 0 37
      vendor/github.com/jlaffaye/ftp/debug.go
  30. 0 1143
      vendor/github.com/jlaffaye/ftp/ftp.go
  31. 0 275
      vendor/github.com/jlaffaye/ftp/parse.go
  32. 0 58
      vendor/github.com/jlaffaye/ftp/scanner.go
  33. 0 119
      vendor/github.com/jlaffaye/ftp/status.go
  34. 0 98
      vendor/github.com/jlaffaye/ftp/walker.go
  35. 0 4
      vendor/github.com/sirupsen/logrus/.gitignore
  36. 0 40
      vendor/github.com/sirupsen/logrus/.golangci.yml
  37. 0 15
      vendor/github.com/sirupsen/logrus/.travis.yml
  38. 0 259
      vendor/github.com/sirupsen/logrus/CHANGELOG.md
  39. 0 21
      vendor/github.com/sirupsen/logrus/LICENSE
  40. 0 515
      vendor/github.com/sirupsen/logrus/README.md
  41. 0 76
      vendor/github.com/sirupsen/logrus/alt_exit.go
  42. 0 14
      vendor/github.com/sirupsen/logrus/appveyor.yml
  43. 0 43
      vendor/github.com/sirupsen/logrus/buffer_pool.go
  44. 0 26
      vendor/github.com/sirupsen/logrus/doc.go
  45. 0 442
      vendor/github.com/sirupsen/logrus/entry.go
  46. 0 270
      vendor/github.com/sirupsen/logrus/exported.go
  47. 0 78
      vendor/github.com/sirupsen/logrus/formatter.go
  48. 0 34
      vendor/github.com/sirupsen/logrus/hooks.go
  49. 0 128
      vendor/github.com/sirupsen/logrus/json_formatter.go
  50. 0 417
      vendor/github.com/sirupsen/logrus/logger.go
  51. 0 186
      vendor/github.com/sirupsen/logrus/logrus.go
  52. 0 11
      vendor/github.com/sirupsen/logrus/terminal_check_appengine.go
  53. 0 13
      vendor/github.com/sirupsen/logrus/terminal_check_bsd.go
  54. 0 7
      vendor/github.com/sirupsen/logrus/terminal_check_js.go
  55. 0 11
      vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go
  56. 0 17
      vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go
  57. 0 11
      vendor/github.com/sirupsen/logrus/terminal_check_solaris.go
  58. 0 13
      vendor/github.com/sirupsen/logrus/terminal_check_unix.go
  59. 0 27
      vendor/github.com/sirupsen/logrus/terminal_check_windows.go
  60. 0 339
      vendor/github.com/sirupsen/logrus/text_formatter.go
  61. 0 102
      vendor/github.com/sirupsen/logrus/writer.go
  62. 0 2
      vendor/github.com/vishvananda/netlink/.gitignore
  63. 0 5
      vendor/github.com/vishvananda/netlink/CHANGELOG.md
  64. 0 192
      vendor/github.com/vishvananda/netlink/LICENSE
  65. 0 30
      vendor/github.com/vishvananda/netlink/Makefile
  66. 0 92
      vendor/github.com/vishvananda/netlink/README.md
  67. 0 57
      vendor/github.com/vishvananda/netlink/addr.go
  68. 0 431
      vendor/github.com/vishvananda/netlink/addr_linux.go
  69. 0 77
      vendor/github.com/vishvananda/netlink/bpf_linux.go
  70. 0 299
      vendor/github.com/vishvananda/netlink/bridge_linux.go
  71. 0 22
      vendor/github.com/vishvananda/netlink/chain.go
  72. 0 120
      vendor/github.com/vishvananda/netlink/chain_linux.go
  73. 0 241
      vendor/github.com/vishvananda/netlink/class.go
  74. 0 406
      vendor/github.com/vishvananda/netlink/class_linux.go
  75. 0 921
      vendor/github.com/vishvananda/netlink/conntrack_linux.go
  76. 0 72
      vendor/github.com/vishvananda/netlink/conntrack_unspecified.go
  77. 0 1175
      vendor/github.com/vishvananda/netlink/devlink_linux.go
  78. 0 514
      vendor/github.com/vishvananda/netlink/filter.go
  79. 0 1229
      vendor/github.com/vishvananda/netlink/filter_linux.go
  80. 0 16
      vendor/github.com/vishvananda/netlink/fou.go
  81. 0 211
      vendor/github.com/vishvananda/netlink/fou_linux.go
  82. 0 16
      vendor/github.com/vishvananda/netlink/fou_unspecified.go
  83. 0 180
      vendor/github.com/vishvananda/netlink/genetlink_linux.go
  84. 0 25
      vendor/github.com/vishvananda/netlink/genetlink_unspecified.go
  85. 0 248
      vendor/github.com/vishvananda/netlink/gtp_linux.go
  86. 0 183
      vendor/github.com/vishvananda/netlink/handle_linux.go
  87. 0 305
      vendor/github.com/vishvananda/netlink/handle_unspecified.go
  88. 0 40
      vendor/github.com/vishvananda/netlink/inet_diag.go
  89. 0 90
      vendor/github.com/vishvananda/netlink/ioctl_linux.go
  90. 0 662
      vendor/github.com/vishvananda/netlink/ipset_linux.go
  91. 0 1454
      vendor/github.com/vishvananda/netlink/link.go
  92. 0 4213
      vendor/github.com/vishvananda/netlink/link_linux.go
  93. 0 151
      vendor/github.com/vishvananda/netlink/link_tuntap_linux.go
  94. 0 41
      vendor/github.com/vishvananda/netlink/neigh.go
  95. 0 499
      vendor/github.com/vishvananda/netlink/neigh_linux.go
  96. 0 40
      vendor/github.com/vishvananda/netlink/netlink.go
  97. 0 14
      vendor/github.com/vishvananda/netlink/netlink_linux.go
  98. 0 294
      vendor/github.com/vishvananda/netlink/netlink_unspecified.go
  99. 0 141
      vendor/github.com/vishvananda/netlink/netns_linux.go
  100. 0 0
      vendor/github.com/vishvananda/netlink/netns_unspecified.go

+ 2 - 0
go.mod

@@ -19,3 +19,5 @@ require (
 	golang.org/x/net v0.44.0 // indirect
 	golang.org/x/sys v0.36.0 // indirect
 )
+
+replace gopkg.in/natefinch/lumberjack.v2 => ./vendor_lumberjack/lumberjack-2.2.1

+ 0 - 2
go.sum

@@ -35,8 +35,6 @@ golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
 gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
-gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
-gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=
 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

+ 0 - 21
vendor/github.com/alexflint/go-filemutex/LICENSE

@@ -1,21 +0,0 @@
-The MIT License
-
-Copyright (c) 2010-2017 Alex Flint.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.

+ 0 - 31
vendor/github.com/alexflint/go-filemutex/README.md

@@ -1,31 +0,0 @@
-# FileMutex
-
-FileMutex is similar to `sync.RWMutex`, but also synchronizes across processes.
-On Linux, OSX, and other POSIX systems it uses the flock system call. On windows
-it uses the LockFileEx and UnlockFileEx system calls.
-
-```go
-import (
-	"log"
-	"github.com/alexflint/go-filemutex"
-)
-
-func main() {
-	m, err := filemutex.New("/tmp/foo.lock")
-	if err != nil {
-		log.Fatalln("Directory did not exist or file could not created")
-	}
-
-	m.Lock()  // Will block until lock can be acquired
-
-	// Code here is protected by the mutex
-
-	m.Unlock()
-}
-```
-
-### Installation
-
-    go get github.com/alexflint/go-filemutex
-
-Forked from https://github.com/golang/build/tree/master/cmd/builder/filemutex_*.go

+ 0 - 5
vendor/github.com/alexflint/go-filemutex/filemutex.go

@@ -1,5 +0,0 @@
-package filemutex
-
-import "errors"
-
-var AlreadyLocked = errors.New("lock already acquired")

+ 0 - 63
vendor/github.com/alexflint/go-filemutex/filemutex_flock.go

@@ -1,63 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build darwin dragonfly freebsd linux netbsd openbsd solaris
-
-package filemutex
-
-import "golang.org/x/sys/unix"
-
-const (
-	mkdirPerm = 0750
-)
-
-// FileMutex is similar to sync.RWMutex, but also synchronizes across processes.
-// This implementation is based on flock syscall.
-type FileMutex struct {
-	fd int
-}
-
-func New(filename string) (*FileMutex, error) {
-	fd, err := unix.Open(filename, unix.O_CREAT|unix.O_RDONLY, mkdirPerm)
-	if err != nil {
-		return nil, err
-	}
-	return &FileMutex{fd: fd}, nil
-}
-
-func (m *FileMutex) Lock() error {
-	return unix.Flock(m.fd, unix.LOCK_EX)
-}
-
-func (m *FileMutex) TryLock() error {
-	if err := unix.Flock(m.fd, unix.LOCK_EX|unix.LOCK_NB); err != nil {
-		if errno, ok := err.(unix.Errno); ok {
-			if errno == unix.EWOULDBLOCK {
-				return AlreadyLocked
-			}
-		}
-		return err
-	}
-	return nil
-}
-
-func (m *FileMutex) Unlock() error {
-	return unix.Flock(m.fd, unix.LOCK_UN)
-}
-
-func (m *FileMutex) RLock() error {
-	return unix.Flock(m.fd, unix.LOCK_SH)
-}
-
-func (m *FileMutex) RUnlock() error {
-	return unix.Flock(m.fd, unix.LOCK_UN)
-}
-
-// Close unlocks the lock and closes the underlying file descriptor.
-func (m *FileMutex) Close() error {
-	if err := unix.Flock(m.fd, unix.LOCK_UN); err != nil {
-		return err
-	}
-	return unix.Close(m.fd)
-}

+ 0 - 63
vendor/github.com/alexflint/go-filemutex/filemutex_windows.go

@@ -1,63 +0,0 @@
-// Copyright 2013 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.
-
-package filemutex
-
-import (
-	"golang.org/x/sys/windows"
-)
-
-// FileMutex is similar to sync.RWMutex, but also synchronizes across processes.
-// This implementation is based on flock syscall.
-type FileMutex struct {
-	fd windows.Handle
-}
-
-func New(filename string) (*FileMutex, error) {
-	fd, err := windows.CreateFile(&(windows.StringToUTF16(filename)[0]), windows.GENERIC_READ|windows.GENERIC_WRITE,
-		windows.FILE_SHARE_READ|windows.FILE_SHARE_WRITE, nil, windows.OPEN_ALWAYS, windows.FILE_ATTRIBUTE_NORMAL, 0)
-	if err != nil {
-		return nil, err
-	}
-	return &FileMutex{fd: fd}, nil
-}
-
-func (m *FileMutex) TryLock() error {
-	if err := windows.LockFileEx(m.fd, windows.LOCKFILE_FAIL_IMMEDIATELY|windows.LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &windows.Overlapped{}); err != nil {
-		if errno, ok := err.(windows.Errno); ok {
-			if errno == windows.ERROR_LOCK_VIOLATION {
-				return AlreadyLocked
-			}
-		}
-		return err
-	}
-	return nil
-}
-
-func (m *FileMutex) Lock() error {
-	return windows.LockFileEx(m.fd, windows.LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &windows.Overlapped{})
-}
-
-func (m *FileMutex) Unlock() error {
-	return windows.UnlockFileEx(m.fd, 0, 1, 0, &windows.Overlapped{})
-}
-
-func (m *FileMutex) RLock() error {
-	return windows.LockFileEx(m.fd, 0, 0, 1, 0, &windows.Overlapped{})
-}
-
-func (m *FileMutex) RUnlock() error {
-	return windows.UnlockFileEx(m.fd, 0, 1, 0, &windows.Overlapped{})
-}
-
-// Close unlocks the lock and closes the underlying file descriptor.
-func (m *FileMutex) Close() error {
-	// See comment section of https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-lockfileex
-	// It's recommended to unlock a file explicitly before closing in order to
-	// avoid delays, but all locks are definitly unlocked when closing a file.
-	// So any unlocking error can be ignored.
-	_ = windows.UnlockFileEx(m.fd, 0, 1, 0, &windows.Overlapped{})
-
-	return windows.Close(m.fd)
-}

+ 0 - 11
vendor/github.com/beevik/ntp/CONTRIBUTORS

@@ -1,11 +0,0 @@
-Brett Vickers (beevik)
-Mikhail Salosin (AlphaB)
-Anton Tolchanov (knyar)
-Christopher Batey (chbatey)
-Meng Zhuo (mengzhuo)
-Leonid Evdokimov (darkk)
-Ask Bjørn Hansen (abh)
-Al Cutter (AlCutter)
-Silves-Xiang (silves-xiang)
-Andrey Smirnov (smira)
-Christian Cedercrantz (chrisceder)

+ 0 - 24
vendor/github.com/beevik/ntp/LICENSE

@@ -1,24 +0,0 @@
-Copyright © 2015-2023 Brett Vickers. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-   1. Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-
-   2. 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.
-
-THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL 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.

+ 0 - 113
vendor/github.com/beevik/ntp/README.md

@@ -1,113 +0,0 @@
-[![GoDoc](https://godoc.org/github.com/beevik/ntp?status.svg)](https://godoc.org/github.com/beevik/ntp)
-[![Go](https://github.com/beevik/ntp/actions/workflows/go.yml/badge.svg)](https://github.com/beevik/ntp/actions/workflows/go.yml)
-
-ntp
-===
-
-The ntp package is an implementation of a Simple NTP (SNTP) client based on
-[RFC 5905](https://tools.ietf.org/html/rfc5905). It allows you to connect to
-a remote NTP server and request information about the current time.
-
-
-## Querying the current time
-
-If all you care about is the current time according to a remote NTP server,
-simply use the `Time` function:
-```go
-time, err := ntp.Time("0.beevik-ntp.pool.ntp.org")
-```
-
-
-## Querying time synchronization data
-
-To obtain the current time as well as some additional synchronization data,
-use the [`Query`](https://godoc.org/github.com/beevik/ntp#Query) function:
-```go
-response, err := ntp.Query("0.beevik-ntp.pool.ntp.org")
-time := time.Now().Add(response.ClockOffset)
-```
-
-The [`Response`](https://godoc.org/github.com/beevik/ntp#Response) structure
-returned by `Query` includes the following information:
-* `ClockOffset`: The estimated offset of the local system clock relative to
-  the server's clock. For a more accurate time reading, you may add this
-  offset to any subsequent system clock reading.
-* `Time`: The time the server transmitted its response, according to its own
-  clock.
-* `RTT`: An estimate of the round-trip-time delay between the client and the
-  server.
-* `Precision`: The precision of the server's clock reading.
-* `Stratum`: The server's stratum, which indicates the number of hops from the
-  server to the reference clock. A stratum 1 server is directly attached to
-  the reference clock. If the stratum is zero, the server has responded with
-  the "kiss of death" and you should examine the `KissCode`.
-* `ReferenceID`: A unique identifier for the consulted reference clock.
-* `ReferenceTime`: The time at which the server last updated its local clock setting.
-* `RootDelay`: The server's aggregate round-trip-time delay to the stratum 1 server.
-* `RootDispersion`: The server's estimated maximum measurement error relative
-  to the reference clock.
-* `RootDistance`: An estimate of the root synchronization distance between the
-  client and the stratum 1 server.
-* `Leap`: The leap second indicator, indicating whether a second should be
-  added to or removed from the current month's last minute.
-* `MinError`: A lower bound on the clock error between the client and the
-  server.
-* `KissCode`: A 4-character string describing the reason for a "kiss of death"
-  response (stratum=0).
-* `Poll`: The maximum polling interval between successive messages to the
-  server.
-
-The `Response` structure's [`Validate`](https://godoc.org/github.com/beevik/ntp#Response.Validate)
-function performs additional sanity checks to determine whether the response
-is suitable for time synchronization purposes.
-```go
-err := response.Validate()
-if err == nil {
-    // response data is suitable for synchronization purposes
-}
-```
-
-If you wish to customize the behavior of the NTP query, use the
-[`QueryWithOptions`](https://godoc.org/github.com/beevik/ntp#QueryWithOptions)
-function:
-```go
-options := ntp.QueryOptions{ Timeout: 30*time.Second, TTL: 5 }
-response, err := ntp.QueryWithOptions("0.beevik-ntp.pool.ntp.org", options)
-time := time.Now().Add(response.ClockOffset)
-```
-
-Configurable [`QueryOptions`](https://godoc.org/github.com/beevik/ntp#QueryOptions)
-include:
-* `Timeout`: How long to wait before giving up on a response from the NTP
-  server.
-* `Version`: Which version of the NTP protocol to use (2, 3 or 4).
-* `TTL`: The maximum number of IP hops before the request packet is discarded.
-* `LocalAddress`: The local IP address to use when sending the query. Useful
-  when the host has multiple network interfaces.
-* `Auth`: The symmetric authentication key and algorithm used by the server to
-  authenticate the query. The same information is used by the client to
-  authenticate the server's response.
-* `Extensions`: Extensions may be added to modify NTP queries before they are
-	transmitted and to process NTP responses after they arrive.
-* `GetSystemTime`: A custom function to obtain the current system time, used
-  to override the default `time.Now` function.
-* `Dialer`: A custom network connection "dialer" function used to override the
-  default UDP dialer function.
-
-## Using the NTP pool
-
-The NTP pool is a shared resource provided by the [NTP Pool
-Project](https://www.pool.ntp.org/en/) and used by people and services all
-over the world. To prevent it from becoming overloaded, please avoid querying
-the standard `pool.ntp.org` zone names in your applications. Instead, consider
-requesting your own [vendor zone](http://www.pool.ntp.org/en/vendors.html) or
-[joining the pool](http://www.pool.ntp.org/join.html).
-
-
-## Network Time Security (NTS)
-
-Network Time Security (NTS) is a recent enhancement of NTP, designed to add
-better authentication and message integrity to the protocol. It is defined by
-[RFC 8915](https://tools.ietf.org/html/rfc8915). If you wish to use NTS, see
-the [nts package](https://github.com/beevik/nts). (The nts package is
-implemented as an extension to this package.)

+ 0 - 207
vendor/github.com/beevik/ntp/RELEASE_NOTES.md

@@ -1,207 +0,0 @@
-Release v1.5.0
-==============
-
-**Changes**
-
-* Added the `GetSystemTime` field to `QueryOptions`.
-* Updated minimum required Go version to 1.24.
-
-**Fixes**
-
-* Upgraded package dependencies to retrieve security fixes.
-
-Release v1.4.3
-==============
-
-**Fixes**
-
-* Fixed an overflow bug in the clock offset calculation introduced by
-  release v1.4.2.
-
-Release v1.4.2
-==============
-
-**Fixes**
-
-* Fixed a bug in clock offset calculation.
-
-Release v1.4.1
-==============
-
-**Updates**
-
-* Upgraded package dependencies to retrieve security fixes.
-
-Release v1.4.0
-==============
-
-**Changes**
-
-* Added a protocol `Version` field to the `Response` struct.
-
-Release v1.3.1
-==============
-
-**Changes**
-
-* Added AES-256-CMAC support for symmetric authentication.
-* Symmetric auth keys may now be specified as ASCII or HEX using the "ASCII:"
-  or "HEX:" prefixes.
-* Updated dependencies to address security issues.
-
-**Fixes**
-
-* Added proper handling of the empty string when used as a server address.
-
-Release v1.3.0
-==============
-
-**Changes**
-
-* Added the `ReferenceString` function to `Response`. This generates a
-  stratum-specific string for the `ReferenceID` value.
-* Optimized the AES CMAC calculation for 64-bit architectures.
-
-**Fixes**
-
-* Fixed a bug introduced in release v1.2.0 that was causing IPv6 addresses
-  to be interpreted incorrectly.
-
-Release v1.2.0
-==============
-
-**Changes**
-
-* Added support for NTP extensions by exposing an extension interface.
-  Extensions are able to (1) modify NTP messages before being sent to
-  the server, and (2) process NTP messages after they arrive from the
-  server. This feature has been added in preparation for NTS support.
-* Added support for RFC 5905 symmetric key authentication.
-* Allowed server address to be specified as a "host:port" pair.
-* Brought package into further compliance with IETF draft on client data
-  minimization.
-* Declared error variables as part of the public API.
-* Added a `Dialer` field to `QueryOptions`. This replaces the deprecated
-  `Dial` field.
-* Added an `IsKissOfDeath` function to the `Response` type.
-
-**Deprecated**
-
-* Deprecated the `Port` field in QueryOptions.
-* Deprecated the `Dial` field in QueryOptions.
-
-Release v1.1.1
-==============
-
-**Fixes**
-
-* Fixed a missing indirect go module dependency.
-
-Release v1.1.0
-==============
-
-**Changes**
-
-* Added the `Dial` property to the `QueryOptions` struct. This allows the user
-  to override the default UDP dialer when setting up a connection to a remote
-  NTP server.
-
-Release v1.0.0
-==============
-
-This package has been stable for several years with no bug reports in that
-time. It is also pretty much feature complete. I am therefore updating the
-version to 1.0.0.
-
-Because this is a major release, all previously deprecated code has been
-removed from the package.
-
-**Breaking changes**
-
-* Removed the `TimeV` function. Use `Time` or `QueryWithOptions` instead.
-
-Release v0.3.2
-==============
-
-**Changes**
-
-* Rename unit tests to enable easier test filtering.
-
-Release v0.3.0
-==============
-
-There have been no breaking changes or further deprecations since the
-previous release.
-
-**Changes**
-
-* Fixed a bug in the calculation of NTP timestamps.
-
-Release v0.2.0
-==============
-
-There are no breaking changes or further deprecations in this release.
-
-**Changes**
-
-* Added `KissCode` to the `Response` structure.
-
-
-Release v0.1.1
-==============
-
-**Breaking changes**
-
-* Removed the `MaxStratum` constant.
-
-**Deprecations**
-
-* Officially deprecated the `TimeV` function.
-
-**Internal changes**
-
-* Removed `minDispersion` from the `RootDistance` calculation, since the value
-  was arbitrary.
-* Moved some validation into main code path so that invalid `TransmitTime` and
-  `mode` responses trigger an error even when `Response.Validate` is not
-  called.
-
-
-Release v0.1.0
-==============
-
-This is the initial release of the `ntp` package.  Currently it supports the
-following features:
-* `Time()` to query the current time according to a remote NTP server.
-* `Query()` to query multiple pieces of time-related information from a remote
-  NTP server.
-* `QueryWithOptions()`, which is like `Query()` but with the ability to
-  override default query options.
-
-Time-related information returned by the `Query` functions includes:
-* `Time`: the time the server transmitted its response, according to the
-  server's clock.
-* `ClockOffset`: the estimated offset of the client's clock relative to the
-  server's clock. You may apply this offset to any local system clock reading
-  once the query is complete.
-* `RTT`: an estimate of the round-trip-time delay between the client and the
-  server.
-* `Precision`: the precision of the server's clock reading.
-* `Stratum`: the "stratum" level of the server, where 1 indicates a server
-  directly connected to a reference clock, and values greater than 1
-  indicating the number of hops from the reference clock.
-* `ReferenceID`: A unique identifier for the NTP server that was contacted.
-* `ReferenceTime`: The time at which the server last updated its local clock
-  setting.
-* `RootDelay`: The server's round-trip delay to the reference clock.
-* `RootDispersion`: The server's total dispersion to the referenced clock.
-* `RootDistance`: An estimate of the root synchronization distance.
-* `Leap`: The leap second indicator.
-* `MinError`: A lower bound on the clock error between the client and the
-  server.
-* `Poll`: the maximum polling interval between successive messages on the
-   server.
-
-The `Response` structure returned by the `Query` functions also contains a
-`Response.Validate()` function that returns an error if any of the fields
-returned by the server are invalid.

+ 0 - 240
vendor/github.com/beevik/ntp/auth.go

@@ -1,240 +0,0 @@
-// Copyright © 2015-2023 Brett Vickers.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package ntp
-
-import (
-	"bytes"
-	"crypto/aes"
-	"crypto/md5"
-	"crypto/sha1"
-	"crypto/sha256"
-	"crypto/sha512"
-	"crypto/subtle"
-	"encoding/binary"
-	"encoding/hex"
-)
-
-// AuthType specifies the cryptographic hash algorithm used to generate a
-// symmetric key authentication digest (or CMAC) for an NTP message. Please
-// note that MD5 and SHA1 are no longer considered secure; they appear here
-// solely for compatibility with existing NTP server implementations.
-type AuthType int
-
-const (
-	AuthNone   AuthType = iota // no authentication
-	AuthMD5                    // MD5 digest
-	AuthSHA1                   // SHA-1 digest
-	AuthSHA256                 // SHA-2 digest (256 bits)
-	AuthSHA512                 // SHA-2 digest (512 bits)
-	AuthAES128                 // AES-128-CMAC
-	AuthAES256                 // AES-256-CMAC
-)
-
-// AuthOptions contains fields used to configure symmetric key authentication
-// for an NTP query.
-type AuthOptions struct {
-	// Type determines the cryptographic hash algorithm used to compute the
-	// authentication digest or CMAC.
-	Type AuthType
-
-	// The cryptographic key used by the client to perform authentication. The
-	// key may be hex-encoded or ascii-encoded. To use a hex-encoded key,
-	// prefix it by "HEX:". To use an ascii-encoded key, prefix it by
-	// "ASCII:". For example, "HEX:6931564b4a5a5045766c55356b30656c7666316c"
-	// or "ASCII:cvuZyN4C8HX8hNcAWDWp".
-	Key string
-
-	// The identifier used by the NTP server to identify which key to use
-	// for authentication purposes.
-	KeyID uint16
-}
-
-var algorithms = []struct {
-	MinKeySize int
-	MaxKeySize int
-	DigestSize int
-	CalcDigest func(payload, key []byte) []byte
-}{
-	{0, 0, 0, nil},                 // AuthNone
-	{4, 32, 16, calcDigest_MD5},    // AuthMD5
-	{4, 32, 20, calcDigest_SHA1},   // AuthSHA1
-	{4, 32, 20, calcDigest_SHA256}, // AuthSHA256
-	{4, 32, 20, calcDigest_SHA512}, // AuthSHA512
-	{16, 16, 16, calcCMAC_AES},     // AuthAES128
-	{32, 32, 16, calcCMAC_AES},     // AuthAES256
-}
-
-func calcDigest_MD5(payload, key []byte) []byte {
-	digest := md5.Sum(append(key, payload...))
-	return digest[:]
-}
-
-func calcDigest_SHA1(payload, key []byte) []byte {
-	digest := sha1.Sum(append(key, payload...))
-	return digest[:]
-}
-
-func calcDigest_SHA256(payload, key []byte) []byte {
-	digest := sha256.Sum256(append(key, payload...))
-	return digest[:20]
-}
-
-func calcDigest_SHA512(payload, key []byte) []byte {
-	digest := sha512.Sum512(append(key, payload...))
-	return digest[:20]
-}
-
-func calcCMAC_AES(payload, key []byte) []byte {
-	// calculate the CMAC according to the algorithm defined in RFC 4493. See
-	// https://tools.ietf.org/html/rfc4493 for details.
-	c, err := aes.NewCipher(key)
-	if err != nil {
-		panic(err)
-	}
-
-	// Generate subkeys.
-	const rb = 0x87
-	k1 := make([]byte, 16)
-	k2 := make([]byte, 16)
-	c.Encrypt(k1, k1)
-	double(k1, k1, rb)
-	double(k2, k1, rb)
-
-	// Process all but the last block.
-	cmac := make([]byte, 16)
-	for ; len(payload) > 16; payload = payload[16:] {
-		xor(cmac, payload[:16])
-		c.Encrypt(cmac, cmac)
-	}
-
-	// Process the last block, padding as necessary.
-	if len(payload) == 16 {
-		xor(cmac, payload)
-		xor(cmac, k1)
-	} else {
-		xor(cmac, pad(payload))
-		xor(cmac, k2)
-	}
-	c.Encrypt(cmac, cmac)
-
-	return cmac
-}
-
-func pad(block []byte) []byte {
-	pad := make([]byte, 16-len(block))
-	pad[0] = 0x80
-	return append(block, pad...)
-}
-
-func double(dst, src []byte, xor int) {
-	_ = src[15] // compiler hint: bounds check
-	s0 := binary.BigEndian.Uint64(src[0:8])
-	s1 := binary.BigEndian.Uint64(src[8:16])
-
-	carry := int(s0 >> 63)
-	d0 := (s0 << 1) | (s1 >> 63)
-	d1 := (s1 << 1) ^ uint64(subtle.ConstantTimeSelect(carry, xor, 0))
-
-	_ = dst[15] // compiler hint: bounds check
-	binary.BigEndian.PutUint64(dst[0:8], d0)
-	binary.BigEndian.PutUint64(dst[8:16], d1)
-}
-
-func xor(dst, src []byte) {
-	_ = src[15] // compiler hint: bounds check
-	s0 := binary.BigEndian.Uint64(src[0:8])
-	s1 := binary.BigEndian.Uint64(src[8:16])
-
-	_ = dst[15] // compiler hint: bounds check
-	d0 := s0 ^ binary.BigEndian.Uint64(dst[0:8])
-	d1 := s1 ^ binary.BigEndian.Uint64(dst[8:16])
-
-	binary.BigEndian.PutUint64(dst[0:8], d0)
-	binary.BigEndian.PutUint64(dst[8:16], d1)
-}
-
-func decodeAuthKey(opt AuthOptions) (key []byte, err error) {
-	if opt.Type == AuthNone {
-		return nil, nil
-	}
-
-	var keyIn string
-	var isHex bool
-	switch {
-	case len(opt.Key) >= 4 && opt.Key[:4] == "HEX:":
-		isHex, keyIn = true, opt.Key[4:]
-	case len(opt.Key) >= 6 && opt.Key[:6] == "ASCII:":
-		isHex, keyIn = false, opt.Key[6:]
-	case len(opt.Key) > 20:
-		isHex, keyIn = true, opt.Key
-	default:
-		isHex, keyIn = false, opt.Key
-	}
-
-	if isHex {
-		key, err = hex.DecodeString(keyIn)
-		if err != nil {
-			return nil, ErrInvalidAuthKey
-		}
-	} else {
-		key = []byte(keyIn)
-	}
-
-	a := algorithms[opt.Type]
-	if len(key) < a.MinKeySize {
-		return nil, ErrInvalidAuthKey
-	}
-	if len(key) > a.MaxKeySize {
-		key = key[:a.MaxKeySize]
-	}
-
-	return key, nil
-}
-
-func appendMAC(buf *bytes.Buffer, opt AuthOptions, key []byte) {
-	if opt.Type == AuthNone {
-		return
-	}
-
-	a := algorithms[opt.Type]
-	payload := buf.Bytes()
-	digest := a.CalcDigest(payload, key)
-	binary.Write(buf, binary.BigEndian, uint32(opt.KeyID))
-	binary.Write(buf, binary.BigEndian, digest)
-}
-
-func verifyMAC(buf []byte, opt AuthOptions, key []byte) error {
-	if opt.Type == AuthNone {
-		return nil
-	}
-
-	// Validate that there are enough bytes at the end of the message to
-	// contain a MAC.
-	const headerSize = 48
-	a := algorithms[opt.Type]
-	macLen := 4 + a.DigestSize
-	remain := len(buf) - headerSize
-	if remain < macLen || (remain%4) != 0 {
-		return ErrAuthFailed
-	}
-
-	// The key ID returned by the server must be the same as the key ID sent
-	// to the server.
-	payloadLen := len(buf) - macLen
-	mac := buf[payloadLen:]
-	keyID := binary.BigEndian.Uint32(mac[:4])
-	if keyID != uint32(opt.KeyID) {
-		return ErrAuthFailed
-	}
-
-	// Calculate and compare digests.
-	payload := buf[:payloadLen]
-	digest := a.CalcDigest(payload, key)
-	if subtle.ConstantTimeCompare(digest, mac[4:]) != 1 {
-		return ErrAuthFailed
-	}
-
-	return nil
-}

+ 0 - 843
vendor/github.com/beevik/ntp/ntp.go

@@ -1,843 +0,0 @@
-// Copyright © 2015-2023 Brett Vickers.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package ntp provides an implementation of a Simple NTP (SNTP) client
-// capable of querying the current time from a remote NTP server.  See
-// RFC 5905 (https://tools.ietf.org/html/rfc5905) for more details.
-//
-// This approach grew out of a go-nuts post by Michael Hofmann:
-// https://groups.google.com/forum/?fromgroups#!topic/golang-nuts/FlcdMU5fkLQ
-package ntp
-
-import (
-	"bytes"
-	"crypto/rand"
-	"encoding/binary"
-	"errors"
-	"fmt"
-	"net"
-	"strconv"
-	"strings"
-	"time"
-
-	"golang.org/x/net/ipv4"
-)
-
-var (
-	ErrAuthFailed             = errors.New("authentication failed")
-	ErrInvalidAuthKey         = errors.New("invalid authentication key")
-	ErrInvalidDispersion      = errors.New("invalid dispersion in response")
-	ErrInvalidLeapSecond      = errors.New("invalid leap second in response")
-	ErrInvalidMode            = errors.New("invalid mode in response")
-	ErrInvalidProtocolVersion = errors.New("invalid protocol version requested")
-	ErrInvalidStratum         = errors.New("invalid stratum in response")
-	ErrInvalidTime            = errors.New("invalid time reported")
-	ErrInvalidTransmitTime    = errors.New("invalid transmit time in response")
-	ErrKissOfDeath            = errors.New("kiss of death received")
-	ErrServerClockFreshness   = errors.New("server clock not fresh")
-	ErrServerResponseMismatch = errors.New("server response didn't match request")
-	ErrServerTickedBackwards  = errors.New("server clock ticked backwards")
-)
-
-// The LeapIndicator is used to warn if a leap second should be inserted
-// or deleted in the last minute of the current month.
-type LeapIndicator uint8
-
-const (
-	// LeapNoWarning indicates no impending leap second.
-	LeapNoWarning LeapIndicator = 0
-
-	// LeapAddSecond indicates the last minute of the day has 61 seconds.
-	LeapAddSecond = 1
-
-	// LeapDelSecond indicates the last minute of the day has 59 seconds.
-	LeapDelSecond = 2
-
-	// LeapNotInSync indicates an unsynchronized leap second.
-	LeapNotInSync = 3
-)
-
-// Internal constants
-const (
-	defaultNtpVersion = 4
-	defaultNtpPort    = 123
-	nanoPerSec        = 1000000000
-	maxStratum        = 16
-	defaultTimeout    = 5 * time.Second
-	maxPollInterval   = (1 << 17) * time.Second
-	maxDispersion     = 16 * time.Second
-)
-
-// Internal variables
-var (
-	ntpEra0 = time.Date(1900, 1, 1, 0, 0, 0, 0, time.UTC)
-	ntpEra1 = time.Date(2036, 2, 7, 6, 28, 16, 0, time.UTC)
-)
-
-type mode uint8
-
-// NTP modes. This package uses only client mode.
-const (
-	reserved mode = 0 + iota
-	symmetricActive
-	symmetricPassive
-	client
-	server
-	broadcast
-	controlMessage
-	reservedPrivate
-)
-
-// An ntpTime is a 64-bit fixed-point (Q32.32) representation of the number of
-// seconds elapsed.
-type ntpTime uint64
-
-// Duration interprets the fixed-point ntpTime as a number of elapsed seconds
-// and returns the corresponding time.Duration value.
-func (t ntpTime) Duration() time.Duration {
-	sec := (t >> 32) * nanoPerSec
-	frac := (t & 0xffffffff) * nanoPerSec
-	nsec := frac >> 32
-	if uint32(frac) >= 0x80000000 {
-		nsec++
-	}
-	return time.Duration(sec + nsec)
-}
-
-// Time interprets the fixed-point ntpTime as an absolute time and returns
-// the corresponding time.Time value.
-func (t ntpTime) Time() time.Time {
-	// Assume NTP era 1 (year 2036+) if the raw timestamp suggests a year
-	// before 1970. Otherwise assume NTP era 0. This allows the function to
-	// report an accurate time value both before and after the 0-to-1 era
-	// rollover.
-	const t1970 = 0x83aa7e8000000000
-	if uint64(t) < t1970 {
-		return ntpEra1.Add(t.Duration())
-	}
-	return ntpEra0.Add(t.Duration())
-}
-
-// toNtpTime converts the time.Time value t into its 64-bit fixed-point
-// ntpTime representation.
-func toNtpTime(t time.Time) ntpTime {
-	nsec := uint64(t.Sub(ntpEra0))
-	sec := nsec / nanoPerSec
-	nsec = uint64(nsec-sec*nanoPerSec) << 32
-	frac := uint64(nsec / nanoPerSec)
-	if nsec%nanoPerSec >= nanoPerSec/2 {
-		frac++
-	}
-	return ntpTime(sec<<32 | frac)
-}
-
-// An ntpTimeShort is a 32-bit fixed-point (Q16.16) representation of the
-// number of seconds elapsed.
-type ntpTimeShort uint32
-
-// Duration interprets the fixed-point ntpTimeShort as a number of elapsed
-// seconds and returns the corresponding time.Duration value.
-func (t ntpTimeShort) Duration() time.Duration {
-	sec := uint64(t>>16) * nanoPerSec
-	frac := uint64(t&0xffff) * nanoPerSec
-	nsec := frac >> 16
-	if uint16(frac) >= 0x8000 {
-		nsec++
-	}
-	return time.Duration(sec + nsec)
-}
-
-// header is an internal representation of an NTP packet header.
-type header struct {
-	LiVnMode       uint8 // Leap Indicator (2) + Version (3) + Mode (3)
-	Stratum        uint8
-	Poll           int8
-	Precision      int8
-	RootDelay      ntpTimeShort
-	RootDispersion ntpTimeShort
-	ReferenceID    uint32 // KoD code if Stratum == 0
-	ReferenceTime  ntpTime
-	OriginTime     ntpTime
-	ReceiveTime    ntpTime
-	TransmitTime   ntpTime
-}
-
-// setVersion sets the NTP protocol version on the header.
-func (h *header) setVersion(v int) {
-	h.LiVnMode = (h.LiVnMode & 0xc7) | uint8(v)<<3
-}
-
-// setMode sets the NTP protocol mode on the header.
-func (h *header) setMode(md mode) {
-	h.LiVnMode = (h.LiVnMode & 0xf8) | uint8(md)
-}
-
-// setLeap modifies the leap indicator on the header.
-func (h *header) setLeap(li LeapIndicator) {
-	h.LiVnMode = (h.LiVnMode & 0x3f) | uint8(li)<<6
-}
-
-// getVersion returns the version value in the header.
-func (h *header) getVersion() int {
-	return int((h.LiVnMode >> 3) & 0x7)
-}
-
-// getMode returns the mode value in the header.
-func (h *header) getMode() mode {
-	return mode(h.LiVnMode & 0x07)
-}
-
-// getLeap returns the leap indicator on the header.
-func (h *header) getLeap() LeapIndicator {
-	return LeapIndicator((h.LiVnMode >> 6) & 0x03)
-}
-
-// An Extension adds custom behaviors capable of modifying NTP packets before
-// being sent to the server and processing packets after being received by the
-// server.
-type Extension interface {
-	// ProcessQuery is called when the client is about to send a query to the
-	// NTP server. The buffer contains the NTP header. It may also contain
-	// extension fields added by extensions processed prior to this one.
-	ProcessQuery(buf *bytes.Buffer) error
-
-	// ProcessResponse is called after the client has received the server's
-	// NTP response. The buffer contains the entire message returned by the
-	// server.
-	ProcessResponse(buf []byte) error
-}
-
-// QueryOptions contains configurable options used by the QueryWithOptions
-// function.
-type QueryOptions struct {
-	// Timeout determines how long the client waits for a response from the
-	// server before failing with a timeout error. Defaults to 5 seconds.
-	Timeout time.Duration
-
-	// Version of the NTP protocol to use. Defaults to 4.
-	Version int
-
-	// LocalAddress contains the local IP address to use when creating a
-	// connection to the remote NTP server. This may be useful when the local
-	// system has more than one IP address. This address should not contain
-	// a port number.
-	LocalAddress string
-
-	// TTL specifies the maximum number of IP hops before the query datagram
-	// is dropped by the network. Defaults to the local system's default value.
-	TTL int
-
-	// Auth contains the settings used to configure NTP symmetric key
-	// authentication. See RFC 5905 for further details.
-	Auth AuthOptions
-
-	// Extensions may be added to modify NTP queries before they are
-	// transmitted and to process NTP responses after they arrive.
-	Extensions []Extension
-
-	// GetSystemTime is a callback used to override the default method of
-	// obtaining the local system time during time synchronization. If not
-	// specified, time.Now is used.
-	GetSystemTime func() time.Time
-
-	// Dialer is a callback used to override the default UDP network dialer.
-	// The localAddress is directly copied from the LocalAddress field
-	// specified in QueryOptions. It may be the empty string or a host address
-	// (without port number). The remoteAddress is the "host:port" string
-	// derived from the first parameter to QueryWithOptions.  The
-	// remoteAddress is guaranteed to include a port number.
-	Dialer func(localAddress, remoteAddress string) (net.Conn, error)
-
-	// Dial is a callback used to override the default UDP network dialer.
-	//
-	// DEPRECATED. Use Dialer instead.
-	Dial func(laddr string, lport int, raddr string, rport int) (net.Conn, error)
-
-	// Port indicates the port used to reach the remote NTP server.
-	//
-	// DEPRECATED. Embed the port number in the query address string instead.
-	Port int
-}
-
-// A Response contains time data, some of which is returned by the NTP server
-// and some of which is calculated by this client.
-type Response struct {
-	// ClockOffset is the estimated offset of the local system clock relative
-	// to the server's clock. Add this value to subsequent local system clock
-	// times in order to obtain a time that is synchronized to the server's
-	// clock.
-	ClockOffset time.Duration
-
-	// Time is the time the server transmitted this response, measured using
-	// its own clock. You should not use this value for time synchronization
-	// purposes. Add ClockOffset to your system clock instead.
-	Time time.Time
-
-	// RTT is the measured round-trip-time delay estimate between the client
-	// and the server.
-	RTT time.Duration
-
-	// Precision is the reported precision of the server's clock.
-	Precision time.Duration
-
-	// Version is the NTP protocol version number reported by the server.
-	Version int
-
-	// Stratum is the "stratum level" of the server. The smaller the number,
-	// the closer the server is to the reference clock. Stratum 1 servers are
-	// attached directly to the reference clock. A stratum value of 0
-	// indicates the "kiss of death," which typically occurs when the client
-	// issues too many requests to the server in a short period of time.
-	Stratum uint8
-
-	// ReferenceID is a 32-bit integer identifying the server or reference
-	// clock. For stratum 1 servers, this is typically a meaningful
-	// zero-padded ASCII-encoded string assigned to the clock. For stratum 2+
-	// servers, this is a reference identifier for the server and is either
-	// the server's IPv4 address or a hash of its IPv6 address. For
-	// kiss-of-death responses (stratum 0), this is the ASCII-encoded "kiss
-	// code".
-	ReferenceID uint32
-
-	// ReferenceTime is the time the server last updated its local clock.
-	ReferenceTime time.Time
-
-	// RootDelay is the server's estimated aggregate round-trip-time delay to
-	// the stratum 1 server.
-	RootDelay time.Duration
-
-	// RootDispersion is the server's estimated maximum measurement error
-	// relative to the stratum 1 server.
-	RootDispersion time.Duration
-
-	// RootDistance is an estimate of the total synchronization distance
-	// between the client and the stratum 1 server.
-	RootDistance time.Duration
-
-	// Leap indicates whether a leap second should be added or removed from
-	// the current month's last minute.
-	Leap LeapIndicator
-
-	// MinError is a lower bound on the error between the client and server
-	// clocks. When the client and server are not synchronized to the same
-	// clock, the reported timestamps may appear to violate the principle of
-	// causality. In other words, the NTP server's response may indicate
-	// that a message was received before it was sent. In such cases, the
-	// minimum error may be useful.
-	MinError time.Duration
-
-	// KissCode is a 4-character string describing the reason for a
-	// "kiss of death" response (stratum=0). For a list of standard kiss
-	// codes, see https://tools.ietf.org/html/rfc5905#section-7.4.
-	KissCode string
-
-	// Poll is the maximum interval between successive NTP query messages to
-	// the server.
-	Poll time.Duration
-
-	authErr error
-}
-
-// IsKissOfDeath returns true if the response is a "kiss of death" from the
-// remote server. If this function returns true, you may examine the
-// response's KissCode value to determine the reason for the kiss of death.
-func (r *Response) IsKissOfDeath() bool {
-	return r.Stratum == 0
-}
-
-// ReferenceString returns the response's ReferenceID value formatted as a
-// string. If the response's stratum is zero, then the "kiss o' death" string
-// is returned. If stratum is one, then the server is a reference clock and
-// the reference clock's name is returned. If stratum is two or greater, then
-// the ID is either an IPv4 address or an MD5 hash of the IPv6 address; in
-// either case the reference string is reported as 4 dot-separated
-// decimal-based integers.
-func (r *Response) ReferenceString() string {
-	if r.Stratum == 0 {
-		return kissCode(r.ReferenceID)
-	}
-
-	var b [4]byte
-	binary.BigEndian.PutUint32(b[:], r.ReferenceID)
-
-	if r.Stratum == 1 {
-		const dot = rune(0x22c5)
-		var r []rune
-		for i := range b {
-			if b[i] == 0 {
-				break
-			}
-			if b[i] >= 32 && b[i] <= 126 {
-				r = append(r, rune(b[i]))
-			} else {
-				r = append(r, dot)
-			}
-		}
-		return fmt.Sprintf(".%s.", string(r))
-	}
-
-	return fmt.Sprintf("%d.%d.%d.%d", b[0], b[1], b[2], b[3])
-}
-
-// Validate checks if the response is valid for the purposes of time
-// synchronization.
-func (r *Response) Validate() error {
-	// Forward authentication errors.
-	if r.authErr != nil {
-		return r.authErr
-	}
-
-	// Handle invalid stratum values.
-	if r.Stratum == 0 {
-		return ErrKissOfDeath
-	}
-	if r.Stratum >= maxStratum {
-		return ErrInvalidStratum
-	}
-
-	// Estimate the "freshness" of the time. If it exceeds the maximum
-	// polling interval (~36 hours), then it cannot be considered "fresh".
-	freshness := r.Time.Sub(r.ReferenceTime)
-	if freshness > maxPollInterval {
-		return ErrServerClockFreshness
-	}
-
-	// Calculate the peer synchronization distance, lambda:
-	//  	lambda := RootDelay/2 + RootDispersion
-	// If this value exceeds MAXDISP (16s), then the time is not suitable
-	// for synchronization purposes.
-	// https://tools.ietf.org/html/rfc5905#appendix-A.5.1.1.
-	lambda := r.RootDelay/2 + r.RootDispersion
-	if lambda > maxDispersion {
-		return ErrInvalidDispersion
-	}
-
-	// If the server's transmit time is before its reference time, the
-	// response is invalid.
-	if r.Time.Before(r.ReferenceTime) {
-		return ErrInvalidTime
-	}
-
-	// Handle invalid leap second indicator.
-	if r.Leap == LeapNotInSync {
-		return ErrInvalidLeapSecond
-	}
-
-	// nil means the response is valid.
-	return nil
-}
-
-// Query requests time data from a remote NTP server. The response contains
-// information from which a more accurate local time can be inferred.
-//
-// The server address is of the form "host", "host:port", "host%zone:port",
-// "[host]:port" or "[host%zone]:port". The host may contain an IPv4, IPv6 or
-// domain name address. When specifying both a port and an IPv6 address, one
-// of the bracket formats must be used. If no port is included, NTP default
-// port 123 is used.
-func Query(address string) (*Response, error) {
-	return QueryWithOptions(address, QueryOptions{})
-}
-
-// QueryWithOptions performs the same function as Query but allows for the
-// customization of certain query behaviors. See the comments for Query and
-// QueryOptions for further details.
-func QueryWithOptions(address string, opt QueryOptions) (*Response, error) {
-	h, now, err := getTime(address, &opt)
-	if err != nil && err != ErrAuthFailed {
-		return nil, err
-	}
-
-	return generateResponse(h, now, err), nil
-}
-
-// Time returns the current, corrected local time using information returned
-// from the remote NTP server. On error, Time returns the uncorrected local
-// system time.
-//
-// The server address is of the form "host", "host:port", "host%zone:port",
-// "[host]:port" or "[host%zone]:port". The host may contain an IPv4, IPv6 or
-// domain name address. When specifying both a port and an IPv6 address, one
-// of the bracket formats must be used. If no port is included, NTP default
-// port 123 is used.
-func Time(address string) (time.Time, error) {
-	r, err := Query(address)
-	if err != nil {
-		return time.Now(), err
-	}
-
-	err = r.Validate()
-	if err != nil {
-		return time.Now(), err
-	}
-
-	// Use the response's clock offset to calculate an accurate time.
-	return time.Now().Add(r.ClockOffset), nil
-}
-
-// getTime performs the NTP server query and returns the response header
-// along with the local system time it was received.
-func getTime(address string, opt *QueryOptions) (*header, ntpTime, error) {
-	if opt.Timeout == 0 {
-		opt.Timeout = defaultTimeout
-	}
-	if opt.Version == 0 {
-		opt.Version = defaultNtpVersion
-	}
-	if opt.Version < 2 || opt.Version > 4 {
-		return nil, 0, ErrInvalidProtocolVersion
-	}
-	if opt.Port == 0 {
-		opt.Port = defaultNtpPort
-	}
-	if opt.Dial != nil {
-		// wrapper for the deprecated Dial callback.
-		opt.Dialer = func(la, ra string) (net.Conn, error) {
-			return dialWrapper(la, ra, opt.Dial)
-		}
-	}
-	if opt.Dialer == nil {
-		opt.Dialer = defaultDialer
-	}
-	if opt.GetSystemTime == nil {
-		opt.GetSystemTime = time.Now
-	}
-
-	// Compose a conforming host:port remote address string if the address
-	// string doesn't already contain a port.
-	remoteAddress, err := fixHostPort(address, opt.Port)
-	if err != nil {
-		return nil, 0, err
-	}
-
-	// Connect to the remote server.
-	con, err := opt.Dialer(opt.LocalAddress, remoteAddress)
-	if err != nil {
-		return nil, 0, err
-	}
-	defer con.Close()
-
-	// Set a TTL for the packet if requested.
-	if opt.TTL != 0 {
-		ipcon := ipv4.NewConn(con)
-		err = ipcon.SetTTL(opt.TTL)
-		if err != nil {
-			return nil, 0, err
-		}
-	}
-
-	// Set a timeout on the connection.
-	con.SetDeadline(time.Now().Add(opt.Timeout))
-
-	// Allocate a buffer big enough to hold an entire response datagram.
-	recvBuf := make([]byte, 8192)
-	recvHdr := new(header)
-
-	// Allocate the query message header.
-	xmitHdr := new(header)
-	xmitHdr.setMode(client)
-	xmitHdr.setVersion(opt.Version)
-	xmitHdr.setLeap(LeapNoWarning)
-	xmitHdr.Precision = 0x20
-
-	// To help prevent spoofing and client fingerprinting, use a
-	// cryptographically random 64-bit value for the TransmitTime. See:
-	// https://www.ietf.org/archive/id/draft-ietf-ntp-data-minimization-04.txt
-	bits := make([]byte, 8)
-	_, err = rand.Read(bits)
-	if err != nil {
-		return nil, 0, err
-	}
-	xmitHdr.TransmitTime = ntpTime(binary.BigEndian.Uint64(bits))
-
-	// Write the query header to a transmit buffer.
-	var xmitBuf bytes.Buffer
-	binary.Write(&xmitBuf, binary.BigEndian, xmitHdr)
-
-	// Allow extensions to process the query and add to the transmit buffer.
-	for _, e := range opt.Extensions {
-		err = e.ProcessQuery(&xmitBuf)
-		if err != nil {
-			return nil, 0, err
-		}
-	}
-
-	// If using symmetric key authentication, decode and validate the auth key
-	// string.
-	authKey, err := decodeAuthKey(opt.Auth)
-	if err != nil {
-		return nil, 0, err
-	}
-
-	// Append a MAC if authentication is being used.
-	appendMAC(&xmitBuf, opt.Auth, authKey)
-
-	// Transmit the query and keep track of when it was transmitted.
-	xmitTime := opt.GetSystemTime()
-	_, err = con.Write(xmitBuf.Bytes())
-	if err != nil {
-		return nil, 0, err
-	}
-
-	// Receive the response.
-	recvBytes, err := con.Read(recvBuf)
-	if err != nil {
-		return nil, 0, err
-	}
-
-	// Keep track of the time the response was received. As of go 1.9, the
-	// time package uses a monotonic clock, so delta will never be less than
-	// zero for go version 1.9 or higher.
-	recvTime := opt.GetSystemTime()
-	if recvTime.Sub(xmitTime) < 0 {
-		recvTime = xmitTime
-	}
-
-	// Parse the response header.
-	recvBuf = recvBuf[:recvBytes]
-	recvReader := bytes.NewReader(recvBuf)
-	err = binary.Read(recvReader, binary.BigEndian, recvHdr)
-	if err != nil {
-		return nil, 0, err
-	}
-
-	// Allow extensions to process the response.
-	for i := len(opt.Extensions) - 1; i >= 0; i-- {
-		err = opt.Extensions[i].ProcessResponse(recvBuf)
-		if err != nil {
-			return nil, 0, err
-		}
-	}
-
-	// Check for invalid fields.
-	if recvHdr.getMode() != server {
-		return nil, 0, ErrInvalidMode
-	}
-	if recvHdr.TransmitTime == ntpTime(0) {
-		return nil, 0, ErrInvalidTransmitTime
-	}
-	if recvHdr.OriginTime != xmitHdr.TransmitTime {
-		return nil, 0, ErrServerResponseMismatch
-	}
-	if recvHdr.ReceiveTime > recvHdr.TransmitTime {
-		return nil, 0, ErrServerTickedBackwards
-	}
-
-	// Correct the received message's origin time using the actual
-	// transmit time.
-	recvHdr.OriginTime = toNtpTime(xmitTime)
-
-	// Perform authentication of the server response.
-	authErr := verifyMAC(recvBuf, opt.Auth, authKey)
-
-	return recvHdr, toNtpTime(recvTime), authErr
-}
-
-// defaultDialer provides a UDP dialer based on Go's built-in net stack.
-func defaultDialer(localAddress, remoteAddress string) (net.Conn, error) {
-	var laddr *net.UDPAddr
-	if localAddress != "" {
-		var err error
-		laddr, err = net.ResolveUDPAddr("udp", net.JoinHostPort(localAddress, "0"))
-		if err != nil {
-			return nil, err
-		}
-	}
-
-	raddr, err := net.ResolveUDPAddr("udp", remoteAddress)
-	if err != nil {
-		return nil, err
-	}
-
-	return net.DialUDP("udp", laddr, raddr)
-}
-
-// dialWrapper is used to wrap the deprecated Dial callback in QueryOptions.
-func dialWrapper(la, ra string,
-	dial func(la string, lp int, ra string, rp int) (net.Conn, error)) (net.Conn, error) {
-	rhost, rport, err := net.SplitHostPort(ra)
-	if err != nil {
-		return nil, err
-	}
-
-	rportValue, err := strconv.Atoi(rport)
-	if err != nil {
-		return nil, err
-	}
-
-	return dial(la, 0, rhost, rportValue)
-}
-
-// fixHostPort examines an address in one of the accepted forms and fixes it
-// to include a port number if necessary.
-func fixHostPort(address string, defaultPort int) (fixed string, err error) {
-	if len(address) == 0 {
-		return "", errors.New("address string is empty")
-	}
-
-	// If the address is wrapped in brackets, append a port if necessary.
-	if address[0] == '[' {
-		end := strings.IndexByte(address, ']')
-		switch {
-		case end < 0:
-			return "", errors.New("missing ']' in address")
-		case end+1 == len(address):
-			return fmt.Sprintf("%s:%d", address, defaultPort), nil
-		case address[end+1] == ':':
-			return address, nil
-		default:
-			return "", errors.New("unexpected character following ']' in address")
-		}
-	}
-
-	// No colons? Must be a port-less IPv4 or domain address.
-	last := strings.LastIndexByte(address, ':')
-	if last < 0 {
-		return fmt.Sprintf("%s:%d", address, defaultPort), nil
-	}
-
-	// Exactly one colon? A port have been included along with an IPv4 or
-	// domain address. (IPv6 addresses are guaranteed to have more than one
-	// colon.)
-	prev := strings.LastIndexByte(address[:last], ':')
-	if prev < 0 {
-		return address, nil
-	}
-
-	// Two or more colons means we must have an IPv6 address without a port.
-	return fmt.Sprintf("[%s]:%d", address, defaultPort), nil
-}
-
-// generateResponse processes NTP header fields along with the its receive
-// time to generate a Response record.
-func generateResponse(h *header, recvTime ntpTime, authErr error) *Response {
-	r := &Response{
-		Time:           h.TransmitTime.Time(),
-		ClockOffset:    offset(h.OriginTime, h.ReceiveTime, h.TransmitTime, recvTime),
-		RTT:            rtt(h.OriginTime, h.ReceiveTime, h.TransmitTime, recvTime),
-		Precision:      toInterval(h.Precision),
-		Version:        h.getVersion(),
-		Stratum:        h.Stratum,
-		ReferenceID:    h.ReferenceID,
-		ReferenceTime:  h.ReferenceTime.Time(),
-		RootDelay:      h.RootDelay.Duration(),
-		RootDispersion: h.RootDispersion.Duration(),
-		Leap:           h.getLeap(),
-		MinError:       minError(h.OriginTime, h.ReceiveTime, h.TransmitTime, recvTime),
-		Poll:           toInterval(h.Poll),
-		authErr:        authErr,
-	}
-
-	// Calculate values depending on other calculated values
-	r.RootDistance = rootDistance(r.RTT, r.RootDelay, r.RootDispersion)
-
-	// If a kiss of death was received, interpret the reference ID as
-	// a kiss code.
-	if r.Stratum == 0 {
-		r.KissCode = kissCode(r.ReferenceID)
-	}
-
-	return r
-}
-
-// The following helper functions calculate additional metadata about the
-// timestamps received from an NTP server.  The timestamps returned by
-// the server are given the following variable names:
-//
-//   org = Origin Timestamp (client send time)
-//   rec = Receive Timestamp (server receive time)
-//   xmt = Transmit Timestamp (server reply time)
-//   dst = Destination Timestamp (client receive time)
-
-func rtt(org, rec, xmt, dst ntpTime) time.Duration {
-	a := int64(dst - org)
-	b := int64(xmt - rec)
-	rtt := a - b
-	if rtt < 0 {
-		rtt = 0
-	}
-	return ntpTime(rtt).Duration()
-}
-
-func offset(org, rec, xmt, dst ntpTime) time.Duration {
-	// The inputs are 64-bit unsigned integer timestamps. These timestamps can
-	// "roll over" at the end of an NTP era, which occurs approximately every
-	// 136 years starting from the year 1900. To ensure an accurate offset
-	// calculation when an era boundary is crossed, we need to take care that
-	// the difference between two 64-bit timestamp values is accurately
-	// calculated even when they are in neighboring eras.
-	//
-	// See: https://www.eecis.udel.edu/~mills/y2k.html
-
-	a := int64(rec - org)
-	b := int64(xmt - dst)
-	offset := a + (b-a)/2
-	if offset < 0 {
-		return -ntpTime(-offset).Duration()
-	}
-	return ntpTime(offset).Duration()
-}
-
-func minError(org, rec, xmt, dst ntpTime) time.Duration {
-	// Each NTP response contains two pairs of send/receive timestamps.
-	// When either pair indicates a "causality violation", we calculate the
-	// error as the difference in time between them. The minimum error is
-	// the greater of the two causality violations.
-	var error0, error1 ntpTime
-	if org >= rec {
-		error0 = org - rec
-	}
-	if xmt >= dst {
-		error1 = xmt - dst
-	}
-	if error0 > error1 {
-		return error0.Duration()
-	}
-	return error1.Duration()
-}
-
-func rootDistance(rtt, rootDelay, rootDisp time.Duration) time.Duration {
-	// The root distance is:
-	// 	the maximum error due to all causes of the local clock
-	//	relative to the primary server. It is defined as half the
-	//	total delay plus total dispersion plus peer jitter.
-	//	(https://tools.ietf.org/html/rfc5905#appendix-A.5.5.2)
-	//
-	// In the reference implementation, it is calculated as follows:
-	//	rootDist = max(MINDISP, rootDelay + rtt)/2 + rootDisp
-	//			+ peerDisp + PHI * (uptime - peerUptime)
-	//			+ peerJitter
-	// For an SNTP client which sends only a single packet, most of these
-	// terms are irrelevant and become 0.
-	totalDelay := rtt + rootDelay
-	return totalDelay/2 + rootDisp
-}
-
-func toInterval(t int8) time.Duration {
-	switch {
-	case t > 0:
-		return time.Duration(uint64(time.Second) << uint(t))
-	case t < 0:
-		return time.Duration(uint64(time.Second) >> uint(-t))
-	default:
-		return time.Second
-	}
-}
-
-func kissCode(id uint32) string {
-	isPrintable := func(ch byte) bool { return ch >= 32 && ch <= 126 }
-
-	b := [4]byte{
-		byte(id >> 24),
-		byte(id >> 16),
-		byte(id >> 8),
-		byte(id),
-	}
-	for _, ch := range b {
-		if !isPrintable(ch) {
-			return ""
-		}
-	}
-	return string(b[:])
-}

+ 0 - 354
vendor/github.com/hashicorp/errwrap/LICENSE

@@ -1,354 +0,0 @@
-Mozilla Public License, version 2.0
-
-1. Definitions
-
-1.1. “Contributor”
-
-     means each individual or legal entity that creates, contributes to the
-     creation of, or owns Covered Software.
-
-1.2. “Contributor Version”
-
-     means the combination of the Contributions of others (if any) used by a
-     Contributor and that particular Contributor’s Contribution.
-
-1.3. “Contribution”
-
-     means Covered Software of a particular Contributor.
-
-1.4. “Covered Software”
-
-     means Source Code Form to which the initial Contributor has attached the
-     notice in Exhibit A, the Executable Form of such Source Code Form, and
-     Modifications of such Source Code Form, in each case including portions
-     thereof.
-
-1.5. “Incompatible With Secondary Licenses”
-     means
-
-     a. that the initial Contributor has attached the notice described in
-        Exhibit B to the Covered Software; or
-
-     b. that the Covered Software was made available under the terms of version
-        1.1 or earlier of the License, but not also under the terms of a
-        Secondary License.
-
-1.6. “Executable Form”
-
-     means any form of the work other than Source Code Form.
-
-1.7. “Larger Work”
-
-     means a work that combines Covered Software with other material, in a separate
-     file or files, that is not Covered Software.
-
-1.8. “License”
-
-     means this document.
-
-1.9. “Licensable”
-
-     means having the right to grant, to the maximum extent possible, whether at the
-     time of the initial grant or subsequently, any and all of the rights conveyed by
-     this License.
-
-1.10. “Modifications”
-
-     means any of the following:
-
-     a. any file in Source Code Form that results from an addition to, deletion
-        from, or modification of the contents of Covered Software; or
-
-     b. any new file in Source Code Form that contains any Covered Software.
-
-1.11. “Patent Claims” of a Contributor
-
-      means any patent claim(s), including without limitation, method, process,
-      and apparatus claims, in any patent Licensable by such Contributor that
-      would be infringed, but for the grant of the License, by the making,
-      using, selling, offering for sale, having made, import, or transfer of
-      either its Contributions or its Contributor Version.
-
-1.12. “Secondary License”
-
-      means either the GNU General Public License, Version 2.0, the GNU Lesser
-      General Public License, Version 2.1, the GNU Affero General Public
-      License, Version 3.0, or any later versions of those licenses.
-
-1.13. “Source Code Form”
-
-      means the form of the work preferred for making modifications.
-
-1.14. “You” (or “Your”)
-
-      means an individual or a legal entity exercising rights under this
-      License. For legal entities, “You” includes any entity that controls, is
-      controlled by, or is under common control with You. For purposes of this
-      definition, “control” means (a) the power, direct or indirect, to cause
-      the direction or management of such entity, whether by contract or
-      otherwise, or (b) ownership of more than fifty percent (50%) of the
-      outstanding shares or beneficial ownership of such entity.
-
-
-2. License Grants and Conditions
-
-2.1. Grants
-
-     Each Contributor hereby grants You a world-wide, royalty-free,
-     non-exclusive license:
-
-     a. under intellectual property rights (other than patent or trademark)
-        Licensable by such Contributor to use, reproduce, make available,
-        modify, display, perform, distribute, and otherwise exploit its
-        Contributions, either on an unmodified basis, with Modifications, or as
-        part of a Larger Work; and
-
-     b. under Patent Claims of such Contributor to make, use, sell, offer for
-        sale, have made, import, and otherwise transfer either its Contributions
-        or its Contributor Version.
-
-2.2. Effective Date
-
-     The licenses granted in Section 2.1 with respect to any Contribution become
-     effective for each Contribution on the date the Contributor first distributes
-     such Contribution.
-
-2.3. Limitations on Grant Scope
-
-     The licenses granted in this Section 2 are the only rights granted under this
-     License. No additional rights or licenses will be implied from the distribution
-     or licensing of Covered Software under this License. Notwithstanding Section
-     2.1(b) above, no patent license is granted by a Contributor:
-
-     a. for any code that a Contributor has removed from Covered Software; or
-
-     b. for infringements caused by: (i) Your and any other third party’s
-        modifications of Covered Software, or (ii) the combination of its
-        Contributions with other software (except as part of its Contributor
-        Version); or
-
-     c. under Patent Claims infringed by Covered Software in the absence of its
-        Contributions.
-
-     This License does not grant any rights in the trademarks, service marks, or
-     logos of any Contributor (except as may be necessary to comply with the
-     notice requirements in Section 3.4).
-
-2.4. Subsequent Licenses
-
-     No Contributor makes additional grants as a result of Your choice to
-     distribute the Covered Software under a subsequent version of this License
-     (see Section 10.2) or under the terms of a Secondary License (if permitted
-     under the terms of Section 3.3).
-
-2.5. Representation
-
-     Each Contributor represents that the Contributor believes its Contributions
-     are its original creation(s) or it has sufficient rights to grant the
-     rights to its Contributions conveyed by this License.
-
-2.6. Fair Use
-
-     This License is not intended to limit any rights You have under applicable
-     copyright doctrines of fair use, fair dealing, or other equivalents.
-
-2.7. Conditions
-
-     Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
-     Section 2.1.
-
-
-3. Responsibilities
-
-3.1. Distribution of Source Form
-
-     All distribution of Covered Software in Source Code Form, including any
-     Modifications that You create or to which You contribute, must be under the
-     terms of this License. You must inform recipients that the Source Code Form
-     of the Covered Software is governed by the terms of this License, and how
-     they can obtain a copy of this License. You may not attempt to alter or
-     restrict the recipients’ rights in the Source Code Form.
-
-3.2. Distribution of Executable Form
-
-     If You distribute Covered Software in Executable Form then:
-
-     a. such Covered Software must also be made available in Source Code Form,
-        as described in Section 3.1, and You must inform recipients of the
-        Executable Form how they can obtain a copy of such Source Code Form by
-        reasonable means in a timely manner, at a charge no more than the cost
-        of distribution to the recipient; and
-
-     b. You may distribute such Executable Form under the terms of this License,
-        or sublicense it under different terms, provided that the license for
-        the Executable Form does not attempt to limit or alter the recipients’
-        rights in the Source Code Form under this License.
-
-3.3. Distribution of a Larger Work
-
-     You may create and distribute a Larger Work under terms of Your choice,
-     provided that You also comply with the requirements of this License for the
-     Covered Software. If the Larger Work is a combination of Covered Software
-     with a work governed by one or more Secondary Licenses, and the Covered
-     Software is not Incompatible With Secondary Licenses, this License permits
-     You to additionally distribute such Covered Software under the terms of
-     such Secondary License(s), so that the recipient of the Larger Work may, at
-     their option, further distribute the Covered Software under the terms of
-     either this License or such Secondary License(s).
-
-3.4. Notices
-
-     You may not remove or alter the substance of any license notices (including
-     copyright notices, patent notices, disclaimers of warranty, or limitations
-     of liability) contained within the Source Code Form of the Covered
-     Software, except that You may alter any license notices to the extent
-     required to remedy known factual inaccuracies.
-
-3.5. Application of Additional Terms
-
-     You may choose to offer, and to charge a fee for, warranty, support,
-     indemnity or liability obligations to one or more recipients of Covered
-     Software. However, You may do so only on Your own behalf, and not on behalf
-     of any Contributor. You must make it absolutely clear that any such
-     warranty, support, indemnity, or liability obligation is offered by You
-     alone, and You hereby agree to indemnify every Contributor for any
-     liability incurred by such Contributor as a result of warranty, support,
-     indemnity or liability terms You offer. You may include additional
-     disclaimers of warranty and limitations of liability specific to any
-     jurisdiction.
-
-4. Inability to Comply Due to Statute or Regulation
-
-   If it is impossible for You to comply with any of the terms of this License
-   with respect to some or all of the Covered Software due to statute, judicial
-   order, or regulation then You must: (a) comply with the terms of this License
-   to the maximum extent possible; and (b) describe the limitations and the code
-   they affect. Such description must be placed in a text file included with all
-   distributions of the Covered Software under this License. Except to the
-   extent prohibited by statute or regulation, such description must be
-   sufficiently detailed for a recipient of ordinary skill to be able to
-   understand it.
-
-5. Termination
-
-5.1. The rights granted under this License will terminate automatically if You
-     fail to comply with any of its terms. However, if You become compliant,
-     then the rights granted under this License from a particular Contributor
-     are reinstated (a) provisionally, unless and until such Contributor
-     explicitly and finally terminates Your grants, and (b) on an ongoing basis,
-     if such Contributor fails to notify You of the non-compliance by some
-     reasonable means prior to 60 days after You have come back into compliance.
-     Moreover, Your grants from a particular Contributor are reinstated on an
-     ongoing basis if such Contributor notifies You of the non-compliance by
-     some reasonable means, this is the first time You have received notice of
-     non-compliance with this License from such Contributor, and You become
-     compliant prior to 30 days after Your receipt of the notice.
-
-5.2. If You initiate litigation against any entity by asserting a patent
-     infringement claim (excluding declaratory judgment actions, counter-claims,
-     and cross-claims) alleging that a Contributor Version directly or
-     indirectly infringes any patent, then the rights granted to You by any and
-     all Contributors for the Covered Software under Section 2.1 of this License
-     shall terminate.
-
-5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
-     license agreements (excluding distributors and resellers) which have been
-     validly granted by You or Your distributors under this License prior to
-     termination shall survive termination.
-
-6. Disclaimer of Warranty
-
-   Covered Software is provided under this License on an “as is” basis, without
-   warranty of any kind, either expressed, implied, or statutory, including,
-   without limitation, warranties that the Covered Software is free of defects,
-   merchantable, fit for a particular purpose or non-infringing. The entire
-   risk as to the quality and performance of the Covered Software is with You.
-   Should any Covered Software prove defective in any respect, You (not any
-   Contributor) assume the cost of any necessary servicing, repair, or
-   correction. This disclaimer of warranty constitutes an essential part of this
-   License. No use of  any Covered Software is authorized under this License
-   except under this disclaimer.
-
-7. Limitation of Liability
-
-   Under no circumstances and under no legal theory, whether tort (including
-   negligence), contract, or otherwise, shall any Contributor, or anyone who
-   distributes Covered Software as permitted above, be liable to You for any
-   direct, indirect, special, incidental, or consequential damages of any
-   character including, without limitation, damages for lost profits, loss of
-   goodwill, work stoppage, computer failure or malfunction, or any and all
-   other commercial damages or losses, even if such party shall have been
-   informed of the possibility of such damages. This limitation of liability
-   shall not apply to liability for death or personal injury resulting from such
-   party’s negligence to the extent applicable law prohibits such limitation.
-   Some jurisdictions do not allow the exclusion or limitation of incidental or
-   consequential damages, so this exclusion and limitation may not apply to You.
-
-8. Litigation
-
-   Any litigation relating to this License may be brought only in the courts of
-   a jurisdiction where the defendant maintains its principal place of business
-   and such litigation shall be governed by laws of that jurisdiction, without
-   reference to its conflict-of-law provisions. Nothing in this Section shall
-   prevent a party’s ability to bring cross-claims or counter-claims.
-
-9. Miscellaneous
-
-   This License represents the complete agreement concerning the subject matter
-   hereof. If any provision of this License is held to be unenforceable, such
-   provision shall be reformed only to the extent necessary to make it
-   enforceable. Any law or regulation which provides that the language of a
-   contract shall be construed against the drafter shall not be used to construe
-   this License against a Contributor.
-
-
-10. Versions of the License
-
-10.1. New Versions
-
-      Mozilla Foundation is the license steward. Except as provided in Section
-      10.3, no one other than the license steward has the right to modify or
-      publish new versions of this License. Each version will be given a
-      distinguishing version number.
-
-10.2. Effect of New Versions
-
-      You may distribute the Covered Software under the terms of the version of
-      the License under which You originally received the Covered Software, or
-      under the terms of any subsequent version published by the license
-      steward.
-
-10.3. Modified Versions
-
-      If you create software not governed by this License, and you want to
-      create a new license for such software, you may create and use a modified
-      version of this License if you rename the license and remove any
-      references to the name of the license steward (except to note that such
-      modified license differs from this License).
-
-10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
-      If You choose to distribute Source Code Form that is Incompatible With
-      Secondary Licenses under the terms of this version of the License, the
-      notice described in Exhibit B of this License must be attached.
-
-Exhibit A - Source Code Form License Notice
-
-      This Source Code Form is subject to the
-      terms of the Mozilla Public License, v.
-      2.0. If a copy of the MPL was not
-      distributed with this file, You can
-      obtain one at
-      http://mozilla.org/MPL/2.0/.
-
-If it is not possible or desirable to put the notice in a particular file, then
-You may include the notice in a location (such as a LICENSE file in a relevant
-directory) where a recipient would be likely to look for such a notice.
-
-You may add additional accurate notices of copyright ownership.
-
-Exhibit B - “Incompatible With Secondary Licenses” Notice
-
-      This Source Code Form is “Incompatible
-      With Secondary Licenses”, as defined by
-      the Mozilla Public License, v. 2.0.
-

+ 0 - 89
vendor/github.com/hashicorp/errwrap/README.md

@@ -1,89 +0,0 @@
-# errwrap
-
-`errwrap` is a package for Go that formalizes the pattern of wrapping errors
-and checking if an error contains another error.
-
-There is a common pattern in Go of taking a returned `error` value and
-then wrapping it (such as with `fmt.Errorf`) before returning it. The problem
-with this pattern is that you completely lose the original `error` structure.
-
-Arguably the _correct_ approach is that you should make a custom structure
-implementing the `error` interface, and have the original error as a field
-on that structure, such [as this example](http://golang.org/pkg/os/#PathError).
-This is a good approach, but you have to know the entire chain of possible
-rewrapping that happens, when you might just care about one.
-
-`errwrap` formalizes this pattern (it doesn't matter what approach you use
-above) by giving a single interface for wrapping errors, checking if a specific
-error is wrapped, and extracting that error.
-
-## Installation and Docs
-
-Install using `go get github.com/hashicorp/errwrap`.
-
-Full documentation is available at
-http://godoc.org/github.com/hashicorp/errwrap
-
-## Usage
-
-#### Basic Usage
-
-Below is a very basic example of its usage:
-
-```go
-// A function that always returns an error, but wraps it, like a real
-// function might.
-func tryOpen() error {
-	_, err := os.Open("/i/dont/exist")
-	if err != nil {
-		return errwrap.Wrapf("Doesn't exist: {{err}}", err)
-	}
-
-	return nil
-}
-
-func main() {
-	err := tryOpen()
-
-	// We can use the Contains helpers to check if an error contains
-	// another error. It is safe to do this with a nil error, or with
-	// an error that doesn't even use the errwrap package.
-	if errwrap.Contains(err, "does not exist") {
-		// Do something
-	}
-	if errwrap.ContainsType(err, new(os.PathError)) {
-		// Do something
-	}
-
-	// Or we can use the associated `Get` functions to just extract
-	// a specific error. This would return nil if that specific error doesn't
-	// exist.
-	perr := errwrap.GetType(err, new(os.PathError))
-}
-```
-
-#### Custom Types
-
-If you're already making custom types that properly wrap errors, then
-you can get all the functionality of `errwraps.Contains` and such by
-implementing the `Wrapper` interface with just one function. Example:
-
-```go
-type AppError {
-  Code ErrorCode
-  Err  error
-}
-
-func (e *AppError) WrappedErrors() []error {
-  return []error{e.Err}
-}
-```
-
-Now this works:
-
-```go
-err := &AppError{Err: fmt.Errorf("an error")}
-if errwrap.ContainsType(err, fmt.Errorf("")) {
-	// This will work!
-}
-```

+ 0 - 169
vendor/github.com/hashicorp/errwrap/errwrap.go

@@ -1,169 +0,0 @@
-// Package errwrap implements methods to formalize error wrapping in Go.
-//
-// All of the top-level functions that take an `error` are built to be able
-// to take any error, not just wrapped errors. This allows you to use errwrap
-// without having to type-check and type-cast everywhere.
-package errwrap
-
-import (
-	"errors"
-	"reflect"
-	"strings"
-)
-
-// WalkFunc is the callback called for Walk.
-type WalkFunc func(error)
-
-// Wrapper is an interface that can be implemented by custom types to
-// have all the Contains, Get, etc. functions in errwrap work.
-//
-// When Walk reaches a Wrapper, it will call the callback for every
-// wrapped error in addition to the wrapper itself. Since all the top-level
-// functions in errwrap use Walk, this means that all those functions work
-// with your custom type.
-type Wrapper interface {
-	WrappedErrors() []error
-}
-
-// Wrap defines that outer wraps inner, returning an error type that
-// can be cleanly used with the other methods in this package, such as
-// Contains, GetAll, etc.
-//
-// This function won't modify the error message at all (the outer message
-// will be used).
-func Wrap(outer, inner error) error {
-	return &wrappedError{
-		Outer: outer,
-		Inner: inner,
-	}
-}
-
-// Wrapf wraps an error with a formatting message. This is similar to using
-// `fmt.Errorf` to wrap an error. If you're using `fmt.Errorf` to wrap
-// errors, you should replace it with this.
-//
-// format is the format of the error message. The string '{{err}}' will
-// be replaced with the original error message.
-func Wrapf(format string, err error) error {
-	outerMsg := "<nil>"
-	if err != nil {
-		outerMsg = err.Error()
-	}
-
-	outer := errors.New(strings.Replace(
-		format, "{{err}}", outerMsg, -1))
-
-	return Wrap(outer, err)
-}
-
-// Contains checks if the given error contains an error with the
-// message msg. If err is not a wrapped error, this will always return
-// false unless the error itself happens to match this msg.
-func Contains(err error, msg string) bool {
-	return len(GetAll(err, msg)) > 0
-}
-
-// ContainsType checks if the given error contains an error with
-// the same concrete type as v. If err is not a wrapped error, this will
-// check the err itself.
-func ContainsType(err error, v interface{}) bool {
-	return len(GetAllType(err, v)) > 0
-}
-
-// Get is the same as GetAll but returns the deepest matching error.
-func Get(err error, msg string) error {
-	es := GetAll(err, msg)
-	if len(es) > 0 {
-		return es[len(es)-1]
-	}
-
-	return nil
-}
-
-// GetType is the same as GetAllType but returns the deepest matching error.
-func GetType(err error, v interface{}) error {
-	es := GetAllType(err, v)
-	if len(es) > 0 {
-		return es[len(es)-1]
-	}
-
-	return nil
-}
-
-// GetAll gets all the errors that might be wrapped in err with the
-// given message. The order of the errors is such that the outermost
-// matching error (the most recent wrap) is index zero, and so on.
-func GetAll(err error, msg string) []error {
-	var result []error
-
-	Walk(err, func(err error) {
-		if err.Error() == msg {
-			result = append(result, err)
-		}
-	})
-
-	return result
-}
-
-// GetAllType gets all the errors that are the same type as v.
-//
-// The order of the return value is the same as described in GetAll.
-func GetAllType(err error, v interface{}) []error {
-	var result []error
-
-	var search string
-	if v != nil {
-		search = reflect.TypeOf(v).String()
-	}
-	Walk(err, func(err error) {
-		var needle string
-		if err != nil {
-			needle = reflect.TypeOf(err).String()
-		}
-
-		if needle == search {
-			result = append(result, err)
-		}
-	})
-
-	return result
-}
-
-// Walk walks all the wrapped errors in err and calls the callback. If
-// err isn't a wrapped error, this will be called once for err. If err
-// is a wrapped error, the callback will be called for both the wrapper
-// that implements error as well as the wrapped error itself.
-func Walk(err error, cb WalkFunc) {
-	if err == nil {
-		return
-	}
-
-	switch e := err.(type) {
-	case *wrappedError:
-		cb(e.Outer)
-		Walk(e.Inner, cb)
-	case Wrapper:
-		cb(err)
-
-		for _, err := range e.WrappedErrors() {
-			Walk(err, cb)
-		}
-	default:
-		cb(err)
-	}
-}
-
-// wrappedError is an implementation of error that has both the
-// outer and inner errors.
-type wrappedError struct {
-	Outer error
-	Inner error
-}
-
-func (w *wrappedError) Error() string {
-	return w.Outer.Error()
-}
-
-func (w *wrappedError) WrappedErrors() []error {
-	return []error{w.Outer, w.Inner}
-}

+ 0 - 353
vendor/github.com/hashicorp/go-multierror/LICENSE

@@ -1,353 +0,0 @@
-Mozilla Public License, version 2.0
-
-1. Definitions
-
-1.1. “Contributor”
-
-     means each individual or legal entity that creates, contributes to the
-     creation of, or owns Covered Software.
-
-1.2. “Contributor Version”
-
-     means the combination of the Contributions of others (if any) used by a
-     Contributor and that particular Contributor’s Contribution.
-
-1.3. “Contribution”
-
-     means Covered Software of a particular Contributor.
-
-1.4. “Covered Software”
-
-     means Source Code Form to which the initial Contributor has attached the
-     notice in Exhibit A, the Executable Form of such Source Code Form, and
-     Modifications of such Source Code Form, in each case including portions
-     thereof.
-
-1.5. “Incompatible With Secondary Licenses”
-     means
-
-     a. that the initial Contributor has attached the notice described in
-        Exhibit B to the Covered Software; or
-
-     b. that the Covered Software was made available under the terms of version
-        1.1 or earlier of the License, but not also under the terms of a
-        Secondary License.
-
-1.6. “Executable Form”
-
-     means any form of the work other than Source Code Form.
-
-1.7. “Larger Work”
-
-     means a work that combines Covered Software with other material, in a separate
-     file or files, that is not Covered Software.
-
-1.8. “License”
-
-     means this document.
-
-1.9. “Licensable”
-
-     means having the right to grant, to the maximum extent possible, whether at the
-     time of the initial grant or subsequently, any and all of the rights conveyed by
-     this License.
-
-1.10. “Modifications”
-
-     means any of the following:
-
-     a. any file in Source Code Form that results from an addition to, deletion
-        from, or modification of the contents of Covered Software; or
-
-     b. any new file in Source Code Form that contains any Covered Software.
-
-1.11. “Patent Claims” of a Contributor
-
-      means any patent claim(s), including without limitation, method, process,
-      and apparatus claims, in any patent Licensable by such Contributor that
-      would be infringed, but for the grant of the License, by the making,
-      using, selling, offering for sale, having made, import, or transfer of
-      either its Contributions or its Contributor Version.
-
-1.12. “Secondary License”
-
-      means either the GNU General Public License, Version 2.0, the GNU Lesser
-      General Public License, Version 2.1, the GNU Affero General Public
-      License, Version 3.0, or any later versions of those licenses.
-
-1.13. “Source Code Form”
-
-      means the form of the work preferred for making modifications.
-
-1.14. “You” (or “Your”)
-
-      means an individual or a legal entity exercising rights under this
-      License. For legal entities, “You” includes any entity that controls, is
-      controlled by, or is under common control with You. For purposes of this
-      definition, “control” means (a) the power, direct or indirect, to cause
-      the direction or management of such entity, whether by contract or
-      otherwise, or (b) ownership of more than fifty percent (50%) of the
-      outstanding shares or beneficial ownership of such entity.
-
-
-2. License Grants and Conditions
-
-2.1. Grants
-
-     Each Contributor hereby grants You a world-wide, royalty-free,
-     non-exclusive license:
-
-     a. under intellectual property rights (other than patent or trademark)
-        Licensable by such Contributor to use, reproduce, make available,
-        modify, display, perform, distribute, and otherwise exploit its
-        Contributions, either on an unmodified basis, with Modifications, or as
-        part of a Larger Work; and
-
-     b. under Patent Claims of such Contributor to make, use, sell, offer for
-        sale, have made, import, and otherwise transfer either its Contributions
-        or its Contributor Version.
-
-2.2. Effective Date
-
-     The licenses granted in Section 2.1 with respect to any Contribution become
-     effective for each Contribution on the date the Contributor first distributes
-     such Contribution.
-
-2.3. Limitations on Grant Scope
-
-     The licenses granted in this Section 2 are the only rights granted under this
-     License. No additional rights or licenses will be implied from the distribution
-     or licensing of Covered Software under this License. Notwithstanding Section
-     2.1(b) above, no patent license is granted by a Contributor:
-
-     a. for any code that a Contributor has removed from Covered Software; or
-
-     b. for infringements caused by: (i) Your and any other third party’s
-        modifications of Covered Software, or (ii) the combination of its
-        Contributions with other software (except as part of its Contributor
-        Version); or
-
-     c. under Patent Claims infringed by Covered Software in the absence of its
-        Contributions.
-
-     This License does not grant any rights in the trademarks, service marks, or
-     logos of any Contributor (except as may be necessary to comply with the
-     notice requirements in Section 3.4).
-
-2.4. Subsequent Licenses
-
-     No Contributor makes additional grants as a result of Your choice to
-     distribute the Covered Software under a subsequent version of this License
-     (see Section 10.2) or under the terms of a Secondary License (if permitted
-     under the terms of Section 3.3).
-
-2.5. Representation
-
-     Each Contributor represents that the Contributor believes its Contributions
-     are its original creation(s) or it has sufficient rights to grant the
-     rights to its Contributions conveyed by this License.
-
-2.6. Fair Use
-
-     This License is not intended to limit any rights You have under applicable
-     copyright doctrines of fair use, fair dealing, or other equivalents.
-
-2.7. Conditions
-
-     Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
-     Section 2.1.
-
-
-3. Responsibilities
-
-3.1. Distribution of Source Form
-
-     All distribution of Covered Software in Source Code Form, including any
-     Modifications that You create or to which You contribute, must be under the
-     terms of this License. You must inform recipients that the Source Code Form
-     of the Covered Software is governed by the terms of this License, and how
-     they can obtain a copy of this License. You may not attempt to alter or
-     restrict the recipients’ rights in the Source Code Form.
-
-3.2. Distribution of Executable Form
-
-     If You distribute Covered Software in Executable Form then:
-
-     a. such Covered Software must also be made available in Source Code Form,
-        as described in Section 3.1, and You must inform recipients of the
-        Executable Form how they can obtain a copy of such Source Code Form by
-        reasonable means in a timely manner, at a charge no more than the cost
-        of distribution to the recipient; and
-
-     b. You may distribute such Executable Form under the terms of this License,
-        or sublicense it under different terms, provided that the license for
-        the Executable Form does not attempt to limit or alter the recipients’
-        rights in the Source Code Form under this License.
-
-3.3. Distribution of a Larger Work
-
-     You may create and distribute a Larger Work under terms of Your choice,
-     provided that You also comply with the requirements of this License for the
-     Covered Software. If the Larger Work is a combination of Covered Software
-     with a work governed by one or more Secondary Licenses, and the Covered
-     Software is not Incompatible With Secondary Licenses, this License permits
-     You to additionally distribute such Covered Software under the terms of
-     such Secondary License(s), so that the recipient of the Larger Work may, at
-     their option, further distribute the Covered Software under the terms of
-     either this License or such Secondary License(s).
-
-3.4. Notices
-
-     You may not remove or alter the substance of any license notices (including
-     copyright notices, patent notices, disclaimers of warranty, or limitations
-     of liability) contained within the Source Code Form of the Covered
-     Software, except that You may alter any license notices to the extent
-     required to remedy known factual inaccuracies.
-
-3.5. Application of Additional Terms
-
-     You may choose to offer, and to charge a fee for, warranty, support,
-     indemnity or liability obligations to one or more recipients of Covered
-     Software. However, You may do so only on Your own behalf, and not on behalf
-     of any Contributor. You must make it absolutely clear that any such
-     warranty, support, indemnity, or liability obligation is offered by You
-     alone, and You hereby agree to indemnify every Contributor for any
-     liability incurred by such Contributor as a result of warranty, support,
-     indemnity or liability terms You offer. You may include additional
-     disclaimers of warranty and limitations of liability specific to any
-     jurisdiction.
-
-4. Inability to Comply Due to Statute or Regulation
-
-   If it is impossible for You to comply with any of the terms of this License
-   with respect to some or all of the Covered Software due to statute, judicial
-   order, or regulation then You must: (a) comply with the terms of this License
-   to the maximum extent possible; and (b) describe the limitations and the code
-   they affect. Such description must be placed in a text file included with all
-   distributions of the Covered Software under this License. Except to the
-   extent prohibited by statute or regulation, such description must be
-   sufficiently detailed for a recipient of ordinary skill to be able to
-   understand it.
-
-5. Termination
-
-5.1. The rights granted under this License will terminate automatically if You
-     fail to comply with any of its terms. However, if You become compliant,
-     then the rights granted under this License from a particular Contributor
-     are reinstated (a) provisionally, unless and until such Contributor
-     explicitly and finally terminates Your grants, and (b) on an ongoing basis,
-     if such Contributor fails to notify You of the non-compliance by some
-     reasonable means prior to 60 days after You have come back into compliance.
-     Moreover, Your grants from a particular Contributor are reinstated on an
-     ongoing basis if such Contributor notifies You of the non-compliance by
-     some reasonable means, this is the first time You have received notice of
-     non-compliance with this License from such Contributor, and You become
-     compliant prior to 30 days after Your receipt of the notice.
-
-5.2. If You initiate litigation against any entity by asserting a patent
-     infringement claim (excluding declaratory judgment actions, counter-claims,
-     and cross-claims) alleging that a Contributor Version directly or
-     indirectly infringes any patent, then the rights granted to You by any and
-     all Contributors for the Covered Software under Section 2.1 of this License
-     shall terminate.
-
-5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
-     license agreements (excluding distributors and resellers) which have been
-     validly granted by You or Your distributors under this License prior to
-     termination shall survive termination.
-
-6. Disclaimer of Warranty
-
-   Covered Software is provided under this License on an “as is” basis, without
-   warranty of any kind, either expressed, implied, or statutory, including,
-   without limitation, warranties that the Covered Software is free of defects,
-   merchantable, fit for a particular purpose or non-infringing. The entire
-   risk as to the quality and performance of the Covered Software is with You.
-   Should any Covered Software prove defective in any respect, You (not any
-   Contributor) assume the cost of any necessary servicing, repair, or
-   correction. This disclaimer of warranty constitutes an essential part of this
-   License. No use of  any Covered Software is authorized under this License
-   except under this disclaimer.
-
-7. Limitation of Liability
-
-   Under no circumstances and under no legal theory, whether tort (including
-   negligence), contract, or otherwise, shall any Contributor, or anyone who
-   distributes Covered Software as permitted above, be liable to You for any
-   direct, indirect, special, incidental, or consequential damages of any
-   character including, without limitation, damages for lost profits, loss of
-   goodwill, work stoppage, computer failure or malfunction, or any and all
-   other commercial damages or losses, even if such party shall have been
-   informed of the possibility of such damages. This limitation of liability
-   shall not apply to liability for death or personal injury resulting from such
-   party’s negligence to the extent applicable law prohibits such limitation.
-   Some jurisdictions do not allow the exclusion or limitation of incidental or
-   consequential damages, so this exclusion and limitation may not apply to You.
-
-8. Litigation
-
-   Any litigation relating to this License may be brought only in the courts of
-   a jurisdiction where the defendant maintains its principal place of business
-   and such litigation shall be governed by laws of that jurisdiction, without
-   reference to its conflict-of-law provisions. Nothing in this Section shall
-   prevent a party’s ability to bring cross-claims or counter-claims.
-
-9. Miscellaneous
-
-   This License represents the complete agreement concerning the subject matter
-   hereof. If any provision of this License is held to be unenforceable, such
-   provision shall be reformed only to the extent necessary to make it
-   enforceable. Any law or regulation which provides that the language of a
-   contract shall be construed against the drafter shall not be used to construe
-   this License against a Contributor.
-
-
-10. Versions of the License
-
-10.1. New Versions
-
-      Mozilla Foundation is the license steward. Except as provided in Section
-      10.3, no one other than the license steward has the right to modify or
-      publish new versions of this License. Each version will be given a
-      distinguishing version number.
-
-10.2. Effect of New Versions
-
-      You may distribute the Covered Software under the terms of the version of
-      the License under which You originally received the Covered Software, or
-      under the terms of any subsequent version published by the license
-      steward.
-
-10.3. Modified Versions
-
-      If you create software not governed by this License, and you want to
-      create a new license for such software, you may create and use a modified
-      version of this License if you rename the license and remove any
-      references to the name of the license steward (except to note that such
-      modified license differs from this License).
-
-10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
-      If You choose to distribute Source Code Form that is Incompatible With
-      Secondary Licenses under the terms of this version of the License, the
-      notice described in Exhibit B of this License must be attached.
-
-Exhibit A - Source Code Form License Notice
-
-      This Source Code Form is subject to the
-      terms of the Mozilla Public License, v.
-      2.0. If a copy of the MPL was not
-      distributed with this file, You can
-      obtain one at
-      http://mozilla.org/MPL/2.0/.
-
-If it is not possible or desirable to put the notice in a particular file, then
-You may include the notice in a location (such as a LICENSE file in a relevant
-directory) where a recipient would be likely to look for such a notice.
-
-You may add additional accurate notices of copyright ownership.
-
-Exhibit B - “Incompatible With Secondary Licenses” Notice
-
-      This Source Code Form is “Incompatible
-      With Secondary Licenses”, as defined by
-      the Mozilla Public License, v. 2.0.

+ 0 - 31
vendor/github.com/hashicorp/go-multierror/Makefile

@@ -1,31 +0,0 @@
-TEST?=./...
-
-default: test
-
-# test runs the test suite and vets the code.
-test: generate
-	@echo "==> Running tests..."
-	@go list $(TEST) \
-		| grep -v "/vendor/" \
-		| xargs -n1 go test -timeout=60s -parallel=10 ${TESTARGS}
-
-# testrace runs the race checker
-testrace: generate
-	@echo "==> Running tests (race)..."
-	@go list $(TEST) \
-		| grep -v "/vendor/" \
-		| xargs -n1 go test -timeout=60s -race ${TESTARGS}
-
-# updatedeps installs all the dependencies needed to run and build.
-updatedeps:
-	@sh -c "'${CURDIR}/scripts/deps.sh' '${NAME}'"
-
-# generate runs `go generate` to build the dynamically generated source files.
-generate:
-	@echo "==> Generating..."
-	@find . -type f -name '.DS_Store' -delete
-	@go list ./... \
-		| grep -v "/vendor/" \
-		| xargs -n1 go generate
-
-.PHONY: default test testrace updatedeps generate

+ 0 - 150
vendor/github.com/hashicorp/go-multierror/README.md

@@ -1,150 +0,0 @@
-# go-multierror
-
-[![CircleCI](https://img.shields.io/circleci/build/github/hashicorp/go-multierror/master)](https://circleci.com/gh/hashicorp/go-multierror)
-[![Go Reference](https://pkg.go.dev/badge/github.com/hashicorp/go-multierror.svg)](https://pkg.go.dev/github.com/hashicorp/go-multierror)
-![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/hashicorp/go-multierror)
-
-[circleci]: https://app.circleci.com/pipelines/github/hashicorp/go-multierror
-[godocs]: https://pkg.go.dev/github.com/hashicorp/go-multierror
-
-`go-multierror` is a package for Go that provides a mechanism for
-representing a list of `error` values as a single `error`.
-
-This allows a function in Go to return an `error` that might actually
-be a list of errors. If the caller knows this, they can unwrap the
-list and access the errors. If the caller doesn't know, the error
-formats to a nice human-readable format.
-
-`go-multierror` is fully compatible with the Go standard library
-[errors](https://golang.org/pkg/errors/) package, including the
-functions `As`, `Is`, and `Unwrap`. This provides a standardized approach
-for introspecting on error values.
-
-## Installation and Docs
-
-Install using `go get github.com/hashicorp/go-multierror`.
-
-Full documentation is available at
-https://pkg.go.dev/github.com/hashicorp/go-multierror
-
-### Requires go version 1.13 or newer
-
-`go-multierror` requires go version 1.13 or newer. Go 1.13 introduced
-[error wrapping](https://golang.org/doc/go1.13#error_wrapping), which
-this library takes advantage of.
-
-If you need to use an earlier version of go, you can use the
-[v1.0.0](https://github.com/hashicorp/go-multierror/tree/v1.0.0)
-tag, which doesn't rely on features in go 1.13.
-
-If you see compile errors that look like the below, it's likely that
-you're on an older version of go:
-
-```
-/go/src/github.com/hashicorp/go-multierror/multierror.go:112:9: undefined: errors.As
-/go/src/github.com/hashicorp/go-multierror/multierror.go:117:9: undefined: errors.Is
-```
-
-## Usage
-
-go-multierror is easy to use and purposely built to be unobtrusive in
-existing Go applications/libraries that may not be aware of it.
-
-**Building a list of errors**
-
-The `Append` function is used to create a list of errors. This function
-behaves a lot like the Go built-in `append` function: it doesn't matter
-if the first argument is nil, a `multierror.Error`, or any other `error`,
-the function behaves as you would expect.
-
-```go
-var result error
-
-if err := step1(); err != nil {
-	result = multierror.Append(result, err)
-}
-if err := step2(); err != nil {
-	result = multierror.Append(result, err)
-}
-
-return result
-```
-
-**Customizing the formatting of the errors**
-
-By specifying a custom `ErrorFormat`, you can customize the format
-of the `Error() string` function:
-
-```go
-var result *multierror.Error
-
-// ... accumulate errors here, maybe using Append
-
-if result != nil {
-	result.ErrorFormat = func([]error) string {
-		return "errors!"
-	}
-}
-```
-
-**Accessing the list of errors**
-
-`multierror.Error` implements `error` so if the caller doesn't know about
-multierror, it will work just fine. But if you're aware a multierror might
-be returned, you can use type switches to access the list of errors:
-
-```go
-if err := something(); err != nil {
-	if merr, ok := err.(*multierror.Error); ok {
-		// Use merr.Errors
-	}
-}
-```
-
-You can also use the standard [`errors.Unwrap`](https://golang.org/pkg/errors/#Unwrap)
-function. This will continue to unwrap into subsequent errors until none exist.
-
-**Extracting an error**
-
-The standard library [`errors.As`](https://golang.org/pkg/errors/#As)
-function can be used directly with a multierror to extract a specific error:
-
-```go
-// Assume err is a multierror value
-err := somefunc()
-
-// We want to know if "err" has a "RichErrorType" in it and extract it.
-var errRich RichErrorType
-if errors.As(err, &errRich) {
-	// It has it, and now errRich is populated.
-}
-```
-
-**Checking for an exact error value**
-
-Some errors are returned as exact errors such as the [`ErrNotExist`](https://golang.org/pkg/os/#pkg-variables)
-error in the `os` package. You can check if this error is present by using
-the standard [`errors.Is`](https://golang.org/pkg/errors/#Is) function.
-
-```go
-// Assume err is a multierror value
-err := somefunc()
-if errors.Is(err, os.ErrNotExist) {
-	// err contains os.ErrNotExist
-}
-```
-
-**Returning a multierror only if there are errors**
-
-If you build a `multierror.Error`, you can use the `ErrorOrNil` function
-to return an `error` implementation only if there are errors to return:
-
-```go
-var result *multierror.Error
-
-// ... accumulate errors here
-
-// Return the `error` only if errors were added to the multierror, otherwise
-// return nil since there are no errors.
-return result.ErrorOrNil()
-```

+ 0 - 43
vendor/github.com/hashicorp/go-multierror/append.go

@@ -1,43 +0,0 @@
-package multierror
-
-// Append is a helper function that will append more errors
-// onto an Error in order to create a larger multi-error.
-//
-// If err is not a multierror.Error, then it will be turned into
-// one. If any of the errs are multierr.Error, they will be flattened
-// one level into err.
-// Any nil errors within errs will be ignored. If err is nil, a new
-// *Error will be returned.
-func Append(err error, errs ...error) *Error {
-	switch err := err.(type) {
-	case *Error:
-		// Typed nils can reach here, so initialize if we are nil
-		if err == nil {
-			err = new(Error)
-		}
-
-		// Go through each error and flatten
-		for _, e := range errs {
-			switch e := e.(type) {
-			case *Error:
-				if e != nil {
-					err.Errors = append(err.Errors, e.Errors...)
-				}
-			default:
-				if e != nil {
-					err.Errors = append(err.Errors, e)
-				}
-			}
-		}
-
-		return err
-	default:
-		newErrs := make([]error, 0, len(errs)+1)
-		if err != nil {
-			newErrs = append(newErrs, err)
-		}
-		newErrs = append(newErrs, errs...)
-
-		return Append(&Error{}, newErrs...)
-	}
-}

+ 0 - 26
vendor/github.com/hashicorp/go-multierror/flatten.go

@@ -1,26 +0,0 @@
-package multierror
-
-// Flatten flattens the given error, merging any *Errors together into
-// a single *Error.
-func Flatten(err error) error {
-	// If it isn't an *Error, just return the error as-is
-	if _, ok := err.(*Error); !ok {
-		return err
-	}
-
-	// Otherwise, make the result and flatten away!
-	flatErr := new(Error)
-	flatten(err, flatErr)
-	return flatErr
-}
-
-func flatten(err error, flatErr *Error) {
-	switch err := err.(type) {
-	case *Error:
-		for _, e := range err.Errors {
-			flatten(e, flatErr)
-		}
-	default:
-		flatErr.Errors = append(flatErr.Errors, err)
-	}
-}

+ 0 - 27
vendor/github.com/hashicorp/go-multierror/format.go

@@ -1,27 +0,0 @@
-package multierror
-
-import (
-	"fmt"
-	"strings"
-)
-
-// ErrorFormatFunc is a function callback that is called by Error to
-// turn the list of errors into a string.
-type ErrorFormatFunc func([]error) string
-
-// ListFormatFunc is a basic formatter that outputs the number of errors
-// that occurred along with a bullet point list of the errors.
-func ListFormatFunc(es []error) string {
-	if len(es) == 1 {
-		return fmt.Sprintf("1 error occurred:\n\t* %s\n\n", es[0])
-	}
-
-	points := make([]string, len(es))
-	for i, err := range es {
-		points[i] = fmt.Sprintf("* %s", err)
-	}
-
-	return fmt.Sprintf(
-		"%d errors occurred:\n\t%s\n\n",
-		len(es), strings.Join(points, "\n\t"))
-}

+ 0 - 38
vendor/github.com/hashicorp/go-multierror/group.go

@@ -1,38 +0,0 @@
-package multierror
-
-import "sync"
-
-// Group is a collection of goroutines which return errors that need to be
-// coalesced.
-type Group struct {
-	mutex sync.Mutex
-	err   *Error
-	wg    sync.WaitGroup
-}
-
-// Go calls the given function in a new goroutine.
-//
-// If the function returns an error it is added to the group multierror which
-// is returned by Wait.
-func (g *Group) Go(f func() error) {
-	g.wg.Add(1)
-
-	go func() {
-		defer g.wg.Done()
-
-		if err := f(); err != nil {
-			g.mutex.Lock()
-			g.err = Append(g.err, err)
-			g.mutex.Unlock()
-		}
-	}()
-}
-
-// Wait blocks until all function calls from the Go method have returned, then
-// returns the multierror.
-func (g *Group) Wait() *Error {
-	g.wg.Wait()
-	g.mutex.Lock()
-	defer g.mutex.Unlock()
-	return g.err
-}

+ 0 - 121
vendor/github.com/hashicorp/go-multierror/multierror.go

@@ -1,121 +0,0 @@
-package multierror
-
-import (
-	"errors"
-	"fmt"
-)
-
-// Error is an error type to track multiple errors. This is used to
-// accumulate errors in cases and return them as a single "error".
-type Error struct {
-	Errors      []error
-	ErrorFormat ErrorFormatFunc
-}
-
-func (e *Error) Error() string {
-	fn := e.ErrorFormat
-	if fn == nil {
-		fn = ListFormatFunc
-	}
-
-	return fn(e.Errors)
-}
-
-// ErrorOrNil returns an error interface if this Error represents
-// a list of errors, or returns nil if the list of errors is empty. This
-// function is useful at the end of accumulation to make sure that the value
-// returned represents the existence of errors.
-func (e *Error) ErrorOrNil() error {
-	if e == nil {
-		return nil
-	}
-	if len(e.Errors) == 0 {
-		return nil
-	}
-
-	return e
-}
-
-func (e *Error) GoString() string {
-	return fmt.Sprintf("*%#v", *e)
-}
-
-// WrappedErrors returns the list of errors that this Error is wrapping. It is
-// an implementation of the errwrap.Wrapper interface so that multierror.Error
-// can be used with that library.
-//
-// This method is not safe to be called concurrently. Unlike accessing the
-// Errors field directly, this function also checks if the multierror is nil to
-// prevent a null-pointer panic. It satisfies the errwrap.Wrapper interface.
-func (e *Error) WrappedErrors() []error {
-	if e == nil {
-		return nil
-	}
-	return e.Errors
-}
-
-// Unwrap returns an error from Error (or nil if there are no errors).
-// This error returned will further support Unwrap to get the next error,
-// etc. The order will match the order of Errors in the multierror.Error
-// at the time of calling.
-//
-// The resulting error supports errors.As/Is/Unwrap so you can continue
-// to use the stdlib errors package to introspect further.
-//
-// This will perform a shallow copy of the errors slice. Any errors appended
-// to this error after calling Unwrap will not be available until a new
-// Unwrap is called on the multierror.Error.
-func (e *Error) Unwrap() error {
-	// If we have no errors then we do nothing
-	if e == nil || len(e.Errors) == 0 {
-		return nil
-	}
-
-	// If we have exactly one error, we can just return that directly.
-	if len(e.Errors) == 1 {
-		return e.Errors[0]
-	}
-
-	// Shallow copy the slice
-	errs := make([]error, len(e.Errors))
-	copy(errs, e.Errors)
-	return chain(errs)
-}
-
-// chain implements the interfaces necessary for errors.Is/As/Unwrap to
-// work in a deterministic way with multierror. A chain tracks a list of
-// errors while accounting for the current represented error. This lets
-// Is/As be meaningful.
-//
-// Unwrap returns the next error. In the cleanest form, Unwrap would return
-// the wrapped error here but we can't do that if we want to properly
-// get access to all the errors. Instead, users are recommended to use
-// Is/As to get the correct error type out.
-//
-// Precondition: []error is non-empty (len > 0)
-type chain []error
-
-// Error implements the error interface
-func (e chain) Error() string {
-	return e[0].Error()
-}
-
-// Unwrap implements errors.Unwrap by returning the next error in the
-// chain or nil if there are no more errors.
-func (e chain) Unwrap() error {
-	if len(e) == 1 {
-		return nil
-	}
-
-	return e[1:]
-}
-
-// As implements errors.As by attempting to map to the current value.
-func (e chain) As(target interface{}) bool {
-	return errors.As(e[0], target)
-}
-
-// Is implements errors.Is by comparing the current value directly.
-func (e chain) Is(target error) bool {
-	return errors.Is(e[0], target)
-}

+ 0 - 37
vendor/github.com/hashicorp/go-multierror/prefix.go

@@ -1,37 +0,0 @@
-package multierror
-
-import (
-	"fmt"
-
-	"github.com/hashicorp/errwrap"
-)
-
-// Prefix is a helper function that will prefix some text
-// to the given error. If the error is a multierror.Error, then
-// it will be prefixed to each wrapped error.
-//
-// This is useful to use when appending multiple multierrors
-// together in order to give better scoping.
-func Prefix(err error, prefix string) error {
-	if err == nil {
-		return nil
-	}
-
-	format := fmt.Sprintf("%s {{err}}", prefix)
-	switch err := err.(type) {
-	case *Error:
-		// Typed nils can reach here, so initialize if we are nil
-		if err == nil {
-			err = new(Error)
-		}
-
-		// Wrap each of the errors
-		for i, e := range err.Errors {
-			err.Errors[i] = errwrap.Wrapf(format, e)
-		}
-
-		return err
-	default:
-		return errwrap.Wrapf(format, err)
-	}
-}

+ 0 - 16
vendor/github.com/hashicorp/go-multierror/sort.go

@@ -1,16 +0,0 @@
-package multierror
-
-// Len implements sort.Interface function for length
-func (err Error) Len() int {
-	return len(err.Errors)
-}
-
-// Swap implements sort.Interface function for swapping elements
-func (err Error) Swap(i, j int) {
-	err.Errors[i], err.Errors[j] = err.Errors[j], err.Errors[i]
-}
-
-// Less implements sort.Interface function for determining order
-func (err Error) Less(i, j int) bool {
-	return err.Errors[i].Error() < err.Errors[j].Error()
-}

+ 0 - 13
vendor/github.com/jlaffaye/ftp/LICENSE

@@ -1,13 +0,0 @@
-Copyright (c) 2011-2013, Julien Laffaye <jlaffaye@FreeBSD.org>
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

+ 0 - 63
vendor/github.com/jlaffaye/ftp/README.md

@@ -1,63 +0,0 @@
-# goftp #
-
-[![Units tests](https://github.com/jlaffaye/ftp/actions/workflows/unit_tests.yaml/badge.svg)](https://github.com/jlaffaye/ftp/actions/workflows/unit_tests.yaml)
-[![Coverage Status](https://coveralls.io/repos/jlaffaye/ftp/badge.svg?branch=master&service=github)](https://coveralls.io/github/jlaffaye/ftp?branch=master)
-[![golangci-lint](https://github.com/jlaffaye/ftp/actions/workflows/golangci-lint.yaml/badge.svg)](https://github.com/jlaffaye/ftp/actions/workflows/golangci-lint.yaml)
-[![CodeQL](https://github.com/jlaffaye/ftp/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/jlaffaye/ftp/actions/workflows/codeql-analysis.yml)
-[![Go ReportCard](https://goreportcard.com/badge/jlaffaye/ftp)](http://goreportcard.com/report/jlaffaye/ftp)
-[![Go Reference](https://pkg.go.dev/badge/github.com/jlaffaye/ftp.svg)](https://pkg.go.dev/github.com/jlaffaye/ftp)
-
-A FTP client package for Go
-
-## Install ##
-
-```
-go get -u github.com/jlaffaye/ftp
-```
-
-## Documentation ##
-
-https://pkg.go.dev/github.com/jlaffaye/ftp
-
-## Example ##
-
-```go
-c, err := ftp.Dial("ftp.example.org:21", ftp.DialWithTimeout(5*time.Second))
-if err != nil {
-    log.Fatal(err)
-}
-
-err = c.Login("anonymous", "anonymous")
-if err != nil {
-    log.Fatal(err)
-}
-
-// Do something with the FTP conn
-
-if err := c.Quit(); err != nil {
-    log.Fatal(err)
-}
-```
-
-## Store a file example ##
-
-```go
-data := bytes.NewBufferString("Hello World")
-err = c.Stor("test-file.txt", data)
-if err != nil {
-	panic(err)
-}
-```
-
-## Read a file example ##
-
-```go
-r, err := c.Retr("test-file.txt")
-if err != nil {
-	panic(err)
-}
-defer r.Close()
-
-buf, err := ioutil.ReadAll(r)
-println(string(buf))
-```

+ 0 - 37
vendor/github.com/jlaffaye/ftp/debug.go

@@ -1,37 +0,0 @@
-package ftp
-
-import "io"
-
-type debugWrapper struct {
-	conn io.ReadWriteCloser
-	io.Reader
-	io.Writer
-}
-
-func newDebugWrapper(conn io.ReadWriteCloser, w io.Writer) io.ReadWriteCloser {
-	return &debugWrapper{
-		Reader: io.TeeReader(conn, w),
-		Writer: io.MultiWriter(w, conn),
-		conn:   conn,
-	}
-}
-
-func (w *debugWrapper) Close() error {
-	return w.conn.Close()
-}
-
-type streamDebugWrapper struct {
-	io.Reader
-	closer io.ReadCloser
-}
-
-func newStreamDebugWrapper(rd io.ReadCloser, w io.Writer) io.ReadCloser {
-	return &streamDebugWrapper{
-		Reader: io.TeeReader(rd, w),
-		closer: rd,
-	}
-}
-
-func (w *streamDebugWrapper) Close() error {
-	return w.closer.Close()
-}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 1143
vendor/github.com/jlaffaye/ftp/ftp.go


+ 0 - 275
vendor/github.com/jlaffaye/ftp/parse.go

@@ -1,275 +0,0 @@
-package ftp
-
-import (
-	"errors"
-	"fmt"
-	"strconv"
-	"strings"
-	"time"
-)
-
-var errUnsupportedListLine = errors.New("unsupported LIST line")
-var errUnsupportedListDate = errors.New("unsupported LIST date")
-var errUnknownListEntryType = errors.New("unknown entry type")
-
-type parseFunc func(string, time.Time, *time.Location) (*Entry, error)
-
-var listLineParsers = []parseFunc{
-	parseRFC3659ListLine,
-	parseLsListLine,
-	parseDirListLine,
-	parseHostedFTPLine,
-}
-
-var dirTimeFormats = []string{
-	"01-02-06  03:04PM",
-	"2006-01-02  15:04",
-}
-
-// parseRFC3659ListLine parses the style of directory line defined in RFC 3659.
-func parseRFC3659ListLine(line string, _ time.Time, loc *time.Location) (*Entry, error) {
-	return parseNextRFC3659ListLine(line, loc, &Entry{})
-}
-
-func parseNextRFC3659ListLine(line string, loc *time.Location, e *Entry) (*Entry, error) {
-	iSemicolon := strings.Index(line, ";")
-	iWhitespace := strings.Index(line, " ")
-
-	if iSemicolon < 0 || iSemicolon > iWhitespace {
-		return nil, errUnsupportedListLine
-	}
-
-	name := line[iWhitespace+1:]
-	if e.Name == "" {
-		e.Name = name
-	} else if e.Name != name {
-		// All lines must have the same name
-		return nil, errUnsupportedListLine
-	}
-
-	for _, field := range strings.Split(line[:iWhitespace-1], ";") {
-		i := strings.Index(field, "=")
-		if i < 1 {
-			return nil, errUnsupportedListLine
-		}
-
-		key := strings.ToLower(field[:i])
-		value := field[i+1:]
-
-		switch key {
-		case "modify":
-			var err error
-			e.Time, err = time.ParseInLocation("20060102150405", value, loc)
-			if err != nil {
-				return nil, err
-			}
-		case "type":
-			switch value {
-			case "dir", "cdir", "pdir":
-				e.Type = EntryTypeFolder
-			case "file":
-				e.Type = EntryTypeFile
-			}
-		case "size":
-			if err := e.setSize(value); err != nil {
-				return nil, err
-			}
-		}
-	}
-	return e, nil
-}
-
-// parseLsListLine parses a directory line in a format based on the output of
-// the UNIX ls command.
-func parseLsListLine(line string, now time.Time, loc *time.Location) (*Entry, error) {
-
-	// Has the first field a length of exactly 10 bytes
-	// - or 10 bytes with an additional '+' character for indicating ACLs?
-	// If not, return.
-	if i := strings.IndexByte(line, ' '); !(i == 10 || (i == 11 && line[10] == '+')) {
-		return nil, errUnsupportedListLine
-	}
-
-	scanner := newScanner(line)
-	fields := scanner.NextFields(6)
-
-	if len(fields) < 6 {
-		return nil, errUnsupportedListLine
-	}
-
-	if fields[1] == "folder" && fields[2] == "0" {
-		e := &Entry{
-			Type: EntryTypeFolder,
-			Name: scanner.Remaining(),
-		}
-		if err := e.setTime(fields[3:6], now, loc); err != nil {
-			return nil, err
-		}
-
-		return e, nil
-	}
-
-	if fields[1] == "0" {
-		fields = append(fields, scanner.Next())
-		e := &Entry{
-			Type: EntryTypeFile,
-			Name: scanner.Remaining(),
-		}
-
-		if err := e.setSize(fields[2]); err != nil {
-			return nil, errUnsupportedListLine
-		}
-		if err := e.setTime(fields[4:7], now, loc); err != nil {
-			return nil, err
-		}
-
-		return e, nil
-	}
-
-	// Read two more fields
-	fields = append(fields, scanner.NextFields(2)...)
-	if len(fields) < 8 {
-		return nil, errUnsupportedListLine
-	}
-
-	e := &Entry{
-		Name: scanner.Remaining(),
-	}
-	switch fields[0][0] {
-	case '-':
-		e.Type = EntryTypeFile
-		if err := e.setSize(fields[4]); err != nil {
-			return nil, err
-		}
-	case 'd':
-		e.Type = EntryTypeFolder
-	case 'l':
-		e.Type = EntryTypeLink
-
-		// Split link name and target
-		if i := strings.Index(e.Name, " -> "); i > 0 {
-			e.Target = e.Name[i+4:]
-			e.Name = e.Name[:i]
-		}
-	default:
-		return nil, errUnknownListEntryType
-	}
-
-	if err := e.setTime(fields[5:8], now, loc); err != nil {
-		return nil, err
-	}
-
-	return e, nil
-}
-
-// parseDirListLine parses a directory line in a format based on the output of
-// the MS-DOS DIR command.
-func parseDirListLine(line string, now time.Time, loc *time.Location) (*Entry, error) {
-	e := &Entry{}
-	var err error
-
-	// Try various time formats that DIR might use, and stop when one works.
-	for _, format := range dirTimeFormats {
-		if len(line) > len(format) {
-			e.Time, err = time.ParseInLocation(format, line[:len(format)], loc)
-			if err == nil {
-				line = line[len(format):]
-				break
-			}
-		}
-	}
-	if err != nil {
-		// None of the time formats worked.
-		return nil, errUnsupportedListLine
-	}
-
-	line = strings.TrimLeft(line, " ")
-	if strings.HasPrefix(line, "<DIR>") {
-		e.Type = EntryTypeFolder
-		line = strings.TrimPrefix(line, "<DIR>")
-	} else {
-		space := strings.Index(line, " ")
-		if space == -1 {
-			return nil, errUnsupportedListLine
-		}
-		e.Size, err = strconv.ParseUint(line[:space], 10, 64)
-		if err != nil {
-			return nil, errUnsupportedListLine
-		}
-		e.Type = EntryTypeFile
-		line = line[space:]
-	}
-
-	e.Name = strings.TrimLeft(line, " ")
-	return e, nil
-}
-
-// parseHostedFTPLine parses a directory line in the non-standard format used
-// by hostedftp.com
-// -r--------   0 user group     65222236 Feb 24 00:39 UABlacklistingWeek8.csv
-// (The link count is inexplicably 0)
-func parseHostedFTPLine(line string, now time.Time, loc *time.Location) (*Entry, error) {
-	// Has the first field a length of 10 bytes?
-	if strings.IndexByte(line, ' ') != 10 {
-		return nil, errUnsupportedListLine
-	}
-
-	scanner := newScanner(line)
-	fields := scanner.NextFields(2)
-
-	if len(fields) < 2 || fields[1] != "0" {
-		return nil, errUnsupportedListLine
-	}
-
-	// Set link count to 1 and attempt to parse as Unix.
-	return parseLsListLine(fields[0]+" 1 "+scanner.Remaining(), now, loc)
-}
-
-// parseListLine parses the various non-standard format returned by the LIST
-// FTP command.
-func parseListLine(line string, now time.Time, loc *time.Location) (*Entry, error) {
-	for _, f := range listLineParsers {
-		e, err := f(line, now, loc)
-		if err != errUnsupportedListLine {
-			return e, err
-		}
-	}
-	return nil, errUnsupportedListLine
-}
-
-func (e *Entry) setSize(str string) (err error) {
-	e.Size, err = strconv.ParseUint(str, 0, 64)
-	return
-}
-
-func (e *Entry) setTime(fields []string, now time.Time, loc *time.Location) (err error) {
-	if strings.Contains(fields[2], ":") { // contains time
-		thisYear, _, _ := now.Date()
-		timeStr := fmt.Sprintf("%s %s %d %s", fields[1], fields[0], thisYear, fields[2])
-		e.Time, err = time.ParseInLocation("_2 Jan 2006 15:04", timeStr, loc)
-
-		/*
-			On unix, `info ls` shows:
-
-			10.1.6 Formatting file timestamps
-			---------------------------------
-
-			A timestamp is considered to be “recent” if it is less than six
-			months old, and is not dated in the future.  If a timestamp dated today
-			is not listed in recent form, the timestamp is in the future, which
-			means you probably have clock skew problems which may break programs
-			like ‘make’ that rely on file timestamps.
-		*/
-		if !e.Time.Before(now.AddDate(0, 6, 0)) {
-			e.Time = e.Time.AddDate(-1, 0, 0)
-		}
-
-	} else { // only the date
-		if len(fields[2]) != 4 {
-			return errUnsupportedListDate
-		}
-		timeStr := fmt.Sprintf("%s %s %s 00:00", fields[1], fields[0], fields[2])
-		e.Time, err = time.ParseInLocation("_2 Jan 2006 15:04", timeStr, loc)
-	}
-	return
-}

+ 0 - 58
vendor/github.com/jlaffaye/ftp/scanner.go

@@ -1,58 +0,0 @@
-package ftp
-
-// A scanner for fields delimited by one or more whitespace characters
-type scanner struct {
-	bytes    []byte
-	position int
-}
-
-// newScanner creates a new scanner
-func newScanner(str string) *scanner {
-	return &scanner{
-		bytes: []byte(str),
-	}
-}
-
-// NextFields returns the next `count` fields
-func (s *scanner) NextFields(count int) []string {
-	fields := make([]string, 0, count)
-	for i := 0; i < count; i++ {
-		if field := s.Next(); field != "" {
-			fields = append(fields, field)
-		} else {
-			break
-		}
-	}
-	return fields
-}
-
-// Next returns the next field
-func (s *scanner) Next() string {
-	sLen := len(s.bytes)
-
-	// skip trailing whitespace
-	for s.position < sLen {
-		if s.bytes[s.position] != ' ' {
-			break
-		}
-		s.position++
-	}
-
-	start := s.position
-
-	// skip non-whitespace
-	for s.position < sLen {
-		if s.bytes[s.position] == ' ' {
-			s.position++
-			return string(s.bytes[start : s.position-1])
-		}
-		s.position++
-	}
-
-	return string(s.bytes[start:s.position])
-}
-
-// Remaining returns the remaining string
-func (s *scanner) Remaining() string {
-	return string(s.bytes[s.position:len(s.bytes)])
-}

+ 0 - 119
vendor/github.com/jlaffaye/ftp/status.go

@@ -1,119 +0,0 @@
-package ftp
-
-import "fmt"
-
-// FTP status codes, defined in RFC 959
-const (
-	StatusInitiating    = 100
-	StatusRestartMarker = 110
-	StatusReadyMinute   = 120
-	StatusAlreadyOpen   = 125
-	StatusAboutToSend   = 150
-
-	StatusCommandOK             = 200
-	StatusCommandNotImplemented = 202
-	StatusSystem                = 211
-	StatusDirectory             = 212
-	StatusFile                  = 213
-	StatusHelp                  = 214
-	StatusName                  = 215
-	StatusReady                 = 220
-	StatusClosing               = 221
-	StatusDataConnectionOpen    = 225
-	StatusClosingDataConnection = 226
-	StatusPassiveMode           = 227
-	StatusLongPassiveMode       = 228
-	StatusExtendedPassiveMode   = 229
-	StatusLoggedIn              = 230
-	StatusLoggedOut             = 231
-	StatusLogoutAck             = 232
-	StatusAuthOK                = 234
-	StatusRequestedFileActionOK = 250
-	StatusPathCreated           = 257
-
-	StatusUserOK             = 331
-	StatusLoginNeedAccount   = 332
-	StatusRequestFilePending = 350
-
-	StatusNotAvailable             = 421
-	StatusCanNotOpenDataConnection = 425
-	StatusTransfertAborted         = 426
-	StatusInvalidCredentials       = 430
-	StatusHostUnavailable          = 434
-	StatusFileActionIgnored        = 450
-	StatusActionAborted            = 451
-	Status452                      = 452
-
-	StatusBadCommand              = 500
-	StatusBadArguments            = 501
-	StatusNotImplemented          = 502
-	StatusBadSequence             = 503
-	StatusNotImplementedParameter = 504
-	StatusNotLoggedIn             = 530
-	StatusStorNeedAccount         = 532
-	StatusFileUnavailable         = 550
-	StatusPageTypeUnknown         = 551
-	StatusExceededStorage         = 552
-	StatusBadFileName             = 553
-)
-
-var statusText = map[int]string{
-	// 200
-	StatusCommandOK:             "Command okay.",
-	StatusCommandNotImplemented: "Command not implemented, superfluous at this site.",
-	StatusSystem:                "System status, or system help reply.",
-	StatusDirectory:             "Directory status.",
-	StatusFile:                  "File status.",
-	StatusHelp:                  "Help message.",
-	StatusName:                  "",
-	StatusReady:                 "Service ready for new user.",
-	StatusClosing:               "Service closing control connection.",
-	StatusDataConnectionOpen:    "Data connection open; no transfer in progress.",
-	StatusClosingDataConnection: "Closing data connection. Requested file action successful.",
-	StatusPassiveMode:           "Entering Passive Mode.",
-	StatusLongPassiveMode:       "Entering Long Passive Mode.",
-	StatusExtendedPassiveMode:   "Entering Extended Passive Mode.",
-	StatusLoggedIn:              "User logged in, proceed.",
-	StatusLoggedOut:             "User logged out; service terminated.",
-	StatusLogoutAck:             "Logout command noted, will complete when transfer done.",
-	StatusAuthOK:                "AUTH command OK",
-	StatusRequestedFileActionOK: "Requested file action okay, completed.",
-	StatusPathCreated:           "Path created.",
-
-	// 300
-	StatusUserOK:             "User name okay, need password.",
-	StatusLoginNeedAccount:   "Need account for login.",
-	StatusRequestFilePending: "Requested file action pending further information.",
-
-	// 400
-	StatusNotAvailable:             "Service not available, closing control connection.",
-	StatusCanNotOpenDataConnection: "Can't open data connection.",
-	StatusTransfertAborted:         "Connection closed; transfer aborted.",
-	StatusInvalidCredentials:       "Invalid username or password.",
-	StatusHostUnavailable:          "Requested host unavailable.",
-	StatusFileActionIgnored:        "Requested file action not taken.",
-	StatusActionAborted:            "Requested action aborted. Local error in processing.",
-	Status452:                      "Insufficient storage space in system.",
-
-	// 500
-	StatusBadCommand:              "Command unrecognized.",
-	StatusBadArguments:            "Syntax error in parameters or arguments.",
-	StatusNotImplemented:          "Command not implemented.",
-	StatusBadSequence:             "Bad sequence of commands.",
-	StatusNotImplementedParameter: "Command not implemented for that parameter.",
-	StatusNotLoggedIn:             "Not logged in.",
-	StatusStorNeedAccount:         "Need account for storing files.",
-	StatusFileUnavailable:         "File unavailable.",
-	StatusPageTypeUnknown:         "Page type unknown.",
-	StatusExceededStorage:         "Exceeded storage allocation.",
-	StatusBadFileName:             "File name not allowed.",
-}
-
-// StatusText returns a text for the FTP status code. It returns the empty string if the code is unknown.
-func StatusText(code int) string {
-	str, ok := statusText[code]
-	if !ok {
-		str = fmt.Sprintf("Unknown status code: %d", code)
-	}
-	return str
-}

+ 0 - 98
vendor/github.com/jlaffaye/ftp/walker.go

@@ -1,98 +0,0 @@
-package ftp
-
-import (
-	"path"
-)
-
-// Walker traverses the directory tree of a remote FTP server
-type Walker struct {
-	serverConn *ServerConn
-	root       string
-	cur        *item
-	stack      []*item
-	descend    bool
-}
-
-type item struct {
-	path  string
-	entry *Entry
-	err   error
-}
-
-// Next advances the Walker to the next file or directory,
-// which will then be available through the Path, Stat, and Err methods.
-// It returns false when the walk stops at the end of the tree.
-func (w *Walker) Next() bool {
-	// check if we need to init cur, maybe this should be inside Walk
-	if w.cur == nil {
-		w.cur = &item{
-			path: w.root,
-			entry: &Entry{
-				Type: EntryTypeFolder,
-			},
-		}
-	}
-
-	if w.descend && w.cur.entry.Type == EntryTypeFolder {
-		entries, err := w.serverConn.List(w.cur.path)
-
-		// an error occurred, drop out and stop walking
-		if err != nil {
-			w.cur.err = err
-			return false
-		}
-
-		for _, entry := range entries {
-			if entry.Name == "." || entry.Name == ".." {
-				continue
-			}
-
-			item := &item{
-				path:  path.Join(w.cur.path, entry.Name),
-				entry: entry,
-			}
-
-			w.stack = append(w.stack, item)
-		}
-	}
-
-	if len(w.stack) == 0 {
-		return false
-	}
-
-	// update cur
-	i := len(w.stack) - 1
-	w.cur = w.stack[i]
-	w.stack = w.stack[:i]
-
-	// reset SkipDir
-	w.descend = true
-
-	return true
-}
-
-// SkipDir tells the Next function to skip the currently processed directory
-func (w *Walker) SkipDir() {
-	w.descend = false
-}
-
-// Err returns the error, if any, for the most recent attempt by Next to
-// visit a file or a directory. If a directory has an error, the walker
-// will not descend in that directory
-func (w *Walker) Err() error {
-	return w.cur.err
-}
-
-// Stat returns info for the most recent file or directory
-// visited by a call to Next.
-func (w *Walker) Stat() *Entry {
-	return w.cur.entry
-}
-
-// Path returns the path to the most recent file or directory
-// visited by a call to Next. It contains the argument to Walk
-// as a prefix; that is, if Walk is called with "dir", which is
-// a directory containing the file "a", Path will return "dir/a".
-func (w *Walker) Path() string {
-	return w.cur.path
-}

+ 0 - 4
vendor/github.com/sirupsen/logrus/.gitignore

@@ -1,4 +0,0 @@
-logrus
-vendor
-
-.idea/

+ 0 - 40
vendor/github.com/sirupsen/logrus/.golangci.yml

@@ -1,40 +0,0 @@
-run:
-  # do not run on test files yet
-  tests: false
-
-# all available settings of specific linters
-linters-settings:
-  errcheck:
-    # report about not checking of errors in type assetions: `a := b.(MyStruct)`;
-    # default is false: such cases aren't reported by default.
-    check-type-assertions: false
-
-    # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
-    # default is false: such cases aren't reported by default.
-    check-blank: false
-
-  lll:
-    line-length: 100
-    tab-width: 4
-
-  prealloc:
-    simple: false
-    range-loops: false
-    for-loops: false
-
-  whitespace:
-    multi-if: false   # Enforces newlines (or comments) after every multi-line if statement
-    multi-func: false # Enforces newlines (or comments) after every multi-line function signature
-
-linters:
-  enable:
-    - megacheck
-    - govet
-  disable:
-    - maligned
-    - prealloc
-  disable-all: false
-  presets:
-    - bugs
-    - unused
-  fast: false

+ 0 - 15
vendor/github.com/sirupsen/logrus/.travis.yml

@@ -1,15 +0,0 @@
-language: go
-go_import_path: github.com/sirupsen/logrus
-git:
-  depth: 1
-env:
-  - GO111MODULE=on
-go: 1.15.x
-os: linux
-install:
-  - ./travis/install.sh
-script:
-  - cd ci
-  - go run mage.go -v -w ../ crossBuild
-  - go run mage.go -v -w ../ lint
-  - go run mage.go -v -w ../ test

+ 0 - 259
vendor/github.com/sirupsen/logrus/CHANGELOG.md

@@ -1,259 +0,0 @@
-# 1.8.1
-Code quality:
-  * move magefile in its own subdir/submodule to remove magefile dependency on logrus consumer
-  * improve timestamp format documentation
-
-Fixes:
-  * fix race condition on logger hooks
-
-
-# 1.8.0
-
-Correct versioning number replacing v1.7.1.
-
-# 1.7.1
-
-Beware this release has introduced a new public API and its semver is therefore incorrect.
-
-Code quality:
-  * use go 1.15 in travis
-  * use magefile as task runner
-
-Fixes:
-  * small fixes about new go 1.13 error formatting system
-  * Fix for long time race condiction with mutating data hooks
-
-Features:
-  * build support for zos
-
-# 1.7.0
-Fixes:
-  * the dependency toward a windows terminal library has been removed
-
-Features:
-  * a new buffer pool management API has been added
-  * a set of `<LogLevel>Fn()` functions have been added
-
-# 1.6.0
-Fixes:
-  * end of line cleanup
-  * revert the entry concurrency bug fix whic leads to deadlock under some circumstances
-  * update dependency on go-windows-terminal-sequences to fix a crash with go 1.14
-
-Features:
-  * add an option to the `TextFormatter` to completely disable fields quoting
-
-# 1.5.0
-Code quality:
-  * add golangci linter run on travis
-
-Fixes:
-  * add mutex for hooks concurrent access on `Entry` data
-  * caller function field for go1.14
-  * fix build issue for gopherjs target
-
-Feature:
-  * add an hooks/writer sub-package whose goal is to split output on different stream depending on the trace level
-  * add a `DisableHTMLEscape` option in the `JSONFormatter`
-  * add `ForceQuote` and `PadLevelText` options in the `TextFormatter`
-
-# 1.4.2
-  * Fixes build break for plan9, nacl, solaris
-# 1.4.1
-This new release introduces:
-  * Enhance TextFormatter to not print caller information when they are empty (#944)
-  * Remove dependency on golang.org/x/crypto (#932, #943)
-
-Fixes:
-  * Fix Entry.WithContext method to return a copy of the initial entry (#941)
-
-# 1.4.0
-This new release introduces:
-  * Add `DeferExitHandler`, similar to `RegisterExitHandler` but prepending the handler to the list of handlers (semantically like `defer`) (#848).
-  * Add `CallerPrettyfier` to `JSONFormatter` and `TextFormatter` (#909, #911)
-  * Add `Entry.WithContext()` and `Entry.Context`, to set a context on entries to be used e.g. in hooks (#919).
-
-Fixes:
-  * Fix wrong method calls `Logger.Print` and `Logger.Warningln` (#893).
-  * Update `Entry.Logf` to not do string formatting unless the log level is enabled (#903)
-  * Fix infinite recursion on unknown `Level.String()` (#907)
-  * Fix race condition in `getCaller` (#916).
-
-
-# 1.3.0
-This new release introduces:
-  * Log, Logf, Logln functions for Logger and Entry that take a Level
-
-Fixes:
-  * Building prometheus node_exporter on AIX (#840)
-  * Race condition in TextFormatter (#468)
-  * Travis CI import path (#868)
-  * Remove coloured output on Windows (#862)
-  * Pointer to func as field in JSONFormatter (#870)
-  * Properly marshal Levels (#873)
-
-# 1.2.0
-This new release introduces:
-  * A new method `SetReportCaller` in the `Logger` to enable the file, line and calling function from which the trace has been issued
-  * A new trace level named `Trace` whose level is below `Debug`
-  * A configurable exit function to be called upon a Fatal trace
-  * The `Level` object now implements `encoding.TextUnmarshaler` interface
-
-# 1.1.1
-This is a bug fix release.
-  * fix the build break on Solaris
-  * don't drop a whole trace in JSONFormatter when a field param is a function pointer which can not be serialized
-
-# 1.1.0
-This new release introduces:
-  * several fixes:
-    * a fix for a race condition on entry formatting
-    * proper cleanup of previously used entries before putting them back in the pool
-    * the extra new line at the end of message in text formatter has been removed
-  * a new global public API to check if a level is activated: IsLevelEnabled
-  * the following methods have been added to the Logger object
-    * IsLevelEnabled
-    * SetFormatter
-    * SetOutput
-    * ReplaceHooks
-  * introduction of go module
-  * an indent configuration for the json formatter
-  * output colour support for windows
-  * the field sort function is now configurable for text formatter
-  * the CLICOLOR and CLICOLOR\_FORCE environment variable support in text formater
-
-# 1.0.6
-
-This new release introduces:
-  * a new api WithTime which allows to easily force the time of the log entry
-    which is mostly useful for logger wrapper
-  * a fix reverting the immutability of the entry given as parameter to the hooks
-    a new configuration field of the json formatter in order to put all the fields
-    in a nested dictionnary
-  * a new SetOutput method in the Logger
-  * a new configuration of the textformatter to configure the name of the default keys
-  * a new configuration of the text formatter to disable the level truncation
-
-# 1.0.5
-
-* Fix hooks race (#707)
-* Fix panic deadlock (#695)
-
-# 1.0.4
-
-* Fix race when adding hooks (#612)
-* Fix terminal check in AppEngine (#635)
-
-# 1.0.3
-
-* Replace example files with testable examples
-
-# 1.0.2
-
-* bug: quote non-string values in text formatter (#583)
-* Make (*Logger) SetLevel a public method
-
-# 1.0.1
-
-* bug: fix escaping in text formatter (#575)
-
-# 1.0.0
-
-* Officially changed name to lower-case
-* bug: colors on Windows 10 (#541)
-* bug: fix race in accessing level (#512)
-
-# 0.11.5
-
-* feature: add writer and writerlevel to entry (#372)
-
-# 0.11.4
-
-* bug: fix undefined variable on solaris (#493)
-
-# 0.11.3
-
-* formatter: configure quoting of empty values (#484)
-* formatter: configure quoting character (default is `"`) (#484)
-* bug: fix not importing io correctly in non-linux environments (#481)
-
-# 0.11.2
-
-* bug: fix windows terminal detection (#476)
-
-# 0.11.1
-
-* bug: fix tty detection with custom out (#471)
-
-# 0.11.0
-
-* performance: Use bufferpool to allocate (#370)
-* terminal: terminal detection for app-engine (#343)
-* feature: exit handler (#375)
-
-# 0.10.0
-
-* feature: Add a test hook (#180)
-* feature: `ParseLevel` is now case-insensitive (#326)
-* feature: `FieldLogger` interface that generalizes `Logger` and `Entry` (#308)
-* performance: avoid re-allocations on `WithFields` (#335)
-
-# 0.9.0
-
-* logrus/text_formatter: don't emit empty msg
-* logrus/hooks/airbrake: move out of main repository
-* logrus/hooks/sentry: move out of main repository
-* logrus/hooks/papertrail: move out of main repository
-* logrus/hooks/bugsnag: move out of main repository
-* logrus/core: run tests with `-race`
-* logrus/core: detect TTY based on `stderr`
-* logrus/core: support `WithError` on logger
-* logrus/core: Solaris support
-
-# 0.8.7
-
-* logrus/core: fix possible race (#216)
-* logrus/doc: small typo fixes and doc improvements
-
-
-# 0.8.6
-
-* hooks/raven: allow passing an initialized client
-
-# 0.8.5
-
-* logrus/core: revert #208
-
-# 0.8.4
-
-* formatter/text: fix data race (#218)
-
-# 0.8.3
-
-* logrus/core: fix entry log level (#208)
-* logrus/core: improve performance of text formatter by 40%
-* logrus/core: expose `LevelHooks` type
-* logrus/core: add support for DragonflyBSD and NetBSD
-* formatter/text: print structs more verbosely
-
-# 0.8.2
-
-* logrus: fix more Fatal family functions
-
-# 0.8.1
-
-* logrus: fix not exiting on `Fatalf` and `Fatalln`
-
-# 0.8.0
-
-* logrus: defaults to stderr instead of stdout
-* hooks/sentry: add special field for `*http.Request`
-* formatter/text: ignore Windows for colors
-
-# 0.7.3
-
-* formatter/\*: allow configuration of timestamp layout
-
-# 0.7.2
-
-* formatter/text: Add configuration option for time format (#158)

+ 0 - 21
vendor/github.com/sirupsen/logrus/LICENSE

@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Simon Eskildsen
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.

+ 0 - 515
vendor/github.com/sirupsen/logrus/README.md

@@ -1,515 +0,0 @@
-# Logrus <img src="http://i.imgur.com/hTeVwmJ.png" width="40" height="40" alt=":walrus:" class="emoji" title=":walrus:"/> [![Build Status](https://github.com/sirupsen/logrus/workflows/CI/badge.svg)](https://github.com/sirupsen/logrus/actions?query=workflow%3ACI) [![Build Status](https://travis-ci.org/sirupsen/logrus.svg?branch=master)](https://travis-ci.org/sirupsen/logrus) [![Go Reference](https://pkg.go.dev/badge/github.com/sirupsen/logrus.svg)](https://pkg.go.dev/github.com/sirupsen/logrus)
-
-Logrus is a structured logger for Go (golang), completely API compatible with
-the standard library logger.
-
-**Logrus is in maintenance-mode.** We will not be introducing new features. It's
-simply too hard to do in a way that won't break many people's projects, which is
-the last thing you want from your Logging library (again...).
-
-This does not mean Logrus is dead. Logrus will continue to be maintained for
-security, (backwards compatible) bug fixes, and performance (where we are
-limited by the interface).
-
-I believe Logrus' biggest contribution is to have played a part in today's
-widespread use of structured logging in Golang. There doesn't seem to be a
-reason to do a major, breaking iteration into Logrus V2, since the fantastic Go
-community has built those independently. Many fantastic alternatives have sprung
-up. Logrus would look like those, had it been re-designed with what we know
-about structured logging in Go today. Check out, for example,
-[Zerolog][zerolog], [Zap][zap], and [Apex][apex].
-
-[zerolog]: https://github.com/rs/zerolog
-[zap]: https://github.com/uber-go/zap
-[apex]: https://github.com/apex/log
-
-**Seeing weird case-sensitive problems?** It's in the past been possible to
-import Logrus as both upper- and lower-case. Due to the Go package environment,
-this caused issues in the community and we needed a standard. Some environments
-experienced problems with the upper-case variant, so the lower-case was decided.
-Everything using `logrus` will need to use the lower-case:
-`github.com/sirupsen/logrus`. Any package that isn't, should be changed.
-
-To fix Glide, see [these
-comments](https://github.com/sirupsen/logrus/issues/553#issuecomment-306591437).
-For an in-depth explanation of the casing issue, see [this
-comment](https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276).
-
-Nicely color-coded in development (when a TTY is attached, otherwise just
-plain text):
-
-![Colored](http://i.imgur.com/PY7qMwd.png)
-
-With `log.SetFormatter(&log.JSONFormatter{})`, for easy parsing by logstash
-or Splunk:
-
-```text
-{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the
-ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"}
-
-{"level":"warning","msg":"The group's number increased tremendously!",
-"number":122,"omg":true,"time":"2014-03-10 19:57:38.562471297 -0400 EDT"}
-
-{"animal":"walrus","level":"info","msg":"A giant walrus appears!",
-"size":10,"time":"2014-03-10 19:57:38.562500591 -0400 EDT"}
-
-{"animal":"walrus","level":"info","msg":"Tremendously sized cow enters the ocean.",
-"size":9,"time":"2014-03-10 19:57:38.562527896 -0400 EDT"}
-
-{"level":"fatal","msg":"The ice breaks!","number":100,"omg":true,
-"time":"2014-03-10 19:57:38.562543128 -0400 EDT"}
-```
-
-With the default `log.SetFormatter(&log.TextFormatter{})` when a TTY is not
-attached, the output is compatible with the
-[logfmt](http://godoc.org/github.com/kr/logfmt) format:
-
-```text
-time="2015-03-26T01:27:38-04:00" level=debug msg="Started observing beach" animal=walrus number=8
-time="2015-03-26T01:27:38-04:00" level=info msg="A group of walrus emerges from the ocean" animal=walrus size=10
-time="2015-03-26T01:27:38-04:00" level=warning msg="The group's number increased tremendously!" number=122 omg=true
-time="2015-03-26T01:27:38-04:00" level=debug msg="Temperature changes" temperature=-4
-time="2015-03-26T01:27:38-04:00" level=panic msg="It's over 9000!" animal=orca size=9009
-time="2015-03-26T01:27:38-04:00" level=fatal msg="The ice breaks!" err=&{0x2082280c0 map[animal:orca size:9009] 2015-03-26 01:27:38.441574009 -0400 EDT panic It's over 9000!} number=100 omg=true
-```
-To ensure this behaviour even if a TTY is attached, set your formatter as follows:
-
-```go
-	log.SetFormatter(&log.TextFormatter{
-		DisableColors: true,
-		FullTimestamp: true,
-	})
-```
-
-#### Logging Method Name
-
-If you wish to add the calling method as a field, instruct the logger via:
-```go
-log.SetReportCaller(true)
-```
-This adds the caller as 'method' like so:
-
-```json
-{"animal":"penguin","level":"fatal","method":"github.com/sirupsen/arcticcreatures.migrate","msg":"a penguin swims by",
-"time":"2014-03-10 19:57:38.562543129 -0400 EDT"}
-```
-
-```text
-time="2015-03-26T01:27:38-04:00" level=fatal method=github.com/sirupsen/arcticcreatures.migrate msg="a penguin swims by" animal=penguin
-```
-Note that this does add measurable overhead - the cost will depend on the version of Go, but is
-between 20 and 40% in recent tests with 1.6 and 1.7.  You can validate this in your
-environment via benchmarks:
-```
-go test -bench=.*CallerTracing
-```
-
-
-#### Case-sensitivity
-
-The organization's name was changed to lower-case--and this will not be changed
-back. If you are getting import conflicts due to case sensitivity, please use
-the lower-case import: `github.com/sirupsen/logrus`.
-
-#### Example
-
-The simplest way to use Logrus is simply the package-level exported logger:
-
-```go
-package main
-
-import (
-  log "github.com/sirupsen/logrus"
-)
-
-func main() {
-  log.WithFields(log.Fields{
-    "animal": "walrus",
-  }).Info("A walrus appears")
-}
-```
-
-Note that it's completely api-compatible with the stdlib logger, so you can
-replace your `log` imports everywhere with `log "github.com/sirupsen/logrus"`
-and you'll now have the flexibility of Logrus. You can customize it all you
-want:
-
-```go
-package main
-
-import (
-  "os"
-  log "github.com/sirupsen/logrus"
-)
-
-func init() {
-  // Log as JSON instead of the default ASCII formatter.
-  log.SetFormatter(&log.JSONFormatter{})
-
-  // Output to stdout instead of the default stderr
-  // Can be any io.Writer, see below for File example
-  log.SetOutput(os.Stdout)
-
-  // Only log the warning severity or above.
-  log.SetLevel(log.WarnLevel)
-}
-
-func main() {
-  log.WithFields(log.Fields{
-    "animal": "walrus",
-    "size":   10,
-  }).Info("A group of walrus emerges from the ocean")
-
-  log.WithFields(log.Fields{
-    "omg":    true,
-    "number": 122,
-  }).Warn("The group's number increased tremendously!")
-
-  log.WithFields(log.Fields{
-    "omg":    true,
-    "number": 100,
-  }).Fatal("The ice breaks!")
-
-  // A common pattern is to re-use fields between logging statements by re-using
-  // the logrus.Entry returned from WithFields()
-  contextLogger := log.WithFields(log.Fields{
-    "common": "this is a common field",
-    "other": "I also should be logged always",
-  })
-
-  contextLogger.Info("I'll be logged with common and other field")
-  contextLogger.Info("Me too")
-}
-```
-
-For more advanced usage such as logging to multiple locations from the same
-application, you can also create an instance of the `logrus` Logger:
-
-```go
-package main
-
-import (
-  "os"
-  "github.com/sirupsen/logrus"
-)
-
-// Create a new instance of the logger. You can have any number of instances.
-var log = logrus.New()
-
-func main() {
-  // The API for setting attributes is a little different than the package level
-  // exported logger. See Godoc.
-  log.Out = os.Stdout
-
-  // You could set this to any `io.Writer` such as a file
-  // file, err := os.OpenFile("logrus.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
-  // if err == nil {
-  //  log.Out = file
-  // } else {
-  //  log.Info("Failed to log to file, using default stderr")
-  // }
-
-  log.WithFields(logrus.Fields{
-    "animal": "walrus",
-    "size":   10,
-  }).Info("A group of walrus emerges from the ocean")
-}
-```
-
-#### Fields
-
-Logrus encourages careful, structured logging through logging fields instead of
-long, unparseable error messages. For example, instead of: `log.Fatalf("Failed
-to send event %s to topic %s with key %d")`, you should log the much more
-discoverable:
-
-```go
-log.WithFields(log.Fields{
-  "event": event,
-  "topic": topic,
-  "key": key,
-}).Fatal("Failed to send event")
-```
-
-We've found this API forces you to think about logging in a way that produces
-much more useful logging messages. We've been in countless situations where just
-a single added field to a log statement that was already there would've saved us
-hours. The `WithFields` call is optional.
-
-In general, with Logrus using any of the `printf`-family functions should be
-seen as a hint you should add a field, however, you can still use the
-`printf`-family functions with Logrus.
-
-#### Default Fields
-
-Often it's helpful to have fields _always_ attached to log statements in an
-application or parts of one. For example, you may want to always log the
-`request_id` and `user_ip` in the context of a request. Instead of writing
-`log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip})` on
-every line, you can create a `logrus.Entry` to pass around instead:
-
-```go
-requestLogger := log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip})
-requestLogger.Info("something happened on that request") # will log request_id and user_ip
-requestLogger.Warn("something not great happened")
-```
-
-#### Hooks
-
-You can add hooks for logging levels. For example to send errors to an exception
-tracking service on `Error`, `Fatal` and `Panic`, info to StatsD or log to
-multiple places simultaneously, e.g. syslog.
-
-Logrus comes with [built-in hooks](hooks/). Add those, or your custom hook, in
-`init`:
-
-```go
-import (
-  log "github.com/sirupsen/logrus"
-  "gopkg.in/gemnasium/logrus-airbrake-hook.v2" // the package is named "airbrake"
-  logrus_syslog "github.com/sirupsen/logrus/hooks/syslog"
-  "log/syslog"
-)
-
-func init() {
-
-  // Use the Airbrake hook to report errors that have Error severity or above to
-  // an exception tracker. You can create custom hooks, see the Hooks section.
-  log.AddHook(airbrake.NewHook(123, "xyz", "production"))
-
-  hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "")
-  if err != nil {
-    log.Error("Unable to connect to local syslog daemon")
-  } else {
-    log.AddHook(hook)
-  }
-}
-```
-Note: Syslog hook also support connecting to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). For the detail, please check the [syslog hook README](hooks/syslog/README.md).
-
-A list of currently known service hooks can be found in this wiki [page](https://github.com/sirupsen/logrus/wiki/Hooks)
-
-
-#### Level logging
-
-Logrus has seven logging levels: Trace, Debug, Info, Warning, Error, Fatal and Panic.
-
-```go
-log.Trace("Something very low level.")
-log.Debug("Useful debugging information.")
-log.Info("Something noteworthy happened!")
-log.Warn("You should probably take a look at this.")
-log.Error("Something failed but I'm not quitting.")
-// Calls os.Exit(1) after logging
-log.Fatal("Bye.")
-// Calls panic() after logging
-log.Panic("I'm bailing.")
-```
-
-You can set the logging level on a `Logger`, then it will only log entries with
-that severity or anything above it:
-
-```go
-// Will log anything that is info or above (warn, error, fatal, panic). Default.
-log.SetLevel(log.InfoLevel)
-```
-
-It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose
-environment if your application has that.
-
-Note: If you want different log levels for global (`log.SetLevel(...)`) and syslog logging, please check the [syslog hook README](hooks/syslog/README.md#different-log-levels-for-local-and-remote-logging).
-
-#### Entries
-
-Besides the fields added with `WithField` or `WithFields` some fields are
-automatically added to all logging events:
-
-1. `time`. The timestamp when the entry was created.
-2. `msg`. The logging message passed to `{Info,Warn,Error,Fatal,Panic}` after
-   the `AddFields` call. E.g. `Failed to send event.`
-3. `level`. The logging level. E.g. `info`.
-
-#### Environments
-
-Logrus has no notion of environment.
-
-If you wish for hooks and formatters to only be used in specific environments,
-you should handle that yourself. For example, if your application has a global
-variable `Environment`, which is a string representation of the environment you
-could do:
-
-```go
-import (
-  log "github.com/sirupsen/logrus"
-)
-
-func init() {
-  // do something here to set environment depending on an environment variable
-  // or command-line flag
-  if Environment == "production" {
-    log.SetFormatter(&log.JSONFormatter{})
-  } else {
-    // The TextFormatter is default, you don't actually have to do this.
-    log.SetFormatter(&log.TextFormatter{})
-  }
-}
-```
-
-This configuration is how `logrus` was intended to be used, but JSON in
-production is mostly only useful if you do log aggregation with tools like
-Splunk or Logstash.
-
-#### Formatters
-
-The built-in logging formatters are:
-
-* `logrus.TextFormatter`. Logs the event in colors if stdout is a tty, otherwise
-  without colors.
-  * *Note:* to force colored output when there is no TTY, set the `ForceColors`
-    field to `true`.  To force no colored output even if there is a TTY  set the
-    `DisableColors` field to `true`. For Windows, see
-    [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable).
-  * When colors are enabled, levels are truncated to 4 characters by default. To disable
-    truncation set the `DisableLevelTruncation` field to `true`.
-  * When outputting to a TTY, it's often helpful to visually scan down a column where all the levels are the same width. Setting the `PadLevelText` field to `true` enables this behavior, by adding padding to the level text.
-  * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#TextFormatter).
-* `logrus.JSONFormatter`. Logs fields as JSON.
-  * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#JSONFormatter).
-
-Third party logging formatters:
-
-* [`FluentdFormatter`](https://github.com/joonix/log). Formats entries that can be parsed by Kubernetes and Google Container Engine.
-* [`GELF`](https://github.com/fabienm/go-logrus-formatters). Formats entries so they comply to Graylog's [GELF 1.1 specification](http://docs.graylog.org/en/2.4/pages/gelf.html).
-* [`logstash`](https://github.com/bshuster-repo/logrus-logstash-hook). Logs fields as [Logstash](http://logstash.net) Events.
-* [`prefixed`](https://github.com/x-cray/logrus-prefixed-formatter). Displays log entry source along with alternative layout.
-* [`zalgo`](https://github.com/aybabtme/logzalgo). Invoking the Power of Zalgo.
-* [`nested-logrus-formatter`](https://github.com/antonfisher/nested-logrus-formatter). Converts logrus fields to a nested structure.
-* [`powerful-logrus-formatter`](https://github.com/zput/zxcTool). get fileName, log's line number and the latest function's name when print log; Sava log to files.
-* [`caption-json-formatter`](https://github.com/nolleh/caption_json_formatter). logrus's message json formatter with human-readable caption added.
-
-You can define your formatter by implementing the `Formatter` interface,
-requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a
-`Fields` type (`map[string]interface{}`) with all your fields as well as the
-default ones (see Entries section above):
-
-```go
-type MyJSONFormatter struct {
-}
-
-log.SetFormatter(new(MyJSONFormatter))
-
-func (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) {
-  // Note this doesn't include Time, Level and Message which are available on
-  // the Entry. Consult `godoc` on information about those fields or read the
-  // source of the official loggers.
-  serialized, err := json.Marshal(entry.Data)
-    if err != nil {
-      return nil, fmt.Errorf("Failed to marshal fields to JSON, %w", err)
-    }
-  return append(serialized, '\n'), nil
-}
-```
-
-#### Logger as an `io.Writer`
-
-Logrus can be transformed into an `io.Writer`. That writer is the end of an `io.Pipe` and it is your responsibility to close it.
-
-```go
-w := logger.Writer()
-defer w.Close()
-
-srv := http.Server{
-    // create a stdlib log.Logger that writes to
-    // logrus.Logger.
-    ErrorLog: log.New(w, "", 0),
-}
-```
-
-Each line written to that writer will be printed the usual way, using formatters
-and hooks. The level for those entries is `info`.
-
-This means that we can override the standard library logger easily:
-
-```go
-logger := logrus.New()
-logger.Formatter = &logrus.JSONFormatter{}
-
-// Use logrus for standard log output
-// Note that `log` here references stdlib's log
-// Not logrus imported under the name `log`.
-log.SetOutput(logger.Writer())
-```
-
-#### Rotation
-
-Log rotation is not provided with Logrus. Log rotation should be done by an
-external program (like `logrotate(8)`) that can compress and delete old log
-entries. It should not be a feature of the application-level logger.
-
-#### Tools
-
-| Tool | Description |
-| ---- | ----------- |
-|[Logrus Mate](https://github.com/gogap/logrus_mate)|Logrus mate is a tool for Logrus to manage loggers, you can initial logger's level, hook and formatter by config file, the logger will be generated with different configs in different environments.|
-|[Logrus Viper Helper](https://github.com/heirko/go-contrib/tree/master/logrusHelper)|An Helper around Logrus to wrap with spf13/Viper to load configuration with fangs! And to simplify Logrus configuration use some behavior of [Logrus Mate](https://github.com/gogap/logrus_mate). [sample](https://github.com/heirko/iris-contrib/blob/master/middleware/logrus-logger/example) |
-
-#### Testing
-
-Logrus has a built in facility for asserting the presence of log messages. This is implemented through the `test` hook and provides:
-
-* decorators for existing logger (`test.NewLocal` and `test.NewGlobal`) which basically just adds the `test` hook
-* a test logger (`test.NewNullLogger`) that just records log messages (and does not output any):
-
-```go
-import(
-  "github.com/sirupsen/logrus"
-  "github.com/sirupsen/logrus/hooks/test"
-  "github.com/stretchr/testify/assert"
-  "testing"
-)
-
-func TestSomething(t*testing.T){
-  logger, hook := test.NewNullLogger()
-  logger.Error("Helloerror")
-
-  assert.Equal(t, 1, len(hook.Entries))
-  assert.Equal(t, logrus.ErrorLevel, hook.LastEntry().Level)
-  assert.Equal(t, "Helloerror", hook.LastEntry().Message)
-
-  hook.Reset()
-  assert.Nil(t, hook.LastEntry())
-}
-```
-
-#### Fatal handlers
-
-Logrus can register one or more functions that will be called when any `fatal`
-level message is logged. The registered handlers will be executed before
-logrus performs an `os.Exit(1)`. This behavior may be helpful if callers need
-to gracefully shutdown. Unlike a `panic("Something went wrong...")` call which can be intercepted with a deferred `recover` a call to `os.Exit(1)` can not be intercepted.
-
-```
-...
-handler := func() {
-  // gracefully shutdown something...
-}
-logrus.RegisterExitHandler(handler)
-...
-```
-
-#### Thread safety
-
-By default, Logger is protected by a mutex for concurrent writes. The mutex is held when calling hooks and writing logs.
-If you are sure such locking is not needed, you can call logger.SetNoLock() to disable the locking.
-
-Situation when locking is not needed includes:
-
-* You have no hooks registered, or hooks calling is already thread-safe.
-
-* Writing to logger.Out is already thread-safe, for example:
-
-  1) logger.Out is protected by locks.
-
-  2) logger.Out is an os.File handler opened with `O_APPEND` flag, and every write is smaller than 4k. (This allows multi-thread/multi-process writing)
-
-     (Refer to http://www.notthewizard.com/2014/06/17/are-files-appends-really-atomic/)

+ 0 - 76
vendor/github.com/sirupsen/logrus/alt_exit.go

@@ -1,76 +0,0 @@
-package logrus
-
-// The following code was sourced and modified from the
-// https://github.com/tebeka/atexit package governed by the following license:
-//
-// Copyright (c) 2012 Miki Tebeka <miki.tebeka@gmail.com>.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy of
-// this software and associated documentation files (the "Software"), to deal in
-// the Software without restriction, including without limitation the rights to
-// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-// the Software, and to permit persons to whom the Software is furnished to do so,
-// subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-import (
-	"fmt"
-	"os"
-)
-
-var handlers = []func(){}
-
-func runHandler(handler func()) {
-	defer func() {
-		if err := recover(); err != nil {
-			fmt.Fprintln(os.Stderr, "Error: Logrus exit handler error:", err)
-		}
-	}()
-
-	handler()
-}
-
-func runHandlers() {
-	for _, handler := range handlers {
-		runHandler(handler)
-	}
-}
-
-// Exit runs all the Logrus atexit handlers and then terminates the program using os.Exit(code)
-func Exit(code int) {
-	runHandlers()
-	os.Exit(code)
-}
-
-// RegisterExitHandler appends a Logrus Exit handler to the list of handlers,
-// call logrus.Exit to invoke all handlers. The handlers will also be invoked when
-// any Fatal log entry is made.
-//
-// This method is useful when a caller wishes to use logrus to log a fatal
-// message but also needs to gracefully shutdown. An example usecase could be
-// closing database connections, or sending a alert that the application is
-// closing.
-func RegisterExitHandler(handler func()) {
-	handlers = append(handlers, handler)
-}
-
-// DeferExitHandler prepends a Logrus Exit handler to the list of handlers,
-// call logrus.Exit to invoke all handlers. The handlers will also be invoked when
-// any Fatal log entry is made.
-//
-// This method is useful when a caller wishes to use logrus to log a fatal
-// message but also needs to gracefully shutdown. An example usecase could be
-// closing database connections, or sending a alert that the application is
-// closing.
-func DeferExitHandler(handler func()) {
-	handlers = append([]func(){handler}, handlers...)
-}

+ 0 - 14
vendor/github.com/sirupsen/logrus/appveyor.yml

@@ -1,14 +0,0 @@
-version: "{build}"
-platform: x64
-clone_folder: c:\gopath\src\github.com\sirupsen\logrus
-environment:
-  GOPATH: c:\gopath
-branches:
-  only:
-    - master
-install:
-  - set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
-  - go version
-build_script:
-  - go get -t
-  - go test

+ 0 - 43
vendor/github.com/sirupsen/logrus/buffer_pool.go

@@ -1,43 +0,0 @@
-package logrus
-
-import (
-	"bytes"
-	"sync"
-)
-
-var (
-	bufferPool BufferPool
-)
-
-type BufferPool interface {
-	Put(*bytes.Buffer)
-	Get() *bytes.Buffer
-}
-
-type defaultPool struct {
-	pool *sync.Pool
-}
-
-func (p *defaultPool) Put(buf *bytes.Buffer) {
-	p.pool.Put(buf)
-}
-
-func (p *defaultPool) Get() *bytes.Buffer {
-	return p.pool.Get().(*bytes.Buffer)
-}
-
-// SetBufferPool allows to replace the default logrus buffer pool
-// to better meets the specific needs of an application.
-func SetBufferPool(bp BufferPool) {
-	bufferPool = bp
-}
-
-func init() {
-	SetBufferPool(&defaultPool{
-		pool: &sync.Pool{
-			New: func() interface{} {
-				return new(bytes.Buffer)
-			},
-		},
-	})
-}

+ 0 - 26
vendor/github.com/sirupsen/logrus/doc.go

@@ -1,26 +0,0 @@
-/*
-Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
-
-
-The simplest way to use Logrus is simply the package-level exported logger:
-
-  package main
-
-  import (
-    log "github.com/sirupsen/logrus"
-  )
-
-  func main() {
-    log.WithFields(log.Fields{
-      "animal": "walrus",
-      "number": 1,
-      "size":   10,
-    }).Info("A walrus appears")
-  }
-
-Output:
-  time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10
-
-For a full guide visit https://github.com/sirupsen/logrus
-*/
-package logrus

+ 0 - 442
vendor/github.com/sirupsen/logrus/entry.go

@@ -1,442 +0,0 @@
-package logrus
-
-import (
-	"bytes"
-	"context"
-	"fmt"
-	"os"
-	"reflect"
-	"runtime"
-	"strings"
-	"sync"
-	"time"
-)
-
-var (
-
-	// qualified package name, cached at first use
-	logrusPackage string
-
-	// Positions in the call stack when tracing to report the calling method
-	minimumCallerDepth int
-
-	// Used for caller information initialisation
-	callerInitOnce sync.Once
-)
-
-const (
-	maximumCallerDepth int = 25
-	knownLogrusFrames  int = 4
-)
-
-func init() {
-	// start at the bottom of the stack before the package-name cache is primed
-	minimumCallerDepth = 1
-}
-
-// Defines the key when adding errors using WithError.
-var ErrorKey = "error"
-
-// An entry is the final or intermediate Logrus logging entry. It contains all
-// the fields passed with WithField{,s}. It's finally logged when Trace, Debug,
-// Info, Warn, Error, Fatal or Panic is called on it. These objects can be
-// reused and passed around as much as you wish to avoid field duplication.
-type Entry struct {
-	Logger *Logger
-
-	// Contains all the fields set by the user.
-	Data Fields
-
-	// Time at which the log entry was created
-	Time time.Time
-
-	// Level the log entry was logged at: Trace, Debug, Info, Warn, Error, Fatal or Panic
-	// This field will be set on entry firing and the value will be equal to the one in Logger struct field.
-	Level Level
-
-	// Calling method, with package name
-	Caller *runtime.Frame
-
-	// Message passed to Trace, Debug, Info, Warn, Error, Fatal or Panic
-	Message string
-
-	// When formatter is called in entry.log(), a Buffer may be set to entry
-	Buffer *bytes.Buffer
-
-	// Contains the context set by the user. Useful for hook processing etc.
-	Context context.Context
-
-	// err may contain a field formatting error
-	err string
-}
-
-func NewEntry(logger *Logger) *Entry {
-	return &Entry{
-		Logger: logger,
-		// Default is three fields, plus one optional.  Give a little extra room.
-		Data: make(Fields, 6),
-	}
-}
-
-func (entry *Entry) Dup() *Entry {
-	data := make(Fields, len(entry.Data))
-	for k, v := range entry.Data {
-		data[k] = v
-	}
-	return &Entry{Logger: entry.Logger, Data: data, Time: entry.Time, Context: entry.Context, err: entry.err}
-}
-
-// Returns the bytes representation of this entry from the formatter.
-func (entry *Entry) Bytes() ([]byte, error) {
-	return entry.Logger.Formatter.Format(entry)
-}
-
-// Returns the string representation from the reader and ultimately the
-// formatter.
-func (entry *Entry) String() (string, error) {
-	serialized, err := entry.Bytes()
-	if err != nil {
-		return "", err
-	}
-	str := string(serialized)
-	return str, nil
-}
-
-// Add an error as single field (using the key defined in ErrorKey) to the Entry.
-func (entry *Entry) WithError(err error) *Entry {
-	return entry.WithField(ErrorKey, err)
-}
-
-// Add a context to the Entry.
-func (entry *Entry) WithContext(ctx context.Context) *Entry {
-	dataCopy := make(Fields, len(entry.Data))
-	for k, v := range entry.Data {
-		dataCopy[k] = v
-	}
-	return &Entry{Logger: entry.Logger, Data: dataCopy, Time: entry.Time, err: entry.err, Context: ctx}
-}
-
-// Add a single field to the Entry.
-func (entry *Entry) WithField(key string, value interface{}) *Entry {
-	return entry.WithFields(Fields{key: value})
-}
-
-// Add a map of fields to the Entry.
-func (entry *Entry) WithFields(fields Fields) *Entry {
-	data := make(Fields, len(entry.Data)+len(fields))
-	for k, v := range entry.Data {
-		data[k] = v
-	}
-	fieldErr := entry.err
-	for k, v := range fields {
-		isErrField := false
-		if t := reflect.TypeOf(v); t != nil {
-			switch {
-			case t.Kind() == reflect.Func, t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Func:
-				isErrField = true
-			}
-		}
-		if isErrField {
-			tmp := fmt.Sprintf("can not add field %q", k)
-			if fieldErr != "" {
-				fieldErr = entry.err + ", " + tmp
-			} else {
-				fieldErr = tmp
-			}
-		} else {
-			data[k] = v
-		}
-	}
-	return &Entry{Logger: entry.Logger, Data: data, Time: entry.Time, err: fieldErr, Context: entry.Context}
-}
-
-// Overrides the time of the Entry.
-func (entry *Entry) WithTime(t time.Time) *Entry {
-	dataCopy := make(Fields, len(entry.Data))
-	for k, v := range entry.Data {
-		dataCopy[k] = v
-	}
-	return &Entry{Logger: entry.Logger, Data: dataCopy, Time: t, err: entry.err, Context: entry.Context}
-}
-
-// getPackageName reduces a fully qualified function name to the package name
-// There really ought to be to be a better way...
-func getPackageName(f string) string {
-	for {
-		lastPeriod := strings.LastIndex(f, ".")
-		lastSlash := strings.LastIndex(f, "/")
-		if lastPeriod > lastSlash {
-			f = f[:lastPeriod]
-		} else {
-			break
-		}
-	}
-
-	return f
-}
-
-// getCaller retrieves the name of the first non-logrus calling function
-func getCaller() *runtime.Frame {
-	// cache this package's fully-qualified name
-	callerInitOnce.Do(func() {
-		pcs := make([]uintptr, maximumCallerDepth)
-		_ = runtime.Callers(0, pcs)
-
-		// dynamic get the package name and the minimum caller depth
-		for i := 0; i < maximumCallerDepth; i++ {
-			funcName := runtime.FuncForPC(pcs[i]).Name()
-			if strings.Contains(funcName, "getCaller") {
-				logrusPackage = getPackageName(funcName)
-				break
-			}
-		}
-
-		minimumCallerDepth = knownLogrusFrames
-	})
-
-	// Restrict the lookback frames to avoid runaway lookups
-	pcs := make([]uintptr, maximumCallerDepth)
-	depth := runtime.Callers(minimumCallerDepth, pcs)
-	frames := runtime.CallersFrames(pcs[:depth])
-
-	for f, again := frames.Next(); again; f, again = frames.Next() {
-		pkg := getPackageName(f.Function)
-
-		// If the caller isn't part of this package, we're done
-		if pkg != logrusPackage {
-			return &f //nolint:scopelint
-		}
-	}
-
-	// if we got here, we failed to find the caller's context
-	return nil
-}
-
-func (entry Entry) HasCaller() (has bool) {
-	return entry.Logger != nil &&
-		entry.Logger.ReportCaller &&
-		entry.Caller != nil
-}
-
-func (entry *Entry) log(level Level, msg string) {
-	var buffer *bytes.Buffer
-
-	newEntry := entry.Dup()
-
-	if newEntry.Time.IsZero() {
-		newEntry.Time = time.Now()
-	}
-
-	newEntry.Level = level
-	newEntry.Message = msg
-
-	newEntry.Logger.mu.Lock()
-	reportCaller := newEntry.Logger.ReportCaller
-	bufPool := newEntry.getBufferPool()
-	newEntry.Logger.mu.Unlock()
-
-	if reportCaller {
-		newEntry.Caller = getCaller()
-	}
-
-	newEntry.fireHooks()
-	buffer = bufPool.Get()
-	defer func() {
-		newEntry.Buffer = nil
-		buffer.Reset()
-		bufPool.Put(buffer)
-	}()
-	buffer.Reset()
-	newEntry.Buffer = buffer
-
-	newEntry.write()
-
-	newEntry.Buffer = nil
-
-	// To avoid Entry#log() returning a value that only would make sense for
-	// panic() to use in Entry#Panic(), we avoid the allocation by checking
-	// directly here.
-	if level <= PanicLevel {
-		panic(newEntry)
-	}
-}
-
-func (entry *Entry) getBufferPool() (pool BufferPool) {
-	if entry.Logger.BufferPool != nil {
-		return entry.Logger.BufferPool
-	}
-	return bufferPool
-}
-
-func (entry *Entry) fireHooks() {
-	var tmpHooks LevelHooks
-	entry.Logger.mu.Lock()
-	tmpHooks = make(LevelHooks, len(entry.Logger.Hooks))
-	for k, v := range entry.Logger.Hooks {
-		tmpHooks[k] = v
-	}
-	entry.Logger.mu.Unlock()
-
-	err := tmpHooks.Fire(entry.Level, entry)
-	if err != nil {
-		fmt.Fprintf(os.Stderr, "Failed to fire hook: %v\n", err)
-	}
-}
-
-func (entry *Entry) write() {
-	entry.Logger.mu.Lock()
-	defer entry.Logger.mu.Unlock()
-	serialized, err := entry.Logger.Formatter.Format(entry)
-	if err != nil {
-		fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err)
-		return
-	}
-	if _, err := entry.Logger.Out.Write(serialized); err != nil {
-		fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err)
-	}
-}
-
-// Log will log a message at the level given as parameter.
-// Warning: using Log at Panic or Fatal level will not respectively Panic nor Exit.
-// For this behaviour Entry.Panic or Entry.Fatal should be used instead.
-func (entry *Entry) Log(level Level, args ...interface{}) {
-	if entry.Logger.IsLevelEnabled(level) {
-		entry.log(level, fmt.Sprint(args...))
-	}
-}
-
-func (entry *Entry) Trace(args ...interface{}) {
-	entry.Log(TraceLevel, args...)
-}
-
-func (entry *Entry) Debug(args ...interface{}) {
-	entry.Log(DebugLevel, args...)
-}
-
-func (entry *Entry) Print(args ...interface{}) {
-	entry.Info(args...)
-}
-
-func (entry *Entry) Info(args ...interface{}) {
-	entry.Log(InfoLevel, args...)
-}
-
-func (entry *Entry) Warn(args ...interface{}) {
-	entry.Log(WarnLevel, args...)
-}
-
-func (entry *Entry) Warning(args ...interface{}) {
-	entry.Warn(args...)
-}
-
-func (entry *Entry) Error(args ...interface{}) {
-	entry.Log(ErrorLevel, args...)
-}
-
-func (entry *Entry) Fatal(args ...interface{}) {
-	entry.Log(FatalLevel, args...)
-	entry.Logger.Exit(1)
-}
-
-func (entry *Entry) Panic(args ...interface{}) {
-	entry.Log(PanicLevel, args...)
-}
-
-// Entry Printf family functions
-
-func (entry *Entry) Logf(level Level, format string, args ...interface{}) {
-	if entry.Logger.IsLevelEnabled(level) {
-		entry.Log(level, fmt.Sprintf(format, args...))
-	}
-}
-
-func (entry *Entry) Tracef(format string, args ...interface{}) {
-	entry.Logf(TraceLevel, format, args...)
-}
-
-func (entry *Entry) Debugf(format string, args ...interface{}) {
-	entry.Logf(DebugLevel, format, args...)
-}
-
-func (entry *Entry) Infof(format string, args ...interface{}) {
-	entry.Logf(InfoLevel, format, args...)
-}
-
-func (entry *Entry) Printf(format string, args ...interface{}) {
-	entry.Infof(format, args...)
-}
-
-func (entry *Entry) Warnf(format string, args ...interface{}) {
-	entry.Logf(WarnLevel, format, args...)
-}
-
-func (entry *Entry) Warningf(format string, args ...interface{}) {
-	entry.Warnf(format, args...)
-}
-
-func (entry *Entry) Errorf(format string, args ...interface{}) {
-	entry.Logf(ErrorLevel, format, args...)
-}
-
-func (entry *Entry) Fatalf(format string, args ...interface{}) {
-	entry.Logf(FatalLevel, format, args...)
-	entry.Logger.Exit(1)
-}
-
-func (entry *Entry) Panicf(format string, args ...interface{}) {
-	entry.Logf(PanicLevel, format, args...)
-}
-
-// Entry Println family functions
-
-func (entry *Entry) Logln(level Level, args ...interface{}) {
-	if entry.Logger.IsLevelEnabled(level) {
-		entry.Log(level, entry.sprintlnn(args...))
-	}
-}
-
-func (entry *Entry) Traceln(args ...interface{}) {
-	entry.Logln(TraceLevel, args...)
-}
-
-func (entry *Entry) Debugln(args ...interface{}) {
-	entry.Logln(DebugLevel, args...)
-}
-
-func (entry *Entry) Infoln(args ...interface{}) {
-	entry.Logln(InfoLevel, args...)
-}
-
-func (entry *Entry) Println(args ...interface{}) {
-	entry.Infoln(args...)
-}
-
-func (entry *Entry) Warnln(args ...interface{}) {
-	entry.Logln(WarnLevel, args...)
-}
-
-func (entry *Entry) Warningln(args ...interface{}) {
-	entry.Warnln(args...)
-}
-
-func (entry *Entry) Errorln(args ...interface{}) {
-	entry.Logln(ErrorLevel, args...)
-}
-
-func (entry *Entry) Fatalln(args ...interface{}) {
-	entry.Logln(FatalLevel, args...)
-	entry.Logger.Exit(1)
-}
-
-func (entry *Entry) Panicln(args ...interface{}) {
-	entry.Logln(PanicLevel, args...)
-}
-
-// Sprintlnn => Sprint no newline. This is to get the behavior of how
-// fmt.Sprintln where spaces are always added between operands, regardless of
-// their type. Instead of vendoring the Sprintln implementation to spare a
-// string allocation, we do the simplest thing.
-func (entry *Entry) sprintlnn(args ...interface{}) string {
-	msg := fmt.Sprintln(args...)
-	return msg[:len(msg)-1]
-}

+ 0 - 270
vendor/github.com/sirupsen/logrus/exported.go

@@ -1,270 +0,0 @@
-package logrus
-
-import (
-	"context"
-	"io"
-	"time"
-)
-
-var (
-	// std is the name of the standard logger in stdlib `log`
-	std = New()
-)
-
-func StandardLogger() *Logger {
-	return std
-}
-
-// SetOutput sets the standard logger output.
-func SetOutput(out io.Writer) {
-	std.SetOutput(out)
-}
-
-// SetFormatter sets the standard logger formatter.
-func SetFormatter(formatter Formatter) {
-	std.SetFormatter(formatter)
-}
-
-// SetReportCaller sets whether the standard logger will include the calling
-// method as a field.
-func SetReportCaller(include bool) {
-	std.SetReportCaller(include)
-}
-
-// SetLevel sets the standard logger level.
-func SetLevel(level Level) {
-	std.SetLevel(level)
-}
-
-// GetLevel returns the standard logger level.
-func GetLevel() Level {
-	return std.GetLevel()
-}
-
-// IsLevelEnabled checks if the log level of the standard logger is greater than the level param
-func IsLevelEnabled(level Level) bool {
-	return std.IsLevelEnabled(level)
-}
-
-// AddHook adds a hook to the standard logger hooks.
-func AddHook(hook Hook) {
-	std.AddHook(hook)
-}
-
-// WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key.
-func WithError(err error) *Entry {
-	return std.WithField(ErrorKey, err)
-}
-
-// WithContext creates an entry from the standard logger and adds a context to it.
-func WithContext(ctx context.Context) *Entry {
-	return std.WithContext(ctx)
-}
-
-// WithField creates an entry from the standard logger and adds a field to
-// it. If you want multiple fields, use `WithFields`.
-//
-// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal
-// or Panic on the Entry it returns.
-func WithField(key string, value interface{}) *Entry {
-	return std.WithField(key, value)
-}
-
-// WithFields creates an entry from the standard logger and adds multiple
-// fields to it. This is simply a helper for `WithField`, invoking it
-// once for each field.
-//
-// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal
-// or Panic on the Entry it returns.
-func WithFields(fields Fields) *Entry {
-	return std.WithFields(fields)
-}
-
-// WithTime creates an entry from the standard logger and overrides the time of
-// logs generated with it.
-//
-// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal
-// or Panic on the Entry it returns.
-func WithTime(t time.Time) *Entry {
-	return std.WithTime(t)
-}
-
-// Trace logs a message at level Trace on the standard logger.
-func Trace(args ...interface{}) {
-	std.Trace(args...)
-}
-
-// Debug logs a message at level Debug on the standard logger.
-func Debug(args ...interface{}) {
-	std.Debug(args...)
-}
-
-// Print logs a message at level Info on the standard logger.
-func Print(args ...interface{}) {
-	std.Print(args...)
-}
-
-// Info logs a message at level Info on the standard logger.
-func Info(args ...interface{}) {
-	std.Info(args...)
-}
-
-// Warn logs a message at level Warn on the standard logger.
-func Warn(args ...interface{}) {
-	std.Warn(args...)
-}
-
-// Warning logs a message at level Warn on the standard logger.
-func Warning(args ...interface{}) {
-	std.Warning(args...)
-}
-
-// Error logs a message at level Error on the standard logger.
-func Error(args ...interface{}) {
-	std.Error(args...)
-}
-
-// Panic logs a message at level Panic on the standard logger.
-func Panic(args ...interface{}) {
-	std.Panic(args...)
-}
-
-// Fatal logs a message at level Fatal on the standard logger then the process will exit with status set to 1.
-func Fatal(args ...interface{}) {
-	std.Fatal(args...)
-}
-
-// TraceFn logs a message from a func at level Trace on the standard logger.
-func TraceFn(fn LogFunction) {
-	std.TraceFn(fn)
-}
-
-// DebugFn logs a message from a func at level Debug on the standard logger.
-func DebugFn(fn LogFunction) {
-	std.DebugFn(fn)
-}
-
-// PrintFn logs a message from a func at level Info on the standard logger.
-func PrintFn(fn LogFunction) {
-	std.PrintFn(fn)
-}
-
-// InfoFn logs a message from a func at level Info on the standard logger.
-func InfoFn(fn LogFunction) {
-	std.InfoFn(fn)
-}
-
-// WarnFn logs a message from a func at level Warn on the standard logger.
-func WarnFn(fn LogFunction) {
-	std.WarnFn(fn)
-}
-
-// WarningFn logs a message from a func at level Warn on the standard logger.
-func WarningFn(fn LogFunction) {
-	std.WarningFn(fn)
-}
-
-// ErrorFn logs a message from a func at level Error on the standard logger.
-func ErrorFn(fn LogFunction) {
-	std.ErrorFn(fn)
-}
-
-// PanicFn logs a message from a func at level Panic on the standard logger.
-func PanicFn(fn LogFunction) {
-	std.PanicFn(fn)
-}
-
-// FatalFn logs a message from a func at level Fatal on the standard logger then the process will exit with status set to 1.
-func FatalFn(fn LogFunction) {
-	std.FatalFn(fn)
-}
-
-// Tracef logs a message at level Trace on the standard logger.
-func Tracef(format string, args ...interface{}) {
-	std.Tracef(format, args...)
-}
-
-// Debugf logs a message at level Debug on the standard logger.
-func Debugf(format string, args ...interface{}) {
-	std.Debugf(format, args...)
-}
-
-// Printf logs a message at level Info on the standard logger.
-func Printf(format string, args ...interface{}) {
-	std.Printf(format, args...)
-}
-
-// Infof logs a message at level Info on the standard logger.
-func Infof(format string, args ...interface{}) {
-	std.Infof(format, args...)
-}
-
-// Warnf logs a message at level Warn on the standard logger.
-func Warnf(format string, args ...interface{}) {
-	std.Warnf(format, args...)
-}
-
-// Warningf logs a message at level Warn on the standard logger.
-func Warningf(format string, args ...interface{}) {
-	std.Warningf(format, args...)
-}
-
-// Errorf logs a message at level Error on the standard logger.
-func Errorf(format string, args ...interface{}) {
-	std.Errorf(format, args...)
-}
-
-// Panicf logs a message at level Panic on the standard logger.
-func Panicf(format string, args ...interface{}) {
-	std.Panicf(format, args...)
-}
-
-// Fatalf logs a message at level Fatal on the standard logger then the process will exit with status set to 1.
-func Fatalf(format string, args ...interface{}) {
-	std.Fatalf(format, args...)
-}
-
-// Traceln logs a message at level Trace on the standard logger.
-func Traceln(args ...interface{}) {
-	std.Traceln(args...)
-}
-
-// Debugln logs a message at level Debug on the standard logger.
-func Debugln(args ...interface{}) {
-	std.Debugln(args...)
-}
-
-// Println logs a message at level Info on the standard logger.
-func Println(args ...interface{}) {
-	std.Println(args...)
-}
-
-// Infoln logs a message at level Info on the standard logger.
-func Infoln(args ...interface{}) {
-	std.Infoln(args...)
-}
-
-// Warnln logs a message at level Warn on the standard logger.
-func Warnln(args ...interface{}) {
-	std.Warnln(args...)
-}
-
-// Warningln logs a message at level Warn on the standard logger.
-func Warningln(args ...interface{}) {
-	std.Warningln(args...)
-}
-
-// Errorln logs a message at level Error on the standard logger.
-func Errorln(args ...interface{}) {
-	std.Errorln(args...)
-}
-
-// Panicln logs a message at level Panic on the standard logger.
-func Panicln(args ...interface{}) {
-	std.Panicln(args...)
-}
-
-// Fatalln logs a message at level Fatal on the standard logger then the process will exit with status set to 1.
-func Fatalln(args ...interface{}) {
-	std.Fatalln(args...)
-}

+ 0 - 78
vendor/github.com/sirupsen/logrus/formatter.go

@@ -1,78 +0,0 @@
-package logrus
-
-import "time"
-
-// Default key names for the default fields
-const (
-	defaultTimestampFormat = time.RFC3339
-	FieldKeyMsg            = "msg"
-	FieldKeyLevel          = "level"
-	FieldKeyTime           = "time"
-	FieldKeyLogrusError    = "logrus_error"
-	FieldKeyFunc           = "func"
-	FieldKeyFile           = "file"
-)
-
-// The Formatter interface is used to implement a custom Formatter. It takes an
-// `Entry`. It exposes all the fields, including the default ones:
-//
-// * `entry.Data["msg"]`. The message passed from Info, Warn, Error ..
-// * `entry.Data["time"]`. The timestamp.
-// * `entry.Data["level"]. The level the entry was logged at.
-//
-// Any additional fields added with `WithField` or `WithFields` are also in
-// `entry.Data`. Format is expected to return an array of bytes which are then
-// logged to `logger.Out`.
-type Formatter interface {
-	Format(*Entry) ([]byte, error)
-}
-
-// This is to not silently overwrite `time`, `msg`, `func` and `level` fields when
-// dumping it. If this code wasn't there doing:
-//
-//  logrus.WithField("level", 1).Info("hello")
-//
-// Would just silently drop the user provided level. Instead with this code
-// it'll logged as:
-//
-//  {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."}
-//
-// It's not exported because it's still using Data in an opinionated way. It's to
-// avoid code duplication between the two default formatters.
-func prefixFieldClashes(data Fields, fieldMap FieldMap, reportCaller bool) {
-	timeKey := fieldMap.resolve(FieldKeyTime)
-	if t, ok := data[timeKey]; ok {
-		data["fields."+timeKey] = t
-		delete(data, timeKey)
-	}
-
-	msgKey := fieldMap.resolve(FieldKeyMsg)
-	if m, ok := data[msgKey]; ok {
-		data["fields."+msgKey] = m
-		delete(data, msgKey)
-	}
-
-	levelKey := fieldMap.resolve(FieldKeyLevel)
-	if l, ok := data[levelKey]; ok {
-		data["fields."+levelKey] = l
-		delete(data, levelKey)
-	}
-
-	logrusErrKey := fieldMap.resolve(FieldKeyLogrusError)
-	if l, ok := data[logrusErrKey]; ok {
-		data["fields."+logrusErrKey] = l
-		delete(data, logrusErrKey)
-	}
-
-	// If reportCaller is not set, 'func' will not conflict.
-	if reportCaller {
-		funcKey := fieldMap.resolve(FieldKeyFunc)
-		if l, ok := data[funcKey]; ok {
-			data["fields."+funcKey] = l
-		}
-		fileKey := fieldMap.resolve(FieldKeyFile)
-		if l, ok := data[fileKey]; ok {
-			data["fields."+fileKey] = l
-		}
-	}
-}

+ 0 - 34
vendor/github.com/sirupsen/logrus/hooks.go

@@ -1,34 +0,0 @@
-package logrus
-
-// A hook to be fired when logging on the logging levels returned from
-// `Levels()` on your implementation of the interface. Note that this is not
-// fired in a goroutine or a channel with workers, you should handle such
-// functionality yourself if your call is non-blocking and you don't wish for
-// the logging calls for levels returned from `Levels()` to block.
-type Hook interface {
-	Levels() []Level
-	Fire(*Entry) error
-}
-
-// Internal type for storing the hooks on a logger instance.
-type LevelHooks map[Level][]Hook
-
-// Add a hook to an instance of logger. This is called with
-// `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface.
-func (hooks LevelHooks) Add(hook Hook) {
-	for _, level := range hook.Levels() {
-		hooks[level] = append(hooks[level], hook)
-	}
-}
-
-// Fire all the hooks for the passed level. Used by `entry.log` to fire
-// appropriate hooks for a log entry.
-func (hooks LevelHooks) Fire(level Level, entry *Entry) error {
-	for _, hook := range hooks[level] {
-		if err := hook.Fire(entry); err != nil {
-			return err
-		}
-	}
-
-	return nil
-}

+ 0 - 128
vendor/github.com/sirupsen/logrus/json_formatter.go

@@ -1,128 +0,0 @@
-package logrus
-
-import (
-	"bytes"
-	"encoding/json"
-	"fmt"
-	"runtime"
-)
-
-type fieldKey string
-
-// FieldMap allows customization of the key names for default fields.
-type FieldMap map[fieldKey]string
-
-func (f FieldMap) resolve(key fieldKey) string {
-	if k, ok := f[key]; ok {
-		return k
-	}
-
-	return string(key)
-}
-
-// JSONFormatter formats logs into parsable json
-type JSONFormatter struct {
-	// TimestampFormat sets the format used for marshaling timestamps.
-	// The format to use is the same than for time.Format or time.Parse from the standard
-	// library.
-	// The standard Library already provides a set of predefined format.
-	TimestampFormat string
-
-	// DisableTimestamp allows disabling automatic timestamps in output
-	DisableTimestamp bool
-
-	// DisableHTMLEscape allows disabling html escaping in output
-	DisableHTMLEscape bool
-
-	// DataKey allows users to put all the log entry parameters into a nested dictionary at a given key.
-	DataKey string
-
-	// FieldMap allows users to customize the names of keys for default fields.
-	// As an example:
-	// formatter := &JSONFormatter{
-	//   	FieldMap: FieldMap{
-	// 		 FieldKeyTime:  "@timestamp",
-	// 		 FieldKeyLevel: "@level",
-	// 		 FieldKeyMsg:   "@message",
-	// 		 FieldKeyFunc:  "@caller",
-	//    },
-	// }
-	FieldMap FieldMap
-
-	// CallerPrettyfier can be set by the user to modify the content
-	// of the function and file keys in the json data when ReportCaller is
-	// activated. If any of the returned value is the empty string the
-	// corresponding key will be removed from json fields.
-	CallerPrettyfier func(*runtime.Frame) (function string, file string)
-
-	// PrettyPrint will indent all json logs
-	PrettyPrint bool
-}
-
-// Format renders a single log entry
-func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) {
-	data := make(Fields, len(entry.Data)+4)
-	for k, v := range entry.Data {
-		switch v := v.(type) {
-		case error:
-			// Otherwise errors are ignored by `encoding/json`
-			// https://github.com/sirupsen/logrus/issues/137
-			data[k] = v.Error()
-		default:
-			data[k] = v
-		}
-	}
-
-	if f.DataKey != "" {
-		newData := make(Fields, 4)
-		newData[f.DataKey] = data
-		data = newData
-	}
-
-	prefixFieldClashes(data, f.FieldMap, entry.HasCaller())
-
-	timestampFormat := f.TimestampFormat
-	if timestampFormat == "" {
-		timestampFormat = defaultTimestampFormat
-	}
-
-	if entry.err != "" {
-		data[f.FieldMap.resolve(FieldKeyLogrusError)] = entry.err
-	}
-	if !f.DisableTimestamp {
-		data[f.FieldMap.resolve(FieldKeyTime)] = entry.Time.Format(timestampFormat)
-	}
-	data[f.FieldMap.resolve(FieldKeyMsg)] = entry.Message
-	data[f.FieldMap.resolve(FieldKeyLevel)] = entry.Level.String()
-	if entry.HasCaller() {
-		funcVal := entry.Caller.Function
-		fileVal := fmt.Sprintf("%s:%d", entry.Caller.File, entry.Caller.Line)
-		if f.CallerPrettyfier != nil {
-			funcVal, fileVal = f.CallerPrettyfier(entry.Caller)
-		}
-		if funcVal != "" {
-			data[f.FieldMap.resolve(FieldKeyFunc)] = funcVal
-		}
-		if fileVal != "" {
-			data[f.FieldMap.resolve(FieldKeyFile)] = fileVal
-		}
-	}
-
-	var b *bytes.Buffer
-	if entry.Buffer != nil {
-		b = entry.Buffer
-	} else {
-		b = &bytes.Buffer{}
-	}
-
-	encoder := json.NewEncoder(b)
-	encoder.SetEscapeHTML(!f.DisableHTMLEscape)
-	if f.PrettyPrint {
-		encoder.SetIndent("", "  ")
-	}
-	if err := encoder.Encode(data); err != nil {
-		return nil, fmt.Errorf("failed to marshal fields to JSON, %w", err)
-	}
-
-	return b.Bytes(), nil
-}

+ 0 - 417
vendor/github.com/sirupsen/logrus/logger.go

@@ -1,417 +0,0 @@
-package logrus
-
-import (
-	"context"
-	"io"
-	"os"
-	"sync"
-	"sync/atomic"
-	"time"
-)
-
-// LogFunction For big messages, it can be more efficient to pass a function
-// and only call it if the log level is actually enables rather than
-// generating the log message and then checking if the level is enabled
-type LogFunction func() []interface{}
-
-type Logger struct {
-	// The logs are `io.Copy`'d to this in a mutex. It's common to set this to a
-	// file, or leave it default which is `os.Stderr`. You can also set this to
-	// something more adventurous, such as logging to Kafka.
-	Out io.Writer
-	// Hooks for the logger instance. These allow firing events based on logging
-	// levels and log entries. For example, to send errors to an error tracking
-	// service, log to StatsD or dump the core on fatal errors.
-	Hooks LevelHooks
-	// All log entries pass through the formatter before logged to Out. The
-	// included formatters are `TextFormatter` and `JSONFormatter` for which
-	// TextFormatter is the default. In development (when a TTY is attached) it
-	// logs with colors, but to a file it wouldn't. You can easily implement your
-	// own that implements the `Formatter` interface, see the `README` or included
-	// formatters for examples.
-	Formatter Formatter
-
-	// Flag for whether to log caller info (off by default)
-	ReportCaller bool
-
-	// The logging level the logger should log at. This is typically (and defaults
-	// to) `logrus.Info`, which allows Info(), Warn(), Error() and Fatal() to be
-	// logged.
-	Level Level
-	// Used to sync writing to the log. Locking is enabled by Default
-	mu MutexWrap
-	// Reusable empty entry
-	entryPool sync.Pool
-	// Function to exit the application, defaults to `os.Exit()`
-	ExitFunc exitFunc
-	// The buffer pool used to format the log. If it is nil, the default global
-	// buffer pool will be used.
-	BufferPool BufferPool
-}
-
-type exitFunc func(int)
-
-type MutexWrap struct {
-	lock     sync.Mutex
-	disabled bool
-}
-
-func (mw *MutexWrap) Lock() {
-	if !mw.disabled {
-		mw.lock.Lock()
-	}
-}
-
-func (mw *MutexWrap) Unlock() {
-	if !mw.disabled {
-		mw.lock.Unlock()
-	}
-}
-
-func (mw *MutexWrap) Disable() {
-	mw.disabled = true
-}
-
-// Creates a new logger. Configuration should be set by changing `Formatter`,
-// `Out` and `Hooks` directly on the default logger instance. You can also just
-// instantiate your own:
-//
-//    var log = &logrus.Logger{
-//      Out: os.Stderr,
-//      Formatter: new(logrus.TextFormatter),
-//      Hooks: make(logrus.LevelHooks),
-//      Level: logrus.DebugLevel,
-//    }
-//
-// It's recommended to make this a global instance called `log`.
-func New() *Logger {
-	return &Logger{
-		Out:          os.Stderr,
-		Formatter:    new(TextFormatter),
-		Hooks:        make(LevelHooks),
-		Level:        InfoLevel,
-		ExitFunc:     os.Exit,
-		ReportCaller: false,
-	}
-}
-
-func (logger *Logger) newEntry() *Entry {
-	entry, ok := logger.entryPool.Get().(*Entry)
-	if ok {
-		return entry
-	}
-	return NewEntry(logger)
-}
-
-func (logger *Logger) releaseEntry(entry *Entry) {
-	entry.Data = map[string]interface{}{}
-	logger.entryPool.Put(entry)
-}
-
-// WithField allocates a new entry and adds a field to it.
-// Debug, Print, Info, Warn, Error, Fatal or Panic must be then applied to
-// this new returned entry.
-// If you want multiple fields, use `WithFields`.
-func (logger *Logger) WithField(key string, value interface{}) *Entry {
-	entry := logger.newEntry()
-	defer logger.releaseEntry(entry)
-	return entry.WithField(key, value)
-}
-
-// Adds a struct of fields to the log entry. All it does is call `WithField` for
-// each `Field`.
-func (logger *Logger) WithFields(fields Fields) *Entry {
-	entry := logger.newEntry()
-	defer logger.releaseEntry(entry)
-	return entry.WithFields(fields)
-}
-
-// Add an error as single field to the log entry.  All it does is call
-// `WithError` for the given `error`.
-func (logger *Logger) WithError(err error) *Entry {
-	entry := logger.newEntry()
-	defer logger.releaseEntry(entry)
-	return entry.WithError(err)
-}
-
-// Add a context to the log entry.
-func (logger *Logger) WithContext(ctx context.Context) *Entry {
-	entry := logger.newEntry()
-	defer logger.releaseEntry(entry)
-	return entry.WithContext(ctx)
-}
-
-// Overrides the time of the log entry.
-func (logger *Logger) WithTime(t time.Time) *Entry {
-	entry := logger.newEntry()
-	defer logger.releaseEntry(entry)
-	return entry.WithTime(t)
-}
-
-func (logger *Logger) Logf(level Level, format string, args ...interface{}) {
-	if logger.IsLevelEnabled(level) {
-		entry := logger.newEntry()
-		entry.Logf(level, format, args...)
-		logger.releaseEntry(entry)
-	}
-}
-
-func (logger *Logger) Tracef(format string, args ...interface{}) {
-	logger.Logf(TraceLevel, format, args...)
-}
-
-func (logger *Logger) Debugf(format string, args ...interface{}) {
-	logger.Logf(DebugLevel, format, args...)
-}
-
-func (logger *Logger) Infof(format string, args ...interface{}) {
-	logger.Logf(InfoLevel, format, args...)
-}
-
-func (logger *Logger) Printf(format string, args ...interface{}) {
-	entry := logger.newEntry()
-	entry.Printf(format, args...)
-	logger.releaseEntry(entry)
-}
-
-func (logger *Logger) Warnf(format string, args ...interface{}) {
-	logger.Logf(WarnLevel, format, args...)
-}
-
-func (logger *Logger) Warningf(format string, args ...interface{}) {
-	logger.Warnf(format, args...)
-}
-
-func (logger *Logger) Errorf(format string, args ...interface{}) {
-	logger.Logf(ErrorLevel, format, args...)
-}
-
-func (logger *Logger) Fatalf(format string, args ...interface{}) {
-	logger.Logf(FatalLevel, format, args...)
-	logger.Exit(1)
-}
-
-func (logger *Logger) Panicf(format string, args ...interface{}) {
-	logger.Logf(PanicLevel, format, args...)
-}
-
-// Log will log a message at the level given as parameter.
-// Warning: using Log at Panic or Fatal level will not respectively Panic nor Exit.
-// For this behaviour Logger.Panic or Logger.Fatal should be used instead.
-func (logger *Logger) Log(level Level, args ...interface{}) {
-	if logger.IsLevelEnabled(level) {
-		entry := logger.newEntry()
-		entry.Log(level, args...)
-		logger.releaseEntry(entry)
-	}
-}
-
-func (logger *Logger) LogFn(level Level, fn LogFunction) {
-	if logger.IsLevelEnabled(level) {
-		entry := logger.newEntry()
-		entry.Log(level, fn()...)
-		logger.releaseEntry(entry)
-	}
-}
-
-func (logger *Logger) Trace(args ...interface{}) {
-	logger.Log(TraceLevel, args...)
-}
-
-func (logger *Logger) Debug(args ...interface{}) {
-	logger.Log(DebugLevel, args...)
-}
-
-func (logger *Logger) Info(args ...interface{}) {
-	logger.Log(InfoLevel, args...)
-}
-
-func (logger *Logger) Print(args ...interface{}) {
-	entry := logger.newEntry()
-	entry.Print(args...)
-	logger.releaseEntry(entry)
-}
-
-func (logger *Logger) Warn(args ...interface{}) {
-	logger.Log(WarnLevel, args...)
-}
-
-func (logger *Logger) Warning(args ...interface{}) {
-	logger.Warn(args...)
-}
-
-func (logger *Logger) Error(args ...interface{}) {
-	logger.Log(ErrorLevel, args...)
-}
-
-func (logger *Logger) Fatal(args ...interface{}) {
-	logger.Log(FatalLevel, args...)
-	logger.Exit(1)
-}
-
-func (logger *Logger) Panic(args ...interface{}) {
-	logger.Log(PanicLevel, args...)
-}
-
-func (logger *Logger) TraceFn(fn LogFunction) {
-	logger.LogFn(TraceLevel, fn)
-}
-
-func (logger *Logger) DebugFn(fn LogFunction) {
-	logger.LogFn(DebugLevel, fn)
-}
-
-func (logger *Logger) InfoFn(fn LogFunction) {
-	logger.LogFn(InfoLevel, fn)
-}
-
-func (logger *Logger) PrintFn(fn LogFunction) {
-	entry := logger.newEntry()
-	entry.Print(fn()...)
-	logger.releaseEntry(entry)
-}
-
-func (logger *Logger) WarnFn(fn LogFunction) {
-	logger.LogFn(WarnLevel, fn)
-}
-
-func (logger *Logger) WarningFn(fn LogFunction) {
-	logger.WarnFn(fn)
-}
-
-func (logger *Logger) ErrorFn(fn LogFunction) {
-	logger.LogFn(ErrorLevel, fn)
-}
-
-func (logger *Logger) FatalFn(fn LogFunction) {
-	logger.LogFn(FatalLevel, fn)
-	logger.Exit(1)
-}
-
-func (logger *Logger) PanicFn(fn LogFunction) {
-	logger.LogFn(PanicLevel, fn)
-}
-
-func (logger *Logger) Logln(level Level, args ...interface{}) {
-	if logger.IsLevelEnabled(level) {
-		entry := logger.newEntry()
-		entry.Logln(level, args...)
-		logger.releaseEntry(entry)
-	}
-}
-
-func (logger *Logger) Traceln(args ...interface{}) {
-	logger.Logln(TraceLevel, args...)
-}
-
-func (logger *Logger) Debugln(args ...interface{}) {
-	logger.Logln(DebugLevel, args...)
-}
-
-func (logger *Logger) Infoln(args ...interface{}) {
-	logger.Logln(InfoLevel, args...)
-}
-
-func (logger *Logger) Println(args ...interface{}) {
-	entry := logger.newEntry()
-	entry.Println(args...)
-	logger.releaseEntry(entry)
-}
-
-func (logger *Logger) Warnln(args ...interface{}) {
-	logger.Logln(WarnLevel, args...)
-}
-
-func (logger *Logger) Warningln(args ...interface{}) {
-	logger.Warnln(args...)
-}
-
-func (logger *Logger) Errorln(args ...interface{}) {
-	logger.Logln(ErrorLevel, args...)
-}
-
-func (logger *Logger) Fatalln(args ...interface{}) {
-	logger.Logln(FatalLevel, args...)
-	logger.Exit(1)
-}
-
-func (logger *Logger) Panicln(args ...interface{}) {
-	logger.Logln(PanicLevel, args...)
-}
-
-func (logger *Logger) Exit(code int) {
-	runHandlers()
-	if logger.ExitFunc == nil {
-		logger.ExitFunc = os.Exit
-	}
-	logger.ExitFunc(code)
-}
-
-//When file is opened with appending mode, it's safe to
-//write concurrently to a file (within 4k message on Linux).
-//In these cases user can choose to disable the lock.
-func (logger *Logger) SetNoLock() {
-	logger.mu.Disable()
-}
-
-func (logger *Logger) level() Level {
-	return Level(atomic.LoadUint32((*uint32)(&logger.Level)))
-}
-
-// SetLevel sets the logger level.
-func (logger *Logger) SetLevel(level Level) {
-	atomic.StoreUint32((*uint32)(&logger.Level), uint32(level))
-}
-
-// GetLevel returns the logger level.
-func (logger *Logger) GetLevel() Level {
-	return logger.level()
-}
-
-// AddHook adds a hook to the logger hooks.
-func (logger *Logger) AddHook(hook Hook) {
-	logger.mu.Lock()
-	defer logger.mu.Unlock()
-	logger.Hooks.Add(hook)
-}
-
-// IsLevelEnabled checks if the log level of the logger is greater than the level param
-func (logger *Logger) IsLevelEnabled(level Level) bool {
-	return logger.level() >= level
-}
-
-// SetFormatter sets the logger formatter.
-func (logger *Logger) SetFormatter(formatter Formatter) {
-	logger.mu.Lock()
-	defer logger.mu.Unlock()
-	logger.Formatter = formatter
-}
-
-// SetOutput sets the logger output.
-func (logger *Logger) SetOutput(output io.Writer) {
-	logger.mu.Lock()
-	defer logger.mu.Unlock()
-	logger.Out = output
-}
-
-func (logger *Logger) SetReportCaller(reportCaller bool) {
-	logger.mu.Lock()
-	defer logger.mu.Unlock()
-	logger.ReportCaller = reportCaller
-}
-
-// ReplaceHooks replaces the logger hooks and returns the old ones
-func (logger *Logger) ReplaceHooks(hooks LevelHooks) LevelHooks {
-	logger.mu.Lock()
-	oldHooks := logger.Hooks
-	logger.Hooks = hooks
-	logger.mu.Unlock()
-	return oldHooks
-}
-
-// SetBufferPool sets the logger buffer pool.
-func (logger *Logger) SetBufferPool(pool BufferPool) {
-	logger.mu.Lock()
-	defer logger.mu.Unlock()
-	logger.BufferPool = pool
-}

+ 0 - 186
vendor/github.com/sirupsen/logrus/logrus.go

@@ -1,186 +0,0 @@
-package logrus
-
-import (
-	"fmt"
-	"log"
-	"strings"
-)
-
-// Fields type, used to pass to `WithFields`.
-type Fields map[string]interface{}
-
-// Level type
-type Level uint32
-
-// Convert the Level to a string. E.g. PanicLevel becomes "panic".
-func (level Level) String() string {
-	if b, err := level.MarshalText(); err == nil {
-		return string(b)
-	} else {
-		return "unknown"
-	}
-}
-
-// ParseLevel takes a string level and returns the Logrus log level constant.
-func ParseLevel(lvl string) (Level, error) {
-	switch strings.ToLower(lvl) {
-	case "panic":
-		return PanicLevel, nil
-	case "fatal":
-		return FatalLevel, nil
-	case "error":
-		return ErrorLevel, nil
-	case "warn", "warning":
-		return WarnLevel, nil
-	case "info":
-		return InfoLevel, nil
-	case "debug":
-		return DebugLevel, nil
-	case "trace":
-		return TraceLevel, nil
-	}
-
-	var l Level
-	return l, fmt.Errorf("not a valid logrus Level: %q", lvl)
-}
-
-// UnmarshalText implements encoding.TextUnmarshaler.
-func (level *Level) UnmarshalText(text []byte) error {
-	l, err := ParseLevel(string(text))
-	if err != nil {
-		return err
-	}
-
-	*level = l
-
-	return nil
-}
-
-func (level Level) MarshalText() ([]byte, error) {
-	switch level {
-	case TraceLevel:
-		return []byte("trace"), nil
-	case DebugLevel:
-		return []byte("debug"), nil
-	case InfoLevel:
-		return []byte("info"), nil
-	case WarnLevel:
-		return []byte("warning"), nil
-	case ErrorLevel:
-		return []byte("error"), nil
-	case FatalLevel:
-		return []byte("fatal"), nil
-	case PanicLevel:
-		return []byte("panic"), nil
-	}
-
-	return nil, fmt.Errorf("not a valid logrus level %d", level)
-}
-
-// A constant exposing all logging levels
-var AllLevels = []Level{
-	PanicLevel,
-	FatalLevel,
-	ErrorLevel,
-	WarnLevel,
-	InfoLevel,
-	DebugLevel,
-	TraceLevel,
-}
-
-// These are the different logging levels. You can set the logging level to log
-// on your instance of logger, obtained with `logrus.New()`.
-const (
-	// PanicLevel level, highest level of severity. Logs and then calls panic with the
-	// message passed to Debug, Info, ...
-	PanicLevel Level = iota
-	// FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the
-	// logging level is set to Panic.
-	FatalLevel
-	// ErrorLevel level. Logs. Used for errors that should definitely be noted.
-	// Commonly used for hooks to send errors to an error tracking service.
-	ErrorLevel
-	// WarnLevel level. Non-critical entries that deserve eyes.
-	WarnLevel
-	// InfoLevel level. General operational entries about what's going on inside the
-	// application.
-	InfoLevel
-	// DebugLevel level. Usually only enabled when debugging. Very verbose logging.
-	DebugLevel
-	// TraceLevel level. Designates finer-grained informational events than the Debug.
-	TraceLevel
-)
-
-// Won't compile if StdLogger can't be realized by a log.Logger
-var (
-	_ StdLogger = &log.Logger{}
-	_ StdLogger = &Entry{}
-	_ StdLogger = &Logger{}
-)
-
-// StdLogger is what your logrus-enabled library should take, that way
-// it'll accept a stdlib logger and a logrus logger. There's no standard
-// interface, this is the closest we get, unfortunately.
-type StdLogger interface {
-	Print(...interface{})
-	Printf(string, ...interface{})
-	Println(...interface{})
-
-	Fatal(...interface{})
-	Fatalf(string, ...interface{})
-	Fatalln(...interface{})
-
-	Panic(...interface{})
-	Panicf(string, ...interface{})
-	Panicln(...interface{})
-}
-
-// The FieldLogger interface generalizes the Entry and Logger types
-type FieldLogger interface {
-	WithField(key string, value interface{}) *Entry
-	WithFields(fields Fields) *Entry
-	WithError(err error) *Entry
-
-	Debugf(format string, args ...interface{})
-	Infof(format string, args ...interface{})
-	Printf(format string, args ...interface{})
-	Warnf(format string, args ...interface{})
-	Warningf(format string, args ...interface{})
-	Errorf(format string, args ...interface{})
-	Fatalf(format string, args ...interface{})
-	Panicf(format string, args ...interface{})
-
-	Debug(args ...interface{})
-	Info(args ...interface{})
-	Print(args ...interface{})
-	Warn(args ...interface{})
-	Warning(args ...interface{})
-	Error(args ...interface{})
-	Fatal(args ...interface{})
-	Panic(args ...interface{})
-
-	Debugln(args ...interface{})
-	Infoln(args ...interface{})
-	Println(args ...interface{})
-	Warnln(args ...interface{})
-	Warningln(args ...interface{})
-	Errorln(args ...interface{})
-	Fatalln(args ...interface{})
-	Panicln(args ...interface{})
-
-	// IsDebugEnabled() bool
-	// IsInfoEnabled() bool
-	// IsWarnEnabled() bool
-	// IsErrorEnabled() bool
-	// IsFatalEnabled() bool
-	// IsPanicEnabled() bool
-}
-
-// Ext1FieldLogger (the first extension to FieldLogger) is superfluous, it is
-// here for consistancy. Do not use. Use Logger or Entry instead.
-type Ext1FieldLogger interface {
-	FieldLogger
-	Tracef(format string, args ...interface{})
-	Trace(args ...interface{})
-	Traceln(args ...interface{})
-}

+ 0 - 11
vendor/github.com/sirupsen/logrus/terminal_check_appengine.go

@@ -1,11 +0,0 @@
-// +build appengine
-
-package logrus
-
-import (
-	"io"
-)
-
-func checkIfTerminal(w io.Writer) bool {
-	return true
-}

+ 0 - 13
vendor/github.com/sirupsen/logrus/terminal_check_bsd.go

@@ -1,13 +0,0 @@
-// +build darwin dragonfly freebsd netbsd openbsd
-// +build !js
-
-package logrus
-
-import "golang.org/x/sys/unix"
-
-const ioctlReadTermios = unix.TIOCGETA
-
-func isTerminal(fd int) bool {
-	_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
-	return err == nil
-}

+ 0 - 7
vendor/github.com/sirupsen/logrus/terminal_check_js.go

@@ -1,7 +0,0 @@
-// +build js
-
-package logrus
-
-func isTerminal(fd int) bool {
-	return false
-}

+ 0 - 11
vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go

@@ -1,11 +0,0 @@
-// +build js nacl plan9
-
-package logrus
-
-import (
-	"io"
-)
-
-func checkIfTerminal(w io.Writer) bool {
-	return false
-}

+ 0 - 17
vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go

@@ -1,17 +0,0 @@
-// +build !appengine,!js,!windows,!nacl,!plan9
-
-package logrus
-
-import (
-	"io"
-	"os"
-)
-
-func checkIfTerminal(w io.Writer) bool {
-	switch v := w.(type) {
-	case *os.File:
-		return isTerminal(int(v.Fd()))
-	default:
-		return false
-	}
-}

+ 0 - 11
vendor/github.com/sirupsen/logrus/terminal_check_solaris.go

@@ -1,11 +0,0 @@
-package logrus
-
-import (
-	"golang.org/x/sys/unix"
-)
-
-// IsTerminal returns true if the given file descriptor is a terminal.
-func isTerminal(fd int) bool {
-	_, err := unix.IoctlGetTermio(fd, unix.TCGETA)
-	return err == nil
-}

+ 0 - 13
vendor/github.com/sirupsen/logrus/terminal_check_unix.go

@@ -1,13 +0,0 @@
-// +build linux aix zos
-// +build !js
-
-package logrus
-
-import "golang.org/x/sys/unix"
-
-const ioctlReadTermios = unix.TCGETS
-
-func isTerminal(fd int) bool {
-	_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
-	return err == nil
-}

+ 0 - 27
vendor/github.com/sirupsen/logrus/terminal_check_windows.go

@@ -1,27 +0,0 @@
-// +build !appengine,!js,windows
-
-package logrus
-
-import (
-	"io"
-	"os"
-
-	"golang.org/x/sys/windows"
-)
-
-func checkIfTerminal(w io.Writer) bool {
-	switch v := w.(type) {
-	case *os.File:
-		handle := windows.Handle(v.Fd())
-		var mode uint32
-		if err := windows.GetConsoleMode(handle, &mode); err != nil {
-			return false
-		}
-		mode |= windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING
-		if err := windows.SetConsoleMode(handle, mode); err != nil {
-			return false
-		}
-		return true
-	}
-	return false
-}

+ 0 - 339
vendor/github.com/sirupsen/logrus/text_formatter.go

@@ -1,339 +0,0 @@
-package logrus
-
-import (
-	"bytes"
-	"fmt"
-	"os"
-	"runtime"
-	"sort"
-	"strconv"
-	"strings"
-	"sync"
-	"time"
-	"unicode/utf8"
-)
-
-const (
-	red    = 31
-	yellow = 33
-	blue   = 36
-	gray   = 37
-)
-
-var baseTimestamp time.Time
-
-func init() {
-	baseTimestamp = time.Now()
-}
-
-// TextFormatter formats logs into text
-type TextFormatter struct {
-	// Set to true to bypass checking for a TTY before outputting colors.
-	ForceColors bool
-
-	// Force disabling colors.
-	DisableColors bool
-
-	// Force quoting of all values
-	ForceQuote bool
-
-	// DisableQuote disables quoting for all values.
-	// DisableQuote will have a lower priority than ForceQuote.
-	// If both of them are set to true, quote will be forced on all values.
-	DisableQuote bool
-
-	// Override coloring based on CLICOLOR and CLICOLOR_FORCE. - https://bixense.com/clicolors/
-	EnvironmentOverrideColors bool
-
-	// Disable timestamp logging. useful when output is redirected to logging
-	// system that already adds timestamps.
-	DisableTimestamp bool
-
-	// Enable logging the full timestamp when a TTY is attached instead of just
-	// the time passed since beginning of execution.
-	FullTimestamp bool
-
-	// TimestampFormat to use for display when a full timestamp is printed.
-	// The format to use is the same than for time.Format or time.Parse from the standard
-	// library.
-	// The standard Library already provides a set of predefined format.
-	TimestampFormat string
-
-	// The fields are sorted by default for a consistent output. For applications
-	// that log extremely frequently and don't use the JSON formatter this may not
-	// be desired.
-	DisableSorting bool
-
-	// The keys sorting function, when uninitialized it uses sort.Strings.
-	SortingFunc func([]string)
-
-	// Disables the truncation of the level text to 4 characters.
-	DisableLevelTruncation bool
-
-	// PadLevelText Adds padding the level text so that all the levels output at the same length
-	// PadLevelText is a superset of the DisableLevelTruncation option
-	PadLevelText bool
-
-	// QuoteEmptyFields will wrap empty fields in quotes if true
-	QuoteEmptyFields bool
-
-	// Whether the logger's out is to a terminal
-	isTerminal bool
-
-	// FieldMap allows users to customize the names of keys for default fields.
-	// As an example:
-	// formatter := &TextFormatter{
-	//     FieldMap: FieldMap{
-	//         FieldKeyTime:  "@timestamp",
-	//         FieldKeyLevel: "@level",
-	//         FieldKeyMsg:   "@message"}}
-	FieldMap FieldMap
-
-	// CallerPrettyfier can be set by the user to modify the content
-	// of the function and file keys in the data when ReportCaller is
-	// activated. If any of the returned value is the empty string the
-	// corresponding key will be removed from fields.
-	CallerPrettyfier func(*runtime.Frame) (function string, file string)
-
-	terminalInitOnce sync.Once
-
-	// The max length of the level text, generated dynamically on init
-	levelTextMaxLength int
-}
-
-func (f *TextFormatter) init(entry *Entry) {
-	if entry.Logger != nil {
-		f.isTerminal = checkIfTerminal(entry.Logger.Out)
-	}
-	// Get the max length of the level text
-	for _, level := range AllLevels {
-		levelTextLength := utf8.RuneCount([]byte(level.String()))
-		if levelTextLength > f.levelTextMaxLength {
-			f.levelTextMaxLength = levelTextLength
-		}
-	}
-}
-
-func (f *TextFormatter) isColored() bool {
-	isColored := f.ForceColors || (f.isTerminal && (runtime.GOOS != "windows"))
-
-	if f.EnvironmentOverrideColors {
-		switch force, ok := os.LookupEnv("CLICOLOR_FORCE"); {
-		case ok && force != "0":
-			isColored = true
-		case ok && force == "0", os.Getenv("CLICOLOR") == "0":
-			isColored = false
-		}
-	}
-
-	return isColored && !f.DisableColors
-}
-
-// Format renders a single log entry
-func (f *TextFormatter) Format(entry *Entry) ([]byte, error) {
-	data := make(Fields)
-	for k, v := range entry.Data {
-		data[k] = v
-	}
-	prefixFieldClashes(data, f.FieldMap, entry.HasCaller())
-	keys := make([]string, 0, len(data))
-	for k := range data {
-		keys = append(keys, k)
-	}
-
-	var funcVal, fileVal string
-
-	fixedKeys := make([]string, 0, 4+len(data))
-	if !f.DisableTimestamp {
-		fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyTime))
-	}
-	fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyLevel))
-	if entry.Message != "" {
-		fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyMsg))
-	}
-	if entry.err != "" {
-		fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyLogrusError))
-	}
-	if entry.HasCaller() {
-		if f.CallerPrettyfier != nil {
-			funcVal, fileVal = f.CallerPrettyfier(entry.Caller)
-		} else {
-			funcVal = entry.Caller.Function
-			fileVal = fmt.Sprintf("%s:%d", entry.Caller.File, entry.Caller.Line)
-		}
-
-		if funcVal != "" {
-			fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyFunc))
-		}
-		if fileVal != "" {
-			fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyFile))
-		}
-	}
-
-	if !f.DisableSorting {
-		if f.SortingFunc == nil {
-			sort.Strings(keys)
-			fixedKeys = append(fixedKeys, keys...)
-		} else {
-			if !f.isColored() {
-				fixedKeys = append(fixedKeys, keys...)
-				f.SortingFunc(fixedKeys)
-			} else {
-				f.SortingFunc(keys)
-			}
-		}
-	} else {
-		fixedKeys = append(fixedKeys, keys...)
-	}
-
-	var b *bytes.Buffer
-	if entry.Buffer != nil {
-		b = entry.Buffer
-	} else {
-		b = &bytes.Buffer{}
-	}
-
-	f.terminalInitOnce.Do(func() { f.init(entry) })
-
-	timestampFormat := f.TimestampFormat
-	if timestampFormat == "" {
-		timestampFormat = defaultTimestampFormat
-	}
-	if f.isColored() {
-		f.printColored(b, entry, keys, data, timestampFormat)
-	} else {
-
-		for _, key := range fixedKeys {
-			var value interface{}
-			switch {
-			case key == f.FieldMap.resolve(FieldKeyTime):
-				value = entry.Time.Format(timestampFormat)
-			case key == f.FieldMap.resolve(FieldKeyLevel):
-				value = entry.Level.String()
-			case key == f.FieldMap.resolve(FieldKeyMsg):
-				value = entry.Message
-			case key == f.FieldMap.resolve(FieldKeyLogrusError):
-				value = entry.err
-			case key == f.FieldMap.resolve(FieldKeyFunc) && entry.HasCaller():
-				value = funcVal
-			case key == f.FieldMap.resolve(FieldKeyFile) && entry.HasCaller():
-				value = fileVal
-			default:
-				value = data[key]
-			}
-			f.appendKeyValue(b, key, value)
-		}
-	}
-
-	b.WriteByte('\n')
-	return b.Bytes(), nil
-}
-
-func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []string, data Fields, timestampFormat string) {
-	var levelColor int
-	switch entry.Level {
-	case DebugLevel, TraceLevel:
-		levelColor = gray
-	case WarnLevel:
-		levelColor = yellow
-	case ErrorLevel, FatalLevel, PanicLevel:
-		levelColor = red
-	case InfoLevel:
-		levelColor = blue
-	default:
-		levelColor = blue
-	}
-
-	levelText := strings.ToUpper(entry.Level.String())
-	if !f.DisableLevelTruncation && !f.PadLevelText {
-		levelText = levelText[0:4]
-	}
-	if f.PadLevelText {
-		// Generates the format string used in the next line, for example "%-6s" or "%-7s".
-		// Based on the max level text length.
-		formatString := "%-" + strconv.Itoa(f.levelTextMaxLength) + "s"
-		// Formats the level text by appending spaces up to the max length, for example:
-		// 	- "INFO   "
-		//	- "WARNING"
-		levelText = fmt.Sprintf(formatString, levelText)
-	}
-
-	// Remove a single newline if it already exists in the message to keep
-	// the behavior of logrus text_formatter the same as the stdlib log package
-	entry.Message = strings.TrimSuffix(entry.Message, "\n")
-
-	caller := ""
-	if entry.HasCaller() {
-		funcVal := fmt.Sprintf("%s()", entry.Caller.Function)
-		fileVal := fmt.Sprintf("%s:%d", entry.Caller.File, entry.Caller.Line)
-
-		if f.CallerPrettyfier != nil {
-			funcVal, fileVal = f.CallerPrettyfier(entry.Caller)
-		}
-
-		if fileVal == "" {
-			caller = funcVal
-		} else if funcVal == "" {
-			caller = fileVal
-		} else {
-			caller = fileVal + " " + funcVal
-		}
-	}
-
-	switch {
-	case f.DisableTimestamp:
-		fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m%s %-44s ", levelColor, levelText, caller, entry.Message)
-	case !f.FullTimestamp:
-		fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%04d]%s %-44s ", levelColor, levelText, int(entry.Time.Sub(baseTimestamp)/time.Second), caller, entry.Message)
-	default:
-		fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%s]%s %-44s ", levelColor, levelText, entry.Time.Format(timestampFormat), caller, entry.Message)
-	}
-	for _, k := range keys {
-		v := data[k]
-		fmt.Fprintf(b, " \x1b[%dm%s\x1b[0m=", levelColor, k)
-		f.appendValue(b, v)
-	}
-}
-
-func (f *TextFormatter) needsQuoting(text string) bool {
-	if f.ForceQuote {
-		return true
-	}
-	if f.QuoteEmptyFields && len(text) == 0 {
-		return true
-	}
-	if f.DisableQuote {
-		return false
-	}
-	for _, ch := range text {
-		if !((ch >= 'a' && ch <= 'z') ||
-			(ch >= 'A' && ch <= 'Z') ||
-			(ch >= '0' && ch <= '9') ||
-			ch == '-' || ch == '.' || ch == '_' || ch == '/' || ch == '@' || ch == '^' || ch == '+') {
-			return true
-		}
-	}
-	return false
-}
-
-func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}) {
-	if b.Len() > 0 {
-		b.WriteByte(' ')
-	}
-	b.WriteString(key)
-	b.WriteByte('=')
-	f.appendValue(b, value)
-}
-
-func (f *TextFormatter) appendValue(b *bytes.Buffer, value interface{}) {
-	stringVal, ok := value.(string)
-	if !ok {
-		stringVal = fmt.Sprint(value)
-	}
-
-	if !f.needsQuoting(stringVal) {
-		b.WriteString(stringVal)
-	} else {
-		b.WriteString(fmt.Sprintf("%q", stringVal))
-	}
-}

+ 0 - 102
vendor/github.com/sirupsen/logrus/writer.go

@@ -1,102 +0,0 @@
-package logrus
-
-import (
-	"bufio"
-	"io"
-	"runtime"
-	"strings"
-)
-
-// Writer at INFO level. See WriterLevel for details.
-func (logger *Logger) Writer() *io.PipeWriter {
-	return logger.WriterLevel(InfoLevel)
-}
-
-// WriterLevel returns an io.Writer that can be used to write arbitrary text to
-// the logger at the given log level. Each line written to the writer will be
-// printed in the usual way using formatters and hooks. The writer is part of an
-// io.Pipe and it is the callers responsibility to close the writer when done.
-// This can be used to override the standard library logger easily.
-func (logger *Logger) WriterLevel(level Level) *io.PipeWriter {
-	return NewEntry(logger).WriterLevel(level)
-}
-
-// Writer returns an io.Writer that writes to the logger at the info log level
-func (entry *Entry) Writer() *io.PipeWriter {
-	return entry.WriterLevel(InfoLevel)
-}
-
-// WriterLevel returns an io.Writer that writes to the logger at the given log level
-func (entry *Entry) WriterLevel(level Level) *io.PipeWriter {
-	reader, writer := io.Pipe()
-
-	var printFunc func(args ...interface{})
-
-	// Determine which log function to use based on the specified log level
-	switch level {
-	case TraceLevel:
-		printFunc = entry.Trace
-	case DebugLevel:
-		printFunc = entry.Debug
-	case InfoLevel:
-		printFunc = entry.Info
-	case WarnLevel:
-		printFunc = entry.Warn
-	case ErrorLevel:
-		printFunc = entry.Error
-	case FatalLevel:
-		printFunc = entry.Fatal
-	case PanicLevel:
-		printFunc = entry.Panic
-	default:
-		printFunc = entry.Print
-	}
-
-	// Start a new goroutine to scan the input and write it to the logger using the specified print function.
-	// It splits the input into chunks of up to 64KB to avoid buffer overflows.
-	go entry.writerScanner(reader, printFunc)
-
-	// Set a finalizer function to close the writer when it is garbage collected
-	runtime.SetFinalizer(writer, writerFinalizer)
-
-	return writer
-}
-
-// writerScanner scans the input from the reader and writes it to the logger
-func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) {
-	scanner := bufio.NewScanner(reader)
-
-	// Set the buffer size to the maximum token size to avoid buffer overflows
-	scanner.Buffer(make([]byte, bufio.MaxScanTokenSize), bufio.MaxScanTokenSize)
-
-	// Define a split function to split the input into chunks of up to 64KB
-	chunkSize := bufio.MaxScanTokenSize // 64KB
-	splitFunc := func(data []byte, atEOF bool) (int, []byte, error) {
-		if len(data) >= chunkSize {
-			return chunkSize, data[:chunkSize], nil
-		}
-
-		return bufio.ScanLines(data, atEOF)
-	}
-
-	// Use the custom split function to split the input
-	scanner.Split(splitFunc)
-
-	// Scan the input and write it to the logger using the specified print function
-	for scanner.Scan() {
-		printFunc(strings.TrimRight(scanner.Text(), "\r\n"))
-	}
-
-	// If there was an error while scanning the input, log an error
-	if err := scanner.Err(); err != nil {
-		entry.Errorf("Error while reading from Writer: %s", err)
-	}
-
-	// Close the reader when we are done
-	reader.Close()
-}
-
-// WriterFinalizer is a finalizer function that closes then given writer when it is garbage collected
-func writerFinalizer(writer *io.PipeWriter) {
-	writer.Close()
-}

+ 0 - 2
vendor/github.com/vishvananda/netlink/.gitignore

@@ -1,2 +0,0 @@
-.idea/
-.vscode/

+ 0 - 5
vendor/github.com/vishvananda/netlink/CHANGELOG.md

@@ -1,5 +0,0 @@
-# Changelog
-
-## 1.0.0 (2018-03-15)
-
-Initial release tagging

+ 0 - 192
vendor/github.com/vishvananda/netlink/LICENSE

@@ -1,192 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   Copyright 2014 Vishvananda Ishaya.
-   Copyright 2014 Docker, Inc.
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.

+ 0 - 30
vendor/github.com/vishvananda/netlink/Makefile

@@ -1,30 +0,0 @@
-DIRS := \
-	. \
-	nl
-
-DEPS = \
-	github.com/vishvananda/netns \
-	golang.org/x/sys/unix
-
-uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
-testdirs = $(call uniq,$(foreach d,$(1),$(dir $(wildcard $(d)/*_test.go))))
-goroot = $(addprefix ../../../,$(1))
-unroot = $(subst ../../../,,$(1))
-fmt = $(addprefix fmt-,$(1))
-
-all: test
-
-$(call goroot,$(DEPS)):
-	go get $(call unroot,$@)
-
-.PHONY: $(call testdirs,$(DIRS))
-$(call testdirs,$(DIRS)):
-	go test -test.exec sudo -test.parallel 4 -timeout 60s -test.v github.com/vishvananda/netlink/$@
-
-$(call fmt,$(call testdirs,$(DIRS))):
-	! gofmt -l $(subst fmt-,,$@)/*.go | grep -q .
-
-.PHONY: fmt
-fmt: $(call fmt,$(call testdirs,$(DIRS)))
-
-test: fmt $(call goroot,$(DEPS)) $(call testdirs,$(DIRS))

+ 0 - 92
vendor/github.com/vishvananda/netlink/README.md

@@ -1,92 +0,0 @@
-# netlink - netlink library for go #
-
-![Build Status](https://github.com/vishvananda/netlink/actions/workflows/main.yml/badge.svg) [![GoDoc](https://godoc.org/github.com/vishvananda/netlink?status.svg)](https://godoc.org/github.com/vishvananda/netlink)
-
-The netlink package provides a simple netlink library for go. Netlink
-is the interface a user-space program in linux uses to communicate with
-the kernel. It can be used to add and remove interfaces, set ip addresses
-and routes, and configure ipsec. Netlink communication requires elevated
-privileges, so in most cases this code needs to be run as root. Since
-low-level netlink messages are inscrutable at best, the library attempts
-to provide an api that is loosely modeled on the CLI provided by iproute2.
-Actions like `ip link add` will be accomplished via a similarly named
-function like AddLink(). This library began its life as a fork of the
-netlink functionality in
-[docker/libcontainer](https://github.com/docker/libcontainer) but was
-heavily rewritten to improve testability, performance, and to add new
-functionality like ipsec xfrm handling.
-
-## Local Build and Test ##
-
-You can use go get command:
-
-    go get github.com/vishvananda/netlink
-
-Testing dependencies:
-
-    go get github.com/vishvananda/netns
-
-Testing (requires root):
-
-    sudo -E go test github.com/vishvananda/netlink
-
-## Examples ##
-
-Add a new bridge and add eth1 into it:
-
-```go
-package main
-
-import (
-    "fmt"
-    "github.com/vishvananda/netlink"
-)
-
-func main() {
-    la := netlink.NewLinkAttrs()
-    la.Name = "foo"
-    mybridge := &netlink.Bridge{LinkAttrs: la}
-    err := netlink.LinkAdd(mybridge)
-    if err != nil  {
-        fmt.Printf("could not add %s: %v\n", la.Name, err)
-    }
-    eth1, _ := netlink.LinkByName("eth1")
-    netlink.LinkSetMaster(eth1, mybridge)
-}
-
-```
-Note `NewLinkAttrs` constructor, it sets default values in structure. For now
-it sets only `TxQLen` to `-1`, so kernel will set default by itself. If you're
-using simple initialization(`LinkAttrs{Name: "foo"}`) `TxQLen` will be set to
-`0` unless you specify it like `LinkAttrs{Name: "foo", TxQLen: 1000}`.
-
-Add a new ip address to loopback:
-
-```go
-package main
-
-import (
-    "github.com/vishvananda/netlink"
-)
-
-func main() {
-    lo, _ := netlink.LinkByName("lo")
-    addr, _ := netlink.ParseAddr("169.254.169.254/32")
-    netlink.AddrAdd(lo, addr)
-}
-
-```
-
-## Future Work ##
-
-Many pieces of netlink are not yet fully supported in the high-level
-interface. Aspects of virtually all of the high-level objects don't exist.
-Many of the underlying primitives are there, so its a matter of putting
-the right fields into the high-level objects and making sure that they
-are serialized and deserialized correctly in the Add and List methods.
-
-There are also a few pieces of low level netlink functionality that still
-need to be implemented. Routing rules are not in place and some of the
-more advanced link types. Hopefully there is decent structure and testing
-in place to make these fairly straightforward to add.
-

+ 0 - 57
vendor/github.com/vishvananda/netlink/addr.go

@@ -1,57 +0,0 @@
-package netlink
-
-import (
-	"fmt"
-	"net"
-	"strings"
-)
-
-// Addr represents an IP address from netlink. Netlink ip addresses
-// include a mask, so it stores the address as a net.IPNet.
-type Addr struct {
-	*net.IPNet
-	Label       string
-	Flags       int
-	Scope       int
-	Peer        *net.IPNet
-	Broadcast   net.IP
-	PreferedLft int
-	ValidLft    int
-	LinkIndex   int
-}
-
-// String returns $ip/$netmask $label
-func (a Addr) String() string {
-	return strings.TrimSpace(fmt.Sprintf("%s %s", a.IPNet, a.Label))
-}
-
-// ParseAddr parses the string representation of an address in the
-// form $ip/$netmask $label. The label portion is optional
-func ParseAddr(s string) (*Addr, error) {
-	label := ""
-	parts := strings.Split(s, " ")
-	if len(parts) > 1 {
-		s = parts[0]
-		label = parts[1]
-	}
-	m, err := ParseIPNet(s)
-	if err != nil {
-		return nil, err
-	}
-	return &Addr{IPNet: m, Label: label}, nil
-}
-
-// Equal returns true if both Addrs have the same net.IPNet value.
-func (a Addr) Equal(x Addr) bool {
-	sizea, _ := a.Mask.Size()
-	sizeb, _ := x.Mask.Size()
-	// ignore label for comparison
-	return a.IP.Equal(x.IP) && sizea == sizeb
-}
-
-func (a Addr) PeerEqual(x Addr) bool {
-	sizea, _ := a.Peer.Mask.Size()
-	sizeb, _ := x.Peer.Mask.Size()
-	// ignore label for comparison
-	return a.Peer.IP.Equal(x.Peer.IP) && sizea == sizeb
-}

+ 0 - 431
vendor/github.com/vishvananda/netlink/addr_linux.go

@@ -1,431 +0,0 @@
-package netlink
-
-import (
-	"errors"
-	"fmt"
-	"net"
-	"syscall"
-
-	"github.com/vishvananda/netlink/nl"
-	"github.com/vishvananda/netns"
-	"golang.org/x/sys/unix"
-)
-
-// AddrAdd will add an IP address to a link device.
-//
-// Equivalent to: `ip addr add $addr dev $link`
-//
-// If `addr` is an IPv4 address and the broadcast address is not given, it
-// will be automatically computed based on the IP mask if /30 or larger.
-// If `net.IPv4zero` is given as the broadcast address, broadcast is disabled.
-func AddrAdd(link Link, addr *Addr) error {
-	return pkgHandle.AddrAdd(link, addr)
-}
-
-// AddrAdd will add an IP address to a link device.
-//
-// Equivalent to: `ip addr add $addr dev $link`
-//
-// If `addr` is an IPv4 address and the broadcast address is not given, it
-// will be automatically computed based on the IP mask if /30 or larger.
-// If `net.IPv4zero` is given as the broadcast address, broadcast is disabled.
-func (h *Handle) AddrAdd(link Link, addr *Addr) error {
-	req := h.newNetlinkRequest(unix.RTM_NEWADDR, unix.NLM_F_CREATE|unix.NLM_F_EXCL|unix.NLM_F_ACK)
-	return h.addrHandle(link, addr, req)
-}
-
-// AddrReplace will replace (or, if not present, add) an IP address on a link device.
-//
-// Equivalent to: `ip addr replace $addr dev $link`
-//
-// If `addr` is an IPv4 address and the broadcast address is not given, it
-// will be automatically computed based on the IP mask if /30 or larger.
-// If `net.IPv4zero` is given as the broadcast address, broadcast is disabled.
-func AddrReplace(link Link, addr *Addr) error {
-	return pkgHandle.AddrReplace(link, addr)
-}
-
-// AddrReplace will replace (or, if not present, add) an IP address on a link device.
-//
-// Equivalent to: `ip addr replace $addr dev $link`
-//
-// If `addr` is an IPv4 address and the broadcast address is not given, it
-// will be automatically computed based on the IP mask if /30 or larger.
-// If `net.IPv4zero` is given as the broadcast address, broadcast is disabled.
-func (h *Handle) AddrReplace(link Link, addr *Addr) error {
-	req := h.newNetlinkRequest(unix.RTM_NEWADDR, unix.NLM_F_CREATE|unix.NLM_F_REPLACE|unix.NLM_F_ACK)
-	return h.addrHandle(link, addr, req)
-}
-
-// AddrDel will delete an IP address from a link device.
-//
-// Equivalent to: `ip addr del $addr dev $link`
-func AddrDel(link Link, addr *Addr) error {
-	return pkgHandle.AddrDel(link, addr)
-}
-
-// AddrDel will delete an IP address from a link device.
-//
-// Equivalent to: `ip addr del $addr dev $link`
-func (h *Handle) AddrDel(link Link, addr *Addr) error {
-	req := h.newNetlinkRequest(unix.RTM_DELADDR, unix.NLM_F_ACK)
-	return h.addrHandle(link, addr, req)
-}
-
-func (h *Handle) addrHandle(link Link, addr *Addr, req *nl.NetlinkRequest) error {
-	family := nl.GetIPFamily(addr.IP)
-	msg := nl.NewIfAddrmsg(family)
-	msg.Scope = uint8(addr.Scope)
-	if link == nil {
-		msg.Index = uint32(addr.LinkIndex)
-	} else {
-		base := link.Attrs()
-		h.ensureIndex(base)
-		msg.Index = uint32(base.Index)
-	}
-	mask := addr.Mask
-	if addr.Peer != nil {
-		mask = addr.Peer.Mask
-	}
-	prefixlen, masklen := mask.Size()
-	msg.Prefixlen = uint8(prefixlen)
-	req.AddData(msg)
-
-	var localAddrData []byte
-	if family == FAMILY_V4 {
-		localAddrData = addr.IP.To4()
-	} else {
-		localAddrData = addr.IP.To16()
-	}
-
-	localData := nl.NewRtAttr(unix.IFA_LOCAL, localAddrData)
-	req.AddData(localData)
-	var peerAddrData []byte
-	if addr.Peer != nil {
-		if family == FAMILY_V4 {
-			peerAddrData = addr.Peer.IP.To4()
-		} else {
-			peerAddrData = addr.Peer.IP.To16()
-		}
-	} else {
-		peerAddrData = localAddrData
-	}
-
-	addressData := nl.NewRtAttr(unix.IFA_ADDRESS, peerAddrData)
-	req.AddData(addressData)
-
-	if addr.Flags != 0 {
-		if addr.Flags <= 0xff {
-			msg.IfAddrmsg.Flags = uint8(addr.Flags)
-		} else {
-			b := make([]byte, 4)
-			native.PutUint32(b, uint32(addr.Flags))
-			flagsData := nl.NewRtAttr(unix.IFA_FLAGS, b)
-			req.AddData(flagsData)
-		}
-	}
-
-	if family == FAMILY_V4 {
-		// Automatically set the broadcast address if it is unset and the
-		// subnet is large enough to sensibly have one (/30 or larger).
-		// See: RFC 3021
-		if addr.Broadcast == nil && prefixlen < 31 {
-			calcBroadcast := make(net.IP, masklen/8)
-			for i := range localAddrData {
-				calcBroadcast[i] = localAddrData[i] | ^mask[i]
-			}
-			addr.Broadcast = calcBroadcast
-		}
-
-		if net.IPv4zero.Equal(addr.Broadcast) {
-			addr.Broadcast = nil
-		}
-
-		if addr.Broadcast != nil {
-			req.AddData(nl.NewRtAttr(unix.IFA_BROADCAST, addr.Broadcast))
-		}
-
-		if addr.Label != "" {
-			labelData := nl.NewRtAttr(unix.IFA_LABEL, nl.ZeroTerminated(addr.Label))
-			req.AddData(labelData)
-		}
-	}
-
-	// 0 is the default value for these attributes. However, 0 means "expired", while the least-surprising default
-	// value should be "forever". To compensate for that, only add the attributes if at least one of the values is
-	// non-zero, which means the caller has explicitly set them
-	if addr.ValidLft > 0 || addr.PreferedLft > 0 {
-		cachedata := nl.IfaCacheInfo{unix.IfaCacheinfo{
-			Valid:    uint32(addr.ValidLft),
-			Prefered: uint32(addr.PreferedLft),
-		}}
-		req.AddData(nl.NewRtAttr(unix.IFA_CACHEINFO, cachedata.Serialize()))
-	}
-
-	_, err := req.Execute(unix.NETLINK_ROUTE, 0)
-	return err
-}
-
-// AddrList gets a list of IP addresses in the system.
-// Equivalent to: `ip addr show`.
-// The list can be filtered by link and ip family.
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func AddrList(link Link, family int) ([]Addr, error) {
-	return pkgHandle.AddrList(link, family)
-}
-
-// AddrList gets a list of IP addresses in the system.
-// Equivalent to: `ip addr show`.
-// The list can be filtered by link and ip family.
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func (h *Handle) AddrList(link Link, family int) ([]Addr, error) {
-	req := h.newNetlinkRequest(unix.RTM_GETADDR, unix.NLM_F_DUMP)
-	msg := nl.NewIfAddrmsg(family)
-	req.AddData(msg)
-
-	msgs, executeErr := req.Execute(unix.NETLINK_ROUTE, unix.RTM_NEWADDR)
-	if executeErr != nil && !errors.Is(executeErr, ErrDumpInterrupted) {
-		return nil, executeErr
-	}
-
-	indexFilter := 0
-	if link != nil {
-		base := link.Attrs()
-		h.ensureIndex(base)
-		indexFilter = base.Index
-	}
-
-	var res []Addr
-	for _, m := range msgs {
-		addr, msgFamily, err := parseAddr(m)
-		if err != nil {
-			return res, err
-		}
-
-		if link != nil && addr.LinkIndex != indexFilter {
-			// Ignore messages from other interfaces
-			continue
-		}
-
-		if family != FAMILY_ALL && msgFamily != family {
-			continue
-		}
-
-		res = append(res, addr)
-	}
-
-	return res, executeErr
-}
-
-func parseAddr(m []byte) (addr Addr, family int, err error) {
-	msg := nl.DeserializeIfAddrmsg(m)
-
-	family = -1
-	addr.LinkIndex = -1
-
-	attrs, err1 := nl.ParseRouteAttr(m[msg.Len():])
-	if err1 != nil {
-		err = err1
-		return
-	}
-
-	family = int(msg.Family)
-	addr.LinkIndex = int(msg.Index)
-
-	var local, dst *net.IPNet
-	for _, attr := range attrs {
-		switch attr.Attr.Type {
-		case unix.IFA_ADDRESS:
-			dst = &net.IPNet{
-				IP:   attr.Value,
-				Mask: net.CIDRMask(int(msg.Prefixlen), 8*len(attr.Value)),
-			}
-		case unix.IFA_LOCAL:
-			// iproute2 manual:
-			// If a peer address is specified, the local address
-			// cannot have a prefix length. The network prefix is
-			// associated with the peer rather than with the local
-			// address.
-			n := 8 * len(attr.Value)
-			local = &net.IPNet{
-				IP:   attr.Value,
-				Mask: net.CIDRMask(n, n),
-			}
-		case unix.IFA_BROADCAST:
-			addr.Broadcast = attr.Value
-		case unix.IFA_LABEL:
-			addr.Label = string(attr.Value[:len(attr.Value)-1])
-		case unix.IFA_FLAGS:
-			addr.Flags = int(native.Uint32(attr.Value[0:4]))
-		case unix.IFA_CACHEINFO:
-			ci := nl.DeserializeIfaCacheInfo(attr.Value)
-			addr.PreferedLft = int(ci.Prefered)
-			addr.ValidLft = int(ci.Valid)
-		}
-	}
-
-	// libnl addr.c comment:
-	// IPv6 sends the local address as IFA_ADDRESS with no
-	// IFA_LOCAL, IPv4 sends both IFA_LOCAL and IFA_ADDRESS
-	// with IFA_ADDRESS being the peer address if they differ
-	//
-	// But obviously, as there are IPv6 PtP addresses, too,
-	// IFA_LOCAL should also be handled for IPv6.
-	if local != nil {
-		if family == FAMILY_V4 && dst != nil && local.IP.Equal(dst.IP) {
-			addr.IPNet = dst
-		} else {
-			addr.IPNet = local
-			addr.Peer = dst
-		}
-	} else {
-		addr.IPNet = dst
-	}
-
-	addr.Scope = int(msg.Scope)
-
-	return
-}
-
-type AddrUpdate struct {
-	LinkAddress net.IPNet
-	LinkIndex   int
-	Flags       int
-	Scope       int
-	PreferedLft int
-	ValidLft    int
-	NewAddr     bool // true=added false=deleted
-}
-
-// AddrSubscribe takes a chan down which notifications will be sent
-// when addresses change.  Close the 'done' chan to stop subscription.
-func AddrSubscribe(ch chan<- AddrUpdate, done <-chan struct{}) error {
-	return addrSubscribeAt(netns.None(), netns.None(), ch, done, nil, false, 0, nil, false)
-}
-
-// AddrSubscribeAt works like AddrSubscribe plus it allows the caller
-// to choose the network namespace in which to subscribe (ns).
-func AddrSubscribeAt(ns netns.NsHandle, ch chan<- AddrUpdate, done <-chan struct{}) error {
-	return addrSubscribeAt(ns, netns.None(), ch, done, nil, false, 0, nil, false)
-}
-
-// AddrSubscribeOptions contains a set of options to use with
-// AddrSubscribeWithOptions.
-type AddrSubscribeOptions struct {
-	Namespace              *netns.NsHandle
-	ErrorCallback          func(error)
-	ListExisting           bool
-	ReceiveBufferSize      int
-	ReceiveBufferForceSize bool
-	ReceiveTimeout         *unix.Timeval
-}
-
-// AddrSubscribeWithOptions work like AddrSubscribe but enable to
-// provide additional options to modify the behavior. Currently, the
-// namespace can be provided as well as an error callback.
-func AddrSubscribeWithOptions(ch chan<- AddrUpdate, done <-chan struct{}, options AddrSubscribeOptions) error {
-	if options.Namespace == nil {
-		none := netns.None()
-		options.Namespace = &none
-	}
-	return addrSubscribeAt(*options.Namespace, netns.None(), ch, done, options.ErrorCallback, options.ListExisting,
-		options.ReceiveBufferSize, options.ReceiveTimeout, options.ReceiveBufferForceSize)
-}
-
-func addrSubscribeAt(newNs, curNs netns.NsHandle, ch chan<- AddrUpdate, done <-chan struct{}, cberr func(error), listExisting bool,
-	rcvbuf int, rcvTimeout *unix.Timeval, rcvBufForce bool) error {
-	s, err := nl.SubscribeAt(newNs, curNs, unix.NETLINK_ROUTE, unix.RTNLGRP_IPV4_IFADDR, unix.RTNLGRP_IPV6_IFADDR)
-	if err != nil {
-		return err
-	}
-	if rcvTimeout != nil {
-		if err := s.SetReceiveTimeout(rcvTimeout); err != nil {
-			return err
-		}
-	}
-	if rcvbuf != 0 {
-		err = s.SetReceiveBufferSize(rcvbuf, rcvBufForce)
-		if err != nil {
-			return err
-		}
-	}
-	if done != nil {
-		go func() {
-			<-done
-			s.Close()
-		}()
-	}
-	if listExisting {
-		req := pkgHandle.newNetlinkRequest(unix.RTM_GETADDR,
-			unix.NLM_F_DUMP)
-		infmsg := nl.NewIfInfomsg(unix.AF_UNSPEC)
-		req.AddData(infmsg)
-		if err := s.Send(req); err != nil {
-			return err
-		}
-	}
-	go func() {
-		defer close(ch)
-		for {
-			msgs, from, err := s.Receive()
-			if err != nil {
-				if cberr != nil {
-					cberr(fmt.Errorf("Receive failed: %v",
-						err))
-				}
-				return
-			}
-			if from.Pid != nl.PidKernel {
-				if cberr != nil {
-					cberr(fmt.Errorf("Wrong sender portid %d, expected %d", from.Pid, nl.PidKernel))
-				}
-				continue
-			}
-			for _, m := range msgs {
-				if m.Header.Type == unix.NLMSG_DONE {
-					continue
-				}
-				if m.Header.Type == unix.NLMSG_ERROR {
-					error := int32(native.Uint32(m.Data[0:4]))
-					if error == 0 {
-						continue
-					}
-					if cberr != nil {
-						cberr(fmt.Errorf("error message: %v",
-							syscall.Errno(-error)))
-					}
-					continue
-				}
-				msgType := m.Header.Type
-				if msgType != unix.RTM_NEWADDR && msgType != unix.RTM_DELADDR {
-					if cberr != nil {
-						cberr(fmt.Errorf("bad message type: %d", msgType))
-					}
-					continue
-				}
-
-				addr, _, err := parseAddr(m.Data)
-				if err != nil {
-					if cberr != nil {
-						cberr(fmt.Errorf("could not parse address: %v", err))
-					}
-					continue
-				}
-
-				ch <- AddrUpdate{LinkAddress: *addr.IPNet,
-					LinkIndex:   addr.LinkIndex,
-					NewAddr:     msgType == unix.RTM_NEWADDR,
-					Flags:       addr.Flags,
-					Scope:       addr.Scope,
-					PreferedLft: addr.PreferedLft,
-					ValidLft:    addr.ValidLft}
-			}
-		}
-	}()
-
-	return nil
-}

+ 0 - 77
vendor/github.com/vishvananda/netlink/bpf_linux.go

@@ -1,77 +0,0 @@
-package netlink
-
-import (
-	"unsafe"
-
-	"golang.org/x/sys/unix"
-)
-
-type BpfProgType uint32
-
-const (
-	BPF_PROG_TYPE_UNSPEC BpfProgType = iota
-	BPF_PROG_TYPE_SOCKET_FILTER
-	BPF_PROG_TYPE_KPROBE
-	BPF_PROG_TYPE_SCHED_CLS
-	BPF_PROG_TYPE_SCHED_ACT
-	BPF_PROG_TYPE_TRACEPOINT
-	BPF_PROG_TYPE_XDP
-	BPF_PROG_TYPE_PERF_EVENT
-	BPF_PROG_TYPE_CGROUP_SKB
-	BPF_PROG_TYPE_CGROUP_SOCK
-	BPF_PROG_TYPE_LWT_IN
-	BPF_PROG_TYPE_LWT_OUT
-	BPF_PROG_TYPE_LWT_XMIT
-	BPF_PROG_TYPE_SOCK_OPS
-	BPF_PROG_TYPE_SK_SKB
-	BPF_PROG_TYPE_CGROUP_DEVICE
-	BPF_PROG_TYPE_SK_MSG
-	BPF_PROG_TYPE_RAW_TRACEPOINT
-	BPF_PROG_TYPE_CGROUP_SOCK_ADDR
-	BPF_PROG_TYPE_LWT_SEG6LOCAL
-	BPF_PROG_TYPE_LIRC_MODE2
-	BPF_PROG_TYPE_SK_REUSEPORT
-	BPF_PROG_TYPE_FLOW_DISSECTOR
-	BPF_PROG_TYPE_CGROUP_SYSCTL
-	BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE
-	BPF_PROG_TYPE_CGROUP_SOCKOPT
-	BPF_PROG_TYPE_TRACING
-	BPF_PROG_TYPE_STRUCT_OPS
-	BPF_PROG_TYPE_EXT
-	BPF_PROG_TYPE_LSM
-	BPF_PROG_TYPE_SK_LOOKUP
-)
-
-type BPFAttr struct {
-	ProgType    uint32
-	InsnCnt     uint32
-	Insns       uintptr
-	License     uintptr
-	LogLevel    uint32
-	LogSize     uint32
-	LogBuf      uintptr
-	KernVersion uint32
-}
-
-// loadSimpleBpf loads a trivial bpf program for testing purposes.
-func loadSimpleBpf(progType BpfProgType, ret uint32) (int, error) {
-	insns := []uint64{
-		0x00000000000000b7 | (uint64(ret) << 32),
-		0x0000000000000095,
-	}
-	license := []byte{'A', 'S', 'L', '2', '\x00'}
-	attr := BPFAttr{
-		ProgType: uint32(progType),
-		InsnCnt:  uint32(len(insns)),
-		Insns:    uintptr(unsafe.Pointer(&insns[0])),
-		License:  uintptr(unsafe.Pointer(&license[0])),
-	}
-	fd, _, errno := unix.Syscall(unix.SYS_BPF,
-		5, /* bpf cmd */
-		uintptr(unsafe.Pointer(&attr)),
-		unsafe.Sizeof(attr))
-	if errno != 0 {
-		return 0, errno
-	}
-	return int(fd), nil
-}

+ 0 - 299
vendor/github.com/vishvananda/netlink/bridge_linux.go

@@ -1,299 +0,0 @@
-package netlink
-
-import (
-	"errors"
-	"fmt"
-	"syscall"
-
-	"github.com/vishvananda/netlink/nl"
-	"golang.org/x/sys/unix"
-)
-
-// BridgeVlanTunnelShow gets vlanid-tunnelid mapping.
-// Equivalent to: `bridge vlan tunnelshow`
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func BridgeVlanTunnelShow() ([]nl.TunnelInfo, error) {
-	return pkgHandle.BridgeVlanTunnelShow()
-}
-
-func (h *Handle) BridgeVlanTunnelShow() ([]nl.TunnelInfo, error) {
-	req := h.newNetlinkRequest(unix.RTM_GETLINK, unix.NLM_F_DUMP)
-	msg := nl.NewIfInfomsg(unix.AF_BRIDGE)
-	req.AddData(msg)
-	req.AddData(nl.NewRtAttr(unix.IFLA_EXT_MASK, nl.Uint32Attr(uint32(nl.RTEXT_FILTER_BRVLAN))))
-
-	msgs, executeErr := req.Execute(unix.NETLINK_ROUTE, unix.RTM_NEWLINK)
-	if executeErr != nil && !errors.Is(executeErr, ErrDumpInterrupted) {
-		return nil, executeErr
-	}
-	ret := make([]nl.TunnelInfo, 0)
-	for _, m := range msgs {
-		msg := nl.DeserializeIfInfomsg(m)
-
-		attrs, err := nl.ParseRouteAttr(m[msg.Len():])
-		if err != nil {
-			return nil, err
-		}
-		for _, attr := range attrs {
-			switch attr.Attr.Type {
-			case unix.IFLA_AF_SPEC:
-				nestedAttrs, err := nl.ParseRouteAttr(attr.Value)
-				if err != nil {
-					return nil, fmt.Errorf("failed to parse nested attr %v", err)
-				}
-				for _, nestAttr := range nestedAttrs {
-					switch nestAttr.Attr.Type {
-					case nl.IFLA_BRIDGE_VLAN_TUNNEL_INFO:
-						ret, err = parseTunnelInfo(&nestAttr, ret)
-						if err != nil {
-							return nil, fmt.Errorf("failed to parse tunnelinfo %v", err)
-						}
-					}
-				}
-			}
-		}
-	}
-	return ret, executeErr
-}
-
-func parseTunnelInfo(nestAttr *syscall.NetlinkRouteAttr, results []nl.TunnelInfo) ([]nl.TunnelInfo, error) {
-	tunnelInfos, err := nl.ParseRouteAttr(nestAttr.Value)
-	if err != nil {
-		return nil, fmt.Errorf("failed to parse nested attr %v", err)
-	}
-	var tunnelId uint32
-	var vid uint16
-	var flag uint16
-	for _, tunnelInfo := range tunnelInfos {
-		switch tunnelInfo.Attr.Type {
-		case nl.IFLA_BRIDGE_VLAN_TUNNEL_ID:
-			tunnelId = native.Uint32(tunnelInfo.Value)
-		case nl.IFLA_BRIDGE_VLAN_TUNNEL_VID:
-			vid = native.Uint16(tunnelInfo.Value)
-		case nl.IFLA_BRIDGE_VLAN_TUNNEL_FLAGS:
-			flag = native.Uint16(tunnelInfo.Value)
-		}
-	}
-
-	if flag == nl.BRIDGE_VLAN_INFO_RANGE_END {
-		lastTi := results[len(results)-1]
-		vni := lastTi.TunId + 1
-		for i := lastTi.Vid + 1; i < vid; i++ {
-			t := nl.TunnelInfo{
-				TunId: vni,
-				Vid:   i,
-			}
-			results = append(results, t)
-			vni++
-		}
-	}
-
-	t := nl.TunnelInfo{
-		TunId: tunnelId,
-		Vid:   vid,
-	}
-
-	results = append(results, t)
-	return results, nil
-}
-
-// BridgeVlanList gets a map of device id to bridge vlan infos.
-// Equivalent to: `bridge vlan show`
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func BridgeVlanList() (map[int32][]*nl.BridgeVlanInfo, error) {
-	return pkgHandle.BridgeVlanList()
-}
-
-// BridgeVlanList gets a map of device id to bridge vlan infos.
-// Equivalent to: `bridge vlan show`
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func (h *Handle) BridgeVlanList() (map[int32][]*nl.BridgeVlanInfo, error) {
-	req := h.newNetlinkRequest(unix.RTM_GETLINK, unix.NLM_F_DUMP)
-	msg := nl.NewIfInfomsg(unix.AF_BRIDGE)
-	req.AddData(msg)
-	req.AddData(nl.NewRtAttr(unix.IFLA_EXT_MASK, nl.Uint32Attr(uint32(nl.RTEXT_FILTER_BRVLAN))))
-
-	msgs, executeErr := req.Execute(unix.NETLINK_ROUTE, unix.RTM_NEWLINK)
-	if executeErr != nil && !errors.Is(executeErr, ErrDumpInterrupted) {
-		return nil, executeErr
-	}
-	ret := make(map[int32][]*nl.BridgeVlanInfo)
-	for _, m := range msgs {
-		msg := nl.DeserializeIfInfomsg(m)
-
-		attrs, err := nl.ParseRouteAttr(m[msg.Len():])
-		if err != nil {
-			return nil, err
-		}
-		for _, attr := range attrs {
-			switch attr.Attr.Type {
-			case unix.IFLA_AF_SPEC:
-				//nested attr
-				nestAttrs, err := nl.ParseRouteAttr(attr.Value)
-				if err != nil {
-					return nil, fmt.Errorf("failed to parse nested attr %v", err)
-				}
-				for _, nestAttr := range nestAttrs {
-					switch nestAttr.Attr.Type {
-					case nl.IFLA_BRIDGE_VLAN_INFO:
-						vlanInfo := nl.DeserializeBridgeVlanInfo(nestAttr.Value)
-						ret[msg.Index] = append(ret[msg.Index], vlanInfo)
-					}
-				}
-			}
-		}
-	}
-	return ret, executeErr
-}
-
-// BridgeVlanAddTunnelInfo adds a new vlan filter entry
-// Equivalent to: `bridge vlan add dev DEV vid VID tunnel_info id TUNID [ self ] [ master ]`
-func BridgeVlanAddTunnelInfo(link Link, vid uint16, tunid uint32, self, master bool) error {
-	return pkgHandle.BridgeVlanAddTunnelInfo(link, vid, 0, tunid, 0, self, master)
-}
-
-// BridgeVlanAddRangeTunnelInfoRange adds a new vlan filter entry
-// Equivalent to: `bridge vlan add dev DEV vid VID-VIDEND tunnel_info id VIN-VINEND [ self ] [ master ]`
-func BridgeVlanAddRangeTunnelInfoRange(link Link, vid, vidEnd uint16, tunid, tunidEnd uint32, self, master bool) error {
-	return pkgHandle.BridgeVlanAddTunnelInfo(link, vid, vidEnd, tunid, tunidEnd, self, master)
-}
-
-func (h *Handle) BridgeVlanAddTunnelInfo(link Link, vid, vidEnd uint16, tunid, tunidEnd uint32, self, master bool) error {
-	return h.bridgeVlanModify(unix.RTM_SETLINK, link, vid, vidEnd, tunid, tunidEnd, false, false, self, master)
-}
-
-// BridgeVlanDelTunnelInfo adds a new vlan filter entry
-// Equivalent to: `bridge vlan del dev DEV vid VID tunnel_info id TUNID [ self ] [ master ]`
-func BridgeVlanDelTunnelInfo(link Link, vid uint16, tunid uint32, self, master bool) error {
-	return pkgHandle.BridgeVlanDelTunnelInfo(link, vid, 0, tunid, 0, self, master)
-}
-
-// BridgeVlanDelRangeTunnelInfoRange adds a new vlan filter entry
-// Equivalent to: `bridge vlan del dev DEV vid VID-VIDEND tunnel_info id VIN-VINEND [ self ] [ master ]`
-func BridgeVlanDelRangeTunnelInfoRange(link Link, vid, vidEnd uint16, tunid, tunidEnd uint32, self, master bool) error {
-	return pkgHandle.BridgeVlanDelTunnelInfo(link, vid, vidEnd, tunid, tunidEnd, self, master)
-}
-
-func (h *Handle) BridgeVlanDelTunnelInfo(link Link, vid, vidEnd uint16, tunid, tunidEnd uint32, self, master bool) error {
-	return h.bridgeVlanModify(unix.RTM_DELLINK, link, vid, vidEnd, tunid, tunidEnd, false, false, self, master)
-}
-
-// BridgeVlanAdd adds a new vlan filter entry
-// Equivalent to: `bridge vlan add dev DEV vid VID [ pvid ] [ untagged ] [ self ] [ master ]`
-func BridgeVlanAdd(link Link, vid uint16, pvid, untagged, self, master bool) error {
-	return pkgHandle.BridgeVlanAdd(link, vid, pvid, untagged, self, master)
-}
-
-// BridgeVlanAdd adds a new vlan filter entry
-// Equivalent to: `bridge vlan add dev DEV vid VID [ pvid ] [ untagged ] [ self ] [ master ]`
-func (h *Handle) BridgeVlanAdd(link Link, vid uint16, pvid, untagged, self, master bool) error {
-	return h.bridgeVlanModify(unix.RTM_SETLINK, link, vid, 0, 0, 0, pvid, untagged, self, master)
-}
-
-// BridgeVlanAddRange adds a new vlan filter entry
-// Equivalent to: `bridge vlan add dev DEV vid VID-VIDEND [ pvid ] [ untagged ] [ self ] [ master ]`
-func BridgeVlanAddRange(link Link, vid, vidEnd uint16, pvid, untagged, self, master bool) error {
-	return pkgHandle.BridgeVlanAddRange(link, vid, vidEnd, pvid, untagged, self, master)
-}
-
-// BridgeVlanAddRange adds a new vlan filter entry
-// Equivalent to: `bridge vlan add dev DEV vid VID-VIDEND [ pvid ] [ untagged ] [ self ] [ master ]`
-func (h *Handle) BridgeVlanAddRange(link Link, vid, vidEnd uint16, pvid, untagged, self, master bool) error {
-	return h.bridgeVlanModify(unix.RTM_SETLINK, link, vid, vidEnd, 0, 0, pvid, untagged, self, master)
-}
-
-// BridgeVlanDel adds a new vlan filter entry
-// Equivalent to: `bridge vlan del dev DEV vid VID [ pvid ] [ untagged ] [ self ] [ master ]`
-func BridgeVlanDel(link Link, vid uint16, pvid, untagged, self, master bool) error {
-	return pkgHandle.BridgeVlanDel(link, vid, pvid, untagged, self, master)
-}
-
-// BridgeVlanDel adds a new vlan filter entry
-// Equivalent to: `bridge vlan del dev DEV vid VID [ pvid ] [ untagged ] [ self ] [ master ]`
-func (h *Handle) BridgeVlanDel(link Link, vid uint16, pvid, untagged, self, master bool) error {
-	return h.bridgeVlanModify(unix.RTM_DELLINK, link, vid, 0, 0, 0, pvid, untagged, self, master)
-}
-
-// BridgeVlanDelRange adds a new vlan filter entry
-// Equivalent to: `bridge vlan del dev DEV vid VID-VIDEND [ pvid ] [ untagged ] [ self ] [ master ]`
-func BridgeVlanDelRange(link Link, vid, vidEnd uint16, pvid, untagged, self, master bool) error {
-	return pkgHandle.BridgeVlanDelRange(link, vid, vidEnd, pvid, untagged, self, master)
-}
-
-// BridgeVlanDelRange adds a new vlan filter entry
-// Equivalent to: `bridge vlan del dev DEV vid VID-VIDEND [ pvid ] [ untagged ] [ self ] [ master ]`
-func (h *Handle) BridgeVlanDelRange(link Link, vid, vidEnd uint16, pvid, untagged, self, master bool) error {
-	return h.bridgeVlanModify(unix.RTM_DELLINK, link, vid, vidEnd, 0, 0, pvid, untagged, self, master)
-}
-
-func (h *Handle) bridgeVlanModify(cmd int, link Link, vid, vidEnd uint16, tunid, tunidEnd uint32, pvid, untagged, self, master bool) error {
-	base := link.Attrs()
-	h.ensureIndex(base)
-	req := h.newNetlinkRequest(cmd, unix.NLM_F_ACK)
-
-	msg := nl.NewIfInfomsg(unix.AF_BRIDGE)
-	msg.Index = int32(base.Index)
-	req.AddData(msg)
-
-	br := nl.NewRtAttr(unix.IFLA_AF_SPEC, nil)
-	var flags uint16
-	if self {
-		flags |= nl.BRIDGE_FLAGS_SELF
-	}
-	if master {
-		flags |= nl.BRIDGE_FLAGS_MASTER
-	}
-	if flags > 0 {
-		br.AddRtAttr(nl.IFLA_BRIDGE_FLAGS, nl.Uint16Attr(flags))
-	}
-
-	if tunid != 0 {
-		if tunidEnd != 0 {
-			tiStart := br.AddRtAttr(nl.IFLA_BRIDGE_VLAN_TUNNEL_INFO, nil)
-			tiStart.AddRtAttr(nl.IFLA_BRIDGE_VLAN_TUNNEL_ID, nl.Uint32Attr(tunid))
-			tiStart.AddRtAttr(nl.IFLA_BRIDGE_VLAN_TUNNEL_VID, nl.Uint16Attr(vid))
-			tiStart.AddRtAttr(nl.IFLA_BRIDGE_VLAN_TUNNEL_FLAGS, nl.Uint16Attr(nl.BRIDGE_VLAN_INFO_RANGE_BEGIN))
-
-			tiEnd := br.AddRtAttr(nl.IFLA_BRIDGE_VLAN_TUNNEL_INFO, nil)
-			tiEnd.AddRtAttr(nl.IFLA_BRIDGE_VLAN_TUNNEL_ID, nl.Uint32Attr(tunidEnd))
-			tiEnd.AddRtAttr(nl.IFLA_BRIDGE_VLAN_TUNNEL_VID, nl.Uint16Attr(vidEnd))
-			tiEnd.AddRtAttr(nl.IFLA_BRIDGE_VLAN_TUNNEL_FLAGS, nl.Uint16Attr(nl.BRIDGE_VLAN_INFO_RANGE_END))
-		} else {
-			ti := br.AddRtAttr(nl.IFLA_BRIDGE_VLAN_TUNNEL_INFO, nil)
-			ti.AddRtAttr(nl.IFLA_BRIDGE_VLAN_TUNNEL_ID, nl.Uint32Attr(tunid))
-			ti.AddRtAttr(nl.IFLA_BRIDGE_VLAN_TUNNEL_VID, nl.Uint16Attr(vid))
-			ti.AddRtAttr(nl.IFLA_BRIDGE_VLAN_TUNNEL_FLAGS, nl.Uint16Attr(0))
-		}
-	} else {
-		vlanInfo := &nl.BridgeVlanInfo{Vid: vid}
-		if pvid {
-			vlanInfo.Flags |= nl.BRIDGE_VLAN_INFO_PVID
-		}
-		if untagged {
-			vlanInfo.Flags |= nl.BRIDGE_VLAN_INFO_UNTAGGED
-		}
-
-		if vidEnd != 0 {
-			vlanEndInfo := &nl.BridgeVlanInfo{Vid: vidEnd}
-			vlanEndInfo.Flags = vlanInfo.Flags
-
-			vlanInfo.Flags |= nl.BRIDGE_VLAN_INFO_RANGE_BEGIN
-			br.AddRtAttr(nl.IFLA_BRIDGE_VLAN_INFO, vlanInfo.Serialize())
-
-			vlanEndInfo.Flags |= nl.BRIDGE_VLAN_INFO_RANGE_END
-			br.AddRtAttr(nl.IFLA_BRIDGE_VLAN_INFO, vlanEndInfo.Serialize())
-		} else {
-			br.AddRtAttr(nl.IFLA_BRIDGE_VLAN_INFO, vlanInfo.Serialize())
-		}
-	}
-
-	req.AddData(br)
-	_, err := req.Execute(unix.NETLINK_ROUTE, 0)
-	return err
-}

+ 0 - 22
vendor/github.com/vishvananda/netlink/chain.go

@@ -1,22 +0,0 @@
-package netlink
-
-import (
-	"fmt"
-)
-
-// Chain contains the attributes of a Chain
-type Chain struct {
-	Parent uint32
-	Chain  uint32
-}
-
-func (c Chain) String() string {
-	return fmt.Sprintf("{Parent: %d, Chain: %d}", c.Parent, c.Chain)
-}
-
-func NewChain(parent uint32, chain uint32) Chain {
-	return Chain{
-		Parent: parent,
-		Chain:  chain,
-	}
-}

+ 0 - 120
vendor/github.com/vishvananda/netlink/chain_linux.go

@@ -1,120 +0,0 @@
-package netlink
-
-import (
-	"errors"
-
-	"github.com/vishvananda/netlink/nl"
-	"golang.org/x/sys/unix"
-)
-
-// ChainDel will delete a chain from the system.
-func ChainDel(link Link, chain Chain) error {
-	// Equivalent to: `tc chain del $chain`
-	return pkgHandle.ChainDel(link, chain)
-}
-
-// ChainDel will delete a chain from the system.
-// Equivalent to: `tc chain del $chain`
-func (h *Handle) ChainDel(link Link, chain Chain) error {
-	return h.chainModify(unix.RTM_DELCHAIN, 0, link, chain)
-}
-
-// ChainAdd will add a chain to the system.
-// Equivalent to: `tc chain add`
-func ChainAdd(link Link, chain Chain) error {
-	return pkgHandle.ChainAdd(link, chain)
-}
-
-// ChainAdd will add a chain to the system.
-// Equivalent to: `tc chain add`
-func (h *Handle) ChainAdd(link Link, chain Chain) error {
-	return h.chainModify(
-		unix.RTM_NEWCHAIN,
-		unix.NLM_F_CREATE|unix.NLM_F_EXCL,
-		link,
-		chain)
-}
-
-func (h *Handle) chainModify(cmd, flags int, link Link, chain Chain) error {
-	req := h.newNetlinkRequest(cmd, flags|unix.NLM_F_ACK)
-	index := int32(0)
-	if link != nil {
-		base := link.Attrs()
-		h.ensureIndex(base)
-		index = int32(base.Index)
-	}
-	msg := &nl.TcMsg{
-		Family:  nl.FAMILY_ALL,
-		Ifindex: index,
-		Parent:  chain.Parent,
-	}
-	req.AddData(msg)
-	req.AddData(nl.NewRtAttr(nl.TCA_CHAIN, nl.Uint32Attr(chain.Chain)))
-
-	_, err := req.Execute(unix.NETLINK_ROUTE, 0)
-	return err
-}
-
-// ChainList gets a list of chains in the system.
-// Equivalent to: `tc chain list`.
-// The list can be filtered by link.
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func ChainList(link Link, parent uint32) ([]Chain, error) {
-	return pkgHandle.ChainList(link, parent)
-}
-
-// ChainList gets a list of chains in the system.
-// Equivalent to: `tc chain list`.
-// The list can be filtered by link.
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func (h *Handle) ChainList(link Link, parent uint32) ([]Chain, error) {
-	req := h.newNetlinkRequest(unix.RTM_GETCHAIN, unix.NLM_F_DUMP)
-	index := int32(0)
-	if link != nil {
-		base := link.Attrs()
-		h.ensureIndex(base)
-		index = int32(base.Index)
-	}
-	msg := &nl.TcMsg{
-		Family:  nl.FAMILY_ALL,
-		Ifindex: index,
-		Parent:  parent,
-	}
-	req.AddData(msg)
-
-	msgs, executeErr := req.Execute(unix.NETLINK_ROUTE, unix.RTM_NEWCHAIN)
-	if executeErr != nil && !errors.Is(executeErr, ErrDumpInterrupted) {
-		return nil, executeErr
-	}
-
-	var res []Chain
-	for _, m := range msgs {
-		msg := nl.DeserializeTcMsg(m)
-
-		attrs, err := nl.ParseRouteAttr(m[msg.Len():])
-		if err != nil {
-			return nil, err
-		}
-
-		// skip chains from other interfaces
-		if link != nil && msg.Ifindex != index {
-			continue
-		}
-
-		var chain Chain
-		for _, attr := range attrs {
-			switch attr.Attr.Type {
-			case nl.TCA_CHAIN:
-				chain.Chain = native.Uint32(attr.Value)
-				chain.Parent = parent
-			}
-		}
-		res = append(res, chain)
-	}
-
-	return res, executeErr
-}

+ 0 - 241
vendor/github.com/vishvananda/netlink/class.go

@@ -1,241 +0,0 @@
-package netlink
-
-import (
-	"fmt"
-)
-
-// Class interfaces for all classes
-type Class interface {
-	Attrs() *ClassAttrs
-	Type() string
-}
-
-// Generic networking statistics for netlink users.
-// This file contains "gnet_" prefixed structs and relevant functions.
-// See Documentation/networking/getn_stats.txt in Linux source code for more details.
-
-// GnetStatsBasic Ref: struct gnet_stats_basic { ... }
-type GnetStatsBasic struct {
-	Bytes   uint64 // number of seen bytes
-	Packets uint32 // number of seen packets
-}
-
-// GnetStatsRateEst Ref: struct gnet_stats_rate_est { ... }
-type GnetStatsRateEst struct {
-	Bps uint32 // current byte rate
-	Pps uint32 // current packet rate
-}
-
-// GnetStatsRateEst64 Ref: struct gnet_stats_rate_est64 { ... }
-type GnetStatsRateEst64 struct {
-	Bps uint64 // current byte rate
-	Pps uint64 // current packet rate
-}
-
-// GnetStatsQueue Ref: struct gnet_stats_queue { ... }
-type GnetStatsQueue struct {
-	Qlen       uint32 // queue length
-	Backlog    uint32 // backlog size of queue
-	Drops      uint32 // number of dropped packets
-	Requeues   uint32 // number of requues
-	Overlimits uint32 // number of enqueues over the limit
-}
-
-// ClassStatistics representation based on generic networking statistics for netlink.
-// See Documentation/networking/gen_stats.txt in Linux source code for more details.
-type ClassStatistics struct {
-	Basic   *GnetStatsBasic
-	Queue   *GnetStatsQueue
-	RateEst *GnetStatsRateEst
-	BasicHw *GnetStatsBasic // Hardward statistics added in kernel 4.20
-}
-
-// NewClassStatistics Construct a ClassStatistics struct which fields are all initialized by 0.
-func NewClassStatistics() *ClassStatistics {
-	return &ClassStatistics{
-		Basic:   &GnetStatsBasic{},
-		Queue:   &GnetStatsQueue{},
-		RateEst: &GnetStatsRateEst{},
-		BasicHw: &GnetStatsBasic{},
-	}
-}
-
-// ClassAttrs represents a netlink class. A filter is associated with a link,
-// has a handle and a parent. The root filter of a device should have a
-// parent == HANDLE_ROOT.
-type ClassAttrs struct {
-	LinkIndex  int
-	Handle     uint32
-	Parent     uint32
-	Leaf       uint32
-	Statistics *ClassStatistics
-}
-
-func (q ClassAttrs) String() string {
-	return fmt.Sprintf("{LinkIndex: %d, Handle: %s, Parent: %s, Leaf: %d}", q.LinkIndex, HandleStr(q.Handle), HandleStr(q.Parent), q.Leaf)
-}
-
-// HtbClassAttrs stores the attributes of HTB class
-type HtbClassAttrs struct {
-	// TODO handle all attributes
-	Rate    uint64
-	Ceil    uint64
-	Buffer  uint32
-	Cbuffer uint32
-	Quantum uint32
-	Level   uint32
-	Prio    uint32
-}
-
-func (q HtbClassAttrs) String() string {
-	return fmt.Sprintf("{Rate: %d, Ceil: %d, Buffer: %d, Cbuffer: %d}", q.Rate, q.Ceil, q.Buffer, q.Cbuffer)
-}
-
-// HtbClass represents an Htb class
-type HtbClass struct {
-	ClassAttrs
-	Rate    uint64
-	Ceil    uint64
-	Buffer  uint32
-	Cbuffer uint32
-	Quantum uint32
-	Level   uint32
-	Prio    uint32
-}
-
-func (q HtbClass) String() string {
-	return fmt.Sprintf("{Rate: %d, Ceil: %d, Buffer: %d, Cbuffer: %d}", q.Rate, q.Ceil, q.Buffer, q.Cbuffer)
-}
-
-// Attrs returns the class attributes
-func (q *HtbClass) Attrs() *ClassAttrs {
-	return &q.ClassAttrs
-}
-
-// Type return the class type
-func (q *HtbClass) Type() string {
-	return "htb"
-}
-
-// GenericClass classes represent types that are not currently understood
-// by this netlink library.
-type GenericClass struct {
-	ClassAttrs
-	ClassType string
-}
-
-// Attrs return the class attributes
-func (class *GenericClass) Attrs() *ClassAttrs {
-	return &class.ClassAttrs
-}
-
-// Type return the class type
-func (class *GenericClass) Type() string {
-	return class.ClassType
-}
-
-// ServiceCurve is a nondecreasing function of some time unit, returning the amount of service
-// (an allowed or allocated amount of bandwidth) at some specific point in time. The purpose of it
-// should be subconsciously obvious: if a class was allowed to transfer not less than the amount
-// specified by its service curve, then the service curve is not violated.
-type ServiceCurve struct {
-	m1 uint32
-	d  uint32
-	m2 uint32
-}
-
-// Attrs return the parameters of the service curve
-func (c *ServiceCurve) Attrs() (uint32, uint32, uint32) {
-	return c.m1, c.d, c.m2
-}
-
-// Burst returns the burst rate (m1) of the curve
-func (c *ServiceCurve) Burst() uint32 {
-	return c.m1
-}
-
-// Delay return the delay (d) of the curve
-func (c *ServiceCurve) Delay() uint32 {
-	return c.d
-}
-
-// Rate returns the rate (m2) of the curve
-func (c *ServiceCurve) Rate() uint32 {
-	return c.m2
-}
-
-// HfscClass is a representation of the HFSC class
-type HfscClass struct {
-	ClassAttrs
-	Rsc ServiceCurve
-	Fsc ServiceCurve
-	Usc ServiceCurve
-}
-
-// SetUsc sets the USC curve. The bandwidth (m1 and m2) is specified in bits and the delay in
-// seconds.
-func (hfsc *HfscClass) SetUsc(m1 uint32, d uint32, m2 uint32) {
-	hfsc.Usc = ServiceCurve{m1: m1, d: d, m2: m2}
-}
-
-// SetFsc sets the Fsc curve. The bandwidth (m1 and m2) is specified in bits and the delay in
-// seconds.
-func (hfsc *HfscClass) SetFsc(m1 uint32, d uint32, m2 uint32) {
-	hfsc.Fsc = ServiceCurve{m1: m1, d: d, m2: m2}
-}
-
-// SetRsc sets the Rsc curve. The bandwidth (m1 and m2) is specified in bits and the delay in
-// seconds.
-func (hfsc *HfscClass) SetRsc(m1 uint32, d uint32, m2 uint32) {
-	hfsc.Rsc = ServiceCurve{m1: m1, d: d, m2: m2}
-}
-
-// SetSC implements the SC from the `tc` CLI. This function behaves the same as if one would set the
-// USC through the `tc` command-line tool. This means bandwidth (m1 and m2) is specified in bits and
-// the delay in ms.
-func (hfsc *HfscClass) SetSC(m1 uint32, d uint32, m2 uint32) {
-	hfsc.SetRsc(m1, d, m2)
-	hfsc.SetFsc(m1, d, m2)
-}
-
-// SetUL implements the UL from the `tc` CLI. This function behaves the same as if one would set the
-// USC through the `tc` command-line tool. This means bandwidth (m1 and m2) is specified in bits and
-// the delay in ms.
-func (hfsc *HfscClass) SetUL(m1 uint32, d uint32, m2 uint32) {
-	hfsc.SetUsc(m1, d, m2)
-}
-
-// SetLS implements the LS from the `tc` CLI. This function behaves the same as if one would set the
-// USC through the `tc` command-line tool. This means bandwidth (m1 and m2) is specified in bits and
-// the delay in ms.
-func (hfsc *HfscClass) SetLS(m1 uint32, d uint32, m2 uint32) {
-	hfsc.SetFsc(m1, d, m2)
-}
-
-// NewHfscClass returns a new HFSC struct with the set parameters
-func NewHfscClass(attrs ClassAttrs) *HfscClass {
-	return &HfscClass{
-		ClassAttrs: attrs,
-		Rsc:        ServiceCurve{},
-		Fsc:        ServiceCurve{},
-		Usc:        ServiceCurve{},
-	}
-}
-
-// String() returns a string that contains the information and attributes of the HFSC class
-func (hfsc *HfscClass) String() string {
-	return fmt.Sprintf(
-		"{%s -- {RSC: {m1=%d d=%d m2=%d}} {FSC: {m1=%d d=%d m2=%d}} {USC: {m1=%d d=%d m2=%d}}}",
-		hfsc.Attrs(), hfsc.Rsc.m1*8, hfsc.Rsc.d, hfsc.Rsc.m2*8, hfsc.Fsc.m1*8, hfsc.Fsc.d, hfsc.Fsc.m2*8, hfsc.Usc.m1*8, hfsc.Usc.d, hfsc.Usc.m2*8,
-	)
-}
-
-// Attrs return the Hfsc parameters
-func (hfsc *HfscClass) Attrs() *ClassAttrs {
-	return &hfsc.ClassAttrs
-}
-
-// Type return the type of the class
-func (hfsc *HfscClass) Type() string {
-	return "hfsc"
-}

+ 0 - 406
vendor/github.com/vishvananda/netlink/class_linux.go

@@ -1,406 +0,0 @@
-package netlink
-
-import (
-	"bytes"
-	"encoding/binary"
-	"encoding/hex"
-	"errors"
-	"fmt"
-	"syscall"
-
-	"github.com/vishvananda/netlink/nl"
-	"golang.org/x/sys/unix"
-)
-
-// Internal tc_stats representation in Go struct.
-// This is for internal uses only to deserialize the payload of rtattr.
-// After the deserialization, this should be converted into the canonical stats
-// struct, ClassStatistics, in case of statistics of a class.
-// Ref: struct tc_stats { ... }
-type tcStats struct {
-	Bytes      uint64 // Number of enqueued bytes
-	Packets    uint32 // Number of enqueued packets
-	Drops      uint32 // Packets dropped because of lack of resources
-	Overlimits uint32 // Number of throttle events when this flow goes out of allocated bandwidth
-	Bps        uint32 // Current flow byte rate
-	Pps        uint32 // Current flow packet rate
-	Qlen       uint32
-	Backlog    uint32
-}
-
-// NewHtbClass NOTE: function is in here because it uses other linux functions
-func NewHtbClass(attrs ClassAttrs, cattrs HtbClassAttrs) *HtbClass {
-	mtu := 1600
-	rate := cattrs.Rate / 8
-	ceil := cattrs.Ceil / 8
-	buffer := cattrs.Buffer
-	cbuffer := cattrs.Cbuffer
-
-	if ceil == 0 {
-		ceil = rate
-	}
-
-	if buffer == 0 {
-		buffer = uint32(float64(rate)/Hz() + float64(mtu))
-	}
-	buffer = Xmittime(rate, buffer)
-
-	if cbuffer == 0 {
-		cbuffer = uint32(float64(ceil)/Hz() + float64(mtu))
-	}
-	cbuffer = Xmittime(ceil, cbuffer)
-
-	return &HtbClass{
-		ClassAttrs: attrs,
-		Rate:       rate,
-		Ceil:       ceil,
-		Buffer:     buffer,
-		Cbuffer:    cbuffer,
-		Level:      0,
-		Prio:       cattrs.Prio,
-		Quantum:    cattrs.Quantum,
-	}
-}
-
-// ClassDel will delete a class from the system.
-// Equivalent to: `tc class del $class`
-func ClassDel(class Class) error {
-	return pkgHandle.ClassDel(class)
-}
-
-// ClassDel will delete a class from the system.
-// Equivalent to: `tc class del $class`
-func (h *Handle) ClassDel(class Class) error {
-	return h.classModify(unix.RTM_DELTCLASS, 0, class)
-}
-
-// ClassChange will change a class in place
-// Equivalent to: `tc class change $class`
-// The parent and handle MUST NOT be changed.
-func ClassChange(class Class) error {
-	return pkgHandle.ClassChange(class)
-}
-
-// ClassChange will change a class in place
-// Equivalent to: `tc class change $class`
-// The parent and handle MUST NOT be changed.
-func (h *Handle) ClassChange(class Class) error {
-	return h.classModify(unix.RTM_NEWTCLASS, 0, class)
-}
-
-// ClassReplace will replace a class to the system.
-// quivalent to: `tc class replace $class`
-// The handle MAY be changed.
-// If a class already exist with this parent/handle pair, the class is changed.
-// If a class does not already exist with this parent/handle, a new class is created.
-func ClassReplace(class Class) error {
-	return pkgHandle.ClassReplace(class)
-}
-
-// ClassReplace will replace a class to the system.
-// quivalent to: `tc class replace $class`
-// The handle MAY be changed.
-// If a class already exist with this parent/handle pair, the class is changed.
-// If a class does not already exist with this parent/handle, a new class is created.
-func (h *Handle) ClassReplace(class Class) error {
-	return h.classModify(unix.RTM_NEWTCLASS, unix.NLM_F_CREATE, class)
-}
-
-// ClassAdd will add a class to the system.
-// Equivalent to: `tc class add $class`
-func ClassAdd(class Class) error {
-	return pkgHandle.ClassAdd(class)
-}
-
-// ClassAdd will add a class to the system.
-// Equivalent to: `tc class add $class`
-func (h *Handle) ClassAdd(class Class) error {
-	return h.classModify(
-		unix.RTM_NEWTCLASS,
-		unix.NLM_F_CREATE|unix.NLM_F_EXCL,
-		class,
-	)
-}
-
-func (h *Handle) classModify(cmd, flags int, class Class) error {
-	req := h.newNetlinkRequest(cmd, flags|unix.NLM_F_ACK)
-	base := class.Attrs()
-	msg := &nl.TcMsg{
-		Family:  nl.FAMILY_ALL,
-		Ifindex: int32(base.LinkIndex),
-		Handle:  base.Handle,
-		Parent:  base.Parent,
-	}
-	req.AddData(msg)
-
-	if cmd != unix.RTM_DELTCLASS {
-		if err := classPayload(req, class); err != nil {
-			return err
-		}
-	}
-	_, err := req.Execute(unix.NETLINK_ROUTE, 0)
-	return err
-}
-
-func classPayload(req *nl.NetlinkRequest, class Class) error {
-	req.AddData(nl.NewRtAttr(nl.TCA_KIND, nl.ZeroTerminated(class.Type())))
-
-	options := nl.NewRtAttr(nl.TCA_OPTIONS, nil)
-	switch class.Type() {
-	case "htb":
-		htb := class.(*HtbClass)
-		opt := nl.TcHtbCopt{}
-		opt.Buffer = htb.Buffer
-		opt.Cbuffer = htb.Cbuffer
-		opt.Quantum = htb.Quantum
-		opt.Level = htb.Level
-		opt.Prio = htb.Prio
-		// TODO: Handle Debug properly. For now default to 0
-		/* Calculate {R,C}Tab and set Rate and Ceil */
-		cellLog := -1
-		ccellLog := -1
-		linklayer := nl.LINKLAYER_ETHERNET
-		mtu := 1600
-		var rtab [256]uint32
-		var ctab [256]uint32
-		tcrate := nl.TcRateSpec{Rate: uint32(htb.Rate)}
-		if CalcRtable(&tcrate, rtab[:], cellLog, uint32(mtu), linklayer) < 0 {
-			return errors.New("HTB: failed to calculate rate table")
-		}
-		opt.Rate = tcrate
-		tcceil := nl.TcRateSpec{Rate: uint32(htb.Ceil)}
-		if CalcRtable(&tcceil, ctab[:], ccellLog, uint32(mtu), linklayer) < 0 {
-			return errors.New("HTB: failed to calculate ceil rate table")
-		}
-		opt.Ceil = tcceil
-		options.AddRtAttr(nl.TCA_HTB_PARMS, opt.Serialize())
-		options.AddRtAttr(nl.TCA_HTB_RTAB, SerializeRtab(rtab))
-		options.AddRtAttr(nl.TCA_HTB_CTAB, SerializeRtab(ctab))
-		if htb.Rate >= uint64(1<<32) {
-			options.AddRtAttr(nl.TCA_HTB_RATE64, nl.Uint64Attr(htb.Rate))
-		}
-		if htb.Ceil >= uint64(1<<32) {
-			options.AddRtAttr(nl.TCA_HTB_CEIL64, nl.Uint64Attr(htb.Ceil))
-		}
-	case "hfsc":
-		hfsc := class.(*HfscClass)
-		opt := nl.HfscCopt{}
-		rm1, rd, rm2 := hfsc.Rsc.Attrs()
-		opt.Rsc.Set(rm1/8, rd, rm2/8)
-		fm1, fd, fm2 := hfsc.Fsc.Attrs()
-		opt.Fsc.Set(fm1/8, fd, fm2/8)
-		um1, ud, um2 := hfsc.Usc.Attrs()
-		opt.Usc.Set(um1/8, ud, um2/8)
-		options.AddRtAttr(nl.TCA_HFSC_RSC, nl.SerializeHfscCurve(&opt.Rsc))
-		options.AddRtAttr(nl.TCA_HFSC_FSC, nl.SerializeHfscCurve(&opt.Fsc))
-		options.AddRtAttr(nl.TCA_HFSC_USC, nl.SerializeHfscCurve(&opt.Usc))
-	}
-	req.AddData(options)
-	return nil
-}
-
-// ClassList gets a list of classes in the system.
-// Equivalent to: `tc class show`.
-//
-// Generally returns nothing if link and parent are not specified.
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func ClassList(link Link, parent uint32) ([]Class, error) {
-	return pkgHandle.ClassList(link, parent)
-}
-
-// ClassList gets a list of classes in the system.
-// Equivalent to: `tc class show`.
-//
-// Generally returns nothing if link and parent are not specified.
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func (h *Handle) ClassList(link Link, parent uint32) ([]Class, error) {
-	req := h.newNetlinkRequest(unix.RTM_GETTCLASS, unix.NLM_F_DUMP)
-	msg := &nl.TcMsg{
-		Family: nl.FAMILY_ALL,
-		Parent: parent,
-	}
-	if link != nil {
-		base := link.Attrs()
-		h.ensureIndex(base)
-		msg.Ifindex = int32(base.Index)
-	}
-	req.AddData(msg)
-
-	msgs, executeErr := req.Execute(unix.NETLINK_ROUTE, unix.RTM_NEWTCLASS)
-	if executeErr != nil && !errors.Is(executeErr, ErrDumpInterrupted) {
-		return nil, executeErr
-	}
-
-	var res []Class
-	for _, m := range msgs {
-		msg := nl.DeserializeTcMsg(m)
-
-		attrs, err := nl.ParseRouteAttr(m[msg.Len():])
-		if err != nil {
-			return nil, err
-		}
-
-		base := ClassAttrs{
-			LinkIndex:  int(msg.Ifindex),
-			Handle:     msg.Handle,
-			Parent:     msg.Parent,
-			Statistics: nil,
-		}
-
-		var class Class
-		classType := ""
-		for _, attr := range attrs {
-			switch attr.Attr.Type {
-			case nl.TCA_KIND:
-				classType = string(attr.Value[:len(attr.Value)-1])
-				switch classType {
-				case "htb":
-					class = &HtbClass{}
-				case "hfsc":
-					class = &HfscClass{}
-				default:
-					class = &GenericClass{ClassType: classType}
-				}
-			case nl.TCA_OPTIONS:
-				switch classType {
-				case "htb":
-					data, err := nl.ParseRouteAttr(attr.Value)
-					if err != nil {
-						return nil, err
-					}
-					_, err = parseHtbClassData(class, data)
-					if err != nil {
-						return nil, err
-					}
-				case "hfsc":
-					data, err := nl.ParseRouteAttr(attr.Value)
-					if err != nil {
-						return nil, err
-					}
-					_, err = parseHfscClassData(class, data)
-					if err != nil {
-						return nil, err
-					}
-				}
-			// For backward compatibility.
-			case nl.TCA_STATS:
-				base.Statistics, err = parseTcStats(attr.Value)
-				if err != nil {
-					return nil, err
-				}
-			case nl.TCA_STATS2:
-				base.Statistics, err = parseTcStats2(attr.Value)
-				if err != nil {
-					return nil, err
-				}
-			}
-		}
-		*class.Attrs() = base
-		res = append(res, class)
-	}
-
-	return res, executeErr
-}
-
-func parseHtbClassData(class Class, data []syscall.NetlinkRouteAttr) (bool, error) {
-	htb := class.(*HtbClass)
-	detailed := false
-	for _, datum := range data {
-		switch datum.Attr.Type {
-		case nl.TCA_HTB_PARMS:
-			opt := nl.DeserializeTcHtbCopt(datum.Value)
-			htb.Rate = uint64(opt.Rate.Rate)
-			htb.Ceil = uint64(opt.Ceil.Rate)
-			htb.Buffer = opt.Buffer
-			htb.Cbuffer = opt.Cbuffer
-			htb.Quantum = opt.Quantum
-			htb.Level = opt.Level
-			htb.Prio = opt.Prio
-		case nl.TCA_HTB_RATE64:
-			htb.Rate = native.Uint64(datum.Value[0:8])
-		case nl.TCA_HTB_CEIL64:
-			htb.Ceil = native.Uint64(datum.Value[0:8])
-		}
-	}
-	return detailed, nil
-}
-
-func parseHfscClassData(class Class, data []syscall.NetlinkRouteAttr) (bool, error) {
-	hfsc := class.(*HfscClass)
-	detailed := false
-	for _, datum := range data {
-		m1, d, m2 := nl.DeserializeHfscCurve(datum.Value).Attrs()
-		switch datum.Attr.Type {
-		case nl.TCA_HFSC_RSC:
-			hfsc.Rsc = ServiceCurve{m1: m1 * 8, d: d, m2: m2 * 8}
-		case nl.TCA_HFSC_FSC:
-			hfsc.Fsc = ServiceCurve{m1: m1 * 8, d: d, m2: m2 * 8}
-		case nl.TCA_HFSC_USC:
-			hfsc.Usc = ServiceCurve{m1: m1 * 8, d: d, m2: m2 * 8}
-		}
-	}
-	return detailed, nil
-}
-
-func parseTcStats(data []byte) (*ClassStatistics, error) {
-	buf := &bytes.Buffer{}
-	buf.Write(data)
-	tcStats := &tcStats{}
-	if err := binary.Read(buf, native, tcStats); err != nil {
-		return nil, err
-	}
-
-	stats := NewClassStatistics()
-	stats.Basic.Bytes = tcStats.Bytes
-	stats.Basic.Packets = tcStats.Packets
-	stats.Queue.Qlen = tcStats.Qlen
-	stats.Queue.Backlog = tcStats.Backlog
-	stats.Queue.Drops = tcStats.Drops
-	stats.Queue.Overlimits = tcStats.Overlimits
-	stats.RateEst.Bps = tcStats.Bps
-	stats.RateEst.Pps = tcStats.Pps
-
-	return stats, nil
-}
-
-func parseGnetStats(data []byte, gnetStats interface{}) error {
-	buf := &bytes.Buffer{}
-	buf.Write(data)
-	return binary.Read(buf, native, gnetStats)
-}
-
-func parseTcStats2(data []byte) (*ClassStatistics, error) {
-	rtAttrs, err := nl.ParseRouteAttr(data)
-	if err != nil {
-		return nil, err
-	}
-	stats := NewClassStatistics()
-	for _, datum := range rtAttrs {
-		switch datum.Attr.Type {
-		case nl.TCA_STATS_BASIC:
-			if err := parseGnetStats(datum.Value, stats.Basic); err != nil {
-				return nil, fmt.Errorf("Failed to parse ClassStatistics.Basic with: %v\n%s",
-					err, hex.Dump(datum.Value))
-			}
-		case nl.TCA_STATS_QUEUE:
-			if err := parseGnetStats(datum.Value, stats.Queue); err != nil {
-				return nil, fmt.Errorf("Failed to parse ClassStatistics.Queue with: %v\n%s",
-					err, hex.Dump(datum.Value))
-			}
-		case nl.TCA_STATS_RATE_EST:
-			if err := parseGnetStats(datum.Value, stats.RateEst); err != nil {
-				return nil, fmt.Errorf("Failed to parse ClassStatistics.RateEst with: %v\n%s",
-					err, hex.Dump(datum.Value))
-			}
-		case nl.TCA_STATS_BASIC_HW:
-			if err := parseGnetStats(datum.Value, stats.BasicHw); err != nil {
-				return nil, fmt.Errorf("Failed to parse ClassStatistics.BasicHw with: %v\n%s",
-					err, hex.Dump(datum.Value))
-			}
-		}
-	}
-
-	return stats, nil
-}

+ 0 - 921
vendor/github.com/vishvananda/netlink/conntrack_linux.go

@@ -1,921 +0,0 @@
-package netlink
-
-import (
-	"bytes"
-	"encoding/binary"
-	"errors"
-	"fmt"
-	"io/fs"
-	"net"
-	"time"
-
-	"github.com/vishvananda/netlink/nl"
-	"golang.org/x/sys/unix"
-)
-
-// ConntrackTableType Conntrack table for the netlink operation
-type ConntrackTableType uint8
-
-const (
-	// ConntrackTable Conntrack table
-	// https://github.com/torvalds/linux/blob/master/include/uapi/linux/netfilter/nfnetlink.h -> #define NFNL_SUBSYS_CTNETLINK		 1
-	ConntrackTable = 1
-	// ConntrackExpectTable Conntrack expect table
-	// https://github.com/torvalds/linux/blob/master/include/uapi/linux/netfilter/nfnetlink.h -> #define NFNL_SUBSYS_CTNETLINK_EXP 2
-	ConntrackExpectTable = 2
-)
-
-const (
-	// backward compatibility with golang 1.6 which does not have io.SeekCurrent
-	seekCurrent = 1
-)
-
-// InetFamily Family type
-type InetFamily uint8
-
-//  -L [table] [options]          List conntrack or expectation table
-//  -G [table] parameters         Get conntrack or expectation
-
-//  -I [table] parameters         Create a conntrack or expectation
-//  -U [table] parameters         Update a conntrack
-//  -E [table] [options]          Show events
-
-//  -C [table]                    Show counter
-//  -S                            Show statistics
-
-// ConntrackTableList returns the flow list of a table of a specific family
-// conntrack -L [table] [options]          List conntrack or expectation table
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func ConntrackTableList(table ConntrackTableType, family InetFamily) ([]*ConntrackFlow, error) {
-	return pkgHandle.ConntrackTableList(table, family)
-}
-
-// ConntrackTableFlush flushes all the flows of a specified table
-// conntrack -F [table]            Flush table
-// The flush operation applies to all the family types
-func ConntrackTableFlush(table ConntrackTableType) error {
-	return pkgHandle.ConntrackTableFlush(table)
-}
-
-// ConntrackCreate creates a new conntrack flow in the desired table
-// conntrack -I [table]		Create a conntrack or expectation
-func ConntrackCreate(table ConntrackTableType, family InetFamily, flow *ConntrackFlow) error {
-	return pkgHandle.ConntrackCreate(table, family, flow)
-}
-
-// ConntrackUpdate updates an existing conntrack flow in the desired table using the handle
-// conntrack -U [table]		Update a conntrack
-func ConntrackUpdate(table ConntrackTableType, family InetFamily, flow *ConntrackFlow) error {
-	return pkgHandle.ConntrackUpdate(table, family, flow)
-}
-
-// ConntrackDeleteFilter deletes entries on the specified table on the base of the filter
-// conntrack -D [table] parameters         Delete conntrack or expectation
-//
-// Deprecated: use [ConntrackDeleteFilters] instead.
-func ConntrackDeleteFilter(table ConntrackTableType, family InetFamily, filter CustomConntrackFilter) (uint, error) {
-	return pkgHandle.ConntrackDeleteFilters(table, family, filter)
-}
-
-// ConntrackDeleteFilters deletes entries on the specified table matching any of the specified filters
-// conntrack -D [table] parameters         Delete conntrack or expectation
-func ConntrackDeleteFilters(table ConntrackTableType, family InetFamily, filters ...CustomConntrackFilter) (uint, error) {
-	return pkgHandle.ConntrackDeleteFilters(table, family, filters...)
-}
-
-// ConntrackTableList returns the flow list of a table of a specific family using the netlink handle passed
-// conntrack -L [table] [options]          List conntrack or expectation table
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func (h *Handle) ConntrackTableList(table ConntrackTableType, family InetFamily) ([]*ConntrackFlow, error) {
-	res, executeErr := h.dumpConntrackTable(table, family)
-	if executeErr != nil && !errors.Is(executeErr, ErrDumpInterrupted) {
-		return nil, executeErr
-	}
-
-	// Deserialize all the flows
-	var result []*ConntrackFlow
-	for _, dataRaw := range res {
-		result = append(result, parseRawData(dataRaw))
-	}
-
-	return result, executeErr
-}
-
-// ConntrackTableFlush flushes all the flows of a specified table using the netlink handle passed
-// conntrack -F [table]            Flush table
-// The flush operation applies to all the family types
-func (h *Handle) ConntrackTableFlush(table ConntrackTableType) error {
-	req := h.newConntrackRequest(table, unix.AF_INET, nl.IPCTNL_MSG_CT_DELETE, unix.NLM_F_ACK)
-	_, err := req.Execute(unix.NETLINK_NETFILTER, 0)
-	return err
-}
-
-// ConntrackCreate creates a new conntrack flow in the desired table using the handle
-// conntrack -I [table]		Create a conntrack or expectation
-func (h *Handle) ConntrackCreate(table ConntrackTableType, family InetFamily, flow *ConntrackFlow) error {
-	req := h.newConntrackRequest(table, family, nl.IPCTNL_MSG_CT_NEW, unix.NLM_F_ACK|unix.NLM_F_CREATE)
-	attr, err := flow.toNlData()
-	if err != nil {
-		return err
-	}
-
-	for _, a := range attr {
-		req.AddData(a)
-	}
-
-	_, err = req.Execute(unix.NETLINK_NETFILTER, 0)
-	return err
-}
-
-// ConntrackUpdate updates an existing conntrack flow in the desired table using the handle
-// conntrack -U [table]		Update a conntrack
-func (h *Handle) ConntrackUpdate(table ConntrackTableType, family InetFamily, flow *ConntrackFlow) error {
-	req := h.newConntrackRequest(table, family, nl.IPCTNL_MSG_CT_NEW, unix.NLM_F_ACK|unix.NLM_F_REPLACE)
-	attr, err := flow.toNlData()
-	if err != nil {
-		return err
-	}
-
-	for _, a := range attr {
-		req.AddData(a)
-	}
-
-	_, err = req.Execute(unix.NETLINK_NETFILTER, 0)
-	return err
-}
-
-// ConntrackDeleteFilter deletes entries on the specified table on the base of the filter using the netlink handle passed
-// conntrack -D [table] parameters         Delete conntrack or expectation
-//
-// Deprecated: use [Handle.ConntrackDeleteFilters] instead.
-func (h *Handle) ConntrackDeleteFilter(table ConntrackTableType, family InetFamily, filter CustomConntrackFilter) (uint, error) {
-	return h.ConntrackDeleteFilters(table, family, filter)
-}
-
-// ConntrackDeleteFilters deletes entries on the specified table matching any of the specified filters using the netlink handle passed
-// conntrack -D [table] parameters         Delete conntrack or expectation
-func (h *Handle) ConntrackDeleteFilters(table ConntrackTableType, family InetFamily, filters ...CustomConntrackFilter) (uint, error) {
-	var finalErr error
-	res, err := h.dumpConntrackTable(table, family)
-	if err != nil {
-		if !errors.Is(err, ErrDumpInterrupted) {
-			return 0, err
-		}
-		// This allows us to at least do a best effort to try to clean the
-		// entries matching the filter.
-		finalErr = err
-	}
-
-	var totalFilterErrors int
-	var matched uint
-	for _, dataRaw := range res {
-		flow := parseRawData(dataRaw)
-		for _, filter := range filters {
-			if match := filter.MatchConntrackFlow(flow); match {
-				req2 := h.newConntrackRequest(table, family, nl.IPCTNL_MSG_CT_DELETE, unix.NLM_F_ACK)
-				// skip the first 4 byte that are the netfilter header, the newConntrackRequest is adding it already
-				req2.AddRawData(dataRaw[4:])
-				if _, err = req2.Execute(unix.NETLINK_NETFILTER, 0); err == nil || errors.Is(err, fs.ErrNotExist) {
-					matched++
-					// flow is already deleted, no need to match on other filters and continue to the next flow.
-					break
-				} else {
-					totalFilterErrors++
-				}
-			}
-		}
-	}
-	if totalFilterErrors > 0 {
-		finalErr = errors.Join(finalErr, fmt.Errorf("failed to delete %d conntrack flows with %d filters", totalFilterErrors, len(filters)))
-	}
-	return matched, finalErr
-}
-
-func (h *Handle) newConntrackRequest(table ConntrackTableType, family InetFamily, operation, flags int) *nl.NetlinkRequest {
-	// Create the Netlink request object
-	req := h.newNetlinkRequest((int(table)<<8)|operation, flags)
-	// Add the netfilter header
-	msg := &nl.Nfgenmsg{
-		NfgenFamily: uint8(family),
-		Version:     nl.NFNETLINK_V0,
-		ResId:       0,
-	}
-	req.AddData(msg)
-	return req
-}
-
-func (h *Handle) dumpConntrackTable(table ConntrackTableType, family InetFamily) ([][]byte, error) {
-	req := h.newConntrackRequest(table, family, nl.IPCTNL_MSG_CT_GET, unix.NLM_F_DUMP)
-	return req.Execute(unix.NETLINK_NETFILTER, 0)
-}
-
-// ProtoInfo wraps an L4-protocol structure - roughly corresponds to the
-// __nfct_protoinfo union found in libnetfilter_conntrack/include/internal/object.h.
-// Currently, only protocol names, and TCP state is supported.
-type ProtoInfo interface {
-	Protocol() string
-}
-
-// ProtoInfoTCP corresponds to the `tcp` struct of the __nfct_protoinfo union.
-// Only TCP state is currently supported.
-type ProtoInfoTCP struct {
-	State uint8
-}
-// Protocol returns "tcp".
-func (*ProtoInfoTCP) Protocol() string {return "tcp"}
-func (p *ProtoInfoTCP) toNlData() ([]*nl.RtAttr, error) {
-	ctProtoInfo := nl.NewRtAttr(unix.NLA_F_NESTED | nl.CTA_PROTOINFO, []byte{})
-	ctProtoInfoTCP := nl.NewRtAttr(unix.NLA_F_NESTED|nl.CTA_PROTOINFO_TCP, []byte{})
-	ctProtoInfoTCPState := nl.NewRtAttr(nl.CTA_PROTOINFO_TCP_STATE, nl.Uint8Attr(p.State))
-	ctProtoInfoTCP.AddChild(ctProtoInfoTCPState)
-	ctProtoInfo.AddChild(ctProtoInfoTCP)
-
-	return []*nl.RtAttr{ctProtoInfo}, nil
-}
-
-// ProtoInfoSCTP only supports the protocol name.
-type ProtoInfoSCTP struct {}
-// Protocol returns "sctp".
-func (*ProtoInfoSCTP) Protocol() string {return "sctp"}
-
-// ProtoInfoDCCP only supports the protocol name.
-type ProtoInfoDCCP struct {}
-// Protocol returns "dccp".
-func (*ProtoInfoDCCP) Protocol() string {return "dccp"}
-
-// The full conntrack flow structure is very complicated and can be found in the file:
-// http://git.netfilter.org/libnetfilter_conntrack/tree/include/internal/object.h
-// For the time being, the structure below allows to parse and extract the base information of a flow
-type IPTuple struct {
-	Bytes    uint64
-	DstIP    net.IP
-	DstPort  uint16
-	Packets  uint64
-	Protocol uint8
-	SrcIP    net.IP
-	SrcPort  uint16
-}
-
-// toNlData generates the inner fields of a nested tuple netlink datastructure
-// does not generate the "nested"-flagged outer message.
-func (t *IPTuple) toNlData(family uint8) ([]*nl.RtAttr, error) {
-
-	var srcIPsFlag, dstIPsFlag int
-	if family == nl.FAMILY_V4 {
-		srcIPsFlag = nl.CTA_IP_V4_SRC
-		dstIPsFlag = nl.CTA_IP_V4_DST
-	} else if family == nl.FAMILY_V6 {
-		srcIPsFlag = nl.CTA_IP_V6_SRC
-		dstIPsFlag = nl.CTA_IP_V6_DST
-	} else {
-		return []*nl.RtAttr{}, fmt.Errorf("couldn't generate netlink message for tuple due to unrecognized FamilyType '%d'", family)
-	}
-
-	ctTupleIP := nl.NewRtAttr(unix.NLA_F_NESTED|nl.CTA_TUPLE_IP, nil)
-	ctTupleIPSrc := nl.NewRtAttr(srcIPsFlag, t.SrcIP)
-	ctTupleIP.AddChild(ctTupleIPSrc)
-	ctTupleIPDst := nl.NewRtAttr(dstIPsFlag, t.DstIP)
-	ctTupleIP.AddChild(ctTupleIPDst)
-
-	ctTupleProto := nl.NewRtAttr(unix.NLA_F_NESTED|nl.CTA_TUPLE_PROTO, nil)
-	ctTupleProtoNum := nl.NewRtAttr(nl.CTA_PROTO_NUM, []byte{t.Protocol})
-	ctTupleProto.AddChild(ctTupleProtoNum)
-	ctTupleProtoSrcPort := nl.NewRtAttr(nl.CTA_PROTO_SRC_PORT, nl.BEUint16Attr(t.SrcPort))
-	ctTupleProto.AddChild(ctTupleProtoSrcPort)
-	ctTupleProtoDstPort := nl.NewRtAttr(nl.CTA_PROTO_DST_PORT, nl.BEUint16Attr(t.DstPort))
-	ctTupleProto.AddChild(ctTupleProtoDstPort, )
-
-	return []*nl.RtAttr{ctTupleIP, ctTupleProto}, nil
-}
-
-type ConntrackFlow struct {
-	FamilyType uint8
-	Forward    IPTuple
-	Reverse    IPTuple
-	Mark       uint32
-	Zone       uint16
-	TimeStart  uint64
-	TimeStop   uint64
-	TimeOut    uint32
-	Labels     []byte
-	ProtoInfo  ProtoInfo
-}
-
-func (s *ConntrackFlow) String() string {
-	// conntrack cmd output:
-	// udp      17 src=127.0.0.1 dst=127.0.0.1 sport=4001 dport=1234 packets=5 bytes=532 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=1234 dport=4001 packets=10 bytes=1078 mark=0 labels=0x00000000050012ac4202010000000000 zone=100
-	//             start=2019-07-26 01:26:21.557800506 +0000 UTC stop=1970-01-01 00:00:00 +0000 UTC timeout=30(sec)
-	start := time.Unix(0, int64(s.TimeStart))
-	stop := time.Unix(0, int64(s.TimeStop))
-	timeout := int32(s.TimeOut)
-	res := fmt.Sprintf("%s\t%d src=%s dst=%s sport=%d dport=%d packets=%d bytes=%d\tsrc=%s dst=%s sport=%d dport=%d packets=%d bytes=%d mark=0x%x ",
-		nl.L4ProtoMap[s.Forward.Protocol], s.Forward.Protocol,
-		s.Forward.SrcIP.String(), s.Forward.DstIP.String(), s.Forward.SrcPort, s.Forward.DstPort, s.Forward.Packets, s.Forward.Bytes,
-		s.Reverse.SrcIP.String(), s.Reverse.DstIP.String(), s.Reverse.SrcPort, s.Reverse.DstPort, s.Reverse.Packets, s.Reverse.Bytes,
-		s.Mark)
-	if len(s.Labels) > 0 {
-		res += fmt.Sprintf("labels=0x%x ", s.Labels)
-	}
-	if s.Zone != 0 {
-		res += fmt.Sprintf("zone=%d ", s.Zone)
-	}
-	res += fmt.Sprintf("start=%v stop=%v timeout=%d(sec)", start, stop, timeout)
-	return res
-}
-
-// toNlData generates netlink messages representing the flow.
-func (s *ConntrackFlow) toNlData() ([]*nl.RtAttr, error) {
-	var payload []*nl.RtAttr
-	// The message structure is built as follows:
-	//	<len, NLA_F_NESTED|CTA_TUPLE_ORIG>
-	//		<len, NLA_F_NESTED|CTA_TUPLE_IP>
-	//			<len, [CTA_IP_V4_SRC|CTA_IP_V6_SRC]>
-	//			<IP>
-	//			<len, [CTA_IP_V4_DST|CTA_IP_V6_DST]>
-	//			<IP>
-	//		<len, NLA_F_NESTED|nl.CTA_TUPLE_PROTO>
-	//			<len, CTA_PROTO_NUM>
-	//			<uint8>
-	//			<len, CTA_PROTO_SRC_PORT>
-	//			<BEuint16>
-	//			<len, CTA_PROTO_DST_PORT>
-	//			<BEuint16>
-	// 	<len, NLA_F_NESTED|CTA_TUPLE_REPLY>
-	//		<len, NLA_F_NESTED|CTA_TUPLE_IP>
-	//			<len, [CTA_IP_V4_SRC|CTA_IP_V6_SRC]>
-	//			<IP>
-	//			<len, [CTA_IP_V4_DST|CTA_IP_V6_DST]>
-	//			<IP>
-	//		<len, NLA_F_NESTED|nl.CTA_TUPLE_PROTO>
-	//			<len, CTA_PROTO_NUM>
-	//			<uint8>
-	//			<len, CTA_PROTO_SRC_PORT>
-	//			<BEuint16>
-	//			<len, CTA_PROTO_DST_PORT>
-	//			<BEuint16>
-	//	<len, CTA_STATUS>
-	//	<uint64>
-	//	<len, CTA_MARK>
-	//	<BEuint64>
-	//	<len, CTA_TIMEOUT>
-	//	<BEuint64>
-	//	<len, NLA_F_NESTED|CTA_PROTOINFO>
- 
-	// CTA_TUPLE_ORIG
-	ctTupleOrig := nl.NewRtAttr(unix.NLA_F_NESTED|nl.CTA_TUPLE_ORIG, nil)
-	forwardFlowAttrs, err := s.Forward.toNlData(s.FamilyType)
-	if err != nil {
-		return nil, fmt.Errorf("couldn't generate netlink data for conntrack forward flow: %w", err)
-	}
-	for _, a := range forwardFlowAttrs {
-		ctTupleOrig.AddChild(a)
-	}
-
-	// CTA_TUPLE_REPLY
-	ctTupleReply := nl.NewRtAttr(unix.NLA_F_NESTED|nl.CTA_TUPLE_REPLY, nil)
-	reverseFlowAttrs, err := s.Reverse.toNlData(s.FamilyType)
-	if err != nil {
-		return nil, fmt.Errorf("couldn't generate netlink data for conntrack reverse flow: %w", err)
-	}
-	for _, a := range reverseFlowAttrs {
-		ctTupleReply.AddChild(a)
-	}
-
-	ctMark := nl.NewRtAttr(nl.CTA_MARK, nl.BEUint32Attr(s.Mark))
-	ctTimeout := nl.NewRtAttr(nl.CTA_TIMEOUT, nl.BEUint32Attr(s.TimeOut))
-
-	payload = append(payload, ctTupleOrig, ctTupleReply, ctMark, ctTimeout)
-
-	if s.ProtoInfo != nil {
-		switch p := s.ProtoInfo.(type) {
-		case *ProtoInfoTCP:
-			attrs, err := p.toNlData()
-			if err != nil {
-				return nil, fmt.Errorf("couldn't generate netlink data for conntrack flow's TCP protoinfo: %w", err)
-			}
-			payload = append(payload, attrs...)
-		default:
-			return nil, errors.New("couldn't generate netlink data for conntrack: field 'ProtoInfo' only supports TCP or nil")
-		}
-	}
-
-	return payload, nil
-}
-
-// This method parse the ip tuple structure
-// The message structure is the following:
-// <len, [CTA_IP_V4_SRC|CTA_IP_V6_SRC], 16 bytes for the IP>
-// <len, [CTA_IP_V4_DST|CTA_IP_V6_DST], 16 bytes for the IP>
-// <len, NLA_F_NESTED|nl.CTA_TUPLE_PROTO, 1 byte for the protocol, 3 bytes of padding>
-// <len, CTA_PROTO_SRC_PORT, 2 bytes for the source port, 2 bytes of padding>
-// <len, CTA_PROTO_DST_PORT, 2 bytes for the source port, 2 bytes of padding>
-func parseIpTuple(reader *bytes.Reader, tpl *IPTuple) uint8 {
-	for i := 0; i < 2; i++ {
-		_, t, _, v := parseNfAttrTLV(reader)
-		switch t {
-		case nl.CTA_IP_V4_SRC, nl.CTA_IP_V6_SRC:
-			tpl.SrcIP = v
-		case nl.CTA_IP_V4_DST, nl.CTA_IP_V6_DST:
-			tpl.DstIP = v
-		}
-	}
-	// Get total length of nested protocol-specific info.
-	_, _, protoInfoTotalLen := parseNfAttrTL(reader)
-	_, t, l, v := parseNfAttrTLV(reader)
-	// Track the number of bytes read.
-	protoInfoBytesRead := uint16(nl.SizeofNfattr) + l
-	if t == nl.CTA_PROTO_NUM {
-		tpl.Protocol = uint8(v[0])
-	}
-	// We only parse TCP & UDP headers. Skip the others.
-	if tpl.Protocol != unix.IPPROTO_TCP && tpl.Protocol != unix.IPPROTO_UDP {
-		// skip the rest
-		bytesRemaining := protoInfoTotalLen - protoInfoBytesRead
-		reader.Seek(int64(bytesRemaining), seekCurrent)
-		return tpl.Protocol
-	}
-	// Skip 3 bytes of padding
-	reader.Seek(3, seekCurrent)
-	protoInfoBytesRead += 3
-	for i := 0; i < 2; i++ {
-		_, t, _ := parseNfAttrTL(reader)
-		protoInfoBytesRead += uint16(nl.SizeofNfattr)
-		switch t {
-		case nl.CTA_PROTO_SRC_PORT:
-			parseBERaw16(reader, &tpl.SrcPort)
-			protoInfoBytesRead += 2
-		case nl.CTA_PROTO_DST_PORT:
-			parseBERaw16(reader, &tpl.DstPort)
-			protoInfoBytesRead += 2
-		}
-		// Skip 2 bytes of padding
-		reader.Seek(2, seekCurrent)
-		protoInfoBytesRead += 2
-	}
-	// Skip any remaining/unknown parts of the message
-	bytesRemaining := protoInfoTotalLen - protoInfoBytesRead
-	reader.Seek(int64(bytesRemaining), seekCurrent)
-
-	return tpl.Protocol
-}
-
-func parseNfAttrTLV(r *bytes.Reader) (isNested bool, attrType, len uint16, value []byte) {
-	isNested, attrType, len = parseNfAttrTL(r)
-
-	value = make([]byte, len)
-	binary.Read(r, binary.BigEndian, &value)
-	return isNested, attrType, len, value
-}
-
-func parseNfAttrTL(r *bytes.Reader) (isNested bool, attrType, len uint16) {
-	binary.Read(r, nl.NativeEndian(), &len)
-	len -= nl.SizeofNfattr
-
-	binary.Read(r, nl.NativeEndian(), &attrType)
-	isNested = (attrType & nl.NLA_F_NESTED) == nl.NLA_F_NESTED
-	attrType = attrType & (nl.NLA_F_NESTED - 1)
-	return isNested, attrType, len
-}
-
-// skipNfAttrValue seeks `r` past attr of length `len`.
-// Maintains buffer alignment.
-// Returns length of the seek performed.
-func skipNfAttrValue(r *bytes.Reader, len uint16) uint16 {
-	len = (len + nl.NLA_ALIGNTO - 1) & ^(nl.NLA_ALIGNTO - 1)
-	r.Seek(int64(len), seekCurrent)
-	return len
-}
-
-func parseBERaw16(r *bytes.Reader, v *uint16) {
-	binary.Read(r, binary.BigEndian, v)
-}
-
-func parseBERaw32(r *bytes.Reader, v *uint32) {
-	binary.Read(r, binary.BigEndian, v)
-}
-
-func parseBERaw64(r *bytes.Reader, v *uint64) {
-	binary.Read(r, binary.BigEndian, v)
-}
-
-func parseRaw32(r *bytes.Reader, v *uint32) {
-	binary.Read(r, nl.NativeEndian(), v)
-}
-
-func parseByteAndPacketCounters(r *bytes.Reader) (bytes, packets uint64) {
-	for i := 0; i < 2; i++ {
-		switch _, t, _ := parseNfAttrTL(r); t {
-		case nl.CTA_COUNTERS_BYTES:
-			parseBERaw64(r, &bytes)
-		case nl.CTA_COUNTERS_PACKETS:
-			parseBERaw64(r, &packets)
-		default:
-			return
-		}
-	}
-	return
-}
-
-// when the flow is alive, only the timestamp_start is returned in structure
-func parseTimeStamp(r *bytes.Reader, readSize uint16) (tstart, tstop uint64) {
-	var numTimeStamps int
-	oneItem := nl.SizeofNfattr + 8 // 4 bytes attr header + 8 bytes timestamp
-	if readSize == uint16(oneItem) {
-		numTimeStamps = 1
-	} else if readSize == 2*uint16(oneItem) {
-		numTimeStamps = 2
-	} else {
-		return
-	}
-	for i := 0; i < numTimeStamps; i++ {
-		switch _, t, _ := parseNfAttrTL(r); t {
-		case nl.CTA_TIMESTAMP_START:
-			parseBERaw64(r, &tstart)
-		case nl.CTA_TIMESTAMP_STOP:
-			parseBERaw64(r, &tstop)
-		default:
-			return
-		}
-	}
-	return
-
-}
-
-func parseProtoInfoTCPState(r *bytes.Reader) (s uint8) {
-	binary.Read(r, binary.BigEndian, &s)
-	r.Seek(nl.SizeofNfattr - 1, seekCurrent)
-	return s
-}
-
-// parseProtoInfoTCP reads the entire nested protoinfo structure, but only parses the state attr.
-func parseProtoInfoTCP(r *bytes.Reader, attrLen uint16) (*ProtoInfoTCP) {
-	p := new(ProtoInfoTCP)
-	bytesRead := 0
-	for bytesRead < int(attrLen) {
-		_, t, l := parseNfAttrTL(r)
-		bytesRead += nl.SizeofNfattr
-
-		switch t {
-		case nl.CTA_PROTOINFO_TCP_STATE:
-			p.State = parseProtoInfoTCPState(r)
-			bytesRead += nl.SizeofNfattr
-		default:
-			bytesRead += int(skipNfAttrValue(r, l))
-		}
-	}
-
-	return p
-}
-
-func parseProtoInfo(r *bytes.Reader, attrLen uint16) (p ProtoInfo) {
-	bytesRead := 0
-	for bytesRead < int(attrLen) {
-		_, t, l := parseNfAttrTL(r)
-		bytesRead += nl.SizeofNfattr
-
-		switch t {
-		case nl.CTA_PROTOINFO_TCP:
-			p = parseProtoInfoTCP(r, l)
-			bytesRead += int(l)
-		// No inner fields of DCCP / SCTP currently supported.
-		case nl.CTA_PROTOINFO_DCCP:
-			p = new(ProtoInfoDCCP)
-			skipped := skipNfAttrValue(r, l)
-			bytesRead += int(skipped)
-		case nl.CTA_PROTOINFO_SCTP:
-			p = new(ProtoInfoSCTP)
-			skipped := skipNfAttrValue(r, l)
-			bytesRead += int(skipped)
-		default:
-			skipped := skipNfAttrValue(r, l)
-			bytesRead += int(skipped)
-		}
-	}
-
-	return p
-}
-
-func parseTimeOut(r *bytes.Reader) (ttimeout uint32) {
-	parseBERaw32(r, &ttimeout)
-	return
-}
-
-func parseConnectionMark(r *bytes.Reader) (mark uint32) {
-	parseBERaw32(r, &mark)
-	return
-}
-
-func parseConnectionLabels(r *bytes.Reader) (label []byte) {
-	label = make([]byte, 16) // netfilter defines 128 bit labels value
-	binary.Read(r, nl.NativeEndian(), &label)
-	return
-}
-
-func parseConnectionZone(r *bytes.Reader) (zone uint16) {
-	parseBERaw16(r, &zone)
-	r.Seek(2, seekCurrent)
-	return
-}
-
-func parseRawData(data []byte) *ConntrackFlow {
-	s := &ConntrackFlow{}
-	// First there is the Nfgenmsg header
-	// consume only the family field
-	reader := bytes.NewReader(data)
-	binary.Read(reader, nl.NativeEndian(), &s.FamilyType)
-
-	// skip rest of the Netfilter header
-	reader.Seek(3, seekCurrent)
-	// The message structure is the following:
-	// <len, NLA_F_NESTED|CTA_TUPLE_ORIG> 4 bytes
-	// <len, NLA_F_NESTED|CTA_TUPLE_IP> 4 bytes
-	// flow information of the forward flow
-	// <len, NLA_F_NESTED|CTA_TUPLE_REPLY> 4 bytes
-	// <len, NLA_F_NESTED|CTA_TUPLE_IP> 4 bytes
-	// flow information of the reverse flow
-	for reader.Len() > 0 {
-		if nested, t, l := parseNfAttrTL(reader); nested {
-			switch t {
-			case nl.CTA_TUPLE_ORIG:
-				if nested, t, l = parseNfAttrTL(reader); nested && t == nl.CTA_TUPLE_IP {
-					parseIpTuple(reader, &s.Forward)
-				}
-			case nl.CTA_TUPLE_REPLY:
-				if nested, t, l = parseNfAttrTL(reader); nested && t == nl.CTA_TUPLE_IP {
-					parseIpTuple(reader, &s.Reverse)
-				} else {
-					// Header not recognized skip it
-					skipNfAttrValue(reader, l)
-				}
-			case nl.CTA_COUNTERS_ORIG:
-				s.Forward.Bytes, s.Forward.Packets = parseByteAndPacketCounters(reader)
-			case nl.CTA_COUNTERS_REPLY:
-				s.Reverse.Bytes, s.Reverse.Packets = parseByteAndPacketCounters(reader)
-			case nl.CTA_TIMESTAMP:
-				s.TimeStart, s.TimeStop = parseTimeStamp(reader, l)
-			case nl.CTA_PROTOINFO:
-				s.ProtoInfo = parseProtoInfo(reader, l)
-			default:
-				skipNfAttrValue(reader, l)
-			}
-		} else {
-			switch t {
-			case nl.CTA_MARK:
-				s.Mark = parseConnectionMark(reader)
-				case nl.CTA_LABELS:
-				s.Labels = parseConnectionLabels(reader)
-			case nl.CTA_TIMEOUT:
-				s.TimeOut = parseTimeOut(reader)
-			case nl.CTA_ID, nl.CTA_STATUS, nl.CTA_USE:
-				skipNfAttrValue(reader, l)
-			case nl.CTA_ZONE:
-				s.Zone = parseConnectionZone(reader)
-			default:
-				skipNfAttrValue(reader, l)
-			}
-		}
-	}
-	return s
-}
-
-// Conntrack parameters and options:
-//   -n, --src-nat ip                      source NAT ip
-//   -g, --dst-nat ip                      destination NAT ip
-//   -j, --any-nat ip                      source or destination NAT ip
-//   -m, --mark mark                       Set mark
-//   -c, --secmark secmark                 Set selinux secmark
-//   -e, --event-mask eventmask            Event mask, eg. NEW,DESTROY
-//   -z, --zero                            Zero counters while listing
-//   -o, --output type[,...]               Output format, eg. xml
-//   -l, --label label[,...]               conntrack labels
-
-// Common parameters and options:
-//   -s, --src, --orig-src ip              Source address from original direction
-//   -d, --dst, --orig-dst ip              Destination address from original direction
-//   -r, --reply-src ip            Source address from reply direction
-//   -q, --reply-dst ip            Destination address from reply direction
-//   -p, --protonum proto          Layer 4 Protocol, eg. 'tcp'
-//   -f, --family proto            Layer 3 Protocol, eg. 'ipv6'
-//   -t, --timeout timeout         Set timeout
-//   -u, --status status           Set status, eg. ASSURED
-//   -w, --zone value              Set conntrack zone
-//   --orig-zone value             Set zone for original direction
-//   --reply-zone value            Set zone for reply direction
-//   -b, --buffer-size             Netlink socket buffer size
-//   --mask-src ip                 Source mask address
-//   --mask-dst ip                 Destination mask address
-
-// Layer 4 Protocol common parameters and options:
-// TCP, UDP, SCTP, UDPLite and DCCP
-//    --sport, --orig-port-src port    Source port in original direction
-//    --dport, --orig-port-dst port    Destination port in original direction
-
-// Filter types
-type ConntrackFilterType uint8
-
-const (
-	ConntrackOrigSrcIP     = iota                // -orig-src ip    Source address from original direction
-	ConntrackOrigDstIP                           // -orig-dst ip    Destination address from original direction
-	ConntrackReplySrcIP                          // --reply-src ip  Reply Source IP
-	ConntrackReplyDstIP                          // --reply-dst ip  Reply Destination IP
-	ConntrackReplyAnyIP                          // Match source or destination reply IP
-	ConntrackOrigSrcPort                         // --orig-port-src port    Source port in original direction
-	ConntrackOrigDstPort                         // --orig-port-dst port    Destination port in original direction
-	ConntrackMatchLabels                         // --label label1,label2   Labels used in entry
-	ConntrackUnmatchLabels                       // --label label1,label2   Labels not used in entry
-	ConntrackNatSrcIP      = ConntrackReplySrcIP // deprecated use instead ConntrackReplySrcIP
-	ConntrackNatDstIP      = ConntrackReplyDstIP // deprecated use instead ConntrackReplyDstIP
-	ConntrackNatAnyIP      = ConntrackReplyAnyIP // deprecated use instead ConntrackReplyAnyIP
-)
-
-type CustomConntrackFilter interface {
-	// MatchConntrackFlow applies the filter to the flow and returns true if the flow matches
-	// the filter or false otherwise
-	MatchConntrackFlow(flow *ConntrackFlow) bool
-}
-
-type ConntrackFilter struct {
-	ipNetFilter map[ConntrackFilterType]*net.IPNet
-	portFilter  map[ConntrackFilterType]uint16
-	protoFilter uint8
-	labelFilter map[ConntrackFilterType][][]byte
-	zoneFilter  *uint16
-}
-
-// AddIPNet adds a IP subnet to the conntrack filter
-func (f *ConntrackFilter) AddIPNet(tp ConntrackFilterType, ipNet *net.IPNet) error {
-	if ipNet == nil {
-		return fmt.Errorf("Filter attribute empty")
-	}
-	if f.ipNetFilter == nil {
-		f.ipNetFilter = make(map[ConntrackFilterType]*net.IPNet)
-	}
-	if _, ok := f.ipNetFilter[tp]; ok {
-		return errors.New("Filter attribute already present")
-	}
-	f.ipNetFilter[tp] = ipNet
-	return nil
-}
-
-// AddIP adds an IP to the conntrack filter
-func (f *ConntrackFilter) AddIP(tp ConntrackFilterType, ip net.IP) error {
-	if ip == nil {
-		return fmt.Errorf("Filter attribute empty")
-	}
-	return f.AddIPNet(tp, NewIPNet(ip))
-}
-
-// AddPort adds a Port to the conntrack filter if the Layer 4 protocol allows it
-func (f *ConntrackFilter) AddPort(tp ConntrackFilterType, port uint16) error {
-	switch f.protoFilter {
-	// TCP, UDP, DCCP, SCTP, UDPLite
-	case 6, 17, 33, 132, 136:
-	default:
-		return fmt.Errorf("Filter attribute not available without a valid Layer 4 protocol: %d", f.protoFilter)
-	}
-
-	if f.portFilter == nil {
-		f.portFilter = make(map[ConntrackFilterType]uint16)
-	}
-	if _, ok := f.portFilter[tp]; ok {
-		return errors.New("Filter attribute already present")
-	}
-	f.portFilter[tp] = port
-	return nil
-}
-
-// AddProtocol adds the Layer 4 protocol to the conntrack filter
-func (f *ConntrackFilter) AddProtocol(proto uint8) error {
-	if f.protoFilter != 0 {
-		return errors.New("Filter attribute already present")
-	}
-	f.protoFilter = proto
-	return nil
-}
-
-// AddLabels adds the provided list (zero or more) of labels to the conntrack filter
-// ConntrackFilterType here can be either:
-//  1. ConntrackMatchLabels: This matches every flow that has a label value (len(flow.Labels) > 0)
-//     against the list of provided labels. If `flow.Labels` contains ALL the provided labels
-//     it is considered a match. This can be used when you want to match flows that contain
-//     one or more labels.
-//  2. ConntrackUnmatchLabels:  This matches every flow that has a label value (len(flow.Labels) > 0)
-//     against the list of provided labels. If `flow.Labels` does NOT contain ALL the provided labels
-//     it is considered a match. This can be used when you want to match flows that don't contain
-//     one or more labels.
-func (f *ConntrackFilter) AddLabels(tp ConntrackFilterType, labels [][]byte) error {
-	if len(labels) == 0 {
-		return errors.New("Invalid length for provided labels")
-	}
-	if f.labelFilter == nil {
-		f.labelFilter = make(map[ConntrackFilterType][][]byte)
-	}
-	if _, ok := f.labelFilter[tp]; ok {
-		return errors.New("Filter attribute already present")
-	}
-	f.labelFilter[tp] = labels
-	return nil
-}
-
-// AddZone adds a zone to the conntrack filter
-func (f *ConntrackFilter) AddZone(zone uint16) error {
-	if f.zoneFilter != nil {
-		return errors.New("Filter attribute already present")
-	}
-	f.zoneFilter = &zone
-	return nil
-}
-
-// MatchConntrackFlow applies the filter to the flow and returns true if the flow matches the filter
-// false otherwise
-func (f *ConntrackFilter) MatchConntrackFlow(flow *ConntrackFlow) bool {
-	if len(f.ipNetFilter) == 0 && len(f.portFilter) == 0 && f.protoFilter == 0 && len(f.labelFilter) == 0 && f.zoneFilter == nil {
-		// empty filter always not match
-		return false
-	}
-
-	// -p, --protonum proto          Layer 4 Protocol, eg. 'tcp'
-	if f.protoFilter != 0 && flow.Forward.Protocol != f.protoFilter {
-		// different Layer 4 protocol always not match
-		return false
-	}
-
-	// Conntrack zone filter
-	if f.zoneFilter != nil && *f.zoneFilter != flow.Zone {
-		return false
-	}
-
-	match := true
-
-	// IP conntrack filter
-	if len(f.ipNetFilter) > 0 {
-		// -orig-src ip   Source address from original direction
-		if elem, found := f.ipNetFilter[ConntrackOrigSrcIP]; found {
-			match = match && elem.Contains(flow.Forward.SrcIP)
-		}
-
-		// -orig-dst ip   Destination address from original direction
-		if elem, found := f.ipNetFilter[ConntrackOrigDstIP]; match && found {
-			match = match && elem.Contains(flow.Forward.DstIP)
-		}
-
-		// -src-nat ip    Source NAT ip
-		if elem, found := f.ipNetFilter[ConntrackReplySrcIP]; match && found {
-			match = match && elem.Contains(flow.Reverse.SrcIP)
-		}
-
-		// -dst-nat ip    Destination NAT ip
-		if elem, found := f.ipNetFilter[ConntrackReplyDstIP]; match && found {
-			match = match && elem.Contains(flow.Reverse.DstIP)
-		}
-
-		// Match source or destination reply IP
-		if elem, found := f.ipNetFilter[ConntrackReplyAnyIP]; match && found {
-			match = match && (elem.Contains(flow.Reverse.SrcIP) || elem.Contains(flow.Reverse.DstIP))
-		}
-	}
-
-	// Layer 4 Port filter
-	if len(f.portFilter) > 0 {
-		// -orig-port-src port	Source port from original direction
-		if elem, found := f.portFilter[ConntrackOrigSrcPort]; match && found {
-			match = match && elem == flow.Forward.SrcPort
-		}
-
-		// -orig-port-dst port	Destination port from original direction
-		if elem, found := f.portFilter[ConntrackOrigDstPort]; match && found {
-			match = match && elem == flow.Forward.DstPort
-		}
-	}
-
-	// Label filter
-	if len(f.labelFilter) > 0 {
-		if len(flow.Labels) > 0 {
-			// --label label1,label2 in conn entry;
-			// every label passed should be contained in flow.Labels for a match to be true
-			if elem, found := f.labelFilter[ConntrackMatchLabels]; match && found {
-				for _, label := range elem {
-					match = match && (bytes.Contains(flow.Labels, label))
-				}
-			}
-			// --label label1,label2 in conn entry;
-			// every label passed should be not contained in flow.Labels for a match to be true
-			if elem, found := f.labelFilter[ConntrackUnmatchLabels]; match && found {
-				for _, label := range elem {
-					match = match && !(bytes.Contains(flow.Labels, label))
-				}
-			}
-		} else {
-			// flow doesn't contain labels, so it doesn't contain or notContain any provided matches
-			match = false
-		}
-	}
-
-	return match
-}
-
-var _ CustomConntrackFilter = (*ConntrackFilter)(nil)

+ 0 - 72
vendor/github.com/vishvananda/netlink/conntrack_unspecified.go

@@ -1,72 +0,0 @@
-// +build !linux
-
-package netlink
-
-// ConntrackTableType Conntrack table for the netlink operation
-type ConntrackTableType uint8
-
-// InetFamily Family type
-type InetFamily uint8
-
-// ConntrackFlow placeholder
-type ConntrackFlow struct{}
-
-// CustomConntrackFilter placeholder
-type CustomConntrackFilter struct{}
-
-// ConntrackFilter placeholder
-type ConntrackFilter struct{}
-
-// ConntrackTableList returns the flow list of a table of a specific family
-// conntrack -L [table] [options]          List conntrack or expectation table
-func ConntrackTableList(table ConntrackTableType, family InetFamily) ([]*ConntrackFlow, error) {
-	return nil, ErrNotImplemented
-}
-
-// ConntrackTableFlush flushes all the flows of a specified table
-// conntrack -F [table]            Flush table
-// The flush operation applies to all the family types
-func ConntrackTableFlush(table ConntrackTableType) error {
-	return ErrNotImplemented
-}
-
-// ConntrackDeleteFilter deletes entries on the specified table on the base of the filter
-// conntrack -D [table] parameters         Delete conntrack or expectation
-//
-// Deprecated: use [ConntrackDeleteFilters] instead.
-func ConntrackDeleteFilter(table ConntrackTableType, family InetFamily, filter *ConntrackFilter) (uint, error) {
-	return 0, ErrNotImplemented
-}
-
-// ConntrackDeleteFilters deletes entries on the specified table matching any of the specified filters
-// conntrack -D [table] parameters         Delete conntrack or expectation
-func ConntrackDeleteFilters(table ConntrackTableType, family InetFamily, filters ...CustomConntrackFilter) (uint, error) {
-	return 0, ErrNotImplemented
-}
-
-// ConntrackTableList returns the flow list of a table of a specific family using the netlink handle passed
-// conntrack -L [table] [options]          List conntrack or expectation table
-func (h *Handle) ConntrackTableList(table ConntrackTableType, family InetFamily) ([]*ConntrackFlow, error) {
-	return nil, ErrNotImplemented
-}
-
-// ConntrackTableFlush flushes all the flows of a specified table using the netlink handle passed
-// conntrack -F [table]            Flush table
-// The flush operation applies to all the family types
-func (h *Handle) ConntrackTableFlush(table ConntrackTableType) error {
-	return ErrNotImplemented
-}
-
-// ConntrackDeleteFilter deletes entries on the specified table on the base of the filter using the netlink handle passed
-// conntrack -D [table] parameters         Delete conntrack or expectation
-//
-// Deprecated: use [Handle.ConntrackDeleteFilters] instead.
-func (h *Handle) ConntrackDeleteFilter(table ConntrackTableType, family InetFamily, filter *ConntrackFilter) (uint, error) {
-	return 0, ErrNotImplemented
-}
-
-// ConntrackDeleteFilters deletes entries on the specified table matching any of the specified filters using the netlink handle passed
-// conntrack -D [table] parameters         Delete conntrack or expectation
-func (h *Handle) ConntrackDeleteFilters(table ConntrackTableType, family InetFamily, filters ...CustomConntrackFilter) (uint, error) {
-	return 0, ErrNotImplemented
-}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 1175
vendor/github.com/vishvananda/netlink/devlink_linux.go


+ 0 - 514
vendor/github.com/vishvananda/netlink/filter.go

@@ -1,514 +0,0 @@
-package netlink
-
-import (
-	"fmt"
-	"net"
-)
-
-type Filter interface {
-	Attrs() *FilterAttrs
-	Type() string
-}
-
-// FilterAttrs represents a netlink filter. A filter is associated with a link,
-// has a handle and a parent. The root filter of a device should have a
-// parent == HANDLE_ROOT.
-type FilterAttrs struct {
-	LinkIndex int
-	Handle    uint32
-	Parent    uint32
-	Priority  uint16 // lower is higher priority
-	Protocol  uint16 // unix.ETH_P_*
-	Chain     *uint32
-}
-
-func (q FilterAttrs) String() string {
-	return fmt.Sprintf("{LinkIndex: %d, Handle: %s, Parent: %s, Priority: %d, Protocol: %d}", q.LinkIndex, HandleStr(q.Handle), HandleStr(q.Parent), q.Priority, q.Protocol)
-}
-
-type TcAct int32
-
-const (
-	TC_ACT_EXT_SHIFT    = 28
-	TC_ACT_EXT_VAL_MASK = (1 << TC_ACT_EXT_SHIFT) - 1
-)
-
-const (
-	TC_ACT_UNSPEC     TcAct = -1
-	TC_ACT_OK         TcAct = 0
-	TC_ACT_RECLASSIFY TcAct = 1
-	TC_ACT_SHOT       TcAct = 2
-	TC_ACT_PIPE       TcAct = 3
-	TC_ACT_STOLEN     TcAct = 4
-	TC_ACT_QUEUED     TcAct = 5
-	TC_ACT_REPEAT     TcAct = 6
-	TC_ACT_REDIRECT   TcAct = 7
-	TC_ACT_JUMP       TcAct = 0x10000000
-)
-
-func getTcActExt(local int32) int32 {
-	return local << TC_ACT_EXT_SHIFT
-}
-
-func getTcActGotoChain() TcAct {
-	return TcAct(getTcActExt(2))
-}
-
-func getTcActExtOpcode(combined int32) int32 {
-	return combined & (^TC_ACT_EXT_VAL_MASK)
-}
-
-func TcActExtCmp(combined int32, opcode int32) bool {
-	return getTcActExtOpcode(combined) == opcode
-}
-
-func (a TcAct) String() string {
-	switch a {
-	case TC_ACT_UNSPEC:
-		return "unspec"
-	case TC_ACT_OK:
-		return "ok"
-	case TC_ACT_RECLASSIFY:
-		return "reclassify"
-	case TC_ACT_SHOT:
-		return "shot"
-	case TC_ACT_PIPE:
-		return "pipe"
-	case TC_ACT_STOLEN:
-		return "stolen"
-	case TC_ACT_QUEUED:
-		return "queued"
-	case TC_ACT_REPEAT:
-		return "repeat"
-	case TC_ACT_REDIRECT:
-		return "redirect"
-	case TC_ACT_JUMP:
-		return "jump"
-	}
-	if TcActExtCmp(int32(a), int32(getTcActGotoChain())) {
-		return "goto"
-	}
-	return fmt.Sprintf("0x%x", int32(a))
-}
-
-type TcPolAct int32
-
-const (
-	TC_POLICE_UNSPEC     TcPolAct = TcPolAct(TC_ACT_UNSPEC)
-	TC_POLICE_OK         TcPolAct = TcPolAct(TC_ACT_OK)
-	TC_POLICE_RECLASSIFY TcPolAct = TcPolAct(TC_ACT_RECLASSIFY)
-	TC_POLICE_SHOT       TcPolAct = TcPolAct(TC_ACT_SHOT)
-	TC_POLICE_PIPE       TcPolAct = TcPolAct(TC_ACT_PIPE)
-)
-
-func (a TcPolAct) String() string {
-	switch a {
-	case TC_POLICE_UNSPEC:
-		return "unspec"
-	case TC_POLICE_OK:
-		return "ok"
-	case TC_POLICE_RECLASSIFY:
-		return "reclassify"
-	case TC_POLICE_SHOT:
-		return "shot"
-	case TC_POLICE_PIPE:
-		return "pipe"
-	}
-	return fmt.Sprintf("0x%x", int32(a))
-}
-
-type ActionAttrs struct {
-	Index      int
-	Capab      int
-	Action     TcAct
-	Refcnt     int
-	Bindcnt    int
-	Statistics *ActionStatistic
-	Timestamp  *ActionTimestamp
-}
-
-func (q ActionAttrs) String() string {
-	return fmt.Sprintf("{Index: %d, Capab: %x, Action: %s, Refcnt: %d, Bindcnt: %d}", q.Index, q.Capab, q.Action.String(), q.Refcnt, q.Bindcnt)
-}
-
-type ActionTimestamp struct {
-	Installed uint64
-	LastUsed  uint64
-	Expires   uint64
-	FirstUsed uint64
-}
-
-func (t ActionTimestamp) String() string {
-	return fmt.Sprintf("Installed %d LastUsed %d Expires %d FirstUsed %d", t.Installed, t.LastUsed, t.Expires, t.FirstUsed)
-}
-
-type ActionStatistic ClassStatistics
-
-// Action represents an action in any supported filter.
-type Action interface {
-	Attrs() *ActionAttrs
-	Type() string
-}
-
-type GenericAction struct {
-	ActionAttrs
-	Chain int32
-}
-
-func (action *GenericAction) Type() string {
-	return "generic"
-}
-
-func (action *GenericAction) Attrs() *ActionAttrs {
-	return &action.ActionAttrs
-}
-
-type BpfAction struct {
-	ActionAttrs
-	Fd   int
-	Name string
-}
-
-func (action *BpfAction) Type() string {
-	return "bpf"
-}
-
-func (action *BpfAction) Attrs() *ActionAttrs {
-	return &action.ActionAttrs
-}
-
-type ConnmarkAction struct {
-	ActionAttrs
-	Zone uint16
-}
-
-func (action *ConnmarkAction) Type() string {
-	return "connmark"
-}
-
-func (action *ConnmarkAction) Attrs() *ActionAttrs {
-	return &action.ActionAttrs
-}
-
-func NewConnmarkAction() *ConnmarkAction {
-	return &ConnmarkAction{
-		ActionAttrs: ActionAttrs{
-			Action: TC_ACT_PIPE,
-		},
-	}
-}
-
-type CsumUpdateFlags uint32
-
-const (
-	TCA_CSUM_UPDATE_FLAG_IPV4HDR CsumUpdateFlags = 1
-	TCA_CSUM_UPDATE_FLAG_ICMP    CsumUpdateFlags = 2
-	TCA_CSUM_UPDATE_FLAG_IGMP    CsumUpdateFlags = 4
-	TCA_CSUM_UPDATE_FLAG_TCP     CsumUpdateFlags = 8
-	TCA_CSUM_UPDATE_FLAG_UDP     CsumUpdateFlags = 16
-	TCA_CSUM_UPDATE_FLAG_UDPLITE CsumUpdateFlags = 32
-	TCA_CSUM_UPDATE_FLAG_SCTP    CsumUpdateFlags = 64
-)
-
-type CsumAction struct {
-	ActionAttrs
-	UpdateFlags CsumUpdateFlags
-}
-
-func (action *CsumAction) Type() string {
-	return "csum"
-}
-
-func (action *CsumAction) Attrs() *ActionAttrs {
-	return &action.ActionAttrs
-}
-
-func NewCsumAction() *CsumAction {
-	return &CsumAction{
-		ActionAttrs: ActionAttrs{
-			Action: TC_ACT_PIPE,
-		},
-	}
-}
-
-type VlanAct int8
-
-type VlanAction struct {
-	ActionAttrs
-	Action VlanAct
-	VlanID uint16
-}
-
-const (
-	TCA_VLAN_ACT_POP  VlanAct = 1
-	TCA_VLAN_ACT_PUSH VlanAct = 2
-)
-
-func (action *VlanAction) Type() string {
-	return "vlan"
-}
-
-func (action *VlanAction) Attrs() *ActionAttrs {
-	return &action.ActionAttrs
-}
-
-func NewVlanAction() *VlanAction {
-	return &VlanAction{
-		ActionAttrs: ActionAttrs{
-			Action: TC_ACT_PIPE,
-		},
-	}
-}
-
-type MirredAct uint8
-
-func (a MirredAct) String() string {
-	switch a {
-	case TCA_EGRESS_REDIR:
-		return "egress redir"
-	case TCA_EGRESS_MIRROR:
-		return "egress mirror"
-	case TCA_INGRESS_REDIR:
-		return "ingress redir"
-	case TCA_INGRESS_MIRROR:
-		return "ingress mirror"
-	}
-	return "unknown"
-}
-
-const (
-	TCA_EGRESS_REDIR   MirredAct = 1 /* packet redirect to EGRESS*/
-	TCA_EGRESS_MIRROR  MirredAct = 2 /* mirror packet to EGRESS */
-	TCA_INGRESS_REDIR  MirredAct = 3 /* packet redirect to INGRESS*/
-	TCA_INGRESS_MIRROR MirredAct = 4 /* mirror packet to INGRESS */
-)
-
-type MirredAction struct {
-	ActionAttrs
-	MirredAction MirredAct
-	Ifindex      int
-}
-
-func (action *MirredAction) Type() string {
-	return "mirred"
-}
-
-func (action *MirredAction) Attrs() *ActionAttrs {
-	return &action.ActionAttrs
-}
-
-func NewMirredAction(redirIndex int) *MirredAction {
-	return &MirredAction{
-		ActionAttrs: ActionAttrs{
-			Action: TC_ACT_STOLEN,
-		},
-		MirredAction: TCA_EGRESS_REDIR,
-		Ifindex:      redirIndex,
-	}
-}
-
-type TunnelKeyAct int8
-
-const (
-	TCA_TUNNEL_KEY_SET   TunnelKeyAct = 1 // set tunnel key
-	TCA_TUNNEL_KEY_UNSET TunnelKeyAct = 2 // unset tunnel key
-)
-
-type TunnelKeyAction struct {
-	ActionAttrs
-	Action   TunnelKeyAct
-	SrcAddr  net.IP
-	DstAddr  net.IP
-	KeyID    uint32
-	DestPort uint16
-}
-
-func (action *TunnelKeyAction) Type() string {
-	return "tunnel_key"
-}
-
-func (action *TunnelKeyAction) Attrs() *ActionAttrs {
-	return &action.ActionAttrs
-}
-
-func NewTunnelKeyAction() *TunnelKeyAction {
-	return &TunnelKeyAction{
-		ActionAttrs: ActionAttrs{
-			Action: TC_ACT_PIPE,
-		},
-	}
-}
-
-type SkbEditAction struct {
-	ActionAttrs
-	QueueMapping *uint16
-	PType        *uint16
-	Priority     *uint32
-	Mark         *uint32
-	Mask         *uint32
-}
-
-func (action *SkbEditAction) Type() string {
-	return "skbedit"
-}
-
-func (action *SkbEditAction) Attrs() *ActionAttrs {
-	return &action.ActionAttrs
-}
-
-func NewSkbEditAction() *SkbEditAction {
-	return &SkbEditAction{
-		ActionAttrs: ActionAttrs{
-			Action: TC_ACT_PIPE,
-		},
-	}
-}
-
-type PoliceAction struct {
-	ActionAttrs
-	Rate            uint32 // in byte per second
-	Burst           uint32 // in byte
-	RCellLog        int
-	Mtu             uint32
-	Mpu             uint16 // in byte
-	PeakRate        uint32 // in byte per second
-	PCellLog        int
-	AvRate          uint32 // in byte per second
-	Overhead        uint16
-	LinkLayer       int
-	ExceedAction    TcPolAct
-	NotExceedAction TcPolAct
-}
-
-func (action *PoliceAction) Type() string {
-	return "police"
-}
-
-func (action *PoliceAction) Attrs() *ActionAttrs {
-	return &action.ActionAttrs
-}
-
-func NewPoliceAction() *PoliceAction {
-	return &PoliceAction{
-		RCellLog:        -1,
-		PCellLog:        -1,
-		LinkLayer:       1, // ETHERNET
-		ExceedAction:    TC_POLICE_RECLASSIFY,
-		NotExceedAction: TC_POLICE_OK,
-	}
-}
-
-type SampleAction struct {
-	ActionAttrs
-	Group     uint32
-	Rate      uint32
-	TruncSize uint32
-}
-
-func (action *SampleAction) Type() string {
-	return "sample"
-}
-
-func (action *SampleAction) Attrs() *ActionAttrs {
-	return &action.ActionAttrs
-}
-
-func NewSampleAction() *SampleAction {
-	return &SampleAction{
-		ActionAttrs: ActionAttrs{
-			Action: TC_ACT_PIPE,
-		},
-	}
-}
-
-// MatchAll filters match all packets
-type MatchAll struct {
-	FilterAttrs
-	ClassId uint32
-	Actions []Action
-}
-
-func (filter *MatchAll) Attrs() *FilterAttrs {
-	return &filter.FilterAttrs
-}
-
-func (filter *MatchAll) Type() string {
-	return "matchall"
-}
-
-type FwFilter struct {
-	FilterAttrs
-	ClassId uint32
-	InDev   string
-	Mask    uint32
-	Police  *PoliceAction
-	Actions []Action
-}
-
-func (filter *FwFilter) Attrs() *FilterAttrs {
-	return &filter.FilterAttrs
-}
-
-func (filter *FwFilter) Type() string {
-	return "fw"
-}
-
-type BpfFilter struct {
-	FilterAttrs
-	ClassId      uint32
-	Fd           int
-	Name         string
-	DirectAction bool
-	Id           int
-	Tag          string
-}
-
-func (filter *BpfFilter) Type() string {
-	return "bpf"
-}
-
-func (filter *BpfFilter) Attrs() *FilterAttrs {
-	return &filter.FilterAttrs
-}
-
-// GenericFilter filters represent types that are not currently understood
-// by this netlink library.
-type GenericFilter struct {
-	FilterAttrs
-	FilterType string
-}
-
-func (filter *GenericFilter) Attrs() *FilterAttrs {
-	return &filter.FilterAttrs
-}
-
-func (filter *GenericFilter) Type() string {
-	return filter.FilterType
-}
-
-type PeditAction struct {
-	ActionAttrs
-	Proto      uint8
-	SrcMacAddr net.HardwareAddr
-	DstMacAddr net.HardwareAddr
-	SrcIP      net.IP
-	DstIP      net.IP
-	SrcPort    uint16
-	DstPort    uint16
-}
-
-func (p *PeditAction) Attrs() *ActionAttrs {
-	return &p.ActionAttrs
-}
-
-func (p *PeditAction) Type() string {
-	return "pedit"
-}
-
-func NewPeditAction() *PeditAction {
-	return &PeditAction{
-		ActionAttrs: ActionAttrs{
-			Action: TC_ACT_PIPE,
-		},
-	}
-}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 1229
vendor/github.com/vishvananda/netlink/filter_linux.go


+ 0 - 16
vendor/github.com/vishvananda/netlink/fou.go

@@ -1,16 +0,0 @@
-package netlink
-
-import (
-	"net"
-)
-
-type Fou struct {
-	Family    int
-	Port      int
-	Protocol  int
-	EncapType int
-	Local     net.IP
-	Peer      net.IP
-	PeerPort  int
-	IfIndex   int
-}

+ 0 - 211
vendor/github.com/vishvananda/netlink/fou_linux.go

@@ -1,211 +0,0 @@
-//go:build linux
-// +build linux
-
-package netlink
-
-import (
-	"encoding/binary"
-	"errors"
-	"log"
-	"net"
-
-	"github.com/vishvananda/netlink/nl"
-	"golang.org/x/sys/unix"
-)
-
-const (
-	FOU_GENL_NAME = "fou"
-)
-
-const (
-	FOU_CMD_UNSPEC uint8 = iota
-	FOU_CMD_ADD
-	FOU_CMD_DEL
-	FOU_CMD_GET
-	FOU_CMD_MAX = FOU_CMD_GET
-)
-
-const (
-	FOU_ATTR_UNSPEC = iota
-	FOU_ATTR_PORT
-	FOU_ATTR_AF
-	FOU_ATTR_IPPROTO
-	FOU_ATTR_TYPE
-	FOU_ATTR_REMCSUM_NOPARTIAL
-	FOU_ATTR_LOCAL_V4
-	FOU_ATTR_LOCAL_V6
-	FOU_ATTR_PEER_V4
-	FOU_ATTR_PEER_V6
-	FOU_ATTR_PEER_PORT
-	FOU_ATTR_IFINDEX
-	FOU_ATTR_MAX = FOU_ATTR_REMCSUM_NOPARTIAL
-)
-
-const (
-	FOU_ENCAP_UNSPEC = iota
-	FOU_ENCAP_DIRECT
-	FOU_ENCAP_GUE
-	FOU_ENCAP_MAX = FOU_ENCAP_GUE
-)
-
-var fouFamilyId int
-
-func FouFamilyId() (int, error) {
-	if fouFamilyId != 0 {
-		return fouFamilyId, nil
-	}
-
-	fam, err := GenlFamilyGet(FOU_GENL_NAME)
-	if err != nil {
-		return -1, err
-	}
-
-	fouFamilyId = int(fam.ID)
-	return fouFamilyId, nil
-}
-
-func FouAdd(f Fou) error {
-	return pkgHandle.FouAdd(f)
-}
-
-func (h *Handle) FouAdd(f Fou) error {
-	fam_id, err := FouFamilyId()
-	if err != nil {
-		return err
-	}
-
-	// setting ip protocol conflicts with encapsulation type GUE
-	if f.EncapType == FOU_ENCAP_GUE && f.Protocol != 0 {
-		return errors.New("GUE encapsulation doesn't specify an IP protocol")
-	}
-
-	req := h.newNetlinkRequest(fam_id, unix.NLM_F_ACK)
-
-	// int to byte for port
-	bp := make([]byte, 2)
-	binary.BigEndian.PutUint16(bp[0:2], uint16(f.Port))
-
-	attrs := []*nl.RtAttr{
-		nl.NewRtAttr(FOU_ATTR_PORT, bp),
-		nl.NewRtAttr(FOU_ATTR_TYPE, []byte{uint8(f.EncapType)}),
-		nl.NewRtAttr(FOU_ATTR_AF, []byte{uint8(f.Family)}),
-		nl.NewRtAttr(FOU_ATTR_IPPROTO, []byte{uint8(f.Protocol)}),
-	}
-	raw := []byte{FOU_CMD_ADD, 1, 0, 0}
-	for _, a := range attrs {
-		raw = append(raw, a.Serialize()...)
-	}
-
-	req.AddRawData(raw)
-
-	_, err = req.Execute(unix.NETLINK_GENERIC, 0)
-	return err
-}
-
-func FouDel(f Fou) error {
-	return pkgHandle.FouDel(f)
-}
-
-func (h *Handle) FouDel(f Fou) error {
-	fam_id, err := FouFamilyId()
-	if err != nil {
-		return err
-	}
-
-	req := h.newNetlinkRequest(fam_id, unix.NLM_F_ACK)
-
-	// int to byte for port
-	bp := make([]byte, 2)
-	binary.BigEndian.PutUint16(bp[0:2], uint16(f.Port))
-
-	attrs := []*nl.RtAttr{
-		nl.NewRtAttr(FOU_ATTR_PORT, bp),
-		nl.NewRtAttr(FOU_ATTR_AF, []byte{uint8(f.Family)}),
-	}
-	raw := []byte{FOU_CMD_DEL, 1, 0, 0}
-	for _, a := range attrs {
-		raw = append(raw, a.Serialize()...)
-	}
-
-	req.AddRawData(raw)
-
-	_, err = req.Execute(unix.NETLINK_GENERIC, 0)
-	if err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func FouList(fam int) ([]Fou, error) {
-	return pkgHandle.FouList(fam)
-}
-
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func (h *Handle) FouList(fam int) ([]Fou, error) {
-	fam_id, err := FouFamilyId()
-	if err != nil {
-		return nil, err
-	}
-
-	req := h.newNetlinkRequest(fam_id, unix.NLM_F_DUMP)
-
-	attrs := []*nl.RtAttr{
-		nl.NewRtAttr(FOU_ATTR_AF, []byte{uint8(fam)}),
-	}
-	raw := []byte{FOU_CMD_GET, 1, 0, 0}
-	for _, a := range attrs {
-		raw = append(raw, a.Serialize()...)
-	}
-
-	req.AddRawData(raw)
-
-	msgs, executeErr := req.Execute(unix.NETLINK_GENERIC, 0)
-	if executeErr != nil && !errors.Is(err, ErrDumpInterrupted) {
-		return nil, executeErr
-	}
-
-	fous := make([]Fou, 0, len(msgs))
-	for _, m := range msgs {
-		f, err := deserializeFouMsg(m)
-		if err != nil {
-			return fous, err
-		}
-
-		fous = append(fous, f)
-	}
-
-	return fous, executeErr
-}
-
-func deserializeFouMsg(msg []byte) (Fou, error) {
-	fou := Fou{}
-
-	for attr := range nl.ParseAttributes(msg[4:]) {
-		switch attr.Type {
-		case FOU_ATTR_AF:
-			fou.Family = int(attr.Value[0])
-		case FOU_ATTR_PORT:
-			fou.Port = int(networkOrder.Uint16(attr.Value))
-		case FOU_ATTR_IPPROTO:
-			fou.Protocol = int(attr.Value[0])
-		case FOU_ATTR_TYPE:
-			fou.EncapType = int(attr.Value[0])
-		case FOU_ATTR_LOCAL_V4, FOU_ATTR_LOCAL_V6:
-			fou.Local = net.IP(attr.Value)
-		case FOU_ATTR_PEER_V4, FOU_ATTR_PEER_V6:
-			fou.Peer = net.IP(attr.Value)
-		case FOU_ATTR_PEER_PORT:
-			fou.PeerPort = int(networkOrder.Uint16(attr.Value))
-		case FOU_ATTR_IFINDEX:
-			fou.IfIndex = int(native.Uint16(attr.Value))
-		default:
-			log.Printf("unknown fou attribute from kernel: %+v %v", attr, attr.Type&nl.NLA_TYPE_MASK)
-		}
-	}
-
-	return fou, nil
-}

+ 0 - 16
vendor/github.com/vishvananda/netlink/fou_unspecified.go

@@ -1,16 +0,0 @@
-//go:build !linux
-// +build !linux
-
-package netlink
-
-func FouAdd(f Fou) error {
-	return ErrNotImplemented
-}
-
-func FouDel(f Fou) error {
-	return ErrNotImplemented
-}
-
-func FouList(fam int) ([]Fou, error) {
-	return nil, ErrNotImplemented
-}

+ 0 - 180
vendor/github.com/vishvananda/netlink/genetlink_linux.go

@@ -1,180 +0,0 @@
-package netlink
-
-import (
-	"errors"
-	"fmt"
-	"syscall"
-
-	"github.com/vishvananda/netlink/nl"
-	"golang.org/x/sys/unix"
-)
-
-type GenlOp struct {
-	ID    uint32
-	Flags uint32
-}
-
-type GenlMulticastGroup struct {
-	ID   uint32
-	Name string
-}
-
-type GenlFamily struct {
-	ID      uint16
-	HdrSize uint32
-	Name    string
-	Version uint32
-	MaxAttr uint32
-	Ops     []GenlOp
-	Groups  []GenlMulticastGroup
-}
-
-func parseOps(b []byte) ([]GenlOp, error) {
-	attrs, err := nl.ParseRouteAttr(b)
-	if err != nil {
-		return nil, err
-	}
-	ops := make([]GenlOp, 0, len(attrs))
-	for _, a := range attrs {
-		nattrs, err := nl.ParseRouteAttr(a.Value)
-		if err != nil {
-			return nil, err
-		}
-		var op GenlOp
-		for _, na := range nattrs {
-			switch na.Attr.Type {
-			case nl.GENL_CTRL_ATTR_OP_ID:
-				op.ID = native.Uint32(na.Value)
-			case nl.GENL_CTRL_ATTR_OP_FLAGS:
-				op.Flags = native.Uint32(na.Value)
-			}
-		}
-		ops = append(ops, op)
-	}
-	return ops, nil
-}
-
-func parseMulticastGroups(b []byte) ([]GenlMulticastGroup, error) {
-	attrs, err := nl.ParseRouteAttr(b)
-	if err != nil {
-		return nil, err
-	}
-	groups := make([]GenlMulticastGroup, 0, len(attrs))
-	for _, a := range attrs {
-		nattrs, err := nl.ParseRouteAttr(a.Value)
-		if err != nil {
-			return nil, err
-		}
-		var g GenlMulticastGroup
-		for _, na := range nattrs {
-			switch na.Attr.Type {
-			case nl.GENL_CTRL_ATTR_MCAST_GRP_NAME:
-				g.Name = nl.BytesToString(na.Value)
-			case nl.GENL_CTRL_ATTR_MCAST_GRP_ID:
-				g.ID = native.Uint32(na.Value)
-			}
-		}
-		groups = append(groups, g)
-	}
-	return groups, nil
-}
-
-func (f *GenlFamily) parseAttributes(attrs []syscall.NetlinkRouteAttr) error {
-	for _, a := range attrs {
-		switch a.Attr.Type {
-		case nl.GENL_CTRL_ATTR_FAMILY_NAME:
-			f.Name = nl.BytesToString(a.Value)
-		case nl.GENL_CTRL_ATTR_FAMILY_ID:
-			f.ID = native.Uint16(a.Value)
-		case nl.GENL_CTRL_ATTR_VERSION:
-			f.Version = native.Uint32(a.Value)
-		case nl.GENL_CTRL_ATTR_HDRSIZE:
-			f.HdrSize = native.Uint32(a.Value)
-		case nl.GENL_CTRL_ATTR_MAXATTR:
-			f.MaxAttr = native.Uint32(a.Value)
-		case nl.GENL_CTRL_ATTR_OPS:
-			ops, err := parseOps(a.Value)
-			if err != nil {
-				return err
-			}
-			f.Ops = ops
-		case nl.GENL_CTRL_ATTR_MCAST_GROUPS:
-			groups, err := parseMulticastGroups(a.Value)
-			if err != nil {
-				return err
-			}
-			f.Groups = groups
-		}
-	}
-
-	return nil
-}
-
-func parseFamilies(msgs [][]byte) ([]*GenlFamily, error) {
-	families := make([]*GenlFamily, 0, len(msgs))
-	for _, m := range msgs {
-		attrs, err := nl.ParseRouteAttr(m[nl.SizeofGenlmsg:])
-		if err != nil {
-			return nil, err
-		}
-		family := &GenlFamily{}
-		if err := family.parseAttributes(attrs); err != nil {
-			return nil, err
-		}
-
-		families = append(families, family)
-	}
-	return families, nil
-}
-
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func (h *Handle) GenlFamilyList() ([]*GenlFamily, error) {
-	msg := &nl.Genlmsg{
-		Command: nl.GENL_CTRL_CMD_GETFAMILY,
-		Version: nl.GENL_CTRL_VERSION,
-	}
-	req := h.newNetlinkRequest(nl.GENL_ID_CTRL, unix.NLM_F_DUMP)
-	req.AddData(msg)
-	msgs, executeErr := req.Execute(unix.NETLINK_GENERIC, 0)
-	if executeErr != nil && !errors.Is(executeErr, ErrDumpInterrupted) {
-		return nil, executeErr
-	}
-	families, err := parseFamilies(msgs)
-	if err != nil {
-		return nil, err
-	}
-	return families, executeErr
-}
-
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func GenlFamilyList() ([]*GenlFamily, error) {
-	return pkgHandle.GenlFamilyList()
-}
-
-func (h *Handle) GenlFamilyGet(name string) (*GenlFamily, error) {
-	msg := &nl.Genlmsg{
-		Command: nl.GENL_CTRL_CMD_GETFAMILY,
-		Version: nl.GENL_CTRL_VERSION,
-	}
-	req := h.newNetlinkRequest(nl.GENL_ID_CTRL, 0)
-	req.AddData(msg)
-	req.AddData(nl.NewRtAttr(nl.GENL_CTRL_ATTR_FAMILY_NAME, nl.ZeroTerminated(name)))
-	msgs, err := req.Execute(unix.NETLINK_GENERIC, 0)
-	if err != nil {
-		return nil, err
-	}
-	families, err := parseFamilies(msgs)
-	if err != nil {
-		return nil, err
-	}
-	if len(families) != 1 {
-		return nil, fmt.Errorf("invalid response for GENL_CTRL_CMD_GETFAMILY")
-	}
-	return families[0], nil
-}
-
-func GenlFamilyGet(name string) (*GenlFamily, error) {
-	return pkgHandle.GenlFamilyGet(name)
-}

+ 0 - 25
vendor/github.com/vishvananda/netlink/genetlink_unspecified.go

@@ -1,25 +0,0 @@
-// +build !linux
-
-package netlink
-
-type GenlOp struct{}
-
-type GenlMulticastGroup struct{}
-
-type GenlFamily struct{}
-
-func (h *Handle) GenlFamilyList() ([]*GenlFamily, error) {
-	return nil, ErrNotImplemented
-}
-
-func GenlFamilyList() ([]*GenlFamily, error) {
-	return nil, ErrNotImplemented
-}
-
-func (h *Handle) GenlFamilyGet(name string) (*GenlFamily, error) {
-	return nil, ErrNotImplemented
-}
-
-func GenlFamilyGet(name string) (*GenlFamily, error) {
-	return nil, ErrNotImplemented
-}

+ 0 - 248
vendor/github.com/vishvananda/netlink/gtp_linux.go

@@ -1,248 +0,0 @@
-package netlink
-
-import (
-	"errors"
-	"fmt"
-	"net"
-	"strings"
-	"syscall"
-
-	"github.com/vishvananda/netlink/nl"
-	"golang.org/x/sys/unix"
-)
-
-type PDP struct {
-	Version     uint32
-	TID         uint64
-	PeerAddress net.IP
-	MSAddress   net.IP
-	Flow        uint16
-	NetNSFD     uint32
-	ITEI        uint32
-	OTEI        uint32
-}
-
-func (pdp *PDP) String() string {
-	elems := []string{}
-	elems = append(elems, fmt.Sprintf("Version: %d", pdp.Version))
-	if pdp.Version == 0 {
-		elems = append(elems, fmt.Sprintf("TID: %d", pdp.TID))
-	} else if pdp.Version == 1 {
-		elems = append(elems, fmt.Sprintf("TEI: %d/%d", pdp.ITEI, pdp.OTEI))
-	}
-	elems = append(elems, fmt.Sprintf("MS-Address: %s", pdp.MSAddress))
-	elems = append(elems, fmt.Sprintf("Peer-Address: %s", pdp.PeerAddress))
-	return fmt.Sprintf("{%s}", strings.Join(elems, " "))
-}
-
-func (p *PDP) parseAttributes(attrs []syscall.NetlinkRouteAttr) error {
-	for _, a := range attrs {
-		switch a.Attr.Type {
-		case nl.GENL_GTP_ATTR_VERSION:
-			p.Version = native.Uint32(a.Value)
-		case nl.GENL_GTP_ATTR_TID:
-			p.TID = native.Uint64(a.Value)
-		case nl.GENL_GTP_ATTR_PEER_ADDRESS:
-			p.PeerAddress = net.IP(a.Value)
-		case nl.GENL_GTP_ATTR_MS_ADDRESS:
-			p.MSAddress = net.IP(a.Value)
-		case nl.GENL_GTP_ATTR_FLOW:
-			p.Flow = native.Uint16(a.Value)
-		case nl.GENL_GTP_ATTR_NET_NS_FD:
-			p.NetNSFD = native.Uint32(a.Value)
-		case nl.GENL_GTP_ATTR_I_TEI:
-			p.ITEI = native.Uint32(a.Value)
-		case nl.GENL_GTP_ATTR_O_TEI:
-			p.OTEI = native.Uint32(a.Value)
-		}
-	}
-	return nil
-}
-
-func parsePDP(msgs [][]byte) ([]*PDP, error) {
-	pdps := make([]*PDP, 0, len(msgs))
-	for _, m := range msgs {
-		attrs, err := nl.ParseRouteAttr(m[nl.SizeofGenlmsg:])
-		if err != nil {
-			return nil, err
-		}
-		pdp := &PDP{}
-		if err := pdp.parseAttributes(attrs); err != nil {
-			return nil, err
-		}
-		pdps = append(pdps, pdp)
-	}
-	return pdps, nil
-}
-
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func (h *Handle) GTPPDPList() ([]*PDP, error) {
-	f, err := h.GenlFamilyGet(nl.GENL_GTP_NAME)
-	if err != nil {
-		return nil, err
-	}
-	msg := &nl.Genlmsg{
-		Command: nl.GENL_GTP_CMD_GETPDP,
-		Version: nl.GENL_GTP_VERSION,
-	}
-	req := h.newNetlinkRequest(int(f.ID), unix.NLM_F_DUMP)
-	req.AddData(msg)
-	msgs, executeErr := req.Execute(unix.NETLINK_GENERIC, 0)
-	if executeErr != nil && !errors.Is(err, ErrDumpInterrupted) {
-		return nil, executeErr
-	}
-	pdps, err := parsePDP(msgs)
-	if err != nil {
-		return nil, err
-	}
-	return pdps, executeErr
-}
-
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func GTPPDPList() ([]*PDP, error) {
-	return pkgHandle.GTPPDPList()
-}
-
-func gtpPDPGet(req *nl.NetlinkRequest) (*PDP, error) {
-	msgs, err := req.Execute(unix.NETLINK_GENERIC, 0)
-	if err != nil {
-		return nil, err
-	}
-	pdps, err := parsePDP(msgs)
-	if err != nil {
-		return nil, err
-	}
-	if len(pdps) != 1 {
-		return nil, fmt.Errorf("invalid reqponse for GENL_GTP_CMD_GETPDP")
-	}
-	return pdps[0], nil
-}
-
-func (h *Handle) GTPPDPByTID(link Link, tid int) (*PDP, error) {
-	f, err := h.GenlFamilyGet(nl.GENL_GTP_NAME)
-	if err != nil {
-		return nil, err
-	}
-	msg := &nl.Genlmsg{
-		Command: nl.GENL_GTP_CMD_GETPDP,
-		Version: nl.GENL_GTP_VERSION,
-	}
-	req := h.newNetlinkRequest(int(f.ID), 0)
-	req.AddData(msg)
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_VERSION, nl.Uint32Attr(0)))
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_LINK, nl.Uint32Attr(uint32(link.Attrs().Index))))
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_TID, nl.Uint64Attr(uint64(tid))))
-	return gtpPDPGet(req)
-}
-
-func GTPPDPByTID(link Link, tid int) (*PDP, error) {
-	return pkgHandle.GTPPDPByTID(link, tid)
-}
-
-func (h *Handle) GTPPDPByITEI(link Link, itei int) (*PDP, error) {
-	f, err := h.GenlFamilyGet(nl.GENL_GTP_NAME)
-	if err != nil {
-		return nil, err
-	}
-	msg := &nl.Genlmsg{
-		Command: nl.GENL_GTP_CMD_GETPDP,
-		Version: nl.GENL_GTP_VERSION,
-	}
-	req := h.newNetlinkRequest(int(f.ID), 0)
-	req.AddData(msg)
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_VERSION, nl.Uint32Attr(1)))
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_LINK, nl.Uint32Attr(uint32(link.Attrs().Index))))
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_I_TEI, nl.Uint32Attr(uint32(itei))))
-	return gtpPDPGet(req)
-}
-
-func GTPPDPByITEI(link Link, itei int) (*PDP, error) {
-	return pkgHandle.GTPPDPByITEI(link, itei)
-}
-
-func (h *Handle) GTPPDPByMSAddress(link Link, addr net.IP) (*PDP, error) {
-	f, err := h.GenlFamilyGet(nl.GENL_GTP_NAME)
-	if err != nil {
-		return nil, err
-	}
-	msg := &nl.Genlmsg{
-		Command: nl.GENL_GTP_CMD_GETPDP,
-		Version: nl.GENL_GTP_VERSION,
-	}
-	req := h.newNetlinkRequest(int(f.ID), 0)
-	req.AddData(msg)
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_VERSION, nl.Uint32Attr(0)))
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_LINK, nl.Uint32Attr(uint32(link.Attrs().Index))))
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_MS_ADDRESS, []byte(addr.To4())))
-	return gtpPDPGet(req)
-}
-
-func GTPPDPByMSAddress(link Link, addr net.IP) (*PDP, error) {
-	return pkgHandle.GTPPDPByMSAddress(link, addr)
-}
-
-func (h *Handle) GTPPDPAdd(link Link, pdp *PDP) error {
-	f, err := h.GenlFamilyGet(nl.GENL_GTP_NAME)
-	if err != nil {
-		return err
-	}
-	msg := &nl.Genlmsg{
-		Command: nl.GENL_GTP_CMD_NEWPDP,
-		Version: nl.GENL_GTP_VERSION,
-	}
-	req := h.newNetlinkRequest(int(f.ID), unix.NLM_F_EXCL|unix.NLM_F_ACK)
-	req.AddData(msg)
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_VERSION, nl.Uint32Attr(pdp.Version)))
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_LINK, nl.Uint32Attr(uint32(link.Attrs().Index))))
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_PEER_ADDRESS, []byte(pdp.PeerAddress.To4())))
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_MS_ADDRESS, []byte(pdp.MSAddress.To4())))
-
-	switch pdp.Version {
-	case 0:
-		req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_TID, nl.Uint64Attr(pdp.TID)))
-		req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_FLOW, nl.Uint16Attr(pdp.Flow)))
-	case 1:
-		req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_I_TEI, nl.Uint32Attr(pdp.ITEI)))
-		req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_O_TEI, nl.Uint32Attr(pdp.OTEI)))
-	default:
-		return fmt.Errorf("unsupported GTP version: %d", pdp.Version)
-	}
-	_, err = req.Execute(unix.NETLINK_GENERIC, 0)
-	return err
-}
-
-func GTPPDPAdd(link Link, pdp *PDP) error {
-	return pkgHandle.GTPPDPAdd(link, pdp)
-}
-
-func (h *Handle) GTPPDPDel(link Link, pdp *PDP) error {
-	f, err := h.GenlFamilyGet(nl.GENL_GTP_NAME)
-	if err != nil {
-		return err
-	}
-	msg := &nl.Genlmsg{
-		Command: nl.GENL_GTP_CMD_DELPDP,
-		Version: nl.GENL_GTP_VERSION,
-	}
-	req := h.newNetlinkRequest(int(f.ID), unix.NLM_F_EXCL|unix.NLM_F_ACK)
-	req.AddData(msg)
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_VERSION, nl.Uint32Attr(pdp.Version)))
-	req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_LINK, nl.Uint32Attr(uint32(link.Attrs().Index))))
-
-	switch pdp.Version {
-	case 0:
-		req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_TID, nl.Uint64Attr(pdp.TID)))
-	case 1:
-		req.AddData(nl.NewRtAttr(nl.GENL_GTP_ATTR_I_TEI, nl.Uint32Attr(pdp.ITEI)))
-	default:
-		return fmt.Errorf("unsupported GTP version: %d", pdp.Version)
-	}
-	_, err = req.Execute(unix.NETLINK_GENERIC, 0)
-	return err
-}
-
-func GTPPDPDel(link Link, pdp *PDP) error {
-	return pkgHandle.GTPPDPDel(link, pdp)
-}

+ 0 - 183
vendor/github.com/vishvananda/netlink/handle_linux.go

@@ -1,183 +0,0 @@
-package netlink
-
-import (
-	"fmt"
-	"time"
-
-	"github.com/vishvananda/netlink/nl"
-	"github.com/vishvananda/netns"
-	"golang.org/x/sys/unix"
-)
-
-// Empty handle used by the netlink package methods
-var pkgHandle = &Handle{}
-
-// Handle is an handle for the netlink requests on a
-// specific network namespace. All the requests on the
-// same netlink family share the same netlink socket,
-// which gets released when the handle is Close'd.
-type Handle struct {
-	sockets      map[int]*nl.SocketHandle
-	lookupByDump bool
-}
-
-// SetSocketTimeout configures timeout for default netlink sockets
-func SetSocketTimeout(to time.Duration) error {
-	if to < time.Microsecond {
-		return fmt.Errorf("invalid timeout, minimul value is %s", time.Microsecond)
-	}
-
-	nl.SocketTimeoutTv = unix.NsecToTimeval(to.Nanoseconds())
-	return nil
-}
-
-// GetSocketTimeout returns the timeout value used by default netlink sockets
-func GetSocketTimeout() time.Duration {
-	nsec := unix.TimevalToNsec(nl.SocketTimeoutTv)
-	return time.Duration(nsec) * time.Nanosecond
-}
-
-// SupportsNetlinkFamily reports whether the passed netlink family is supported by this Handle
-func (h *Handle) SupportsNetlinkFamily(nlFamily int) bool {
-	_, ok := h.sockets[nlFamily]
-	return ok
-}
-
-// NewHandle returns a netlink handle on the current network namespace.
-// Caller may specify the netlink families the handle should support.
-// If no families are specified, all the families the netlink package
-// supports will be automatically added.
-func NewHandle(nlFamilies ...int) (*Handle, error) {
-	return newHandle(netns.None(), netns.None(), nlFamilies...)
-}
-
-// SetSocketTimeout sets the send and receive timeout for each socket in the
-// netlink handle. Although the socket timeout has granularity of one
-// microsecond, the effective granularity is floored by the kernel timer tick,
-// which default value is four milliseconds.
-func (h *Handle) SetSocketTimeout(to time.Duration) error {
-	if to < time.Microsecond {
-		return fmt.Errorf("invalid timeout, minimul value is %s", time.Microsecond)
-	}
-	tv := unix.NsecToTimeval(to.Nanoseconds())
-	for _, sh := range h.sockets {
-		if err := sh.Socket.SetSendTimeout(&tv); err != nil {
-			return err
-		}
-		if err := sh.Socket.SetReceiveTimeout(&tv); err != nil {
-			return err
-		}
-	}
-	return nil
-}
-
-// SetSocketReceiveBufferSize sets the receive buffer size for each
-// socket in the netlink handle. The maximum value is capped by
-// /proc/sys/net/core/rmem_max.
-func (h *Handle) SetSocketReceiveBufferSize(size int, force bool) error {
-	opt := unix.SO_RCVBUF
-	if force {
-		opt = unix.SO_RCVBUFFORCE
-	}
-	for _, sh := range h.sockets {
-		fd := sh.Socket.GetFd()
-		err := unix.SetsockoptInt(fd, unix.SOL_SOCKET, opt, size)
-		if err != nil {
-			return err
-		}
-	}
-	return nil
-}
-
-// GetSocketReceiveBufferSize gets the receiver buffer size for each
-// socket in the netlink handle. The retrieved value should be the
-// double to the one set for SetSocketReceiveBufferSize.
-func (h *Handle) GetSocketReceiveBufferSize() ([]int, error) {
-	results := make([]int, len(h.sockets))
-	i := 0
-	for _, sh := range h.sockets {
-		fd := sh.Socket.GetFd()
-		size, err := unix.GetsockoptInt(fd, unix.SOL_SOCKET, unix.SO_RCVBUF)
-		if err != nil {
-			return nil, err
-		}
-		results[i] = size
-		i++
-	}
-	return results, nil
-}
-
-// SetStrictCheck sets the strict check socket option for each socket in the netlink handle. Returns early if any set operation fails
-func (h *Handle) SetStrictCheck(state bool) error {
-	for _, sh := range h.sockets {
-		var stateInt int = 0
-		if state {
-			stateInt = 1
-		}
-		err := unix.SetsockoptInt(sh.Socket.GetFd(), unix.SOL_NETLINK, unix.NETLINK_GET_STRICT_CHK, stateInt)
-		if err != nil {
-			return err
-		}
-	}
-	return nil
-}
-
-// NewHandleAt returns a netlink handle on the network namespace
-// specified by ns. If ns=netns.None(), current network namespace
-// will be assumed
-func NewHandleAt(ns netns.NsHandle, nlFamilies ...int) (*Handle, error) {
-	return newHandle(ns, netns.None(), nlFamilies...)
-}
-
-// NewHandleAtFrom works as NewHandle but allows client to specify the
-// new and the origin netns Handle.
-func NewHandleAtFrom(newNs, curNs netns.NsHandle) (*Handle, error) {
-	return newHandle(newNs, curNs)
-}
-
-func newHandle(newNs, curNs netns.NsHandle, nlFamilies ...int) (*Handle, error) {
-	h := &Handle{sockets: map[int]*nl.SocketHandle{}}
-	fams := nl.SupportedNlFamilies
-	if len(nlFamilies) != 0 {
-		fams = nlFamilies
-	}
-	for _, f := range fams {
-		s, err := nl.GetNetlinkSocketAt(newNs, curNs, f)
-		if err != nil {
-			return nil, err
-		}
-		h.sockets[f] = &nl.SocketHandle{Socket: s}
-	}
-	return h, nil
-}
-
-// Close releases the resources allocated to this handle
-func (h *Handle) Close() {
-	for _, sh := range h.sockets {
-		sh.Close()
-	}
-	h.sockets = nil
-}
-
-// Delete releases the resources allocated to this handle
-//
-// Deprecated: use Close instead which is in line with typical resource release
-// patterns for files and other resources.
-func (h *Handle) Delete() {
-	h.Close()
-}
-
-func (h *Handle) newNetlinkRequest(proto, flags int) *nl.NetlinkRequest {
-	// Do this so that package API still use nl package variable nextSeqNr
-	if h.sockets == nil {
-		return nl.NewNetlinkRequest(proto, flags)
-	}
-	return &nl.NetlinkRequest{
-		NlMsghdr: unix.NlMsghdr{
-			Len:   uint32(unix.SizeofNlMsghdr),
-			Type:  uint16(proto),
-			Flags: unix.NLM_F_REQUEST | uint16(flags),
-		},
-		Sockets: h.sockets,
-	}
-}

+ 0 - 305
vendor/github.com/vishvananda/netlink/handle_unspecified.go

@@ -1,305 +0,0 @@
-//go:build !linux
-// +build !linux
-
-package netlink
-
-import (
-	"net"
-	"time"
-
-	"github.com/vishvananda/netns"
-)
-
-type Handle struct{}
-
-func NewHandle(nlFamilies ...int) (*Handle, error) {
-	return nil, ErrNotImplemented
-}
-
-func NewHandleAt(ns netns.NsHandle, nlFamilies ...int) (*Handle, error) {
-	return nil, ErrNotImplemented
-}
-
-func NewHandleAtFrom(newNs, curNs netns.NsHandle) (*Handle, error) {
-	return nil, ErrNotImplemented
-}
-
-func (h *Handle) Close() {}
-
-func (h *Handle) Delete() {}
-
-func (h *Handle) SupportsNetlinkFamily(nlFamily int) bool {
-	return false
-}
-
-func (h *Handle) SetSocketTimeout(to time.Duration) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) SetPromiscOn(link Link) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) SetPromiscOff(link Link) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetUp(link Link) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetDown(link Link) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetMTU(link Link, mtu int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetName(link Link, name string) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetAlias(link Link, name string) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetHardwareAddr(link Link, hwaddr net.HardwareAddr) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetVfHardwareAddr(link Link, vf int, hwaddr net.HardwareAddr) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetVfVlan(link Link, vf, vlan int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetVfVlanQos(link Link, vf, vlan, qos int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetVfVlanQosProto(link Link, vf, vlan, qos, proto int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetVfTxRate(link Link, vf, rate int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetVfRate(link Link, vf, minRate, maxRate int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetMaster(link Link, master Link) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetNoMaster(link Link) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetMasterByIndex(link Link, masterIndex int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetNsPid(link Link, nspid int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetNsFd(link Link, fd int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkAdd(link Link) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkDel(link Link) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkByName(name string) (Link, error) {
-	return nil, ErrNotImplemented
-}
-
-func (h *Handle) LinkByAlias(alias string) (Link, error) {
-	return nil, ErrNotImplemented
-}
-
-func (h *Handle) LinkByIndex(index int) (Link, error) {
-	return nil, ErrNotImplemented
-}
-
-func (h *Handle) LinkList() ([]Link, error) {
-	return nil, ErrNotImplemented
-}
-
-func (h *Handle) LinkSetHairpin(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetGuard(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetFastLeave(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetLearning(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetRootBlock(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetFlood(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetTxQLen(link Link, qlen int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetGroup(link Link, group int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetGSOMaxSize(link Link, maxSize int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetGROMaxSize(link Link, maxSize int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetGSOIPv4MaxSize(link Link, maxSize int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetGROIPv4MaxSize(link Link, maxSize int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) LinkSetIP6AddrGenMode(link Link, mode int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) setProtinfoAttr(link Link, mode bool, attr int) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) AddrAdd(link Link, addr *Addr) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) AddrDel(link Link, addr *Addr) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) AddrList(link Link, family int) ([]Addr, error) {
-	return nil, ErrNotImplemented
-}
-
-func (h *Handle) ClassDel(class Class) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) ClassChange(class Class) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) ClassReplace(class Class) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) ClassAdd(class Class) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) ClassList(link Link, parent uint32) ([]Class, error) {
-	return nil, ErrNotImplemented
-}
-
-func (h *Handle) FilterDel(filter Filter) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) FilterAdd(filter Filter) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) FilterList(link Link, parent uint32) ([]Filter, error) {
-	return nil, ErrNotImplemented
-}
-
-func (h *Handle) NeighAdd(neigh *Neigh) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) NeighSet(neigh *Neigh) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) NeighAppend(neigh *Neigh) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) NeighDel(neigh *Neigh) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) NeighList(linkIndex, family int) ([]Neigh, error) {
-	return nil, ErrNotImplemented
-}
-
-func (h *Handle) NeighProxyList(linkIndex, family int) ([]Neigh, error) {
-	return nil, ErrNotImplemented
-}
-
-func (h *Handle) RouteAdd(route *Route) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) RouteAppend(route *Route) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) RouteChange(route *Route) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) RouteDel(route *Route) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) RouteGet(destination net.IP) ([]Route, error) {
-	return nil, ErrNotImplemented
-}
-
-func (h *Handle) RouteList(link Link, family int) ([]Route, error) {
-	return nil, ErrNotImplemented
-}
-
-func (h *Handle) RouteListFiltered(family int, filter *Route, filterMask uint64) ([]Route, error) {
-	return nil, ErrNotImplemented
-}
-
-func (h *Handle) RouteReplace(route *Route) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) RuleAdd(rule *Rule) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) RuleDel(rule *Rule) error {
-	return ErrNotImplemented
-}
-
-func (h *Handle) RuleList(family int) ([]Rule, error) {
-	return nil, ErrNotImplemented
-}

+ 0 - 40
vendor/github.com/vishvananda/netlink/inet_diag.go

@@ -1,40 +0,0 @@
-package netlink
-
-// INET_DIAG constatns
-const (
-	INET_DIAG_NONE = iota
-	INET_DIAG_MEMINFO
-	INET_DIAG_INFO
-	INET_DIAG_VEGASINFO
-	INET_DIAG_CONG
-	INET_DIAG_TOS
-	INET_DIAG_TCLASS
-	INET_DIAG_SKMEMINFO
-	INET_DIAG_SHUTDOWN
-	INET_DIAG_DCTCPINFO
-	INET_DIAG_PROTOCOL
-	INET_DIAG_SKV6ONLY
-	INET_DIAG_LOCALS
-	INET_DIAG_PEERS
-	INET_DIAG_PAD
-	INET_DIAG_MARK
-	INET_DIAG_BBRINFO
-	INET_DIAG_CLASS_ID
-	INET_DIAG_MD5SIG
-	INET_DIAG_ULP_INFO
-	INET_DIAG_SK_BPF_STORAGES
-	INET_DIAG_CGROUP_ID
-	INET_DIAG_SOCKOPT
-	INET_DIAG_MAX
-)
-
-type InetDiagTCPInfoResp struct {
-	InetDiagMsg *Socket
-	TCPInfo     *TCPInfo
-	TCPBBRInfo  *TCPBBRInfo
-}
-
-type InetDiagUDPInfoResp struct {
-	InetDiagMsg *Socket
-	Memory      *MemInfo
-}

+ 0 - 90
vendor/github.com/vishvananda/netlink/ioctl_linux.go

@@ -1,90 +0,0 @@
-package netlink
-
-import (
-	"syscall"
-	"unsafe"
-
-	"golang.org/x/sys/unix"
-)
-
-// ioctl for statistics.
-const (
-	// ETHTOOL_GSSET_INFO gets string set info
-	ETHTOOL_GSSET_INFO = 0x00000037
-	// SIOCETHTOOL is Ethtool interface
-	SIOCETHTOOL = 0x8946
-	// ETHTOOL_GSTRINGS gets specified string set
-	ETHTOOL_GSTRINGS = 0x0000001b
-	// ETHTOOL_GSTATS gets NIC-specific statistics
-	ETHTOOL_GSTATS = 0x0000001d
-)
-
-// string set id.
-const (
-	// ETH_SS_TEST is self-test result names, for use with %ETHTOOL_TEST
-	ETH_SS_TEST = iota
-	// ETH_SS_STATS statistic names, for use with %ETHTOOL_GSTATS
-	ETH_SS_STATS
-	// ETH_SS_PRIV_FLAGS are driver private flag names
-	ETH_SS_PRIV_FLAGS
-	// _ETH_SS_NTUPLE_FILTERS is deprecated
-	_ETH_SS_NTUPLE_FILTERS
-	// ETH_SS_FEATURES are device feature names
-	ETH_SS_FEATURES
-	// ETH_SS_RSS_HASH_FUNCS is RSS hush function names
-	ETH_SS_RSS_HASH_FUNCS
-)
-
-// IfreqSlave is a struct for ioctl bond manipulation syscalls.
-// It is used to assign slave to bond interface with Name.
-type IfreqSlave struct {
-	Name  [unix.IFNAMSIZ]byte
-	Slave [unix.IFNAMSIZ]byte
-}
-
-// Ifreq is a struct for ioctl ethernet manipulation syscalls.
-type Ifreq struct {
-	Name [unix.IFNAMSIZ]byte
-	Data uintptr
-}
-
-// ethtoolSset is a string set information
-type ethtoolSset struct {
-	cmd      uint32
-	reserved uint32
-	mask     uint64
-	data     [1]uint32
-}
-
-type ethtoolStats struct {
-	cmd    uint32
-	nStats uint32
-	// Followed by nStats * []uint64.
-}
-
-// newIocltSlaveReq returns filled IfreqSlave with proper interface names
-// It is used by ioctl to assign slave to bond master
-func newIocltSlaveReq(slave, master string) *IfreqSlave {
-	ifreq := &IfreqSlave{}
-	copy(ifreq.Name[:unix.IFNAMSIZ-1], master)
-	copy(ifreq.Slave[:unix.IFNAMSIZ-1], slave)
-	return ifreq
-}
-
-// newIocltStringSetReq creates request to get interface string set
-func newIocltStringSetReq(linkName string) (*Ifreq, *ethtoolSset) {
-	e := &ethtoolSset{
-		cmd:  ETHTOOL_GSSET_INFO,
-		mask: 1 << ETH_SS_STATS,
-	}
-
-	ifreq := &Ifreq{Data: uintptr(unsafe.Pointer(e))}
-	copy(ifreq.Name[:unix.IFNAMSIZ-1], linkName)
-	return ifreq, e
-}
-
-// getSocketUDP returns file descriptor to new UDP socket
-// It is used for communication with ioctl interface.
-func getSocketUDP() (int, error) {
-	return syscall.Socket(unix.AF_INET, unix.SOCK_DGRAM|unix.SOCK_CLOEXEC, 0)
-}

+ 0 - 662
vendor/github.com/vishvananda/netlink/ipset_linux.go

@@ -1,662 +0,0 @@
-package netlink
-
-import (
-	"encoding/binary"
-	"log"
-	"net"
-	"syscall"
-
-	"github.com/vishvananda/netlink/nl"
-	"golang.org/x/sys/unix"
-)
-
-// IPSetEntry is used for adding, updating, retreiving and deleting entries
-type IPSetEntry struct {
-	Comment  string
-	MAC      net.HardwareAddr
-	IP       net.IP
-	CIDR     uint8
-	Timeout  *uint32
-	Packets  *uint64
-	Bytes    *uint64
-	Protocol *uint8
-	Port     *uint16
-	IP2      net.IP
-	CIDR2    uint8
-	IFace    string
-	Mark     *uint32
-
-	Replace bool // replace existing entry
-}
-
-// IPSetResult is the result of a dump request for a set
-type IPSetResult struct {
-	Nfgenmsg           *nl.Nfgenmsg
-	Protocol           uint8
-	ProtocolMinVersion uint8
-	Revision           uint8
-	Family             uint8
-	Flags              uint8
-	SetName            string
-	TypeName           string
-	Comment            string
-	MarkMask           uint32
-
-	IPFrom   net.IP
-	IPTo     net.IP
-	PortFrom uint16
-	PortTo   uint16
-
-	HashSize     uint32
-	NumEntries   uint32
-	MaxElements  uint32
-	References   uint32
-	SizeInMemory uint32
-	CadtFlags    uint32
-	Timeout      *uint32
-	LineNo       uint32
-
-	Entries []IPSetEntry
-}
-
-// IpsetCreateOptions is the options struct for creating a new ipset
-type IpsetCreateOptions struct {
-	Replace  bool // replace existing ipset
-	Timeout  *uint32
-	Counters bool
-	Comments bool
-	Skbinfo  bool
-
-	Family      uint8
-	Revision    uint8
-	IPFrom      net.IP
-	IPTo        net.IP
-	PortFrom    uint16
-	PortTo      uint16
-	MaxElements uint32
-}
-
-// IpsetProtocol returns the ipset protocol version from the kernel
-func IpsetProtocol() (uint8, uint8, error) {
-	return pkgHandle.IpsetProtocol()
-}
-
-// IpsetCreate creates a new ipset
-func IpsetCreate(setname, typename string, options IpsetCreateOptions) error {
-	return pkgHandle.IpsetCreate(setname, typename, options)
-}
-
-// IpsetDestroy destroys an existing ipset
-func IpsetDestroy(setname string) error {
-	return pkgHandle.IpsetDestroy(setname)
-}
-
-// IpsetFlush flushes an existing ipset
-func IpsetFlush(setname string) error {
-	return pkgHandle.IpsetFlush(setname)
-}
-
-// IpsetSwap swaps two ipsets.
-func IpsetSwap(setname, othersetname string) error {
-	return pkgHandle.IpsetSwap(setname, othersetname)
-}
-
-// IpsetList dumps an specific ipset.
-func IpsetList(setname string) (*IPSetResult, error) {
-	return pkgHandle.IpsetList(setname)
-}
-
-// IpsetListAll dumps all ipsets.
-func IpsetListAll() ([]IPSetResult, error) {
-	return pkgHandle.IpsetListAll()
-}
-
-// IpsetAdd adds an entry to an existing ipset.
-func IpsetAdd(setname string, entry *IPSetEntry) error {
-	return pkgHandle.IpsetAdd(setname, entry)
-}
-
-// IpsetDel deletes an entry from an existing ipset.
-func IpsetDel(setname string, entry *IPSetEntry) error {
-	return pkgHandle.IpsetDel(setname, entry)
-}
-
-// IpsetTest tests whether an entry is in a set or not.
-func IpsetTest(setname string, entry *IPSetEntry) (bool, error) {
-	return pkgHandle.IpsetTest(setname, entry)
-}
-
-func (h *Handle) IpsetProtocol() (protocol uint8, minVersion uint8, err error) {
-	req := h.newIpsetRequest(nl.IPSET_CMD_PROTOCOL)
-	msgs, err := req.Execute(unix.NETLINK_NETFILTER, 0)
-
-	if err != nil {
-		return 0, 0, err
-	}
-	response := ipsetUnserialize(msgs)
-	return response.Protocol, response.ProtocolMinVersion, nil
-}
-
-func (h *Handle) IpsetCreate(setname, typename string, options IpsetCreateOptions) error {
-	req := h.newIpsetRequest(nl.IPSET_CMD_CREATE)
-
-	if !options.Replace {
-		req.Flags |= unix.NLM_F_EXCL
-	}
-
-	req.AddData(nl.NewRtAttr(nl.IPSET_ATTR_SETNAME, nl.ZeroTerminated(setname)))
-	req.AddData(nl.NewRtAttr(nl.IPSET_ATTR_TYPENAME, nl.ZeroTerminated(typename)))
-
-	cadtFlags := optionsToBitflag(options)
-
-	revision := options.Revision
-	if revision == 0 {
-		revision = getIpsetDefaultRevision(typename, cadtFlags)
-	}
-	req.AddData(nl.NewRtAttr(nl.IPSET_ATTR_REVISION, nl.Uint8Attr(revision)))
-
-	data := nl.NewRtAttr(nl.IPSET_ATTR_DATA|int(nl.NLA_F_NESTED), nil)
-
-	var family uint8
-	switch typename {
-	case "hash:mac":
-	case "bitmap:port":
-		buf := make([]byte, 4)
-		binary.BigEndian.PutUint16(buf, options.PortFrom)
-		binary.BigEndian.PutUint16(buf[2:], options.PortTo)
-		data.AddChild(nl.NewRtAttr(nl.IPSET_ATTR_PORT_FROM|int(nl.NLA_F_NET_BYTEORDER), buf[:2]))
-		data.AddChild(nl.NewRtAttr(nl.IPSET_ATTR_PORT_TO|int(nl.NLA_F_NET_BYTEORDER), buf[2:]))
-	default:
-		family = options.Family
-		if family == 0 {
-			family = unix.AF_INET
-		}
-	}
-
-	req.AddData(nl.NewRtAttr(nl.IPSET_ATTR_FAMILY, nl.Uint8Attr(family)))
-
-	if options.MaxElements != 0 {
-		data.AddChild(&nl.Uint32Attribute{Type: nl.IPSET_ATTR_MAXELEM | nl.NLA_F_NET_BYTEORDER, Value: options.MaxElements})
-	}
-
-	if timeout := options.Timeout; timeout != nil {
-		data.AddChild(&nl.Uint32Attribute{Type: nl.IPSET_ATTR_TIMEOUT | nl.NLA_F_NET_BYTEORDER, Value: *timeout})
-	}
-
-	if cadtFlags != 0 {
-		data.AddChild(&nl.Uint32Attribute{Type: nl.IPSET_ATTR_CADT_FLAGS | nl.NLA_F_NET_BYTEORDER, Value: cadtFlags})
-	}
-
-	req.AddData(data)
-	_, err := ipsetExecute(req)
-	return err
-}
-
-func (h *Handle) IpsetDestroy(setname string) error {
-	req := h.newIpsetRequest(nl.IPSET_CMD_DESTROY)
-	req.AddData(nl.NewRtAttr(nl.IPSET_ATTR_SETNAME, nl.ZeroTerminated(setname)))
-	_, err := ipsetExecute(req)
-	return err
-}
-
-func (h *Handle) IpsetFlush(setname string) error {
-	req := h.newIpsetRequest(nl.IPSET_CMD_FLUSH)
-	req.AddData(nl.NewRtAttr(nl.IPSET_ATTR_SETNAME, nl.ZeroTerminated(setname)))
-	_, err := ipsetExecute(req)
-	return err
-}
-
-func (h *Handle) IpsetSwap(setname, othersetname string) error {
-	req := h.newIpsetRequest(nl.IPSET_CMD_SWAP)
-	req.AddData(nl.NewRtAttr(nl.IPSET_ATTR_SETNAME, nl.ZeroTerminated(setname)))
-	req.AddData(nl.NewRtAttr(nl.IPSET_ATTR_TYPENAME, nl.ZeroTerminated(othersetname)))
-	_, err := ipsetExecute(req)
-	return err
-}
-
-func (h *Handle) IpsetList(name string) (*IPSetResult, error) {
-	req := h.newIpsetRequest(nl.IPSET_CMD_LIST)
-	req.AddData(nl.NewRtAttr(nl.IPSET_ATTR_SETNAME, nl.ZeroTerminated(name)))
-
-	msgs, err := ipsetExecute(req)
-	if err != nil {
-		return nil, err
-	}
-
-	result := ipsetUnserialize(msgs)
-	return &result, nil
-}
-
-func (h *Handle) IpsetListAll() ([]IPSetResult, error) {
-	req := h.newIpsetRequest(nl.IPSET_CMD_LIST)
-
-	msgs, err := ipsetExecute(req)
-	if err != nil {
-		return nil, err
-	}
-
-	result := make([]IPSetResult, len(msgs))
-	for i, msg := range msgs {
-		result[i].unserialize(msg)
-	}
-
-	return result, nil
-}
-
-// IpsetAdd adds an entry to an existing ipset.
-func (h *Handle) IpsetAdd(setname string, entry *IPSetEntry) error {
-	return h.ipsetAddDel(nl.IPSET_CMD_ADD, setname, entry)
-}
-
-// IpsetDel deletes an entry from an existing ipset.
-func (h *Handle) IpsetDel(setname string, entry *IPSetEntry) error {
-	return h.ipsetAddDel(nl.IPSET_CMD_DEL, setname, entry)
-}
-
-func encodeIP(ip net.IP) (*nl.RtAttr, error) {
-	typ := int(nl.NLA_F_NET_BYTEORDER)
-	if ip4 := ip.To4(); ip4 != nil {
-		typ |= nl.IPSET_ATTR_IPADDR_IPV4
-		ip = ip4
-	} else {
-		typ |= nl.IPSET_ATTR_IPADDR_IPV6
-	}
-
-	return nl.NewRtAttr(typ, ip), nil
-}
-
-func buildEntryData(entry *IPSetEntry) (*nl.RtAttr, error) {
-	data := nl.NewRtAttr(nl.IPSET_ATTR_DATA|int(nl.NLA_F_NESTED), nil)
-
-	if entry.Comment != "" {
-		data.AddChild(nl.NewRtAttr(nl.IPSET_ATTR_COMMENT, nl.ZeroTerminated(entry.Comment)))
-	}
-
-	if entry.Timeout != nil {
-		data.AddChild(&nl.Uint32Attribute{Type: nl.IPSET_ATTR_TIMEOUT | nl.NLA_F_NET_BYTEORDER, Value: *entry.Timeout})
-	}
-
-	if entry.IP != nil {
-		nestedData, err := encodeIP(entry.IP)
-		if err != nil {
-			return nil, err
-		}
-		data.AddChild(nl.NewRtAttr(nl.IPSET_ATTR_IP|int(nl.NLA_F_NESTED), nestedData.Serialize()))
-	}
-
-	if entry.MAC != nil {
-		data.AddChild(nl.NewRtAttr(nl.IPSET_ATTR_ETHER, entry.MAC))
-	}
-
-	if entry.CIDR != 0 {
-		data.AddChild(nl.NewRtAttr(nl.IPSET_ATTR_CIDR, nl.Uint8Attr(entry.CIDR)))
-	}
-
-	if entry.IP2 != nil {
-		nestedData, err := encodeIP(entry.IP2)
-		if err != nil {
-			return nil, err
-		}
-		data.AddChild(nl.NewRtAttr(nl.IPSET_ATTR_IP2|int(nl.NLA_F_NESTED), nestedData.Serialize()))
-	}
-
-	if entry.CIDR2 != 0 {
-		data.AddChild(nl.NewRtAttr(nl.IPSET_ATTR_CIDR2, nl.Uint8Attr(entry.CIDR2)))
-	}
-
-	if entry.Port != nil {
-		if entry.Protocol == nil {
-			// use tcp protocol as default
-			val := uint8(unix.IPPROTO_TCP)
-			entry.Protocol = &val
-		}
-		data.AddChild(nl.NewRtAttr(nl.IPSET_ATTR_PROTO, nl.Uint8Attr(*entry.Protocol)))
-		buf := make([]byte, 2)
-		binary.BigEndian.PutUint16(buf, *entry.Port)
-		data.AddChild(nl.NewRtAttr(int(nl.IPSET_ATTR_PORT|nl.NLA_F_NET_BYTEORDER), buf))
-	}
-
-	if entry.IFace != "" {
-		data.AddChild(nl.NewRtAttr(nl.IPSET_ATTR_IFACE, nl.ZeroTerminated(entry.IFace)))
-	}
-
-	if entry.Mark != nil {
-		data.AddChild(&nl.Uint32Attribute{Type: nl.IPSET_ATTR_MARK | nl.NLA_F_NET_BYTEORDER, Value: *entry.Mark})
-	}
-	return data, nil
-}
-
-func (h *Handle) ipsetAddDel(nlCmd int, setname string, entry *IPSetEntry) error {
-	req := h.newIpsetRequest(nlCmd)
-	req.AddData(nl.NewRtAttr(nl.IPSET_ATTR_SETNAME, nl.ZeroTerminated(setname)))
-
-	if !entry.Replace {
-		req.Flags |= unix.NLM_F_EXCL
-	}
-
-	data, err := buildEntryData(entry)
-	if err != nil {
-		return err
-	}
-	data.AddChild(&nl.Uint32Attribute{Type: nl.IPSET_ATTR_LINENO | nl.NLA_F_NET_BYTEORDER, Value: 0})
-	req.AddData(data)
-
-	_, err = ipsetExecute(req)
-	return err
-}
-
-func (h *Handle) IpsetTest(setname string, entry *IPSetEntry) (bool, error) {
-	req := h.newIpsetRequest(nl.IPSET_CMD_TEST)
-	req.AddData(nl.NewRtAttr(nl.IPSET_ATTR_SETNAME, nl.ZeroTerminated(setname)))
-
-	if !entry.Replace {
-		req.Flags |= unix.NLM_F_EXCL
-	}
-
-	data, err := buildEntryData(entry)
-	if err != nil {
-		return false, err
-	}
-	req.AddData(data)
-
-	_, err = ipsetExecute(req)
-	if err != nil {
-		if err == nl.IPSetError(nl.IPSET_ERR_EXIST) {
-			// not exist
-			return false, nil
-		}
-		return false, err
-	}
-	return true, nil
-}
-
-func (h *Handle) newIpsetRequest(cmd int) *nl.NetlinkRequest {
-	req := h.newNetlinkRequest(cmd|(unix.NFNL_SUBSYS_IPSET<<8), nl.GetIpsetFlags(cmd))
-
-	// Add the netfilter header
-	msg := &nl.Nfgenmsg{
-		NfgenFamily: uint8(unix.AF_NETLINK),
-		Version:     nl.NFNETLINK_V0,
-		ResId:       0,
-	}
-	req.AddData(msg)
-	req.AddData(nl.NewRtAttr(nl.IPSET_ATTR_PROTOCOL, nl.Uint8Attr(nl.IPSET_PROTOCOL)))
-
-	return req
-}
-
-// NOTE: This can't just take typename into account, it also has to take desired
-// feature support into account, on a per-set-type basis, to return the correct revision, see e.g.
-// https://github.com/Olipro/ipset/blob/9f145b49100104d6570fe5c31a5236816ebb4f8f/kernel/net/netfilter/ipset/ip_set_hash_ipport.c#L30
-//
-// This means that whenever a new "type" of ipset is added, returning the "correct" default revision
-// requires adding a new case here for that type, and consulting the ipset C code to figure out the correct
-// combination of type name, feature bit flags, and revision ranges.
-//
-// Care should be taken as some types share the same revision ranges for the same features, and others do not.
-// When in doubt, mimic the C code.
-func getIpsetDefaultRevision(typename string, featureFlags uint32) uint8 {
-	switch typename {
-	case "hash:ip,port",
-		"hash:ip,port,ip":
-		// Taken from
-		// - ipset/kernel/net/netfilter/ipset/ip_set_hash_ipport.c
-		// - ipset/kernel/net/netfilter/ipset/ip_set_hash_ipportip.c
-		if (featureFlags & nl.IPSET_FLAG_WITH_SKBINFO) != 0 {
-			return 5
-		}
-
-		if (featureFlags & nl.IPSET_FLAG_WITH_FORCEADD) != 0 {
-			return 4
-		}
-
-		if (featureFlags & nl.IPSET_FLAG_WITH_COMMENT) != 0 {
-			return 3
-		}
-
-		if (featureFlags & nl.IPSET_FLAG_WITH_COUNTERS) != 0 {
-			return 2
-		}
-
-		// the min revision this library supports for this type
-		return 1
-
-	case "hash:ip,port,net",
-		"hash:net,port":
-		// Taken from
-		// - ipset/kernel/net/netfilter/ipset/ip_set_hash_ipportnet.c
-		// - ipset/kernel/net/netfilter/ipset/ip_set_hash_netport.c
-		if (featureFlags & nl.IPSET_FLAG_WITH_SKBINFO) != 0 {
-			return 7
-		}
-
-		if (featureFlags & nl.IPSET_FLAG_WITH_FORCEADD) != 0 {
-			return 6
-		}
-
-		if (featureFlags & nl.IPSET_FLAG_WITH_COMMENT) != 0 {
-			return 5
-		}
-
-		if (featureFlags & nl.IPSET_FLAG_WITH_COUNTERS) != 0 {
-			return 4
-		}
-
-		if (featureFlags & nl.IPSET_FLAG_NOMATCH) != 0 {
-			return 3
-		}
-		// the min revision this library supports for this type
-		return 2
-
-	case "hash:ip":
-		// Taken from
-		// - ipset/kernel/net/netfilter/ipset/ip_set_hash_ip.c
-		if (featureFlags & nl.IPSET_FLAG_WITH_SKBINFO) != 0 {
-			return 4
-		}
-
-		if (featureFlags & nl.IPSET_FLAG_WITH_FORCEADD) != 0 {
-			return 3
-		}
-
-		if (featureFlags & nl.IPSET_FLAG_WITH_COMMENT) != 0 {
-			return 2
-		}
-
-		// the min revision this library supports for this type
-		return 1
-	}
-
-	// can't map the correct revision for this type.
-	return 0
-}
-
-func ipsetExecute(req *nl.NetlinkRequest) (msgs [][]byte, err error) {
-	msgs, err = req.Execute(unix.NETLINK_NETFILTER, 0)
-
-	if err != nil {
-		if errno := int(err.(syscall.Errno)); errno >= nl.IPSET_ERR_PRIVATE {
-			err = nl.IPSetError(uintptr(errno))
-		}
-	}
-	return
-}
-
-func ipsetUnserialize(msgs [][]byte) (result IPSetResult) {
-	for _, msg := range msgs {
-		result.unserialize(msg)
-	}
-	return result
-}
-
-func (result *IPSetResult) unserialize(msg []byte) {
-	result.Nfgenmsg = nl.DeserializeNfgenmsg(msg)
-
-	for attr := range nl.ParseAttributes(msg[4:]) {
-		switch attr.Type {
-		case nl.IPSET_ATTR_PROTOCOL:
-			result.Protocol = attr.Value[0]
-		case nl.IPSET_ATTR_SETNAME:
-			result.SetName = nl.BytesToString(attr.Value)
-		case nl.IPSET_ATTR_COMMENT:
-			result.Comment = nl.BytesToString(attr.Value)
-		case nl.IPSET_ATTR_TYPENAME:
-			result.TypeName = nl.BytesToString(attr.Value)
-		case nl.IPSET_ATTR_REVISION:
-			result.Revision = attr.Value[0]
-		case nl.IPSET_ATTR_FAMILY:
-			result.Family = attr.Value[0]
-		case nl.IPSET_ATTR_FLAGS:
-			result.Flags = attr.Value[0]
-		case nl.IPSET_ATTR_DATA | nl.NLA_F_NESTED:
-			result.parseAttrData(attr.Value)
-		case nl.IPSET_ATTR_ADT | nl.NLA_F_NESTED:
-			result.parseAttrADT(attr.Value)
-		case nl.IPSET_ATTR_PROTOCOL_MIN:
-			result.ProtocolMinVersion = attr.Value[0]
-		case nl.IPSET_ATTR_MARKMASK:
-			result.MarkMask = attr.Uint32()
-		default:
-			log.Printf("unknown ipset attribute from kernel: %+v %v", attr, attr.Type&nl.NLA_TYPE_MASK)
-		}
-	}
-}
-
-func (result *IPSetResult) parseAttrData(data []byte) {
-	for attr := range nl.ParseAttributes(data) {
-		switch attr.Type {
-		case nl.IPSET_ATTR_HASHSIZE | nl.NLA_F_NET_BYTEORDER:
-			result.HashSize = attr.Uint32()
-		case nl.IPSET_ATTR_MAXELEM | nl.NLA_F_NET_BYTEORDER:
-			result.MaxElements = attr.Uint32()
-		case nl.IPSET_ATTR_TIMEOUT | nl.NLA_F_NET_BYTEORDER:
-			val := attr.Uint32()
-			result.Timeout = &val
-		case nl.IPSET_ATTR_ELEMENTS | nl.NLA_F_NET_BYTEORDER:
-			result.NumEntries = attr.Uint32()
-		case nl.IPSET_ATTR_REFERENCES | nl.NLA_F_NET_BYTEORDER:
-			result.References = attr.Uint32()
-		case nl.IPSET_ATTR_MEMSIZE | nl.NLA_F_NET_BYTEORDER:
-			result.SizeInMemory = attr.Uint32()
-		case nl.IPSET_ATTR_CADT_FLAGS | nl.NLA_F_NET_BYTEORDER:
-			result.CadtFlags = attr.Uint32()
-		case nl.IPSET_ATTR_IP | nl.NLA_F_NESTED:
-			for nested := range nl.ParseAttributes(attr.Value) {
-				switch nested.Type {
-				case nl.IPSET_ATTR_IP | nl.NLA_F_NET_BYTEORDER:
-					result.Entries = append(result.Entries, IPSetEntry{IP: nested.Value})
-				case nl.IPSET_ATTR_IP:
-					result.IPFrom = nested.Value
-				default:
-					log.Printf("unknown nested ipset data attribute from kernel: %+v %v", nested, nested.Type&nl.NLA_TYPE_MASK)
-				}
-			}
-		case nl.IPSET_ATTR_IP_TO | nl.NLA_F_NESTED:
-			for nested := range nl.ParseAttributes(attr.Value) {
-				switch nested.Type {
-				case nl.IPSET_ATTR_IP:
-					result.IPTo = nested.Value
-				default:
-					log.Printf("unknown nested ipset data attribute from kernel: %+v %v", nested, nested.Type&nl.NLA_TYPE_MASK)
-				}
-			}
-		case nl.IPSET_ATTR_PORT_FROM | nl.NLA_F_NET_BYTEORDER:
-			result.PortFrom = networkOrder.Uint16(attr.Value)
-		case nl.IPSET_ATTR_PORT_TO | nl.NLA_F_NET_BYTEORDER:
-			result.PortTo = networkOrder.Uint16(attr.Value)
-		case nl.IPSET_ATTR_CADT_LINENO | nl.NLA_F_NET_BYTEORDER:
-			result.LineNo = attr.Uint32()
-		case nl.IPSET_ATTR_COMMENT:
-			result.Comment = nl.BytesToString(attr.Value)
-		case nl.IPSET_ATTR_MARKMASK:
-			result.MarkMask = attr.Uint32()
-		default:
-			log.Printf("unknown ipset data attribute from kernel: %+v %v", attr, attr.Type&nl.NLA_TYPE_MASK)
-		}
-	}
-}
-
-func (result *IPSetResult) parseAttrADT(data []byte) {
-	for attr := range nl.ParseAttributes(data) {
-		switch attr.Type {
-		case nl.IPSET_ATTR_DATA | nl.NLA_F_NESTED:
-			result.Entries = append(result.Entries, parseIPSetEntry(attr.Value))
-		default:
-			log.Printf("unknown ADT attribute from kernel: %+v %v", attr, attr.Type&nl.NLA_TYPE_MASK)
-		}
-	}
-}
-
-func parseIPSetEntry(data []byte) (entry IPSetEntry) {
-	for attr := range nl.ParseAttributes(data) {
-		switch attr.Type {
-		case nl.IPSET_ATTR_TIMEOUT | nl.NLA_F_NET_BYTEORDER:
-			val := attr.Uint32()
-			entry.Timeout = &val
-		case nl.IPSET_ATTR_BYTES | nl.NLA_F_NET_BYTEORDER:
-			val := attr.Uint64()
-			entry.Bytes = &val
-		case nl.IPSET_ATTR_PACKETS | nl.NLA_F_NET_BYTEORDER:
-			val := attr.Uint64()
-			entry.Packets = &val
-		case nl.IPSET_ATTR_ETHER:
-			entry.MAC = net.HardwareAddr(attr.Value)
-		case nl.IPSET_ATTR_IP:
-			entry.IP = net.IP(attr.Value)
-		case nl.IPSET_ATTR_COMMENT:
-			entry.Comment = nl.BytesToString(attr.Value)
-		case nl.IPSET_ATTR_IP | nl.NLA_F_NESTED:
-			for attr := range nl.ParseAttributes(attr.Value) {
-				switch attr.Type {
-				case nl.IPSET_ATTR_IPADDR_IPV4, nl.IPSET_ATTR_IPADDR_IPV6:
-					entry.IP = net.IP(attr.Value)
-				default:
-					log.Printf("unknown nested ADT attribute from kernel: %+v", attr)
-				}
-			}
-		case nl.IPSET_ATTR_IP2 | nl.NLA_F_NESTED:
-			for attr := range nl.ParseAttributes(attr.Value) {
-				switch attr.Type {
-				case nl.IPSET_ATTR_IPADDR_IPV4, nl.IPSET_ATTR_IPADDR_IPV6:
-					entry.IP2 = net.IP(attr.Value)
-				default:
-					log.Printf("unknown nested ADT attribute from kernel: %+v", attr)
-				}
-			}
-		case nl.IPSET_ATTR_CIDR:
-			entry.CIDR = attr.Value[0]
-		case nl.IPSET_ATTR_CIDR2:
-			entry.CIDR2 = attr.Value[0]
-		case nl.IPSET_ATTR_PORT | nl.NLA_F_NET_BYTEORDER:
-			val := networkOrder.Uint16(attr.Value)
-			entry.Port = &val
-		case nl.IPSET_ATTR_PROTO:
-			val := attr.Value[0]
-			entry.Protocol = &val
-		case nl.IPSET_ATTR_IFACE:
-			entry.IFace = nl.BytesToString(attr.Value)
-		case nl.IPSET_ATTR_MARK | nl.NLA_F_NET_BYTEORDER:
-			val := attr.Uint32()
-			entry.Mark = &val
-		default:
-			log.Printf("unknown ADT attribute from kernel: %+v", attr)
-		}
-	}
-	return
-}
-
-func optionsToBitflag(options IpsetCreateOptions) uint32 {
-	var cadtFlags uint32
-
-	if options.Comments {
-		cadtFlags |= nl.IPSET_FLAG_WITH_COMMENT
-	}
-	if options.Counters {
-		cadtFlags |= nl.IPSET_FLAG_WITH_COUNTERS
-	}
-	if options.Skbinfo {
-		cadtFlags |= nl.IPSET_FLAG_WITH_SKBINFO
-	}
-
-	return cadtFlags
-}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 1454
vendor/github.com/vishvananda/netlink/link.go


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 4213
vendor/github.com/vishvananda/netlink/link_linux.go


+ 0 - 151
vendor/github.com/vishvananda/netlink/link_tuntap_linux.go

@@ -1,151 +0,0 @@
-package netlink
-
-import (
-	"fmt"
-	"os"
-	"strings"
-	"syscall"
-
-	"golang.org/x/sys/unix"
-)
-
-// ideally golang.org/x/sys/unix would define IfReq but it only has
-// IFNAMSIZ, hence this minimalistic implementation
-const (
-	SizeOfIfReq = 40
-	IFNAMSIZ    = 16
-)
-
-const TUN = "/dev/net/tun"
-
-type ifReq struct {
-	Name  [IFNAMSIZ]byte
-	Flags uint16
-	pad   [SizeOfIfReq - IFNAMSIZ - 2]byte
-}
-
-// AddQueues opens and attaches multiple queue file descriptors to an existing
-// TUN/TAP interface in multi-queue mode.
-//
-// It performs TUNSETIFF ioctl on each opened file descriptor with the current
-// tuntap configuration. Each resulting fd is set to non-blocking mode and
-// returned as *os.File.
-//
-// If the interface was created with a name pattern (e.g. "tap%d"),
-// the first successful TUNSETIFF call will return the resolved name,
-// which is saved back into tuntap.Name.
-//
-// This method assumes that the interface already exists and is in multi-queue mode.
-// The returned FDs are also appended to tuntap.Fds and tuntap.Queues is updated.
-//
-// It is the caller's responsibility to close the FDs when they are no longer needed.
-func (tuntap *Tuntap) AddQueues(count int) ([]*os.File, error) {
-	if tuntap.Mode < unix.IFF_TUN || tuntap.Mode > unix.IFF_TAP {
-		return nil, fmt.Errorf("Tuntap.Mode %v unknown", tuntap.Mode)
-	}
-	if tuntap.Flags&TUNTAP_MULTI_QUEUE == 0 {
-		return nil, fmt.Errorf("TUNTAP_MULTI_QUEUE not set")
-	}
-	if count < 1 {
-		return nil, fmt.Errorf("count must be >= 1")
-	}
-
-	req, err := unix.NewIfreq(tuntap.Name)
-	if err != nil {
-		return nil, err
-	}
-	req.SetUint16(uint16(tuntap.Mode) | uint16(tuntap.Flags))
-
-	var fds []*os.File
-	for i := 0; i < count; i++ {
-		localReq := req
-		fd, err := unix.Open(TUN, os.O_RDWR|syscall.O_CLOEXEC, 0)
-		if err != nil {
-			cleanupFds(fds)
-			return nil, err
-		}
-
-		err = unix.IoctlIfreq(fd, unix.TUNSETIFF, req)
-		if err != nil {
-			// close the new fd
-			unix.Close(fd)
-			// and the already opened ones
-			cleanupFds(fds)
-			return nil, fmt.Errorf("tuntap IOCTL TUNSETIFF failed [%d]: %w", i, err)
-		}
-
-		// Set the tun device to non-blocking before use. The below comment
-		// taken from:
-		//
-		// https://github.com/mistsys/tuntap/commit/161418c25003bbee77d085a34af64d189df62bea
-		//
-		// Note there is a complication because in go, if a device node is
-		// opened, go sets it to use nonblocking I/O. However a /dev/net/tun
-		// doesn't work with epoll until after the TUNSETIFF ioctl has been
-		// done. So we open the unix fd directly, do the ioctl, then put the
-		// fd in nonblocking mode, an then finally wrap it in a os.File,
-		// which will see the nonblocking mode and add the fd to the
-		// pollable set, so later on when we Read() from it blocked the
-		// calling thread in the kernel.
-		//
-		// See
-		//   https://github.com/golang/go/issues/30426
-		// which got exposed in go 1.13 by the fix to
-		//   https://github.com/golang/go/issues/30624
-		err = unix.SetNonblock(fd, true)
-		if err != nil {
-			cleanupFds(fds)
-			return nil, fmt.Errorf("tuntap set to non-blocking failed [%d]: %w", i, err)
-		}
-
-		// create the file from the file descriptor and store it
-		file := os.NewFile(uintptr(fd), TUN)
-		fds = append(fds, file)
-
-		// 1) we only care for the name of the first tap in the multi queue set
-		// 2) if the original name was empty, the localReq has now the actual name
-		//
-		// In addition:
-		// This ensures that the link name is always identical to what the kernel returns.
-		// Not only in case of an empty name, but also when using name templates.
-		// e.g. when the provided name is "tap%d", the kernel replaces %d with the next available number.
-		if i == 0 {
-			tuntap.Name = strings.Trim(localReq.Name(), "\x00")
-		}
-	}
-
-	tuntap.Fds = append(tuntap.Fds, fds...)
-	tuntap.Queues = len(tuntap.Fds)
-	return fds, nil
-}
-
-// RemoveQueues closes the given TAP queue file descriptors and removes them
-// from the tuntap.Fds list.
-//
-// This is a logical counterpart to AddQueues and allows releasing specific queues
-// (e.g., to simulate queue failure or perform partial detach).
-//
-// The method updates tuntap.Queues to reflect the number of remaining active queues.
-//
-// It is safe to call with a subset of tuntap.Fds, but the caller must ensure
-// that the passed *os.File descriptors belong to this interface.
-func (tuntap *Tuntap) RemoveQueues(fds ...*os.File) error {
-	toClose := make(map[uintptr]struct{}, len(fds))
-	for _, fd := range fds {
-		toClose[fd.Fd()] = struct{}{}
-	}
-
-	var newFds []*os.File
-	for _, fd := range tuntap.Fds {
-		if _, shouldClose := toClose[fd.Fd()]; shouldClose {
-			if err := fd.Close(); err != nil {
-				return fmt.Errorf("failed to close queue fd %d: %w", fd.Fd(), err)
-			}
-			tuntap.Queues--
-		} else {
-			newFds = append(newFds, fd)
-		}
-	}
-	tuntap.Fds = newFds
-	return nil
-}

+ 0 - 41
vendor/github.com/vishvananda/netlink/neigh.go

@@ -1,41 +0,0 @@
-package netlink
-
-import (
-	"fmt"
-	"net"
-)
-
-// Neigh represents a link layer neighbor from netlink.
-type Neigh struct {
-	LinkIndex    int
-	Family       int
-	State        int
-	Type         int
-	Flags        int
-	FlagsExt     int
-	IP           net.IP
-	HardwareAddr net.HardwareAddr
-	LLIPAddr     net.IP //Used in the case of NHRP
-	Vlan         int
-	VNI          int
-	MasterIndex  int
-
-	// These values are expressed as "clock ticks ago".  To
-	// convert these clock ticks to seconds divide by sysconf(_SC_CLK_TCK).
-	// When _SC_CLK_TCK is 100, for example, the ndm_* times are expressed
-	// in centiseconds.
-	Confirmed uint32 // The last time ARP/ND succeeded OR higher layer confirmation was received
-	Used      uint32 // The last time ARP/ND took place for this neighbor
-	Updated   uint32 // The time when the current NUD state was entered
-}
-
-// String returns $ip/$hwaddr $label
-func (neigh *Neigh) String() string {
-	return fmt.Sprintf("%s %s", neigh.IP, neigh.HardwareAddr)
-}
-
-// NeighUpdate is sent when a neighbor changes - type is RTM_NEWNEIGH or RTM_DELNEIGH.
-type NeighUpdate struct {
-	Type uint16
-	Neigh
-}

+ 0 - 499
vendor/github.com/vishvananda/netlink/neigh_linux.go

@@ -1,499 +0,0 @@
-package netlink
-
-import (
-	"errors"
-	"fmt"
-	"net"
-	"syscall"
-	"unsafe"
-
-	"github.com/vishvananda/netlink/nl"
-	"github.com/vishvananda/netns"
-	"golang.org/x/sys/unix"
-)
-
-const (
-	NDA_UNSPEC = iota
-	NDA_DST
-	NDA_LLADDR
-	NDA_CACHEINFO
-	NDA_PROBES
-	NDA_VLAN
-	NDA_PORT
-	NDA_VNI
-	NDA_IFINDEX
-	NDA_MASTER
-	NDA_LINK_NETNSID
-	NDA_SRC_VNI
-	NDA_PROTOCOL
-	NDA_NH_ID
-	NDA_FDB_EXT_ATTRS
-	NDA_FLAGS_EXT
-	NDA_MAX = NDA_FLAGS_EXT
-)
-
-// Neighbor Cache Entry States.
-const (
-	NUD_NONE       = 0x00
-	NUD_INCOMPLETE = 0x01
-	NUD_REACHABLE  = 0x02
-	NUD_STALE      = 0x04
-	NUD_DELAY      = 0x08
-	NUD_PROBE      = 0x10
-	NUD_FAILED     = 0x20
-	NUD_NOARP      = 0x40
-	NUD_PERMANENT  = 0x80
-)
-
-// Neighbor Flags
-const (
-	NTF_USE         = 0x01
-	NTF_SELF        = 0x02
-	NTF_MASTER      = 0x04
-	NTF_PROXY       = 0x08
-	NTF_EXT_LEARNED = 0x10
-	NTF_OFFLOADED   = 0x20
-	NTF_STICKY      = 0x40
-	NTF_ROUTER      = 0x80
-)
-
-// Extended Neighbor Flags
-const (
-	NTF_EXT_MANAGED = 0x00000001
-)
-
-// Ndmsg is for adding, removing or receiving information about a neighbor table entry
-type Ndmsg struct {
-	Family uint8
-	Index  uint32
-	State  uint16
-	Flags  uint8
-	Type   uint8
-}
-
-func deserializeNdmsg(b []byte) *Ndmsg {
-	var dummy Ndmsg
-	return (*Ndmsg)(unsafe.Pointer(&b[0:unsafe.Sizeof(dummy)][0]))
-}
-
-func (msg *Ndmsg) Serialize() []byte {
-	return (*(*[unsafe.Sizeof(*msg)]byte)(unsafe.Pointer(msg)))[:]
-}
-
-func (msg *Ndmsg) Len() int {
-	return int(unsafe.Sizeof(*msg))
-}
-
-// NeighAdd will add an IP to MAC mapping to the ARP table
-// Equivalent to: `ip neigh add ....`
-func NeighAdd(neigh *Neigh) error {
-	return pkgHandle.NeighAdd(neigh)
-}
-
-// NeighAdd will add an IP to MAC mapping to the ARP table
-// Equivalent to: `ip neigh add ....`
-func (h *Handle) NeighAdd(neigh *Neigh) error {
-	return h.neighAdd(neigh, unix.NLM_F_CREATE|unix.NLM_F_EXCL)
-}
-
-// NeighSet will add or replace an IP to MAC mapping to the ARP table
-// Equivalent to: `ip neigh replace....`
-func NeighSet(neigh *Neigh) error {
-	return pkgHandle.NeighSet(neigh)
-}
-
-// NeighSet will add or replace an IP to MAC mapping to the ARP table
-// Equivalent to: `ip neigh replace....`
-func (h *Handle) NeighSet(neigh *Neigh) error {
-	return h.neighAdd(neigh, unix.NLM_F_CREATE|unix.NLM_F_REPLACE)
-}
-
-// NeighAppend will append an entry to FDB
-// Equivalent to: `bridge fdb append...`
-func NeighAppend(neigh *Neigh) error {
-	return pkgHandle.NeighAppend(neigh)
-}
-
-// NeighAppend will append an entry to FDB
-// Equivalent to: `bridge fdb append...`
-func (h *Handle) NeighAppend(neigh *Neigh) error {
-	return h.neighAdd(neigh, unix.NLM_F_CREATE|unix.NLM_F_APPEND)
-}
-
-// NeighAppend will append an entry to FDB
-// Equivalent to: `bridge fdb append...`
-func neighAdd(neigh *Neigh, mode int) error {
-	return pkgHandle.neighAdd(neigh, mode)
-}
-
-// NeighAppend will append an entry to FDB
-// Equivalent to: `bridge fdb append...`
-func (h *Handle) neighAdd(neigh *Neigh, mode int) error {
-	req := h.newNetlinkRequest(unix.RTM_NEWNEIGH, mode|unix.NLM_F_ACK)
-	return neighHandle(neigh, req)
-}
-
-// NeighDel will delete an IP address from a link device.
-// Equivalent to: `ip addr del $addr dev $link`
-func NeighDel(neigh *Neigh) error {
-	return pkgHandle.NeighDel(neigh)
-}
-
-// NeighDel will delete an IP address from a link device.
-// Equivalent to: `ip addr del $addr dev $link`
-func (h *Handle) NeighDel(neigh *Neigh) error {
-	req := h.newNetlinkRequest(unix.RTM_DELNEIGH, unix.NLM_F_ACK)
-	return neighHandle(neigh, req)
-}
-
-func neighHandle(neigh *Neigh, req *nl.NetlinkRequest) error {
-	var family int
-
-	if neigh.Family > 0 {
-		family = neigh.Family
-	} else {
-		family = nl.GetIPFamily(neigh.IP)
-	}
-
-	msg := Ndmsg{
-		Family: uint8(family),
-		Index:  uint32(neigh.LinkIndex),
-		State:  uint16(neigh.State),
-		Type:   uint8(neigh.Type),
-		Flags:  uint8(neigh.Flags),
-	}
-	req.AddData(&msg)
-
-	ipData := neigh.IP.To4()
-	if ipData == nil {
-		ipData = neigh.IP.To16()
-	}
-
-	dstData := nl.NewRtAttr(NDA_DST, ipData)
-	req.AddData(dstData)
-
-	if neigh.LLIPAddr != nil {
-		llIPData := nl.NewRtAttr(NDA_LLADDR, neigh.LLIPAddr.To4())
-		req.AddData(llIPData)
-	} else if neigh.HardwareAddr != nil {
-		hwData := nl.NewRtAttr(NDA_LLADDR, []byte(neigh.HardwareAddr))
-		req.AddData(hwData)
-	}
-
-	if neigh.FlagsExt != 0 {
-		flagsExtData := nl.NewRtAttr(NDA_FLAGS_EXT, nl.Uint32Attr(uint32(neigh.FlagsExt)))
-		req.AddData(flagsExtData)
-	}
-
-	if neigh.Vlan != 0 {
-		vlanData := nl.NewRtAttr(NDA_VLAN, nl.Uint16Attr(uint16(neigh.Vlan)))
-		req.AddData(vlanData)
-	}
-
-	if neigh.VNI != 0 {
-		vniData := nl.NewRtAttr(NDA_VNI, nl.Uint32Attr(uint32(neigh.VNI)))
-		req.AddData(vniData)
-	}
-
-	if neigh.MasterIndex != 0 {
-		masterData := nl.NewRtAttr(NDA_MASTER, nl.Uint32Attr(uint32(neigh.MasterIndex)))
-		req.AddData(masterData)
-	}
-
-	_, err := req.Execute(unix.NETLINK_ROUTE, 0)
-	return err
-}
-
-// NeighList returns a list of IP-MAC mappings in the system (ARP table).
-// Equivalent to: `ip neighbor show`.
-// The list can be filtered by link and ip family.
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func NeighList(linkIndex, family int) ([]Neigh, error) {
-	return pkgHandle.NeighList(linkIndex, family)
-}
-
-// NeighProxyList returns a list of neighbor proxies in the system.
-// Equivalent to: `ip neighbor show proxy`.
-// The list can be filtered by link and ip family.
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func NeighProxyList(linkIndex, family int) ([]Neigh, error) {
-	return pkgHandle.NeighProxyList(linkIndex, family)
-}
-
-// NeighList returns a list of IP-MAC mappings in the system (ARP table).
-// Equivalent to: `ip neighbor show`.
-// The list can be filtered by link and ip family.
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func (h *Handle) NeighList(linkIndex, family int) ([]Neigh, error) {
-	return h.NeighListExecute(Ndmsg{
-		Family: uint8(family),
-		Index:  uint32(linkIndex),
-	})
-}
-
-// NeighProxyList returns a list of neighbor proxies in the system.
-// Equivalent to: `ip neighbor show proxy`.
-// The list can be filtered by link, ip family.
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func (h *Handle) NeighProxyList(linkIndex, family int) ([]Neigh, error) {
-	return h.NeighListExecute(Ndmsg{
-		Family: uint8(family),
-		Index:  uint32(linkIndex),
-		Flags:  NTF_PROXY,
-	})
-}
-
-// NeighListExecute returns a list of neighbour entries filtered by link, ip family, flag and state.
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func NeighListExecute(msg Ndmsg) ([]Neigh, error) {
-	return pkgHandle.NeighListExecute(msg)
-}
-
-// NeighListExecute returns a list of neighbour entries filtered by link, ip family, flag and state.
-//
-// If the returned error is [ErrDumpInterrupted], results may be inconsistent
-// or incomplete.
-func (h *Handle) NeighListExecute(msg Ndmsg) ([]Neigh, error) {
-	req := h.newNetlinkRequest(unix.RTM_GETNEIGH, unix.NLM_F_DUMP)
-	req.AddData(&msg)
-
-	msgs, executeErr := req.Execute(unix.NETLINK_ROUTE, unix.RTM_NEWNEIGH)
-	if executeErr != nil && !errors.Is(executeErr, ErrDumpInterrupted) {
-		return nil, executeErr
-	}
-
-	var res []Neigh
-	for _, m := range msgs {
-		ndm := deserializeNdmsg(m)
-		if msg.Index != 0 && ndm.Index != msg.Index {
-			// Ignore messages from other interfaces
-			continue
-		}
-		if msg.Family != 0 && ndm.Family != msg.Family {
-			continue
-		}
-		if msg.State != 0 && ndm.State != msg.State {
-			continue
-		}
-		if msg.Type != 0 && ndm.Type != msg.Type {
-			continue
-		}
-		if msg.Flags != 0 && ndm.Flags != msg.Flags {
-			continue
-		}
-
-		neigh, err := NeighDeserialize(m)
-		if err != nil {
-			continue
-		}
-
-		res = append(res, *neigh)
-	}
-
-	return res, executeErr
-}
-
-func NeighDeserialize(m []byte) (*Neigh, error) {
-	msg := deserializeNdmsg(m)
-
-	neigh := Neigh{
-		LinkIndex: int(msg.Index),
-		Family:    int(msg.Family),
-		State:     int(msg.State),
-		Type:      int(msg.Type),
-		Flags:     int(msg.Flags),
-	}
-
-	attrs, err := nl.ParseRouteAttr(m[msg.Len():])
-	if err != nil {
-		return nil, err
-	}
-
-	for _, attr := range attrs {
-		switch attr.Attr.Type {
-		case NDA_DST:
-			neigh.IP = net.IP(attr.Value)
-		case NDA_LLADDR:
-			// BUG: Is this a bug in the netlink library?
-			// #define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
-			// #define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0))
-			attrLen := attr.Attr.Len - unix.SizeofRtAttr
-			if attrLen == 4 {
-				neigh.LLIPAddr = net.IP(attr.Value)
-			} else if attrLen == 16 {
-				// Can be IPv6 or FireWire HWAddr
-				link, err := LinkByIndex(neigh.LinkIndex)
-				if err == nil && link.Attrs().EncapType == "tunnel6" {
-					neigh.IP = net.IP(attr.Value)
-				} else {
-					neigh.HardwareAddr = net.HardwareAddr(attr.Value)
-				}
-			} else {
-				neigh.HardwareAddr = net.HardwareAddr(attr.Value)
-			}
-		case NDA_FLAGS_EXT:
-			neigh.FlagsExt = int(native.Uint32(attr.Value[0:4]))
-		case NDA_VLAN:
-			neigh.Vlan = int(native.Uint16(attr.Value[0:2]))
-		case NDA_VNI:
-			neigh.VNI = int(native.Uint32(attr.Value[0:4]))
-		case NDA_MASTER:
-			neigh.MasterIndex = int(native.Uint32(attr.Value[0:4]))
-		case NDA_CACHEINFO:
-			neigh.Confirmed = native.Uint32(attr.Value[0:4])
-			neigh.Used = native.Uint32(attr.Value[4:8])
-			neigh.Updated = native.Uint32(attr.Value[8:12])
-		}
-	}
-
-	return &neigh, nil
-}
-
-// NeighSubscribe takes a chan down which notifications will be sent
-// when neighbors are added or deleted. Close the 'done' chan to stop subscription.
-func NeighSubscribe(ch chan<- NeighUpdate, done <-chan struct{}) error {
-	return neighSubscribeAt(netns.None(), netns.None(), ch, done, nil, false, 0, nil, false)
-}
-
-// NeighSubscribeAt works like NeighSubscribe plus it allows the caller
-// to choose the network namespace in which to subscribe (ns).
-func NeighSubscribeAt(ns netns.NsHandle, ch chan<- NeighUpdate, done <-chan struct{}) error {
-	return neighSubscribeAt(ns, netns.None(), ch, done, nil, false, 0, nil, false)
-}
-
-// NeighSubscribeOptions contains a set of options to use with
-// NeighSubscribeWithOptions.
-type NeighSubscribeOptions struct {
-	Namespace     *netns.NsHandle
-	ErrorCallback func(error)
-	ListExisting  bool
-
-	// max size is based on value of /proc/sys/net/core/rmem_max
-	ReceiveBufferSize      int
-	ReceiveBufferForceSize bool
-	ReceiveTimeout         *unix.Timeval
-}
-
-// NeighSubscribeWithOptions work like NeighSubscribe but enable to
-// provide additional options to modify the behavior. Currently, the
-// namespace can be provided as well as an error callback.
-//
-// When options.ListExisting is true, options.ErrorCallback may be
-// called with [ErrDumpInterrupted] to indicate that results from
-// the initial dump of links may be inconsistent or incomplete.
-func NeighSubscribeWithOptions(ch chan<- NeighUpdate, done <-chan struct{}, options NeighSubscribeOptions) error {
-	if options.Namespace == nil {
-		none := netns.None()
-		options.Namespace = &none
-	}
-	return neighSubscribeAt(*options.Namespace, netns.None(), ch, done, options.ErrorCallback, options.ListExisting,
-		options.ReceiveBufferSize, options.ReceiveTimeout, options.ReceiveBufferForceSize)
-}
-
-func neighSubscribeAt(newNs, curNs netns.NsHandle, ch chan<- NeighUpdate, done <-chan struct{}, cberr func(error), listExisting bool,
-	rcvbuf int, rcvTimeout *unix.Timeval, rcvbufForce bool) error {
-	s, err := nl.SubscribeAt(newNs, curNs, unix.NETLINK_ROUTE, unix.RTNLGRP_NEIGH)
-	makeRequest := func(family int) error {
-		req := pkgHandle.newNetlinkRequest(unix.RTM_GETNEIGH, unix.NLM_F_DUMP)
-		ndmsg := &Ndmsg{Family: uint8(family)}
-		req.AddData(ndmsg)
-		if err := s.Send(req); err != nil {
-			return err
-		}
-		return nil
-	}
-	if err != nil {
-		return err
-	}
-	if rcvTimeout != nil {
-		if err := s.SetReceiveTimeout(rcvTimeout); err != nil {
-			return err
-		}
-	}
-	if rcvbuf != 0 {
-		err = s.SetReceiveBufferSize(rcvbuf, rcvbufForce)
-		if err != nil {
-			return err
-		}
-	}
-	if done != nil {
-		go func() {
-			<-done
-			s.Close()
-		}()
-	}
-	if listExisting {
-		if err := makeRequest(unix.AF_UNSPEC); err != nil {
-			return err
-		}
-		// We have to wait for NLMSG_DONE before making AF_BRIDGE request
-	}
-	go func() {
-		defer close(ch)
-		for {
-			msgs, from, err := s.Receive()
-			if err != nil {
-				if cberr != nil {
-					cberr(err)
-				}
-				return
-			}
-			if from.Pid != nl.PidKernel {
-				if cberr != nil {
-					cberr(fmt.Errorf("Wrong sender portid %d, expected %d", from.Pid, nl.PidKernel))
-				}
-				continue
-			}
-			for _, m := range msgs {
-				if m.Header.Flags&unix.NLM_F_DUMP_INTR != 0 && cberr != nil {
-					cberr(ErrDumpInterrupted)
-				}
-				if m.Header.Type == unix.NLMSG_DONE {
-					if listExisting {
-						// This will be called after handling AF_UNSPEC
-						// list request, we have to wait for NLMSG_DONE
-						// before making another request
-						if err := makeRequest(unix.AF_BRIDGE); err != nil {
-							if cberr != nil {
-								cberr(err)
-							}
-							return
-						}
-						listExisting = false
-					}
-					continue
-				}
-				if m.Header.Type == unix.NLMSG_ERROR {
-					nError := int32(native.Uint32(m.Data[0:4]))
-					if nError == 0 {
-						continue
-					}
-					if cberr != nil {
-						cberr(syscall.Errno(-nError))
-					}
-					return
-				}
-				neigh, err := NeighDeserialize(m.Data)
-				if err != nil {
-					if cberr != nil {
-						cberr(err)
-					}
-					return
-				}
-				ch <- NeighUpdate{Type: m.Header.Type, Neigh: *neigh}
-			}
-		}
-	}()
-
-	return nil
-}

+ 0 - 40
vendor/github.com/vishvananda/netlink/netlink.go

@@ -1,40 +0,0 @@
-// Package netlink provides a simple library for netlink. Netlink is
-// the interface a user-space program in linux uses to communicate with
-// the kernel. It can be used to add and remove interfaces, set up ip
-// addresses and routes, and confiugre ipsec. Netlink communication
-// requires elevated privileges, so in most cases this code needs to
-// be run as root. The low level primitives for netlink are contained
-// in the nl subpackage. This package attempts to provide a high-level
-// interface that is loosly modeled on the iproute2 cli.
-package netlink
-
-import (
-	"errors"
-	"net"
-)
-
-var (
-	// ErrNotImplemented is returned when a requested feature is not implemented.
-	ErrNotImplemented = errors.New("not implemented")
-)
-
-// ParseIPNet parses a string in ip/net format and returns a net.IPNet.
-// This is valuable because addresses in netlink are often IPNets and
-// ParseCIDR returns an IPNet with the IP part set to the base IP of the
-// range.
-func ParseIPNet(s string) (*net.IPNet, error) {
-	ip, ipNet, err := net.ParseCIDR(s)
-	if err != nil {
-		return nil, err
-	}
-	ipNet.IP = ip
-	return ipNet, nil
-}
-
-// NewIPNet generates an IPNet from an ip address using a netmask of 32 or 128.
-func NewIPNet(ip net.IP) *net.IPNet {
-	if ip.To4() != nil {
-		return &net.IPNet{IP: ip, Mask: net.CIDRMask(32, 32)}
-	}
-	return &net.IPNet{IP: ip, Mask: net.CIDRMask(128, 128)}
-}

+ 0 - 14
vendor/github.com/vishvananda/netlink/netlink_linux.go

@@ -1,14 +0,0 @@
-package netlink
-
-import "github.com/vishvananda/netlink/nl"
-
-// Family type definitions
-const (
-	FAMILY_ALL  = nl.FAMILY_ALL
-	FAMILY_V4   = nl.FAMILY_V4
-	FAMILY_V6   = nl.FAMILY_V6
-	FAMILY_MPLS = nl.FAMILY_MPLS
-)
-
-// ErrDumpInterrupted is an alias for [nl.ErrDumpInterrupted].
-var ErrDumpInterrupted = nl.ErrDumpInterrupted

+ 0 - 294
vendor/github.com/vishvananda/netlink/netlink_unspecified.go

@@ -1,294 +0,0 @@
-//go:build !linux
-// +build !linux
-
-package netlink
-
-import "net"
-
-func LinkSetUp(link Link) error {
-	return ErrNotImplemented
-}
-
-func LinkSetDown(link Link) error {
-	return ErrNotImplemented
-}
-
-func LinkSetMTU(link Link, mtu int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetMaster(link Link, master Link) error {
-	return ErrNotImplemented
-}
-
-func LinkSetNsPid(link Link, nspid int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetNsFd(link Link, fd int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetName(link Link, name string) error {
-	return ErrNotImplemented
-}
-
-func LinkSetAlias(link Link, name string) error {
-	return ErrNotImplemented
-}
-
-func LinkSetHardwareAddr(link Link, hwaddr net.HardwareAddr) error {
-	return ErrNotImplemented
-}
-
-func LinkSetVfHardwareAddr(link Link, vf int, hwaddr net.HardwareAddr) error {
-	return ErrNotImplemented
-}
-
-func LinkSetVfVlan(link Link, vf, vlan int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetVfVlanQos(link Link, vf, vlan, qos int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetVfVlanQosProto(link Link, vf, vlan, qos, proto int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetVfTxRate(link Link, vf, rate int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetVfRate(link Link, vf, minRate, maxRate int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetNoMaster(link Link) error {
-	return ErrNotImplemented
-}
-
-func LinkSetMasterByIndex(link Link, masterIndex int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetXdpFd(link Link, fd int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetXdpFdWithFlags(link Link, fd, flags int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetARPOff(link Link) error {
-	return ErrNotImplemented
-}
-
-func LinkSetARPOn(link Link) error {
-	return ErrNotImplemented
-}
-
-func LinkByName(name string) (Link, error) {
-	return nil, ErrNotImplemented
-}
-
-func LinkByAlias(alias string) (Link, error) {
-	return nil, ErrNotImplemented
-}
-
-func LinkByIndex(index int) (Link, error) {
-	return nil, ErrNotImplemented
-}
-
-func LinkSetHairpin(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func LinkSetGuard(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func LinkSetFastLeave(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func LinkSetLearning(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func LinkSetRootBlock(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func LinkSetFlood(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func LinkSetTxQLen(link Link, qlen int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetGSOMaxSize(link Link, maxSize int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetGROMaxSize(link Link, maxSize int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetGSOIPv4MaxSize(link Link, maxSize int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetGROIPv4MaxSize(link Link, maxSize int) error {
-	return ErrNotImplemented
-}
-
-func LinkSetIP6AddrGenMode(link Link, mode int) error {
-	return ErrNotImplemented
-}
-
-func LinkAdd(link Link) error {
-	return ErrNotImplemented
-}
-
-func LinkDel(link Link) error {
-	return ErrNotImplemented
-}
-
-func SetHairpin(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func SetGuard(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func SetFastLeave(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func SetLearning(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func SetRootBlock(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func SetFlood(link Link, mode bool) error {
-	return ErrNotImplemented
-}
-
-func LinkList() ([]Link, error) {
-	return nil, ErrNotImplemented
-}
-
-func AddrAdd(link Link, addr *Addr) error {
-	return ErrNotImplemented
-}
-
-func AddrReplace(link Link, addr *Addr) error {
-	return ErrNotImplemented
-}
-
-func AddrDel(link Link, addr *Addr) error {
-	return ErrNotImplemented
-}
-
-func AddrList(link Link, family int) ([]Addr, error) {
-	return nil, ErrNotImplemented
-}
-
-func RouteAdd(route *Route) error {
-	return ErrNotImplemented
-}
-
-func RouteAppend(route *Route) error {
-	return ErrNotImplemented
-}
-
-func RouteChange(route *Route) error {
-	return ErrNotImplemented
-}
-
-func RouteDel(route *Route) error {
-	return ErrNotImplemented
-}
-
-func RouteGet(destination net.IP) ([]Route, error) {
-	return nil, ErrNotImplemented
-}
-
-func RouteList(link Link, family int) ([]Route, error) {
-	return nil, ErrNotImplemented
-}
-
-func RouteListFiltered(family int, filter *Route, filterMask uint64) ([]Route, error) {
-	return nil, ErrNotImplemented
-}
-
-func RouteReplace(route *Route) error {
-	return ErrNotImplemented
-}
-
-func XfrmPolicyAdd(policy *XfrmPolicy) error {
-	return ErrNotImplemented
-}
-
-func XfrmPolicyDel(policy *XfrmPolicy) error {
-	return ErrNotImplemented
-}
-
-func XfrmPolicyList(family int) ([]XfrmPolicy, error) {
-	return nil, ErrNotImplemented
-}
-
-func XfrmPolicyGet(policy *XfrmPolicy) (*XfrmPolicy, error) {
-	return nil, ErrNotImplemented
-}
-
-func XfrmStateAdd(policy *XfrmState) error {
-	return ErrNotImplemented
-}
-
-func XfrmStateDel(policy *XfrmState) error {
-	return ErrNotImplemented
-}
-
-func XfrmStateList(family int) ([]XfrmState, error) {
-	return nil, ErrNotImplemented
-}
-
-func NeighAdd(neigh *Neigh) error {
-	return ErrNotImplemented
-}
-
-func NeighSet(neigh *Neigh) error {
-	return ErrNotImplemented
-}
-
-func NeighAppend(neigh *Neigh) error {
-	return ErrNotImplemented
-}
-
-func NeighDel(neigh *Neigh) error {
-	return ErrNotImplemented
-}
-
-func NeighList(linkIndex, family int) ([]Neigh, error) {
-	return nil, ErrNotImplemented
-}
-
-func NeighDeserialize(m []byte) (*Neigh, error) {
-	return nil, ErrNotImplemented
-}
-
-func SocketGet(local, remote net.Addr) (*Socket, error) {
-	return nil, ErrNotImplemented
-}
-
-func SocketDestroy(local, remote net.Addr) (*Socket, error) {
-	return nil, ErrNotImplemented
-}

+ 0 - 141
vendor/github.com/vishvananda/netlink/netns_linux.go

@@ -1,141 +0,0 @@
-package netlink
-
-// Network namespace ID functions
-//
-// The kernel has a weird concept called the network namespace ID.
-// This is different from the file reference in proc (and any bind-mounted
-// namespaces, etc.)
-//
-// Instead, namespaces can be assigned a numeric ID at any time. Once set,
-// the ID is fixed. The ID can either be set manually by the user, or
-// automatically, triggered by certain kernel actions. The most common kernel
-// action that triggers namespace ID creation is moving one end of a veth pair
-// in to that namespace.
-
-import (
-	"fmt"
-
-	"github.com/vishvananda/netlink/nl"
-	"golang.org/x/sys/unix"
-)
-
-// These can be replaced by the values from sys/unix when it is next released.
-const (
-	_ = iota
-	NETNSA_NSID
-	NETNSA_PID
-	NETNSA_FD
-)
-
-// GetNetNsIdByPid looks up the network namespace ID for a given pid (really thread id).
-// Returns -1 if the namespace does not have an ID set.
-func (h *Handle) GetNetNsIdByPid(pid int) (int, error) {
-	return h.getNetNsId(NETNSA_PID, uint32(pid))
-}
-
-// GetNetNsIdByPid looks up the network namespace ID for a given pid (really thread id).
-// Returns -1 if the namespace does not have an ID set.
-func GetNetNsIdByPid(pid int) (int, error) {
-	return pkgHandle.GetNetNsIdByPid(pid)
-}
-
-// SetNetNSIdByPid sets the ID of the network namespace for a given pid (really thread id).
-// The ID can only be set for namespaces without an ID already set.
-func (h *Handle) SetNetNsIdByPid(pid, nsid int) error {
-	return h.setNetNsId(NETNSA_PID, uint32(pid), uint32(nsid))
-}
-
-// SetNetNSIdByPid sets the ID of the network namespace for a given pid (really thread id).
-// The ID can only be set for namespaces without an ID already set.
-func SetNetNsIdByPid(pid, nsid int) error {
-	return pkgHandle.SetNetNsIdByPid(pid, nsid)
-}
-
-// GetNetNsIdByFd looks up the network namespace ID for a given fd.
-// fd must be an open file descriptor to a namespace file.
-// Returns -1 if the namespace does not have an ID set.
-func (h *Handle) GetNetNsIdByFd(fd int) (int, error) {
-	return h.getNetNsId(NETNSA_FD, uint32(fd))
-}
-
-// GetNetNsIdByFd looks up the network namespace ID for a given fd.
-// fd must be an open file descriptor to a namespace file.
-// Returns -1 if the namespace does not have an ID set.
-func GetNetNsIdByFd(fd int) (int, error) {
-	return pkgHandle.GetNetNsIdByFd(fd)
-}
-
-// SetNetNSIdByFd sets the ID of the network namespace for a given fd.
-// fd must be an open file descriptor to a namespace file.
-// The ID can only be set for namespaces without an ID already set.
-func (h *Handle) SetNetNsIdByFd(fd, nsid int) error {
-	return h.setNetNsId(NETNSA_FD, uint32(fd), uint32(nsid))
-}
-
-// SetNetNSIdByFd sets the ID of the network namespace for a given fd.
-// fd must be an open file descriptor to a namespace file.
-// The ID can only be set for namespaces without an ID already set.
-func SetNetNsIdByFd(fd, nsid int) error {
-	return pkgHandle.SetNetNsIdByFd(fd, nsid)
-}
-
-// getNetNsId requests the netnsid for a given type-val pair
-// type should be either NETNSA_PID or NETNSA_FD
-func (h *Handle) getNetNsId(attrType int, val uint32) (int, error) {
-	req := h.newNetlinkRequest(unix.RTM_GETNSID, unix.NLM_F_REQUEST)
-
-	rtgen := nl.NewRtGenMsg()
-	req.AddData(rtgen)
-
-	b := make([]byte, 4)
-	native.PutUint32(b, val)
-	attr := nl.NewRtAttr(attrType, b)
-	req.AddData(attr)
-
-	msgs, err := req.Execute(unix.NETLINK_ROUTE, unix.RTM_NEWNSID)
-
-	if err != nil {
-		return 0, err
-	}
-
-	for _, m := range msgs {
-		msg := nl.DeserializeRtGenMsg(m)
-
-		attrs, err := nl.ParseRouteAttr(m[msg.Len():])
-		if err != nil {
-			return 0, err
-		}
-
-		for _, attr := range attrs {
-			switch attr.Attr.Type {
-			case NETNSA_NSID:
-				return int(int32(native.Uint32(attr.Value))), nil
-			}
-		}
-	}
-
-	return 0, fmt.Errorf("unexpected empty result")
-}
-
-// setNetNsId sets the netnsid for a given type-val pair
-// type should be either NETNSA_PID or NETNSA_FD
-// The ID can only be set for namespaces without an ID already set
-func (h *Handle) setNetNsId(attrType int, val uint32, newnsid uint32) error {
-	req := h.newNetlinkRequest(unix.RTM_NEWNSID, unix.NLM_F_REQUEST|unix.NLM_F_ACK)
-
-	rtgen := nl.NewRtGenMsg()
-	req.AddData(rtgen)
-
-	b := make([]byte, 4)
-	native.PutUint32(b, val)
-	attr := nl.NewRtAttr(attrType, b)
-	req.AddData(attr)
-
-	b1 := make([]byte, 4)
-	native.PutUint32(b1, newnsid)
-	attr1 := nl.NewRtAttr(NETNSA_NSID, b1)
-	req.AddData(attr1)
-
-	_, err := req.Execute(unix.NETLINK_ROUTE, unix.RTM_NEWNSID)
-	return err
-}

+ 0 - 0
vendor/github.com/vishvananda/netlink/netns_unspecified.go


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor