go 1.19 && go get -u && go mod tidy && go mod vendor
This commit is contained in:
parent
d67d3a1899
commit
c49752492e
16
go.mod
16
go.mod
|
@ -1,17 +1,17 @@
|
|||
module github.com/DrJosh9000/sungrow
|
||||
|
||||
go 1.18
|
||||
go 1.19
|
||||
|
||||
require github.com/prometheus/client_golang v1.13.0
|
||||
require github.com/prometheus/client_golang v1.14.0
|
||||
|
||||
require (
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
|
||||
github.com/prometheus/client_model v0.2.0 // indirect
|
||||
github.com/prometheus/common v0.37.0 // indirect
|
||||
github.com/prometheus/procfs v0.8.0 // indirect
|
||||
golang.org/x/sys v0.0.0-20220818161305-2296e01440c6 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||
github.com/prometheus/client_model v0.3.0 // indirect
|
||||
github.com/prometheus/common v0.39.0 // indirect
|
||||
github.com/prometheus/procfs v0.9.0 // indirect
|
||||
golang.org/x/sys v0.4.0 // indirect
|
||||
google.golang.org/protobuf v1.28.1 // indirect
|
||||
)
|
||||
|
|
478
go.sum
478
go.sum
|
@ -1,476 +1,30 @@
|
|||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
||||
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
||||
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
||||
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
||||
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
|
||||
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
|
||||
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
|
||||
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
|
||||
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
|
||||
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
|
||||
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
|
||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
||||
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
|
||||
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
|
||||
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
|
||||
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
||||
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
|
||||
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
|
||||
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
||||
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
|
||||
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
|
||||
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
|
||||
github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
||||
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
|
||||
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
|
||||
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
|
||||
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
|
||||
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
|
||||
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
|
||||
github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU=
|
||||
github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
|
||||
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
|
||||
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
|
||||
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
|
||||
github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE=
|
||||
github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
||||
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||
github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=
|
||||
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
||||
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
|
||||
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
|
||||
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
||||
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
|
||||
github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=
|
||||
github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
|
||||
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
|
||||
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
|
||||
github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI=
|
||||
github.com/prometheus/common v0.39.0/go.mod h1:6XBZ7lYdLCbkAVhwRsWTZn+IN5AB9F/NXd5w0BbEX0Y=
|
||||
github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=
|
||||
github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220818161305-2296e01440c6 h1:Sx/u41w+OwrInGdEckYmEuU5gHoGSL4QbDz3S9s6j4U=
|
||||
golang.org/x/sys v0.0.0-20220818161305-2296e01440c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
|
||||
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
|
||||
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
|
||||
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
|
||||
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
|
||||
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
|
||||
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
|
||||
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
|
||||
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
[![Go Reference](https://pkg.go.dev/badge/github.com/cespare/xxhash/v2.svg)](https://pkg.go.dev/github.com/cespare/xxhash/v2)
|
||||
[![Test](https://github.com/cespare/xxhash/actions/workflows/test.yml/badge.svg)](https://github.com/cespare/xxhash/actions/workflows/test.yml)
|
||||
|
||||
xxhash is a Go implementation of the 64-bit
|
||||
[xxHash](http://cyan4973.github.io/xxHash/) algorithm, XXH64. This is a
|
||||
xxhash is a Go implementation of the 64-bit [xxHash] algorithm, XXH64. This is a
|
||||
high-quality hashing algorithm that is much faster than anything in the Go
|
||||
standard library.
|
||||
|
||||
|
@ -25,8 +24,11 @@ func (*Digest) WriteString(string) (int, error)
|
|||
func (*Digest) Sum64() uint64
|
||||
```
|
||||
|
||||
This implementation provides a fast pure-Go implementation and an even faster
|
||||
assembly implementation for amd64.
|
||||
The package is written with optimized pure Go and also contains even faster
|
||||
assembly implementations for amd64 and arm64. If desired, the `purego` build tag
|
||||
opts into using the Go code even on those architectures.
|
||||
|
||||
[xxHash]: http://cyan4973.github.io/xxHash/
|
||||
|
||||
## Compatibility
|
||||
|
||||
|
@ -45,19 +47,20 @@ I recommend using the latest release of Go.
|
|||
Here are some quick benchmarks comparing the pure-Go and assembly
|
||||
implementations of Sum64.
|
||||
|
||||
| input size | purego | asm |
|
||||
| --- | --- | --- |
|
||||
| 5 B | 979.66 MB/s | 1291.17 MB/s |
|
||||
| 100 B | 7475.26 MB/s | 7973.40 MB/s |
|
||||
| 4 KB | 17573.46 MB/s | 17602.65 MB/s |
|
||||
| 10 MB | 17131.46 MB/s | 17142.16 MB/s |
|
||||
| input size | purego | asm |
|
||||
| ---------- | --------- | --------- |
|
||||
| 4 B | 1.3 GB/s | 1.2 GB/s |
|
||||
| 16 B | 2.9 GB/s | 3.5 GB/s |
|
||||
| 100 B | 6.9 GB/s | 8.1 GB/s |
|
||||
| 4 KB | 11.7 GB/s | 16.7 GB/s |
|
||||
| 10 MB | 12.0 GB/s | 17.3 GB/s |
|
||||
|
||||
These numbers were generated on Ubuntu 18.04 with an Intel i7-8700K CPU using
|
||||
the following commands under Go 1.11.2:
|
||||
These numbers were generated on Ubuntu 20.04 with an Intel Xeon Platinum 8252C
|
||||
CPU using the following commands under Go 1.19.2:
|
||||
|
||||
```
|
||||
$ go test -tags purego -benchtime 10s -bench '/xxhash,direct,bytes'
|
||||
$ go test -benchtime 10s -bench '/xxhash,direct,bytes'
|
||||
benchstat <(go test -tags purego -benchtime 500ms -count 15 -bench 'Sum64$')
|
||||
benchstat <(go test -benchtime 500ms -count 15 -bench 'Sum64$')
|
||||
```
|
||||
|
||||
## Projects using this package
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
set -eu -o pipefail
|
||||
|
||||
# Small convenience script for running the tests with various combinations of
|
||||
# arch/tags. This assumes we're running on amd64 and have qemu available.
|
||||
|
||||
go test ./...
|
||||
go test -tags purego ./...
|
||||
GOARCH=arm64 go test
|
||||
GOARCH=arm64 go test -tags purego
|
|
@ -16,19 +16,11 @@ const (
|
|||
prime5 uint64 = 2870177450012600261
|
||||
)
|
||||
|
||||
// NOTE(caleb): I'm using both consts and vars of the primes. Using consts where
|
||||
// possible in the Go code is worth a small (but measurable) performance boost
|
||||
// by avoiding some MOVQs. Vars are needed for the asm and also are useful for
|
||||
// convenience in the Go code in a few places where we need to intentionally
|
||||
// avoid constant arithmetic (e.g., v1 := prime1 + prime2 fails because the
|
||||
// result overflows a uint64).
|
||||
var (
|
||||
prime1v = prime1
|
||||
prime2v = prime2
|
||||
prime3v = prime3
|
||||
prime4v = prime4
|
||||
prime5v = prime5
|
||||
)
|
||||
// Store the primes in an array as well.
|
||||
//
|
||||
// The consts are used when possible in Go code to avoid MOVs but we need a
|
||||
// contiguous array of the assembly code.
|
||||
var primes = [...]uint64{prime1, prime2, prime3, prime4, prime5}
|
||||
|
||||
// Digest implements hash.Hash64.
|
||||
type Digest struct {
|
||||
|
@ -50,10 +42,10 @@ func New() *Digest {
|
|||
|
||||
// Reset clears the Digest's state so that it can be reused.
|
||||
func (d *Digest) Reset() {
|
||||
d.v1 = prime1v + prime2
|
||||
d.v1 = primes[0] + prime2
|
||||
d.v2 = prime2
|
||||
d.v3 = 0
|
||||
d.v4 = -prime1v
|
||||
d.v4 = -primes[0]
|
||||
d.total = 0
|
||||
d.n = 0
|
||||
}
|
||||
|
@ -69,21 +61,23 @@ func (d *Digest) Write(b []byte) (n int, err error) {
|
|||
n = len(b)
|
||||
d.total += uint64(n)
|
||||
|
||||
memleft := d.mem[d.n&(len(d.mem)-1):]
|
||||
|
||||
if d.n+n < 32 {
|
||||
// This new data doesn't even fill the current block.
|
||||
copy(d.mem[d.n:], b)
|
||||
copy(memleft, b)
|
||||
d.n += n
|
||||
return
|
||||
}
|
||||
|
||||
if d.n > 0 {
|
||||
// Finish off the partial block.
|
||||
copy(d.mem[d.n:], b)
|
||||
c := copy(memleft, b)
|
||||
d.v1 = round(d.v1, u64(d.mem[0:8]))
|
||||
d.v2 = round(d.v2, u64(d.mem[8:16]))
|
||||
d.v3 = round(d.v3, u64(d.mem[16:24]))
|
||||
d.v4 = round(d.v4, u64(d.mem[24:32]))
|
||||
b = b[32-d.n:]
|
||||
b = b[c:]
|
||||
d.n = 0
|
||||
}
|
||||
|
||||
|
@ -133,21 +127,20 @@ func (d *Digest) Sum64() uint64 {
|
|||
|
||||
h += d.total
|
||||
|
||||
i, end := 0, d.n
|
||||
for ; i+8 <= end; i += 8 {
|
||||
k1 := round(0, u64(d.mem[i:i+8]))
|
||||
b := d.mem[:d.n&(len(d.mem)-1)]
|
||||
for ; len(b) >= 8; b = b[8:] {
|
||||
k1 := round(0, u64(b[:8]))
|
||||
h ^= k1
|
||||
h = rol27(h)*prime1 + prime4
|
||||
}
|
||||
if i+4 <= end {
|
||||
h ^= uint64(u32(d.mem[i:i+4])) * prime1
|
||||
if len(b) >= 4 {
|
||||
h ^= uint64(u32(b[:4])) * prime1
|
||||
h = rol23(h)*prime2 + prime3
|
||||
i += 4
|
||||
b = b[4:]
|
||||
}
|
||||
for i < end {
|
||||
h ^= uint64(d.mem[i]) * prime5
|
||||
for ; len(b) > 0; b = b[1:] {
|
||||
h ^= uint64(b[0]) * prime5
|
||||
h = rol11(h) * prime1
|
||||
i++
|
||||
}
|
||||
|
||||
h ^= h >> 33
|
||||
|
|
|
@ -1,215 +1,209 @@
|
|||
//go:build !appengine && gc && !purego
|
||||
// +build !appengine
|
||||
// +build gc
|
||||
// +build !purego
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
// Register allocation:
|
||||
// AX h
|
||||
// SI pointer to advance through b
|
||||
// DX n
|
||||
// BX loop end
|
||||
// R8 v1, k1
|
||||
// R9 v2
|
||||
// R10 v3
|
||||
// R11 v4
|
||||
// R12 tmp
|
||||
// R13 prime1v
|
||||
// R14 prime2v
|
||||
// DI prime4v
|
||||
// Registers:
|
||||
#define h AX
|
||||
#define d AX
|
||||
#define p SI // pointer to advance through b
|
||||
#define n DX
|
||||
#define end BX // loop end
|
||||
#define v1 R8
|
||||
#define v2 R9
|
||||
#define v3 R10
|
||||
#define v4 R11
|
||||
#define x R12
|
||||
#define prime1 R13
|
||||
#define prime2 R14
|
||||
#define prime4 DI
|
||||
|
||||
// round reads from and advances the buffer pointer in SI.
|
||||
// It assumes that R13 has prime1v and R14 has prime2v.
|
||||
#define round(r) \
|
||||
MOVQ (SI), R12 \
|
||||
ADDQ $8, SI \
|
||||
IMULQ R14, R12 \
|
||||
ADDQ R12, r \
|
||||
ROLQ $31, r \
|
||||
IMULQ R13, r
|
||||
#define round(acc, x) \
|
||||
IMULQ prime2, x \
|
||||
ADDQ x, acc \
|
||||
ROLQ $31, acc \
|
||||
IMULQ prime1, acc
|
||||
|
||||
// mergeRound applies a merge round on the two registers acc and val.
|
||||
// It assumes that R13 has prime1v, R14 has prime2v, and DI has prime4v.
|
||||
#define mergeRound(acc, val) \
|
||||
IMULQ R14, val \
|
||||
ROLQ $31, val \
|
||||
IMULQ R13, val \
|
||||
XORQ val, acc \
|
||||
IMULQ R13, acc \
|
||||
ADDQ DI, acc
|
||||
// round0 performs the operation x = round(0, x).
|
||||
#define round0(x) \
|
||||
IMULQ prime2, x \
|
||||
ROLQ $31, x \
|
||||
IMULQ prime1, x
|
||||
|
||||
// mergeRound applies a merge round on the two registers acc and x.
|
||||
// It assumes that prime1, prime2, and prime4 have been loaded.
|
||||
#define mergeRound(acc, x) \
|
||||
round0(x) \
|
||||
XORQ x, acc \
|
||||
IMULQ prime1, acc \
|
||||
ADDQ prime4, acc
|
||||
|
||||
// blockLoop processes as many 32-byte blocks as possible,
|
||||
// updating v1, v2, v3, and v4. It assumes that there is at least one block
|
||||
// to process.
|
||||
#define blockLoop() \
|
||||
loop: \
|
||||
MOVQ +0(p), x \
|
||||
round(v1, x) \
|
||||
MOVQ +8(p), x \
|
||||
round(v2, x) \
|
||||
MOVQ +16(p), x \
|
||||
round(v3, x) \
|
||||
MOVQ +24(p), x \
|
||||
round(v4, x) \
|
||||
ADDQ $32, p \
|
||||
CMPQ p, end \
|
||||
JLE loop
|
||||
|
||||
// func Sum64(b []byte) uint64
|
||||
TEXT ·Sum64(SB), NOSPLIT, $0-32
|
||||
TEXT ·Sum64(SB), NOSPLIT|NOFRAME, $0-32
|
||||
// Load fixed primes.
|
||||
MOVQ ·prime1v(SB), R13
|
||||
MOVQ ·prime2v(SB), R14
|
||||
MOVQ ·prime4v(SB), DI
|
||||
MOVQ ·primes+0(SB), prime1
|
||||
MOVQ ·primes+8(SB), prime2
|
||||
MOVQ ·primes+24(SB), prime4
|
||||
|
||||
// Load slice.
|
||||
MOVQ b_base+0(FP), SI
|
||||
MOVQ b_len+8(FP), DX
|
||||
LEAQ (SI)(DX*1), BX
|
||||
MOVQ b_base+0(FP), p
|
||||
MOVQ b_len+8(FP), n
|
||||
LEAQ (p)(n*1), end
|
||||
|
||||
// The first loop limit will be len(b)-32.
|
||||
SUBQ $32, BX
|
||||
SUBQ $32, end
|
||||
|
||||
// Check whether we have at least one block.
|
||||
CMPQ DX, $32
|
||||
CMPQ n, $32
|
||||
JLT noBlocks
|
||||
|
||||
// Set up initial state (v1, v2, v3, v4).
|
||||
MOVQ R13, R8
|
||||
ADDQ R14, R8
|
||||
MOVQ R14, R9
|
||||
XORQ R10, R10
|
||||
XORQ R11, R11
|
||||
SUBQ R13, R11
|
||||
MOVQ prime1, v1
|
||||
ADDQ prime2, v1
|
||||
MOVQ prime2, v2
|
||||
XORQ v3, v3
|
||||
XORQ v4, v4
|
||||
SUBQ prime1, v4
|
||||
|
||||
// Loop until SI > BX.
|
||||
blockLoop:
|
||||
round(R8)
|
||||
round(R9)
|
||||
round(R10)
|
||||
round(R11)
|
||||
blockLoop()
|
||||
|
||||
CMPQ SI, BX
|
||||
JLE blockLoop
|
||||
MOVQ v1, h
|
||||
ROLQ $1, h
|
||||
MOVQ v2, x
|
||||
ROLQ $7, x
|
||||
ADDQ x, h
|
||||
MOVQ v3, x
|
||||
ROLQ $12, x
|
||||
ADDQ x, h
|
||||
MOVQ v4, x
|
||||
ROLQ $18, x
|
||||
ADDQ x, h
|
||||
|
||||
MOVQ R8, AX
|
||||
ROLQ $1, AX
|
||||
MOVQ R9, R12
|
||||
ROLQ $7, R12
|
||||
ADDQ R12, AX
|
||||
MOVQ R10, R12
|
||||
ROLQ $12, R12
|
||||
ADDQ R12, AX
|
||||
MOVQ R11, R12
|
||||
ROLQ $18, R12
|
||||
ADDQ R12, AX
|
||||
|
||||
mergeRound(AX, R8)
|
||||
mergeRound(AX, R9)
|
||||
mergeRound(AX, R10)
|
||||
mergeRound(AX, R11)
|
||||
mergeRound(h, v1)
|
||||
mergeRound(h, v2)
|
||||
mergeRound(h, v3)
|
||||
mergeRound(h, v4)
|
||||
|
||||
JMP afterBlocks
|
||||
|
||||
noBlocks:
|
||||
MOVQ ·prime5v(SB), AX
|
||||
MOVQ ·primes+32(SB), h
|
||||
|
||||
afterBlocks:
|
||||
ADDQ DX, AX
|
||||
ADDQ n, h
|
||||
|
||||
// Right now BX has len(b)-32, and we want to loop until SI > len(b)-8.
|
||||
ADDQ $24, BX
|
||||
ADDQ $24, end
|
||||
CMPQ p, end
|
||||
JG try4
|
||||
|
||||
CMPQ SI, BX
|
||||
JG fourByte
|
||||
loop8:
|
||||
MOVQ (p), x
|
||||
ADDQ $8, p
|
||||
round0(x)
|
||||
XORQ x, h
|
||||
ROLQ $27, h
|
||||
IMULQ prime1, h
|
||||
ADDQ prime4, h
|
||||
|
||||
wordLoop:
|
||||
// Calculate k1.
|
||||
MOVQ (SI), R8
|
||||
ADDQ $8, SI
|
||||
IMULQ R14, R8
|
||||
ROLQ $31, R8
|
||||
IMULQ R13, R8
|
||||
CMPQ p, end
|
||||
JLE loop8
|
||||
|
||||
XORQ R8, AX
|
||||
ROLQ $27, AX
|
||||
IMULQ R13, AX
|
||||
ADDQ DI, AX
|
||||
try4:
|
||||
ADDQ $4, end
|
||||
CMPQ p, end
|
||||
JG try1
|
||||
|
||||
CMPQ SI, BX
|
||||
JLE wordLoop
|
||||
MOVL (p), x
|
||||
ADDQ $4, p
|
||||
IMULQ prime1, x
|
||||
XORQ x, h
|
||||
|
||||
fourByte:
|
||||
ADDQ $4, BX
|
||||
CMPQ SI, BX
|
||||
JG singles
|
||||
ROLQ $23, h
|
||||
IMULQ prime2, h
|
||||
ADDQ ·primes+16(SB), h
|
||||
|
||||
MOVL (SI), R8
|
||||
ADDQ $4, SI
|
||||
IMULQ R13, R8
|
||||
XORQ R8, AX
|
||||
|
||||
ROLQ $23, AX
|
||||
IMULQ R14, AX
|
||||
ADDQ ·prime3v(SB), AX
|
||||
|
||||
singles:
|
||||
ADDQ $4, BX
|
||||
CMPQ SI, BX
|
||||
try1:
|
||||
ADDQ $4, end
|
||||
CMPQ p, end
|
||||
JGE finalize
|
||||
|
||||
singlesLoop:
|
||||
MOVBQZX (SI), R12
|
||||
ADDQ $1, SI
|
||||
IMULQ ·prime5v(SB), R12
|
||||
XORQ R12, AX
|
||||
loop1:
|
||||
MOVBQZX (p), x
|
||||
ADDQ $1, p
|
||||
IMULQ ·primes+32(SB), x
|
||||
XORQ x, h
|
||||
ROLQ $11, h
|
||||
IMULQ prime1, h
|
||||
|
||||
ROLQ $11, AX
|
||||
IMULQ R13, AX
|
||||
|
||||
CMPQ SI, BX
|
||||
JL singlesLoop
|
||||
CMPQ p, end
|
||||
JL loop1
|
||||
|
||||
finalize:
|
||||
MOVQ AX, R12
|
||||
SHRQ $33, R12
|
||||
XORQ R12, AX
|
||||
IMULQ R14, AX
|
||||
MOVQ AX, R12
|
||||
SHRQ $29, R12
|
||||
XORQ R12, AX
|
||||
IMULQ ·prime3v(SB), AX
|
||||
MOVQ AX, R12
|
||||
SHRQ $32, R12
|
||||
XORQ R12, AX
|
||||
MOVQ h, x
|
||||
SHRQ $33, x
|
||||
XORQ x, h
|
||||
IMULQ prime2, h
|
||||
MOVQ h, x
|
||||
SHRQ $29, x
|
||||
XORQ x, h
|
||||
IMULQ ·primes+16(SB), h
|
||||
MOVQ h, x
|
||||
SHRQ $32, x
|
||||
XORQ x, h
|
||||
|
||||
MOVQ AX, ret+24(FP)
|
||||
MOVQ h, ret+24(FP)
|
||||
RET
|
||||
|
||||
// writeBlocks uses the same registers as above except that it uses AX to store
|
||||
// the d pointer.
|
||||
|
||||
// func writeBlocks(d *Digest, b []byte) int
|
||||
TEXT ·writeBlocks(SB), NOSPLIT, $0-40
|
||||
TEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40
|
||||
// Load fixed primes needed for round.
|
||||
MOVQ ·prime1v(SB), R13
|
||||
MOVQ ·prime2v(SB), R14
|
||||
MOVQ ·primes+0(SB), prime1
|
||||
MOVQ ·primes+8(SB), prime2
|
||||
|
||||
// Load slice.
|
||||
MOVQ b_base+8(FP), SI
|
||||
MOVQ b_len+16(FP), DX
|
||||
LEAQ (SI)(DX*1), BX
|
||||
SUBQ $32, BX
|
||||
MOVQ b_base+8(FP), p
|
||||
MOVQ b_len+16(FP), n
|
||||
LEAQ (p)(n*1), end
|
||||
SUBQ $32, end
|
||||
|
||||
// Load vN from d.
|
||||
MOVQ d+0(FP), AX
|
||||
MOVQ 0(AX), R8 // v1
|
||||
MOVQ 8(AX), R9 // v2
|
||||
MOVQ 16(AX), R10 // v3
|
||||
MOVQ 24(AX), R11 // v4
|
||||
MOVQ s+0(FP), d
|
||||
MOVQ 0(d), v1
|
||||
MOVQ 8(d), v2
|
||||
MOVQ 16(d), v3
|
||||
MOVQ 24(d), v4
|
||||
|
||||
// We don't need to check the loop condition here; this function is
|
||||
// always called with at least one block of data to process.
|
||||
blockLoop:
|
||||
round(R8)
|
||||
round(R9)
|
||||
round(R10)
|
||||
round(R11)
|
||||
|
||||
CMPQ SI, BX
|
||||
JLE blockLoop
|
||||
blockLoop()
|
||||
|
||||
// Copy vN back to d.
|
||||
MOVQ R8, 0(AX)
|
||||
MOVQ R9, 8(AX)
|
||||
MOVQ R10, 16(AX)
|
||||
MOVQ R11, 24(AX)
|
||||
MOVQ v1, 0(d)
|
||||
MOVQ v2, 8(d)
|
||||
MOVQ v3, 16(d)
|
||||
MOVQ v4, 24(d)
|
||||
|
||||
// The number of bytes written is SI minus the old base pointer.
|
||||
SUBQ b_base+8(FP), SI
|
||||
MOVQ SI, ret+32(FP)
|
||||
// The number of bytes written is p minus the old base pointer.
|
||||
SUBQ b_base+8(FP), p
|
||||
MOVQ p, ret+32(FP)
|
||||
|
||||
RET
|
||||
|
|
|
@ -0,0 +1,183 @@
|
|||
//go:build !appengine && gc && !purego
|
||||
// +build !appengine
|
||||
// +build gc
|
||||
// +build !purego
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
// Registers:
|
||||
#define digest R1
|
||||
#define h R2 // return value
|
||||
#define p R3 // input pointer
|
||||
#define n R4 // input length
|
||||
#define nblocks R5 // n / 32
|
||||
#define prime1 R7
|
||||
#define prime2 R8
|
||||
#define prime3 R9
|
||||
#define prime4 R10
|
||||
#define prime5 R11
|
||||
#define v1 R12
|
||||
#define v2 R13
|
||||
#define v3 R14
|
||||
#define v4 R15
|
||||
#define x1 R20
|
||||
#define x2 R21
|
||||
#define x3 R22
|
||||
#define x4 R23
|
||||
|
||||
#define round(acc, x) \
|
||||
MADD prime2, acc, x, acc \
|
||||
ROR $64-31, acc \
|
||||
MUL prime1, acc
|
||||
|
||||
// round0 performs the operation x = round(0, x).
|
||||
#define round0(x) \
|
||||
MUL prime2, x \
|
||||
ROR $64-31, x \
|
||||
MUL prime1, x
|
||||
|
||||
#define mergeRound(acc, x) \
|
||||
round0(x) \
|
||||
EOR x, acc \
|
||||
MADD acc, prime4, prime1, acc
|
||||
|
||||
// blockLoop processes as many 32-byte blocks as possible,
|
||||
// updating v1, v2, v3, and v4. It assumes that n >= 32.
|
||||
#define blockLoop() \
|
||||
LSR $5, n, nblocks \
|
||||
PCALIGN $16 \
|
||||
loop: \
|
||||
LDP.P 16(p), (x1, x2) \
|
||||
LDP.P 16(p), (x3, x4) \
|
||||
round(v1, x1) \
|
||||
round(v2, x2) \
|
||||
round(v3, x3) \
|
||||
round(v4, x4) \
|
||||
SUB $1, nblocks \
|
||||
CBNZ nblocks, loop
|
||||
|
||||
// func Sum64(b []byte) uint64
|
||||
TEXT ·Sum64(SB), NOSPLIT|NOFRAME, $0-32
|
||||
LDP b_base+0(FP), (p, n)
|
||||
|
||||
LDP ·primes+0(SB), (prime1, prime2)
|
||||
LDP ·primes+16(SB), (prime3, prime4)
|
||||
MOVD ·primes+32(SB), prime5
|
||||
|
||||
CMP $32, n
|
||||
CSEL LT, prime5, ZR, h // if n < 32 { h = prime5 } else { h = 0 }
|
||||
BLT afterLoop
|
||||
|
||||
ADD prime1, prime2, v1
|
||||
MOVD prime2, v2
|
||||
MOVD $0, v3
|
||||
NEG prime1, v4
|
||||
|
||||
blockLoop()
|
||||
|
||||
ROR $64-1, v1, x1
|
||||
ROR $64-7, v2, x2
|
||||
ADD x1, x2
|
||||
ROR $64-12, v3, x3
|
||||
ROR $64-18, v4, x4
|
||||
ADD x3, x4
|
||||
ADD x2, x4, h
|
||||
|
||||
mergeRound(h, v1)
|
||||
mergeRound(h, v2)
|
||||
mergeRound(h, v3)
|
||||
mergeRound(h, v4)
|
||||
|
||||
afterLoop:
|
||||
ADD n, h
|
||||
|
||||
TBZ $4, n, try8
|
||||
LDP.P 16(p), (x1, x2)
|
||||
|
||||
round0(x1)
|
||||
|
||||
// NOTE: here and below, sequencing the EOR after the ROR (using a
|
||||
// rotated register) is worth a small but measurable speedup for small
|
||||
// inputs.
|
||||
ROR $64-27, h
|
||||
EOR x1 @> 64-27, h, h
|
||||
MADD h, prime4, prime1, h
|
||||
|
||||
round0(x2)
|
||||
ROR $64-27, h
|
||||
EOR x2 @> 64-27, h, h
|
||||
MADD h, prime4, prime1, h
|
||||
|
||||
try8:
|
||||
TBZ $3, n, try4
|
||||
MOVD.P 8(p), x1
|
||||
|
||||
round0(x1)
|
||||
ROR $64-27, h
|
||||
EOR x1 @> 64-27, h, h
|
||||
MADD h, prime4, prime1, h
|
||||
|
||||
try4:
|
||||
TBZ $2, n, try2
|
||||
MOVWU.P 4(p), x2
|
||||
|
||||
MUL prime1, x2
|
||||
ROR $64-23, h
|
||||
EOR x2 @> 64-23, h, h
|
||||
MADD h, prime3, prime2, h
|
||||
|
||||
try2:
|
||||
TBZ $1, n, try1
|
||||
MOVHU.P 2(p), x3
|
||||
AND $255, x3, x1
|
||||
LSR $8, x3, x2
|
||||
|
||||
MUL prime5, x1
|
||||
ROR $64-11, h
|
||||
EOR x1 @> 64-11, h, h
|
||||
MUL prime1, h
|
||||
|
||||
MUL prime5, x2
|
||||
ROR $64-11, h
|
||||
EOR x2 @> 64-11, h, h
|
||||
MUL prime1, h
|
||||
|
||||
try1:
|
||||
TBZ $0, n, finalize
|
||||
MOVBU (p), x4
|
||||
|
||||
MUL prime5, x4
|
||||
ROR $64-11, h
|
||||
EOR x4 @> 64-11, h, h
|
||||
MUL prime1, h
|
||||
|
||||
finalize:
|
||||
EOR h >> 33, h
|
||||
MUL prime2, h
|
||||
EOR h >> 29, h
|
||||
MUL prime3, h
|
||||
EOR h >> 32, h
|
||||
|
||||
MOVD h, ret+24(FP)
|
||||
RET
|
||||
|
||||
// func writeBlocks(d *Digest, b []byte) int
|
||||
TEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40
|
||||
LDP ·primes+0(SB), (prime1, prime2)
|
||||
|
||||
// Load state. Assume v[1-4] are stored contiguously.
|
||||
MOVD d+0(FP), digest
|
||||
LDP 0(digest), (v1, v2)
|
||||
LDP 16(digest), (v3, v4)
|
||||
|
||||
LDP b_base+8(FP), (p, n)
|
||||
|
||||
blockLoop()
|
||||
|
||||
// Store updated state.
|
||||
STP (v1, v2), 0(digest)
|
||||
STP (v3, v4), 16(digest)
|
||||
|
||||
BIC $31, n
|
||||
MOVD n, ret+32(FP)
|
||||
RET
|
|
@ -1,3 +1,5 @@
|
|||
//go:build (amd64 || arm64) && !appengine && gc && !purego
|
||||
// +build amd64 arm64
|
||||
// +build !appengine
|
||||
// +build gc
|
||||
// +build !purego
|
|
@ -1,4 +1,5 @@
|
|||
// +build !amd64 appengine !gc purego
|
||||
//go:build (!amd64 && !arm64) || appengine || !gc || purego
|
||||
// +build !amd64,!arm64 appengine !gc purego
|
||||
|
||||
package xxhash
|
||||
|
||||
|
@ -14,10 +15,10 @@ func Sum64(b []byte) uint64 {
|
|||
var h uint64
|
||||
|
||||
if n >= 32 {
|
||||
v1 := prime1v + prime2
|
||||
v1 := primes[0] + prime2
|
||||
v2 := prime2
|
||||
v3 := uint64(0)
|
||||
v4 := -prime1v
|
||||
v4 := -primes[0]
|
||||
for len(b) >= 32 {
|
||||
v1 = round(v1, u64(b[0:8:len(b)]))
|
||||
v2 = round(v2, u64(b[8:16:len(b)]))
|
||||
|
@ -36,19 +37,18 @@ func Sum64(b []byte) uint64 {
|
|||
|
||||
h += uint64(n)
|
||||
|
||||
i, end := 0, len(b)
|
||||
for ; i+8 <= end; i += 8 {
|
||||
k1 := round(0, u64(b[i:i+8:len(b)]))
|
||||
for ; len(b) >= 8; b = b[8:] {
|
||||
k1 := round(0, u64(b[:8]))
|
||||
h ^= k1
|
||||
h = rol27(h)*prime1 + prime4
|
||||
}
|
||||
if i+4 <= end {
|
||||
h ^= uint64(u32(b[i:i+4:len(b)])) * prime1
|
||||
if len(b) >= 4 {
|
||||
h ^= uint64(u32(b[:4])) * prime1
|
||||
h = rol23(h)*prime2 + prime3
|
||||
i += 4
|
||||
b = b[4:]
|
||||
}
|
||||
for ; i < end; i++ {
|
||||
h ^= uint64(b[i]) * prime5
|
||||
for ; len(b) > 0; b = b[1:] {
|
||||
h ^= uint64(b[0]) * prime5
|
||||
h = rol11(h) * prime1
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build appengine
|
||||
// +build appengine
|
||||
|
||||
// This file contains the safe implementations of otherwise unsafe-using code.
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build !appengine
|
||||
// +build !appengine
|
||||
|
||||
// This file encapsulates usage of unsafe.
|
||||
|
@ -11,7 +12,7 @@ import (
|
|||
|
||||
// In the future it's possible that compiler optimizations will make these
|
||||
// XxxString functions unnecessary by realizing that calls such as
|
||||
// Sum64([]byte(s)) don't need to copy s. See https://golang.org/issue/2205.
|
||||
// Sum64([]byte(s)) don't need to copy s. See https://go.dev/issue/2205.
|
||||
// If that happens, even if we keep these functions they can be replaced with
|
||||
// the trivial safe code.
|
||||
|
||||
|
|
|
@ -140,12 +140,13 @@ func (c *counter) get() float64 {
|
|||
}
|
||||
|
||||
func (c *counter) Write(out *dto.Metric) error {
|
||||
val := c.get()
|
||||
|
||||
// Read the Exemplar first and the value second. This is to avoid a race condition
|
||||
// where users see an exemplar for a not-yet-existing observation.
|
||||
var exemplar *dto.Exemplar
|
||||
if e := c.exemplar.Load(); e != nil {
|
||||
exemplar = e.(*dto.Exemplar)
|
||||
}
|
||||
val := c.get()
|
||||
|
||||
return populateMetric(CounterValue, val, c.labelPairs, exemplar, out)
|
||||
}
|
||||
|
@ -245,7 +246,8 @@ func (v *CounterVec) GetMetricWith(labels Labels) (Counter, error) {
|
|||
// WithLabelValues works as GetMetricWithLabelValues, but panics where
|
||||
// GetMetricWithLabelValues would have returned an error. Not returning an
|
||||
// error allows shortcuts like
|
||||
// myVec.WithLabelValues("404", "GET").Add(42)
|
||||
//
|
||||
// myVec.WithLabelValues("404", "GET").Add(42)
|
||||
func (v *CounterVec) WithLabelValues(lvs ...string) Counter {
|
||||
c, err := v.GetMetricWithLabelValues(lvs...)
|
||||
if err != nil {
|
||||
|
@ -256,7 +258,8 @@ func (v *CounterVec) WithLabelValues(lvs ...string) Counter {
|
|||
|
||||
// With works as GetMetricWith, but panics where GetMetricWithLabels would have
|
||||
// returned an error. Not returning an error allows shortcuts like
|
||||
// myVec.With(prometheus.Labels{"code": "404", "method": "GET"}).Add(42)
|
||||
//
|
||||
// myVec.With(prometheus.Labels{"code": "404", "method": "GET"}).Add(42)
|
||||
func (v *CounterVec) With(labels Labels) Counter {
|
||||
c, err := v.GetMetricWith(labels)
|
||||
if err != nil {
|
||||
|
|
|
@ -21,55 +21,66 @@
|
|||
// All exported functions and methods are safe to be used concurrently unless
|
||||
// specified otherwise.
|
||||
//
|
||||
// A Basic Example
|
||||
// # A Basic Example
|
||||
//
|
||||
// As a starting point, a very basic usage example:
|
||||
//
|
||||
// package main
|
||||
// package main
|
||||
//
|
||||
// import (
|
||||
// "log"
|
||||
// "net/http"
|
||||
// import (
|
||||
// "log"
|
||||
// "net/http"
|
||||
//
|
||||
// "github.com/prometheus/client_golang/prometheus"
|
||||
// "github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
// )
|
||||
// "github.com/prometheus/client_golang/prometheus"
|
||||
// "github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
// )
|
||||
//
|
||||
// var (
|
||||
// cpuTemp = prometheus.NewGauge(prometheus.GaugeOpts{
|
||||
// Name: "cpu_temperature_celsius",
|
||||
// Help: "Current temperature of the CPU.",
|
||||
// })
|
||||
// hdFailures = prometheus.NewCounterVec(
|
||||
// prometheus.CounterOpts{
|
||||
// Name: "hd_errors_total",
|
||||
// Help: "Number of hard-disk errors.",
|
||||
// },
|
||||
// []string{"device"},
|
||||
// )
|
||||
// )
|
||||
// type metrics struct {
|
||||
// cpuTemp prometheus.Gauge
|
||||
// hdFailures *prometheus.CounterVec
|
||||
// }
|
||||
//
|
||||
// func init() {
|
||||
// // Metrics have to be registered to be exposed:
|
||||
// prometheus.MustRegister(cpuTemp)
|
||||
// prometheus.MustRegister(hdFailures)
|
||||
// }
|
||||
// func NewMetrics(reg prometheus.Registerer) *metrics {
|
||||
// m := &metrics{
|
||||
// cpuTemp: prometheus.NewGauge(prometheus.GaugeOpts{
|
||||
// Name: "cpu_temperature_celsius",
|
||||
// Help: "Current temperature of the CPU.",
|
||||
// }),
|
||||
// hdFailures: prometheus.NewCounterVec(
|
||||
// prometheus.CounterOpts{
|
||||
// Name: "hd_errors_total",
|
||||
// Help: "Number of hard-disk errors.",
|
||||
// },
|
||||
// []string{"device"},
|
||||
// ),
|
||||
// }
|
||||
// reg.MustRegister(m.cpuTemp)
|
||||
// reg.MustRegister(m.hdFailures)
|
||||
// return m
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// cpuTemp.Set(65.3)
|
||||
// hdFailures.With(prometheus.Labels{"device":"/dev/sda"}).Inc()
|
||||
// func main() {
|
||||
// // Create a non-global registry.
|
||||
// reg := prometheus.NewRegistry()
|
||||
//
|
||||
// // The Handler function provides a default handler to expose metrics
|
||||
// // via an HTTP server. "/metrics" is the usual endpoint for that.
|
||||
// http.Handle("/metrics", promhttp.Handler())
|
||||
// log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
// }
|
||||
// // Create new metrics and register them using the custom registry.
|
||||
// m := NewMetrics(reg)
|
||||
// // Set values for the new created metrics.
|
||||
// m.cpuTemp.Set(65.3)
|
||||
// m.hdFailures.With(prometheus.Labels{"device":"/dev/sda"}).Inc()
|
||||
//
|
||||
// // Expose metrics and custom registry via an HTTP server
|
||||
// // using the HandleFor function. "/metrics" is the usual endpoint for that.
|
||||
// http.Handle("/metrics", promhttp.HandlerFor(reg, promhttp.HandlerOpts{Registry: reg}))
|
||||
// log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
// }
|
||||
//
|
||||
// This is a complete program that exports two metrics, a Gauge and a Counter,
|
||||
// the latter with a label attached to turn it into a (one-dimensional) vector.
|
||||
// It register the metrics using a custom registry and exposes them via an HTTP server
|
||||
// on the /metrics endpoint.
|
||||
//
|
||||
// Metrics
|
||||
// # Metrics
|
||||
//
|
||||
// The number of exported identifiers in this package might appear a bit
|
||||
// overwhelming. However, in addition to the basic plumbing shown in the example
|
||||
|
@ -100,7 +111,7 @@
|
|||
// To create instances of Metrics and their vector versions, you need a suitable
|
||||
// …Opts struct, i.e. GaugeOpts, CounterOpts, SummaryOpts, or HistogramOpts.
|
||||
//
|
||||
// Custom Collectors and constant Metrics
|
||||
// # Custom Collectors and constant Metrics
|
||||
//
|
||||
// While you could create your own implementations of Metric, most likely you
|
||||
// will only ever implement the Collector interface on your own. At a first
|
||||
|
@ -141,7 +152,7 @@
|
|||
// a metric, GaugeFunc, CounterFunc, or UntypedFunc might be interesting
|
||||
// shortcuts.
|
||||
//
|
||||
// Advanced Uses of the Registry
|
||||
// # Advanced Uses of the Registry
|
||||
//
|
||||
// While MustRegister is the by far most common way of registering a Collector,
|
||||
// sometimes you might want to handle the errors the registration might cause.
|
||||
|
@ -176,23 +187,23 @@
|
|||
// NewProcessCollector). With a custom registry, you are in control and decide
|
||||
// yourself about the Collectors to register.
|
||||
//
|
||||
// HTTP Exposition
|
||||
// # HTTP Exposition
|
||||
//
|
||||
// The Registry implements the Gatherer interface. The caller of the Gather
|
||||
// method can then expose the gathered metrics in some way. Usually, the metrics
|
||||
// are served via HTTP on the /metrics endpoint. That's happening in the example
|
||||
// above. The tools to expose metrics via HTTP are in the promhttp sub-package.
|
||||
//
|
||||
// Pushing to the Pushgateway
|
||||
// # Pushing to the Pushgateway
|
||||
//
|
||||
// Function for pushing to the Pushgateway can be found in the push sub-package.
|
||||
//
|
||||
// Graphite Bridge
|
||||
// # Graphite Bridge
|
||||
//
|
||||
// Functions and examples to push metrics from a Gatherer to Graphite can be
|
||||
// found in the graphite sub-package.
|
||||
//
|
||||
// Other Means of Exposition
|
||||
// # Other Means of Exposition
|
||||
//
|
||||
// More ways of exposing metrics can easily be added by following the approaches
|
||||
// of the existing implementations.
|
||||
|
|
|
@ -210,7 +210,8 @@ func (v *GaugeVec) GetMetricWith(labels Labels) (Gauge, error) {
|
|||
// WithLabelValues works as GetMetricWithLabelValues, but panics where
|
||||
// GetMetricWithLabelValues would have returned an error. Not returning an
|
||||
// error allows shortcuts like
|
||||
// myVec.WithLabelValues("404", "GET").Add(42)
|
||||
//
|
||||
// myVec.WithLabelValues("404", "GET").Add(42)
|
||||
func (v *GaugeVec) WithLabelValues(lvs ...string) Gauge {
|
||||
g, err := v.GetMetricWithLabelValues(lvs...)
|
||||
if err != nil {
|
||||
|
@ -221,7 +222,8 @@ func (v *GaugeVec) WithLabelValues(lvs ...string) Gauge {
|
|||
|
||||
// With works as GetMetricWith, but panics where GetMetricWithLabels would have
|
||||
// returned an error. Not returning an error allows shortcuts like
|
||||
// myVec.With(prometheus.Labels{"code": "404", "method": "GET"}).Add(42)
|
||||
//
|
||||
// myVec.With(prometheus.Labels{"code": "404", "method": "GET"}).Add(42)
|
||||
func (v *GaugeVec) With(labels Labels) Gauge {
|
||||
g, err := v.GetMetricWith(labels)
|
||||
if err != nil {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
60
vendor/github.com/prometheus/client_golang/prometheus/internal/almost_equal.go
generated
vendored
Normal file
60
vendor/github.com/prometheus/client_golang/prometheus/internal/almost_equal.go
generated
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
// Copyright (c) 2015 Björn Rabenstein
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// The code in this package is copy/paste to avoid a dependency. Hence this file
|
||||
// carries the copyright of the original repo.
|
||||
// https://github.com/beorn7/floats
|
||||
package internal
|
||||
|
||||
import (
|
||||
"math"
|
||||
)
|
||||
|
||||
// minNormalFloat64 is the smallest positive normal value of type float64.
|
||||
var minNormalFloat64 = math.Float64frombits(0x0010000000000000)
|
||||
|
||||
// AlmostEqualFloat64 returns true if a and b are equal within a relative error
|
||||
// of epsilon. See http://floating-point-gui.de/errors/comparison/ for the
|
||||
// details of the applied method.
|
||||
func AlmostEqualFloat64(a, b, epsilon float64) bool {
|
||||
if a == b {
|
||||
return true
|
||||
}
|
||||
absA := math.Abs(a)
|
||||
absB := math.Abs(b)
|
||||
diff := math.Abs(a - b)
|
||||
if a == 0 || b == 0 || absA+absB < minNormalFloat64 {
|
||||
return diff < epsilon*minNormalFloat64
|
||||
}
|
||||
return diff/math.Min(absA+absB, math.MaxFloat64) < epsilon
|
||||
}
|
||||
|
||||
// AlmostEqualFloat64s is the slice form of AlmostEqualFloat64.
|
||||
func AlmostEqualFloat64s(a, b []float64, epsilon float64) bool {
|
||||
if len(a) != len(b) {
|
||||
return false
|
||||
}
|
||||
for i := range a {
|
||||
if !AlmostEqualFloat64(a[i], b[i], epsilon) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
|
@ -201,12 +201,15 @@ func (m *SequenceMatcher) isBJunk(s string) bool {
|
|||
// If IsJunk is not defined:
|
||||
//
|
||||
// Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where
|
||||
// alo <= i <= i+k <= ahi
|
||||
// blo <= j <= j+k <= bhi
|
||||
//
|
||||
// alo <= i <= i+k <= ahi
|
||||
// blo <= j <= j+k <= bhi
|
||||
//
|
||||
// and for all (i',j',k') meeting those conditions,
|
||||
// k >= k'
|
||||
// i <= i'
|
||||
// and if i == i', j <= j'
|
||||
//
|
||||
// k >= k'
|
||||
// i <= i'
|
||||
// and if i == i', j <= j'
|
||||
//
|
||||
// In other words, of all maximal matching blocks, return one that
|
||||
// starts earliest in a, and of all those maximal matching blocks that
|
||||
|
|
|
@ -25,7 +25,8 @@ import (
|
|||
// Labels represents a collection of label name -> value mappings. This type is
|
||||
// commonly used with the With(Labels) and GetMetricWith(Labels) methods of
|
||||
// metric vector Collectors, e.g.:
|
||||
// myVec.With(Labels{"code": "404", "method": "GET"}).Add(42)
|
||||
//
|
||||
// myVec.With(Labels{"code": "404", "method": "GET"}).Add(42)
|
||||
//
|
||||
// The other use-case is the specification of constant label pairs in Opts or to
|
||||
// create a Desc.
|
||||
|
|
|
@ -187,7 +187,7 @@ func (m *withExemplarsMetric) Write(pb *dto.Metric) error {
|
|||
} else {
|
||||
// The +Inf bucket should be explicitly added if there is an exemplar for it, similar to non-const histogram logic in https://github.com/prometheus/client_golang/blob/main/prometheus/histogram.go#L357-L365.
|
||||
b := &dto.Bucket{
|
||||
CumulativeCount: proto.Uint64(pb.Histogram.Bucket[len(pb.Histogram.GetBucket())-1].GetCumulativeCount()),
|
||||
CumulativeCount: proto.Uint64(pb.Histogram.GetSampleCount()),
|
||||
UpperBound: proto.Float64(math.Inf(1)),
|
||||
Exemplar: e,
|
||||
}
|
||||
|
|
|
@ -14,114 +14,114 @@
|
|||
// Package promauto provides alternative constructors for the fundamental
|
||||
// Prometheus metric types and their …Vec and …Func variants. The difference to
|
||||
// their counterparts in the prometheus package is that the promauto
|
||||
// constructors return Collectors that are already registered with a
|
||||
// registry. There are two sets of constructors. The constructors in the first
|
||||
// set are top-level functions, while the constructors in the other set are
|
||||
// methods of the Factory type. The top-level function return Collectors
|
||||
// registered with the global registry (prometheus.DefaultRegisterer), while the
|
||||
// methods return Collectors registered with the registry the Factory was
|
||||
// constructed with. All constructors panic if the registration fails.
|
||||
// constructors register the Collectors with a registry before returning them.
|
||||
// There are two sets of constructors. The constructors in the first set are
|
||||
// top-level functions, while the constructors in the other set are methods of
|
||||
// the Factory type. The top-level function return Collectors registered with
|
||||
// the global registry (prometheus.DefaultRegisterer), while the methods return
|
||||
// Collectors registered with the registry the Factory was constructed with. All
|
||||
// constructors panic if the registration fails.
|
||||
//
|
||||
// The following example is a complete program to create a histogram of normally
|
||||
// distributed random numbers from the math/rand package:
|
||||
//
|
||||
// package main
|
||||
// package main
|
||||
//
|
||||
// import (
|
||||
// "math/rand"
|
||||
// "net/http"
|
||||
// import (
|
||||
// "math/rand"
|
||||
// "net/http"
|
||||
//
|
||||
// "github.com/prometheus/client_golang/prometheus"
|
||||
// "github.com/prometheus/client_golang/prometheus/promauto"
|
||||
// "github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
// )
|
||||
// "github.com/prometheus/client_golang/prometheus"
|
||||
// "github.com/prometheus/client_golang/prometheus/promauto"
|
||||
// "github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
// )
|
||||
//
|
||||
// var histogram = promauto.NewHistogram(prometheus.HistogramOpts{
|
||||
// Name: "random_numbers",
|
||||
// Help: "A histogram of normally distributed random numbers.",
|
||||
// Buckets: prometheus.LinearBuckets(-3, .1, 61),
|
||||
// })
|
||||
// var histogram = promauto.NewHistogram(prometheus.HistogramOpts{
|
||||
// Name: "random_numbers",
|
||||
// Help: "A histogram of normally distributed random numbers.",
|
||||
// Buckets: prometheus.LinearBuckets(-3, .1, 61),
|
||||
// })
|
||||
//
|
||||
// func Random() {
|
||||
// for {
|
||||
// histogram.Observe(rand.NormFloat64())
|
||||
// }
|
||||
// }
|
||||
// func Random() {
|
||||
// for {
|
||||
// histogram.Observe(rand.NormFloat64())
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// go Random()
|
||||
// http.Handle("/metrics", promhttp.Handler())
|
||||
// http.ListenAndServe(":1971", nil)
|
||||
// }
|
||||
// func main() {
|
||||
// go Random()
|
||||
// http.Handle("/metrics", promhttp.Handler())
|
||||
// http.ListenAndServe(":1971", nil)
|
||||
// }
|
||||
//
|
||||
// Prometheus's version of a minimal hello-world program:
|
||||
//
|
||||
// package main
|
||||
// package main
|
||||
//
|
||||
// import (
|
||||
// "fmt"
|
||||
// "net/http"
|
||||
// import (
|
||||
// "fmt"
|
||||
// "net/http"
|
||||
//
|
||||
// "github.com/prometheus/client_golang/prometheus"
|
||||
// "github.com/prometheus/client_golang/prometheus/promauto"
|
||||
// "github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
// )
|
||||
// "github.com/prometheus/client_golang/prometheus"
|
||||
// "github.com/prometheus/client_golang/prometheus/promauto"
|
||||
// "github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// http.Handle("/", promhttp.InstrumentHandlerCounter(
|
||||
// promauto.NewCounterVec(
|
||||
// prometheus.CounterOpts{
|
||||
// Name: "hello_requests_total",
|
||||
// Help: "Total number of hello-world requests by HTTP code.",
|
||||
// },
|
||||
// []string{"code"},
|
||||
// ),
|
||||
// http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// fmt.Fprint(w, "Hello, world!")
|
||||
// }),
|
||||
// ))
|
||||
// http.Handle("/metrics", promhttp.Handler())
|
||||
// http.ListenAndServe(":1971", nil)
|
||||
// }
|
||||
// func main() {
|
||||
// http.Handle("/", promhttp.InstrumentHandlerCounter(
|
||||
// promauto.NewCounterVec(
|
||||
// prometheus.CounterOpts{
|
||||
// Name: "hello_requests_total",
|
||||
// Help: "Total number of hello-world requests by HTTP code.",
|
||||
// },
|
||||
// []string{"code"},
|
||||
// ),
|
||||
// http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// fmt.Fprint(w, "Hello, world!")
|
||||
// }),
|
||||
// ))
|
||||
// http.Handle("/metrics", promhttp.Handler())
|
||||
// http.ListenAndServe(":1971", nil)
|
||||
// }
|
||||
//
|
||||
// A Factory is created with the With(prometheus.Registerer) function, which
|
||||
// enables two usage pattern. With(prometheus.Registerer) can be called once per
|
||||
// line:
|
||||
//
|
||||
// var (
|
||||
// reg = prometheus.NewRegistry()
|
||||
// randomNumbers = promauto.With(reg).NewHistogram(prometheus.HistogramOpts{
|
||||
// Name: "random_numbers",
|
||||
// Help: "A histogram of normally distributed random numbers.",
|
||||
// Buckets: prometheus.LinearBuckets(-3, .1, 61),
|
||||
// })
|
||||
// requestCount = promauto.With(reg).NewCounterVec(
|
||||
// prometheus.CounterOpts{
|
||||
// Name: "http_requests_total",
|
||||
// Help: "Total number of HTTP requests by status code and method.",
|
||||
// },
|
||||
// []string{"code", "method"},
|
||||
// )
|
||||
// )
|
||||
// var (
|
||||
// reg = prometheus.NewRegistry()
|
||||
// randomNumbers = promauto.With(reg).NewHistogram(prometheus.HistogramOpts{
|
||||
// Name: "random_numbers",
|
||||
// Help: "A histogram of normally distributed random numbers.",
|
||||
// Buckets: prometheus.LinearBuckets(-3, .1, 61),
|
||||
// })
|
||||
// requestCount = promauto.With(reg).NewCounterVec(
|
||||
// prometheus.CounterOpts{
|
||||
// Name: "http_requests_total",
|
||||
// Help: "Total number of HTTP requests by status code and method.",
|
||||
// },
|
||||
// []string{"code", "method"},
|
||||
// )
|
||||
// )
|
||||
//
|
||||
// Or it can be used to create a Factory once to be used multiple times:
|
||||
//
|
||||
// var (
|
||||
// reg = prometheus.NewRegistry()
|
||||
// factory = promauto.With(reg)
|
||||
// randomNumbers = factory.NewHistogram(prometheus.HistogramOpts{
|
||||
// Name: "random_numbers",
|
||||
// Help: "A histogram of normally distributed random numbers.",
|
||||
// Buckets: prometheus.LinearBuckets(-3, .1, 61),
|
||||
// })
|
||||
// requestCount = factory.NewCounterVec(
|
||||
// prometheus.CounterOpts{
|
||||
// Name: "http_requests_total",
|
||||
// Help: "Total number of HTTP requests by status code and method.",
|
||||
// },
|
||||
// []string{"code", "method"},
|
||||
// )
|
||||
// )
|
||||
// var (
|
||||
// reg = prometheus.NewRegistry()
|
||||
// factory = promauto.With(reg)
|
||||
// randomNumbers = factory.NewHistogram(prometheus.HistogramOpts{
|
||||
// Name: "random_numbers",
|
||||
// Help: "A histogram of normally distributed random numbers.",
|
||||
// Buckets: prometheus.LinearBuckets(-3, .1, 61),
|
||||
// })
|
||||
// requestCount = factory.NewCounterVec(
|
||||
// prometheus.CounterOpts{
|
||||
// Name: "http_requests_total",
|
||||
// Help: "Total number of HTTP requests by status code and method.",
|
||||
// },
|
||||
// []string{"code", "method"},
|
||||
// )
|
||||
// )
|
||||
//
|
||||
// This appears very handy. So why are these constructors locked away in a
|
||||
// separate package?
|
||||
|
|
5
vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go
generated
vendored
5
vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go
generated
vendored
|
@ -73,12 +73,11 @@ func InstrumentRoundTripperCounter(counter *prometheus.CounterVec, next http.Rou
|
|||
return func(r *http.Request) (*http.Response, error) {
|
||||
resp, err := next.RoundTrip(r)
|
||||
if err == nil {
|
||||
exemplarAdd(
|
||||
addWithExemplar(
|
||||
counter.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)),
|
||||
1,
|
||||
rtOpts.getExemplarFn(r.Context()),
|
||||
)
|
||||
counter.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)).Inc()
|
||||
}
|
||||
return resp, err
|
||||
}
|
||||
|
@ -117,7 +116,7 @@ func InstrumentRoundTripperDuration(obs prometheus.ObserverVec, next http.RoundT
|
|||
start := time.Now()
|
||||
resp, err := next.RoundTrip(r)
|
||||
if err == nil {
|
||||
exemplarObserve(
|
||||
observeWithExemplar(
|
||||
obs.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)),
|
||||
time.Since(start).Seconds(),
|
||||
rtOpts.getExemplarFn(r.Context()),
|
||||
|
|
24
vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go
generated
vendored
24
vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go
generated
vendored
|
@ -28,7 +28,9 @@ import (
|
|||
// magicString is used for the hacky label test in checkLabels. Remove once fixed.
|
||||
const magicString = "zZgWfBxLqvG8kc8IMv3POi2Bb0tZI3vAnBx+gBaFi9FyPzB/CzKUer1yufDa"
|
||||
|
||||
func exemplarObserve(obs prometheus.Observer, val float64, labels map[string]string) {
|
||||
// observeWithExemplar is a wrapper for [prometheus.ExemplarAdder.ExemplarObserver],
|
||||
// which falls back to [prometheus.Observer.Observe] if no labels are provided.
|
||||
func observeWithExemplar(obs prometheus.Observer, val float64, labels map[string]string) {
|
||||
if labels == nil {
|
||||
obs.Observe(val)
|
||||
return
|
||||
|
@ -36,7 +38,9 @@ func exemplarObserve(obs prometheus.Observer, val float64, labels map[string]str
|
|||
obs.(prometheus.ExemplarObserver).ObserveWithExemplar(val, labels)
|
||||
}
|
||||
|
||||
func exemplarAdd(obs prometheus.Counter, val float64, labels map[string]string) {
|
||||
// addWithExemplar is a wrapper for [prometheus.ExemplarAdder.AddWithExemplar],
|
||||
// which falls back to [prometheus.Counter.Add] if no labels are provided.
|
||||
func addWithExemplar(obs prometheus.Counter, val float64, labels map[string]string) {
|
||||
if labels == nil {
|
||||
obs.Add(val)
|
||||
return
|
||||
|
@ -91,7 +95,7 @@ func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler, op
|
|||
d := newDelegator(w, nil)
|
||||
next.ServeHTTP(d, r)
|
||||
|
||||
exemplarObserve(
|
||||
observeWithExemplar(
|
||||
obs.With(labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)),
|
||||
time.Since(now).Seconds(),
|
||||
hOpts.getExemplarFn(r.Context()),
|
||||
|
@ -103,7 +107,7 @@ func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler, op
|
|||
now := time.Now()
|
||||
next.ServeHTTP(w, r)
|
||||
|
||||
exemplarObserve(
|
||||
observeWithExemplar(
|
||||
obs.With(labels(code, method, r.Method, 0, hOpts.extraMethods...)),
|
||||
time.Since(now).Seconds(),
|
||||
hOpts.getExemplarFn(r.Context()),
|
||||
|
@ -141,7 +145,7 @@ func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler,
|
|||
d := newDelegator(w, nil)
|
||||
next.ServeHTTP(d, r)
|
||||
|
||||
exemplarAdd(
|
||||
addWithExemplar(
|
||||
counter.With(labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)),
|
||||
1,
|
||||
hOpts.getExemplarFn(r.Context()),
|
||||
|
@ -151,7 +155,7 @@ func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler,
|
|||
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
next.ServeHTTP(w, r)
|
||||
exemplarAdd(
|
||||
addWithExemplar(
|
||||
counter.With(labels(code, method, r.Method, 0, hOpts.extraMethods...)),
|
||||
1,
|
||||
hOpts.getExemplarFn(r.Context()),
|
||||
|
@ -192,7 +196,7 @@ func InstrumentHandlerTimeToWriteHeader(obs prometheus.ObserverVec, next http.Ha
|
|||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
now := time.Now()
|
||||
d := newDelegator(w, func(status int) {
|
||||
exemplarObserve(
|
||||
observeWithExemplar(
|
||||
obs.With(labels(code, method, r.Method, status, hOpts.extraMethods...)),
|
||||
time.Since(now).Seconds(),
|
||||
hOpts.getExemplarFn(r.Context()),
|
||||
|
@ -233,7 +237,7 @@ func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler,
|
|||
d := newDelegator(w, nil)
|
||||
next.ServeHTTP(d, r)
|
||||
size := computeApproximateRequestSize(r)
|
||||
exemplarObserve(
|
||||
observeWithExemplar(
|
||||
obs.With(labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)),
|
||||
float64(size),
|
||||
hOpts.getExemplarFn(r.Context()),
|
||||
|
@ -244,7 +248,7 @@ func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler,
|
|||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
next.ServeHTTP(w, r)
|
||||
size := computeApproximateRequestSize(r)
|
||||
exemplarObserve(
|
||||
observeWithExemplar(
|
||||
obs.With(labels(code, method, r.Method, 0, hOpts.extraMethods...)),
|
||||
float64(size),
|
||||
hOpts.getExemplarFn(r.Context()),
|
||||
|
@ -282,7 +286,7 @@ func InstrumentHandlerResponseSize(obs prometheus.ObserverVec, next http.Handler
|
|||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
d := newDelegator(w, nil)
|
||||
next.ServeHTTP(d, r)
|
||||
exemplarObserve(
|
||||
observeWithExemplar(
|
||||
obs.With(labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)),
|
||||
float64(d.Written()),
|
||||
hOpts.getExemplarFn(r.Context()),
|
||||
|
|
|
@ -252,9 +252,12 @@ func (errs MultiError) MaybeUnwrap() error {
|
|||
}
|
||||
|
||||
// Registry registers Prometheus collectors, collects their metrics, and gathers
|
||||
// them into MetricFamilies for exposition. It implements both Registerer and
|
||||
// Gatherer. The zero value is not usable. Create instances with NewRegistry or
|
||||
// NewPedanticRegistry.
|
||||
// them into MetricFamilies for exposition. It implements Registerer, Gatherer,
|
||||
// and Collector. The zero value is not usable. Create instances with
|
||||
// NewRegistry or NewPedanticRegistry.
|
||||
//
|
||||
// Registry implements Collector to allow it to be used for creating groups of
|
||||
// metrics. See the Grouping example for how this can be done.
|
||||
type Registry struct {
|
||||
mtx sync.RWMutex
|
||||
collectorsByID map[uint64]Collector // ID is a hash of the descIDs.
|
||||
|
@ -556,6 +559,31 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) {
|
|||
return internal.NormalizeMetricFamilies(metricFamiliesByName), errs.MaybeUnwrap()
|
||||
}
|
||||
|
||||
// Describe implements Collector.
|
||||
func (r *Registry) Describe(ch chan<- *Desc) {
|
||||
r.mtx.RLock()
|
||||
defer r.mtx.RUnlock()
|
||||
|
||||
// Only report the checked Collectors; unchecked collectors don't report any
|
||||
// Desc.
|
||||
for _, c := range r.collectorsByID {
|
||||
c.Describe(ch)
|
||||
}
|
||||
}
|
||||
|
||||
// Collect implements Collector.
|
||||
func (r *Registry) Collect(ch chan<- Metric) {
|
||||
r.mtx.RLock()
|
||||
defer r.mtx.RUnlock()
|
||||
|
||||
for _, c := range r.collectorsByID {
|
||||
c.Collect(ch)
|
||||
}
|
||||
for _, c := range r.uncheckedCollectors {
|
||||
c.Collect(ch)
|
||||
}
|
||||
}
|
||||
|
||||
// WriteToTextfile calls Gather on the provided Gatherer, encodes the result in the
|
||||
// Prometheus text format, and writes it to a temporary file. Upon success, the
|
||||
// temporary file is renamed to the provided filename.
|
||||
|
|
|
@ -603,7 +603,8 @@ func (v *SummaryVec) GetMetricWith(labels Labels) (Observer, error) {
|
|||
// WithLabelValues works as GetMetricWithLabelValues, but panics where
|
||||
// GetMetricWithLabelValues would have returned an error. Not returning an
|
||||
// error allows shortcuts like
|
||||
// myVec.WithLabelValues("404", "GET").Observe(42.21)
|
||||
//
|
||||
// myVec.WithLabelValues("404", "GET").Observe(42.21)
|
||||
func (v *SummaryVec) WithLabelValues(lvs ...string) Observer {
|
||||
s, err := v.GetMetricWithLabelValues(lvs...)
|
||||
if err != nil {
|
||||
|
@ -614,7 +615,8 @@ func (v *SummaryVec) WithLabelValues(lvs ...string) Observer {
|
|||
|
||||
// With works as GetMetricWith, but panics where GetMetricWithLabels would have
|
||||
// returned an error. Not returning an error allows shortcuts like
|
||||
// myVec.With(prometheus.Labels{"code": "404", "method": "GET"}).Observe(42.21)
|
||||
//
|
||||
// myVec.With(prometheus.Labels{"code": "404", "method": "GET"}).Observe(42.21)
|
||||
func (v *SummaryVec) With(labels Labels) Observer {
|
||||
s, err := v.GetMetricWith(labels)
|
||||
if err != nil {
|
||||
|
@ -701,7 +703,8 @@ func (s *constSummary) Write(out *dto.Metric) error {
|
|||
//
|
||||
// quantiles maps ranks to quantile values. For example, a median latency of
|
||||
// 0.23s and a 99th percentile latency of 0.56s would be expressed as:
|
||||
// map[float64]float64{0.5: 0.23, 0.99: 0.56}
|
||||
//
|
||||
// map[float64]float64{0.5: 0.23, 0.99: 0.56}
|
||||
//
|
||||
// NewConstSummary returns an error if the length of labelValues is not
|
||||
// consistent with the variable labels in Desc or if Desc is invalid.
|
||||
|
|
|
@ -25,11 +25,12 @@ type Timer struct {
|
|||
// NewTimer creates a new Timer. The provided Observer is used to observe a
|
||||
// duration in seconds. Timer is usually used to time a function call in the
|
||||
// following way:
|
||||
// func TimeMe() {
|
||||
// timer := NewTimer(myHistogram)
|
||||
// defer timer.ObserveDuration()
|
||||
// // Do actual work.
|
||||
// }
|
||||
//
|
||||
// func TimeMe() {
|
||||
// timer := NewTimer(myHistogram)
|
||||
// defer timer.ObserveDuration()
|
||||
// // Do actual work.
|
||||
// }
|
||||
func NewTimer(o Observer) *Timer {
|
||||
return &Timer{
|
||||
begin: time.Now(),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: metrics.proto
|
||||
// source: io/prometheus/client/metrics.proto
|
||||
|
||||
package io_prometheus_client
|
||||
|
||||
|
@ -24,11 +24,18 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|||
type MetricType int32
|
||||
|
||||
const (
|
||||
MetricType_COUNTER MetricType = 0
|
||||
MetricType_GAUGE MetricType = 1
|
||||
MetricType_SUMMARY MetricType = 2
|
||||
MetricType_UNTYPED MetricType = 3
|
||||
// COUNTER must use the Metric field "counter".
|
||||
MetricType_COUNTER MetricType = 0
|
||||
// GAUGE must use the Metric field "gauge".
|
||||
MetricType_GAUGE MetricType = 1
|
||||
// SUMMARY must use the Metric field "summary".
|
||||
MetricType_SUMMARY MetricType = 2
|
||||
// UNTYPED must use the Metric field "untyped".
|
||||
MetricType_UNTYPED MetricType = 3
|
||||
// HISTOGRAM must use the Metric field "histogram".
|
||||
MetricType_HISTOGRAM MetricType = 4
|
||||
// GAUGE_HISTOGRAM must use the Metric field "histogram".
|
||||
MetricType_GAUGE_HISTOGRAM MetricType = 5
|
||||
)
|
||||
|
||||
var MetricType_name = map[int32]string{
|
||||
|
@ -37,14 +44,16 @@ var MetricType_name = map[int32]string{
|
|||
2: "SUMMARY",
|
||||
3: "UNTYPED",
|
||||
4: "HISTOGRAM",
|
||||
5: "GAUGE_HISTOGRAM",
|
||||
}
|
||||
|
||||
var MetricType_value = map[string]int32{
|
||||
"COUNTER": 0,
|
||||
"GAUGE": 1,
|
||||
"SUMMARY": 2,
|
||||
"UNTYPED": 3,
|
||||
"HISTOGRAM": 4,
|
||||
"COUNTER": 0,
|
||||
"GAUGE": 1,
|
||||
"SUMMARY": 2,
|
||||
"UNTYPED": 3,
|
||||
"HISTOGRAM": 4,
|
||||
"GAUGE_HISTOGRAM": 5,
|
||||
}
|
||||
|
||||
func (x MetricType) Enum() *MetricType {
|
||||
|
@ -67,7 +76,7 @@ func (x *MetricType) UnmarshalJSON(data []byte) error {
|
|||
}
|
||||
|
||||
func (MetricType) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6039342a2ba47b72, []int{0}
|
||||
return fileDescriptor_d1e5ddb18987a258, []int{0}
|
||||
}
|
||||
|
||||
type LabelPair struct {
|
||||
|
@ -82,7 +91,7 @@ func (m *LabelPair) Reset() { *m = LabelPair{} }
|
|||
func (m *LabelPair) String() string { return proto.CompactTextString(m) }
|
||||
func (*LabelPair) ProtoMessage() {}
|
||||
func (*LabelPair) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6039342a2ba47b72, []int{0}
|
||||
return fileDescriptor_d1e5ddb18987a258, []int{0}
|
||||
}
|
||||
|
||||
func (m *LabelPair) XXX_Unmarshal(b []byte) error {
|
||||
|
@ -128,7 +137,7 @@ func (m *Gauge) Reset() { *m = Gauge{} }
|
|||
func (m *Gauge) String() string { return proto.CompactTextString(m) }
|
||||
func (*Gauge) ProtoMessage() {}
|
||||
func (*Gauge) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6039342a2ba47b72, []int{1}
|
||||
return fileDescriptor_d1e5ddb18987a258, []int{1}
|
||||
}
|
||||
|
||||
func (m *Gauge) XXX_Unmarshal(b []byte) error {
|
||||
|
@ -168,7 +177,7 @@ func (m *Counter) Reset() { *m = Counter{} }
|
|||
func (m *Counter) String() string { return proto.CompactTextString(m) }
|
||||
func (*Counter) ProtoMessage() {}
|
||||
func (*Counter) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6039342a2ba47b72, []int{2}
|
||||
return fileDescriptor_d1e5ddb18987a258, []int{2}
|
||||
}
|
||||
|
||||
func (m *Counter) XXX_Unmarshal(b []byte) error {
|
||||
|
@ -215,7 +224,7 @@ func (m *Quantile) Reset() { *m = Quantile{} }
|
|||
func (m *Quantile) String() string { return proto.CompactTextString(m) }
|
||||
func (*Quantile) ProtoMessage() {}
|
||||
func (*Quantile) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6039342a2ba47b72, []int{3}
|
||||
return fileDescriptor_d1e5ddb18987a258, []int{3}
|
||||
}
|
||||
|
||||
func (m *Quantile) XXX_Unmarshal(b []byte) error {
|
||||
|
@ -263,7 +272,7 @@ func (m *Summary) Reset() { *m = Summary{} }
|
|||
func (m *Summary) String() string { return proto.CompactTextString(m) }
|
||||
func (*Summary) ProtoMessage() {}
|
||||
func (*Summary) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6039342a2ba47b72, []int{4}
|
||||
return fileDescriptor_d1e5ddb18987a258, []int{4}
|
||||
}
|
||||
|
||||
func (m *Summary) XXX_Unmarshal(b []byte) error {
|
||||
|
@ -316,7 +325,7 @@ func (m *Untyped) Reset() { *m = Untyped{} }
|
|||
func (m *Untyped) String() string { return proto.CompactTextString(m) }
|
||||
func (*Untyped) ProtoMessage() {}
|
||||
func (*Untyped) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6039342a2ba47b72, []int{5}
|
||||
return fileDescriptor_d1e5ddb18987a258, []int{5}
|
||||
}
|
||||
|
||||
func (m *Untyped) XXX_Unmarshal(b []byte) error {
|
||||
|
@ -345,9 +354,34 @@ func (m *Untyped) GetValue() float64 {
|
|||
}
|
||||
|
||||
type Histogram struct {
|
||||
SampleCount *uint64 `protobuf:"varint,1,opt,name=sample_count,json=sampleCount" json:"sample_count,omitempty"`
|
||||
SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"`
|
||||
Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket" json:"bucket,omitempty"`
|
||||
SampleCount *uint64 `protobuf:"varint,1,opt,name=sample_count,json=sampleCount" json:"sample_count,omitempty"`
|
||||
SampleCountFloat *float64 `protobuf:"fixed64,4,opt,name=sample_count_float,json=sampleCountFloat" json:"sample_count_float,omitempty"`
|
||||
SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"`
|
||||
// Buckets for the conventional histogram.
|
||||
Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket" json:"bucket,omitempty"`
|
||||
// schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8.
|
||||
// They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and
|
||||
// then each power of two is divided into 2^n logarithmic buckets.
|
||||
// Or in other words, each bucket boundary is the previous boundary times 2^(2^-n).
|
||||
// In the future, more bucket schemas may be added using numbers < -4 or > 8.
|
||||
Schema *int32 `protobuf:"zigzag32,5,opt,name=schema" json:"schema,omitempty"`
|
||||
ZeroThreshold *float64 `protobuf:"fixed64,6,opt,name=zero_threshold,json=zeroThreshold" json:"zero_threshold,omitempty"`
|
||||
ZeroCount *uint64 `protobuf:"varint,7,opt,name=zero_count,json=zeroCount" json:"zero_count,omitempty"`
|
||||
ZeroCountFloat *float64 `protobuf:"fixed64,8,opt,name=zero_count_float,json=zeroCountFloat" json:"zero_count_float,omitempty"`
|
||||
// Negative buckets for the native histogram.
|
||||
NegativeSpan []*BucketSpan `protobuf:"bytes,9,rep,name=negative_span,json=negativeSpan" json:"negative_span,omitempty"`
|
||||
// Use either "negative_delta" or "negative_count", the former for
|
||||
// regular histograms with integer counts, the latter for float
|
||||
// histograms.
|
||||
NegativeDelta []int64 `protobuf:"zigzag64,10,rep,name=negative_delta,json=negativeDelta" json:"negative_delta,omitempty"`
|
||||
NegativeCount []float64 `protobuf:"fixed64,11,rep,name=negative_count,json=negativeCount" json:"negative_count,omitempty"`
|
||||
// Positive buckets for the native histogram.
|
||||
PositiveSpan []*BucketSpan `protobuf:"bytes,12,rep,name=positive_span,json=positiveSpan" json:"positive_span,omitempty"`
|
||||
// Use either "positive_delta" or "positive_count", the former for
|
||||
// regular histograms with integer counts, the latter for float
|
||||
// histograms.
|
||||
PositiveDelta []int64 `protobuf:"zigzag64,13,rep,name=positive_delta,json=positiveDelta" json:"positive_delta,omitempty"`
|
||||
PositiveCount []float64 `protobuf:"fixed64,14,rep,name=positive_count,json=positiveCount" json:"positive_count,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
|
@ -357,7 +391,7 @@ func (m *Histogram) Reset() { *m = Histogram{} }
|
|||
func (m *Histogram) String() string { return proto.CompactTextString(m) }
|
||||
func (*Histogram) ProtoMessage() {}
|
||||
func (*Histogram) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6039342a2ba47b72, []int{6}
|
||||
return fileDescriptor_d1e5ddb18987a258, []int{6}
|
||||
}
|
||||
|
||||
func (m *Histogram) XXX_Unmarshal(b []byte) error {
|
||||
|
@ -385,6 +419,13 @@ func (m *Histogram) GetSampleCount() uint64 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (m *Histogram) GetSampleCountFloat() float64 {
|
||||
if m != nil && m.SampleCountFloat != nil {
|
||||
return *m.SampleCountFloat
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Histogram) GetSampleSum() float64 {
|
||||
if m != nil && m.SampleSum != nil {
|
||||
return *m.SampleSum
|
||||
|
@ -399,8 +440,81 @@ func (m *Histogram) GetBucket() []*Bucket {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (m *Histogram) GetSchema() int32 {
|
||||
if m != nil && m.Schema != nil {
|
||||
return *m.Schema
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Histogram) GetZeroThreshold() float64 {
|
||||
if m != nil && m.ZeroThreshold != nil {
|
||||
return *m.ZeroThreshold
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Histogram) GetZeroCount() uint64 {
|
||||
if m != nil && m.ZeroCount != nil {
|
||||
return *m.ZeroCount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Histogram) GetZeroCountFloat() float64 {
|
||||
if m != nil && m.ZeroCountFloat != nil {
|
||||
return *m.ZeroCountFloat
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Histogram) GetNegativeSpan() []*BucketSpan {
|
||||
if m != nil {
|
||||
return m.NegativeSpan
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Histogram) GetNegativeDelta() []int64 {
|
||||
if m != nil {
|
||||
return m.NegativeDelta
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Histogram) GetNegativeCount() []float64 {
|
||||
if m != nil {
|
||||
return m.NegativeCount
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Histogram) GetPositiveSpan() []*BucketSpan {
|
||||
if m != nil {
|
||||
return m.PositiveSpan
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Histogram) GetPositiveDelta() []int64 {
|
||||
if m != nil {
|
||||
return m.PositiveDelta
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Histogram) GetPositiveCount() []float64 {
|
||||
if m != nil {
|
||||
return m.PositiveCount
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// A Bucket of a conventional histogram, each of which is treated as
|
||||
// an individual counter-like time series by Prometheus.
|
||||
type Bucket struct {
|
||||
CumulativeCount *uint64 `protobuf:"varint,1,opt,name=cumulative_count,json=cumulativeCount" json:"cumulative_count,omitempty"`
|
||||
CumulativeCountFloat *float64 `protobuf:"fixed64,4,opt,name=cumulative_count_float,json=cumulativeCountFloat" json:"cumulative_count_float,omitempty"`
|
||||
UpperBound *float64 `protobuf:"fixed64,2,opt,name=upper_bound,json=upperBound" json:"upper_bound,omitempty"`
|
||||
Exemplar *Exemplar `protobuf:"bytes,3,opt,name=exemplar" json:"exemplar,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
|
@ -412,7 +526,7 @@ func (m *Bucket) Reset() { *m = Bucket{} }
|
|||
func (m *Bucket) String() string { return proto.CompactTextString(m) }
|
||||
func (*Bucket) ProtoMessage() {}
|
||||
func (*Bucket) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6039342a2ba47b72, []int{7}
|
||||
return fileDescriptor_d1e5ddb18987a258, []int{7}
|
||||
}
|
||||
|
||||
func (m *Bucket) XXX_Unmarshal(b []byte) error {
|
||||
|
@ -440,6 +554,13 @@ func (m *Bucket) GetCumulativeCount() uint64 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (m *Bucket) GetCumulativeCountFloat() float64 {
|
||||
if m != nil && m.CumulativeCountFloat != nil {
|
||||
return *m.CumulativeCountFloat
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Bucket) GetUpperBound() float64 {
|
||||
if m != nil && m.UpperBound != nil {
|
||||
return *m.UpperBound
|
||||
|
@ -454,6 +575,59 @@ func (m *Bucket) GetExemplar() *Exemplar {
|
|||
return nil
|
||||
}
|
||||
|
||||
// A BucketSpan defines a number of consecutive buckets in a native
|
||||
// histogram with their offset. Logically, it would be more
|
||||
// straightforward to include the bucket counts in the Span. However,
|
||||
// the protobuf representation is more compact in the way the data is
|
||||
// structured here (with all the buckets in a single array separate
|
||||
// from the Spans).
|
||||
type BucketSpan struct {
|
||||
Offset *int32 `protobuf:"zigzag32,1,opt,name=offset" json:"offset,omitempty"`
|
||||
Length *uint32 `protobuf:"varint,2,opt,name=length" json:"length,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *BucketSpan) Reset() { *m = BucketSpan{} }
|
||||
func (m *BucketSpan) String() string { return proto.CompactTextString(m) }
|
||||
func (*BucketSpan) ProtoMessage() {}
|
||||
func (*BucketSpan) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_d1e5ddb18987a258, []int{8}
|
||||
}
|
||||
|
||||
func (m *BucketSpan) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_BucketSpan.Unmarshal(m, b)
|
||||
}
|
||||
func (m *BucketSpan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_BucketSpan.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *BucketSpan) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_BucketSpan.Merge(m, src)
|
||||
}
|
||||
func (m *BucketSpan) XXX_Size() int {
|
||||
return xxx_messageInfo_BucketSpan.Size(m)
|
||||
}
|
||||
func (m *BucketSpan) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_BucketSpan.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_BucketSpan proto.InternalMessageInfo
|
||||
|
||||
func (m *BucketSpan) GetOffset() int32 {
|
||||
if m != nil && m.Offset != nil {
|
||||
return *m.Offset
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *BucketSpan) GetLength() uint32 {
|
||||
if m != nil && m.Length != nil {
|
||||
return *m.Length
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Exemplar struct {
|
||||
Label []*LabelPair `protobuf:"bytes,1,rep,name=label" json:"label,omitempty"`
|
||||
Value *float64 `protobuf:"fixed64,2,opt,name=value" json:"value,omitempty"`
|
||||
|
@ -467,7 +641,7 @@ func (m *Exemplar) Reset() { *m = Exemplar{} }
|
|||
func (m *Exemplar) String() string { return proto.CompactTextString(m) }
|
||||
func (*Exemplar) ProtoMessage() {}
|
||||
func (*Exemplar) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6039342a2ba47b72, []int{8}
|
||||
return fileDescriptor_d1e5ddb18987a258, []int{9}
|
||||
}
|
||||
|
||||
func (m *Exemplar) XXX_Unmarshal(b []byte) error {
|
||||
|
@ -526,7 +700,7 @@ func (m *Metric) Reset() { *m = Metric{} }
|
|||
func (m *Metric) String() string { return proto.CompactTextString(m) }
|
||||
func (*Metric) ProtoMessage() {}
|
||||
func (*Metric) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6039342a2ba47b72, []int{9}
|
||||
return fileDescriptor_d1e5ddb18987a258, []int{10}
|
||||
}
|
||||
|
||||
func (m *Metric) XXX_Unmarshal(b []byte) error {
|
||||
|
@ -610,7 +784,7 @@ func (m *MetricFamily) Reset() { *m = MetricFamily{} }
|
|||
func (m *MetricFamily) String() string { return proto.CompactTextString(m) }
|
||||
func (*MetricFamily) ProtoMessage() {}
|
||||
func (*MetricFamily) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6039342a2ba47b72, []int{10}
|
||||
return fileDescriptor_d1e5ddb18987a258, []int{11}
|
||||
}
|
||||
|
||||
func (m *MetricFamily) XXX_Unmarshal(b []byte) error {
|
||||
|
@ -669,55 +843,72 @@ func init() {
|
|||
proto.RegisterType((*Untyped)(nil), "io.prometheus.client.Untyped")
|
||||
proto.RegisterType((*Histogram)(nil), "io.prometheus.client.Histogram")
|
||||
proto.RegisterType((*Bucket)(nil), "io.prometheus.client.Bucket")
|
||||
proto.RegisterType((*BucketSpan)(nil), "io.prometheus.client.BucketSpan")
|
||||
proto.RegisterType((*Exemplar)(nil), "io.prometheus.client.Exemplar")
|
||||
proto.RegisterType((*Metric)(nil), "io.prometheus.client.Metric")
|
||||
proto.RegisterType((*MetricFamily)(nil), "io.prometheus.client.MetricFamily")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("metrics.proto", fileDescriptor_6039342a2ba47b72) }
|
||||
|
||||
var fileDescriptor_6039342a2ba47b72 = []byte{
|
||||
// 665 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x4c,
|
||||
0x14, 0xfd, 0xdc, 0x38, 0x3f, 0xbe, 0x69, 0x3f, 0xa2, 0x51, 0x17, 0x56, 0xa1, 0x24, 0x78, 0x55,
|
||||
0x58, 0x38, 0xa2, 0x6a, 0x05, 0x2a, 0xb0, 0x68, 0x4b, 0x48, 0x91, 0x48, 0x5b, 0x26, 0xc9, 0xa2,
|
||||
0xb0, 0x88, 0x1c, 0x77, 0x70, 0x2c, 0x3c, 0xb1, 0xb1, 0x67, 0x2a, 0xb2, 0x66, 0xc1, 0x16, 0x5e,
|
||||
0x81, 0x17, 0x05, 0xcd, 0x8f, 0x6d, 0x2a, 0xb9, 0x95, 0x40, 0xec, 0x66, 0xee, 0x3d, 0xe7, 0xfa,
|
||||
0xcc, 0xf8, 0x9c, 0x81, 0x0d, 0x4a, 0x58, 0x1a, 0xfa, 0x99, 0x9b, 0xa4, 0x31, 0x8b, 0xd1, 0x66,
|
||||
0x18, 0x8b, 0x15, 0x25, 0x6c, 0x41, 0x78, 0xe6, 0xfa, 0x51, 0x48, 0x96, 0x6c, 0xab, 0x1b, 0xc4,
|
||||
0x71, 0x10, 0x91, 0xbe, 0xc4, 0xcc, 0xf9, 0x87, 0x3e, 0x0b, 0x29, 0xc9, 0x98, 0x47, 0x13, 0x45,
|
||||
0x73, 0xf6, 0xc1, 0x7a, 0xe3, 0xcd, 0x49, 0x74, 0xee, 0x85, 0x29, 0x42, 0x60, 0x2e, 0x3d, 0x4a,
|
||||
0x6c, 0xa3, 0x67, 0xec, 0x58, 0x58, 0xae, 0xd1, 0x26, 0xd4, 0xaf, 0xbc, 0x88, 0x13, 0x7b, 0x4d,
|
||||
0x16, 0xd5, 0xc6, 0xd9, 0x86, 0xfa, 0xd0, 0xe3, 0xc1, 0x6f, 0x6d, 0xc1, 0x31, 0xf2, 0xf6, 0x7b,
|
||||
0x68, 0x1e, 0xc7, 0x7c, 0xc9, 0x48, 0x5a, 0x0d, 0x40, 0x07, 0xd0, 0x22, 0x9f, 0x09, 0x4d, 0x22,
|
||||
0x2f, 0x95, 0x83, 0xdb, 0xbb, 0xf7, 0xdd, 0xaa, 0x03, 0xb8, 0x03, 0x8d, 0xc2, 0x05, 0xde, 0x79,
|
||||
0x0e, 0xad, 0xb7, 0xdc, 0x5b, 0xb2, 0x30, 0x22, 0x68, 0x0b, 0x5a, 0x9f, 0xf4, 0x5a, 0x7f, 0xa0,
|
||||
0xd8, 0x5f, 0x57, 0x5e, 0x48, 0xfb, 0x6a, 0x40, 0x73, 0xcc, 0x29, 0xf5, 0xd2, 0x15, 0x7a, 0x00,
|
||||
0xeb, 0x99, 0x47, 0x93, 0x88, 0xcc, 0x7c, 0xa1, 0x56, 0x4e, 0x30, 0x71, 0x5b, 0xd5, 0xe4, 0x01,
|
||||
0xd0, 0x36, 0x80, 0x86, 0x64, 0x9c, 0xea, 0x49, 0x96, 0xaa, 0x8c, 0x39, 0x15, 0xe7, 0x28, 0xbe,
|
||||
0x5f, 0xeb, 0xd5, 0x6e, 0x3e, 0x47, 0xae, 0xb8, 0xd4, 0xe7, 0x74, 0xa1, 0x39, 0x5d, 0xb2, 0x55,
|
||||
0x42, 0x2e, 0x6f, 0xb8, 0xc5, 0x2f, 0x06, 0x58, 0x27, 0x61, 0xc6, 0xe2, 0x20, 0xf5, 0xe8, 0x3f,
|
||||
0x10, 0xbb, 0x07, 0x8d, 0x39, 0xf7, 0x3f, 0x12, 0xa6, 0xa5, 0xde, 0xab, 0x96, 0x7a, 0x24, 0x31,
|
||||
0x58, 0x63, 0x9d, 0x6f, 0x06, 0x34, 0x54, 0x09, 0x3d, 0x84, 0x8e, 0xcf, 0x29, 0x8f, 0x3c, 0x16,
|
||||
0x5e, 0x5d, 0x97, 0x71, 0xa7, 0xac, 0x2b, 0x29, 0x5d, 0x68, 0xf3, 0x24, 0x21, 0xe9, 0x6c, 0x1e,
|
||||
0xf3, 0xe5, 0xa5, 0xd6, 0x02, 0xb2, 0x74, 0x24, 0x2a, 0xd7, 0x1c, 0x50, 0xfb, 0x43, 0x07, 0x7c,
|
||||
0x37, 0xa0, 0x95, 0x97, 0xd1, 0x3e, 0xd4, 0x23, 0xe1, 0x60, 0xdb, 0x90, 0x87, 0xea, 0x56, 0x4f,
|
||||
0x29, 0x4c, 0x8e, 0x15, 0xba, 0xda, 0x1d, 0xe8, 0x29, 0x58, 0x45, 0x42, 0xb4, 0xac, 0x2d, 0x57,
|
||||
0x65, 0xc8, 0xcd, 0x33, 0xe4, 0x4e, 0x72, 0x04, 0x2e, 0xc1, 0xce, 0xcf, 0x35, 0x68, 0x8c, 0x64,
|
||||
0x22, 0xff, 0x56, 0xd1, 0x63, 0xa8, 0x07, 0x22, 0x53, 0x3a, 0x10, 0x77, 0xab, 0x69, 0x32, 0x76,
|
||||
0x58, 0x21, 0xd1, 0x13, 0x68, 0xfa, 0x2a, 0x67, 0x5a, 0xec, 0x76, 0x35, 0x49, 0x87, 0x11, 0xe7,
|
||||
0x68, 0x41, 0xcc, 0x54, 0x08, 0x6c, 0xf3, 0x36, 0xa2, 0x4e, 0x0a, 0xce, 0xd1, 0x82, 0xc8, 0x95,
|
||||
0x69, 0xed, 0xfa, 0x6d, 0x44, 0xed, 0x6c, 0x9c, 0xa3, 0xd1, 0x0b, 0xb0, 0x16, 0xb9, 0x97, 0xed,
|
||||
0xa6, 0xa4, 0xde, 0x70, 0x31, 0x85, 0xe5, 0x71, 0xc9, 0x10, 0xee, 0x2f, 0xee, 0x7a, 0x46, 0x33,
|
||||
0xbb, 0xd1, 0x33, 0x76, 0x6a, 0xb8, 0x5d, 0xd4, 0x46, 0x99, 0xf3, 0xc3, 0x80, 0x75, 0xf5, 0x07,
|
||||
0x5e, 0x79, 0x34, 0x8c, 0x56, 0x95, 0xcf, 0x19, 0x02, 0x73, 0x41, 0xa2, 0x44, 0xbf, 0x66, 0x72,
|
||||
0x8d, 0xf6, 0xc0, 0x14, 0x1a, 0xe5, 0x15, 0xfe, 0xbf, 0xdb, 0xab, 0x56, 0xa5, 0x26, 0x4f, 0x56,
|
||||
0x09, 0xc1, 0x12, 0x2d, 0xd2, 0xa4, 0x5e, 0x60, 0xdb, 0xbc, 0x2d, 0x4d, 0x8a, 0x87, 0x35, 0xf6,
|
||||
0xd1, 0x08, 0xa0, 0x9c, 0x84, 0xda, 0xd0, 0x3c, 0x3e, 0x9b, 0x9e, 0x4e, 0x06, 0xb8, 0xf3, 0x1f,
|
||||
0xb2, 0xa0, 0x3e, 0x3c, 0x9c, 0x0e, 0x07, 0x1d, 0x43, 0xd4, 0xc7, 0xd3, 0xd1, 0xe8, 0x10, 0x5f,
|
||||
0x74, 0xd6, 0xc4, 0x66, 0x7a, 0x3a, 0xb9, 0x38, 0x1f, 0xbc, 0xec, 0xd4, 0xd0, 0x06, 0x58, 0x27,
|
||||
0xaf, 0xc7, 0x93, 0xb3, 0x21, 0x3e, 0x1c, 0x75, 0xcc, 0x23, 0x0c, 0x95, 0xef, 0xfe, 0xbb, 0x83,
|
||||
0x20, 0x64, 0x0b, 0x3e, 0x77, 0xfd, 0x98, 0xf6, 0xcb, 0x6e, 0x5f, 0x75, 0x67, 0x34, 0xbe, 0x24,
|
||||
0x51, 0x3f, 0x88, 0x9f, 0x85, 0xf1, 0xac, 0xec, 0xce, 0x54, 0xf7, 0x57, 0x00, 0x00, 0x00, 0xff,
|
||||
0xff, 0xd0, 0x84, 0x91, 0x73, 0x59, 0x06, 0x00, 0x00,
|
||||
func init() {
|
||||
proto.RegisterFile("io/prometheus/client/metrics.proto", fileDescriptor_d1e5ddb18987a258)
|
||||
}
|
||||
|
||||
var fileDescriptor_d1e5ddb18987a258 = []byte{
|
||||
// 896 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xdd, 0x8e, 0xdb, 0x44,
|
||||
0x18, 0xc5, 0x9b, 0x5f, 0x7f, 0xd9, 0x6c, 0xd3, 0x61, 0x55, 0x59, 0x0b, 0xcb, 0x06, 0x4b, 0x48,
|
||||
0x0b, 0x42, 0x8e, 0x40, 0x5b, 0x81, 0x0a, 0x5c, 0xec, 0xb6, 0xe9, 0x16, 0x89, 0xb4, 0x65, 0x92,
|
||||
0x5c, 0x14, 0x2e, 0xac, 0x49, 0x32, 0xeb, 0x58, 0x78, 0x3c, 0xc6, 0x1e, 0x57, 0x2c, 0x2f, 0xc0,
|
||||
0x35, 0xaf, 0xc0, 0xc3, 0xf0, 0x22, 0x3c, 0x08, 0x68, 0xfe, 0xec, 0xdd, 0xe2, 0x94, 0xd2, 0x3b,
|
||||
0x7f, 0x67, 0xce, 0xf7, 0xcd, 0x39, 0xe3, 0xc9, 0x71, 0xc0, 0x8f, 0xf9, 0x24, 0xcb, 0x39, 0xa3,
|
||||
0x62, 0x4b, 0xcb, 0x62, 0xb2, 0x4e, 0x62, 0x9a, 0x8a, 0x09, 0xa3, 0x22, 0x8f, 0xd7, 0x45, 0x90,
|
||||
0xe5, 0x5c, 0x70, 0x74, 0x18, 0xf3, 0xa0, 0xe6, 0x04, 0x9a, 0x73, 0x74, 0x12, 0x71, 0x1e, 0x25,
|
||||
0x74, 0xa2, 0x38, 0xab, 0xf2, 0x6a, 0x22, 0x62, 0x46, 0x0b, 0x41, 0x58, 0xa6, 0xdb, 0xfc, 0xfb,
|
||||
0xe0, 0x7e, 0x47, 0x56, 0x34, 0x79, 0x4e, 0xe2, 0x1c, 0x21, 0x68, 0xa7, 0x84, 0x51, 0xcf, 0x19,
|
||||
0x3b, 0xa7, 0x2e, 0x56, 0xcf, 0xe8, 0x10, 0x3a, 0x2f, 0x49, 0x52, 0x52, 0x6f, 0x4f, 0x81, 0xba,
|
||||
0xf0, 0x8f, 0xa1, 0x73, 0x49, 0xca, 0xe8, 0xc6, 0xb2, 0xec, 0x71, 0xec, 0xf2, 0x8f, 0xd0, 0x7b,
|
||||
0xc8, 0xcb, 0x54, 0xd0, 0xbc, 0x99, 0x80, 0x1e, 0x40, 0x9f, 0xfe, 0x42, 0x59, 0x96, 0x90, 0x5c,
|
||||
0x0d, 0x1e, 0x7c, 0xfe, 0x41, 0xd0, 0x64, 0x20, 0x98, 0x1a, 0x16, 0xae, 0xf8, 0xfe, 0xd7, 0xd0,
|
||||
0xff, 0xbe, 0x24, 0xa9, 0x88, 0x13, 0x8a, 0x8e, 0xa0, 0xff, 0xb3, 0x79, 0x36, 0x1b, 0x54, 0xf5,
|
||||
0x6d, 0xe5, 0x95, 0xb4, 0xdf, 0x1c, 0xe8, 0xcd, 0x4b, 0xc6, 0x48, 0x7e, 0x8d, 0x3e, 0x84, 0xfd,
|
||||
0x82, 0xb0, 0x2c, 0xa1, 0xe1, 0x5a, 0xaa, 0x55, 0x13, 0xda, 0x78, 0xa0, 0x31, 0x65, 0x00, 0x1d,
|
||||
0x03, 0x18, 0x4a, 0x51, 0x32, 0x33, 0xc9, 0xd5, 0xc8, 0xbc, 0x64, 0xd2, 0x47, 0xb5, 0x7f, 0x6b,
|
||||
0xdc, 0xda, 0xed, 0xc3, 0x2a, 0xae, 0xf5, 0xf9, 0x27, 0xd0, 0x5b, 0xa6, 0xe2, 0x3a, 0xa3, 0x9b,
|
||||
0x1d, 0xa7, 0xf8, 0x57, 0x1b, 0xdc, 0x27, 0x71, 0x21, 0x78, 0x94, 0x13, 0xf6, 0x26, 0x62, 0x3f,
|
||||
0x05, 0x74, 0x93, 0x12, 0x5e, 0x25, 0x9c, 0x08, 0xaf, 0xad, 0x66, 0x8e, 0x6e, 0x10, 0x1f, 0x4b,
|
||||
0xfc, 0xbf, 0xac, 0x9d, 0x41, 0x77, 0x55, 0xae, 0x7f, 0xa2, 0xc2, 0x18, 0x7b, 0xbf, 0xd9, 0xd8,
|
||||
0x85, 0xe2, 0x60, 0xc3, 0x45, 0xf7, 0xa0, 0x5b, 0xac, 0xb7, 0x94, 0x11, 0xaf, 0x33, 0x76, 0x4e,
|
||||
0xef, 0x62, 0x53, 0xa1, 0x8f, 0xe0, 0xe0, 0x57, 0x9a, 0xf3, 0x50, 0x6c, 0x73, 0x5a, 0x6c, 0x79,
|
||||
0xb2, 0xf1, 0xba, 0x6a, 0xc3, 0xa1, 0x44, 0x17, 0x16, 0x94, 0x9a, 0x14, 0x4d, 0x5b, 0xec, 0x29,
|
||||
0x8b, 0xae, 0x44, 0xb4, 0xc1, 0x53, 0x18, 0xd5, 0xcb, 0xc6, 0x5e, 0x5f, 0xcd, 0x39, 0xa8, 0x48,
|
||||
0xda, 0xdc, 0x14, 0x86, 0x29, 0x8d, 0x88, 0x88, 0x5f, 0xd2, 0xb0, 0xc8, 0x48, 0xea, 0xb9, 0xca,
|
||||
0xc4, 0xf8, 0x75, 0x26, 0xe6, 0x19, 0x49, 0xf1, 0xbe, 0x6d, 0x93, 0x95, 0x94, 0x5d, 0x8d, 0xd9,
|
||||
0xd0, 0x44, 0x10, 0x0f, 0xc6, 0xad, 0x53, 0x84, 0xab, 0xe1, 0x8f, 0x24, 0x78, 0x8b, 0xa6, 0xa5,
|
||||
0x0f, 0xc6, 0x2d, 0xe9, 0xce, 0xa2, 0x5a, 0xfe, 0x14, 0x86, 0x19, 0x2f, 0xe2, 0x5a, 0xd4, 0xfe,
|
||||
0x9b, 0x8a, 0xb2, 0x6d, 0x56, 0x54, 0x35, 0x46, 0x8b, 0x1a, 0x6a, 0x51, 0x16, 0xad, 0x44, 0x55,
|
||||
0x34, 0x2d, 0xea, 0x40, 0x8b, 0xb2, 0xa8, 0x12, 0xe5, 0xff, 0xe9, 0x40, 0x57, 0x6f, 0x85, 0x3e,
|
||||
0x86, 0xd1, 0xba, 0x64, 0x65, 0x72, 0xd3, 0x88, 0xbe, 0x66, 0x77, 0x6a, 0x5c, 0x5b, 0x39, 0x83,
|
||||
0x7b, 0xaf, 0x52, 0x6f, 0x5d, 0xb7, 0xc3, 0x57, 0x1a, 0xf4, 0x5b, 0x39, 0x81, 0x41, 0x99, 0x65,
|
||||
0x34, 0x0f, 0x57, 0xbc, 0x4c, 0x37, 0xe6, 0xce, 0x81, 0x82, 0x2e, 0x24, 0x72, 0x2b, 0x17, 0x5a,
|
||||
0xff, 0x3b, 0x17, 0xa0, 0x3e, 0x32, 0x79, 0x11, 0xf9, 0xd5, 0x55, 0x41, 0xb5, 0x83, 0xbb, 0xd8,
|
||||
0x54, 0x12, 0x4f, 0x68, 0x1a, 0x89, 0xad, 0xda, 0x7d, 0x88, 0x4d, 0xe5, 0xff, 0xee, 0x40, 0xdf,
|
||||
0x0e, 0x45, 0xf7, 0xa1, 0x93, 0xc8, 0x54, 0xf4, 0x1c, 0xf5, 0x82, 0x4e, 0x9a, 0x35, 0x54, 0xc1,
|
||||
0x89, 0x35, 0xbb, 0x39, 0x71, 0xd0, 0x97, 0xe0, 0x56, 0xa9, 0x6b, 0x4c, 0x1d, 0x05, 0x3a, 0x97,
|
||||
0x03, 0x9b, 0xcb, 0xc1, 0xc2, 0x32, 0x70, 0x4d, 0xf6, 0xff, 0xde, 0x83, 0xee, 0x4c, 0xa5, 0xfc,
|
||||
0xdb, 0x2a, 0xfa, 0x0c, 0x3a, 0x91, 0xcc, 0x69, 0x13, 0xb2, 0xef, 0x35, 0xb7, 0xa9, 0x28, 0xc7,
|
||||
0x9a, 0x89, 0xbe, 0x80, 0xde, 0x5a, 0x67, 0xb7, 0x11, 0x7b, 0xdc, 0xdc, 0x64, 0x02, 0x1e, 0x5b,
|
||||
0xb6, 0x6c, 0x2c, 0x74, 0xb0, 0xaa, 0x3b, 0xb0, 0xb3, 0xd1, 0xa4, 0x2f, 0xb6, 0x6c, 0xd9, 0x58,
|
||||
0xea, 0x20, 0x54, 0xa1, 0xb1, 0xb3, 0xd1, 0xa4, 0x25, 0xb6, 0x6c, 0xf4, 0x0d, 0xb8, 0x5b, 0x9b,
|
||||
0x8f, 0x2a, 0x2c, 0x76, 0x1e, 0x4c, 0x15, 0xa3, 0xb8, 0xee, 0x90, 0x89, 0x5a, 0x9d, 0x75, 0xc8,
|
||||
0x0a, 0x95, 0x48, 0x2d, 0x3c, 0xa8, 0xb0, 0x59, 0xe1, 0xff, 0xe1, 0xc0, 0xbe, 0x7e, 0x03, 0x8f,
|
||||
0x09, 0x8b, 0x93, 0xeb, 0xc6, 0x4f, 0x24, 0x82, 0xf6, 0x96, 0x26, 0x99, 0xf9, 0x42, 0xaa, 0x67,
|
||||
0x74, 0x06, 0x6d, 0xa9, 0x51, 0x1d, 0xe1, 0xc1, 0xae, 0x5f, 0xb8, 0x9e, 0xbc, 0xb8, 0xce, 0x28,
|
||||
0x56, 0x6c, 0x99, 0xb9, 0xfa, 0xab, 0xee, 0xb5, 0x5f, 0x97, 0xb9, 0xba, 0x0f, 0x1b, 0xee, 0x27,
|
||||
0x2b, 0x80, 0x7a, 0x12, 0x1a, 0x40, 0xef, 0xe1, 0xb3, 0xe5, 0xd3, 0xc5, 0x14, 0x8f, 0xde, 0x41,
|
||||
0x2e, 0x74, 0x2e, 0xcf, 0x97, 0x97, 0xd3, 0x91, 0x23, 0xf1, 0xf9, 0x72, 0x36, 0x3b, 0xc7, 0x2f,
|
||||
0x46, 0x7b, 0xb2, 0x58, 0x3e, 0x5d, 0xbc, 0x78, 0x3e, 0x7d, 0x34, 0x6a, 0xa1, 0x21, 0xb8, 0x4f,
|
||||
0xbe, 0x9d, 0x2f, 0x9e, 0x5d, 0xe2, 0xf3, 0xd9, 0xa8, 0x8d, 0xde, 0x85, 0x3b, 0xaa, 0x27, 0xac,
|
||||
0xc1, 0xce, 0x05, 0x86, 0xc6, 0x3f, 0x18, 0x3f, 0x3c, 0x88, 0x62, 0xb1, 0x2d, 0x57, 0xc1, 0x9a,
|
||||
0xb3, 0x7f, 0xff, 0x45, 0x09, 0x19, 0xdf, 0xd0, 0x64, 0x12, 0xf1, 0xaf, 0x62, 0x1e, 0xd6, 0xab,
|
||||
0xa1, 0x5e, 0xfd, 0x27, 0x00, 0x00, 0xff, 0xff, 0x16, 0x77, 0x81, 0x98, 0xd7, 0x08, 0x00, 0x00,
|
||||
}
|
||||
|
|
|
@ -21,8 +21,8 @@ import "bytes"
|
|||
|
||||
// Fuzz text metric parser with with github.com/dvyukov/go-fuzz:
|
||||
//
|
||||
// go-fuzz-build github.com/prometheus/common/expfmt
|
||||
// go-fuzz -bin expfmt-fuzz.zip -workdir fuzz
|
||||
// go-fuzz-build github.com/prometheus/common/expfmt
|
||||
// go-fuzz -bin expfmt-fuzz.zip -workdir fuzz
|
||||
//
|
||||
// Further input samples should go in the folder fuzz/corpus.
|
||||
func Fuzz(in []byte) int {
|
||||
|
|
|
@ -46,20 +46,20 @@ import (
|
|||
// missing features and peculiarities to avoid complications when switching from
|
||||
// Prometheus to OpenMetrics or vice versa:
|
||||
//
|
||||
// - Counters are expected to have the `_total` suffix in their metric name. In
|
||||
// the output, the suffix will be truncated from the `# TYPE` and `# HELP`
|
||||
// line. A counter with a missing `_total` suffix is not an error. However,
|
||||
// its type will be set to `unknown` in that case to avoid invalid OpenMetrics
|
||||
// output.
|
||||
// - Counters are expected to have the `_total` suffix in their metric name. In
|
||||
// the output, the suffix will be truncated from the `# TYPE` and `# HELP`
|
||||
// line. A counter with a missing `_total` suffix is not an error. However,
|
||||
// its type will be set to `unknown` in that case to avoid invalid OpenMetrics
|
||||
// output.
|
||||
//
|
||||
// - No support for the following (optional) features: `# UNIT` line, `_created`
|
||||
// line, info type, stateset type, gaugehistogram type.
|
||||
// - No support for the following (optional) features: `# UNIT` line, `_created`
|
||||
// line, info type, stateset type, gaugehistogram type.
|
||||
//
|
||||
// - The size of exemplar labels is not checked (i.e. it's possible to create
|
||||
// exemplars that are larger than allowed by the OpenMetrics specification).
|
||||
// - The size of exemplar labels is not checked (i.e. it's possible to create
|
||||
// exemplars that are larger than allowed by the OpenMetrics specification).
|
||||
//
|
||||
// - The value of Counters is not checked. (OpenMetrics doesn't allow counters
|
||||
// with a `NaN` value.)
|
||||
// - The value of Counters is not checked. (OpenMetrics doesn't allow counters
|
||||
// with a `NaN` value.)
|
||||
func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int, err error) {
|
||||
name := in.GetName()
|
||||
if name == "" {
|
||||
|
|
|
@ -17,7 +17,6 @@ import (
|
|||
"bufio"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -44,7 +43,7 @@ const (
|
|||
var (
|
||||
bufPool = sync.Pool{
|
||||
New: func() interface{} {
|
||||
return bufio.NewWriter(ioutil.Discard)
|
||||
return bufio.NewWriter(io.Discard)
|
||||
},
|
||||
}
|
||||
numBufPool = sync.Pool{
|
||||
|
|
22
vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go
generated
vendored
22
vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go
generated
vendored
|
@ -11,18 +11,18 @@ Redistribution and use in source and binary forms, with or without
|
|||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
Neither the name of the Open Knowledge Foundation Ltd. nor the
|
||||
names of its contributors may be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
Neither the name of the Open Knowledge Foundation Ltd. nor the
|
||||
names of its contributors may be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
@ -35,8 +35,6 @@ 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.
|
||||
|
||||
|
||||
*/
|
||||
package goautoneg
|
||||
|
||||
|
|
|
@ -55,19 +55,22 @@ ifneq ($(shell which gotestsum),)
|
|||
endif
|
||||
endif
|
||||
|
||||
PROMU_VERSION ?= 0.13.0
|
||||
PROMU_VERSION ?= 0.14.0
|
||||
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
|
||||
|
||||
SKIP_GOLANGCI_LINT :=
|
||||
GOLANGCI_LINT :=
|
||||
GOLANGCI_LINT_OPTS ?=
|
||||
GOLANGCI_LINT_VERSION ?= v1.45.2
|
||||
GOLANGCI_LINT_VERSION ?= v1.49.0
|
||||
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
|
||||
# windows isn't included here because of the path separator being different.
|
||||
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
|
||||
ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386))
|
||||
# If we're in CI and there is an Actions file, that means the linter
|
||||
# is being run in Actions, so we don't need to run it here.
|
||||
ifeq (,$(CIRCLE_JOB))
|
||||
ifneq (,$(SKIP_GOLANGCI_LINT))
|
||||
GOLANGCI_LINT :=
|
||||
else ifeq (,$(CIRCLE_JOB))
|
||||
GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint
|
||||
else ifeq (,$(wildcard .github/workflows/golangci-lint.yml))
|
||||
GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint
|
||||
|
|
|
@ -380,6 +380,42 @@ func parseCPUInfoMips(info []byte) ([]CPUInfo, error) {
|
|||
return cpuinfo, nil
|
||||
}
|
||||
|
||||
func parseCPUInfoLoong(info []byte) ([]CPUInfo, error) {
|
||||
scanner := bufio.NewScanner(bytes.NewReader(info))
|
||||
// find the first "processor" line
|
||||
firstLine := firstNonEmptyLine(scanner)
|
||||
if !strings.HasPrefix(firstLine, "system type") || !strings.Contains(firstLine, ":") {
|
||||
return nil, errors.New("invalid cpuinfo file: " + firstLine)
|
||||
}
|
||||
field := strings.SplitN(firstLine, ": ", 2)
|
||||
cpuinfo := []CPUInfo{}
|
||||
systemType := field[1]
|
||||
i := 0
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
if !strings.Contains(line, ":") {
|
||||
continue
|
||||
}
|
||||
field := strings.SplitN(line, ": ", 2)
|
||||
switch strings.TrimSpace(field[0]) {
|
||||
case "processor":
|
||||
v, err := strconv.ParseUint(field[1], 0, 32)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
i = int(v)
|
||||
cpuinfo = append(cpuinfo, CPUInfo{}) // start of the next processor
|
||||
cpuinfo[i].Processor = uint(v)
|
||||
cpuinfo[i].VendorID = systemType
|
||||
case "CPU Family":
|
||||
cpuinfo[i].CPUFamily = field[1]
|
||||
case "Model Name":
|
||||
cpuinfo[i].ModelName = field[1]
|
||||
}
|
||||
}
|
||||
return cpuinfo, nil
|
||||
}
|
||||
|
||||
func parseCPUInfoPPC(info []byte) ([]CPUInfo, error) {
|
||||
scanner := bufio.NewScanner(bytes.NewReader(info))
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2022 The Prometheus Authors
|
||||
// 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.
|
||||
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package procfs
|
||||
|
||||
var parseCPUInfo = parseCPUInfoLoong
|
|
@ -11,8 +11,8 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build linux && !386 && !amd64 && !arm && !arm64 && !mips && !mips64 && !mips64le && !mipsle && !ppc64 && !ppc64le && !riscv64 && !s390x
|
||||
// +build linux,!386,!amd64,!arm,!arm64,!mips,!mips64,!mips64le,!mipsle,!ppc64,!ppc64le,!riscv64,!s390x
|
||||
//go:build linux && !386 && !amd64 && !arm && !arm64 && !loong64 && !mips && !mips64 && !mips64le && !mipsle && !ppc64 && !ppc64le && !riscv64 && !s390x
|
||||
// +build linux,!386,!amd64,!arm,!arm64,!loong64,!mips,!mips64,!mips64le,!mipsle,!ppc64,!ppc64le,!riscv64,!s390x
|
||||
|
||||
package procfs
|
||||
|
||||
|
|
|
@ -16,30 +16,29 @@
|
|||
//
|
||||
// Example:
|
||||
//
|
||||
// package main
|
||||
// package main
|
||||
//
|
||||
// import (
|
||||
// "fmt"
|
||||
// "log"
|
||||
// import (
|
||||
// "fmt"
|
||||
// "log"
|
||||
//
|
||||
// "github.com/prometheus/procfs"
|
||||
// )
|
||||
// "github.com/prometheus/procfs"
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// p, err := procfs.Self()
|
||||
// if err != nil {
|
||||
// log.Fatalf("could not get process: %s", err)
|
||||
// }
|
||||
// func main() {
|
||||
// p, err := procfs.Self()
|
||||
// if err != nil {
|
||||
// log.Fatalf("could not get process: %s", err)
|
||||
// }
|
||||
//
|
||||
// stat, err := p.Stat()
|
||||
// if err != nil {
|
||||
// log.Fatalf("could not get process stat: %s", err)
|
||||
// }
|
||||
//
|
||||
// fmt.Printf("command: %s\n", stat.Comm)
|
||||
// fmt.Printf("cpu time: %fs\n", stat.CPUTime())
|
||||
// fmt.Printf("vsize: %dB\n", stat.VirtualMemory())
|
||||
// fmt.Printf("rss: %dB\n", stat.ResidentMemory())
|
||||
// }
|
||||
// stat, err := p.Stat()
|
||||
// if err != nil {
|
||||
// log.Fatalf("could not get process stat: %s", err)
|
||||
// }
|
||||
//
|
||||
// fmt.Printf("command: %s\n", stat.Comm)
|
||||
// fmt.Printf("cpu time: %fs\n", stat.CPUTime())
|
||||
// fmt.Printf("vsize: %dB\n", stat.VirtualMemory())
|
||||
// fmt.Printf("rss: %dB\n", stat.ResidentMemory())
|
||||
// }
|
||||
package procfs
|
||||
|
|
|
@ -284,7 +284,8 @@ func parseMountStats(r io.Reader) ([]*Mount, error) {
|
|||
}
|
||||
|
||||
// parseMount parses an entry in /proc/[pid]/mountstats in the format:
|
||||
// device [device] mounted on [mount] with fstype [type]
|
||||
//
|
||||
// device [device] mounted on [mount] with fstype [type]
|
||||
func parseMount(ss []string) (*Mount, error) {
|
||||
if len(ss) < deviceEntryLen {
|
||||
return nil, fmt.Errorf("invalid device entry: %v", ss)
|
||||
|
|
|
@ -27,8 +27,9 @@ import (
|
|||
// For the proc file format details,
|
||||
// See:
|
||||
// * Linux 2.6.23 https://elixir.bootlin.com/linux/v2.6.23/source/net/core/dev.c#L2343
|
||||
// * Linux 4.17 https://elixir.bootlin.com/linux/v4.17/source/net/core/net-procfs.c#L162
|
||||
// and https://elixir.bootlin.com/linux/v4.17/source/include/linux/netdevice.h#L2810.
|
||||
// * Linux 2.6.39 https://elixir.bootlin.com/linux/v2.6.39/source/net/core/dev.c#L4086
|
||||
// * Linux 4.18 https://elixir.bootlin.com/linux/v4.18/source/net/core/net-procfs.c#L162
|
||||
// * Linux 5.14 https://elixir.bootlin.com/linux/v5.14/source/net/core/net-procfs.c#L169
|
||||
|
||||
// SoftnetStat contains a single row of data from /proc/net/softnet_stat.
|
||||
type SoftnetStat struct {
|
||||
|
@ -38,6 +39,18 @@ type SoftnetStat struct {
|
|||
Dropped uint32
|
||||
// Number of times processing packets ran out of quota.
|
||||
TimeSqueezed uint32
|
||||
// Number of collision occur while obtaining device lock while transmitting.
|
||||
CPUCollision uint32
|
||||
// Number of times cpu woken up received_rps.
|
||||
ReceivedRps uint32
|
||||
// number of times flow limit has been reached.
|
||||
FlowLimitCount uint32
|
||||
// Softnet backlog status.
|
||||
SoftnetBacklogLen uint32
|
||||
// CPU id owning this softnet_data.
|
||||
Index uint32
|
||||
// softnet_data's Width.
|
||||
Width int
|
||||
}
|
||||
|
||||
var softNetProcFile = "net/softnet_stat"
|
||||
|
@ -66,22 +79,57 @@ func parseSoftnet(r io.Reader) ([]SoftnetStat, error) {
|
|||
for s.Scan() {
|
||||
columns := strings.Fields(s.Text())
|
||||
width := len(columns)
|
||||
softnetStat := SoftnetStat{}
|
||||
|
||||
if width < minColumns {
|
||||
return nil, fmt.Errorf("%d columns were detected, but at least %d were expected", width, minColumns)
|
||||
}
|
||||
|
||||
// We only parse the first three columns at the moment.
|
||||
us, err := parseHexUint32s(columns[0:3])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
// Linux 2.6.23 https://elixir.bootlin.com/linux/v2.6.23/source/net/core/dev.c#L2347
|
||||
if width >= minColumns {
|
||||
us, err := parseHexUint32s(columns[0:9])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
softnetStat.Processed = us[0]
|
||||
softnetStat.Dropped = us[1]
|
||||
softnetStat.TimeSqueezed = us[2]
|
||||
softnetStat.CPUCollision = us[8]
|
||||
}
|
||||
|
||||
stats = append(stats, SoftnetStat{
|
||||
Processed: us[0],
|
||||
Dropped: us[1],
|
||||
TimeSqueezed: us[2],
|
||||
})
|
||||
// Linux 2.6.39 https://elixir.bootlin.com/linux/v2.6.39/source/net/core/dev.c#L4086
|
||||
if width >= 10 {
|
||||
us, err := parseHexUint32s(columns[9:10])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
softnetStat.ReceivedRps = us[0]
|
||||
}
|
||||
|
||||
// Linux 4.18 https://elixir.bootlin.com/linux/v4.18/source/net/core/net-procfs.c#L162
|
||||
if width >= 11 {
|
||||
us, err := parseHexUint32s(columns[10:11])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
softnetStat.FlowLimitCount = us[0]
|
||||
}
|
||||
|
||||
// Linux 5.14 https://elixir.bootlin.com/linux/v5.14/source/net/core/net-procfs.c#L169
|
||||
if width >= 13 {
|
||||
us, err := parseHexUint32s(columns[11:13])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
softnetStat.SoftnetBacklogLen = us[0]
|
||||
softnetStat.Index = us[1]
|
||||
}
|
||||
softnetStat.Width = width
|
||||
stats = append(stats, softnetStat)
|
||||
}
|
||||
|
||||
return stats, nil
|
||||
|
|
|
@ -15,6 +15,7 @@ package procfs
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
@ -42,27 +43,43 @@ func (fs FS) NetStat() ([]NetStat, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
netStatFile := NetStat{
|
||||
Filename: filepath.Base(filePath),
|
||||
Stats: make(map[string][]uint64),
|
||||
procNetstat, err := parseNetstat(file)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
scanner := bufio.NewScanner(file)
|
||||
scanner.Scan()
|
||||
// First string is always a header for stats
|
||||
var headers []string
|
||||
headers = append(headers, strings.Fields(scanner.Text())...)
|
||||
procNetstat.Filename = filepath.Base(filePath)
|
||||
|
||||
// Other strings represent per-CPU counters
|
||||
for scanner.Scan() {
|
||||
for num, counter := range strings.Fields(scanner.Text()) {
|
||||
value, err := strconv.ParseUint(counter, 16, 64)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
netStatFile.Stats[headers[num]] = append(netStatFile.Stats[headers[num]], value)
|
||||
}
|
||||
}
|
||||
netStatsTotal = append(netStatsTotal, netStatFile)
|
||||
netStatsTotal = append(netStatsTotal, procNetstat)
|
||||
}
|
||||
return netStatsTotal, nil
|
||||
}
|
||||
|
||||
// parseNetstat parses the metrics from `/proc/net/stat/` file
|
||||
// and returns a NetStat structure.
|
||||
func parseNetstat(r io.Reader) (NetStat, error) {
|
||||
var (
|
||||
scanner = bufio.NewScanner(r)
|
||||
netStat = NetStat{
|
||||
Stats: make(map[string][]uint64),
|
||||
}
|
||||
)
|
||||
|
||||
scanner.Scan()
|
||||
|
||||
// First string is always a header for stats
|
||||
var headers []string
|
||||
headers = append(headers, strings.Fields(scanner.Text())...)
|
||||
|
||||
// Other strings represent per-CPU counters
|
||||
for scanner.Scan() {
|
||||
for num, counter := range strings.Fields(scanner.Text()) {
|
||||
value, err := strconv.ParseUint(counter, 16, 64)
|
||||
if err != nil {
|
||||
return NetStat{}, err
|
||||
}
|
||||
netStat.Stats[headers[num]] = append(netStat.Stats[headers[num]], value)
|
||||
}
|
||||
}
|
||||
|
||||
return netStat, nil
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import (
|
|||
"github.com/prometheus/procfs/internal/util"
|
||||
)
|
||||
|
||||
// Cgroup models one line from /proc/[pid]/cgroup. Each Cgroup struct describes the the placement of a PID inside a
|
||||
// Cgroup models one line from /proc/[pid]/cgroup. Each Cgroup struct describes the placement of a PID inside a
|
||||
// specific control hierarchy. The kernel has two cgroup APIs, v1 and v2. v1 has one hierarchy per available resource
|
||||
// controller, while v2 has one unified hierarchy shared by all controllers. Regardless of v1 or v2, all hierarchies
|
||||
// contain all running processes, so the question answerable with a Cgroup struct is 'where is this process in
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
// Copyright 2022 The Prometheus Authors
|
||||
// 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.
|
||||
|
||||
package procfs
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/prometheus/procfs/internal/util"
|
||||
)
|
||||
|
||||
// Interrupt represents a single interrupt line.
|
||||
type Interrupt struct {
|
||||
// Info is the type of interrupt.
|
||||
Info string
|
||||
// Devices is the name of the device that is located at that IRQ
|
||||
Devices string
|
||||
// Values is the number of interrupts per CPU.
|
||||
Values []string
|
||||
}
|
||||
|
||||
// Interrupts models the content of /proc/interrupts. Key is the IRQ number.
|
||||
// - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s2-proc-interrupts
|
||||
// - https://raspberrypi.stackexchange.com/questions/105802/explanation-of-proc-interrupts-output
|
||||
type Interrupts map[string]Interrupt
|
||||
|
||||
// Interrupts creates a new instance from a given Proc instance.
|
||||
func (p Proc) Interrupts() (Interrupts, error) {
|
||||
data, err := util.ReadFileNoStat(p.path("interrupts"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return parseInterrupts(bytes.NewReader(data))
|
||||
}
|
||||
|
||||
func parseInterrupts(r io.Reader) (Interrupts, error) {
|
||||
var (
|
||||
interrupts = Interrupts{}
|
||||
scanner = bufio.NewScanner(r)
|
||||
)
|
||||
|
||||
if !scanner.Scan() {
|
||||
return nil, errors.New("interrupts empty")
|
||||
}
|
||||
cpuNum := len(strings.Fields(scanner.Text())) // one header per cpu
|
||||
|
||||
for scanner.Scan() {
|
||||
parts := strings.Fields(scanner.Text())
|
||||
if len(parts) == 0 { // skip empty lines
|
||||
continue
|
||||
}
|
||||
if len(parts) < 2 {
|
||||
return nil, fmt.Errorf("not enough fields in interrupts (expected at least 2 fields but got %d): %s", len(parts), parts)
|
||||
}
|
||||
intName := parts[0][:len(parts[0])-1] // remove trailing :
|
||||
|
||||
if len(parts) == 2 {
|
||||
interrupts[intName] = Interrupt{
|
||||
Info: "",
|
||||
Devices: "",
|
||||
Values: []string{
|
||||
parts[1],
|
||||
},
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
intr := Interrupt{
|
||||
Values: parts[1 : cpuNum+1],
|
||||
}
|
||||
|
||||
if _, err := strconv.Atoi(intName); err == nil { // numeral interrupt
|
||||
intr.Info = parts[cpuNum+1]
|
||||
intr.Devices = strings.Join(parts[cpuNum+2:], " ")
|
||||
} else {
|
||||
intr.Info = strings.Join(parts[cpuNum+1:], " ")
|
||||
}
|
||||
interrupts[intName] = intr
|
||||
}
|
||||
|
||||
return interrupts, scanner.Err()
|
||||
}
|
|
@ -33,139 +33,140 @@ type ProcNetstat struct {
|
|||
}
|
||||
|
||||
type TcpExt struct { // nolint:revive
|
||||
SyncookiesSent float64
|
||||
SyncookiesRecv float64
|
||||
SyncookiesFailed float64
|
||||
EmbryonicRsts float64
|
||||
PruneCalled float64
|
||||
RcvPruned float64
|
||||
OfoPruned float64
|
||||
OutOfWindowIcmps float64
|
||||
LockDroppedIcmps float64
|
||||
ArpFilter float64
|
||||
TW float64
|
||||
TWRecycled float64
|
||||
TWKilled float64
|
||||
PAWSActive float64
|
||||
PAWSEstab float64
|
||||
DelayedACKs float64
|
||||
DelayedACKLocked float64
|
||||
DelayedACKLost float64
|
||||
ListenOverflows float64
|
||||
ListenDrops float64
|
||||
TCPHPHits float64
|
||||
TCPPureAcks float64
|
||||
TCPHPAcks float64
|
||||
TCPRenoRecovery float64
|
||||
TCPSackRecovery float64
|
||||
TCPSACKReneging float64
|
||||
TCPSACKReorder float64
|
||||
TCPRenoReorder float64
|
||||
TCPTSReorder float64
|
||||
TCPFullUndo float64
|
||||
TCPPartialUndo float64
|
||||
TCPDSACKUndo float64
|
||||
TCPLossUndo float64
|
||||
TCPLostRetransmit float64
|
||||
TCPRenoFailures float64
|
||||
TCPSackFailures float64
|
||||
TCPLossFailures float64
|
||||
TCPFastRetrans float64
|
||||
TCPSlowStartRetrans float64
|
||||
TCPTimeouts float64
|
||||
TCPLossProbes float64
|
||||
TCPLossProbeRecovery float64
|
||||
TCPRenoRecoveryFail float64
|
||||
TCPSackRecoveryFail float64
|
||||
TCPRcvCollapsed float64
|
||||
TCPDSACKOldSent float64
|
||||
TCPDSACKOfoSent float64
|
||||
TCPDSACKRecv float64
|
||||
TCPDSACKOfoRecv float64
|
||||
TCPAbortOnData float64
|
||||
TCPAbortOnClose float64
|
||||
TCPAbortOnMemory float64
|
||||
TCPAbortOnTimeout float64
|
||||
TCPAbortOnLinger float64
|
||||
TCPAbortFailed float64
|
||||
TCPMemoryPressures float64
|
||||
TCPMemoryPressuresChrono float64
|
||||
TCPSACKDiscard float64
|
||||
TCPDSACKIgnoredOld float64
|
||||
TCPDSACKIgnoredNoUndo float64
|
||||
TCPSpuriousRTOs float64
|
||||
TCPMD5NotFound float64
|
||||
TCPMD5Unexpected float64
|
||||
TCPMD5Failure float64
|
||||
TCPSackShifted float64
|
||||
TCPSackMerged float64
|
||||
TCPSackShiftFallback float64
|
||||
TCPBacklogDrop float64
|
||||
PFMemallocDrop float64
|
||||
TCPMinTTLDrop float64
|
||||
TCPDeferAcceptDrop float64
|
||||
IPReversePathFilter float64
|
||||
TCPTimeWaitOverflow float64
|
||||
TCPReqQFullDoCookies float64
|
||||
TCPReqQFullDrop float64
|
||||
TCPRetransFail float64
|
||||
TCPRcvCoalesce float64
|
||||
TCPOFOQueue float64
|
||||
TCPOFODrop float64
|
||||
TCPOFOMerge float64
|
||||
TCPChallengeACK float64
|
||||
TCPSYNChallenge float64
|
||||
TCPFastOpenActive float64
|
||||
TCPFastOpenActiveFail float64
|
||||
TCPFastOpenPassive float64
|
||||
TCPFastOpenPassiveFail float64
|
||||
TCPFastOpenListenOverflow float64
|
||||
TCPFastOpenCookieReqd float64
|
||||
TCPFastOpenBlackhole float64
|
||||
TCPSpuriousRtxHostQueues float64
|
||||
BusyPollRxPackets float64
|
||||
TCPAutoCorking float64
|
||||
TCPFromZeroWindowAdv float64
|
||||
TCPToZeroWindowAdv float64
|
||||
TCPWantZeroWindowAdv float64
|
||||
TCPSynRetrans float64
|
||||
TCPOrigDataSent float64
|
||||
TCPHystartTrainDetect float64
|
||||
TCPHystartTrainCwnd float64
|
||||
TCPHystartDelayDetect float64
|
||||
TCPHystartDelayCwnd float64
|
||||
TCPACKSkippedSynRecv float64
|
||||
TCPACKSkippedPAWS float64
|
||||
TCPACKSkippedSeq float64
|
||||
TCPACKSkippedFinWait2 float64
|
||||
TCPACKSkippedTimeWait float64
|
||||
TCPACKSkippedChallenge float64
|
||||
TCPWinProbe float64
|
||||
TCPKeepAlive float64
|
||||
TCPMTUPFail float64
|
||||
TCPMTUPSuccess float64
|
||||
TCPWqueueTooBig float64
|
||||
SyncookiesSent *float64
|
||||
SyncookiesRecv *float64
|
||||
SyncookiesFailed *float64
|
||||
EmbryonicRsts *float64
|
||||
PruneCalled *float64
|
||||
RcvPruned *float64
|
||||
OfoPruned *float64
|
||||
OutOfWindowIcmps *float64
|
||||
LockDroppedIcmps *float64
|
||||
ArpFilter *float64
|
||||
TW *float64
|
||||
TWRecycled *float64
|
||||
TWKilled *float64
|
||||
PAWSActive *float64
|
||||
PAWSEstab *float64
|
||||
DelayedACKs *float64
|
||||
DelayedACKLocked *float64
|
||||
DelayedACKLost *float64
|
||||
ListenOverflows *float64
|
||||
ListenDrops *float64
|
||||
TCPHPHits *float64
|
||||
TCPPureAcks *float64
|
||||
TCPHPAcks *float64
|
||||
TCPRenoRecovery *float64
|
||||
TCPSackRecovery *float64
|
||||
TCPSACKReneging *float64
|
||||
TCPSACKReorder *float64
|
||||
TCPRenoReorder *float64
|
||||
TCPTSReorder *float64
|
||||
TCPFullUndo *float64
|
||||
TCPPartialUndo *float64
|
||||
TCPDSACKUndo *float64
|
||||
TCPLossUndo *float64
|
||||
TCPLostRetransmit *float64
|
||||
TCPRenoFailures *float64
|
||||
TCPSackFailures *float64
|
||||
TCPLossFailures *float64
|
||||
TCPFastRetrans *float64
|
||||
TCPSlowStartRetrans *float64
|
||||
TCPTimeouts *float64
|
||||
TCPLossProbes *float64
|
||||
TCPLossProbeRecovery *float64
|
||||
TCPRenoRecoveryFail *float64
|
||||
TCPSackRecoveryFail *float64
|
||||
TCPRcvCollapsed *float64
|
||||
TCPDSACKOldSent *float64
|
||||
TCPDSACKOfoSent *float64
|
||||
TCPDSACKRecv *float64
|
||||
TCPDSACKOfoRecv *float64
|
||||
TCPAbortOnData *float64
|
||||
TCPAbortOnClose *float64
|
||||
TCPAbortOnMemory *float64
|
||||
TCPAbortOnTimeout *float64
|
||||
TCPAbortOnLinger *float64
|
||||
TCPAbortFailed *float64
|
||||
TCPMemoryPressures *float64
|
||||
TCPMemoryPressuresChrono *float64
|
||||
TCPSACKDiscard *float64
|
||||
TCPDSACKIgnoredOld *float64
|
||||
TCPDSACKIgnoredNoUndo *float64
|
||||
TCPSpuriousRTOs *float64
|
||||
TCPMD5NotFound *float64
|
||||
TCPMD5Unexpected *float64
|
||||
TCPMD5Failure *float64
|
||||
TCPSackShifted *float64
|
||||
TCPSackMerged *float64
|
||||
TCPSackShiftFallback *float64
|
||||
TCPBacklogDrop *float64
|
||||
PFMemallocDrop *float64
|
||||
TCPMinTTLDrop *float64
|
||||
TCPDeferAcceptDrop *float64
|
||||
IPReversePathFilter *float64
|
||||
TCPTimeWaitOverflow *float64
|
||||
TCPReqQFullDoCookies *float64
|
||||
TCPReqQFullDrop *float64
|
||||
TCPRetransFail *float64
|
||||
TCPRcvCoalesce *float64
|
||||
TCPRcvQDrop *float64
|
||||
TCPOFOQueue *float64
|
||||
TCPOFODrop *float64
|
||||
TCPOFOMerge *float64
|
||||
TCPChallengeACK *float64
|
||||
TCPSYNChallenge *float64
|
||||
TCPFastOpenActive *float64
|
||||
TCPFastOpenActiveFail *float64
|
||||
TCPFastOpenPassive *float64
|
||||
TCPFastOpenPassiveFail *float64
|
||||
TCPFastOpenListenOverflow *float64
|
||||
TCPFastOpenCookieReqd *float64
|
||||
TCPFastOpenBlackhole *float64
|
||||
TCPSpuriousRtxHostQueues *float64
|
||||
BusyPollRxPackets *float64
|
||||
TCPAutoCorking *float64
|
||||
TCPFromZeroWindowAdv *float64
|
||||
TCPToZeroWindowAdv *float64
|
||||
TCPWantZeroWindowAdv *float64
|
||||
TCPSynRetrans *float64
|
||||
TCPOrigDataSent *float64
|
||||
TCPHystartTrainDetect *float64
|
||||
TCPHystartTrainCwnd *float64
|
||||
TCPHystartDelayDetect *float64
|
||||
TCPHystartDelayCwnd *float64
|
||||
TCPACKSkippedSynRecv *float64
|
||||
TCPACKSkippedPAWS *float64
|
||||
TCPACKSkippedSeq *float64
|
||||
TCPACKSkippedFinWait2 *float64
|
||||
TCPACKSkippedTimeWait *float64
|
||||
TCPACKSkippedChallenge *float64
|
||||
TCPWinProbe *float64
|
||||
TCPKeepAlive *float64
|
||||
TCPMTUPFail *float64
|
||||
TCPMTUPSuccess *float64
|
||||
TCPWqueueTooBig *float64
|
||||
}
|
||||
|
||||
type IpExt struct { // nolint:revive
|
||||
InNoRoutes float64
|
||||
InTruncatedPkts float64
|
||||
InMcastPkts float64
|
||||
OutMcastPkts float64
|
||||
InBcastPkts float64
|
||||
OutBcastPkts float64
|
||||
InOctets float64
|
||||
OutOctets float64
|
||||
InMcastOctets float64
|
||||
OutMcastOctets float64
|
||||
InBcastOctets float64
|
||||
OutBcastOctets float64
|
||||
InCsumErrors float64
|
||||
InNoECTPkts float64
|
||||
InECT1Pkts float64
|
||||
InECT0Pkts float64
|
||||
InCEPkts float64
|
||||
ReasmOverlaps float64
|
||||
InNoRoutes *float64
|
||||
InTruncatedPkts *float64
|
||||
InMcastPkts *float64
|
||||
OutMcastPkts *float64
|
||||
InBcastPkts *float64
|
||||
OutBcastPkts *float64
|
||||
InOctets *float64
|
||||
OutOctets *float64
|
||||
InMcastOctets *float64
|
||||
OutMcastOctets *float64
|
||||
InBcastOctets *float64
|
||||
OutBcastOctets *float64
|
||||
InCsumErrors *float64
|
||||
InNoECTPkts *float64
|
||||
InECT1Pkts *float64
|
||||
InECT0Pkts *float64
|
||||
InCEPkts *float64
|
||||
ReasmOverlaps *float64
|
||||
}
|
||||
|
||||
func (p Proc) Netstat() (ProcNetstat, error) {
|
||||
|
@ -174,14 +175,14 @@ func (p Proc) Netstat() (ProcNetstat, error) {
|
|||
if err != nil {
|
||||
return ProcNetstat{PID: p.PID}, err
|
||||
}
|
||||
procNetstat, err := parseNetstat(bytes.NewReader(data), filename)
|
||||
procNetstat, err := parseProcNetstat(bytes.NewReader(data), filename)
|
||||
procNetstat.PID = p.PID
|
||||
return procNetstat, err
|
||||
}
|
||||
|
||||
// parseNetstat parses the metrics from proc/<pid>/net/netstat file
|
||||
// parseProcNetstat parses the metrics from proc/<pid>/net/netstat file
|
||||
// and returns a ProcNetstat structure.
|
||||
func parseNetstat(r io.Reader, fileName string) (ProcNetstat, error) {
|
||||
func parseProcNetstat(r io.Reader, fileName string) (ProcNetstat, error) {
|
||||
var (
|
||||
scanner = bufio.NewScanner(r)
|
||||
procNetstat = ProcNetstat{}
|
||||
|
@ -208,230 +209,232 @@ func parseNetstat(r io.Reader, fileName string) (ProcNetstat, error) {
|
|||
case "TcpExt":
|
||||
switch key {
|
||||
case "SyncookiesSent":
|
||||
procNetstat.TcpExt.SyncookiesSent = value
|
||||
procNetstat.TcpExt.SyncookiesSent = &value
|
||||
case "SyncookiesRecv":
|
||||
procNetstat.TcpExt.SyncookiesRecv = value
|
||||
procNetstat.TcpExt.SyncookiesRecv = &value
|
||||
case "SyncookiesFailed":
|
||||
procNetstat.TcpExt.SyncookiesFailed = value
|
||||
procNetstat.TcpExt.SyncookiesFailed = &value
|
||||
case "EmbryonicRsts":
|
||||
procNetstat.TcpExt.EmbryonicRsts = value
|
||||
procNetstat.TcpExt.EmbryonicRsts = &value
|
||||
case "PruneCalled":
|
||||
procNetstat.TcpExt.PruneCalled = value
|
||||
procNetstat.TcpExt.PruneCalled = &value
|
||||
case "RcvPruned":
|
||||
procNetstat.TcpExt.RcvPruned = value
|
||||
procNetstat.TcpExt.RcvPruned = &value
|
||||
case "OfoPruned":
|
||||
procNetstat.TcpExt.OfoPruned = value
|
||||
procNetstat.TcpExt.OfoPruned = &value
|
||||
case "OutOfWindowIcmps":
|
||||
procNetstat.TcpExt.OutOfWindowIcmps = value
|
||||
procNetstat.TcpExt.OutOfWindowIcmps = &value
|
||||
case "LockDroppedIcmps":
|
||||
procNetstat.TcpExt.LockDroppedIcmps = value
|
||||
procNetstat.TcpExt.LockDroppedIcmps = &value
|
||||
case "ArpFilter":
|
||||
procNetstat.TcpExt.ArpFilter = value
|
||||
procNetstat.TcpExt.ArpFilter = &value
|
||||
case "TW":
|
||||
procNetstat.TcpExt.TW = value
|
||||
procNetstat.TcpExt.TW = &value
|
||||
case "TWRecycled":
|
||||
procNetstat.TcpExt.TWRecycled = value
|
||||
procNetstat.TcpExt.TWRecycled = &value
|
||||
case "TWKilled":
|
||||
procNetstat.TcpExt.TWKilled = value
|
||||
procNetstat.TcpExt.TWKilled = &value
|
||||
case "PAWSActive":
|
||||
procNetstat.TcpExt.PAWSActive = value
|
||||
procNetstat.TcpExt.PAWSActive = &value
|
||||
case "PAWSEstab":
|
||||
procNetstat.TcpExt.PAWSEstab = value
|
||||
procNetstat.TcpExt.PAWSEstab = &value
|
||||
case "DelayedACKs":
|
||||
procNetstat.TcpExt.DelayedACKs = value
|
||||
procNetstat.TcpExt.DelayedACKs = &value
|
||||
case "DelayedACKLocked":
|
||||
procNetstat.TcpExt.DelayedACKLocked = value
|
||||
procNetstat.TcpExt.DelayedACKLocked = &value
|
||||
case "DelayedACKLost":
|
||||
procNetstat.TcpExt.DelayedACKLost = value
|
||||
procNetstat.TcpExt.DelayedACKLost = &value
|
||||
case "ListenOverflows":
|
||||
procNetstat.TcpExt.ListenOverflows = value
|
||||
procNetstat.TcpExt.ListenOverflows = &value
|
||||
case "ListenDrops":
|
||||
procNetstat.TcpExt.ListenDrops = value
|
||||
procNetstat.TcpExt.ListenDrops = &value
|
||||
case "TCPHPHits":
|
||||
procNetstat.TcpExt.TCPHPHits = value
|
||||
procNetstat.TcpExt.TCPHPHits = &value
|
||||
case "TCPPureAcks":
|
||||
procNetstat.TcpExt.TCPPureAcks = value
|
||||
procNetstat.TcpExt.TCPPureAcks = &value
|
||||
case "TCPHPAcks":
|
||||
procNetstat.TcpExt.TCPHPAcks = value
|
||||
procNetstat.TcpExt.TCPHPAcks = &value
|
||||
case "TCPRenoRecovery":
|
||||
procNetstat.TcpExt.TCPRenoRecovery = value
|
||||
procNetstat.TcpExt.TCPRenoRecovery = &value
|
||||
case "TCPSackRecovery":
|
||||
procNetstat.TcpExt.TCPSackRecovery = value
|
||||
procNetstat.TcpExt.TCPSackRecovery = &value
|
||||
case "TCPSACKReneging":
|
||||
procNetstat.TcpExt.TCPSACKReneging = value
|
||||
procNetstat.TcpExt.TCPSACKReneging = &value
|
||||
case "TCPSACKReorder":
|
||||
procNetstat.TcpExt.TCPSACKReorder = value
|
||||
procNetstat.TcpExt.TCPSACKReorder = &value
|
||||
case "TCPRenoReorder":
|
||||
procNetstat.TcpExt.TCPRenoReorder = value
|
||||
procNetstat.TcpExt.TCPRenoReorder = &value
|
||||
case "TCPTSReorder":
|
||||
procNetstat.TcpExt.TCPTSReorder = value
|
||||
procNetstat.TcpExt.TCPTSReorder = &value
|
||||
case "TCPFullUndo":
|
||||
procNetstat.TcpExt.TCPFullUndo = value
|
||||
procNetstat.TcpExt.TCPFullUndo = &value
|
||||
case "TCPPartialUndo":
|
||||
procNetstat.TcpExt.TCPPartialUndo = value
|
||||
procNetstat.TcpExt.TCPPartialUndo = &value
|
||||
case "TCPDSACKUndo":
|
||||
procNetstat.TcpExt.TCPDSACKUndo = value
|
||||
procNetstat.TcpExt.TCPDSACKUndo = &value
|
||||
case "TCPLossUndo":
|
||||
procNetstat.TcpExt.TCPLossUndo = value
|
||||
procNetstat.TcpExt.TCPLossUndo = &value
|
||||
case "TCPLostRetransmit":
|
||||
procNetstat.TcpExt.TCPLostRetransmit = value
|
||||
procNetstat.TcpExt.TCPLostRetransmit = &value
|
||||
case "TCPRenoFailures":
|
||||
procNetstat.TcpExt.TCPRenoFailures = value
|
||||
procNetstat.TcpExt.TCPRenoFailures = &value
|
||||
case "TCPSackFailures":
|
||||
procNetstat.TcpExt.TCPSackFailures = value
|
||||
procNetstat.TcpExt.TCPSackFailures = &value
|
||||
case "TCPLossFailures":
|
||||
procNetstat.TcpExt.TCPLossFailures = value
|
||||
procNetstat.TcpExt.TCPLossFailures = &value
|
||||
case "TCPFastRetrans":
|
||||
procNetstat.TcpExt.TCPFastRetrans = value
|
||||
procNetstat.TcpExt.TCPFastRetrans = &value
|
||||
case "TCPSlowStartRetrans":
|
||||
procNetstat.TcpExt.TCPSlowStartRetrans = value
|
||||
procNetstat.TcpExt.TCPSlowStartRetrans = &value
|
||||
case "TCPTimeouts":
|
||||
procNetstat.TcpExt.TCPTimeouts = value
|
||||
procNetstat.TcpExt.TCPTimeouts = &value
|
||||
case "TCPLossProbes":
|
||||
procNetstat.TcpExt.TCPLossProbes = value
|
||||
procNetstat.TcpExt.TCPLossProbes = &value
|
||||
case "TCPLossProbeRecovery":
|
||||
procNetstat.TcpExt.TCPLossProbeRecovery = value
|
||||
procNetstat.TcpExt.TCPLossProbeRecovery = &value
|
||||
case "TCPRenoRecoveryFail":
|
||||
procNetstat.TcpExt.TCPRenoRecoveryFail = value
|
||||
procNetstat.TcpExt.TCPRenoRecoveryFail = &value
|
||||
case "TCPSackRecoveryFail":
|
||||
procNetstat.TcpExt.TCPSackRecoveryFail = value
|
||||
procNetstat.TcpExt.TCPSackRecoveryFail = &value
|
||||
case "TCPRcvCollapsed":
|
||||
procNetstat.TcpExt.TCPRcvCollapsed = value
|
||||
procNetstat.TcpExt.TCPRcvCollapsed = &value
|
||||
case "TCPDSACKOldSent":
|
||||
procNetstat.TcpExt.TCPDSACKOldSent = value
|
||||
procNetstat.TcpExt.TCPDSACKOldSent = &value
|
||||
case "TCPDSACKOfoSent":
|
||||
procNetstat.TcpExt.TCPDSACKOfoSent = value
|
||||
procNetstat.TcpExt.TCPDSACKOfoSent = &value
|
||||
case "TCPDSACKRecv":
|
||||
procNetstat.TcpExt.TCPDSACKRecv = value
|
||||
procNetstat.TcpExt.TCPDSACKRecv = &value
|
||||
case "TCPDSACKOfoRecv":
|
||||
procNetstat.TcpExt.TCPDSACKOfoRecv = value
|
||||
procNetstat.TcpExt.TCPDSACKOfoRecv = &value
|
||||
case "TCPAbortOnData":
|
||||
procNetstat.TcpExt.TCPAbortOnData = value
|
||||
procNetstat.TcpExt.TCPAbortOnData = &value
|
||||
case "TCPAbortOnClose":
|
||||
procNetstat.TcpExt.TCPAbortOnClose = value
|
||||
procNetstat.TcpExt.TCPAbortOnClose = &value
|
||||
case "TCPDeferAcceptDrop":
|
||||
procNetstat.TcpExt.TCPDeferAcceptDrop = value
|
||||
procNetstat.TcpExt.TCPDeferAcceptDrop = &value
|
||||
case "IPReversePathFilter":
|
||||
procNetstat.TcpExt.IPReversePathFilter = value
|
||||
procNetstat.TcpExt.IPReversePathFilter = &value
|
||||
case "TCPTimeWaitOverflow":
|
||||
procNetstat.TcpExt.TCPTimeWaitOverflow = value
|
||||
procNetstat.TcpExt.TCPTimeWaitOverflow = &value
|
||||
case "TCPReqQFullDoCookies":
|
||||
procNetstat.TcpExt.TCPReqQFullDoCookies = value
|
||||
procNetstat.TcpExt.TCPReqQFullDoCookies = &value
|
||||
case "TCPReqQFullDrop":
|
||||
procNetstat.TcpExt.TCPReqQFullDrop = value
|
||||
procNetstat.TcpExt.TCPReqQFullDrop = &value
|
||||
case "TCPRetransFail":
|
||||
procNetstat.TcpExt.TCPRetransFail = value
|
||||
procNetstat.TcpExt.TCPRetransFail = &value
|
||||
case "TCPRcvCoalesce":
|
||||
procNetstat.TcpExt.TCPRcvCoalesce = value
|
||||
procNetstat.TcpExt.TCPRcvCoalesce = &value
|
||||
case "TCPRcvQDrop":
|
||||
procNetstat.TcpExt.TCPRcvQDrop = &value
|
||||
case "TCPOFOQueue":
|
||||
procNetstat.TcpExt.TCPOFOQueue = value
|
||||
procNetstat.TcpExt.TCPOFOQueue = &value
|
||||
case "TCPOFODrop":
|
||||
procNetstat.TcpExt.TCPOFODrop = value
|
||||
procNetstat.TcpExt.TCPOFODrop = &value
|
||||
case "TCPOFOMerge":
|
||||
procNetstat.TcpExt.TCPOFOMerge = value
|
||||
procNetstat.TcpExt.TCPOFOMerge = &value
|
||||
case "TCPChallengeACK":
|
||||
procNetstat.TcpExt.TCPChallengeACK = value
|
||||
procNetstat.TcpExt.TCPChallengeACK = &value
|
||||
case "TCPSYNChallenge":
|
||||
procNetstat.TcpExt.TCPSYNChallenge = value
|
||||
procNetstat.TcpExt.TCPSYNChallenge = &value
|
||||
case "TCPFastOpenActive":
|
||||
procNetstat.TcpExt.TCPFastOpenActive = value
|
||||
procNetstat.TcpExt.TCPFastOpenActive = &value
|
||||
case "TCPFastOpenActiveFail":
|
||||
procNetstat.TcpExt.TCPFastOpenActiveFail = value
|
||||
procNetstat.TcpExt.TCPFastOpenActiveFail = &value
|
||||
case "TCPFastOpenPassive":
|
||||
procNetstat.TcpExt.TCPFastOpenPassive = value
|
||||
procNetstat.TcpExt.TCPFastOpenPassive = &value
|
||||
case "TCPFastOpenPassiveFail":
|
||||
procNetstat.TcpExt.TCPFastOpenPassiveFail = value
|
||||
procNetstat.TcpExt.TCPFastOpenPassiveFail = &value
|
||||
case "TCPFastOpenListenOverflow":
|
||||
procNetstat.TcpExt.TCPFastOpenListenOverflow = value
|
||||
procNetstat.TcpExt.TCPFastOpenListenOverflow = &value
|
||||
case "TCPFastOpenCookieReqd":
|
||||
procNetstat.TcpExt.TCPFastOpenCookieReqd = value
|
||||
procNetstat.TcpExt.TCPFastOpenCookieReqd = &value
|
||||
case "TCPFastOpenBlackhole":
|
||||
procNetstat.TcpExt.TCPFastOpenBlackhole = value
|
||||
procNetstat.TcpExt.TCPFastOpenBlackhole = &value
|
||||
case "TCPSpuriousRtxHostQueues":
|
||||
procNetstat.TcpExt.TCPSpuriousRtxHostQueues = value
|
||||
procNetstat.TcpExt.TCPSpuriousRtxHostQueues = &value
|
||||
case "BusyPollRxPackets":
|
||||
procNetstat.TcpExt.BusyPollRxPackets = value
|
||||
procNetstat.TcpExt.BusyPollRxPackets = &value
|
||||
case "TCPAutoCorking":
|
||||
procNetstat.TcpExt.TCPAutoCorking = value
|
||||
procNetstat.TcpExt.TCPAutoCorking = &value
|
||||
case "TCPFromZeroWindowAdv":
|
||||
procNetstat.TcpExt.TCPFromZeroWindowAdv = value
|
||||
procNetstat.TcpExt.TCPFromZeroWindowAdv = &value
|
||||
case "TCPToZeroWindowAdv":
|
||||
procNetstat.TcpExt.TCPToZeroWindowAdv = value
|
||||
procNetstat.TcpExt.TCPToZeroWindowAdv = &value
|
||||
case "TCPWantZeroWindowAdv":
|
||||
procNetstat.TcpExt.TCPWantZeroWindowAdv = value
|
||||
procNetstat.TcpExt.TCPWantZeroWindowAdv = &value
|
||||
case "TCPSynRetrans":
|
||||
procNetstat.TcpExt.TCPSynRetrans = value
|
||||
procNetstat.TcpExt.TCPSynRetrans = &value
|
||||
case "TCPOrigDataSent":
|
||||
procNetstat.TcpExt.TCPOrigDataSent = value
|
||||
procNetstat.TcpExt.TCPOrigDataSent = &value
|
||||
case "TCPHystartTrainDetect":
|
||||
procNetstat.TcpExt.TCPHystartTrainDetect = value
|
||||
procNetstat.TcpExt.TCPHystartTrainDetect = &value
|
||||
case "TCPHystartTrainCwnd":
|
||||
procNetstat.TcpExt.TCPHystartTrainCwnd = value
|
||||
procNetstat.TcpExt.TCPHystartTrainCwnd = &value
|
||||
case "TCPHystartDelayDetect":
|
||||
procNetstat.TcpExt.TCPHystartDelayDetect = value
|
||||
procNetstat.TcpExt.TCPHystartDelayDetect = &value
|
||||
case "TCPHystartDelayCwnd":
|
||||
procNetstat.TcpExt.TCPHystartDelayCwnd = value
|
||||
procNetstat.TcpExt.TCPHystartDelayCwnd = &value
|
||||
case "TCPACKSkippedSynRecv":
|
||||
procNetstat.TcpExt.TCPACKSkippedSynRecv = value
|
||||
procNetstat.TcpExt.TCPACKSkippedSynRecv = &value
|
||||
case "TCPACKSkippedPAWS":
|
||||
procNetstat.TcpExt.TCPACKSkippedPAWS = value
|
||||
procNetstat.TcpExt.TCPACKSkippedPAWS = &value
|
||||
case "TCPACKSkippedSeq":
|
||||
procNetstat.TcpExt.TCPACKSkippedSeq = value
|
||||
procNetstat.TcpExt.TCPACKSkippedSeq = &value
|
||||
case "TCPACKSkippedFinWait2":
|
||||
procNetstat.TcpExt.TCPACKSkippedFinWait2 = value
|
||||
procNetstat.TcpExt.TCPACKSkippedFinWait2 = &value
|
||||
case "TCPACKSkippedTimeWait":
|
||||
procNetstat.TcpExt.TCPACKSkippedTimeWait = value
|
||||
procNetstat.TcpExt.TCPACKSkippedTimeWait = &value
|
||||
case "TCPACKSkippedChallenge":
|
||||
procNetstat.TcpExt.TCPACKSkippedChallenge = value
|
||||
procNetstat.TcpExt.TCPACKSkippedChallenge = &value
|
||||
case "TCPWinProbe":
|
||||
procNetstat.TcpExt.TCPWinProbe = value
|
||||
procNetstat.TcpExt.TCPWinProbe = &value
|
||||
case "TCPKeepAlive":
|
||||
procNetstat.TcpExt.TCPKeepAlive = value
|
||||
procNetstat.TcpExt.TCPKeepAlive = &value
|
||||
case "TCPMTUPFail":
|
||||
procNetstat.TcpExt.TCPMTUPFail = value
|
||||
procNetstat.TcpExt.TCPMTUPFail = &value
|
||||
case "TCPMTUPSuccess":
|
||||
procNetstat.TcpExt.TCPMTUPSuccess = value
|
||||
procNetstat.TcpExt.TCPMTUPSuccess = &value
|
||||
case "TCPWqueueTooBig":
|
||||
procNetstat.TcpExt.TCPWqueueTooBig = value
|
||||
procNetstat.TcpExt.TCPWqueueTooBig = &value
|
||||
}
|
||||
case "IpExt":
|
||||
switch key {
|
||||
case "InNoRoutes":
|
||||
procNetstat.IpExt.InNoRoutes = value
|
||||
procNetstat.IpExt.InNoRoutes = &value
|
||||
case "InTruncatedPkts":
|
||||
procNetstat.IpExt.InTruncatedPkts = value
|
||||
procNetstat.IpExt.InTruncatedPkts = &value
|
||||
case "InMcastPkts":
|
||||
procNetstat.IpExt.InMcastPkts = value
|
||||
procNetstat.IpExt.InMcastPkts = &value
|
||||
case "OutMcastPkts":
|
||||
procNetstat.IpExt.OutMcastPkts = value
|
||||
procNetstat.IpExt.OutMcastPkts = &value
|
||||
case "InBcastPkts":
|
||||
procNetstat.IpExt.InBcastPkts = value
|
||||
procNetstat.IpExt.InBcastPkts = &value
|
||||
case "OutBcastPkts":
|
||||
procNetstat.IpExt.OutBcastPkts = value
|
||||
procNetstat.IpExt.OutBcastPkts = &value
|
||||
case "InOctets":
|
||||
procNetstat.IpExt.InOctets = value
|
||||
procNetstat.IpExt.InOctets = &value
|
||||
case "OutOctets":
|
||||
procNetstat.IpExt.OutOctets = value
|
||||
procNetstat.IpExt.OutOctets = &value
|
||||
case "InMcastOctets":
|
||||
procNetstat.IpExt.InMcastOctets = value
|
||||
procNetstat.IpExt.InMcastOctets = &value
|
||||
case "OutMcastOctets":
|
||||
procNetstat.IpExt.OutMcastOctets = value
|
||||
procNetstat.IpExt.OutMcastOctets = &value
|
||||
case "InBcastOctets":
|
||||
procNetstat.IpExt.InBcastOctets = value
|
||||
procNetstat.IpExt.InBcastOctets = &value
|
||||
case "OutBcastOctets":
|
||||
procNetstat.IpExt.OutBcastOctets = value
|
||||
procNetstat.IpExt.OutBcastOctets = &value
|
||||
case "InCsumErrors":
|
||||
procNetstat.IpExt.InCsumErrors = value
|
||||
procNetstat.IpExt.InCsumErrors = &value
|
||||
case "InNoECTPkts":
|
||||
procNetstat.IpExt.InNoECTPkts = value
|
||||
procNetstat.IpExt.InNoECTPkts = &value
|
||||
case "InECT1Pkts":
|
||||
procNetstat.IpExt.InECT1Pkts = value
|
||||
procNetstat.IpExt.InECT1Pkts = &value
|
||||
case "InECT0Pkts":
|
||||
procNetstat.IpExt.InECT0Pkts = value
|
||||
procNetstat.IpExt.InECT0Pkts = &value
|
||||
case "InCEPkts":
|
||||
procNetstat.IpExt.InCEPkts = value
|
||||
procNetstat.IpExt.InCEPkts = &value
|
||||
case "ReasmOverlaps":
|
||||
procNetstat.IpExt.ReasmOverlaps = value
|
||||
procNetstat.IpExt.ReasmOverlaps = &value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,100 +37,100 @@ type ProcSnmp struct {
|
|||
}
|
||||
|
||||
type Ip struct { // nolint:revive
|
||||
Forwarding float64
|
||||
DefaultTTL float64
|
||||
InReceives float64
|
||||
InHdrErrors float64
|
||||
InAddrErrors float64
|
||||
ForwDatagrams float64
|
||||
InUnknownProtos float64
|
||||
InDiscards float64
|
||||
InDelivers float64
|
||||
OutRequests float64
|
||||
OutDiscards float64
|
||||
OutNoRoutes float64
|
||||
ReasmTimeout float64
|
||||
ReasmReqds float64
|
||||
ReasmOKs float64
|
||||
ReasmFails float64
|
||||
FragOKs float64
|
||||
FragFails float64
|
||||
FragCreates float64
|
||||
Forwarding *float64
|
||||
DefaultTTL *float64
|
||||
InReceives *float64
|
||||
InHdrErrors *float64
|
||||
InAddrErrors *float64
|
||||
ForwDatagrams *float64
|
||||
InUnknownProtos *float64
|
||||
InDiscards *float64
|
||||
InDelivers *float64
|
||||
OutRequests *float64
|
||||
OutDiscards *float64
|
||||
OutNoRoutes *float64
|
||||
ReasmTimeout *float64
|
||||
ReasmReqds *float64
|
||||
ReasmOKs *float64
|
||||
ReasmFails *float64
|
||||
FragOKs *float64
|
||||
FragFails *float64
|
||||
FragCreates *float64
|
||||
}
|
||||
|
||||
type Icmp struct {
|
||||
InMsgs float64
|
||||
InErrors float64
|
||||
InCsumErrors float64
|
||||
InDestUnreachs float64
|
||||
InTimeExcds float64
|
||||
InParmProbs float64
|
||||
InSrcQuenchs float64
|
||||
InRedirects float64
|
||||
InEchos float64
|
||||
InEchoReps float64
|
||||
InTimestamps float64
|
||||
InTimestampReps float64
|
||||
InAddrMasks float64
|
||||
InAddrMaskReps float64
|
||||
OutMsgs float64
|
||||
OutErrors float64
|
||||
OutDestUnreachs float64
|
||||
OutTimeExcds float64
|
||||
OutParmProbs float64
|
||||
OutSrcQuenchs float64
|
||||
OutRedirects float64
|
||||
OutEchos float64
|
||||
OutEchoReps float64
|
||||
OutTimestamps float64
|
||||
OutTimestampReps float64
|
||||
OutAddrMasks float64
|
||||
OutAddrMaskReps float64
|
||||
type Icmp struct { // nolint:revive
|
||||
InMsgs *float64
|
||||
InErrors *float64
|
||||
InCsumErrors *float64
|
||||
InDestUnreachs *float64
|
||||
InTimeExcds *float64
|
||||
InParmProbs *float64
|
||||
InSrcQuenchs *float64
|
||||
InRedirects *float64
|
||||
InEchos *float64
|
||||
InEchoReps *float64
|
||||
InTimestamps *float64
|
||||
InTimestampReps *float64
|
||||
InAddrMasks *float64
|
||||
InAddrMaskReps *float64
|
||||
OutMsgs *float64
|
||||
OutErrors *float64
|
||||
OutDestUnreachs *float64
|
||||
OutTimeExcds *float64
|
||||
OutParmProbs *float64
|
||||
OutSrcQuenchs *float64
|
||||
OutRedirects *float64
|
||||
OutEchos *float64
|
||||
OutEchoReps *float64
|
||||
OutTimestamps *float64
|
||||
OutTimestampReps *float64
|
||||
OutAddrMasks *float64
|
||||
OutAddrMaskReps *float64
|
||||
}
|
||||
|
||||
type IcmpMsg struct {
|
||||
InType3 float64
|
||||
OutType3 float64
|
||||
InType3 *float64
|
||||
OutType3 *float64
|
||||
}
|
||||
|
||||
type Tcp struct { // nolint:revive
|
||||
RtoAlgorithm float64
|
||||
RtoMin float64
|
||||
RtoMax float64
|
||||
MaxConn float64
|
||||
ActiveOpens float64
|
||||
PassiveOpens float64
|
||||
AttemptFails float64
|
||||
EstabResets float64
|
||||
CurrEstab float64
|
||||
InSegs float64
|
||||
OutSegs float64
|
||||
RetransSegs float64
|
||||
InErrs float64
|
||||
OutRsts float64
|
||||
InCsumErrors float64
|
||||
RtoAlgorithm *float64
|
||||
RtoMin *float64
|
||||
RtoMax *float64
|
||||
MaxConn *float64
|
||||
ActiveOpens *float64
|
||||
PassiveOpens *float64
|
||||
AttemptFails *float64
|
||||
EstabResets *float64
|
||||
CurrEstab *float64
|
||||
InSegs *float64
|
||||
OutSegs *float64
|
||||
RetransSegs *float64
|
||||
InErrs *float64
|
||||
OutRsts *float64
|
||||
InCsumErrors *float64
|
||||
}
|
||||
|
||||
type Udp struct { // nolint:revive
|
||||
InDatagrams float64
|
||||
NoPorts float64
|
||||
InErrors float64
|
||||
OutDatagrams float64
|
||||
RcvbufErrors float64
|
||||
SndbufErrors float64
|
||||
InCsumErrors float64
|
||||
IgnoredMulti float64
|
||||
InDatagrams *float64
|
||||
NoPorts *float64
|
||||
InErrors *float64
|
||||
OutDatagrams *float64
|
||||
RcvbufErrors *float64
|
||||
SndbufErrors *float64
|
||||
InCsumErrors *float64
|
||||
IgnoredMulti *float64
|
||||
}
|
||||
|
||||
type UdpLite struct { // nolint:revive
|
||||
InDatagrams float64
|
||||
NoPorts float64
|
||||
InErrors float64
|
||||
OutDatagrams float64
|
||||
RcvbufErrors float64
|
||||
SndbufErrors float64
|
||||
InCsumErrors float64
|
||||
IgnoredMulti float64
|
||||
InDatagrams *float64
|
||||
NoPorts *float64
|
||||
InErrors *float64
|
||||
OutDatagrams *float64
|
||||
RcvbufErrors *float64
|
||||
SndbufErrors *float64
|
||||
InCsumErrors *float64
|
||||
IgnoredMulti *float64
|
||||
}
|
||||
|
||||
func (p Proc) Snmp() (ProcSnmp, error) {
|
||||
|
@ -173,178 +173,178 @@ func parseSnmp(r io.Reader, fileName string) (ProcSnmp, error) {
|
|||
case "Ip":
|
||||
switch key {
|
||||
case "Forwarding":
|
||||
procSnmp.Ip.Forwarding = value
|
||||
procSnmp.Ip.Forwarding = &value
|
||||
case "DefaultTTL":
|
||||
procSnmp.Ip.DefaultTTL = value
|
||||
procSnmp.Ip.DefaultTTL = &value
|
||||
case "InReceives":
|
||||
procSnmp.Ip.InReceives = value
|
||||
procSnmp.Ip.InReceives = &value
|
||||
case "InHdrErrors":
|
||||
procSnmp.Ip.InHdrErrors = value
|
||||
procSnmp.Ip.InHdrErrors = &value
|
||||
case "InAddrErrors":
|
||||
procSnmp.Ip.InAddrErrors = value
|
||||
procSnmp.Ip.InAddrErrors = &value
|
||||
case "ForwDatagrams":
|
||||
procSnmp.Ip.ForwDatagrams = value
|
||||
procSnmp.Ip.ForwDatagrams = &value
|
||||
case "InUnknownProtos":
|
||||
procSnmp.Ip.InUnknownProtos = value
|
||||
procSnmp.Ip.InUnknownProtos = &value
|
||||
case "InDiscards":
|
||||
procSnmp.Ip.InDiscards = value
|
||||
procSnmp.Ip.InDiscards = &value
|
||||
case "InDelivers":
|
||||
procSnmp.Ip.InDelivers = value
|
||||
procSnmp.Ip.InDelivers = &value
|
||||
case "OutRequests":
|
||||
procSnmp.Ip.OutRequests = value
|
||||
procSnmp.Ip.OutRequests = &value
|
||||
case "OutDiscards":
|
||||
procSnmp.Ip.OutDiscards = value
|
||||
procSnmp.Ip.OutDiscards = &value
|
||||
case "OutNoRoutes":
|
||||
procSnmp.Ip.OutNoRoutes = value
|
||||
procSnmp.Ip.OutNoRoutes = &value
|
||||
case "ReasmTimeout":
|
||||
procSnmp.Ip.ReasmTimeout = value
|
||||
procSnmp.Ip.ReasmTimeout = &value
|
||||
case "ReasmReqds":
|
||||
procSnmp.Ip.ReasmReqds = value
|
||||
procSnmp.Ip.ReasmReqds = &value
|
||||
case "ReasmOKs":
|
||||
procSnmp.Ip.ReasmOKs = value
|
||||
procSnmp.Ip.ReasmOKs = &value
|
||||
case "ReasmFails":
|
||||
procSnmp.Ip.ReasmFails = value
|
||||
procSnmp.Ip.ReasmFails = &value
|
||||
case "FragOKs":
|
||||
procSnmp.Ip.FragOKs = value
|
||||
procSnmp.Ip.FragOKs = &value
|
||||
case "FragFails":
|
||||
procSnmp.Ip.FragFails = value
|
||||
procSnmp.Ip.FragFails = &value
|
||||
case "FragCreates":
|
||||
procSnmp.Ip.FragCreates = value
|
||||
procSnmp.Ip.FragCreates = &value
|
||||
}
|
||||
case "Icmp":
|
||||
switch key {
|
||||
case "InMsgs":
|
||||
procSnmp.Icmp.InMsgs = value
|
||||
procSnmp.Icmp.InMsgs = &value
|
||||
case "InErrors":
|
||||
procSnmp.Icmp.InErrors = value
|
||||
procSnmp.Icmp.InErrors = &value
|
||||
case "InCsumErrors":
|
||||
procSnmp.Icmp.InCsumErrors = value
|
||||
procSnmp.Icmp.InCsumErrors = &value
|
||||
case "InDestUnreachs":
|
||||
procSnmp.Icmp.InDestUnreachs = value
|
||||
procSnmp.Icmp.InDestUnreachs = &value
|
||||
case "InTimeExcds":
|
||||
procSnmp.Icmp.InTimeExcds = value
|
||||
procSnmp.Icmp.InTimeExcds = &value
|
||||
case "InParmProbs":
|
||||
procSnmp.Icmp.InParmProbs = value
|
||||
procSnmp.Icmp.InParmProbs = &value
|
||||
case "InSrcQuenchs":
|
||||
procSnmp.Icmp.InSrcQuenchs = value
|
||||
procSnmp.Icmp.InSrcQuenchs = &value
|
||||
case "InRedirects":
|
||||
procSnmp.Icmp.InRedirects = value
|
||||
procSnmp.Icmp.InRedirects = &value
|
||||
case "InEchos":
|
||||
procSnmp.Icmp.InEchos = value
|
||||
procSnmp.Icmp.InEchos = &value
|
||||
case "InEchoReps":
|
||||
procSnmp.Icmp.InEchoReps = value
|
||||
procSnmp.Icmp.InEchoReps = &value
|
||||
case "InTimestamps":
|
||||
procSnmp.Icmp.InTimestamps = value
|
||||
procSnmp.Icmp.InTimestamps = &value
|
||||
case "InTimestampReps":
|
||||
procSnmp.Icmp.InTimestampReps = value
|
||||
procSnmp.Icmp.InTimestampReps = &value
|
||||
case "InAddrMasks":
|
||||
procSnmp.Icmp.InAddrMasks = value
|
||||
procSnmp.Icmp.InAddrMasks = &value
|
||||
case "InAddrMaskReps":
|
||||
procSnmp.Icmp.InAddrMaskReps = value
|
||||
procSnmp.Icmp.InAddrMaskReps = &value
|
||||
case "OutMsgs":
|
||||
procSnmp.Icmp.OutMsgs = value
|
||||
procSnmp.Icmp.OutMsgs = &value
|
||||
case "OutErrors":
|
||||
procSnmp.Icmp.OutErrors = value
|
||||
procSnmp.Icmp.OutErrors = &value
|
||||
case "OutDestUnreachs":
|
||||
procSnmp.Icmp.OutDestUnreachs = value
|
||||
procSnmp.Icmp.OutDestUnreachs = &value
|
||||
case "OutTimeExcds":
|
||||
procSnmp.Icmp.OutTimeExcds = value
|
||||
procSnmp.Icmp.OutTimeExcds = &value
|
||||
case "OutParmProbs":
|
||||
procSnmp.Icmp.OutParmProbs = value
|
||||
procSnmp.Icmp.OutParmProbs = &value
|
||||
case "OutSrcQuenchs":
|
||||
procSnmp.Icmp.OutSrcQuenchs = value
|
||||
procSnmp.Icmp.OutSrcQuenchs = &value
|
||||
case "OutRedirects":
|
||||
procSnmp.Icmp.OutRedirects = value
|
||||
procSnmp.Icmp.OutRedirects = &value
|
||||
case "OutEchos":
|
||||
procSnmp.Icmp.OutEchos = value
|
||||
procSnmp.Icmp.OutEchos = &value
|
||||
case "OutEchoReps":
|
||||
procSnmp.Icmp.OutEchoReps = value
|
||||
procSnmp.Icmp.OutEchoReps = &value
|
||||
case "OutTimestamps":
|
||||
procSnmp.Icmp.OutTimestamps = value
|
||||
procSnmp.Icmp.OutTimestamps = &value
|
||||
case "OutTimestampReps":
|
||||
procSnmp.Icmp.OutTimestampReps = value
|
||||
procSnmp.Icmp.OutTimestampReps = &value
|
||||
case "OutAddrMasks":
|
||||
procSnmp.Icmp.OutAddrMasks = value
|
||||
procSnmp.Icmp.OutAddrMasks = &value
|
||||
case "OutAddrMaskReps":
|
||||
procSnmp.Icmp.OutAddrMaskReps = value
|
||||
procSnmp.Icmp.OutAddrMaskReps = &value
|
||||
}
|
||||
case "IcmpMsg":
|
||||
switch key {
|
||||
case "InType3":
|
||||
procSnmp.IcmpMsg.InType3 = value
|
||||
procSnmp.IcmpMsg.InType3 = &value
|
||||
case "OutType3":
|
||||
procSnmp.IcmpMsg.OutType3 = value
|
||||
procSnmp.IcmpMsg.OutType3 = &value
|
||||
}
|
||||
case "Tcp":
|
||||
switch key {
|
||||
case "RtoAlgorithm":
|
||||
procSnmp.Tcp.RtoAlgorithm = value
|
||||
procSnmp.Tcp.RtoAlgorithm = &value
|
||||
case "RtoMin":
|
||||
procSnmp.Tcp.RtoMin = value
|
||||
procSnmp.Tcp.RtoMin = &value
|
||||
case "RtoMax":
|
||||
procSnmp.Tcp.RtoMax = value
|
||||
procSnmp.Tcp.RtoMax = &value
|
||||
case "MaxConn":
|
||||
procSnmp.Tcp.MaxConn = value
|
||||
procSnmp.Tcp.MaxConn = &value
|
||||
case "ActiveOpens":
|
||||
procSnmp.Tcp.ActiveOpens = value
|
||||
procSnmp.Tcp.ActiveOpens = &value
|
||||
case "PassiveOpens":
|
||||
procSnmp.Tcp.PassiveOpens = value
|
||||
procSnmp.Tcp.PassiveOpens = &value
|
||||
case "AttemptFails":
|
||||
procSnmp.Tcp.AttemptFails = value
|
||||
procSnmp.Tcp.AttemptFails = &value
|
||||
case "EstabResets":
|
||||
procSnmp.Tcp.EstabResets = value
|
||||
procSnmp.Tcp.EstabResets = &value
|
||||
case "CurrEstab":
|
||||
procSnmp.Tcp.CurrEstab = value
|
||||
procSnmp.Tcp.CurrEstab = &value
|
||||
case "InSegs":
|
||||
procSnmp.Tcp.InSegs = value
|
||||
procSnmp.Tcp.InSegs = &value
|
||||
case "OutSegs":
|
||||
procSnmp.Tcp.OutSegs = value
|
||||
procSnmp.Tcp.OutSegs = &value
|
||||
case "RetransSegs":
|
||||
procSnmp.Tcp.RetransSegs = value
|
||||
procSnmp.Tcp.RetransSegs = &value
|
||||
case "InErrs":
|
||||
procSnmp.Tcp.InErrs = value
|
||||
procSnmp.Tcp.InErrs = &value
|
||||
case "OutRsts":
|
||||
procSnmp.Tcp.OutRsts = value
|
||||
procSnmp.Tcp.OutRsts = &value
|
||||
case "InCsumErrors":
|
||||
procSnmp.Tcp.InCsumErrors = value
|
||||
procSnmp.Tcp.InCsumErrors = &value
|
||||
}
|
||||
case "Udp":
|
||||
switch key {
|
||||
case "InDatagrams":
|
||||
procSnmp.Udp.InDatagrams = value
|
||||
procSnmp.Udp.InDatagrams = &value
|
||||
case "NoPorts":
|
||||
procSnmp.Udp.NoPorts = value
|
||||
procSnmp.Udp.NoPorts = &value
|
||||
case "InErrors":
|
||||
procSnmp.Udp.InErrors = value
|
||||
procSnmp.Udp.InErrors = &value
|
||||
case "OutDatagrams":
|
||||
procSnmp.Udp.OutDatagrams = value
|
||||
procSnmp.Udp.OutDatagrams = &value
|
||||
case "RcvbufErrors":
|
||||
procSnmp.Udp.RcvbufErrors = value
|
||||
procSnmp.Udp.RcvbufErrors = &value
|
||||
case "SndbufErrors":
|
||||
procSnmp.Udp.SndbufErrors = value
|
||||
procSnmp.Udp.SndbufErrors = &value
|
||||
case "InCsumErrors":
|
||||
procSnmp.Udp.InCsumErrors = value
|
||||
procSnmp.Udp.InCsumErrors = &value
|
||||
case "IgnoredMulti":
|
||||
procSnmp.Udp.IgnoredMulti = value
|
||||
procSnmp.Udp.IgnoredMulti = &value
|
||||
}
|
||||
case "UdpLite":
|
||||
switch key {
|
||||
case "InDatagrams":
|
||||
procSnmp.UdpLite.InDatagrams = value
|
||||
procSnmp.UdpLite.InDatagrams = &value
|
||||
case "NoPorts":
|
||||
procSnmp.UdpLite.NoPorts = value
|
||||
procSnmp.UdpLite.NoPorts = &value
|
||||
case "InErrors":
|
||||
procSnmp.UdpLite.InErrors = value
|
||||
procSnmp.UdpLite.InErrors = &value
|
||||
case "OutDatagrams":
|
||||
procSnmp.UdpLite.OutDatagrams = value
|
||||
procSnmp.UdpLite.OutDatagrams = &value
|
||||
case "RcvbufErrors":
|
||||
procSnmp.UdpLite.RcvbufErrors = value
|
||||
procSnmp.UdpLite.RcvbufErrors = &value
|
||||
case "SndbufErrors":
|
||||
procSnmp.UdpLite.SndbufErrors = value
|
||||
procSnmp.UdpLite.SndbufErrors = &value
|
||||
case "InCsumErrors":
|
||||
procSnmp.UdpLite.InCsumErrors = value
|
||||
procSnmp.UdpLite.InCsumErrors = &value
|
||||
case "IgnoredMulti":
|
||||
procSnmp.UdpLite.IgnoredMulti = value
|
||||
procSnmp.UdpLite.IgnoredMulti = &value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,106 +36,106 @@ type ProcSnmp6 struct {
|
|||
}
|
||||
|
||||
type Ip6 struct { // nolint:revive
|
||||
InReceives float64
|
||||
InHdrErrors float64
|
||||
InTooBigErrors float64
|
||||
InNoRoutes float64
|
||||
InAddrErrors float64
|
||||
InUnknownProtos float64
|
||||
InTruncatedPkts float64
|
||||
InDiscards float64
|
||||
InDelivers float64
|
||||
OutForwDatagrams float64
|
||||
OutRequests float64
|
||||
OutDiscards float64
|
||||
OutNoRoutes float64
|
||||
ReasmTimeout float64
|
||||
ReasmReqds float64
|
||||
ReasmOKs float64
|
||||
ReasmFails float64
|
||||
FragOKs float64
|
||||
FragFails float64
|
||||
FragCreates float64
|
||||
InMcastPkts float64
|
||||
OutMcastPkts float64
|
||||
InOctets float64
|
||||
OutOctets float64
|
||||
InMcastOctets float64
|
||||
OutMcastOctets float64
|
||||
InBcastOctets float64
|
||||
OutBcastOctets float64
|
||||
InNoECTPkts float64
|
||||
InECT1Pkts float64
|
||||
InECT0Pkts float64
|
||||
InCEPkts float64
|
||||
InReceives *float64
|
||||
InHdrErrors *float64
|
||||
InTooBigErrors *float64
|
||||
InNoRoutes *float64
|
||||
InAddrErrors *float64
|
||||
InUnknownProtos *float64
|
||||
InTruncatedPkts *float64
|
||||
InDiscards *float64
|
||||
InDelivers *float64
|
||||
OutForwDatagrams *float64
|
||||
OutRequests *float64
|
||||
OutDiscards *float64
|
||||
OutNoRoutes *float64
|
||||
ReasmTimeout *float64
|
||||
ReasmReqds *float64
|
||||
ReasmOKs *float64
|
||||
ReasmFails *float64
|
||||
FragOKs *float64
|
||||
FragFails *float64
|
||||
FragCreates *float64
|
||||
InMcastPkts *float64
|
||||
OutMcastPkts *float64
|
||||
InOctets *float64
|
||||
OutOctets *float64
|
||||
InMcastOctets *float64
|
||||
OutMcastOctets *float64
|
||||
InBcastOctets *float64
|
||||
OutBcastOctets *float64
|
||||
InNoECTPkts *float64
|
||||
InECT1Pkts *float64
|
||||
InECT0Pkts *float64
|
||||
InCEPkts *float64
|
||||
}
|
||||
|
||||
type Icmp6 struct {
|
||||
InMsgs float64
|
||||
InErrors float64
|
||||
OutMsgs float64
|
||||
OutErrors float64
|
||||
InCsumErrors float64
|
||||
InDestUnreachs float64
|
||||
InPktTooBigs float64
|
||||
InTimeExcds float64
|
||||
InParmProblems float64
|
||||
InEchos float64
|
||||
InEchoReplies float64
|
||||
InGroupMembQueries float64
|
||||
InGroupMembResponses float64
|
||||
InGroupMembReductions float64
|
||||
InRouterSolicits float64
|
||||
InRouterAdvertisements float64
|
||||
InNeighborSolicits float64
|
||||
InNeighborAdvertisements float64
|
||||
InRedirects float64
|
||||
InMLDv2Reports float64
|
||||
OutDestUnreachs float64
|
||||
OutPktTooBigs float64
|
||||
OutTimeExcds float64
|
||||
OutParmProblems float64
|
||||
OutEchos float64
|
||||
OutEchoReplies float64
|
||||
OutGroupMembQueries float64
|
||||
OutGroupMembResponses float64
|
||||
OutGroupMembReductions float64
|
||||
OutRouterSolicits float64
|
||||
OutRouterAdvertisements float64
|
||||
OutNeighborSolicits float64
|
||||
OutNeighborAdvertisements float64
|
||||
OutRedirects float64
|
||||
OutMLDv2Reports float64
|
||||
InType1 float64
|
||||
InType134 float64
|
||||
InType135 float64
|
||||
InType136 float64
|
||||
InType143 float64
|
||||
OutType133 float64
|
||||
OutType135 float64
|
||||
OutType136 float64
|
||||
OutType143 float64
|
||||
InMsgs *float64
|
||||
InErrors *float64
|
||||
OutMsgs *float64
|
||||
OutErrors *float64
|
||||
InCsumErrors *float64
|
||||
InDestUnreachs *float64
|
||||
InPktTooBigs *float64
|
||||
InTimeExcds *float64
|
||||
InParmProblems *float64
|
||||
InEchos *float64
|
||||
InEchoReplies *float64
|
||||
InGroupMembQueries *float64
|
||||
InGroupMembResponses *float64
|
||||
InGroupMembReductions *float64
|
||||
InRouterSolicits *float64
|
||||
InRouterAdvertisements *float64
|
||||
InNeighborSolicits *float64
|
||||
InNeighborAdvertisements *float64
|
||||
InRedirects *float64
|
||||
InMLDv2Reports *float64
|
||||
OutDestUnreachs *float64
|
||||
OutPktTooBigs *float64
|
||||
OutTimeExcds *float64
|
||||
OutParmProblems *float64
|
||||
OutEchos *float64
|
||||
OutEchoReplies *float64
|
||||
OutGroupMembQueries *float64
|
||||
OutGroupMembResponses *float64
|
||||
OutGroupMembReductions *float64
|
||||
OutRouterSolicits *float64
|
||||
OutRouterAdvertisements *float64
|
||||
OutNeighborSolicits *float64
|
||||
OutNeighborAdvertisements *float64
|
||||
OutRedirects *float64
|
||||
OutMLDv2Reports *float64
|
||||
InType1 *float64
|
||||
InType134 *float64
|
||||
InType135 *float64
|
||||
InType136 *float64
|
||||
InType143 *float64
|
||||
OutType133 *float64
|
||||
OutType135 *float64
|
||||
OutType136 *float64
|
||||
OutType143 *float64
|
||||
}
|
||||
|
||||
type Udp6 struct { // nolint:revive
|
||||
InDatagrams float64
|
||||
NoPorts float64
|
||||
InErrors float64
|
||||
OutDatagrams float64
|
||||
RcvbufErrors float64
|
||||
SndbufErrors float64
|
||||
InCsumErrors float64
|
||||
IgnoredMulti float64
|
||||
InDatagrams *float64
|
||||
NoPorts *float64
|
||||
InErrors *float64
|
||||
OutDatagrams *float64
|
||||
RcvbufErrors *float64
|
||||
SndbufErrors *float64
|
||||
InCsumErrors *float64
|
||||
IgnoredMulti *float64
|
||||
}
|
||||
|
||||
type UdpLite6 struct { // nolint:revive
|
||||
InDatagrams float64
|
||||
NoPorts float64
|
||||
InErrors float64
|
||||
OutDatagrams float64
|
||||
RcvbufErrors float64
|
||||
SndbufErrors float64
|
||||
InCsumErrors float64
|
||||
InDatagrams *float64
|
||||
NoPorts *float64
|
||||
InErrors *float64
|
||||
OutDatagrams *float64
|
||||
RcvbufErrors *float64
|
||||
SndbufErrors *float64
|
||||
InCsumErrors *float64
|
||||
}
|
||||
|
||||
func (p Proc) Snmp6() (ProcSnmp6, error) {
|
||||
|
@ -182,197 +182,197 @@ func parseSNMP6Stats(r io.Reader) (ProcSnmp6, error) {
|
|||
case "Ip6":
|
||||
switch key {
|
||||
case "InReceives":
|
||||
procSnmp6.Ip6.InReceives = value
|
||||
procSnmp6.Ip6.InReceives = &value
|
||||
case "InHdrErrors":
|
||||
procSnmp6.Ip6.InHdrErrors = value
|
||||
procSnmp6.Ip6.InHdrErrors = &value
|
||||
case "InTooBigErrors":
|
||||
procSnmp6.Ip6.InTooBigErrors = value
|
||||
procSnmp6.Ip6.InTooBigErrors = &value
|
||||
case "InNoRoutes":
|
||||
procSnmp6.Ip6.InNoRoutes = value
|
||||
procSnmp6.Ip6.InNoRoutes = &value
|
||||
case "InAddrErrors":
|
||||
procSnmp6.Ip6.InAddrErrors = value
|
||||
procSnmp6.Ip6.InAddrErrors = &value
|
||||
case "InUnknownProtos":
|
||||
procSnmp6.Ip6.InUnknownProtos = value
|
||||
procSnmp6.Ip6.InUnknownProtos = &value
|
||||
case "InTruncatedPkts":
|
||||
procSnmp6.Ip6.InTruncatedPkts = value
|
||||
procSnmp6.Ip6.InTruncatedPkts = &value
|
||||
case "InDiscards":
|
||||
procSnmp6.Ip6.InDiscards = value
|
||||
procSnmp6.Ip6.InDiscards = &value
|
||||
case "InDelivers":
|
||||
procSnmp6.Ip6.InDelivers = value
|
||||
procSnmp6.Ip6.InDelivers = &value
|
||||
case "OutForwDatagrams":
|
||||
procSnmp6.Ip6.OutForwDatagrams = value
|
||||
procSnmp6.Ip6.OutForwDatagrams = &value
|
||||
case "OutRequests":
|
||||
procSnmp6.Ip6.OutRequests = value
|
||||
procSnmp6.Ip6.OutRequests = &value
|
||||
case "OutDiscards":
|
||||
procSnmp6.Ip6.OutDiscards = value
|
||||
procSnmp6.Ip6.OutDiscards = &value
|
||||
case "OutNoRoutes":
|
||||
procSnmp6.Ip6.OutNoRoutes = value
|
||||
procSnmp6.Ip6.OutNoRoutes = &value
|
||||
case "ReasmTimeout":
|
||||
procSnmp6.Ip6.ReasmTimeout = value
|
||||
procSnmp6.Ip6.ReasmTimeout = &value
|
||||
case "ReasmReqds":
|
||||
procSnmp6.Ip6.ReasmReqds = value
|
||||
procSnmp6.Ip6.ReasmReqds = &value
|
||||
case "ReasmOKs":
|
||||
procSnmp6.Ip6.ReasmOKs = value
|
||||
procSnmp6.Ip6.ReasmOKs = &value
|
||||
case "ReasmFails":
|
||||
procSnmp6.Ip6.ReasmFails = value
|
||||
procSnmp6.Ip6.ReasmFails = &value
|
||||
case "FragOKs":
|
||||
procSnmp6.Ip6.FragOKs = value
|
||||
procSnmp6.Ip6.FragOKs = &value
|
||||
case "FragFails":
|
||||
procSnmp6.Ip6.FragFails = value
|
||||
procSnmp6.Ip6.FragFails = &value
|
||||
case "FragCreates":
|
||||
procSnmp6.Ip6.FragCreates = value
|
||||
procSnmp6.Ip6.FragCreates = &value
|
||||
case "InMcastPkts":
|
||||
procSnmp6.Ip6.InMcastPkts = value
|
||||
procSnmp6.Ip6.InMcastPkts = &value
|
||||
case "OutMcastPkts":
|
||||
procSnmp6.Ip6.OutMcastPkts = value
|
||||
procSnmp6.Ip6.OutMcastPkts = &value
|
||||
case "InOctets":
|
||||
procSnmp6.Ip6.InOctets = value
|
||||
procSnmp6.Ip6.InOctets = &value
|
||||
case "OutOctets":
|
||||
procSnmp6.Ip6.OutOctets = value
|
||||
procSnmp6.Ip6.OutOctets = &value
|
||||
case "InMcastOctets":
|
||||
procSnmp6.Ip6.InMcastOctets = value
|
||||
procSnmp6.Ip6.InMcastOctets = &value
|
||||
case "OutMcastOctets":
|
||||
procSnmp6.Ip6.OutMcastOctets = value
|
||||
procSnmp6.Ip6.OutMcastOctets = &value
|
||||
case "InBcastOctets":
|
||||
procSnmp6.Ip6.InBcastOctets = value
|
||||
procSnmp6.Ip6.InBcastOctets = &value
|
||||
case "OutBcastOctets":
|
||||
procSnmp6.Ip6.OutBcastOctets = value
|
||||
procSnmp6.Ip6.OutBcastOctets = &value
|
||||
case "InNoECTPkts":
|
||||
procSnmp6.Ip6.InNoECTPkts = value
|
||||
procSnmp6.Ip6.InNoECTPkts = &value
|
||||
case "InECT1Pkts":
|
||||
procSnmp6.Ip6.InECT1Pkts = value
|
||||
procSnmp6.Ip6.InECT1Pkts = &value
|
||||
case "InECT0Pkts":
|
||||
procSnmp6.Ip6.InECT0Pkts = value
|
||||
procSnmp6.Ip6.InECT0Pkts = &value
|
||||
case "InCEPkts":
|
||||
procSnmp6.Ip6.InCEPkts = value
|
||||
procSnmp6.Ip6.InCEPkts = &value
|
||||
|
||||
}
|
||||
case "Icmp6":
|
||||
switch key {
|
||||
case "InMsgs":
|
||||
procSnmp6.Icmp6.InMsgs = value
|
||||
procSnmp6.Icmp6.InMsgs = &value
|
||||
case "InErrors":
|
||||
procSnmp6.Icmp6.InErrors = value
|
||||
procSnmp6.Icmp6.InErrors = &value
|
||||
case "OutMsgs":
|
||||
procSnmp6.Icmp6.OutMsgs = value
|
||||
procSnmp6.Icmp6.OutMsgs = &value
|
||||
case "OutErrors":
|
||||
procSnmp6.Icmp6.OutErrors = value
|
||||
procSnmp6.Icmp6.OutErrors = &value
|
||||
case "InCsumErrors":
|
||||
procSnmp6.Icmp6.InCsumErrors = value
|
||||
procSnmp6.Icmp6.InCsumErrors = &value
|
||||
case "InDestUnreachs":
|
||||
procSnmp6.Icmp6.InDestUnreachs = value
|
||||
procSnmp6.Icmp6.InDestUnreachs = &value
|
||||
case "InPktTooBigs":
|
||||
procSnmp6.Icmp6.InPktTooBigs = value
|
||||
procSnmp6.Icmp6.InPktTooBigs = &value
|
||||
case "InTimeExcds":
|
||||
procSnmp6.Icmp6.InTimeExcds = value
|
||||
procSnmp6.Icmp6.InTimeExcds = &value
|
||||
case "InParmProblems":
|
||||
procSnmp6.Icmp6.InParmProblems = value
|
||||
procSnmp6.Icmp6.InParmProblems = &value
|
||||
case "InEchos":
|
||||
procSnmp6.Icmp6.InEchos = value
|
||||
procSnmp6.Icmp6.InEchos = &value
|
||||
case "InEchoReplies":
|
||||
procSnmp6.Icmp6.InEchoReplies = value
|
||||
procSnmp6.Icmp6.InEchoReplies = &value
|
||||
case "InGroupMembQueries":
|
||||
procSnmp6.Icmp6.InGroupMembQueries = value
|
||||
procSnmp6.Icmp6.InGroupMembQueries = &value
|
||||
case "InGroupMembResponses":
|
||||
procSnmp6.Icmp6.InGroupMembResponses = value
|
||||
procSnmp6.Icmp6.InGroupMembResponses = &value
|
||||
case "InGroupMembReductions":
|
||||
procSnmp6.Icmp6.InGroupMembReductions = value
|
||||
procSnmp6.Icmp6.InGroupMembReductions = &value
|
||||
case "InRouterSolicits":
|
||||
procSnmp6.Icmp6.InRouterSolicits = value
|
||||
procSnmp6.Icmp6.InRouterSolicits = &value
|
||||
case "InRouterAdvertisements":
|
||||
procSnmp6.Icmp6.InRouterAdvertisements = value
|
||||
procSnmp6.Icmp6.InRouterAdvertisements = &value
|
||||
case "InNeighborSolicits":
|
||||
procSnmp6.Icmp6.InNeighborSolicits = value
|
||||
procSnmp6.Icmp6.InNeighborSolicits = &value
|
||||
case "InNeighborAdvertisements":
|
||||
procSnmp6.Icmp6.InNeighborAdvertisements = value
|
||||
procSnmp6.Icmp6.InNeighborAdvertisements = &value
|
||||
case "InRedirects":
|
||||
procSnmp6.Icmp6.InRedirects = value
|
||||
procSnmp6.Icmp6.InRedirects = &value
|
||||
case "InMLDv2Reports":
|
||||
procSnmp6.Icmp6.InMLDv2Reports = value
|
||||
procSnmp6.Icmp6.InMLDv2Reports = &value
|
||||
case "OutDestUnreachs":
|
||||
procSnmp6.Icmp6.OutDestUnreachs = value
|
||||
procSnmp6.Icmp6.OutDestUnreachs = &value
|
||||
case "OutPktTooBigs":
|
||||
procSnmp6.Icmp6.OutPktTooBigs = value
|
||||
procSnmp6.Icmp6.OutPktTooBigs = &value
|
||||
case "OutTimeExcds":
|
||||
procSnmp6.Icmp6.OutTimeExcds = value
|
||||
procSnmp6.Icmp6.OutTimeExcds = &value
|
||||
case "OutParmProblems":
|
||||
procSnmp6.Icmp6.OutParmProblems = value
|
||||
procSnmp6.Icmp6.OutParmProblems = &value
|
||||
case "OutEchos":
|
||||
procSnmp6.Icmp6.OutEchos = value
|
||||
procSnmp6.Icmp6.OutEchos = &value
|
||||
case "OutEchoReplies":
|
||||
procSnmp6.Icmp6.OutEchoReplies = value
|
||||
procSnmp6.Icmp6.OutEchoReplies = &value
|
||||
case "OutGroupMembQueries":
|
||||
procSnmp6.Icmp6.OutGroupMembQueries = value
|
||||
procSnmp6.Icmp6.OutGroupMembQueries = &value
|
||||
case "OutGroupMembResponses":
|
||||
procSnmp6.Icmp6.OutGroupMembResponses = value
|
||||
procSnmp6.Icmp6.OutGroupMembResponses = &value
|
||||
case "OutGroupMembReductions":
|
||||
procSnmp6.Icmp6.OutGroupMembReductions = value
|
||||
procSnmp6.Icmp6.OutGroupMembReductions = &value
|
||||
case "OutRouterSolicits":
|
||||
procSnmp6.Icmp6.OutRouterSolicits = value
|
||||
procSnmp6.Icmp6.OutRouterSolicits = &value
|
||||
case "OutRouterAdvertisements":
|
||||
procSnmp6.Icmp6.OutRouterAdvertisements = value
|
||||
procSnmp6.Icmp6.OutRouterAdvertisements = &value
|
||||
case "OutNeighborSolicits":
|
||||
procSnmp6.Icmp6.OutNeighborSolicits = value
|
||||
procSnmp6.Icmp6.OutNeighborSolicits = &value
|
||||
case "OutNeighborAdvertisements":
|
||||
procSnmp6.Icmp6.OutNeighborAdvertisements = value
|
||||
procSnmp6.Icmp6.OutNeighborAdvertisements = &value
|
||||
case "OutRedirects":
|
||||
procSnmp6.Icmp6.OutRedirects = value
|
||||
procSnmp6.Icmp6.OutRedirects = &value
|
||||
case "OutMLDv2Reports":
|
||||
procSnmp6.Icmp6.OutMLDv2Reports = value
|
||||
procSnmp6.Icmp6.OutMLDv2Reports = &value
|
||||
case "InType1":
|
||||
procSnmp6.Icmp6.InType1 = value
|
||||
procSnmp6.Icmp6.InType1 = &value
|
||||
case "InType134":
|
||||
procSnmp6.Icmp6.InType134 = value
|
||||
procSnmp6.Icmp6.InType134 = &value
|
||||
case "InType135":
|
||||
procSnmp6.Icmp6.InType135 = value
|
||||
procSnmp6.Icmp6.InType135 = &value
|
||||
case "InType136":
|
||||
procSnmp6.Icmp6.InType136 = value
|
||||
procSnmp6.Icmp6.InType136 = &value
|
||||
case "InType143":
|
||||
procSnmp6.Icmp6.InType143 = value
|
||||
procSnmp6.Icmp6.InType143 = &value
|
||||
case "OutType133":
|
||||
procSnmp6.Icmp6.OutType133 = value
|
||||
procSnmp6.Icmp6.OutType133 = &value
|
||||
case "OutType135":
|
||||
procSnmp6.Icmp6.OutType135 = value
|
||||
procSnmp6.Icmp6.OutType135 = &value
|
||||
case "OutType136":
|
||||
procSnmp6.Icmp6.OutType136 = value
|
||||
procSnmp6.Icmp6.OutType136 = &value
|
||||
case "OutType143":
|
||||
procSnmp6.Icmp6.OutType143 = value
|
||||
procSnmp6.Icmp6.OutType143 = &value
|
||||
}
|
||||
case "Udp6":
|
||||
switch key {
|
||||
case "InDatagrams":
|
||||
procSnmp6.Udp6.InDatagrams = value
|
||||
procSnmp6.Udp6.InDatagrams = &value
|
||||
case "NoPorts":
|
||||
procSnmp6.Udp6.NoPorts = value
|
||||
procSnmp6.Udp6.NoPorts = &value
|
||||
case "InErrors":
|
||||
procSnmp6.Udp6.InErrors = value
|
||||
procSnmp6.Udp6.InErrors = &value
|
||||
case "OutDatagrams":
|
||||
procSnmp6.Udp6.OutDatagrams = value
|
||||
procSnmp6.Udp6.OutDatagrams = &value
|
||||
case "RcvbufErrors":
|
||||
procSnmp6.Udp6.RcvbufErrors = value
|
||||
procSnmp6.Udp6.RcvbufErrors = &value
|
||||
case "SndbufErrors":
|
||||
procSnmp6.Udp6.SndbufErrors = value
|
||||
procSnmp6.Udp6.SndbufErrors = &value
|
||||
case "InCsumErrors":
|
||||
procSnmp6.Udp6.InCsumErrors = value
|
||||
procSnmp6.Udp6.InCsumErrors = &value
|
||||
case "IgnoredMulti":
|
||||
procSnmp6.Udp6.IgnoredMulti = value
|
||||
procSnmp6.Udp6.IgnoredMulti = &value
|
||||
}
|
||||
case "UdpLite6":
|
||||
switch key {
|
||||
case "InDatagrams":
|
||||
procSnmp6.UdpLite6.InDatagrams = value
|
||||
procSnmp6.UdpLite6.InDatagrams = &value
|
||||
case "NoPorts":
|
||||
procSnmp6.UdpLite6.NoPorts = value
|
||||
procSnmp6.UdpLite6.NoPorts = &value
|
||||
case "InErrors":
|
||||
procSnmp6.UdpLite6.InErrors = value
|
||||
procSnmp6.UdpLite6.InErrors = &value
|
||||
case "OutDatagrams":
|
||||
procSnmp6.UdpLite6.OutDatagrams = value
|
||||
procSnmp6.UdpLite6.OutDatagrams = &value
|
||||
case "RcvbufErrors":
|
||||
procSnmp6.UdpLite6.RcvbufErrors = value
|
||||
procSnmp6.UdpLite6.RcvbufErrors = &value
|
||||
case "SndbufErrors":
|
||||
procSnmp6.UdpLite6.SndbufErrors = value
|
||||
procSnmp6.UdpLite6.SndbufErrors = &value
|
||||
case "InCsumErrors":
|
||||
procSnmp6.UdpLite6.InCsumErrors = value
|
||||
procSnmp6.UdpLite6.InCsumErrors = &value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,6 +102,8 @@ type ProcStat struct {
|
|||
RSS int
|
||||
// Soft limit in bytes on the rss of the process.
|
||||
RSSLimit uint64
|
||||
// CPU number last executed on.
|
||||
Processor uint
|
||||
// Real-time scheduling priority, a number in the range 1 to 99 for processes
|
||||
// scheduled under a real-time policy, or 0, for non-real-time processes.
|
||||
RTPriority uint
|
||||
|
@ -184,7 +186,7 @@ func (p Proc) Stat() (ProcStat, error) {
|
|||
&ignoreUint64,
|
||||
&ignoreUint64,
|
||||
&ignoreInt64,
|
||||
&ignoreInt64,
|
||||
&s.Processor,
|
||||
&s.RTPriority,
|
||||
&s.Policy,
|
||||
&s.DelayAcctBlkIOTicks,
|
||||
|
|
|
@ -96,10 +96,10 @@ func (p Proc) NewStatus() (ProcStatus, error) {
|
|||
kv := strings.SplitN(line, ":", 2)
|
||||
|
||||
// removes spaces
|
||||
k := string(strings.TrimSpace(kv[0]))
|
||||
v := string(strings.TrimSpace(kv[1]))
|
||||
k := strings.TrimSpace(kv[0])
|
||||
v := strings.TrimSpace(kv[1])
|
||||
// removes "kB"
|
||||
v = string(bytes.Trim([]byte(v), " kB"))
|
||||
v = strings.TrimSuffix(v, " kB")
|
||||
|
||||
// value to int when possible
|
||||
// we can skip error check here, 'cause vKBytes is not used when value is a string
|
||||
|
|
|
@ -62,7 +62,7 @@ type Stat struct {
|
|||
// Summed up cpu statistics.
|
||||
CPUTotal CPUStat
|
||||
// Per-CPU statistics.
|
||||
CPU []CPUStat
|
||||
CPU map[int64]CPUStat
|
||||
// Number of times interrupts were handled, which contains numbered and unnumbered IRQs.
|
||||
IRQTotal uint64
|
||||
// Number of times a numbered IRQ was triggered.
|
||||
|
@ -170,10 +170,23 @@ func (fs FS) Stat() (Stat, error) {
|
|||
if err != nil {
|
||||
return Stat{}, err
|
||||
}
|
||||
procStat, err := parseStat(bytes.NewReader(data), fileName)
|
||||
if err != nil {
|
||||
return Stat{}, err
|
||||
}
|
||||
return procStat, nil
|
||||
}
|
||||
|
||||
stat := Stat{}
|
||||
// parseStat parses the metrics from /proc/[pid]/stat.
|
||||
func parseStat(r io.Reader, fileName string) (Stat, error) {
|
||||
var (
|
||||
scanner = bufio.NewScanner(r)
|
||||
stat = Stat{
|
||||
CPU: make(map[int64]CPUStat),
|
||||
}
|
||||
err error
|
||||
)
|
||||
|
||||
scanner := bufio.NewScanner(bytes.NewReader(data))
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
parts := strings.Fields(scanner.Text())
|
||||
|
@ -228,9 +241,6 @@ func (fs FS) Stat() (Stat, error) {
|
|||
if cpuID == -1 {
|
||||
stat.CPUTotal = cpuStat
|
||||
} else {
|
||||
for int64(len(stat.CPU)) <= cpuID {
|
||||
stat.CPU = append(stat.CPU, CPUStat{})
|
||||
}
|
||||
stat.CPU[cpuID] = cpuStat
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
// Copyright 2022 The Prometheus Authors
|
||||
// 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.
|
||||
|
||||
package procfs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
fsi "github.com/prometheus/procfs/internal/fs"
|
||||
)
|
||||
|
||||
// Provide access to /proc/PID/task/TID files, for thread specific values. Since
|
||||
// such files have the same structure as /proc/PID/ ones, the data structures
|
||||
// and the parsers for the latter may be reused.
|
||||
|
||||
// AllThreads returns a list of all currently available threads under /proc/PID.
|
||||
func AllThreads(pid int) (Procs, error) {
|
||||
fs, err := NewFS(DefaultMountPoint)
|
||||
if err != nil {
|
||||
return Procs{}, err
|
||||
}
|
||||
return fs.AllThreads(pid)
|
||||
}
|
||||
|
||||
// AllThreads returns a list of all currently available threads for PID.
|
||||
func (fs FS) AllThreads(pid int) (Procs, error) {
|
||||
taskPath := fs.proc.Path(strconv.Itoa(pid), "task")
|
||||
d, err := os.Open(taskPath)
|
||||
if err != nil {
|
||||
return Procs{}, err
|
||||
}
|
||||
defer d.Close()
|
||||
|
||||
names, err := d.Readdirnames(-1)
|
||||
if err != nil {
|
||||
return Procs{}, fmt.Errorf("could not read %q: %w", d.Name(), err)
|
||||
}
|
||||
|
||||
t := Procs{}
|
||||
for _, n := range names {
|
||||
tid, err := strconv.ParseInt(n, 10, 64)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
t = append(t, Proc{PID: int(tid), fs: fsi.FS(taskPath)})
|
||||
}
|
||||
|
||||
return t, nil
|
||||
}
|
||||
|
||||
// Thread returns a process for a given PID, TID.
|
||||
func (fs FS) Thread(pid, tid int) (Proc, error) {
|
||||
taskPath := fs.proc.Path(strconv.Itoa(pid), "task")
|
||||
if _, err := os.Stat(taskPath); err != nil {
|
||||
return Proc{}, err
|
||||
}
|
||||
return Proc{PID: tid, fs: fsi.FS(taskPath)}, nil
|
||||
}
|
||||
|
||||
// Thread returns a process for a given TID of Proc.
|
||||
func (proc Proc) Thread(tid int) (Proc, error) {
|
||||
tfs := fsi.FS(proc.path("task"))
|
||||
if _, err := os.Stat(tfs.Path(strconv.Itoa(tid))); err != nil {
|
||||
return Proc{}, err
|
||||
}
|
||||
return Proc{PID: tid, fs: tfs}, nil
|
||||
}
|
|
@ -26,7 +26,9 @@ import (
|
|||
)
|
||||
|
||||
// The VM interface is described at
|
||||
// https://www.kernel.org/doc/Documentation/sysctl/vm.txt
|
||||
//
|
||||
// https://www.kernel.org/doc/Documentation/sysctl/vm.txt
|
||||
//
|
||||
// Each setting is exposed as a single file.
|
||||
// Each file contains one line with a single numerical value, except lowmem_reserve_ratio which holds an array
|
||||
// and numa_zonelist_order (deprecated) which is a string.
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright 2022 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build (darwin || freebsd || netbsd || openbsd) && gc
|
||||
// +build darwin freebsd netbsd openbsd
|
||||
// +build gc
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
//
|
||||
// System call support for ppc64, BSD
|
||||
//
|
||||
|
||||
// Just jump to package syscall's implementation for all these functions.
|
||||
// The runtime may know about them.
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56
|
||||
JMP syscall·Syscall(SB)
|
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
||||
JMP syscall·Syscall6(SB)
|
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-104
|
||||
JMP syscall·Syscall9(SB)
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||
JMP syscall·RawSyscall(SB)
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||
JMP syscall·RawSyscall6(SB)
|
|
@ -2,8 +2,8 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
|
||||
|
||||
package unix
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build gccgo && !aix
|
||||
// +build gccgo,!aix
|
||||
//go:build gccgo && !aix && !hurd
|
||||
// +build gccgo,!aix,!hurd
|
||||
|
||||
package unix
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build gccgo
|
||||
// +build !aix
|
||||
// +build gccgo,!hurd
|
||||
// +build !aix,!hurd
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||
//go:build aix || darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris
|
||||
// +build aix darwin dragonfly freebsd hurd linux netbsd openbsd solaris
|
||||
|
||||
package unix
|
||||
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
|
||||
package unix
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
)
|
||||
import "unsafe"
|
||||
|
||||
// IoctlRetInt performs an ioctl operation specified by req on a device
|
||||
// associated with opened file descriptor fd, and returns a non-negative
|
||||
|
@ -217,3 +215,19 @@ func IoctlKCMAttach(fd int, info KCMAttach) error {
|
|||
func IoctlKCMUnattach(fd int, info KCMUnattach) error {
|
||||
return ioctlPtr(fd, SIOCKCMUNATTACH, unsafe.Pointer(&info))
|
||||
}
|
||||
|
||||
// IoctlLoopGetStatus64 gets the status of the loop device associated with the
|
||||
// file descriptor fd using the LOOP_GET_STATUS64 operation.
|
||||
func IoctlLoopGetStatus64(fd int) (*LoopInfo64, error) {
|
||||
var value LoopInfo64
|
||||
if err := ioctlPtr(fd, LOOP_GET_STATUS64, unsafe.Pointer(&value)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &value, nil
|
||||
}
|
||||
|
||||
// IoctlLoopSetStatus64 sets the status of the loop device associated with the
|
||||
// file descriptor fd using the LOOP_SET_STATUS64 operation.
|
||||
func IoctlLoopSetStatus64(fd int, value *LoopInfo64) error {
|
||||
return ioctlPtr(fd, LOOP_SET_STATUS64, unsafe.Pointer(value))
|
||||
}
|
||||
|
|
|
@ -174,10 +174,28 @@ openbsd_arm64)
|
|||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
||||
;;
|
||||
openbsd_mips64)
|
||||
mkasm="go run mkasm.go"
|
||||
mkerrors="$mkerrors -m64"
|
||||
mksyscall="go run mksyscall.go -openbsd"
|
||||
mksyscall="go run mksyscall.go -openbsd -libc"
|
||||
mksysctl="go run mksysctl_openbsd.go"
|
||||
# Let the type of C char be signed for making the bare syscall
|
||||
# API consistent across platforms.
|
||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
||||
;;
|
||||
openbsd_ppc64)
|
||||
mkasm="go run mkasm.go"
|
||||
mkerrors="$mkerrors -m64"
|
||||
mksyscall="go run mksyscall.go -openbsd -libc"
|
||||
mksysctl="go run mksysctl_openbsd.go"
|
||||
# Let the type of C char be signed for making the bare syscall
|
||||
# API consistent across platforms.
|
||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
||||
;;
|
||||
openbsd_riscv64)
|
||||
mkasm="go run mkasm.go"
|
||||
mkerrors="$mkerrors -m64"
|
||||
mksyscall="go run mksyscall.go -openbsd -libc"
|
||||
mksysctl="go run mksysctl_openbsd.go"
|
||||
mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'"
|
||||
# Let the type of C char be signed for making the bare syscall
|
||||
# API consistent across platforms.
|
||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
||||
|
@ -214,11 +232,6 @@ esac
|
|||
if [ "$GOOSARCH" == "aix_ppc64" ]; then
|
||||
# aix/ppc64 script generates files instead of writing to stdin.
|
||||
echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in && gofmt -w zsyscall_$GOOSARCH.go && gofmt -w zsyscall_"$GOOSARCH"_gccgo.go && gofmt -w zsyscall_"$GOOSARCH"_gc.go " ;
|
||||
elif [ "$GOOS" == "darwin" ]; then
|
||||
# 1.12 and later, syscalls via libSystem
|
||||
echo "$mksyscall -tags $GOOS,$GOARCH,go1.12 $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go";
|
||||
# 1.13 and later, syscalls via libSystem (including syscallPtr)
|
||||
echo "$mksyscall -tags $GOOS,$GOARCH,go1.13 syscall_darwin.1_13.go |gofmt >zsyscall_$GOOSARCH.1_13.go";
|
||||
elif [ "$GOOS" == "illumos" ]; then
|
||||
# illumos code generation requires a --illumos switch
|
||||
echo "$mksyscall -illumos -tags illumos,$GOARCH syscall_illumos.go |gofmt > zsyscall_illumos_$GOARCH.go";
|
||||
|
|
|
@ -642,7 +642,7 @@ errors=$(
|
|||
signals=$(
|
||||
echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |
|
||||
awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' |
|
||||
egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
|
||||
grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' |
|
||||
sort
|
||||
)
|
||||
|
||||
|
@ -652,7 +652,7 @@ echo '#include <errno.h>' | $CC -x c - -E -dM $ccflags |
|
|||
sort >_error.grep
|
||||
echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |
|
||||
awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' |
|
||||
egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
|
||||
grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' |
|
||||
sort >_signal.grep
|
||||
|
||||
echo '// mkerrors.sh' "$@"
|
||||
|
|
|
@ -52,6 +52,20 @@ func ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error) {
|
|||
return msgs, nil
|
||||
}
|
||||
|
||||
// ParseOneSocketControlMessage parses a single socket control message from b, returning the message header,
|
||||
// message data (a slice of b), and the remainder of b after that single message.
|
||||
// When there are no remaining messages, len(remainder) == 0.
|
||||
func ParseOneSocketControlMessage(b []byte) (hdr Cmsghdr, data []byte, remainder []byte, err error) {
|
||||
h, dbuf, err := socketControlMessageHeaderAndData(b)
|
||||
if err != nil {
|
||||
return Cmsghdr{}, nil, nil, err
|
||||
}
|
||||
if i := cmsgAlignOf(int(h.Len)); i < len(b) {
|
||||
remainder = b[i:]
|
||||
}
|
||||
return *h, dbuf, remainder, nil
|
||||
}
|
||||
|
||||
func socketControlMessageHeaderAndData(b []byte) (*Cmsghdr, []byte, error) {
|
||||
h := (*Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||
if h.Len < SizeofCmsghdr || uint64(h.Len) > uint64(len(b)) {
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||
|
||||
package unix
|
||||
|
||||
func itoa(val int) string { // do it here rather than with fmt to avoid dependency
|
||||
if val < 0 {
|
||||
return "-" + uitoa(uint(-val))
|
||||
}
|
||||
return uitoa(uint(val))
|
||||
}
|
||||
|
||||
func uitoa(val uint) string {
|
||||
var buf [32]byte // big enough for int64
|
||||
i := len(buf) - 1
|
||||
for val >= 10 {
|
||||
buf[i] = byte(val%10 + '0')
|
||||
i--
|
||||
val /= 10
|
||||
}
|
||||
buf[i] = byte(val + '0')
|
||||
return string(buf[i:])
|
||||
}
|
|
@ -29,8 +29,6 @@ import (
|
|||
"bytes"
|
||||
"strings"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/internal/unsafeheader"
|
||||
)
|
||||
|
||||
// ByteSliceFromString returns a NUL-terminated slice of bytes
|
||||
|
@ -82,13 +80,7 @@ func BytePtrToString(p *byte) string {
|
|||
ptr = unsafe.Pointer(uintptr(ptr) + 1)
|
||||
}
|
||||
|
||||
var s []byte
|
||||
h := (*unsafeheader.Slice)(unsafe.Pointer(&s))
|
||||
h.Data = unsafe.Pointer(p)
|
||||
h.Len = n
|
||||
h.Cap = n
|
||||
|
||||
return string(s)
|
||||
return string(unsafe.Slice(p, n))
|
||||
}
|
||||
|
||||
// Single-word zero for use when we need a valid pointer to 0 bytes.
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build darwin && go1.12 && !go1.13
|
||||
// +build darwin,go1.12,!go1.13
|
||||
|
||||
package unix
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
const _SYS_GETDIRENTRIES64 = 344
|
||||
|
||||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
||||
// To implement this using libSystem we'd need syscall_syscallPtr for
|
||||
// fdopendir. However, syscallPtr was only added in Go 1.13, so we fall
|
||||
// back to raw syscalls for this func on Go 1.12.
|
||||
var p unsafe.Pointer
|
||||
if len(buf) > 0 {
|
||||
p = unsafe.Pointer(&buf[0])
|
||||
} else {
|
||||
p = unsafe.Pointer(&_zero)
|
||||
}
|
||||
r0, _, e1 := Syscall6(_SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
|
||||
n = int(r0)
|
||||
if e1 != 0 {
|
||||
return n, errnoErr(e1)
|
||||
}
|
||||
return n, nil
|
||||
}
|
|
@ -1,108 +0,0 @@
|
|||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build darwin && go1.13
|
||||
// +build darwin,go1.13
|
||||
|
||||
package unix
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/internal/unsafeheader"
|
||||
)
|
||||
|
||||
//sys closedir(dir uintptr) (err error)
|
||||
//sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno)
|
||||
|
||||
func fdopendir(fd int) (dir uintptr, err error) {
|
||||
r0, _, e1 := syscall_syscallPtr(libc_fdopendir_trampoline_addr, uintptr(fd), 0, 0)
|
||||
dir = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
var libc_fdopendir_trampoline_addr uintptr
|
||||
|
||||
//go:cgo_import_dynamic libc_fdopendir fdopendir "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
||||
// Simulate Getdirentries using fdopendir/readdir_r/closedir.
|
||||
// We store the number of entries to skip in the seek
|
||||
// offset of fd. See issue #31368.
|
||||
// It's not the full required semantics, but should handle the case
|
||||
// of calling Getdirentries or ReadDirent repeatedly.
|
||||
// It won't handle assigning the results of lseek to *basep, or handle
|
||||
// the directory being edited underfoot.
|
||||
skip, err := Seek(fd, 0, 1 /* SEEK_CUR */)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
// We need to duplicate the incoming file descriptor
|
||||
// because the caller expects to retain control of it, but
|
||||
// fdopendir expects to take control of its argument.
|
||||
// Just Dup'ing the file descriptor is not enough, as the
|
||||
// result shares underlying state. Use Openat to make a really
|
||||
// new file descriptor referring to the same directory.
|
||||
fd2, err := Openat(fd, ".", O_RDONLY, 0)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
d, err := fdopendir(fd2)
|
||||
if err != nil {
|
||||
Close(fd2)
|
||||
return 0, err
|
||||
}
|
||||
defer closedir(d)
|
||||
|
||||
var cnt int64
|
||||
for {
|
||||
var entry Dirent
|
||||
var entryp *Dirent
|
||||
e := readdir_r(d, &entry, &entryp)
|
||||
if e != 0 {
|
||||
return n, errnoErr(e)
|
||||
}
|
||||
if entryp == nil {
|
||||
break
|
||||
}
|
||||
if skip > 0 {
|
||||
skip--
|
||||
cnt++
|
||||
continue
|
||||
}
|
||||
|
||||
reclen := int(entry.Reclen)
|
||||
if reclen > len(buf) {
|
||||
// Not enough room. Return for now.
|
||||
// The counter will let us know where we should start up again.
|
||||
// Note: this strategy for suspending in the middle and
|
||||
// restarting is O(n^2) in the length of the directory. Oh well.
|
||||
break
|
||||
}
|
||||
|
||||
// Copy entry into return buffer.
|
||||
var s []byte
|
||||
hdr := (*unsafeheader.Slice)(unsafe.Pointer(&s))
|
||||
hdr.Data = unsafe.Pointer(&entry)
|
||||
hdr.Cap = reclen
|
||||
hdr.Len = reclen
|
||||
copy(buf, s)
|
||||
|
||||
buf = buf[reclen:]
|
||||
n += reclen
|
||||
cnt++
|
||||
}
|
||||
// Set the seek offset of the input fd to record
|
||||
// how many files we've already returned.
|
||||
_, err = Seek(fd, cnt, 0 /* SEEK_SET */)
|
||||
if err != nil {
|
||||
return n, err
|
||||
}
|
||||
|
||||
return n, nil
|
||||
}
|
|
@ -19,6 +19,96 @@ import (
|
|||
"unsafe"
|
||||
)
|
||||
|
||||
//sys closedir(dir uintptr) (err error)
|
||||
//sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno)
|
||||
|
||||
func fdopendir(fd int) (dir uintptr, err error) {
|
||||
r0, _, e1 := syscall_syscallPtr(libc_fdopendir_trampoline_addr, uintptr(fd), 0, 0)
|
||||
dir = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
var libc_fdopendir_trampoline_addr uintptr
|
||||
|
||||
//go:cgo_import_dynamic libc_fdopendir fdopendir "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
||||
// Simulate Getdirentries using fdopendir/readdir_r/closedir.
|
||||
// We store the number of entries to skip in the seek
|
||||
// offset of fd. See issue #31368.
|
||||
// It's not the full required semantics, but should handle the case
|
||||
// of calling Getdirentries or ReadDirent repeatedly.
|
||||
// It won't handle assigning the results of lseek to *basep, or handle
|
||||
// the directory being edited underfoot.
|
||||
skip, err := Seek(fd, 0, 1 /* SEEK_CUR */)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
// We need to duplicate the incoming file descriptor
|
||||
// because the caller expects to retain control of it, but
|
||||
// fdopendir expects to take control of its argument.
|
||||
// Just Dup'ing the file descriptor is not enough, as the
|
||||
// result shares underlying state. Use Openat to make a really
|
||||
// new file descriptor referring to the same directory.
|
||||
fd2, err := Openat(fd, ".", O_RDONLY, 0)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
d, err := fdopendir(fd2)
|
||||
if err != nil {
|
||||
Close(fd2)
|
||||
return 0, err
|
||||
}
|
||||
defer closedir(d)
|
||||
|
||||
var cnt int64
|
||||
for {
|
||||
var entry Dirent
|
||||
var entryp *Dirent
|
||||
e := readdir_r(d, &entry, &entryp)
|
||||
if e != 0 {
|
||||
return n, errnoErr(e)
|
||||
}
|
||||
if entryp == nil {
|
||||
break
|
||||
}
|
||||
if skip > 0 {
|
||||
skip--
|
||||
cnt++
|
||||
continue
|
||||
}
|
||||
|
||||
reclen := int(entry.Reclen)
|
||||
if reclen > len(buf) {
|
||||
// Not enough room. Return for now.
|
||||
// The counter will let us know where we should start up again.
|
||||
// Note: this strategy for suspending in the middle and
|
||||
// restarting is O(n^2) in the length of the directory. Oh well.
|
||||
break
|
||||
}
|
||||
|
||||
// Copy entry into return buffer.
|
||||
s := unsafe.Slice((*byte)(unsafe.Pointer(&entry)), reclen)
|
||||
copy(buf, s)
|
||||
|
||||
buf = buf[reclen:]
|
||||
n += reclen
|
||||
cnt++
|
||||
}
|
||||
// Set the seek offset of the input fd to record
|
||||
// how many files we've already returned.
|
||||
_, err = Seek(fd, cnt, 0 /* SEEK_SET */)
|
||||
if err != nil {
|
||||
return n, err
|
||||
}
|
||||
|
||||
return n, nil
|
||||
}
|
||||
|
||||
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
|
||||
type SockaddrDatalink struct {
|
||||
Len uint8
|
||||
|
|
|
@ -255,6 +255,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
//sys Chmod(path string, mode uint32) (err error)
|
||||
//sys Chown(path string, uid int, gid int) (err error)
|
||||
//sys Chroot(path string) (err error)
|
||||
//sys ClockGettime(clockid int32, time *Timespec) (err error)
|
||||
//sys Close(fd int) (err error)
|
||||
//sys Dup(fd int) (nfd int, err error)
|
||||
//sys Dup2(from int, to int) (err error)
|
||||
|
|
|
@ -319,6 +319,7 @@ func PtraceSingleStep(pid int) (err error) {
|
|||
//sys Chmod(path string, mode uint32) (err error)
|
||||
//sys Chown(path string, uid int, gid int) (err error)
|
||||
//sys Chroot(path string) (err error)
|
||||
//sys ClockGettime(clockid int32, time *Timespec) (err error)
|
||||
//sys Close(fd int) (err error)
|
||||
//sys Dup(fd int) (nfd int, err error)
|
||||
//sys Dup2(from int, to int) (err error)
|
||||
|
|
|
@ -61,7 +61,7 @@ func PtraceGetFsBase(pid int, fsbase *int64) (err error) {
|
|||
}
|
||||
|
||||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)}
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint32(countin)}
|
||||
err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
|
||||
return int(ioDesc.Len), err
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ func PtraceGetFsBase(pid int, fsbase *int64) (err error) {
|
|||
}
|
||||
|
||||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)}
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint64(countin)}
|
||||
err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
|
||||
return int(ioDesc.Len), err
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||
|
||||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)}
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint32(countin)}
|
||||
err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
|
||||
return int(ioDesc.Len), err
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||
|
||||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)}
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint64(countin)}
|
||||
err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
|
||||
return int(ioDesc.Len), err
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||
|
||||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)}
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint64(countin)}
|
||||
err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
|
||||
return int(ioDesc.Len), err
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright 2022 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build hurd
|
||||
// +build hurd
|
||||
|
||||
package unix
|
||||
|
||||
/*
|
||||
#include <stdint.h>
|
||||
int ioctl(int, unsigned long int, uintptr_t);
|
||||
*/
|
||||
import "C"
|
||||
|
||||
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||
r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg))
|
||||
if r0 == -1 && er != nil {
|
||||
err = er
|
||||
}
|
||||
return
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2022 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build 386 && hurd
|
||||
// +build 386,hurd
|
||||
|
||||
package unix
|
||||
|
||||
const (
|
||||
TIOCGETA = 0x62251713
|
||||
)
|
||||
|
||||
type Winsize struct {
|
||||
Row uint16
|
||||
Col uint16
|
||||
Xpixel uint16
|
||||
Ypixel uint16
|
||||
}
|
||||
|
||||
type Termios struct {
|
||||
Iflag uint32
|
||||
Oflag uint32
|
||||
Cflag uint32
|
||||
Lflag uint32
|
||||
Cc [20]uint8
|
||||
Ispeed int32
|
||||
Ospeed int32
|
||||
}
|
|
@ -10,8 +10,6 @@
|
|||
package unix
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
|
@ -79,107 +77,3 @@ func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
//sys putmsg(fd int, clptr *strbuf, dataptr *strbuf, flags int) (err error)
|
||||
|
||||
func Putmsg(fd int, cl []byte, data []byte, flags int) (err error) {
|
||||
var clp, datap *strbuf
|
||||
if len(cl) > 0 {
|
||||
clp = &strbuf{
|
||||
Len: int32(len(cl)),
|
||||
Buf: (*int8)(unsafe.Pointer(&cl[0])),
|
||||
}
|
||||
}
|
||||
if len(data) > 0 {
|
||||
datap = &strbuf{
|
||||
Len: int32(len(data)),
|
||||
Buf: (*int8)(unsafe.Pointer(&data[0])),
|
||||
}
|
||||
}
|
||||
return putmsg(fd, clp, datap, flags)
|
||||
}
|
||||
|
||||
//sys getmsg(fd int, clptr *strbuf, dataptr *strbuf, flags *int) (err error)
|
||||
|
||||
func Getmsg(fd int, cl []byte, data []byte) (retCl []byte, retData []byte, flags int, err error) {
|
||||
var clp, datap *strbuf
|
||||
if len(cl) > 0 {
|
||||
clp = &strbuf{
|
||||
Maxlen: int32(len(cl)),
|
||||
Buf: (*int8)(unsafe.Pointer(&cl[0])),
|
||||
}
|
||||
}
|
||||
if len(data) > 0 {
|
||||
datap = &strbuf{
|
||||
Maxlen: int32(len(data)),
|
||||
Buf: (*int8)(unsafe.Pointer(&data[0])),
|
||||
}
|
||||
}
|
||||
|
||||
if err = getmsg(fd, clp, datap, &flags); err != nil {
|
||||
return nil, nil, 0, err
|
||||
}
|
||||
|
||||
if len(cl) > 0 {
|
||||
retCl = cl[:clp.Len]
|
||||
}
|
||||
if len(data) > 0 {
|
||||
retData = data[:datap.Len]
|
||||
}
|
||||
return retCl, retData, flags, nil
|
||||
}
|
||||
|
||||
func IoctlSetIntRetInt(fd int, req uint, arg int) (int, error) {
|
||||
return ioctlRet(fd, req, uintptr(arg))
|
||||
}
|
||||
|
||||
func IoctlSetString(fd int, req uint, val string) error {
|
||||
bs := make([]byte, len(val)+1)
|
||||
copy(bs[:len(bs)-1], val)
|
||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&bs[0])))
|
||||
runtime.KeepAlive(&bs[0])
|
||||
return err
|
||||
}
|
||||
|
||||
// Lifreq Helpers
|
||||
|
||||
func (l *Lifreq) SetName(name string) error {
|
||||
if len(name) >= len(l.Name) {
|
||||
return fmt.Errorf("name cannot be more than %d characters", len(l.Name)-1)
|
||||
}
|
||||
for i := range name {
|
||||
l.Name[i] = int8(name[i])
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *Lifreq) SetLifruInt(d int) {
|
||||
*(*int)(unsafe.Pointer(&l.Lifru[0])) = d
|
||||
}
|
||||
|
||||
func (l *Lifreq) GetLifruInt() int {
|
||||
return *(*int)(unsafe.Pointer(&l.Lifru[0]))
|
||||
}
|
||||
|
||||
func (l *Lifreq) SetLifruUint(d uint) {
|
||||
*(*uint)(unsafe.Pointer(&l.Lifru[0])) = d
|
||||
}
|
||||
|
||||
func (l *Lifreq) GetLifruUint() uint {
|
||||
return *(*uint)(unsafe.Pointer(&l.Lifru[0]))
|
||||
}
|
||||
|
||||
func IoctlLifreq(fd int, req uint, l *Lifreq) error {
|
||||
return ioctl(fd, req, uintptr(unsafe.Pointer(l)))
|
||||
}
|
||||
|
||||
// Strioctl Helpers
|
||||
|
||||
func (s *Strioctl) SetInt(i int) {
|
||||
s.Len = int32(unsafe.Sizeof(i))
|
||||
s.Dp = (*int8)(unsafe.Pointer(&i))
|
||||
}
|
||||
|
||||
func IoctlSetStrioctlRetInt(fd int, req uint, s *Strioctl) (int, error) {
|
||||
return ioctlRet(fd, req, uintptr(unsafe.Pointer(s)))
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ package unix
|
|||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"strconv"
|
||||
"syscall"
|
||||
"time"
|
||||
"unsafe"
|
||||
|
@ -233,7 +234,7 @@ func Futimesat(dirfd int, path string, tv []Timeval) error {
|
|||
func Futimes(fd int, tv []Timeval) (err error) {
|
||||
// Believe it or not, this is the best we can do on Linux
|
||||
// (and is what glibc does).
|
||||
return Utimes("/proc/self/fd/"+itoa(fd), tv)
|
||||
return Utimes("/proc/self/fd/"+strconv.Itoa(fd), tv)
|
||||
}
|
||||
|
||||
const ImplementsGetwd = true
|
||||
|
@ -1553,6 +1554,7 @@ func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Sockle
|
|||
var iova [1]Iovec
|
||||
iova[0].Base = &dummy
|
||||
iova[0].SetLen(1)
|
||||
iov = iova[:]
|
||||
}
|
||||
}
|
||||
msg.Control = &oob[0]
|
||||
|
@ -1891,17 +1893,28 @@ func PrctlRetInt(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uint
|
|||
return int(ret), nil
|
||||
}
|
||||
|
||||
// issue 1435.
|
||||
// On linux Setuid and Setgid only affects the current thread, not the process.
|
||||
// This does not match what most callers expect so we must return an error
|
||||
// here rather than letting the caller think that the call succeeded.
|
||||
|
||||
func Setuid(uid int) (err error) {
|
||||
return EOPNOTSUPP
|
||||
return syscall.Setuid(uid)
|
||||
}
|
||||
|
||||
func Setgid(uid int) (err error) {
|
||||
return EOPNOTSUPP
|
||||
func Setgid(gid int) (err error) {
|
||||
return syscall.Setgid(gid)
|
||||
}
|
||||
|
||||
func Setreuid(ruid, euid int) (err error) {
|
||||
return syscall.Setreuid(ruid, euid)
|
||||
}
|
||||
|
||||
func Setregid(rgid, egid int) (err error) {
|
||||
return syscall.Setregid(rgid, egid)
|
||||
}
|
||||
|
||||
func Setresuid(ruid, euid, suid int) (err error) {
|
||||
return syscall.Setresuid(ruid, euid, suid)
|
||||
}
|
||||
|
||||
func Setresgid(rgid, egid, sgid int) (err error) {
|
||||
return syscall.Setresgid(rgid, egid, sgid)
|
||||
}
|
||||
|
||||
// SetfsgidRetGid sets fsgid for current thread and returns previous fsgid set.
|
||||
|
@ -1960,36 +1973,46 @@ func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) {
|
|||
//sys preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PREADV2
|
||||
//sys pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PWRITEV2
|
||||
|
||||
func bytes2iovec(bs [][]byte) []Iovec {
|
||||
iovecs := make([]Iovec, len(bs))
|
||||
for i, b := range bs {
|
||||
iovecs[i].SetLen(len(b))
|
||||
// minIovec is the size of the small initial allocation used by
|
||||
// Readv, Writev, etc.
|
||||
//
|
||||
// This small allocation gets stack allocated, which lets the
|
||||
// common use case of len(iovs) <= minIovs avoid more expensive
|
||||
// heap allocations.
|
||||
const minIovec = 8
|
||||
|
||||
// appendBytes converts bs to Iovecs and appends them to vecs.
|
||||
func appendBytes(vecs []Iovec, bs [][]byte) []Iovec {
|
||||
for _, b := range bs {
|
||||
var v Iovec
|
||||
v.SetLen(len(b))
|
||||
if len(b) > 0 {
|
||||
iovecs[i].Base = &b[0]
|
||||
v.Base = &b[0]
|
||||
} else {
|
||||
iovecs[i].Base = (*byte)(unsafe.Pointer(&_zero))
|
||||
v.Base = (*byte)(unsafe.Pointer(&_zero))
|
||||
}
|
||||
vecs = append(vecs, v)
|
||||
}
|
||||
return iovecs
|
||||
return vecs
|
||||
}
|
||||
|
||||
// offs2lohi splits offs into its lower and upper unsigned long. On 64-bit
|
||||
// systems, hi will always be 0. On 32-bit systems, offs will be split in half.
|
||||
// preadv/pwritev chose this calling convention so they don't need to add a
|
||||
// padding-register for alignment on ARM.
|
||||
// offs2lohi splits offs into its low and high order bits.
|
||||
func offs2lohi(offs int64) (lo, hi uintptr) {
|
||||
return uintptr(offs), uintptr(uint64(offs) >> SizeofLong)
|
||||
const longBits = SizeofLong * 8
|
||||
return uintptr(offs), uintptr(uint64(offs) >> longBits)
|
||||
}
|
||||
|
||||
func Readv(fd int, iovs [][]byte) (n int, err error) {
|
||||
iovecs := bytes2iovec(iovs)
|
||||
iovecs := make([]Iovec, 0, minIovec)
|
||||
iovecs = appendBytes(iovecs, iovs)
|
||||
n, err = readv(fd, iovecs)
|
||||
readvRacedetect(iovecs, n, err)
|
||||
return n, err
|
||||
}
|
||||
|
||||
func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) {
|
||||
iovecs := bytes2iovec(iovs)
|
||||
iovecs := make([]Iovec, 0, minIovec)
|
||||
iovecs = appendBytes(iovecs, iovs)
|
||||
lo, hi := offs2lohi(offset)
|
||||
n, err = preadv(fd, iovecs, lo, hi)
|
||||
readvRacedetect(iovecs, n, err)
|
||||
|
@ -1997,7 +2020,8 @@ func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) {
|
|||
}
|
||||
|
||||
func Preadv2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) {
|
||||
iovecs := bytes2iovec(iovs)
|
||||
iovecs := make([]Iovec, 0, minIovec)
|
||||
iovecs = appendBytes(iovecs, iovs)
|
||||
lo, hi := offs2lohi(offset)
|
||||
n, err = preadv2(fd, iovecs, lo, hi, flags)
|
||||
readvRacedetect(iovecs, n, err)
|
||||
|
@ -2024,7 +2048,8 @@ func readvRacedetect(iovecs []Iovec, n int, err error) {
|
|||
}
|
||||
|
||||
func Writev(fd int, iovs [][]byte) (n int, err error) {
|
||||
iovecs := bytes2iovec(iovs)
|
||||
iovecs := make([]Iovec, 0, minIovec)
|
||||
iovecs = appendBytes(iovecs, iovs)
|
||||
if raceenabled {
|
||||
raceReleaseMerge(unsafe.Pointer(&ioSync))
|
||||
}
|
||||
|
@ -2034,7 +2059,8 @@ func Writev(fd int, iovs [][]byte) (n int, err error) {
|
|||
}
|
||||
|
||||
func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) {
|
||||
iovecs := bytes2iovec(iovs)
|
||||
iovecs := make([]Iovec, 0, minIovec)
|
||||
iovecs = appendBytes(iovecs, iovs)
|
||||
if raceenabled {
|
||||
raceReleaseMerge(unsafe.Pointer(&ioSync))
|
||||
}
|
||||
|
@ -2045,7 +2071,8 @@ func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) {
|
|||
}
|
||||
|
||||
func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) {
|
||||
iovecs := bytes2iovec(iovs)
|
||||
iovecs := make([]Iovec, 0, minIovec)
|
||||
iovecs = appendBytes(iovecs, iovs)
|
||||
if raceenabled {
|
||||
raceReleaseMerge(unsafe.Pointer(&ioSync))
|
||||
}
|
||||
|
@ -2240,7 +2267,7 @@ func (fh *FileHandle) Bytes() []byte {
|
|||
if n == 0 {
|
||||
return nil
|
||||
}
|
||||
return (*[1 << 30]byte)(unsafe.Pointer(uintptr(unsafe.Pointer(&fh.fileHandle.Type)) + 4))[:n:n]
|
||||
return unsafe.Slice((*byte)(unsafe.Pointer(uintptr(unsafe.Pointer(&fh.fileHandle.Type))+4)), n)
|
||||
}
|
||||
|
||||
// NameToHandleAt wraps the name_to_handle_at system call; it obtains
|
||||
|
@ -2356,6 +2383,16 @@ func Setitimer(which ItimerWhich, it Itimerval) (Itimerval, error) {
|
|||
return prev, nil
|
||||
}
|
||||
|
||||
//sysnb rtSigprocmask(how int, set *Sigset_t, oldset *Sigset_t, sigsetsize uintptr) (err error) = SYS_RT_SIGPROCMASK
|
||||
|
||||
func PthreadSigmask(how int, set, oldset *Sigset_t) error {
|
||||
if oldset != nil {
|
||||
// Explicitly clear in case Sigset_t is larger than _C__NSIG.
|
||||
*oldset = Sigset_t{}
|
||||
}
|
||||
return rtSigprocmask(how, set, oldset, _C__NSIG/8)
|
||||
}
|
||||
|
||||
/*
|
||||
* Unimplemented
|
||||
*/
|
||||
|
@ -2414,7 +2451,6 @@ func Setitimer(which ItimerWhich, it Itimerval) (Itimerval, error) {
|
|||
// RestartSyscall
|
||||
// RtSigaction
|
||||
// RtSigpending
|
||||
// RtSigprocmask
|
||||
// RtSigqueueinfo
|
||||
// RtSigreturn
|
||||
// RtSigsuspend
|
||||
|
|
|
@ -41,10 +41,6 @@ func setTimeval(sec, usec int64) Timeval {
|
|||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
|
||||
//sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32
|
||||
//sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32
|
||||
//sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32
|
||||
//sysnb Setreuid(ruid int, euid int) (err error) = SYS_SETREUID32
|
||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
|
||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
||||
|
|
|
@ -46,11 +46,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||
//sys Shutdown(fd int, how int) (err error)
|
||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||
|
||||
|
|
|
@ -62,10 +62,6 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
|||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
|
||||
//sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32
|
||||
//sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32
|
||||
//sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32
|
||||
//sysnb Setreuid(ruid int, euid int) (err error) = SYS_SETREUID32
|
||||
//sys Shutdown(fd int, how int) (err error)
|
||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
|
||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||
|
|
|
@ -39,11 +39,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
//sysnb setrlimit(resource int, rlim *Rlimit) (err error)
|
||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||
//sys Shutdown(fd int, how int) (err error)
|
||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||
|
||||
|
|
|
@ -34,10 +34,6 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||
//sys Shutdown(fd int, how int) (err error)
|
||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||
|
||||
|
|
|
@ -37,11 +37,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||
//sys Shutdown(fd int, how int) (err error)
|
||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||
//sys Statfs(path string, buf *Statfs_t) (err error)
|
||||
|
|
|
@ -32,10 +32,6 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
|
|||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||
//sys Shutdown(fd int, how int) (err error)
|
||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
|
||||
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
||||
|
|
|
@ -34,10 +34,6 @@ import (
|
|||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||
//sys Shutdown(fd int, how int) (err error)
|
||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
|
||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||
|
|
|
@ -34,11 +34,7 @@ package unix
|
|||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||
//sys Shutdown(fd int, how int) (err error)
|
||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||
//sys Stat(path string, stat *Stat_t) (err error)
|
||||
|
|
|
@ -38,11 +38,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||
//sys Shutdown(fd int, how int) (err error)
|
||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||
|
||||
|
|
|
@ -34,11 +34,7 @@ import (
|
|||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||
//sys Stat(path string, stat *Stat_t) (err error)
|
||||
//sys Statfs(path string, buf *Statfs_t) (err error)
|
||||
|
|
|
@ -31,11 +31,7 @@ package unix
|
|||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||
//sys Shutdown(fd int, how int) (err error)
|
||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||
//sys Stat(path string, stat *Stat_t) (err error)
|
||||
|
|
|
@ -110,6 +110,20 @@ func direntNamlen(buf []byte) (uint64, bool) {
|
|||
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
|
||||
}
|
||||
|
||||
func SysctlUvmexp(name string) (*Uvmexp, error) {
|
||||
mib, err := sysctlmib(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
n := uintptr(SizeofUvmexp)
|
||||
var u Uvmexp
|
||||
if err := sysctl(mib, (*byte)(unsafe.Pointer(&u)), &n, nil, 0); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &u, nil
|
||||
}
|
||||
|
||||
func Pipe(p []int) (err error) {
|
||||
return Pipe2(p, 0)
|
||||
}
|
||||
|
@ -245,6 +259,7 @@ func Statvfs(path string, buf *Statvfs_t) (err error) {
|
|||
//sys Chmod(path string, mode uint32) (err error)
|
||||
//sys Chown(path string, uid int, gid int) (err error)
|
||||
//sys Chroot(path string) (err error)
|
||||
//sys ClockGettime(clockid int32, time *Timespec) (err error)
|
||||
//sys Close(fd int) (err error)
|
||||
//sys Dup(fd int) (nfd int, err error)
|
||||
//sys Dup2(from int, to int) (err error)
|
||||
|
|
|
@ -220,6 +220,7 @@ func Uname(uname *Utsname) error {
|
|||
//sys Chmod(path string, mode uint32) (err error)
|
||||
//sys Chown(path string, uid int, gid int) (err error)
|
||||
//sys Chroot(path string) (err error)
|
||||
//sys ClockGettime(clockid int32, time *Timespec) (err error)
|
||||
//sys Close(fd int) (err error)
|
||||
//sys Dup(fd int) (nfd int, err error)
|
||||
//sys Dup2(from int, to int) (err error)
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build (openbsd && 386) || (openbsd && amd64) || (openbsd && arm) || (openbsd && arm64)
|
||||
// +build openbsd,386 openbsd,amd64 openbsd,arm openbsd,arm64
|
||||
//go:build openbsd
|
||||
// +build openbsd
|
||||
|
||||
package unix
|
||||
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ppc64 && openbsd
|
||||
// +build ppc64,openbsd
|
||||
|
||||
package unix
|
||||
|
||||
func setTimespec(sec, nsec int64) Timespec {
|
||||
return Timespec{Sec: sec, Nsec: nsec}
|
||||
}
|
||||
|
||||
func setTimeval(sec, usec int64) Timeval {
|
||||
return Timeval{Sec: sec, Usec: usec}
|
||||
}
|
||||
|
||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||
k.Ident = uint64(fd)
|
||||
k.Filter = int16(mode)
|
||||
k.Flags = uint16(flags)
|
||||
}
|
||||
|
||||
func (iov *Iovec) SetLen(length int) {
|
||||
iov.Len = uint64(length)
|
||||
}
|
||||
|
||||
func (msghdr *Msghdr) SetControllen(length int) {
|
||||
msghdr.Controllen = uint32(length)
|
||||
}
|
||||
|
||||
func (msghdr *Msghdr) SetIovlen(length int) {
|
||||
msghdr.Iovlen = uint32(length)
|
||||
}
|
||||
|
||||
func (cmsg *Cmsghdr) SetLen(length int) {
|
||||
cmsg.Len = uint32(length)
|
||||
}
|
||||
|
||||
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
|
||||
// of openbsd/ppc64 the syscall is called sysctl instead of __sysctl.
|
||||
const SYS___SYSCTL = SYS_SYSCTL
|
|
@ -0,0 +1,42 @@
|
|||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build riscv64 && openbsd
|
||||
// +build riscv64,openbsd
|
||||
|
||||
package unix
|
||||
|
||||
func setTimespec(sec, nsec int64) Timespec {
|
||||
return Timespec{Sec: sec, Nsec: nsec}
|
||||
}
|
||||
|
||||
func setTimeval(sec, usec int64) Timeval {
|
||||
return Timeval{Sec: sec, Usec: usec}
|
||||
}
|
||||
|
||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||
k.Ident = uint64(fd)
|
||||
k.Filter = int16(mode)
|
||||
k.Flags = uint16(flags)
|
||||
}
|
||||
|
||||
func (iov *Iovec) SetLen(length int) {
|
||||
iov.Len = uint64(length)
|
||||
}
|
||||
|
||||
func (msghdr *Msghdr) SetControllen(length int) {
|
||||
msghdr.Controllen = uint32(length)
|
||||
}
|
||||
|
||||
func (msghdr *Msghdr) SetIovlen(length int) {
|
||||
msghdr.Iovlen = uint32(length)
|
||||
}
|
||||
|
||||
func (cmsg *Cmsghdr) SetLen(length int) {
|
||||
cmsg.Len = uint32(length)
|
||||
}
|
||||
|
||||
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
|
||||
// of openbsd/riscv64 the syscall is called sysctl instead of __sysctl.
|
||||
const SYS___SYSCTL = SYS_SYSCTL
|
|
@ -590,6 +590,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
//sys Chmod(path string, mode uint32) (err error)
|
||||
//sys Chown(path string, uid int, gid int) (err error)
|
||||
//sys Chroot(path string) (err error)
|
||||
//sys ClockGettime(clockid int32, time *Timespec) (err error)
|
||||
//sys Close(fd int) (err error)
|
||||
//sys Creat(path string, mode uint32) (fd int, err error)
|
||||
//sys Dup(fd int) (nfd int, err error)
|
||||
|
@ -750,8 +751,8 @@ type EventPort struct {
|
|||
// we should handle things gracefully. To do so, we need to keep an extra
|
||||
// reference to the cookie around until the event is processed
|
||||
// thus the otherwise seemingly extraneous "cookies" map
|
||||
// The key of this map is a pointer to the corresponding &fCookie.cookie
|
||||
cookies map[*interface{}]*fileObjCookie
|
||||
// The key of this map is a pointer to the corresponding fCookie
|
||||
cookies map[*fileObjCookie]struct{}
|
||||
}
|
||||
|
||||
// PortEvent is an abstraction of the port_event C struct.
|
||||
|
@ -778,7 +779,7 @@ func NewEventPort() (*EventPort, error) {
|
|||
port: port,
|
||||
fds: make(map[uintptr]*fileObjCookie),
|
||||
paths: make(map[string]*fileObjCookie),
|
||||
cookies: make(map[*interface{}]*fileObjCookie),
|
||||
cookies: make(map[*fileObjCookie]struct{}),
|
||||
}
|
||||
return e, nil
|
||||
}
|
||||
|
@ -799,6 +800,7 @@ func (e *EventPort) Close() error {
|
|||
}
|
||||
e.fds = nil
|
||||
e.paths = nil
|
||||
e.cookies = nil
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -826,17 +828,16 @@ func (e *EventPort) AssociatePath(path string, stat os.FileInfo, events int, coo
|
|||
if _, found := e.paths[path]; found {
|
||||
return fmt.Errorf("%v is already associated with this Event Port", path)
|
||||
}
|
||||
fobj, err := createFileObj(path, stat)
|
||||
fCookie, err := createFileObjCookie(path, stat, cookie)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fCookie := &fileObjCookie{fobj, cookie}
|
||||
_, err = port_associate(e.port, PORT_SOURCE_FILE, uintptr(unsafe.Pointer(fobj)), events, (*byte)(unsafe.Pointer(&fCookie.cookie)))
|
||||
_, err = port_associate(e.port, PORT_SOURCE_FILE, uintptr(unsafe.Pointer(fCookie.fobj)), events, (*byte)(unsafe.Pointer(fCookie)))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
e.paths[path] = fCookie
|
||||
e.cookies[&fCookie.cookie] = fCookie
|
||||
e.cookies[fCookie] = struct{}{}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -858,7 +859,7 @@ func (e *EventPort) DissociatePath(path string) error {
|
|||
if err == nil {
|
||||
// dissociate was successful, safe to delete the cookie
|
||||
fCookie := e.paths[path]
|
||||
delete(e.cookies, &fCookie.cookie)
|
||||
delete(e.cookies, fCookie)
|
||||
}
|
||||
delete(e.paths, path)
|
||||
return err
|
||||
|
@ -871,13 +872,16 @@ func (e *EventPort) AssociateFd(fd uintptr, events int, cookie interface{}) erro
|
|||
if _, found := e.fds[fd]; found {
|
||||
return fmt.Errorf("%v is already associated with this Event Port", fd)
|
||||
}
|
||||
fCookie := &fileObjCookie{nil, cookie}
|
||||
_, err := port_associate(e.port, PORT_SOURCE_FD, fd, events, (*byte)(unsafe.Pointer(&fCookie.cookie)))
|
||||
fCookie, err := createFileObjCookie("", nil, cookie)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = port_associate(e.port, PORT_SOURCE_FD, fd, events, (*byte)(unsafe.Pointer(fCookie)))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
e.fds[fd] = fCookie
|
||||
e.cookies[&fCookie.cookie] = fCookie
|
||||
e.cookies[fCookie] = struct{}{}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -896,27 +900,31 @@ func (e *EventPort) DissociateFd(fd uintptr) error {
|
|||
if err == nil {
|
||||
// dissociate was successful, safe to delete the cookie
|
||||
fCookie := e.fds[fd]
|
||||
delete(e.cookies, &fCookie.cookie)
|
||||
delete(e.cookies, fCookie)
|
||||
}
|
||||
delete(e.fds, fd)
|
||||
return err
|
||||
}
|
||||
|
||||
func createFileObj(name string, stat os.FileInfo) (*fileObj, error) {
|
||||
fobj := new(fileObj)
|
||||
bs, err := ByteSliceFromString(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
func createFileObjCookie(name string, stat os.FileInfo, cookie interface{}) (*fileObjCookie, error) {
|
||||
fCookie := new(fileObjCookie)
|
||||
fCookie.cookie = cookie
|
||||
if name != "" && stat != nil {
|
||||
fCookie.fobj = new(fileObj)
|
||||
bs, err := ByteSliceFromString(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fCookie.fobj.Name = (*int8)(unsafe.Pointer(&bs[0]))
|
||||
s := stat.Sys().(*syscall.Stat_t)
|
||||
fCookie.fobj.Atim.Sec = s.Atim.Sec
|
||||
fCookie.fobj.Atim.Nsec = s.Atim.Nsec
|
||||
fCookie.fobj.Mtim.Sec = s.Mtim.Sec
|
||||
fCookie.fobj.Mtim.Nsec = s.Mtim.Nsec
|
||||
fCookie.fobj.Ctim.Sec = s.Ctim.Sec
|
||||
fCookie.fobj.Ctim.Nsec = s.Ctim.Nsec
|
||||
}
|
||||
fobj.Name = (*int8)(unsafe.Pointer(&bs[0]))
|
||||
s := stat.Sys().(*syscall.Stat_t)
|
||||
fobj.Atim.Sec = s.Atim.Sec
|
||||
fobj.Atim.Nsec = s.Atim.Nsec
|
||||
fobj.Mtim.Sec = s.Mtim.Sec
|
||||
fobj.Mtim.Nsec = s.Mtim.Nsec
|
||||
fobj.Ctim.Sec = s.Ctim.Sec
|
||||
fobj.Ctim.Nsec = s.Ctim.Nsec
|
||||
return fobj, nil
|
||||
return fCookie, nil
|
||||
}
|
||||
|
||||
// GetOne wraps port_get(3c) and returns a single PortEvent.
|
||||
|
@ -929,44 +937,50 @@ func (e *EventPort) GetOne(t *Timespec) (*PortEvent, error) {
|
|||
p := new(PortEvent)
|
||||
e.mu.Lock()
|
||||
defer e.mu.Unlock()
|
||||
e.peIntToExt(pe, p)
|
||||
err = e.peIntToExt(pe, p)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return p, nil
|
||||
}
|
||||
|
||||
// peIntToExt converts a cgo portEvent struct into the friendlier PortEvent
|
||||
// NOTE: Always call this function while holding the e.mu mutex
|
||||
func (e *EventPort) peIntToExt(peInt *portEvent, peExt *PortEvent) {
|
||||
func (e *EventPort) peIntToExt(peInt *portEvent, peExt *PortEvent) error {
|
||||
if e.cookies == nil {
|
||||
return fmt.Errorf("this EventPort is already closed")
|
||||
}
|
||||
peExt.Events = peInt.Events
|
||||
peExt.Source = peInt.Source
|
||||
cookie := (*interface{})(unsafe.Pointer(peInt.User))
|
||||
peExt.Cookie = *cookie
|
||||
fCookie := (*fileObjCookie)(unsafe.Pointer(peInt.User))
|
||||
_, found := e.cookies[fCookie]
|
||||
|
||||
if !found {
|
||||
panic("unexpected event port address; may be due to kernel bug; see https://go.dev/issue/54254")
|
||||
}
|
||||
peExt.Cookie = fCookie.cookie
|
||||
delete(e.cookies, fCookie)
|
||||
|
||||
switch peInt.Source {
|
||||
case PORT_SOURCE_FD:
|
||||
delete(e.cookies, cookie)
|
||||
peExt.Fd = uintptr(peInt.Object)
|
||||
// Only remove the fds entry if it exists and this cookie matches
|
||||
if fobj, ok := e.fds[peExt.Fd]; ok {
|
||||
if &fobj.cookie == cookie {
|
||||
if fobj == fCookie {
|
||||
delete(e.fds, peExt.Fd)
|
||||
}
|
||||
}
|
||||
case PORT_SOURCE_FILE:
|
||||
if fCookie, ok := e.cookies[cookie]; ok && uintptr(unsafe.Pointer(fCookie.fobj)) == uintptr(peInt.Object) {
|
||||
// Use our stashed reference rather than using unsafe on what we got back
|
||||
// the unsafe version would be (*fileObj)(unsafe.Pointer(uintptr(peInt.Object)))
|
||||
peExt.fobj = fCookie.fobj
|
||||
} else {
|
||||
panic("mismanaged memory")
|
||||
}
|
||||
delete(e.cookies, cookie)
|
||||
peExt.fobj = fCookie.fobj
|
||||
peExt.Path = BytePtrToString((*byte)(unsafe.Pointer(peExt.fobj.Name)))
|
||||
// Only remove the paths entry if it exists and this cookie matches
|
||||
if fobj, ok := e.paths[peExt.Path]; ok {
|
||||
if &fobj.cookie == cookie {
|
||||
if fobj == fCookie {
|
||||
delete(e.paths, peExt.Path)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Pending wraps port_getn(3c) and returns how many events are pending.
|
||||
|
@ -990,7 +1004,7 @@ func (e *EventPort) Get(s []PortEvent, min int, timeout *Timespec) (int, error)
|
|||
got := uint32(min)
|
||||
max := uint32(len(s))
|
||||
var err error
|
||||
ps := make([]portEvent, max, max)
|
||||
ps := make([]portEvent, max)
|
||||
_, err = port_getn(e.port, &ps[0], max, &got, timeout)
|
||||
// got will be trustworthy with ETIME, but not any other error.
|
||||
if err != nil && err != ETIME {
|
||||
|
@ -998,8 +1012,122 @@ func (e *EventPort) Get(s []PortEvent, min int, timeout *Timespec) (int, error)
|
|||
}
|
||||
e.mu.Lock()
|
||||
defer e.mu.Unlock()
|
||||
valid := 0
|
||||
for i := 0; i < int(got); i++ {
|
||||
e.peIntToExt(&ps[i], &s[i])
|
||||
err2 := e.peIntToExt(&ps[i], &s[i])
|
||||
if err2 != nil {
|
||||
if valid == 0 && err == nil {
|
||||
// If err2 is the only error and there are no valid events
|
||||
// to return, return it to the caller.
|
||||
err = err2
|
||||
}
|
||||
break
|
||||
}
|
||||
valid = i + 1
|
||||
}
|
||||
return int(got), err
|
||||
return valid, err
|
||||
}
|
||||
|
||||
//sys putmsg(fd int, clptr *strbuf, dataptr *strbuf, flags int) (err error)
|
||||
|
||||
func Putmsg(fd int, cl []byte, data []byte, flags int) (err error) {
|
||||
var clp, datap *strbuf
|
||||
if len(cl) > 0 {
|
||||
clp = &strbuf{
|
||||
Len: int32(len(cl)),
|
||||
Buf: (*int8)(unsafe.Pointer(&cl[0])),
|
||||
}
|
||||
}
|
||||
if len(data) > 0 {
|
||||
datap = &strbuf{
|
||||
Len: int32(len(data)),
|
||||
Buf: (*int8)(unsafe.Pointer(&data[0])),
|
||||
}
|
||||
}
|
||||
return putmsg(fd, clp, datap, flags)
|
||||
}
|
||||
|
||||
//sys getmsg(fd int, clptr *strbuf, dataptr *strbuf, flags *int) (err error)
|
||||
|
||||
func Getmsg(fd int, cl []byte, data []byte) (retCl []byte, retData []byte, flags int, err error) {
|
||||
var clp, datap *strbuf
|
||||
if len(cl) > 0 {
|
||||
clp = &strbuf{
|
||||
Maxlen: int32(len(cl)),
|
||||
Buf: (*int8)(unsafe.Pointer(&cl[0])),
|
||||
}
|
||||
}
|
||||
if len(data) > 0 {
|
||||
datap = &strbuf{
|
||||
Maxlen: int32(len(data)),
|
||||
Buf: (*int8)(unsafe.Pointer(&data[0])),
|
||||
}
|
||||
}
|
||||
|
||||
if err = getmsg(fd, clp, datap, &flags); err != nil {
|
||||
return nil, nil, 0, err
|
||||
}
|
||||
|
||||
if len(cl) > 0 {
|
||||
retCl = cl[:clp.Len]
|
||||
}
|
||||
if len(data) > 0 {
|
||||
retData = data[:datap.Len]
|
||||
}
|
||||
return retCl, retData, flags, nil
|
||||
}
|
||||
|
||||
func IoctlSetIntRetInt(fd int, req uint, arg int) (int, error) {
|
||||
return ioctlRet(fd, req, uintptr(arg))
|
||||
}
|
||||
|
||||
func IoctlSetString(fd int, req uint, val string) error {
|
||||
bs := make([]byte, len(val)+1)
|
||||
copy(bs[:len(bs)-1], val)
|
||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&bs[0])))
|
||||
runtime.KeepAlive(&bs[0])
|
||||
return err
|
||||
}
|
||||
|
||||
// Lifreq Helpers
|
||||
|
||||
func (l *Lifreq) SetName(name string) error {
|
||||
if len(name) >= len(l.Name) {
|
||||
return fmt.Errorf("name cannot be more than %d characters", len(l.Name)-1)
|
||||
}
|
||||
for i := range name {
|
||||
l.Name[i] = int8(name[i])
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *Lifreq) SetLifruInt(d int) {
|
||||
*(*int)(unsafe.Pointer(&l.Lifru[0])) = d
|
||||
}
|
||||
|
||||
func (l *Lifreq) GetLifruInt() int {
|
||||
return *(*int)(unsafe.Pointer(&l.Lifru[0]))
|
||||
}
|
||||
|
||||
func (l *Lifreq) SetLifruUint(d uint) {
|
||||
*(*uint)(unsafe.Pointer(&l.Lifru[0])) = d
|
||||
}
|
||||
|
||||
func (l *Lifreq) GetLifruUint() uint {
|
||||
return *(*uint)(unsafe.Pointer(&l.Lifru[0]))
|
||||
}
|
||||
|
||||
func IoctlLifreq(fd int, req uint, l *Lifreq) error {
|
||||
return ioctl(fd, req, uintptr(unsafe.Pointer(l)))
|
||||
}
|
||||
|
||||
// Strioctl Helpers
|
||||
|
||||
func (s *Strioctl) SetInt(i int) {
|
||||
s.Len = int32(unsafe.Sizeof(i))
|
||||
s.Dp = (*int8)(unsafe.Pointer(&i))
|
||||
}
|
||||
|
||||
func IoctlSetStrioctlRetInt(fd int, req uint, s *Strioctl) (int, error) {
|
||||
return ioctlRet(fd, req, uintptr(unsafe.Pointer(s)))
|
||||
}
|
||||
|
|
|
@ -13,8 +13,6 @@ import (
|
|||
"sync"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/internal/unsafeheader"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -117,11 +115,7 @@ func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (d
|
|||
}
|
||||
|
||||
// Use unsafe to convert addr into a []byte.
|
||||
var b []byte
|
||||
hdr := (*unsafeheader.Slice)(unsafe.Pointer(&b))
|
||||
hdr.Data = unsafe.Pointer(addr)
|
||||
hdr.Cap = length
|
||||
hdr.Len = length
|
||||
b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), length)
|
||||
|
||||
// Register mapping in m and return it.
|
||||
p := &b[cap(b)-1]
|
||||
|
@ -337,6 +331,19 @@ func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
// Recvmsg receives a message from a socket using the recvmsg system call. The
|
||||
// received non-control data will be written to p, and any "out of band"
|
||||
// control data will be written to oob. The flags are passed to recvmsg.
|
||||
//
|
||||
// The results are:
|
||||
// - n is the number of non-control data bytes read into p
|
||||
// - oobn is the number of control data bytes read into oob; this may be interpreted using [ParseSocketControlMessage]
|
||||
// - recvflags is flags returned by recvmsg
|
||||
// - from is the address of the sender
|
||||
//
|
||||
// If the underlying socket type is not SOCK_DGRAM, a received message
|
||||
// containing oob data and a single '\0' of non-control data is treated as if
|
||||
// the message contained only control data, i.e. n will be zero on return.
|
||||
func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
|
||||
var iov [1]Iovec
|
||||
if len(p) > 0 {
|
||||
|
@ -352,13 +359,9 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from
|
|||
return
|
||||
}
|
||||
|
||||
// RecvmsgBuffers receives a message from a socket using the recvmsg
|
||||
// system call. The flags are passed to recvmsg. Any non-control data
|
||||
// read is scattered into the buffers slices. The results are:
|
||||
// - n is the number of non-control data read into bufs
|
||||
// - oobn is the number of control data read into oob; this may be interpreted using [ParseSocketControlMessage]
|
||||
// - recvflags is flags returned by recvmsg
|
||||
// - from is the address of the sender
|
||||
// RecvmsgBuffers receives a message from a socket using the recvmsg system
|
||||
// call. This function is equivalent to Recvmsg, but non-control data read is
|
||||
// scattered into the buffers slices.
|
||||
func RecvmsgBuffers(fd int, buffers [][]byte, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
|
||||
iov := make([]Iovec, len(buffers))
|
||||
for i := range buffers {
|
||||
|
@ -377,11 +380,38 @@ func RecvmsgBuffers(fd int, buffers [][]byte, oob []byte, flags int) (n, oobn in
|
|||
return
|
||||
}
|
||||
|
||||
// Sendmsg sends a message on a socket to an address using the sendmsg system
|
||||
// call. This function is equivalent to SendmsgN, but does not return the
|
||||
// number of bytes actually sent.
|
||||
func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {
|
||||
_, err = SendmsgN(fd, p, oob, to, flags)
|
||||
return
|
||||
}
|
||||
|
||||
// SendmsgN sends a message on a socket to an address using the sendmsg system
|
||||
// call. p contains the non-control data to send, and oob contains the "out of
|
||||
// band" control data. The flags are passed to sendmsg. The number of
|
||||
// non-control bytes actually written to the socket is returned.
|
||||
//
|
||||
// Some socket types do not support sending control data without accompanying
|
||||
// non-control data. If p is empty, and oob contains control data, and the
|
||||
// underlying socket type is not SOCK_DGRAM, p will be treated as containing a
|
||||
// single '\0' and the return value will indicate zero bytes sent.
|
||||
//
|
||||
// The Go function Recvmsg, if called with an empty p and a non-empty oob,
|
||||
// will read and ignore this additional '\0'. If the message is received by
|
||||
// code that does not use Recvmsg, or that does not use Go at all, that code
|
||||
// will need to be written to expect and ignore the additional '\0'.
|
||||
//
|
||||
// If you need to send non-empty oob with p actually empty, and if the
|
||||
// underlying socket type supports it, you can do so via a raw system call as
|
||||
// follows:
|
||||
//
|
||||
// msg := &unix.Msghdr{
|
||||
// Control: &oob[0],
|
||||
// }
|
||||
// msg.SetControllen(len(oob))
|
||||
// n, _, errno := unix.Syscall(unix.SYS_SENDMSG, uintptr(fd), uintptr(unsafe.Pointer(msg)), flags)
|
||||
func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
|
||||
var iov [1]Iovec
|
||||
if len(p) > 0 {
|
||||
|
@ -400,9 +430,8 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)
|
|||
}
|
||||
|
||||
// SendmsgBuffers sends a message on a socket to an address using the sendmsg
|
||||
// system call. The flags are passed to sendmsg. Any non-control data written
|
||||
// is gathered from buffers. The function returns the number of bytes written
|
||||
// to the socket.
|
||||
// system call. This function is equivalent to SendmsgN, but the non-control
|
||||
// data is gathered from buffers.
|
||||
func SendmsgBuffers(fd int, buffers [][]byte, oob []byte, to Sockaddr, flags int) (n int, err error) {
|
||||
iov := make([]Iovec, len(buffers))
|
||||
for i := range buffers {
|
||||
|
@ -429,11 +458,15 @@ func Send(s int, buf []byte, flags int) (err error) {
|
|||
}
|
||||
|
||||
func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error) {
|
||||
ptr, n, err := to.sockaddr()
|
||||
if err != nil {
|
||||
return err
|
||||
var ptr unsafe.Pointer
|
||||
var salen _Socklen
|
||||
if to != nil {
|
||||
ptr, salen, err = to.sockaddr()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return sendto(fd, p, flags, ptr, n)
|
||||
return sendto(fd, p, flags, ptr, salen)
|
||||
}
|
||||
|
||||
func SetsockoptByte(fd, level, opt int, value byte) (err error) {
|
||||
|
|
|
@ -2,11 +2,9 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build (darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && gc && !ppc64le && !ppc64
|
||||
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||
//go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc
|
||||
// +build darwin dragonfly freebsd linux,!ppc64,!ppc64le netbsd openbsd solaris
|
||||
// +build gc
|
||||
// +build !ppc64le
|
||||
// +build !ppc64
|
||||
|
||||
package unix
|
||||
|
||||
|
|
|
@ -9,8 +9,10 @@ package unix
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
@ -55,7 +57,13 @@ func (d *Dirent) NameString() string {
|
|||
if d == nil {
|
||||
return ""
|
||||
}
|
||||
return string(d.Name[:d.Namlen])
|
||||
s := string(d.Name[:])
|
||||
idx := strings.IndexByte(s, 0)
|
||||
if idx == -1 {
|
||||
return s
|
||||
} else {
|
||||
return s[:idx]
|
||||
}
|
||||
}
|
||||
|
||||
func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||
|
@ -1230,6 +1238,14 @@ func Readdir(dir uintptr) (*Dirent, error) {
|
|||
return &ent, err
|
||||
}
|
||||
|
||||
func readdir_r(dirp uintptr, entry *direntLE, result **direntLE) (err error) {
|
||||
r0, _, e1 := syscall_syscall(SYS___READDIR_R_A, dirp, uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
|
||||
if int64(r0) == -1 {
|
||||
err = errnoErr(Errno(e1))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func Closedir(dir uintptr) error {
|
||||
_, _, e := syscall_syscall(SYS_CLOSEDIR, dir, 0, 0)
|
||||
if e != 0 {
|
||||
|
@ -1821,3 +1837,158 @@ func Unmount(name string, mtm int) (err error) {
|
|||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func fdToPath(dirfd int) (path string, err error) {
|
||||
var buffer [1024]byte
|
||||
// w_ctrl()
|
||||
ret := runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS_W_IOCTL<<4,
|
||||
[]uintptr{uintptr(dirfd), 17, 1024, uintptr(unsafe.Pointer(&buffer[0]))})
|
||||
if ret == 0 {
|
||||
zb := bytes.IndexByte(buffer[:], 0)
|
||||
if zb == -1 {
|
||||
zb = len(buffer)
|
||||
}
|
||||
// __e2a_l()
|
||||
runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___E2A_L<<4,
|
||||
[]uintptr{uintptr(unsafe.Pointer(&buffer[0])), uintptr(zb)})
|
||||
return string(buffer[:zb]), nil
|
||||
}
|
||||
// __errno()
|
||||
errno := int(*(*int32)(unsafe.Pointer(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO<<4,
|
||||
[]uintptr{}))))
|
||||
// __errno2()
|
||||
errno2 := int(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO2<<4,
|
||||
[]uintptr{}))
|
||||
// strerror_r()
|
||||
ret = runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS_STRERROR_R<<4,
|
||||
[]uintptr{uintptr(errno), uintptr(unsafe.Pointer(&buffer[0])), 1024})
|
||||
if ret == 0 {
|
||||
zb := bytes.IndexByte(buffer[:], 0)
|
||||
if zb == -1 {
|
||||
zb = len(buffer)
|
||||
}
|
||||
return "", fmt.Errorf("%s (errno2=0x%x)", buffer[:zb], errno2)
|
||||
} else {
|
||||
return "", fmt.Errorf("fdToPath errno %d (errno2=0x%x)", errno, errno2)
|
||||
}
|
||||
}
|
||||
|
||||
func direntLeToDirentUnix(dirent *direntLE, dir uintptr, path string) (Dirent, error) {
|
||||
var d Dirent
|
||||
|
||||
d.Ino = uint64(dirent.Ino)
|
||||
offset, err := Telldir(dir)
|
||||
if err != nil {
|
||||
return d, err
|
||||
}
|
||||
|
||||
d.Off = int64(offset)
|
||||
s := string(bytes.Split(dirent.Name[:], []byte{0})[0])
|
||||
copy(d.Name[:], s)
|
||||
|
||||
d.Reclen = uint16(24 + len(d.NameString()))
|
||||
var st Stat_t
|
||||
path = path + "/" + s
|
||||
err = Lstat(path, &st)
|
||||
if err != nil {
|
||||
return d, err
|
||||
}
|
||||
|
||||
d.Type = uint8(st.Mode >> 24)
|
||||
return d, err
|
||||
}
|
||||
|
||||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
||||
// Simulation of Getdirentries port from the Darwin implementation.
|
||||
// COMMENTS FROM DARWIN:
|
||||
// It's not the full required semantics, but should handle the case
|
||||
// of calling Getdirentries or ReadDirent repeatedly.
|
||||
// It won't handle assigning the results of lseek to *basep, or handle
|
||||
// the directory being edited underfoot.
|
||||
|
||||
skip, err := Seek(fd, 0, 1 /* SEEK_CUR */)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
// Get path from fd to avoid unavailable call (fdopendir)
|
||||
path, err := fdToPath(fd)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
d, err := Opendir(path)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
defer Closedir(d)
|
||||
|
||||
var cnt int64
|
||||
for {
|
||||
var entryLE direntLE
|
||||
var entrypLE *direntLE
|
||||
e := readdir_r(d, &entryLE, &entrypLE)
|
||||
if e != nil {
|
||||
return n, e
|
||||
}
|
||||
if entrypLE == nil {
|
||||
break
|
||||
}
|
||||
if skip > 0 {
|
||||
skip--
|
||||
cnt++
|
||||
continue
|
||||
}
|
||||
|
||||
// Dirent on zos has a different structure
|
||||
entry, e := direntLeToDirentUnix(&entryLE, d, path)
|
||||
if e != nil {
|
||||
return n, e
|
||||
}
|
||||
|
||||
reclen := int(entry.Reclen)
|
||||
if reclen > len(buf) {
|
||||
// Not enough room. Return for now.
|
||||
// The counter will let us know where we should start up again.
|
||||
// Note: this strategy for suspending in the middle and
|
||||
// restarting is O(n^2) in the length of the directory. Oh well.
|
||||
break
|
||||
}
|
||||
|
||||
// Copy entry into return buffer.
|
||||
s := unsafe.Slice((*byte)(unsafe.Pointer(&entry)), reclen)
|
||||
copy(buf, s)
|
||||
|
||||
buf = buf[reclen:]
|
||||
n += reclen
|
||||
cnt++
|
||||
}
|
||||
// Set the seek offset of the input fd to record
|
||||
// how many files we've already returned.
|
||||
_, err = Seek(fd, cnt, 0 /* SEEK_SET */)
|
||||
if err != nil {
|
||||
return n, err
|
||||
}
|
||||
|
||||
return n, nil
|
||||
}
|
||||
|
||||
func ReadDirent(fd int, buf []byte) (n int, err error) {
|
||||
var base = (*uintptr)(unsafe.Pointer(new(uint64)))
|
||||
return Getdirentries(fd, buf, base)
|
||||
}
|
||||
|
||||
func direntIno(buf []byte) (uint64, bool) {
|
||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino))
|
||||
}
|
||||
|
||||
func direntReclen(buf []byte) (uint64, bool) {
|
||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
|
||||
}
|
||||
|
||||
func direntNamlen(buf []byte) (uint64, bool) {
|
||||
reclen, ok := direntReclen(buf)
|
||||
if !ok {
|
||||
return 0, false
|
||||
}
|
||||
return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true
|
||||
}
|
||||
|
|
|
@ -7,11 +7,7 @@
|
|||
|
||||
package unix
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/internal/unsafeheader"
|
||||
)
|
||||
import "unsafe"
|
||||
|
||||
// SysvShmAttach attaches the Sysv shared memory segment associated with the
|
||||
// shared memory identifier id.
|
||||
|
@ -34,12 +30,7 @@ func SysvShmAttach(id int, addr uintptr, flag int) ([]byte, error) {
|
|||
}
|
||||
|
||||
// Use unsafe to convert addr into a []byte.
|
||||
// TODO: convert to unsafe.Slice once we can assume Go 1.17
|
||||
var b []byte
|
||||
hdr := (*unsafeheader.Slice)(unsafe.Pointer(&b))
|
||||
hdr.Data = unsafe.Pointer(addr)
|
||||
hdr.Cap = int(info.Segsz)
|
||||
hdr.Len = int(info.Segsz)
|
||||
b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), int(info.Segsz))
|
||||
return b, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -160,13 +160,12 @@ func Lremovexattr(link string, attr string) (err error) {
|
|||
}
|
||||
|
||||
func Listxattr(file string, dest []byte) (sz int, err error) {
|
||||
d := initxattrdest(dest, 0)
|
||||
destsiz := len(dest)
|
||||
|
||||
// FreeBSD won't allow you to list xattrs from multiple namespaces
|
||||
s := 0
|
||||
s, pos := 0, 0
|
||||
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
||||
stmp, e := ExtattrListFile(file, nsid, uintptr(d), destsiz)
|
||||
stmp, e := ListxattrNS(file, nsid, dest[pos:])
|
||||
|
||||
/* Errors accessing system attrs are ignored so that
|
||||
* we can implement the Linux-like behavior of omitting errors that
|
||||
|
@ -175,66 +174,102 @@ func Listxattr(file string, dest []byte) (sz int, err error) {
|
|||
* Linux will still error if we ask for user attributes on a file that
|
||||
* we don't have read permissions on, so don't ignore those errors
|
||||
*/
|
||||
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
||||
continue
|
||||
} else if e != nil {
|
||||
if e != nil {
|
||||
if e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
||||
continue
|
||||
}
|
||||
return s, e
|
||||
}
|
||||
|
||||
s += stmp
|
||||
destsiz -= s
|
||||
if destsiz < 0 {
|
||||
destsiz = 0
|
||||
pos = s
|
||||
if pos > destsiz {
|
||||
pos = destsiz
|
||||
}
|
||||
d = initxattrdest(dest, s)
|
||||
}
|
||||
|
||||
return s, nil
|
||||
}
|
||||
|
||||
func ListxattrNS(file string, nsid int, dest []byte) (sz int, err error) {
|
||||
d := initxattrdest(dest, 0)
|
||||
destsiz := len(dest)
|
||||
|
||||
s, e := ExtattrListFile(file, nsid, uintptr(d), destsiz)
|
||||
if e != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return s, nil
|
||||
}
|
||||
|
||||
func Flistxattr(fd int, dest []byte) (sz int, err error) {
|
||||
d := initxattrdest(dest, 0)
|
||||
destsiz := len(dest)
|
||||
|
||||
s := 0
|
||||
s, pos := 0, 0
|
||||
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
||||
stmp, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz)
|
||||
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
||||
continue
|
||||
} else if e != nil {
|
||||
stmp, e := FlistxattrNS(fd, nsid, dest[pos:])
|
||||
|
||||
if e != nil {
|
||||
if e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
||||
continue
|
||||
}
|
||||
return s, e
|
||||
}
|
||||
|
||||
s += stmp
|
||||
destsiz -= s
|
||||
if destsiz < 0 {
|
||||
destsiz = 0
|
||||
pos = s
|
||||
if pos > destsiz {
|
||||
pos = destsiz
|
||||
}
|
||||
d = initxattrdest(dest, s)
|
||||
}
|
||||
|
||||
return s, nil
|
||||
}
|
||||
|
||||
func FlistxattrNS(fd int, nsid int, dest []byte) (sz int, err error) {
|
||||
d := initxattrdest(dest, 0)
|
||||
destsiz := len(dest)
|
||||
|
||||
s, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz)
|
||||
if e != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return s, nil
|
||||
}
|
||||
|
||||
func Llistxattr(link string, dest []byte) (sz int, err error) {
|
||||
d := initxattrdest(dest, 0)
|
||||
destsiz := len(dest)
|
||||
|
||||
s := 0
|
||||
s, pos := 0, 0
|
||||
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
||||
stmp, e := ExtattrListLink(link, nsid, uintptr(d), destsiz)
|
||||
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
||||
continue
|
||||
} else if e != nil {
|
||||
stmp, e := LlistxattrNS(link, nsid, dest[pos:])
|
||||
|
||||
if e != nil {
|
||||
if e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
||||
continue
|
||||
}
|
||||
return s, e
|
||||
}
|
||||
|
||||
s += stmp
|
||||
destsiz -= s
|
||||
if destsiz < 0 {
|
||||
destsiz = 0
|
||||
pos = s
|
||||
if pos > destsiz {
|
||||
pos = destsiz
|
||||
}
|
||||
d = initxattrdest(dest, s)
|
||||
}
|
||||
|
||||
return s, nil
|
||||
}
|
||||
|
||||
func LlistxattrNS(link string, nsid int, dest []byte) (sz int, err error) {
|
||||
d := initxattrdest(dest, 0)
|
||||
destsiz := len(dest)
|
||||
|
||||
s, e := ExtattrListLink(link, nsid, uintptr(d), destsiz)
|
||||
if e != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return s, nil
|
||||
|
|
|
@ -46,6 +46,7 @@ const (
|
|||
AF_SNA = 0xb
|
||||
AF_UNIX = 0x1
|
||||
AF_UNSPEC = 0x0
|
||||
ALTWERASE = 0x200
|
||||
ARPHRD_ETHER = 0x1
|
||||
ARPHRD_FRELAY = 0xf
|
||||
ARPHRD_IEEE1394 = 0x18
|
||||
|
@ -108,6 +109,15 @@ const (
|
|||
BPF_DIRECTION_IN = 0x1
|
||||
BPF_DIRECTION_OUT = 0x2
|
||||
BPF_DIV = 0x30
|
||||
BPF_FILDROP_CAPTURE = 0x1
|
||||
BPF_FILDROP_DROP = 0x2
|
||||
BPF_FILDROP_PASS = 0x0
|
||||
BPF_F_DIR_IN = 0x10
|
||||
BPF_F_DIR_MASK = 0x30
|
||||
BPF_F_DIR_OUT = 0x20
|
||||
BPF_F_DIR_SHIFT = 0x4
|
||||
BPF_F_FLOWID = 0x8
|
||||
BPF_F_PRI_MASK = 0x7
|
||||
BPF_H = 0x8
|
||||
BPF_IMM = 0x0
|
||||
BPF_IND = 0x40
|
||||
|
@ -136,6 +146,7 @@ const (
|
|||
BPF_OR = 0x40
|
||||
BPF_RELEASE = 0x30bb6
|
||||
BPF_RET = 0x6
|
||||
BPF_RND = 0xc0
|
||||
BPF_RSH = 0x70
|
||||
BPF_ST = 0x2
|
||||
BPF_STX = 0x3
|
||||
|
@ -147,6 +158,12 @@ const (
|
|||
BRKINT = 0x2
|
||||
CFLUSH = 0xf
|
||||
CLOCAL = 0x8000
|
||||
CLOCK_BOOTTIME = 0x6
|
||||
CLOCK_MONOTONIC = 0x3
|
||||
CLOCK_PROCESS_CPUTIME_ID = 0x2
|
||||
CLOCK_REALTIME = 0x0
|
||||
CLOCK_THREAD_CPUTIME_ID = 0x4
|
||||
CLOCK_UPTIME = 0x5
|
||||
CPUSTATES = 0x6
|
||||
CP_IDLE = 0x5
|
||||
CP_INTR = 0x4
|
||||
|
@ -170,7 +187,65 @@ const (
|
|||
CTL_KERN = 0x1
|
||||
CTL_MAXNAME = 0xc
|
||||
CTL_NET = 0x4
|
||||
DIOCADDQUEUE = 0xc100445d
|
||||
DIOCADDRULE = 0xccc84404
|
||||
DIOCADDSTATE = 0xc1084425
|
||||
DIOCCHANGERULE = 0xccc8441a
|
||||
DIOCCLRIFFLAG = 0xc024445a
|
||||
DIOCCLRSRCNODES = 0x20004455
|
||||
DIOCCLRSTATES = 0xc0d04412
|
||||
DIOCCLRSTATUS = 0xc0244416
|
||||
DIOCGETLIMIT = 0xc0084427
|
||||
DIOCGETQSTATS = 0xc1084460
|
||||
DIOCGETQUEUE = 0xc100445f
|
||||
DIOCGETQUEUES = 0xc100445e
|
||||
DIOCGETRULE = 0xccc84407
|
||||
DIOCGETRULES = 0xccc84406
|
||||
DIOCGETRULESET = 0xc444443b
|
||||
DIOCGETRULESETS = 0xc444443a
|
||||
DIOCGETSRCNODES = 0xc0084454
|
||||
DIOCGETSTATE = 0xc1084413
|
||||
DIOCGETSTATES = 0xc0084419
|
||||
DIOCGETSTATUS = 0xc1e84415
|
||||
DIOCGETSYNFLWATS = 0xc0084463
|
||||
DIOCGETTIMEOUT = 0xc008441e
|
||||
DIOCIGETIFACES = 0xc0244457
|
||||
DIOCKILLSRCNODES = 0xc068445b
|
||||
DIOCKILLSTATES = 0xc0d04429
|
||||
DIOCNATLOOK = 0xc0504417
|
||||
DIOCOSFPADD = 0xc084444f
|
||||
DIOCOSFPFLUSH = 0x2000444e
|
||||
DIOCOSFPGET = 0xc0844450
|
||||
DIOCRADDADDRS = 0xc44c4443
|
||||
DIOCRADDTABLES = 0xc44c443d
|
||||
DIOCRCLRADDRS = 0xc44c4442
|
||||
DIOCRCLRASTATS = 0xc44c4448
|
||||
DIOCRCLRTABLES = 0xc44c443c
|
||||
DIOCRCLRTSTATS = 0xc44c4441
|
||||
DIOCRDELADDRS = 0xc44c4444
|
||||
DIOCRDELTABLES = 0xc44c443e
|
||||
DIOCRGETADDRS = 0xc44c4446
|
||||
DIOCRGETASTATS = 0xc44c4447
|
||||
DIOCRGETTABLES = 0xc44c443f
|
||||
DIOCRGETTSTATS = 0xc44c4440
|
||||
DIOCRINADEFINE = 0xc44c444d
|
||||
DIOCRSETADDRS = 0xc44c4445
|
||||
DIOCRSETTFLAGS = 0xc44c444a
|
||||
DIOCRTSTADDRS = 0xc44c4449
|
||||
DIOCSETDEBUG = 0xc0044418
|
||||
DIOCSETHOSTID = 0xc0044456
|
||||
DIOCSETIFFLAG = 0xc0244459
|
||||
DIOCSETLIMIT = 0xc0084428
|
||||
DIOCSETREASS = 0xc004445c
|
||||
DIOCSETSTATUSIF = 0xc0244414
|
||||
DIOCSETSYNCOOKIES = 0xc0014462
|
||||
DIOCSETSYNFLWATS = 0xc0084461
|
||||
DIOCSETTIMEOUT = 0xc008441d
|
||||
DIOCSTART = 0x20004401
|
||||
DIOCSTOP = 0x20004402
|
||||
DIOCXBEGIN = 0xc00c4451
|
||||
DIOCXCOMMIT = 0xc00c4452
|
||||
DIOCXROLLBACK = 0xc00c4453
|
||||
DLT_ARCNET = 0x7
|
||||
DLT_ATM_RFC1483 = 0xb
|
||||
DLT_AX25 = 0x3
|
||||
|
@ -186,6 +261,7 @@ const (
|
|||
DLT_LOOP = 0xc
|
||||
DLT_MPLS = 0xdb
|
||||
DLT_NULL = 0x0
|
||||
DLT_OPENFLOW = 0x10b
|
||||
DLT_PFLOG = 0x75
|
||||
DLT_PFSYNC = 0x12
|
||||
DLT_PPP = 0x9
|
||||
|
@ -196,6 +272,23 @@ const (
|
|||
DLT_RAW = 0xe
|
||||
DLT_SLIP = 0x8
|
||||
DLT_SLIP_BSDOS = 0xf
|
||||
DLT_USBPCAP = 0xf9
|
||||
DLT_USER0 = 0x93
|
||||
DLT_USER1 = 0x94
|
||||
DLT_USER10 = 0x9d
|
||||
DLT_USER11 = 0x9e
|
||||
DLT_USER12 = 0x9f
|
||||
DLT_USER13 = 0xa0
|
||||
DLT_USER14 = 0xa1
|
||||
DLT_USER15 = 0xa2
|
||||
DLT_USER2 = 0x95
|
||||
DLT_USER3 = 0x96
|
||||
DLT_USER4 = 0x97
|
||||
DLT_USER5 = 0x98
|
||||
DLT_USER6 = 0x99
|
||||
DLT_USER7 = 0x9a
|
||||
DLT_USER8 = 0x9b
|
||||
DLT_USER9 = 0x9c
|
||||
DT_BLK = 0x6
|
||||
DT_CHR = 0x2
|
||||
DT_DIR = 0x4
|
||||
|
@ -215,6 +308,8 @@ const (
|
|||
EMUL_ENABLED = 0x1
|
||||
EMUL_NATIVE = 0x2
|
||||
ENDRUNDISC = 0x9
|
||||
ETH64_8021_RSVD_MASK = 0xfffffffffff0
|
||||
ETH64_8021_RSVD_PREFIX = 0x180c2000000
|
||||
ETHERMIN = 0x2e
|
||||
ETHERMTU = 0x5dc
|
||||
ETHERTYPE_8023 = 0x4
|
||||
|
@ -267,6 +362,7 @@ const (
|
|||
ETHERTYPE_DN = 0x6003
|
||||
ETHERTYPE_DOGFIGHT = 0x1989
|
||||
ETHERTYPE_DSMD = 0x8039
|
||||
ETHERTYPE_EAPOL = 0x888e
|
||||
ETHERTYPE_ECMA = 0x803
|
||||
ETHERTYPE_ENCRYPT = 0x803d
|
||||
ETHERTYPE_ES = 0x805d
|
||||
|
@ -298,6 +394,7 @@ const (
|
|||
ETHERTYPE_LLDP = 0x88cc
|
||||
ETHERTYPE_LOGICRAFT = 0x8148
|
||||
ETHERTYPE_LOOPBACK = 0x9000
|
||||
ETHERTYPE_MACSEC = 0x88e5
|
||||
ETHERTYPE_MATRA = 0x807a
|
||||
ETHERTYPE_MAX = 0xffff
|
||||
ETHERTYPE_MERIT = 0x807c
|
||||
|
@ -326,15 +423,17 @@ const (
|
|||
ETHERTYPE_NCD = 0x8149
|
||||
ETHERTYPE_NESTAR = 0x8006
|
||||
ETHERTYPE_NETBEUI = 0x8191
|
||||
ETHERTYPE_NHRP = 0x2001
|
||||
ETHERTYPE_NOVELL = 0x8138
|
||||
ETHERTYPE_NS = 0x600
|
||||
ETHERTYPE_NSAT = 0x601
|
||||
ETHERTYPE_NSCOMPAT = 0x807
|
||||
ETHERTYPE_NSH = 0x984f
|
||||
ETHERTYPE_NTRAILER = 0x10
|
||||
ETHERTYPE_OS9 = 0x7007
|
||||
ETHERTYPE_OS9NET = 0x7009
|
||||
ETHERTYPE_PACER = 0x80c6
|
||||
ETHERTYPE_PAE = 0x888e
|
||||
ETHERTYPE_PBB = 0x88e7
|
||||
ETHERTYPE_PCS = 0x4242
|
||||
ETHERTYPE_PLANNING = 0x8044
|
||||
ETHERTYPE_PPP = 0x880b
|
||||
|
@ -409,28 +508,40 @@ const (
|
|||
ETHER_CRC_POLY_LE = 0xedb88320
|
||||
ETHER_HDR_LEN = 0xe
|
||||
ETHER_MAX_DIX_LEN = 0x600
|
||||
ETHER_MAX_HARDMTU_LEN = 0xff9b
|
||||
ETHER_MAX_LEN = 0x5ee
|
||||
ETHER_MIN_LEN = 0x40
|
||||
ETHER_TYPE_LEN = 0x2
|
||||
ETHER_VLAN_ENCAP_LEN = 0x4
|
||||
EVFILT_AIO = -0x3
|
||||
EVFILT_DEVICE = -0x8
|
||||
EVFILT_EXCEPT = -0x9
|
||||
EVFILT_PROC = -0x5
|
||||
EVFILT_READ = -0x1
|
||||
EVFILT_SIGNAL = -0x6
|
||||
EVFILT_SYSCOUNT = 0x7
|
||||
EVFILT_SYSCOUNT = 0x9
|
||||
EVFILT_TIMER = -0x7
|
||||
EVFILT_VNODE = -0x4
|
||||
EVFILT_WRITE = -0x2
|
||||
EVL_ENCAPLEN = 0x4
|
||||
EVL_PRIO_BITS = 0xd
|
||||
EVL_PRIO_MAX = 0x7
|
||||
EVL_VLID_MASK = 0xfff
|
||||
EVL_VLID_MAX = 0xffe
|
||||
EVL_VLID_MIN = 0x1
|
||||
EVL_VLID_NULL = 0x0
|
||||
EV_ADD = 0x1
|
||||
EV_CLEAR = 0x20
|
||||
EV_DELETE = 0x2
|
||||
EV_DISABLE = 0x8
|
||||
EV_DISPATCH = 0x80
|
||||
EV_ENABLE = 0x4
|
||||
EV_EOF = 0x8000
|
||||
EV_ERROR = 0x4000
|
||||
EV_FLAG1 = 0x2000
|
||||
EV_ONESHOT = 0x10
|
||||
EV_SYSFLAGS = 0xf000
|
||||
EV_RECEIPT = 0x40
|
||||
EV_SYSFLAGS = 0xf800
|
||||
EXTA = 0x4b00
|
||||
EXTB = 0x9600
|
||||
EXTPROC = 0x800
|
||||
|
@ -443,6 +554,7 @@ const (
|
|||
F_GETFL = 0x3
|
||||
F_GETLK = 0x7
|
||||
F_GETOWN = 0x5
|
||||
F_ISATTY = 0xb
|
||||
F_OK = 0x0
|
||||
F_RDLCK = 0x1
|
||||
F_SETFD = 0x2
|
||||
|
@ -460,7 +572,6 @@ const (
|
|||
IEXTEN = 0x400
|
||||
IFAN_ARRIVAL = 0x0
|
||||
IFAN_DEPARTURE = 0x1
|
||||
IFA_ROUTE = 0x1
|
||||
IFF_ALLMULTI = 0x200
|
||||
IFF_BROADCAST = 0x2
|
||||
IFF_CANTCHANGE = 0x8e52
|
||||
|
@ -471,12 +582,12 @@ const (
|
|||
IFF_LOOPBACK = 0x8
|
||||
IFF_MULTICAST = 0x8000
|
||||
IFF_NOARP = 0x80
|
||||
IFF_NOTRAILERS = 0x20
|
||||
IFF_OACTIVE = 0x400
|
||||
IFF_POINTOPOINT = 0x10
|
||||
IFF_PROMISC = 0x100
|
||||
IFF_RUNNING = 0x40
|
||||
IFF_SIMPLEX = 0x800
|
||||
IFF_STATICARP = 0x20
|
||||
IFF_UP = 0x1
|
||||
IFNAMSIZ = 0x10
|
||||
IFT_1822 = 0x2
|
||||
|
@ -605,6 +716,7 @@ const (
|
|||
IFT_LINEGROUP = 0xd2
|
||||
IFT_LOCALTALK = 0x2a
|
||||
IFT_LOOP = 0x18
|
||||
IFT_MBIM = 0xfa
|
||||
IFT_MEDIAMAILOVERIP = 0x8b
|
||||
IFT_MFSIGLINK = 0xa7
|
||||
IFT_MIOX25 = 0x26
|
||||
|
@ -695,6 +807,7 @@ const (
|
|||
IFT_VOICEOVERCABLE = 0xc6
|
||||
IFT_VOICEOVERFRAMERELAY = 0x99
|
||||
IFT_VOICEOVERIP = 0x68
|
||||
IFT_WIREGUARD = 0xfb
|
||||
IFT_X213 = 0x5d
|
||||
IFT_X25 = 0x5
|
||||
IFT_X25DDN = 0x4
|
||||
|
@ -729,8 +842,6 @@ const (
|
|||
IPPROTO_AH = 0x33
|
||||
IPPROTO_CARP = 0x70
|
||||
IPPROTO_DIVERT = 0x102
|
||||
IPPROTO_DIVERT_INIT = 0x2
|
||||
IPPROTO_DIVERT_RESP = 0x1
|
||||
IPPROTO_DONE = 0x101
|
||||
IPPROTO_DSTOPTS = 0x3c
|
||||
IPPROTO_EGP = 0x8
|
||||
|
@ -762,9 +873,11 @@ const (
|
|||
IPPROTO_RAW = 0xff
|
||||
IPPROTO_ROUTING = 0x2b
|
||||
IPPROTO_RSVP = 0x2e
|
||||
IPPROTO_SCTP = 0x84
|
||||
IPPROTO_TCP = 0x6
|
||||
IPPROTO_TP = 0x1d
|
||||
IPPROTO_UDP = 0x11
|
||||
IPPROTO_UDPLITE = 0x88
|
||||
IPV6_AUTH_LEVEL = 0x35
|
||||
IPV6_AUTOFLOWLABEL = 0x3b
|
||||
IPV6_CHECKSUM = 0x1a
|
||||
|
@ -787,6 +900,7 @@ const (
|
|||
IPV6_LEAVE_GROUP = 0xd
|
||||
IPV6_MAXHLIM = 0xff
|
||||
IPV6_MAXPACKET = 0xffff
|
||||
IPV6_MINHOPCOUNT = 0x41
|
||||
IPV6_MMTU = 0x500
|
||||
IPV6_MULTICAST_HOPS = 0xa
|
||||
IPV6_MULTICAST_IF = 0x9
|
||||
|
@ -826,12 +940,12 @@ const (
|
|||
IP_DEFAULT_MULTICAST_LOOP = 0x1
|
||||
IP_DEFAULT_MULTICAST_TTL = 0x1
|
||||
IP_DF = 0x4000
|
||||
IP_DIVERTFL = 0x1022
|
||||
IP_DROP_MEMBERSHIP = 0xd
|
||||
IP_ESP_NETWORK_LEVEL = 0x16
|
||||
IP_ESP_TRANS_LEVEL = 0x15
|
||||
IP_HDRINCL = 0x2
|
||||
IP_IPCOMP_LEVEL = 0x1d
|
||||
IP_IPDEFTTL = 0x25
|
||||
IP_IPSECFLOWINFO = 0x24
|
||||
IP_IPSEC_LOCAL_AUTH = 0x1b
|
||||
IP_IPSEC_LOCAL_CRED = 0x19
|
||||
|
@ -865,10 +979,15 @@ const (
|
|||
IP_RETOPTS = 0x8
|
||||
IP_RF = 0x8000
|
||||
IP_RTABLE = 0x1021
|
||||
IP_SENDSRCADDR = 0x7
|
||||
IP_TOS = 0x3
|
||||
IP_TTL = 0x4
|
||||
ISIG = 0x80
|
||||
ISTRIP = 0x20
|
||||
ITIMER_PROF = 0x2
|
||||
ITIMER_REAL = 0x0
|
||||
ITIMER_VIRTUAL = 0x1
|
||||
IUCLC = 0x1000
|
||||
IXANY = 0x800
|
||||
IXOFF = 0x400
|
||||
IXON = 0x200
|
||||
|
@ -900,10 +1019,11 @@ const (
|
|||
MAP_INHERIT_COPY = 0x1
|
||||
MAP_INHERIT_NONE = 0x2
|
||||
MAP_INHERIT_SHARE = 0x0
|
||||
MAP_NOEXTEND = 0x100
|
||||
MAP_NORESERVE = 0x40
|
||||
MAP_INHERIT_ZERO = 0x3
|
||||
MAP_NOEXTEND = 0x0
|
||||
MAP_NORESERVE = 0x0
|
||||
MAP_PRIVATE = 0x2
|
||||
MAP_RENAME = 0x20
|
||||
MAP_RENAME = 0x0
|
||||
MAP_SHARED = 0x1
|
||||
MAP_STACK = 0x4000
|
||||
MAP_TRYFIXED = 0x0
|
||||
|
@ -922,6 +1042,7 @@ const (
|
|||
MNT_NOATIME = 0x8000
|
||||
MNT_NODEV = 0x10
|
||||
MNT_NOEXEC = 0x4
|
||||
MNT_NOPERM = 0x20
|
||||
MNT_NOSUID = 0x8
|
||||
MNT_NOWAIT = 0x2
|
||||
MNT_QUOTA = 0x2000
|
||||
|
@ -929,13 +1050,29 @@ const (
|
|||
MNT_RELOAD = 0x40000
|
||||
MNT_ROOTFS = 0x4000
|
||||
MNT_SOFTDEP = 0x4000000
|
||||
MNT_STALLED = 0x100000
|
||||
MNT_SWAPPABLE = 0x200000
|
||||
MNT_SYNCHRONOUS = 0x2
|
||||
MNT_UPDATE = 0x10000
|
||||
MNT_VISFLAGMASK = 0x400ffff
|
||||
MNT_WAIT = 0x1
|
||||
MNT_WANTRDWR = 0x2000000
|
||||
MNT_WXALLOWED = 0x800
|
||||
MOUNT_AFS = "afs"
|
||||
MOUNT_CD9660 = "cd9660"
|
||||
MOUNT_EXT2FS = "ext2fs"
|
||||
MOUNT_FFS = "ffs"
|
||||
MOUNT_FUSEFS = "fuse"
|
||||
MOUNT_MFS = "mfs"
|
||||
MOUNT_MSDOS = "msdos"
|
||||
MOUNT_NCPFS = "ncpfs"
|
||||
MOUNT_NFS = "nfs"
|
||||
MOUNT_NTFS = "ntfs"
|
||||
MOUNT_TMPFS = "tmpfs"
|
||||
MOUNT_UDF = "udf"
|
||||
MOUNT_UFS = "ffs"
|
||||
MSG_BCAST = 0x100
|
||||
MSG_CMSG_CLOEXEC = 0x800
|
||||
MSG_CTRUNC = 0x20
|
||||
MSG_DONTROUTE = 0x4
|
||||
MSG_DONTWAIT = 0x80
|
||||
|
@ -946,6 +1083,7 @@ const (
|
|||
MSG_PEEK = 0x2
|
||||
MSG_TRUNC = 0x10
|
||||
MSG_WAITALL = 0x40
|
||||
MSG_WAITFORONE = 0x1000
|
||||
MS_ASYNC = 0x1
|
||||
MS_INVALIDATE = 0x4
|
||||
MS_SYNC = 0x2
|
||||
|
@ -953,12 +1091,16 @@ const (
|
|||
NET_RT_DUMP = 0x1
|
||||
NET_RT_FLAGS = 0x2
|
||||
NET_RT_IFLIST = 0x3
|
||||
NET_RT_MAXID = 0x6
|
||||
NET_RT_IFNAMES = 0x6
|
||||
NET_RT_MAXID = 0x8
|
||||
NET_RT_SOURCE = 0x7
|
||||
NET_RT_STATS = 0x4
|
||||
NET_RT_TABLE = 0x5
|
||||
NFDBITS = 0x20
|
||||
NOFLSH = 0x80000000
|
||||
NOKERNINFO = 0x2000000
|
||||
NOTE_ATTRIB = 0x8
|
||||
NOTE_CHANGE = 0x1
|
||||
NOTE_CHILD = 0x4
|
||||
NOTE_DELETE = 0x1
|
||||
NOTE_EOF = 0x2
|
||||
|
@ -968,6 +1110,7 @@ const (
|
|||
NOTE_FORK = 0x40000000
|
||||
NOTE_LINK = 0x10
|
||||
NOTE_LOWAT = 0x1
|
||||
NOTE_OOB = 0x4
|
||||
NOTE_PCTRLMASK = 0xf0000000
|
||||
NOTE_PDATAMASK = 0xfffff
|
||||
NOTE_RENAME = 0x20
|
||||
|
@ -977,11 +1120,13 @@ const (
|
|||
NOTE_TRUNCATE = 0x80
|
||||
NOTE_WRITE = 0x2
|
||||
OCRNL = 0x10
|
||||
OLCUC = 0x20
|
||||
ONLCR = 0x2
|
||||
ONLRET = 0x80
|
||||
ONOCR = 0x40
|
||||
ONOEOT = 0x8
|
||||
OPOST = 0x1
|
||||
OXTABS = 0x4
|
||||
O_ACCMODE = 0x3
|
||||
O_APPEND = 0x8
|
||||
O_ASYNC = 0x40
|
||||
|
@ -1015,7 +1160,6 @@ const (
|
|||
PROT_NONE = 0x0
|
||||
PROT_READ = 0x1
|
||||
PROT_WRITE = 0x2
|
||||
PT_MASK = 0x3ff000
|
||||
RLIMIT_CORE = 0x4
|
||||
RLIMIT_CPU = 0x0
|
||||
RLIMIT_DATA = 0x2
|
||||
|
@ -1027,19 +1171,25 @@ const (
|
|||
RLIMIT_STACK = 0x3
|
||||
RLIM_INFINITY = 0x7fffffffffffffff
|
||||
RTAX_AUTHOR = 0x6
|
||||
RTAX_BFD = 0xb
|
||||
RTAX_BRD = 0x7
|
||||
RTAX_DNS = 0xc
|
||||
RTAX_DST = 0x0
|
||||
RTAX_GATEWAY = 0x1
|
||||
RTAX_GENMASK = 0x3
|
||||
RTAX_IFA = 0x5
|
||||
RTAX_IFP = 0x4
|
||||
RTAX_LABEL = 0xa
|
||||
RTAX_MAX = 0xb
|
||||
RTAX_MAX = 0xf
|
||||
RTAX_NETMASK = 0x2
|
||||
RTAX_SEARCH = 0xe
|
||||
RTAX_SRC = 0x8
|
||||
RTAX_SRCMASK = 0x9
|
||||
RTAX_STATIC = 0xd
|
||||
RTA_AUTHOR = 0x40
|
||||
RTA_BFD = 0x800
|
||||
RTA_BRD = 0x80
|
||||
RTA_DNS = 0x1000
|
||||
RTA_DST = 0x1
|
||||
RTA_GATEWAY = 0x2
|
||||
RTA_GENMASK = 0x8
|
||||
|
@ -1047,49 +1197,57 @@ const (
|
|||
RTA_IFP = 0x10
|
||||
RTA_LABEL = 0x400
|
||||
RTA_NETMASK = 0x4
|
||||
RTA_SEARCH = 0x4000
|
||||
RTA_SRC = 0x100
|
||||
RTA_SRCMASK = 0x200
|
||||
RTA_STATIC = 0x2000
|
||||
RTF_ANNOUNCE = 0x4000
|
||||
RTF_BFD = 0x1000000
|
||||
RTF_BLACKHOLE = 0x1000
|
||||
RTF_BROADCAST = 0x400000
|
||||
RTF_CACHED = 0x20000
|
||||
RTF_CLONED = 0x10000
|
||||
RTF_CLONING = 0x100
|
||||
RTF_CONNECTED = 0x800000
|
||||
RTF_DONE = 0x40
|
||||
RTF_DYNAMIC = 0x10
|
||||
RTF_FMASK = 0x10f808
|
||||
RTF_FMASK = 0x110fc08
|
||||
RTF_GATEWAY = 0x2
|
||||
RTF_HOST = 0x4
|
||||
RTF_LLINFO = 0x400
|
||||
RTF_MASK = 0x80
|
||||
RTF_LOCAL = 0x200000
|
||||
RTF_MODIFIED = 0x20
|
||||
RTF_MPATH = 0x40000
|
||||
RTF_MPLS = 0x100000
|
||||
RTF_MULTICAST = 0x200
|
||||
RTF_PERMANENT_ARP = 0x2000
|
||||
RTF_PROTO1 = 0x8000
|
||||
RTF_PROTO2 = 0x4000
|
||||
RTF_PROTO3 = 0x2000
|
||||
RTF_REJECT = 0x8
|
||||
RTF_SOURCE = 0x20000
|
||||
RTF_STATIC = 0x800
|
||||
RTF_TUNNEL = 0x100000
|
||||
RTF_UP = 0x1
|
||||
RTF_USETRAILERS = 0x8000
|
||||
RTF_XRESOLVE = 0x200
|
||||
RTM_80211INFO = 0x15
|
||||
RTM_ADD = 0x1
|
||||
RTM_BFD = 0x12
|
||||
RTM_CHANGE = 0x3
|
||||
RTM_CHGADDRATTR = 0x14
|
||||
RTM_DELADDR = 0xd
|
||||
RTM_DELETE = 0x2
|
||||
RTM_DESYNC = 0x10
|
||||
RTM_GET = 0x4
|
||||
RTM_IFANNOUNCE = 0xf
|
||||
RTM_IFINFO = 0xe
|
||||
RTM_LOCK = 0x8
|
||||
RTM_INVALIDATE = 0x11
|
||||
RTM_LOSING = 0x5
|
||||
RTM_MAXSIZE = 0x800
|
||||
RTM_MISS = 0x7
|
||||
RTM_NEWADDR = 0xc
|
||||
RTM_PROPOSAL = 0x13
|
||||
RTM_REDIRECT = 0x6
|
||||
RTM_RESOLVE = 0xb
|
||||
RTM_RTTUNIT = 0xf4240
|
||||
RTM_SOURCE = 0x16
|
||||
RTM_VERSION = 0x5
|
||||
RTV_EXPIRE = 0x4
|
||||
RTV_HOPCOUNT = 0x2
|
||||
|
@ -1099,67 +1257,74 @@ const (
|
|||
RTV_RTTVAR = 0x80
|
||||
RTV_SPIPE = 0x10
|
||||
RTV_SSTHRESH = 0x20
|
||||
RT_TABLEID_BITS = 0x8
|
||||
RT_TABLEID_MASK = 0xff
|
||||
RT_TABLEID_MAX = 0xff
|
||||
RUSAGE_CHILDREN = -0x1
|
||||
RUSAGE_SELF = 0x0
|
||||
RUSAGE_THREAD = 0x1
|
||||
SCM_RIGHTS = 0x1
|
||||
SCM_TIMESTAMP = 0x4
|
||||
SEEK_CUR = 0x1
|
||||
SEEK_END = 0x2
|
||||
SEEK_SET = 0x0
|
||||
SHUT_RD = 0x0
|
||||
SHUT_RDWR = 0x2
|
||||
SHUT_WR = 0x1
|
||||
SIOCADDMULTI = 0x80206931
|
||||
SIOCAIFADDR = 0x8040691a
|
||||
SIOCAIFGROUP = 0x80246987
|
||||
SIOCALIFADDR = 0x8218691c
|
||||
SIOCATMARK = 0x40047307
|
||||
SIOCBRDGADD = 0x8054693c
|
||||
SIOCBRDGADDS = 0x80546941
|
||||
SIOCBRDGARL = 0x806e694d
|
||||
SIOCBRDGADD = 0x805c693c
|
||||
SIOCBRDGADDL = 0x805c6949
|
||||
SIOCBRDGADDS = 0x805c6941
|
||||
SIOCBRDGARL = 0x808c694d
|
||||
SIOCBRDGDADDR = 0x81286947
|
||||
SIOCBRDGDEL = 0x8054693d
|
||||
SIOCBRDGDELS = 0x80546942
|
||||
SIOCBRDGFLUSH = 0x80546948
|
||||
SIOCBRDGFRL = 0x806e694e
|
||||
SIOCBRDGDEL = 0x805c693d
|
||||
SIOCBRDGDELS = 0x805c6942
|
||||
SIOCBRDGFLUSH = 0x805c6948
|
||||
SIOCBRDGFRL = 0x808c694e
|
||||
SIOCBRDGGCACHE = 0xc0146941
|
||||
SIOCBRDGGFD = 0xc0146952
|
||||
SIOCBRDGGHT = 0xc0146951
|
||||
SIOCBRDGGIFFLGS = 0xc054693e
|
||||
SIOCBRDGGIFFLGS = 0xc05c693e
|
||||
SIOCBRDGGMA = 0xc0146953
|
||||
SIOCBRDGGPARAM = 0xc03c6958
|
||||
SIOCBRDGGPRI = 0xc0146950
|
||||
SIOCBRDGGRL = 0xc028694f
|
||||
SIOCBRDGGSIFS = 0xc054693c
|
||||
SIOCBRDGGTO = 0xc0146946
|
||||
SIOCBRDGIFS = 0xc0546942
|
||||
SIOCBRDGIFS = 0xc05c6942
|
||||
SIOCBRDGRTS = 0xc0186943
|
||||
SIOCBRDGSADDR = 0xc1286944
|
||||
SIOCBRDGSCACHE = 0x80146940
|
||||
SIOCBRDGSFD = 0x80146952
|
||||
SIOCBRDGSHT = 0x80146951
|
||||
SIOCBRDGSIFCOST = 0x80546955
|
||||
SIOCBRDGSIFFLGS = 0x8054693f
|
||||
SIOCBRDGSIFPRIO = 0x80546954
|
||||
SIOCBRDGSIFCOST = 0x805c6955
|
||||
SIOCBRDGSIFFLGS = 0x805c693f
|
||||
SIOCBRDGSIFPRIO = 0x805c6954
|
||||
SIOCBRDGSIFPROT = 0x805c694a
|
||||
SIOCBRDGSMA = 0x80146953
|
||||
SIOCBRDGSPRI = 0x80146950
|
||||
SIOCBRDGSPROTO = 0x8014695a
|
||||
SIOCBRDGSTO = 0x80146945
|
||||
SIOCBRDGSTXHC = 0x80146959
|
||||
SIOCDELLABEL = 0x80206997
|
||||
SIOCDELMULTI = 0x80206932
|
||||
SIOCDIFADDR = 0x80206919
|
||||
SIOCDIFGROUP = 0x80246989
|
||||
SIOCDIFPARENT = 0x802069b4
|
||||
SIOCDIFPHYADDR = 0x80206949
|
||||
SIOCDLIFADDR = 0x8218691e
|
||||
SIOCDPWE3NEIGHBOR = 0x802069de
|
||||
SIOCDVNETID = 0x802069af
|
||||
SIOCGETKALIVE = 0xc01869a4
|
||||
SIOCGETLABEL = 0x8020699a
|
||||
SIOCGETMPWCFG = 0xc02069ae
|
||||
SIOCGETPFLOW = 0xc02069fe
|
||||
SIOCGETPFSYNC = 0xc02069f8
|
||||
SIOCGETSGCNT = 0xc0147534
|
||||
SIOCGETVIFCNT = 0xc0147533
|
||||
SIOCGETVLAN = 0xc0206990
|
||||
SIOCGHIWAT = 0x40047301
|
||||
SIOCGIFADDR = 0xc0206921
|
||||
SIOCGIFASYNCMAP = 0xc020697c
|
||||
SIOCGIFBRDADDR = 0xc0206923
|
||||
SIOCGIFCONF = 0xc0086924
|
||||
SIOCGIFDATA = 0xc020691b
|
||||
|
@ -1168,40 +1333,53 @@ const (
|
|||
SIOCGIFFLAGS = 0xc0206911
|
||||
SIOCGIFGATTR = 0xc024698b
|
||||
SIOCGIFGENERIC = 0xc020693a
|
||||
SIOCGIFGLIST = 0xc024698d
|
||||
SIOCGIFGMEMB = 0xc024698a
|
||||
SIOCGIFGROUP = 0xc0246988
|
||||
SIOCGIFHARDMTU = 0xc02069a5
|
||||
SIOCGIFMEDIA = 0xc0286936
|
||||
SIOCGIFLLPRIO = 0xc02069b6
|
||||
SIOCGIFMEDIA = 0xc0386938
|
||||
SIOCGIFMETRIC = 0xc0206917
|
||||
SIOCGIFMTU = 0xc020697e
|
||||
SIOCGIFNETMASK = 0xc0206925
|
||||
SIOCGIFPDSTADDR = 0xc0206948
|
||||
SIOCGIFPAIR = 0xc02069b1
|
||||
SIOCGIFPARENT = 0xc02069b3
|
||||
SIOCGIFPRIORITY = 0xc020699c
|
||||
SIOCGIFPSRCADDR = 0xc0206947
|
||||
SIOCGIFRDOMAIN = 0xc02069a0
|
||||
SIOCGIFRTLABEL = 0xc0206983
|
||||
SIOCGIFTIMESLOT = 0xc0206986
|
||||
SIOCGIFRXR = 0x802069aa
|
||||
SIOCGIFSFFPAGE = 0xc1126939
|
||||
SIOCGIFXFLAGS = 0xc020699e
|
||||
SIOCGLIFADDR = 0xc218691d
|
||||
SIOCGLIFPHYADDR = 0xc218694b
|
||||
SIOCGLIFPHYDF = 0xc02069c2
|
||||
SIOCGLIFPHYECN = 0xc02069c8
|
||||
SIOCGLIFPHYRTABLE = 0xc02069a2
|
||||
SIOCGLIFPHYTTL = 0xc02069a9
|
||||
SIOCGLOWAT = 0x40047303
|
||||
SIOCGPGRP = 0x40047309
|
||||
SIOCGPWE3 = 0xc0206998
|
||||
SIOCGPWE3CTRLWORD = 0xc02069dc
|
||||
SIOCGPWE3FAT = 0xc02069dd
|
||||
SIOCGPWE3NEIGHBOR = 0xc21869de
|
||||
SIOCGRXHPRIO = 0xc02069db
|
||||
SIOCGSPPPPARAMS = 0xc0206994
|
||||
SIOCGTXHPRIO = 0xc02069c6
|
||||
SIOCGUMBINFO = 0xc02069be
|
||||
SIOCGUMBPARAM = 0xc02069c0
|
||||
SIOCGVH = 0xc02069f6
|
||||
SIOCGVNETFLOWID = 0xc02069c4
|
||||
SIOCGVNETID = 0xc02069a7
|
||||
SIOCIFAFATTACH = 0x801169ab
|
||||
SIOCIFAFDETACH = 0x801169ac
|
||||
SIOCIFCREATE = 0x8020697a
|
||||
SIOCIFDESTROY = 0x80206979
|
||||
SIOCIFGCLONERS = 0xc00c6978
|
||||
SIOCSETKALIVE = 0x801869a3
|
||||
SIOCSETLABEL = 0x80206999
|
||||
SIOCSETMPWCFG = 0x802069ad
|
||||
SIOCSETPFLOW = 0x802069fd
|
||||
SIOCSETPFSYNC = 0x802069f7
|
||||
SIOCSETVLAN = 0x8020698f
|
||||
SIOCSHIWAT = 0x80047300
|
||||
SIOCSIFADDR = 0x8020690c
|
||||
SIOCSIFASYNCMAP = 0x8020697d
|
||||
SIOCSIFBRDADDR = 0x80206913
|
||||
SIOCSIFDESCR = 0x80206980
|
||||
SIOCSIFDSTADDR = 0x8020690e
|
||||
|
@ -1209,25 +1387,37 @@ const (
|
|||
SIOCSIFGATTR = 0x8024698c
|
||||
SIOCSIFGENERIC = 0x80206939
|
||||
SIOCSIFLLADDR = 0x8020691f
|
||||
SIOCSIFMEDIA = 0xc0206935
|
||||
SIOCSIFLLPRIO = 0x802069b5
|
||||
SIOCSIFMEDIA = 0xc0206937
|
||||
SIOCSIFMETRIC = 0x80206918
|
||||
SIOCSIFMTU = 0x8020697f
|
||||
SIOCSIFNETMASK = 0x80206916
|
||||
SIOCSIFPHYADDR = 0x80406946
|
||||
SIOCSIFPAIR = 0x802069b0
|
||||
SIOCSIFPARENT = 0x802069b2
|
||||
SIOCSIFPRIORITY = 0x8020699b
|
||||
SIOCSIFRDOMAIN = 0x8020699f
|
||||
SIOCSIFRTLABEL = 0x80206982
|
||||
SIOCSIFTIMESLOT = 0x80206985
|
||||
SIOCSIFXFLAGS = 0x8020699d
|
||||
SIOCSLIFPHYADDR = 0x8218694a
|
||||
SIOCSLIFPHYDF = 0x802069c1
|
||||
SIOCSLIFPHYECN = 0x802069c7
|
||||
SIOCSLIFPHYRTABLE = 0x802069a1
|
||||
SIOCSLIFPHYTTL = 0x802069a8
|
||||
SIOCSLOWAT = 0x80047302
|
||||
SIOCSPGRP = 0x80047308
|
||||
SIOCSPWE3CTRLWORD = 0x802069dc
|
||||
SIOCSPWE3FAT = 0x802069dd
|
||||
SIOCSPWE3NEIGHBOR = 0x821869de
|
||||
SIOCSRXHPRIO = 0x802069db
|
||||
SIOCSSPPPPARAMS = 0x80206993
|
||||
SIOCSTXHPRIO = 0x802069c5
|
||||
SIOCSUMBPARAM = 0x802069bf
|
||||
SIOCSVH = 0xc02069f5
|
||||
SIOCSVNETFLOWID = 0x802069c3
|
||||
SIOCSVNETID = 0x802069a6
|
||||
SOCK_CLOEXEC = 0x8000
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_DNS = 0x1000
|
||||
SOCK_NONBLOCK = 0x4000
|
||||
SOCK_RAW = 0x3
|
||||
SOCK_RDM = 0x4
|
||||
SOCK_SEQPACKET = 0x5
|
||||
|
@ -1238,6 +1428,7 @@ const (
|
|||
SO_BINDANY = 0x1000
|
||||
SO_BROADCAST = 0x20
|
||||
SO_DEBUG = 0x1
|
||||
SO_DOMAIN = 0x1024
|
||||
SO_DONTROUTE = 0x10
|
||||
SO_ERROR = 0x1007
|
||||
SO_KEEPALIVE = 0x8
|
||||
|
@ -1245,6 +1436,7 @@ const (
|
|||
SO_NETPROC = 0x1020
|
||||
SO_OOBINLINE = 0x100
|
||||
SO_PEERCRED = 0x1022
|
||||
SO_PROTOCOL = 0x1025
|
||||
SO_RCVBUF = 0x1002
|
||||
SO_RCVLOWAT = 0x1004
|
||||
SO_RCVTIMEO = 0x1006
|
||||
|
@ -1258,6 +1450,7 @@ const (
|
|||
SO_TIMESTAMP = 0x800
|
||||
SO_TYPE = 0x1008
|
||||
SO_USELOOPBACK = 0x40
|
||||
SO_ZEROIZE = 0x2000
|
||||
S_BLKSIZE = 0x200
|
||||
S_IEXEC = 0x40
|
||||
S_IFBLK = 0x6000
|
||||
|
@ -1287,9 +1480,24 @@ const (
|
|||
S_IXOTH = 0x1
|
||||
S_IXUSR = 0x40
|
||||
TCIFLUSH = 0x1
|
||||
TCIOFF = 0x3
|
||||
TCIOFLUSH = 0x3
|
||||
TCION = 0x4
|
||||
TCOFLUSH = 0x2
|
||||
TCP_MAXBURST = 0x4
|
||||
TCOOFF = 0x1
|
||||
TCOON = 0x2
|
||||
TCPOPT_EOL = 0x0
|
||||
TCPOPT_MAXSEG = 0x2
|
||||
TCPOPT_NOP = 0x1
|
||||
TCPOPT_SACK = 0x5
|
||||
TCPOPT_SACK_HDR = 0x1010500
|
||||
TCPOPT_SACK_PERMITTED = 0x4
|
||||
TCPOPT_SACK_PERMIT_HDR = 0x1010402
|
||||
TCPOPT_SIGNATURE = 0x13
|
||||
TCPOPT_TIMESTAMP = 0x8
|
||||
TCPOPT_TSTAMP_HDR = 0x101080a
|
||||
TCPOPT_WINDOW = 0x3
|
||||
TCP_INFO = 0x9
|
||||
TCP_MAXSEG = 0x2
|
||||
TCP_MAXWIN = 0xffff
|
||||
TCP_MAX_SACK = 0x3
|
||||
|
@ -1298,11 +1506,15 @@ const (
|
|||
TCP_MSS = 0x200
|
||||
TCP_NODELAY = 0x1
|
||||
TCP_NOPUSH = 0x10
|
||||
TCP_NSTATES = 0xb
|
||||
TCP_SACKHOLE_LIMIT = 0x80
|
||||
TCP_SACK_ENABLE = 0x8
|
||||
TCSAFLUSH = 0x2
|
||||
TIMER_ABSTIME = 0x1
|
||||
TIMER_RELTIME = 0x0
|
||||
TIOCCBRK = 0x2000747a
|
||||
TIOCCDTR = 0x20007478
|
||||
TIOCCHKVERAUTH = 0x2000741e
|
||||
TIOCCLRVERAUTH = 0x2000741d
|
||||
TIOCCONS = 0x80047462
|
||||
TIOCDRAIN = 0x2000745e
|
||||
TIOCEXCL = 0x2000740d
|
||||
|
@ -1357,17 +1569,21 @@ const (
|
|||
TIOCSETAF = 0x802c7416
|
||||
TIOCSETAW = 0x802c7415
|
||||
TIOCSETD = 0x8004741b
|
||||
TIOCSETVERAUTH = 0x8004741c
|
||||
TIOCSFLAGS = 0x8004745c
|
||||
TIOCSIG = 0x8004745f
|
||||
TIOCSPGRP = 0x80047476
|
||||
TIOCSTART = 0x2000746e
|
||||
TIOCSTAT = 0x80047465
|
||||
TIOCSTI = 0x80017472
|
||||
TIOCSTAT = 0x20007465
|
||||
TIOCSTOP = 0x2000746f
|
||||
TIOCSTSTAMP = 0x8008745a
|
||||
TIOCSWINSZ = 0x80087467
|
||||
TIOCUCNTL = 0x80047466
|
||||
TIOCUCNTL_CBRK = 0x7a
|
||||
TIOCUCNTL_SBRK = 0x7b
|
||||
TOSTOP = 0x400000
|
||||
UTIME_NOW = -0x2
|
||||
UTIME_OMIT = -0x1
|
||||
VDISCARD = 0xf
|
||||
VDSUSP = 0xb
|
||||
VEOF = 0x0
|
||||
|
@ -1378,6 +1594,19 @@ const (
|
|||
VKILL = 0x5
|
||||
VLNEXT = 0xe
|
||||
VMIN = 0x10
|
||||
VM_ANONMIN = 0x7
|
||||
VM_LOADAVG = 0x2
|
||||
VM_MALLOC_CONF = 0xc
|
||||
VM_MAXID = 0xd
|
||||
VM_MAXSLP = 0xa
|
||||
VM_METER = 0x1
|
||||
VM_NKMEMPAGES = 0x6
|
||||
VM_PSSTRINGS = 0x3
|
||||
VM_SWAPENCRYPT = 0x5
|
||||
VM_USPACE = 0xb
|
||||
VM_UVMEXP = 0x4
|
||||
VM_VNODEMIN = 0x9
|
||||
VM_VTEXTMIN = 0x8
|
||||
VQUIT = 0x9
|
||||
VREPRINT = 0x6
|
||||
VSTART = 0xc
|
||||
|
@ -1390,8 +1619,8 @@ const (
|
|||
WCONTINUED = 0x8
|
||||
WCOREFLAG = 0x80
|
||||
WNOHANG = 0x1
|
||||
WSTOPPED = 0x7f
|
||||
WUNTRACED = 0x2
|
||||
XCASE = 0x1000000
|
||||
)
|
||||
|
||||
// Errors
|
||||
|
@ -1405,6 +1634,7 @@ const (
|
|||
EALREADY = syscall.Errno(0x25)
|
||||
EAUTH = syscall.Errno(0x50)
|
||||
EBADF = syscall.Errno(0x9)
|
||||
EBADMSG = syscall.Errno(0x5c)
|
||||
EBADRPC = syscall.Errno(0x48)
|
||||
EBUSY = syscall.Errno(0x10)
|
||||
ECANCELED = syscall.Errno(0x58)
|
||||
|
@ -1431,7 +1661,7 @@ const (
|
|||
EIPSEC = syscall.Errno(0x52)
|
||||
EISCONN = syscall.Errno(0x38)
|
||||
EISDIR = syscall.Errno(0x15)
|
||||
ELAST = syscall.Errno(0x5b)
|
||||
ELAST = syscall.Errno(0x5f)
|
||||
ELOOP = syscall.Errno(0x3e)
|
||||
EMEDIUMTYPE = syscall.Errno(0x56)
|
||||
EMFILE = syscall.Errno(0x18)
|
||||
|
@ -1459,12 +1689,14 @@ const (
|
|||
ENOTCONN = syscall.Errno(0x39)
|
||||
ENOTDIR = syscall.Errno(0x14)
|
||||
ENOTEMPTY = syscall.Errno(0x42)
|
||||
ENOTRECOVERABLE = syscall.Errno(0x5d)
|
||||
ENOTSOCK = syscall.Errno(0x26)
|
||||
ENOTSUP = syscall.Errno(0x5b)
|
||||
ENOTTY = syscall.Errno(0x19)
|
||||
ENXIO = syscall.Errno(0x6)
|
||||
EOPNOTSUPP = syscall.Errno(0x2d)
|
||||
EOVERFLOW = syscall.Errno(0x57)
|
||||
EOWNERDEAD = syscall.Errno(0x5e)
|
||||
EPERM = syscall.Errno(0x1)
|
||||
EPFNOSUPPORT = syscall.Errno(0x2e)
|
||||
EPIPE = syscall.Errno(0x20)
|
||||
|
@ -1472,6 +1704,7 @@ const (
|
|||
EPROCUNAVAIL = syscall.Errno(0x4c)
|
||||
EPROGMISMATCH = syscall.Errno(0x4b)
|
||||
EPROGUNAVAIL = syscall.Errno(0x4a)
|
||||
EPROTO = syscall.Errno(0x5f)
|
||||
EPROTONOSUPPORT = syscall.Errno(0x2b)
|
||||
EPROTOTYPE = syscall.Errno(0x29)
|
||||
ERANGE = syscall.Errno(0x22)
|
||||
|
@ -1568,7 +1801,7 @@ var errorList = [...]struct {
|
|||
{32, "EPIPE", "broken pipe"},
|
||||
{33, "EDOM", "numerical argument out of domain"},
|
||||
{34, "ERANGE", "result too large"},
|
||||
{35, "EWOULDBLOCK", "resource temporarily unavailable"},
|
||||
{35, "EAGAIN", "resource temporarily unavailable"},
|
||||
{36, "EINPROGRESS", "operation now in progress"},
|
||||
{37, "EALREADY", "operation already in progress"},
|
||||
{38, "ENOTSOCK", "socket operation on non-socket"},
|
||||
|
@ -1624,7 +1857,11 @@ var errorList = [...]struct {
|
|||
{88, "ECANCELED", "operation canceled"},
|
||||
{89, "EIDRM", "identifier removed"},
|
||||
{90, "ENOMSG", "no message of desired type"},
|
||||
{91, "ELAST", "not supported"},
|
||||
{91, "ENOTSUP", "not supported"},
|
||||
{92, "EBADMSG", "bad message"},
|
||||
{93, "ENOTRECOVERABLE", "state not recoverable"},
|
||||
{94, "EOWNERDEAD", "previous owner died"},
|
||||
{95, "ELAST", "protocol error"},
|
||||
}
|
||||
|
||||
// Signal table
|
||||
|
@ -1638,7 +1875,7 @@ var signalList = [...]struct {
|
|||
{3, "SIGQUIT", "quit"},
|
||||
{4, "SIGILL", "illegal instruction"},
|
||||
{5, "SIGTRAP", "trace/BPT trap"},
|
||||
{6, "SIGABRT", "abort trap"},
|
||||
{6, "SIGIOT", "abort trap"},
|
||||
{7, "SIGEMT", "EMT trap"},
|
||||
{8, "SIGFPE", "floating point exception"},
|
||||
{9, "SIGKILL", "killed"},
|
||||
|
@ -1665,4 +1902,5 @@ var signalList = [...]struct {
|
|||
{30, "SIGUSR1", "user defined signal 1"},
|
||||
{31, "SIGUSR2", "user defined signal 2"},
|
||||
{32, "SIGTHR", "thread AST"},
|
||||
{28672, "SIGSTKSZ", "unknown signal"},
|
||||
}
|
||||
|
|
|
@ -109,6 +109,15 @@ const (
|
|||
BPF_DIRECTION_IN = 0x1
|
||||
BPF_DIRECTION_OUT = 0x2
|
||||
BPF_DIV = 0x30
|
||||
BPF_FILDROP_CAPTURE = 0x1
|
||||
BPF_FILDROP_DROP = 0x2
|
||||
BPF_FILDROP_PASS = 0x0
|
||||
BPF_F_DIR_IN = 0x10
|
||||
BPF_F_DIR_MASK = 0x30
|
||||
BPF_F_DIR_OUT = 0x20
|
||||
BPF_F_DIR_SHIFT = 0x4
|
||||
BPF_F_FLOWID = 0x8
|
||||
BPF_F_PRI_MASK = 0x7
|
||||
BPF_H = 0x8
|
||||
BPF_IMM = 0x0
|
||||
BPF_IND = 0x40
|
||||
|
@ -137,6 +146,7 @@ const (
|
|||
BPF_OR = 0x40
|
||||
BPF_RELEASE = 0x30bb6
|
||||
BPF_RET = 0x6
|
||||
BPF_RND = 0xc0
|
||||
BPF_RSH = 0x70
|
||||
BPF_ST = 0x2
|
||||
BPF_STX = 0x3
|
||||
|
@ -177,7 +187,65 @@ const (
|
|||
CTL_KERN = 0x1
|
||||
CTL_MAXNAME = 0xc
|
||||
CTL_NET = 0x4
|
||||
DIOCADDQUEUE = 0xc110445d
|
||||
DIOCADDRULE = 0xcd604404
|
||||
DIOCADDSTATE = 0xc1084425
|
||||
DIOCCHANGERULE = 0xcd60441a
|
||||
DIOCCLRIFFLAG = 0xc028445a
|
||||
DIOCCLRSRCNODES = 0x20004455
|
||||
DIOCCLRSTATES = 0xc0e04412
|
||||
DIOCCLRSTATUS = 0xc0284416
|
||||
DIOCGETLIMIT = 0xc0084427
|
||||
DIOCGETQSTATS = 0xc1204460
|
||||
DIOCGETQUEUE = 0xc110445f
|
||||
DIOCGETQUEUES = 0xc110445e
|
||||
DIOCGETRULE = 0xcd604407
|
||||
DIOCGETRULES = 0xcd604406
|
||||
DIOCGETRULESET = 0xc444443b
|
||||
DIOCGETRULESETS = 0xc444443a
|
||||
DIOCGETSRCNODES = 0xc0104454
|
||||
DIOCGETSTATE = 0xc1084413
|
||||
DIOCGETSTATES = 0xc0104419
|
||||
DIOCGETSTATUS = 0xc1e84415
|
||||
DIOCGETSYNFLWATS = 0xc0084463
|
||||
DIOCGETTIMEOUT = 0xc008441e
|
||||
DIOCIGETIFACES = 0xc0284457
|
||||
DIOCKILLSRCNODES = 0xc080445b
|
||||
DIOCKILLSTATES = 0xc0e04429
|
||||
DIOCNATLOOK = 0xc0504417
|
||||
DIOCOSFPADD = 0xc088444f
|
||||
DIOCOSFPFLUSH = 0x2000444e
|
||||
DIOCOSFPGET = 0xc0884450
|
||||
DIOCRADDADDRS = 0xc4504443
|
||||
DIOCRADDTABLES = 0xc450443d
|
||||
DIOCRCLRADDRS = 0xc4504442
|
||||
DIOCRCLRASTATS = 0xc4504448
|
||||
DIOCRCLRTABLES = 0xc450443c
|
||||
DIOCRCLRTSTATS = 0xc4504441
|
||||
DIOCRDELADDRS = 0xc4504444
|
||||
DIOCRDELTABLES = 0xc450443e
|
||||
DIOCRGETADDRS = 0xc4504446
|
||||
DIOCRGETASTATS = 0xc4504447
|
||||
DIOCRGETTABLES = 0xc450443f
|
||||
DIOCRGETTSTATS = 0xc4504440
|
||||
DIOCRINADEFINE = 0xc450444d
|
||||
DIOCRSETADDRS = 0xc4504445
|
||||
DIOCRSETTFLAGS = 0xc450444a
|
||||
DIOCRTSTADDRS = 0xc4504449
|
||||
DIOCSETDEBUG = 0xc0044418
|
||||
DIOCSETHOSTID = 0xc0044456
|
||||
DIOCSETIFFLAG = 0xc0284459
|
||||
DIOCSETLIMIT = 0xc0084428
|
||||
DIOCSETREASS = 0xc004445c
|
||||
DIOCSETSTATUSIF = 0xc0284414
|
||||
DIOCSETSYNCOOKIES = 0xc0014462
|
||||
DIOCSETSYNFLWATS = 0xc0084461
|
||||
DIOCSETTIMEOUT = 0xc008441d
|
||||
DIOCSTART = 0x20004401
|
||||
DIOCSTOP = 0x20004402
|
||||
DIOCXBEGIN = 0xc0104451
|
||||
DIOCXCOMMIT = 0xc0104452
|
||||
DIOCXROLLBACK = 0xc0104453
|
||||
DLT_ARCNET = 0x7
|
||||
DLT_ATM_RFC1483 = 0xb
|
||||
DLT_AX25 = 0x3
|
||||
|
@ -240,6 +308,8 @@ const (
|
|||
EMUL_ENABLED = 0x1
|
||||
EMUL_NATIVE = 0x2
|
||||
ENDRUNDISC = 0x9
|
||||
ETH64_8021_RSVD_MASK = 0xfffffffffff0
|
||||
ETH64_8021_RSVD_PREFIX = 0x180c2000000
|
||||
ETHERMIN = 0x2e
|
||||
ETHERMTU = 0x5dc
|
||||
ETHERTYPE_8023 = 0x4
|
||||
|
@ -292,6 +362,7 @@ const (
|
|||
ETHERTYPE_DN = 0x6003
|
||||
ETHERTYPE_DOGFIGHT = 0x1989
|
||||
ETHERTYPE_DSMD = 0x8039
|
||||
ETHERTYPE_EAPOL = 0x888e
|
||||
ETHERTYPE_ECMA = 0x803
|
||||
ETHERTYPE_ENCRYPT = 0x803d
|
||||
ETHERTYPE_ES = 0x805d
|
||||
|
@ -323,6 +394,7 @@ const (
|
|||
ETHERTYPE_LLDP = 0x88cc
|
||||
ETHERTYPE_LOGICRAFT = 0x8148
|
||||
ETHERTYPE_LOOPBACK = 0x9000
|
||||
ETHERTYPE_MACSEC = 0x88e5
|
||||
ETHERTYPE_MATRA = 0x807a
|
||||
ETHERTYPE_MAX = 0xffff
|
||||
ETHERTYPE_MERIT = 0x807c
|
||||
|
@ -351,15 +423,17 @@ const (
|
|||
ETHERTYPE_NCD = 0x8149
|
||||
ETHERTYPE_NESTAR = 0x8006
|
||||
ETHERTYPE_NETBEUI = 0x8191
|
||||
ETHERTYPE_NHRP = 0x2001
|
||||
ETHERTYPE_NOVELL = 0x8138
|
||||
ETHERTYPE_NS = 0x600
|
||||
ETHERTYPE_NSAT = 0x601
|
||||
ETHERTYPE_NSCOMPAT = 0x807
|
||||
ETHERTYPE_NSH = 0x984f
|
||||
ETHERTYPE_NTRAILER = 0x10
|
||||
ETHERTYPE_OS9 = 0x7007
|
||||
ETHERTYPE_OS9NET = 0x7009
|
||||
ETHERTYPE_PACER = 0x80c6
|
||||
ETHERTYPE_PAE = 0x888e
|
||||
ETHERTYPE_PBB = 0x88e7
|
||||
ETHERTYPE_PCS = 0x4242
|
||||
ETHERTYPE_PLANNING = 0x8044
|
||||
ETHERTYPE_PPP = 0x880b
|
||||
|
@ -441,10 +515,11 @@ const (
|
|||
ETHER_VLAN_ENCAP_LEN = 0x4
|
||||
EVFILT_AIO = -0x3
|
||||
EVFILT_DEVICE = -0x8
|
||||
EVFILT_EXCEPT = -0x9
|
||||
EVFILT_PROC = -0x5
|
||||
EVFILT_READ = -0x1
|
||||
EVFILT_SIGNAL = -0x6
|
||||
EVFILT_SYSCOUNT = 0x8
|
||||
EVFILT_SYSCOUNT = 0x9
|
||||
EVFILT_TIMER = -0x7
|
||||
EVFILT_VNODE = -0x4
|
||||
EVFILT_WRITE = -0x2
|
||||
|
@ -466,7 +541,7 @@ const (
|
|||
EV_FLAG1 = 0x2000
|
||||
EV_ONESHOT = 0x10
|
||||
EV_RECEIPT = 0x40
|
||||
EV_SYSFLAGS = 0xf000
|
||||
EV_SYSFLAGS = 0xf800
|
||||
EXTA = 0x4b00
|
||||
EXTB = 0x9600
|
||||
EXTPROC = 0x800
|
||||
|
@ -732,6 +807,7 @@ const (
|
|||
IFT_VOICEOVERCABLE = 0xc6
|
||||
IFT_VOICEOVERFRAMERELAY = 0x99
|
||||
IFT_VOICEOVERIP = 0x68
|
||||
IFT_WIREGUARD = 0xfb
|
||||
IFT_X213 = 0x5d
|
||||
IFT_X25 = 0x5
|
||||
IFT_X25DDN = 0x4
|
||||
|
@ -797,9 +873,11 @@ const (
|
|||
IPPROTO_RAW = 0xff
|
||||
IPPROTO_ROUTING = 0x2b
|
||||
IPPROTO_RSVP = 0x2e
|
||||
IPPROTO_SCTP = 0x84
|
||||
IPPROTO_TCP = 0x6
|
||||
IPPROTO_TP = 0x1d
|
||||
IPPROTO_UDP = 0x11
|
||||
IPPROTO_UDPLITE = 0x88
|
||||
IPV6_AUTH_LEVEL = 0x35
|
||||
IPV6_AUTOFLOWLABEL = 0x3b
|
||||
IPV6_CHECKSUM = 0x1a
|
||||
|
@ -906,6 +984,9 @@ const (
|
|||
IP_TTL = 0x4
|
||||
ISIG = 0x80
|
||||
ISTRIP = 0x20
|
||||
ITIMER_PROF = 0x2
|
||||
ITIMER_REAL = 0x0
|
||||
ITIMER_VIRTUAL = 0x1
|
||||
IUCLC = 0x1000
|
||||
IXANY = 0x800
|
||||
IXOFF = 0x400
|
||||
|
@ -970,12 +1051,26 @@ const (
|
|||
MNT_ROOTFS = 0x4000
|
||||
MNT_SOFTDEP = 0x4000000
|
||||
MNT_STALLED = 0x100000
|
||||
MNT_SWAPPABLE = 0x200000
|
||||
MNT_SYNCHRONOUS = 0x2
|
||||
MNT_UPDATE = 0x10000
|
||||
MNT_VISFLAGMASK = 0x400ffff
|
||||
MNT_WAIT = 0x1
|
||||
MNT_WANTRDWR = 0x2000000
|
||||
MNT_WXALLOWED = 0x800
|
||||
MOUNT_AFS = "afs"
|
||||
MOUNT_CD9660 = "cd9660"
|
||||
MOUNT_EXT2FS = "ext2fs"
|
||||
MOUNT_FFS = "ffs"
|
||||
MOUNT_FUSEFS = "fuse"
|
||||
MOUNT_MFS = "mfs"
|
||||
MOUNT_MSDOS = "msdos"
|
||||
MOUNT_NCPFS = "ncpfs"
|
||||
MOUNT_NFS = "nfs"
|
||||
MOUNT_NTFS = "ntfs"
|
||||
MOUNT_TMPFS = "tmpfs"
|
||||
MOUNT_UDF = "udf"
|
||||
MOUNT_UFS = "ffs"
|
||||
MSG_BCAST = 0x100
|
||||
MSG_CMSG_CLOEXEC = 0x800
|
||||
MSG_CTRUNC = 0x20
|
||||
|
@ -988,6 +1083,7 @@ const (
|
|||
MSG_PEEK = 0x2
|
||||
MSG_TRUNC = 0x10
|
||||
MSG_WAITALL = 0x40
|
||||
MSG_WAITFORONE = 0x1000
|
||||
MS_ASYNC = 0x1
|
||||
MS_INVALIDATE = 0x4
|
||||
MS_SYNC = 0x2
|
||||
|
@ -996,7 +1092,8 @@ const (
|
|||
NET_RT_FLAGS = 0x2
|
||||
NET_RT_IFLIST = 0x3
|
||||
NET_RT_IFNAMES = 0x6
|
||||
NET_RT_MAXID = 0x7
|
||||
NET_RT_MAXID = 0x8
|
||||
NET_RT_SOURCE = 0x7
|
||||
NET_RT_STATS = 0x4
|
||||
NET_RT_TABLE = 0x5
|
||||
NFDBITS = 0x20
|
||||
|
@ -1013,6 +1110,7 @@ const (
|
|||
NOTE_FORK = 0x40000000
|
||||
NOTE_LINK = 0x10
|
||||
NOTE_LOWAT = 0x1
|
||||
NOTE_OOB = 0x4
|
||||
NOTE_PCTRLMASK = 0xf0000000
|
||||
NOTE_PDATAMASK = 0xfffff
|
||||
NOTE_RENAME = 0x20
|
||||
|
@ -1130,9 +1228,11 @@ const (
|
|||
RTF_STATIC = 0x800
|
||||
RTF_UP = 0x1
|
||||
RTF_USETRAILERS = 0x8000
|
||||
RTM_80211INFO = 0x15
|
||||
RTM_ADD = 0x1
|
||||
RTM_BFD = 0x12
|
||||
RTM_CHANGE = 0x3
|
||||
RTM_CHGADDRATTR = 0x14
|
||||
RTM_DELADDR = 0xd
|
||||
RTM_DELETE = 0x2
|
||||
RTM_DESYNC = 0x10
|
||||
|
@ -1140,7 +1240,6 @@ const (
|
|||
RTM_IFANNOUNCE = 0xf
|
||||
RTM_IFINFO = 0xe
|
||||
RTM_INVALIDATE = 0x11
|
||||
RTM_LOCK = 0x8
|
||||
RTM_LOSING = 0x5
|
||||
RTM_MAXSIZE = 0x800
|
||||
RTM_MISS = 0x7
|
||||
|
@ -1148,7 +1247,7 @@ const (
|
|||
RTM_PROPOSAL = 0x13
|
||||
RTM_REDIRECT = 0x6
|
||||
RTM_RESOLVE = 0xb
|
||||
RTM_RTTUNIT = 0xf4240
|
||||
RTM_SOURCE = 0x16
|
||||
RTM_VERSION = 0x5
|
||||
RTV_EXPIRE = 0x4
|
||||
RTV_HOPCOUNT = 0x2
|
||||
|
@ -1166,6 +1265,9 @@ const (
|
|||
RUSAGE_THREAD = 0x1
|
||||
SCM_RIGHTS = 0x1
|
||||
SCM_TIMESTAMP = 0x4
|
||||
SEEK_CUR = 0x1
|
||||
SEEK_END = 0x2
|
||||
SEEK_SET = 0x0
|
||||
SHUT_RD = 0x0
|
||||
SHUT_RDWR = 0x2
|
||||
SHUT_WR = 0x1
|
||||
|
@ -1182,35 +1284,37 @@ const (
|
|||
SIOCBRDGDELS = 0x80606942
|
||||
SIOCBRDGFLUSH = 0x80606948
|
||||
SIOCBRDGFRL = 0x808c694e
|
||||
SIOCBRDGGCACHE = 0xc0186941
|
||||
SIOCBRDGGFD = 0xc0186952
|
||||
SIOCBRDGGHT = 0xc0186951
|
||||
SIOCBRDGGCACHE = 0xc0146941
|
||||
SIOCBRDGGFD = 0xc0146952
|
||||
SIOCBRDGGHT = 0xc0146951
|
||||
SIOCBRDGGIFFLGS = 0xc060693e
|
||||
SIOCBRDGGMA = 0xc0186953
|
||||
SIOCBRDGGMA = 0xc0146953
|
||||
SIOCBRDGGPARAM = 0xc0406958
|
||||
SIOCBRDGGPRI = 0xc0186950
|
||||
SIOCBRDGGPRI = 0xc0146950
|
||||
SIOCBRDGGRL = 0xc030694f
|
||||
SIOCBRDGGTO = 0xc0186946
|
||||
SIOCBRDGGTO = 0xc0146946
|
||||
SIOCBRDGIFS = 0xc0606942
|
||||
SIOCBRDGRTS = 0xc0206943
|
||||
SIOCBRDGSADDR = 0xc1286944
|
||||
SIOCBRDGSCACHE = 0x80186940
|
||||
SIOCBRDGSFD = 0x80186952
|
||||
SIOCBRDGSHT = 0x80186951
|
||||
SIOCBRDGSCACHE = 0x80146940
|
||||
SIOCBRDGSFD = 0x80146952
|
||||
SIOCBRDGSHT = 0x80146951
|
||||
SIOCBRDGSIFCOST = 0x80606955
|
||||
SIOCBRDGSIFFLGS = 0x8060693f
|
||||
SIOCBRDGSIFPRIO = 0x80606954
|
||||
SIOCBRDGSIFPROT = 0x8060694a
|
||||
SIOCBRDGSMA = 0x80186953
|
||||
SIOCBRDGSPRI = 0x80186950
|
||||
SIOCBRDGSPROTO = 0x8018695a
|
||||
SIOCBRDGSTO = 0x80186945
|
||||
SIOCBRDGSTXHC = 0x80186959
|
||||
SIOCBRDGSMA = 0x80146953
|
||||
SIOCBRDGSPRI = 0x80146950
|
||||
SIOCBRDGSPROTO = 0x8014695a
|
||||
SIOCBRDGSTO = 0x80146945
|
||||
SIOCBRDGSTXHC = 0x80146959
|
||||
SIOCDELLABEL = 0x80206997
|
||||
SIOCDELMULTI = 0x80206932
|
||||
SIOCDIFADDR = 0x80206919
|
||||
SIOCDIFGROUP = 0x80286989
|
||||
SIOCDIFPARENT = 0x802069b4
|
||||
SIOCDIFPHYADDR = 0x80206949
|
||||
SIOCDPWE3NEIGHBOR = 0x802069de
|
||||
SIOCDVNETID = 0x802069af
|
||||
SIOCGETKALIVE = 0xc01869a4
|
||||
SIOCGETLABEL = 0x8020699a
|
||||
|
@ -1229,6 +1333,7 @@ const (
|
|||
SIOCGIFFLAGS = 0xc0206911
|
||||
SIOCGIFGATTR = 0xc028698b
|
||||
SIOCGIFGENERIC = 0xc020693a
|
||||
SIOCGIFGLIST = 0xc028698d
|
||||
SIOCGIFGMEMB = 0xc028698a
|
||||
SIOCGIFGROUP = 0xc0286988
|
||||
SIOCGIFHARDMTU = 0xc02069a5
|
||||
|
@ -1243,13 +1348,21 @@ const (
|
|||
SIOCGIFRDOMAIN = 0xc02069a0
|
||||
SIOCGIFRTLABEL = 0xc0206983
|
||||
SIOCGIFRXR = 0x802069aa
|
||||
SIOCGIFSFFPAGE = 0xc1126939
|
||||
SIOCGIFXFLAGS = 0xc020699e
|
||||
SIOCGLIFPHYADDR = 0xc218694b
|
||||
SIOCGLIFPHYDF = 0xc02069c2
|
||||
SIOCGLIFPHYECN = 0xc02069c8
|
||||
SIOCGLIFPHYRTABLE = 0xc02069a2
|
||||
SIOCGLIFPHYTTL = 0xc02069a9
|
||||
SIOCGPGRP = 0x40047309
|
||||
SIOCGPWE3 = 0xc0206998
|
||||
SIOCGPWE3CTRLWORD = 0xc02069dc
|
||||
SIOCGPWE3FAT = 0xc02069dd
|
||||
SIOCGPWE3NEIGHBOR = 0xc21869de
|
||||
SIOCGRXHPRIO = 0xc02069db
|
||||
SIOCGSPPPPARAMS = 0xc0206994
|
||||
SIOCGTXHPRIO = 0xc02069c6
|
||||
SIOCGUMBINFO = 0xc02069be
|
||||
SIOCGUMBPARAM = 0xc02069c0
|
||||
SIOCGVH = 0xc02069f6
|
||||
|
@ -1287,19 +1400,20 @@ const (
|
|||
SIOCSIFXFLAGS = 0x8020699d
|
||||
SIOCSLIFPHYADDR = 0x8218694a
|
||||
SIOCSLIFPHYDF = 0x802069c1
|
||||
SIOCSLIFPHYECN = 0x802069c7
|
||||
SIOCSLIFPHYRTABLE = 0x802069a1
|
||||
SIOCSLIFPHYTTL = 0x802069a8
|
||||
SIOCSPGRP = 0x80047308
|
||||
SIOCSPWE3CTRLWORD = 0x802069dc
|
||||
SIOCSPWE3FAT = 0x802069dd
|
||||
SIOCSPWE3NEIGHBOR = 0x821869de
|
||||
SIOCSRXHPRIO = 0x802069db
|
||||
SIOCSSPPPPARAMS = 0x80206993
|
||||
SIOCSTXHPRIO = 0x802069c5
|
||||
SIOCSUMBPARAM = 0x802069bf
|
||||
SIOCSVH = 0xc02069f5
|
||||
SIOCSVNETFLOWID = 0x802069c3
|
||||
SIOCSVNETID = 0x802069a6
|
||||
SIOCSWGDPID = 0xc018695b
|
||||
SIOCSWGMAXFLOW = 0xc0186960
|
||||
SIOCSWGMAXGROUP = 0xc018695d
|
||||
SIOCSWSDPID = 0x8018695c
|
||||
SIOCSWSPORTNO = 0xc060695f
|
||||
SOCK_CLOEXEC = 0x8000
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_DNS = 0x1000
|
||||
|
@ -1314,6 +1428,7 @@ const (
|
|||
SO_BINDANY = 0x1000
|
||||
SO_BROADCAST = 0x20
|
||||
SO_DEBUG = 0x1
|
||||
SO_DOMAIN = 0x1024
|
||||
SO_DONTROUTE = 0x10
|
||||
SO_ERROR = 0x1007
|
||||
SO_KEEPALIVE = 0x8
|
||||
|
@ -1321,6 +1436,7 @@ const (
|
|||
SO_NETPROC = 0x1020
|
||||
SO_OOBINLINE = 0x100
|
||||
SO_PEERCRED = 0x1022
|
||||
SO_PROTOCOL = 0x1025
|
||||
SO_RCVBUF = 0x1002
|
||||
SO_RCVLOWAT = 0x1004
|
||||
SO_RCVTIMEO = 0x1006
|
||||
|
@ -1370,7 +1486,18 @@ const (
|
|||
TCOFLUSH = 0x2
|
||||
TCOOFF = 0x1
|
||||
TCOON = 0x2
|
||||
TCP_MAXBURST = 0x4
|
||||
TCPOPT_EOL = 0x0
|
||||
TCPOPT_MAXSEG = 0x2
|
||||
TCPOPT_NOP = 0x1
|
||||
TCPOPT_SACK = 0x5
|
||||
TCPOPT_SACK_HDR = 0x1010500
|
||||
TCPOPT_SACK_PERMITTED = 0x4
|
||||
TCPOPT_SACK_PERMIT_HDR = 0x1010402
|
||||
TCPOPT_SIGNATURE = 0x13
|
||||
TCPOPT_TIMESTAMP = 0x8
|
||||
TCPOPT_TSTAMP_HDR = 0x101080a
|
||||
TCPOPT_WINDOW = 0x3
|
||||
TCP_INFO = 0x9
|
||||
TCP_MAXSEG = 0x2
|
||||
TCP_MAXWIN = 0xffff
|
||||
TCP_MAX_SACK = 0x3
|
||||
|
@ -1379,8 +1506,11 @@ const (
|
|||
TCP_MSS = 0x200
|
||||
TCP_NODELAY = 0x1
|
||||
TCP_NOPUSH = 0x10
|
||||
TCP_SACKHOLE_LIMIT = 0x80
|
||||
TCP_SACK_ENABLE = 0x8
|
||||
TCSAFLUSH = 0x2
|
||||
TIMER_ABSTIME = 0x1
|
||||
TIMER_RELTIME = 0x0
|
||||
TIOCCBRK = 0x2000747a
|
||||
TIOCCDTR = 0x20007478
|
||||
TIOCCHKVERAUTH = 0x2000741e
|
||||
|
@ -1445,7 +1575,6 @@ const (
|
|||
TIOCSPGRP = 0x80047476
|
||||
TIOCSTART = 0x2000746e
|
||||
TIOCSTAT = 0x20007465
|
||||
TIOCSTI = 0x80017472
|
||||
TIOCSTOP = 0x2000746f
|
||||
TIOCSTSTAMP = 0x8008745a
|
||||
TIOCSWINSZ = 0x80087467
|
||||
|
@ -1467,7 +1596,8 @@ const (
|
|||
VMIN = 0x10
|
||||
VM_ANONMIN = 0x7
|
||||
VM_LOADAVG = 0x2
|
||||
VM_MAXID = 0xc
|
||||
VM_MALLOC_CONF = 0xc
|
||||
VM_MAXID = 0xd
|
||||
VM_MAXSLP = 0xa
|
||||
VM_METER = 0x1
|
||||
VM_NKMEMPAGES = 0x6
|
||||
|
@ -1745,7 +1875,7 @@ var signalList = [...]struct {
|
|||
{3, "SIGQUIT", "quit"},
|
||||
{4, "SIGILL", "illegal instruction"},
|
||||
{5, "SIGTRAP", "trace/BPT trap"},
|
||||
{6, "SIGABRT", "abort trap"},
|
||||
{6, "SIGIOT", "abort trap"},
|
||||
{7, "SIGEMT", "EMT trap"},
|
||||
{8, "SIGFPE", "floating point exception"},
|
||||
{9, "SIGKILL", "killed"},
|
||||
|
@ -1772,4 +1902,5 @@ var signalList = [...]struct {
|
|||
{30, "SIGUSR1", "user defined signal 1"},
|
||||
{31, "SIGUSR2", "user defined signal 2"},
|
||||
{32, "SIGTHR", "thread AST"},
|
||||
{28672, "SIGSTKSZ", "unknown signal"},
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ const (
|
|||
AF_SNA = 0xb
|
||||
AF_UNIX = 0x1
|
||||
AF_UNSPEC = 0x0
|
||||
ALTWERASE = 0x200
|
||||
ARPHRD_ETHER = 0x1
|
||||
ARPHRD_FRELAY = 0xf
|
||||
ARPHRD_IEEE1394 = 0x18
|
||||
|
@ -82,7 +83,7 @@ const (
|
|||
BIOCGFILDROP = 0x40044278
|
||||
BIOCGHDRCMPLT = 0x40044274
|
||||
BIOCGRSIG = 0x40044273
|
||||
BIOCGRTIMEOUT = 0x400c426e
|
||||
BIOCGRTIMEOUT = 0x4010426e
|
||||
BIOCGSTATS = 0x4008426f
|
||||
BIOCIMMEDIATE = 0x80044270
|
||||
BIOCLOCK = 0x20004276
|
||||
|
@ -96,7 +97,7 @@ const (
|
|||
BIOCSFILDROP = 0x80044279
|
||||
BIOCSHDRCMPLT = 0x80044275
|
||||
BIOCSRSIG = 0x80044272
|
||||
BIOCSRTIMEOUT = 0x800c426d
|
||||
BIOCSRTIMEOUT = 0x8010426d
|
||||
BIOCVERSION = 0x40044271
|
||||
BPF_A = 0x10
|
||||
BPF_ABS = 0x20
|
||||
|
@ -108,6 +109,15 @@ const (
|
|||
BPF_DIRECTION_IN = 0x1
|
||||
BPF_DIRECTION_OUT = 0x2
|
||||
BPF_DIV = 0x30
|
||||
BPF_FILDROP_CAPTURE = 0x1
|
||||
BPF_FILDROP_DROP = 0x2
|
||||
BPF_FILDROP_PASS = 0x0
|
||||
BPF_F_DIR_IN = 0x10
|
||||
BPF_F_DIR_MASK = 0x30
|
||||
BPF_F_DIR_OUT = 0x20
|
||||
BPF_F_DIR_SHIFT = 0x4
|
||||
BPF_F_FLOWID = 0x8
|
||||
BPF_F_PRI_MASK = 0x7
|
||||
BPF_H = 0x8
|
||||
BPF_IMM = 0x0
|
||||
BPF_IND = 0x40
|
||||
|
@ -136,6 +146,7 @@ const (
|
|||
BPF_OR = 0x40
|
||||
BPF_RELEASE = 0x30bb6
|
||||
BPF_RET = 0x6
|
||||
BPF_RND = 0xc0
|
||||
BPF_RSH = 0x70
|
||||
BPF_ST = 0x2
|
||||
BPF_STX = 0x3
|
||||
|
@ -147,6 +158,12 @@ const (
|
|||
BRKINT = 0x2
|
||||
CFLUSH = 0xf
|
||||
CLOCAL = 0x8000
|
||||
CLOCK_BOOTTIME = 0x6
|
||||
CLOCK_MONOTONIC = 0x3
|
||||
CLOCK_PROCESS_CPUTIME_ID = 0x2
|
||||
CLOCK_REALTIME = 0x0
|
||||
CLOCK_THREAD_CPUTIME_ID = 0x4
|
||||
CLOCK_UPTIME = 0x5
|
||||
CPUSTATES = 0x6
|
||||
CP_IDLE = 0x5
|
||||
CP_INTR = 0x4
|
||||
|
@ -170,7 +187,65 @@ const (
|
|||
CTL_KERN = 0x1
|
||||
CTL_MAXNAME = 0xc
|
||||
CTL_NET = 0x4
|
||||
DIOCADDQUEUE = 0xc100445d
|
||||
DIOCADDRULE = 0xcce04404
|
||||
DIOCADDSTATE = 0xc1084425
|
||||
DIOCCHANGERULE = 0xcce0441a
|
||||
DIOCCLRIFFLAG = 0xc024445a
|
||||
DIOCCLRSRCNODES = 0x20004455
|
||||
DIOCCLRSTATES = 0xc0d04412
|
||||
DIOCCLRSTATUS = 0xc0244416
|
||||
DIOCGETLIMIT = 0xc0084427
|
||||
DIOCGETQSTATS = 0xc1084460
|
||||
DIOCGETQUEUE = 0xc100445f
|
||||
DIOCGETQUEUES = 0xc100445e
|
||||
DIOCGETRULE = 0xcce04407
|
||||
DIOCGETRULES = 0xcce04406
|
||||
DIOCGETRULESET = 0xc444443b
|
||||
DIOCGETRULESETS = 0xc444443a
|
||||
DIOCGETSRCNODES = 0xc0084454
|
||||
DIOCGETSTATE = 0xc1084413
|
||||
DIOCGETSTATES = 0xc0084419
|
||||
DIOCGETSTATUS = 0xc1e84415
|
||||
DIOCGETSYNFLWATS = 0xc0084463
|
||||
DIOCGETTIMEOUT = 0xc008441e
|
||||
DIOCIGETIFACES = 0xc0244457
|
||||
DIOCKILLSRCNODES = 0xc068445b
|
||||
DIOCKILLSTATES = 0xc0d04429
|
||||
DIOCNATLOOK = 0xc0504417
|
||||
DIOCOSFPADD = 0xc088444f
|
||||
DIOCOSFPFLUSH = 0x2000444e
|
||||
DIOCOSFPGET = 0xc0884450
|
||||
DIOCRADDADDRS = 0xc44c4443
|
||||
DIOCRADDTABLES = 0xc44c443d
|
||||
DIOCRCLRADDRS = 0xc44c4442
|
||||
DIOCRCLRASTATS = 0xc44c4448
|
||||
DIOCRCLRTABLES = 0xc44c443c
|
||||
DIOCRCLRTSTATS = 0xc44c4441
|
||||
DIOCRDELADDRS = 0xc44c4444
|
||||
DIOCRDELTABLES = 0xc44c443e
|
||||
DIOCRGETADDRS = 0xc44c4446
|
||||
DIOCRGETASTATS = 0xc44c4447
|
||||
DIOCRGETTABLES = 0xc44c443f
|
||||
DIOCRGETTSTATS = 0xc44c4440
|
||||
DIOCRINADEFINE = 0xc44c444d
|
||||
DIOCRSETADDRS = 0xc44c4445
|
||||
DIOCRSETTFLAGS = 0xc44c444a
|
||||
DIOCRTSTADDRS = 0xc44c4449
|
||||
DIOCSETDEBUG = 0xc0044418
|
||||
DIOCSETHOSTID = 0xc0044456
|
||||
DIOCSETIFFLAG = 0xc0244459
|
||||
DIOCSETLIMIT = 0xc0084428
|
||||
DIOCSETREASS = 0xc004445c
|
||||
DIOCSETSTATUSIF = 0xc0244414
|
||||
DIOCSETSYNCOOKIES = 0xc0014462
|
||||
DIOCSETSYNFLWATS = 0xc0084461
|
||||
DIOCSETTIMEOUT = 0xc008441d
|
||||
DIOCSTART = 0x20004401
|
||||
DIOCSTOP = 0x20004402
|
||||
DIOCXBEGIN = 0xc00c4451
|
||||
DIOCXCOMMIT = 0xc00c4452
|
||||
DIOCXROLLBACK = 0xc00c4453
|
||||
DLT_ARCNET = 0x7
|
||||
DLT_ATM_RFC1483 = 0xb
|
||||
DLT_AX25 = 0x3
|
||||
|
@ -186,6 +261,7 @@ const (
|
|||
DLT_LOOP = 0xc
|
||||
DLT_MPLS = 0xdb
|
||||
DLT_NULL = 0x0
|
||||
DLT_OPENFLOW = 0x10b
|
||||
DLT_PFLOG = 0x75
|
||||
DLT_PFSYNC = 0x12
|
||||
DLT_PPP = 0x9
|
||||
|
@ -196,6 +272,23 @@ const (
|
|||
DLT_RAW = 0xe
|
||||
DLT_SLIP = 0x8
|
||||
DLT_SLIP_BSDOS = 0xf
|
||||
DLT_USBPCAP = 0xf9
|
||||
DLT_USER0 = 0x93
|
||||
DLT_USER1 = 0x94
|
||||
DLT_USER10 = 0x9d
|
||||
DLT_USER11 = 0x9e
|
||||
DLT_USER12 = 0x9f
|
||||
DLT_USER13 = 0xa0
|
||||
DLT_USER14 = 0xa1
|
||||
DLT_USER15 = 0xa2
|
||||
DLT_USER2 = 0x95
|
||||
DLT_USER3 = 0x96
|
||||
DLT_USER4 = 0x97
|
||||
DLT_USER5 = 0x98
|
||||
DLT_USER6 = 0x99
|
||||
DLT_USER7 = 0x9a
|
||||
DLT_USER8 = 0x9b
|
||||
DLT_USER9 = 0x9c
|
||||
DT_BLK = 0x6
|
||||
DT_CHR = 0x2
|
||||
DT_DIR = 0x4
|
||||
|
@ -215,6 +308,8 @@ const (
|
|||
EMUL_ENABLED = 0x1
|
||||
EMUL_NATIVE = 0x2
|
||||
ENDRUNDISC = 0x9
|
||||
ETH64_8021_RSVD_MASK = 0xfffffffffff0
|
||||
ETH64_8021_RSVD_PREFIX = 0x180c2000000
|
||||
ETHERMIN = 0x2e
|
||||
ETHERMTU = 0x5dc
|
||||
ETHERTYPE_8023 = 0x4
|
||||
|
@ -267,6 +362,7 @@ const (
|
|||
ETHERTYPE_DN = 0x6003
|
||||
ETHERTYPE_DOGFIGHT = 0x1989
|
||||
ETHERTYPE_DSMD = 0x8039
|
||||
ETHERTYPE_EAPOL = 0x888e
|
||||
ETHERTYPE_ECMA = 0x803
|
||||
ETHERTYPE_ENCRYPT = 0x803d
|
||||
ETHERTYPE_ES = 0x805d
|
||||
|
@ -298,6 +394,7 @@ const (
|
|||
ETHERTYPE_LLDP = 0x88cc
|
||||
ETHERTYPE_LOGICRAFT = 0x8148
|
||||
ETHERTYPE_LOOPBACK = 0x9000
|
||||
ETHERTYPE_MACSEC = 0x88e5
|
||||
ETHERTYPE_MATRA = 0x807a
|
||||
ETHERTYPE_MAX = 0xffff
|
||||
ETHERTYPE_MERIT = 0x807c
|
||||
|
@ -326,15 +423,17 @@ const (
|
|||
ETHERTYPE_NCD = 0x8149
|
||||
ETHERTYPE_NESTAR = 0x8006
|
||||
ETHERTYPE_NETBEUI = 0x8191
|
||||
ETHERTYPE_NHRP = 0x2001
|
||||
ETHERTYPE_NOVELL = 0x8138
|
||||
ETHERTYPE_NS = 0x600
|
||||
ETHERTYPE_NSAT = 0x601
|
||||
ETHERTYPE_NSCOMPAT = 0x807
|
||||
ETHERTYPE_NSH = 0x984f
|
||||
ETHERTYPE_NTRAILER = 0x10
|
||||
ETHERTYPE_OS9 = 0x7007
|
||||
ETHERTYPE_OS9NET = 0x7009
|
||||
ETHERTYPE_PACER = 0x80c6
|
||||
ETHERTYPE_PAE = 0x888e
|
||||
ETHERTYPE_PBB = 0x88e7
|
||||
ETHERTYPE_PCS = 0x4242
|
||||
ETHERTYPE_PLANNING = 0x8044
|
||||
ETHERTYPE_PPP = 0x880b
|
||||
|
@ -409,28 +508,40 @@ const (
|
|||
ETHER_CRC_POLY_LE = 0xedb88320
|
||||
ETHER_HDR_LEN = 0xe
|
||||
ETHER_MAX_DIX_LEN = 0x600
|
||||
ETHER_MAX_HARDMTU_LEN = 0xff9b
|
||||
ETHER_MAX_LEN = 0x5ee
|
||||
ETHER_MIN_LEN = 0x40
|
||||
ETHER_TYPE_LEN = 0x2
|
||||
ETHER_VLAN_ENCAP_LEN = 0x4
|
||||
EVFILT_AIO = -0x3
|
||||
EVFILT_DEVICE = -0x8
|
||||
EVFILT_EXCEPT = -0x9
|
||||
EVFILT_PROC = -0x5
|
||||
EVFILT_READ = -0x1
|
||||
EVFILT_SIGNAL = -0x6
|
||||
EVFILT_SYSCOUNT = 0x7
|
||||
EVFILT_SYSCOUNT = 0x9
|
||||
EVFILT_TIMER = -0x7
|
||||
EVFILT_VNODE = -0x4
|
||||
EVFILT_WRITE = -0x2
|
||||
EVL_ENCAPLEN = 0x4
|
||||
EVL_PRIO_BITS = 0xd
|
||||
EVL_PRIO_MAX = 0x7
|
||||
EVL_VLID_MASK = 0xfff
|
||||
EVL_VLID_MAX = 0xffe
|
||||
EVL_VLID_MIN = 0x1
|
||||
EVL_VLID_NULL = 0x0
|
||||
EV_ADD = 0x1
|
||||
EV_CLEAR = 0x20
|
||||
EV_DELETE = 0x2
|
||||
EV_DISABLE = 0x8
|
||||
EV_DISPATCH = 0x80
|
||||
EV_ENABLE = 0x4
|
||||
EV_EOF = 0x8000
|
||||
EV_ERROR = 0x4000
|
||||
EV_FLAG1 = 0x2000
|
||||
EV_ONESHOT = 0x10
|
||||
EV_SYSFLAGS = 0xf000
|
||||
EV_RECEIPT = 0x40
|
||||
EV_SYSFLAGS = 0xf800
|
||||
EXTA = 0x4b00
|
||||
EXTB = 0x9600
|
||||
EXTPROC = 0x800
|
||||
|
@ -443,6 +554,8 @@ const (
|
|||
F_GETFL = 0x3
|
||||
F_GETLK = 0x7
|
||||
F_GETOWN = 0x5
|
||||
F_ISATTY = 0xb
|
||||
F_OK = 0x0
|
||||
F_RDLCK = 0x1
|
||||
F_SETFD = 0x2
|
||||
F_SETFL = 0x4
|
||||
|
@ -459,7 +572,6 @@ const (
|
|||
IEXTEN = 0x400
|
||||
IFAN_ARRIVAL = 0x0
|
||||
IFAN_DEPARTURE = 0x1
|
||||
IFA_ROUTE = 0x1
|
||||
IFF_ALLMULTI = 0x200
|
||||
IFF_BROADCAST = 0x2
|
||||
IFF_CANTCHANGE = 0x8e52
|
||||
|
@ -470,12 +582,12 @@ const (
|
|||
IFF_LOOPBACK = 0x8
|
||||
IFF_MULTICAST = 0x8000
|
||||
IFF_NOARP = 0x80
|
||||
IFF_NOTRAILERS = 0x20
|
||||
IFF_OACTIVE = 0x400
|
||||
IFF_POINTOPOINT = 0x10
|
||||
IFF_PROMISC = 0x100
|
||||
IFF_RUNNING = 0x40
|
||||
IFF_SIMPLEX = 0x800
|
||||
IFF_STATICARP = 0x20
|
||||
IFF_UP = 0x1
|
||||
IFNAMSIZ = 0x10
|
||||
IFT_1822 = 0x2
|
||||
|
@ -604,6 +716,7 @@ const (
|
|||
IFT_LINEGROUP = 0xd2
|
||||
IFT_LOCALTALK = 0x2a
|
||||
IFT_LOOP = 0x18
|
||||
IFT_MBIM = 0xfa
|
||||
IFT_MEDIAMAILOVERIP = 0x8b
|
||||
IFT_MFSIGLINK = 0xa7
|
||||
IFT_MIOX25 = 0x26
|
||||
|
@ -694,6 +807,7 @@ const (
|
|||
IFT_VOICEOVERCABLE = 0xc6
|
||||
IFT_VOICEOVERFRAMERELAY = 0x99
|
||||
IFT_VOICEOVERIP = 0x68
|
||||
IFT_WIREGUARD = 0xfb
|
||||
IFT_X213 = 0x5d
|
||||
IFT_X25 = 0x5
|
||||
IFT_X25DDN = 0x4
|
||||
|
@ -728,8 +842,6 @@ const (
|
|||
IPPROTO_AH = 0x33
|
||||
IPPROTO_CARP = 0x70
|
||||
IPPROTO_DIVERT = 0x102
|
||||
IPPROTO_DIVERT_INIT = 0x2
|
||||
IPPROTO_DIVERT_RESP = 0x1
|
||||
IPPROTO_DONE = 0x101
|
||||
IPPROTO_DSTOPTS = 0x3c
|
||||
IPPROTO_EGP = 0x8
|
||||
|
@ -761,9 +873,11 @@ const (
|
|||
IPPROTO_RAW = 0xff
|
||||
IPPROTO_ROUTING = 0x2b
|
||||
IPPROTO_RSVP = 0x2e
|
||||
IPPROTO_SCTP = 0x84
|
||||
IPPROTO_TCP = 0x6
|
||||
IPPROTO_TP = 0x1d
|
||||
IPPROTO_UDP = 0x11
|
||||
IPPROTO_UDPLITE = 0x88
|
||||
IPV6_AUTH_LEVEL = 0x35
|
||||
IPV6_AUTOFLOWLABEL = 0x3b
|
||||
IPV6_CHECKSUM = 0x1a
|
||||
|
@ -786,6 +900,7 @@ const (
|
|||
IPV6_LEAVE_GROUP = 0xd
|
||||
IPV6_MAXHLIM = 0xff
|
||||
IPV6_MAXPACKET = 0xffff
|
||||
IPV6_MINHOPCOUNT = 0x41
|
||||
IPV6_MMTU = 0x500
|
||||
IPV6_MULTICAST_HOPS = 0xa
|
||||
IPV6_MULTICAST_IF = 0x9
|
||||
|
@ -825,12 +940,12 @@ const (
|
|||
IP_DEFAULT_MULTICAST_LOOP = 0x1
|
||||
IP_DEFAULT_MULTICAST_TTL = 0x1
|
||||
IP_DF = 0x4000
|
||||
IP_DIVERTFL = 0x1022
|
||||
IP_DROP_MEMBERSHIP = 0xd
|
||||
IP_ESP_NETWORK_LEVEL = 0x16
|
||||
IP_ESP_TRANS_LEVEL = 0x15
|
||||
IP_HDRINCL = 0x2
|
||||
IP_IPCOMP_LEVEL = 0x1d
|
||||
IP_IPDEFTTL = 0x25
|
||||
IP_IPSECFLOWINFO = 0x24
|
||||
IP_IPSEC_LOCAL_AUTH = 0x1b
|
||||
IP_IPSEC_LOCAL_CRED = 0x19
|
||||
|
@ -864,10 +979,15 @@ const (
|
|||
IP_RETOPTS = 0x8
|
||||
IP_RF = 0x8000
|
||||
IP_RTABLE = 0x1021
|
||||
IP_SENDSRCADDR = 0x7
|
||||
IP_TOS = 0x3
|
||||
IP_TTL = 0x4
|
||||
ISIG = 0x80
|
||||
ISTRIP = 0x20
|
||||
ITIMER_PROF = 0x2
|
||||
ITIMER_REAL = 0x0
|
||||
ITIMER_VIRTUAL = 0x1
|
||||
IUCLC = 0x1000
|
||||
IXANY = 0x800
|
||||
IXOFF = 0x400
|
||||
IXON = 0x200
|
||||
|
@ -922,6 +1042,7 @@ const (
|
|||
MNT_NOATIME = 0x8000
|
||||
MNT_NODEV = 0x10
|
||||
MNT_NOEXEC = 0x4
|
||||
MNT_NOPERM = 0x20
|
||||
MNT_NOSUID = 0x8
|
||||
MNT_NOWAIT = 0x2
|
||||
MNT_QUOTA = 0x2000
|
||||
|
@ -929,12 +1050,27 @@ const (
|
|||
MNT_RELOAD = 0x40000
|
||||
MNT_ROOTFS = 0x4000
|
||||
MNT_SOFTDEP = 0x4000000
|
||||
MNT_STALLED = 0x100000
|
||||
MNT_SWAPPABLE = 0x200000
|
||||
MNT_SYNCHRONOUS = 0x2
|
||||
MNT_UPDATE = 0x10000
|
||||
MNT_VISFLAGMASK = 0x400ffff
|
||||
MNT_WAIT = 0x1
|
||||
MNT_WANTRDWR = 0x2000000
|
||||
MNT_WXALLOWED = 0x800
|
||||
MOUNT_AFS = "afs"
|
||||
MOUNT_CD9660 = "cd9660"
|
||||
MOUNT_EXT2FS = "ext2fs"
|
||||
MOUNT_FFS = "ffs"
|
||||
MOUNT_FUSEFS = "fuse"
|
||||
MOUNT_MFS = "mfs"
|
||||
MOUNT_MSDOS = "msdos"
|
||||
MOUNT_NCPFS = "ncpfs"
|
||||
MOUNT_NFS = "nfs"
|
||||
MOUNT_NTFS = "ntfs"
|
||||
MOUNT_TMPFS = "tmpfs"
|
||||
MOUNT_UDF = "udf"
|
||||
MOUNT_UFS = "ffs"
|
||||
MSG_BCAST = 0x100
|
||||
MSG_CMSG_CLOEXEC = 0x800
|
||||
MSG_CTRUNC = 0x20
|
||||
|
@ -947,6 +1083,7 @@ const (
|
|||
MSG_PEEK = 0x2
|
||||
MSG_TRUNC = 0x10
|
||||
MSG_WAITALL = 0x40
|
||||
MSG_WAITFORONE = 0x1000
|
||||
MS_ASYNC = 0x1
|
||||
MS_INVALIDATE = 0x4
|
||||
MS_SYNC = 0x2
|
||||
|
@ -954,12 +1091,16 @@ const (
|
|||
NET_RT_DUMP = 0x1
|
||||
NET_RT_FLAGS = 0x2
|
||||
NET_RT_IFLIST = 0x3
|
||||
NET_RT_MAXID = 0x6
|
||||
NET_RT_IFNAMES = 0x6
|
||||
NET_RT_MAXID = 0x8
|
||||
NET_RT_SOURCE = 0x7
|
||||
NET_RT_STATS = 0x4
|
||||
NET_RT_TABLE = 0x5
|
||||
NFDBITS = 0x20
|
||||
NOFLSH = 0x80000000
|
||||
NOKERNINFO = 0x2000000
|
||||
NOTE_ATTRIB = 0x8
|
||||
NOTE_CHANGE = 0x1
|
||||
NOTE_CHILD = 0x4
|
||||
NOTE_DELETE = 0x1
|
||||
NOTE_EOF = 0x2
|
||||
|
@ -969,6 +1110,7 @@ const (
|
|||
NOTE_FORK = 0x40000000
|
||||
NOTE_LINK = 0x10
|
||||
NOTE_LOWAT = 0x1
|
||||
NOTE_OOB = 0x4
|
||||
NOTE_PCTRLMASK = 0xf0000000
|
||||
NOTE_PDATAMASK = 0xfffff
|
||||
NOTE_RENAME = 0x20
|
||||
|
@ -978,11 +1120,13 @@ const (
|
|||
NOTE_TRUNCATE = 0x80
|
||||
NOTE_WRITE = 0x2
|
||||
OCRNL = 0x10
|
||||
OLCUC = 0x20
|
||||
ONLCR = 0x2
|
||||
ONLRET = 0x80
|
||||
ONOCR = 0x40
|
||||
ONOEOT = 0x8
|
||||
OPOST = 0x1
|
||||
OXTABS = 0x4
|
||||
O_ACCMODE = 0x3
|
||||
O_APPEND = 0x8
|
||||
O_ASYNC = 0x40
|
||||
|
@ -1027,19 +1171,25 @@ const (
|
|||
RLIMIT_STACK = 0x3
|
||||
RLIM_INFINITY = 0x7fffffffffffffff
|
||||
RTAX_AUTHOR = 0x6
|
||||
RTAX_BFD = 0xb
|
||||
RTAX_BRD = 0x7
|
||||
RTAX_DNS = 0xc
|
||||
RTAX_DST = 0x0
|
||||
RTAX_GATEWAY = 0x1
|
||||
RTAX_GENMASK = 0x3
|
||||
RTAX_IFA = 0x5
|
||||
RTAX_IFP = 0x4
|
||||
RTAX_LABEL = 0xa
|
||||
RTAX_MAX = 0xb
|
||||
RTAX_MAX = 0xf
|
||||
RTAX_NETMASK = 0x2
|
||||
RTAX_SEARCH = 0xe
|
||||
RTAX_SRC = 0x8
|
||||
RTAX_SRCMASK = 0x9
|
||||
RTAX_STATIC = 0xd
|
||||
RTA_AUTHOR = 0x40
|
||||
RTA_BFD = 0x800
|
||||
RTA_BRD = 0x80
|
||||
RTA_DNS = 0x1000
|
||||
RTA_DST = 0x1
|
||||
RTA_GATEWAY = 0x2
|
||||
RTA_GENMASK = 0x8
|
||||
|
@ -1047,24 +1197,29 @@ const (
|
|||
RTA_IFP = 0x10
|
||||
RTA_LABEL = 0x400
|
||||
RTA_NETMASK = 0x4
|
||||
RTA_SEARCH = 0x4000
|
||||
RTA_SRC = 0x100
|
||||
RTA_SRCMASK = 0x200
|
||||
RTA_STATIC = 0x2000
|
||||
RTF_ANNOUNCE = 0x4000
|
||||
RTF_BFD = 0x1000000
|
||||
RTF_BLACKHOLE = 0x1000
|
||||
RTF_BROADCAST = 0x400000
|
||||
RTF_CACHED = 0x20000
|
||||
RTF_CLONED = 0x10000
|
||||
RTF_CLONING = 0x100
|
||||
RTF_CONNECTED = 0x800000
|
||||
RTF_DONE = 0x40
|
||||
RTF_DYNAMIC = 0x10
|
||||
RTF_FMASK = 0x70f808
|
||||
RTF_FMASK = 0x110fc08
|
||||
RTF_GATEWAY = 0x2
|
||||
RTF_HOST = 0x4
|
||||
RTF_LLINFO = 0x400
|
||||
RTF_LOCAL = 0x200000
|
||||
RTF_MASK = 0x80
|
||||
RTF_MODIFIED = 0x20
|
||||
RTF_MPATH = 0x40000
|
||||
RTF_MPLS = 0x100000
|
||||
RTF_MULTICAST = 0x200
|
||||
RTF_PERMANENT_ARP = 0x2000
|
||||
RTF_PROTO1 = 0x8000
|
||||
RTF_PROTO2 = 0x4000
|
||||
|
@ -1073,23 +1228,26 @@ const (
|
|||
RTF_STATIC = 0x800
|
||||
RTF_UP = 0x1
|
||||
RTF_USETRAILERS = 0x8000
|
||||
RTF_XRESOLVE = 0x200
|
||||
RTM_80211INFO = 0x15
|
||||
RTM_ADD = 0x1
|
||||
RTM_BFD = 0x12
|
||||
RTM_CHANGE = 0x3
|
||||
RTM_CHGADDRATTR = 0x14
|
||||
RTM_DELADDR = 0xd
|
||||
RTM_DELETE = 0x2
|
||||
RTM_DESYNC = 0x10
|
||||
RTM_GET = 0x4
|
||||
RTM_IFANNOUNCE = 0xf
|
||||
RTM_IFINFO = 0xe
|
||||
RTM_LOCK = 0x8
|
||||
RTM_INVALIDATE = 0x11
|
||||
RTM_LOSING = 0x5
|
||||
RTM_MAXSIZE = 0x800
|
||||
RTM_MISS = 0x7
|
||||
RTM_NEWADDR = 0xc
|
||||
RTM_PROPOSAL = 0x13
|
||||
RTM_REDIRECT = 0x6
|
||||
RTM_RESOLVE = 0xb
|
||||
RTM_RTTUNIT = 0xf4240
|
||||
RTM_SOURCE = 0x16
|
||||
RTM_VERSION = 0x5
|
||||
RTV_EXPIRE = 0x4
|
||||
RTV_HOPCOUNT = 0x2
|
||||
|
@ -1099,67 +1257,74 @@ const (
|
|||
RTV_RTTVAR = 0x80
|
||||
RTV_SPIPE = 0x10
|
||||
RTV_SSTHRESH = 0x20
|
||||
RT_TABLEID_BITS = 0x8
|
||||
RT_TABLEID_MASK = 0xff
|
||||
RT_TABLEID_MAX = 0xff
|
||||
RUSAGE_CHILDREN = -0x1
|
||||
RUSAGE_SELF = 0x0
|
||||
RUSAGE_THREAD = 0x1
|
||||
SCM_RIGHTS = 0x1
|
||||
SCM_TIMESTAMP = 0x4
|
||||
SEEK_CUR = 0x1
|
||||
SEEK_END = 0x2
|
||||
SEEK_SET = 0x0
|
||||
SHUT_RD = 0x0
|
||||
SHUT_RDWR = 0x2
|
||||
SHUT_WR = 0x1
|
||||
SIOCADDMULTI = 0x80206931
|
||||
SIOCAIFADDR = 0x8040691a
|
||||
SIOCAIFGROUP = 0x80246987
|
||||
SIOCALIFADDR = 0x8218691c
|
||||
SIOCATMARK = 0x40047307
|
||||
SIOCBRDGADD = 0x8054693c
|
||||
SIOCBRDGADDS = 0x80546941
|
||||
SIOCBRDGARL = 0x806e694d
|
||||
SIOCBRDGADD = 0x8060693c
|
||||
SIOCBRDGADDL = 0x80606949
|
||||
SIOCBRDGADDS = 0x80606941
|
||||
SIOCBRDGARL = 0x808c694d
|
||||
SIOCBRDGDADDR = 0x81286947
|
||||
SIOCBRDGDEL = 0x8054693d
|
||||
SIOCBRDGDELS = 0x80546942
|
||||
SIOCBRDGFLUSH = 0x80546948
|
||||
SIOCBRDGFRL = 0x806e694e
|
||||
SIOCBRDGDEL = 0x8060693d
|
||||
SIOCBRDGDELS = 0x80606942
|
||||
SIOCBRDGFLUSH = 0x80606948
|
||||
SIOCBRDGFRL = 0x808c694e
|
||||
SIOCBRDGGCACHE = 0xc0146941
|
||||
SIOCBRDGGFD = 0xc0146952
|
||||
SIOCBRDGGHT = 0xc0146951
|
||||
SIOCBRDGGIFFLGS = 0xc054693e
|
||||
SIOCBRDGGIFFLGS = 0xc060693e
|
||||
SIOCBRDGGMA = 0xc0146953
|
||||
SIOCBRDGGPARAM = 0xc03c6958
|
||||
SIOCBRDGGPARAM = 0xc0406958
|
||||
SIOCBRDGGPRI = 0xc0146950
|
||||
SIOCBRDGGRL = 0xc028694f
|
||||
SIOCBRDGGSIFS = 0xc054693c
|
||||
SIOCBRDGGTO = 0xc0146946
|
||||
SIOCBRDGIFS = 0xc0546942
|
||||
SIOCBRDGIFS = 0xc0606942
|
||||
SIOCBRDGRTS = 0xc0186943
|
||||
SIOCBRDGSADDR = 0xc1286944
|
||||
SIOCBRDGSCACHE = 0x80146940
|
||||
SIOCBRDGSFD = 0x80146952
|
||||
SIOCBRDGSHT = 0x80146951
|
||||
SIOCBRDGSIFCOST = 0x80546955
|
||||
SIOCBRDGSIFFLGS = 0x8054693f
|
||||
SIOCBRDGSIFPRIO = 0x80546954
|
||||
SIOCBRDGSIFCOST = 0x80606955
|
||||
SIOCBRDGSIFFLGS = 0x8060693f
|
||||
SIOCBRDGSIFPRIO = 0x80606954
|
||||
SIOCBRDGSIFPROT = 0x8060694a
|
||||
SIOCBRDGSMA = 0x80146953
|
||||
SIOCBRDGSPRI = 0x80146950
|
||||
SIOCBRDGSPROTO = 0x8014695a
|
||||
SIOCBRDGSTO = 0x80146945
|
||||
SIOCBRDGSTXHC = 0x80146959
|
||||
SIOCDELLABEL = 0x80206997
|
||||
SIOCDELMULTI = 0x80206932
|
||||
SIOCDIFADDR = 0x80206919
|
||||
SIOCDIFGROUP = 0x80246989
|
||||
SIOCDIFPARENT = 0x802069b4
|
||||
SIOCDIFPHYADDR = 0x80206949
|
||||
SIOCDLIFADDR = 0x8218691e
|
||||
SIOCDPWE3NEIGHBOR = 0x802069de
|
||||
SIOCDVNETID = 0x802069af
|
||||
SIOCGETKALIVE = 0xc01869a4
|
||||
SIOCGETLABEL = 0x8020699a
|
||||
SIOCGETMPWCFG = 0xc02069ae
|
||||
SIOCGETPFLOW = 0xc02069fe
|
||||
SIOCGETPFSYNC = 0xc02069f8
|
||||
SIOCGETSGCNT = 0xc0147534
|
||||
SIOCGETVIFCNT = 0xc0147533
|
||||
SIOCGETVLAN = 0xc0206990
|
||||
SIOCGHIWAT = 0x40047301
|
||||
SIOCGIFADDR = 0xc0206921
|
||||
SIOCGIFASYNCMAP = 0xc020697c
|
||||
SIOCGIFBRDADDR = 0xc0206923
|
||||
SIOCGIFCONF = 0xc0086924
|
||||
SIOCGIFDATA = 0xc020691b
|
||||
|
@ -1168,41 +1333,53 @@ const (
|
|||
SIOCGIFFLAGS = 0xc0206911
|
||||
SIOCGIFGATTR = 0xc024698b
|
||||
SIOCGIFGENERIC = 0xc020693a
|
||||
SIOCGIFGLIST = 0xc024698d
|
||||
SIOCGIFGMEMB = 0xc024698a
|
||||
SIOCGIFGROUP = 0xc0246988
|
||||
SIOCGIFHARDMTU = 0xc02069a5
|
||||
SIOCGIFMEDIA = 0xc0286936
|
||||
SIOCGIFLLPRIO = 0xc02069b6
|
||||
SIOCGIFMEDIA = 0xc0386938
|
||||
SIOCGIFMETRIC = 0xc0206917
|
||||
SIOCGIFMTU = 0xc020697e
|
||||
SIOCGIFNETMASK = 0xc0206925
|
||||
SIOCGIFPDSTADDR = 0xc0206948
|
||||
SIOCGIFPAIR = 0xc02069b1
|
||||
SIOCGIFPARENT = 0xc02069b3
|
||||
SIOCGIFPRIORITY = 0xc020699c
|
||||
SIOCGIFPSRCADDR = 0xc0206947
|
||||
SIOCGIFRDOMAIN = 0xc02069a0
|
||||
SIOCGIFRTLABEL = 0xc0206983
|
||||
SIOCGIFRXR = 0x802069aa
|
||||
SIOCGIFTIMESLOT = 0xc0206986
|
||||
SIOCGIFSFFPAGE = 0xc1126939
|
||||
SIOCGIFXFLAGS = 0xc020699e
|
||||
SIOCGLIFADDR = 0xc218691d
|
||||
SIOCGLIFPHYADDR = 0xc218694b
|
||||
SIOCGLIFPHYDF = 0xc02069c2
|
||||
SIOCGLIFPHYECN = 0xc02069c8
|
||||
SIOCGLIFPHYRTABLE = 0xc02069a2
|
||||
SIOCGLIFPHYTTL = 0xc02069a9
|
||||
SIOCGLOWAT = 0x40047303
|
||||
SIOCGPGRP = 0x40047309
|
||||
SIOCGPWE3 = 0xc0206998
|
||||
SIOCGPWE3CTRLWORD = 0xc02069dc
|
||||
SIOCGPWE3FAT = 0xc02069dd
|
||||
SIOCGPWE3NEIGHBOR = 0xc21869de
|
||||
SIOCGRXHPRIO = 0xc02069db
|
||||
SIOCGSPPPPARAMS = 0xc0206994
|
||||
SIOCGTXHPRIO = 0xc02069c6
|
||||
SIOCGUMBINFO = 0xc02069be
|
||||
SIOCGUMBPARAM = 0xc02069c0
|
||||
SIOCGVH = 0xc02069f6
|
||||
SIOCGVNETFLOWID = 0xc02069c4
|
||||
SIOCGVNETID = 0xc02069a7
|
||||
SIOCIFAFATTACH = 0x801169ab
|
||||
SIOCIFAFDETACH = 0x801169ac
|
||||
SIOCIFCREATE = 0x8020697a
|
||||
SIOCIFDESTROY = 0x80206979
|
||||
SIOCIFGCLONERS = 0xc00c6978
|
||||
SIOCSETKALIVE = 0x801869a3
|
||||
SIOCSETLABEL = 0x80206999
|
||||
SIOCSETMPWCFG = 0x802069ad
|
||||
SIOCSETPFLOW = 0x802069fd
|
||||
SIOCSETPFSYNC = 0x802069f7
|
||||
SIOCSETVLAN = 0x8020698f
|
||||
SIOCSHIWAT = 0x80047300
|
||||
SIOCSIFADDR = 0x8020690c
|
||||
SIOCSIFASYNCMAP = 0x8020697d
|
||||
SIOCSIFBRDADDR = 0x80206913
|
||||
SIOCSIFDESCR = 0x80206980
|
||||
SIOCSIFDSTADDR = 0x8020690e
|
||||
|
@ -1210,26 +1387,36 @@ const (
|
|||
SIOCSIFGATTR = 0x8024698c
|
||||
SIOCSIFGENERIC = 0x80206939
|
||||
SIOCSIFLLADDR = 0x8020691f
|
||||
SIOCSIFMEDIA = 0xc0206935
|
||||
SIOCSIFLLPRIO = 0x802069b5
|
||||
SIOCSIFMEDIA = 0xc0206937
|
||||
SIOCSIFMETRIC = 0x80206918
|
||||
SIOCSIFMTU = 0x8020697f
|
||||
SIOCSIFNETMASK = 0x80206916
|
||||
SIOCSIFPHYADDR = 0x80406946
|
||||
SIOCSIFPAIR = 0x802069b0
|
||||
SIOCSIFPARENT = 0x802069b2
|
||||
SIOCSIFPRIORITY = 0x8020699b
|
||||
SIOCSIFRDOMAIN = 0x8020699f
|
||||
SIOCSIFRTLABEL = 0x80206982
|
||||
SIOCSIFTIMESLOT = 0x80206985
|
||||
SIOCSIFXFLAGS = 0x8020699d
|
||||
SIOCSLIFPHYADDR = 0x8218694a
|
||||
SIOCSLIFPHYDF = 0x802069c1
|
||||
SIOCSLIFPHYECN = 0x802069c7
|
||||
SIOCSLIFPHYRTABLE = 0x802069a1
|
||||
SIOCSLIFPHYTTL = 0x802069a8
|
||||
SIOCSLOWAT = 0x80047302
|
||||
SIOCSPGRP = 0x80047308
|
||||
SIOCSPWE3CTRLWORD = 0x802069dc
|
||||
SIOCSPWE3FAT = 0x802069dd
|
||||
SIOCSPWE3NEIGHBOR = 0x821869de
|
||||
SIOCSRXHPRIO = 0x802069db
|
||||
SIOCSSPPPPARAMS = 0x80206993
|
||||
SIOCSTXHPRIO = 0x802069c5
|
||||
SIOCSUMBPARAM = 0x802069bf
|
||||
SIOCSVH = 0xc02069f5
|
||||
SIOCSVNETFLOWID = 0x802069c3
|
||||
SIOCSVNETID = 0x802069a6
|
||||
SOCK_CLOEXEC = 0x8000
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_DNS = 0x1000
|
||||
SOCK_NONBLOCK = 0x4000
|
||||
SOCK_RAW = 0x3
|
||||
SOCK_RDM = 0x4
|
||||
|
@ -1241,6 +1428,7 @@ const (
|
|||
SO_BINDANY = 0x1000
|
||||
SO_BROADCAST = 0x20
|
||||
SO_DEBUG = 0x1
|
||||
SO_DOMAIN = 0x1024
|
||||
SO_DONTROUTE = 0x10
|
||||
SO_ERROR = 0x1007
|
||||
SO_KEEPALIVE = 0x8
|
||||
|
@ -1248,6 +1436,7 @@ const (
|
|||
SO_NETPROC = 0x1020
|
||||
SO_OOBINLINE = 0x100
|
||||
SO_PEERCRED = 0x1022
|
||||
SO_PROTOCOL = 0x1025
|
||||
SO_RCVBUF = 0x1002
|
||||
SO_RCVLOWAT = 0x1004
|
||||
SO_RCVTIMEO = 0x1006
|
||||
|
@ -1261,6 +1450,7 @@ const (
|
|||
SO_TIMESTAMP = 0x800
|
||||
SO_TYPE = 0x1008
|
||||
SO_USELOOPBACK = 0x40
|
||||
SO_ZEROIZE = 0x2000
|
||||
S_BLKSIZE = 0x200
|
||||
S_IEXEC = 0x40
|
||||
S_IFBLK = 0x6000
|
||||
|
@ -1290,9 +1480,24 @@ const (
|
|||
S_IXOTH = 0x1
|
||||
S_IXUSR = 0x40
|
||||
TCIFLUSH = 0x1
|
||||
TCIOFF = 0x3
|
||||
TCIOFLUSH = 0x3
|
||||
TCION = 0x4
|
||||
TCOFLUSH = 0x2
|
||||
TCP_MAXBURST = 0x4
|
||||
TCOOFF = 0x1
|
||||
TCOON = 0x2
|
||||
TCPOPT_EOL = 0x0
|
||||
TCPOPT_MAXSEG = 0x2
|
||||
TCPOPT_NOP = 0x1
|
||||
TCPOPT_SACK = 0x5
|
||||
TCPOPT_SACK_HDR = 0x1010500
|
||||
TCPOPT_SACK_PERMITTED = 0x4
|
||||
TCPOPT_SACK_PERMIT_HDR = 0x1010402
|
||||
TCPOPT_SIGNATURE = 0x13
|
||||
TCPOPT_TIMESTAMP = 0x8
|
||||
TCPOPT_TSTAMP_HDR = 0x101080a
|
||||
TCPOPT_WINDOW = 0x3
|
||||
TCP_INFO = 0x9
|
||||
TCP_MAXSEG = 0x2
|
||||
TCP_MAXWIN = 0xffff
|
||||
TCP_MAX_SACK = 0x3
|
||||
|
@ -1301,11 +1506,15 @@ const (
|
|||
TCP_MSS = 0x200
|
||||
TCP_NODELAY = 0x1
|
||||
TCP_NOPUSH = 0x10
|
||||
TCP_NSTATES = 0xb
|
||||
TCP_SACKHOLE_LIMIT = 0x80
|
||||
TCP_SACK_ENABLE = 0x8
|
||||
TCSAFLUSH = 0x2
|
||||
TIMER_ABSTIME = 0x1
|
||||
TIMER_RELTIME = 0x0
|
||||
TIOCCBRK = 0x2000747a
|
||||
TIOCCDTR = 0x20007478
|
||||
TIOCCHKVERAUTH = 0x2000741e
|
||||
TIOCCLRVERAUTH = 0x2000741d
|
||||
TIOCCONS = 0x80047462
|
||||
TIOCDRAIN = 0x2000745e
|
||||
TIOCEXCL = 0x2000740d
|
||||
|
@ -1321,7 +1530,7 @@ const (
|
|||
TIOCGFLAGS = 0x4004745d
|
||||
TIOCGPGRP = 0x40047477
|
||||
TIOCGSID = 0x40047463
|
||||
TIOCGTSTAMP = 0x400c745b
|
||||
TIOCGTSTAMP = 0x4010745b
|
||||
TIOCGWINSZ = 0x40087468
|
||||
TIOCMBIC = 0x8004746b
|
||||
TIOCMBIS = 0x8004746c
|
||||
|
@ -1360,17 +1569,21 @@ const (
|
|||
TIOCSETAF = 0x802c7416
|
||||
TIOCSETAW = 0x802c7415
|
||||
TIOCSETD = 0x8004741b
|
||||
TIOCSETVERAUTH = 0x8004741c
|
||||
TIOCSFLAGS = 0x8004745c
|
||||
TIOCSIG = 0x8004745f
|
||||
TIOCSPGRP = 0x80047476
|
||||
TIOCSTART = 0x2000746e
|
||||
TIOCSTAT = 0x80047465
|
||||
TIOCSTI = 0x80017472
|
||||
TIOCSTAT = 0x20007465
|
||||
TIOCSTOP = 0x2000746f
|
||||
TIOCSTSTAMP = 0x8008745a
|
||||
TIOCSWINSZ = 0x80087467
|
||||
TIOCUCNTL = 0x80047466
|
||||
TIOCUCNTL_CBRK = 0x7a
|
||||
TIOCUCNTL_SBRK = 0x7b
|
||||
TOSTOP = 0x400000
|
||||
UTIME_NOW = -0x2
|
||||
UTIME_OMIT = -0x1
|
||||
VDISCARD = 0xf
|
||||
VDSUSP = 0xb
|
||||
VEOF = 0x0
|
||||
|
@ -1381,6 +1594,19 @@ const (
|
|||
VKILL = 0x5
|
||||
VLNEXT = 0xe
|
||||
VMIN = 0x10
|
||||
VM_ANONMIN = 0x7
|
||||
VM_LOADAVG = 0x2
|
||||
VM_MALLOC_CONF = 0xc
|
||||
VM_MAXID = 0xd
|
||||
VM_MAXSLP = 0xa
|
||||
VM_METER = 0x1
|
||||
VM_NKMEMPAGES = 0x6
|
||||
VM_PSSTRINGS = 0x3
|
||||
VM_SWAPENCRYPT = 0x5
|
||||
VM_USPACE = 0xb
|
||||
VM_UVMEXP = 0x4
|
||||
VM_VNODEMIN = 0x9
|
||||
VM_VTEXTMIN = 0x8
|
||||
VQUIT = 0x9
|
||||
VREPRINT = 0x6
|
||||
VSTART = 0xc
|
||||
|
@ -1394,6 +1620,7 @@ const (
|
|||
WCOREFLAG = 0x80
|
||||
WNOHANG = 0x1
|
||||
WUNTRACED = 0x2
|
||||
XCASE = 0x1000000
|
||||
)
|
||||
|
||||
// Errors
|
||||
|
@ -1407,6 +1634,7 @@ const (
|
|||
EALREADY = syscall.Errno(0x25)
|
||||
EAUTH = syscall.Errno(0x50)
|
||||
EBADF = syscall.Errno(0x9)
|
||||
EBADMSG = syscall.Errno(0x5c)
|
||||
EBADRPC = syscall.Errno(0x48)
|
||||
EBUSY = syscall.Errno(0x10)
|
||||
ECANCELED = syscall.Errno(0x58)
|
||||
|
@ -1433,7 +1661,7 @@ const (
|
|||
EIPSEC = syscall.Errno(0x52)
|
||||
EISCONN = syscall.Errno(0x38)
|
||||
EISDIR = syscall.Errno(0x15)
|
||||
ELAST = syscall.Errno(0x5b)
|
||||
ELAST = syscall.Errno(0x5f)
|
||||
ELOOP = syscall.Errno(0x3e)
|
||||
EMEDIUMTYPE = syscall.Errno(0x56)
|
||||
EMFILE = syscall.Errno(0x18)
|
||||
|
@ -1461,12 +1689,14 @@ const (
|
|||
ENOTCONN = syscall.Errno(0x39)
|
||||
ENOTDIR = syscall.Errno(0x14)
|
||||
ENOTEMPTY = syscall.Errno(0x42)
|
||||
ENOTRECOVERABLE = syscall.Errno(0x5d)
|
||||
ENOTSOCK = syscall.Errno(0x26)
|
||||
ENOTSUP = syscall.Errno(0x5b)
|
||||
ENOTTY = syscall.Errno(0x19)
|
||||
ENXIO = syscall.Errno(0x6)
|
||||
EOPNOTSUPP = syscall.Errno(0x2d)
|
||||
EOVERFLOW = syscall.Errno(0x57)
|
||||
EOWNERDEAD = syscall.Errno(0x5e)
|
||||
EPERM = syscall.Errno(0x1)
|
||||
EPFNOSUPPORT = syscall.Errno(0x2e)
|
||||
EPIPE = syscall.Errno(0x20)
|
||||
|
@ -1474,6 +1704,7 @@ const (
|
|||
EPROCUNAVAIL = syscall.Errno(0x4c)
|
||||
EPROGMISMATCH = syscall.Errno(0x4b)
|
||||
EPROGUNAVAIL = syscall.Errno(0x4a)
|
||||
EPROTO = syscall.Errno(0x5f)
|
||||
EPROTONOSUPPORT = syscall.Errno(0x2b)
|
||||
EPROTOTYPE = syscall.Errno(0x29)
|
||||
ERANGE = syscall.Errno(0x22)
|
||||
|
@ -1570,7 +1801,7 @@ var errorList = [...]struct {
|
|||
{32, "EPIPE", "broken pipe"},
|
||||
{33, "EDOM", "numerical argument out of domain"},
|
||||
{34, "ERANGE", "result too large"},
|
||||
{35, "EWOULDBLOCK", "resource temporarily unavailable"},
|
||||
{35, "EAGAIN", "resource temporarily unavailable"},
|
||||
{36, "EINPROGRESS", "operation now in progress"},
|
||||
{37, "EALREADY", "operation already in progress"},
|
||||
{38, "ENOTSOCK", "socket operation on non-socket"},
|
||||
|
@ -1626,7 +1857,11 @@ var errorList = [...]struct {
|
|||
{88, "ECANCELED", "operation canceled"},
|
||||
{89, "EIDRM", "identifier removed"},
|
||||
{90, "ENOMSG", "no message of desired type"},
|
||||
{91, "ELAST", "not supported"},
|
||||
{91, "ENOTSUP", "not supported"},
|
||||
{92, "EBADMSG", "bad message"},
|
||||
{93, "ENOTRECOVERABLE", "state not recoverable"},
|
||||
{94, "EOWNERDEAD", "previous owner died"},
|
||||
{95, "ELAST", "protocol error"},
|
||||
}
|
||||
|
||||
// Signal table
|
||||
|
@ -1640,7 +1875,7 @@ var signalList = [...]struct {
|
|||
{3, "SIGQUIT", "quit"},
|
||||
{4, "SIGILL", "illegal instruction"},
|
||||
{5, "SIGTRAP", "trace/BPT trap"},
|
||||
{6, "SIGABRT", "abort trap"},
|
||||
{6, "SIGIOT", "abort trap"},
|
||||
{7, "SIGEMT", "EMT trap"},
|
||||
{8, "SIGFPE", "floating point exception"},
|
||||
{9, "SIGKILL", "killed"},
|
||||
|
@ -1667,4 +1902,5 @@ var signalList = [...]struct {
|
|||
{30, "SIGUSR1", "user defined signal 1"},
|
||||
{31, "SIGUSR2", "user defined signal 2"},
|
||||
{32, "SIGTHR", "thread AST"},
|
||||
{28672, "SIGSTKSZ", "unknown signal"},
|
||||
}
|
||||
|
|
|
@ -112,6 +112,12 @@ const (
|
|||
BPF_FILDROP_CAPTURE = 0x1
|
||||
BPF_FILDROP_DROP = 0x2
|
||||
BPF_FILDROP_PASS = 0x0
|
||||
BPF_F_DIR_IN = 0x10
|
||||
BPF_F_DIR_MASK = 0x30
|
||||
BPF_F_DIR_OUT = 0x20
|
||||
BPF_F_DIR_SHIFT = 0x4
|
||||
BPF_F_FLOWID = 0x8
|
||||
BPF_F_PRI_MASK = 0x7
|
||||
BPF_H = 0x8
|
||||
BPF_IMM = 0x0
|
||||
BPF_IND = 0x40
|
||||
|
@ -140,6 +146,7 @@ const (
|
|||
BPF_OR = 0x40
|
||||
BPF_RELEASE = 0x30bb6
|
||||
BPF_RET = 0x6
|
||||
BPF_RND = 0xc0
|
||||
BPF_RSH = 0x70
|
||||
BPF_ST = 0x2
|
||||
BPF_STX = 0x3
|
||||
|
@ -180,7 +187,65 @@ const (
|
|||
CTL_KERN = 0x1
|
||||
CTL_MAXNAME = 0xc
|
||||
CTL_NET = 0x4
|
||||
DIOCADDQUEUE = 0xc110445d
|
||||
DIOCADDRULE = 0xcd604404
|
||||
DIOCADDSTATE = 0xc1084425
|
||||
DIOCCHANGERULE = 0xcd60441a
|
||||
DIOCCLRIFFLAG = 0xc028445a
|
||||
DIOCCLRSRCNODES = 0x20004455
|
||||
DIOCCLRSTATES = 0xc0e04412
|
||||
DIOCCLRSTATUS = 0xc0284416
|
||||
DIOCGETLIMIT = 0xc0084427
|
||||
DIOCGETQSTATS = 0xc1204460
|
||||
DIOCGETQUEUE = 0xc110445f
|
||||
DIOCGETQUEUES = 0xc110445e
|
||||
DIOCGETRULE = 0xcd604407
|
||||
DIOCGETRULES = 0xcd604406
|
||||
DIOCGETRULESET = 0xc444443b
|
||||
DIOCGETRULESETS = 0xc444443a
|
||||
DIOCGETSRCNODES = 0xc0104454
|
||||
DIOCGETSTATE = 0xc1084413
|
||||
DIOCGETSTATES = 0xc0104419
|
||||
DIOCGETSTATUS = 0xc1e84415
|
||||
DIOCGETSYNFLWATS = 0xc0084463
|
||||
DIOCGETTIMEOUT = 0xc008441e
|
||||
DIOCIGETIFACES = 0xc0284457
|
||||
DIOCKILLSRCNODES = 0xc080445b
|
||||
DIOCKILLSTATES = 0xc0e04429
|
||||
DIOCNATLOOK = 0xc0504417
|
||||
DIOCOSFPADD = 0xc088444f
|
||||
DIOCOSFPFLUSH = 0x2000444e
|
||||
DIOCOSFPGET = 0xc0884450
|
||||
DIOCRADDADDRS = 0xc4504443
|
||||
DIOCRADDTABLES = 0xc450443d
|
||||
DIOCRCLRADDRS = 0xc4504442
|
||||
DIOCRCLRASTATS = 0xc4504448
|
||||
DIOCRCLRTABLES = 0xc450443c
|
||||
DIOCRCLRTSTATS = 0xc4504441
|
||||
DIOCRDELADDRS = 0xc4504444
|
||||
DIOCRDELTABLES = 0xc450443e
|
||||
DIOCRGETADDRS = 0xc4504446
|
||||
DIOCRGETASTATS = 0xc4504447
|
||||
DIOCRGETTABLES = 0xc450443f
|
||||
DIOCRGETTSTATS = 0xc4504440
|
||||
DIOCRINADEFINE = 0xc450444d
|
||||
DIOCRSETADDRS = 0xc4504445
|
||||
DIOCRSETTFLAGS = 0xc450444a
|
||||
DIOCRTSTADDRS = 0xc4504449
|
||||
DIOCSETDEBUG = 0xc0044418
|
||||
DIOCSETHOSTID = 0xc0044456
|
||||
DIOCSETIFFLAG = 0xc0284459
|
||||
DIOCSETLIMIT = 0xc0084428
|
||||
DIOCSETREASS = 0xc004445c
|
||||
DIOCSETSTATUSIF = 0xc0284414
|
||||
DIOCSETSYNCOOKIES = 0xc0014462
|
||||
DIOCSETSYNFLWATS = 0xc0084461
|
||||
DIOCSETTIMEOUT = 0xc008441d
|
||||
DIOCSTART = 0x20004401
|
||||
DIOCSTOP = 0x20004402
|
||||
DIOCXBEGIN = 0xc0104451
|
||||
DIOCXCOMMIT = 0xc0104452
|
||||
DIOCXROLLBACK = 0xc0104453
|
||||
DLT_ARCNET = 0x7
|
||||
DLT_ATM_RFC1483 = 0xb
|
||||
DLT_AX25 = 0x3
|
||||
|
@ -243,6 +308,8 @@ const (
|
|||
EMUL_ENABLED = 0x1
|
||||
EMUL_NATIVE = 0x2
|
||||
ENDRUNDISC = 0x9
|
||||
ETH64_8021_RSVD_MASK = 0xfffffffffff0
|
||||
ETH64_8021_RSVD_PREFIX = 0x180c2000000
|
||||
ETHERMIN = 0x2e
|
||||
ETHERMTU = 0x5dc
|
||||
ETHERTYPE_8023 = 0x4
|
||||
|
@ -295,6 +362,7 @@ const (
|
|||
ETHERTYPE_DN = 0x6003
|
||||
ETHERTYPE_DOGFIGHT = 0x1989
|
||||
ETHERTYPE_DSMD = 0x8039
|
||||
ETHERTYPE_EAPOL = 0x888e
|
||||
ETHERTYPE_ECMA = 0x803
|
||||
ETHERTYPE_ENCRYPT = 0x803d
|
||||
ETHERTYPE_ES = 0x805d
|
||||
|
@ -326,6 +394,7 @@ const (
|
|||
ETHERTYPE_LLDP = 0x88cc
|
||||
ETHERTYPE_LOGICRAFT = 0x8148
|
||||
ETHERTYPE_LOOPBACK = 0x9000
|
||||
ETHERTYPE_MACSEC = 0x88e5
|
||||
ETHERTYPE_MATRA = 0x807a
|
||||
ETHERTYPE_MAX = 0xffff
|
||||
ETHERTYPE_MERIT = 0x807c
|
||||
|
@ -354,15 +423,16 @@ const (
|
|||
ETHERTYPE_NCD = 0x8149
|
||||
ETHERTYPE_NESTAR = 0x8006
|
||||
ETHERTYPE_NETBEUI = 0x8191
|
||||
ETHERTYPE_NHRP = 0x2001
|
||||
ETHERTYPE_NOVELL = 0x8138
|
||||
ETHERTYPE_NS = 0x600
|
||||
ETHERTYPE_NSAT = 0x601
|
||||
ETHERTYPE_NSCOMPAT = 0x807
|
||||
ETHERTYPE_NSH = 0x984f
|
||||
ETHERTYPE_NTRAILER = 0x10
|
||||
ETHERTYPE_OS9 = 0x7007
|
||||
ETHERTYPE_OS9NET = 0x7009
|
||||
ETHERTYPE_PACER = 0x80c6
|
||||
ETHERTYPE_PAE = 0x888e
|
||||
ETHERTYPE_PBB = 0x88e7
|
||||
ETHERTYPE_PCS = 0x4242
|
||||
ETHERTYPE_PLANNING = 0x8044
|
||||
|
@ -445,10 +515,11 @@ const (
|
|||
ETHER_VLAN_ENCAP_LEN = 0x4
|
||||
EVFILT_AIO = -0x3
|
||||
EVFILT_DEVICE = -0x8
|
||||
EVFILT_EXCEPT = -0x9
|
||||
EVFILT_PROC = -0x5
|
||||
EVFILT_READ = -0x1
|
||||
EVFILT_SIGNAL = -0x6
|
||||
EVFILT_SYSCOUNT = 0x8
|
||||
EVFILT_SYSCOUNT = 0x9
|
||||
EVFILT_TIMER = -0x7
|
||||
EVFILT_VNODE = -0x4
|
||||
EVFILT_WRITE = -0x2
|
||||
|
@ -470,7 +541,7 @@ const (
|
|||
EV_FLAG1 = 0x2000
|
||||
EV_ONESHOT = 0x10
|
||||
EV_RECEIPT = 0x40
|
||||
EV_SYSFLAGS = 0xf000
|
||||
EV_SYSFLAGS = 0xf800
|
||||
EXTA = 0x4b00
|
||||
EXTB = 0x9600
|
||||
EXTPROC = 0x800
|
||||
|
@ -736,6 +807,7 @@ const (
|
|||
IFT_VOICEOVERCABLE = 0xc6
|
||||
IFT_VOICEOVERFRAMERELAY = 0x99
|
||||
IFT_VOICEOVERIP = 0x68
|
||||
IFT_WIREGUARD = 0xfb
|
||||
IFT_X213 = 0x5d
|
||||
IFT_X25 = 0x5
|
||||
IFT_X25DDN = 0x4
|
||||
|
@ -801,9 +873,11 @@ const (
|
|||
IPPROTO_RAW = 0xff
|
||||
IPPROTO_ROUTING = 0x2b
|
||||
IPPROTO_RSVP = 0x2e
|
||||
IPPROTO_SCTP = 0x84
|
||||
IPPROTO_TCP = 0x6
|
||||
IPPROTO_TP = 0x1d
|
||||
IPPROTO_UDP = 0x11
|
||||
IPPROTO_UDPLITE = 0x88
|
||||
IPV6_AUTH_LEVEL = 0x35
|
||||
IPV6_AUTOFLOWLABEL = 0x3b
|
||||
IPV6_CHECKSUM = 0x1a
|
||||
|
@ -910,6 +984,9 @@ const (
|
|||
IP_TTL = 0x4
|
||||
ISIG = 0x80
|
||||
ISTRIP = 0x20
|
||||
ITIMER_PROF = 0x2
|
||||
ITIMER_REAL = 0x0
|
||||
ITIMER_VIRTUAL = 0x1
|
||||
IUCLC = 0x1000
|
||||
IXANY = 0x800
|
||||
IXOFF = 0x400
|
||||
|
@ -981,6 +1058,19 @@ const (
|
|||
MNT_WAIT = 0x1
|
||||
MNT_WANTRDWR = 0x2000000
|
||||
MNT_WXALLOWED = 0x800
|
||||
MOUNT_AFS = "afs"
|
||||
MOUNT_CD9660 = "cd9660"
|
||||
MOUNT_EXT2FS = "ext2fs"
|
||||
MOUNT_FFS = "ffs"
|
||||
MOUNT_FUSEFS = "fuse"
|
||||
MOUNT_MFS = "mfs"
|
||||
MOUNT_MSDOS = "msdos"
|
||||
MOUNT_NCPFS = "ncpfs"
|
||||
MOUNT_NFS = "nfs"
|
||||
MOUNT_NTFS = "ntfs"
|
||||
MOUNT_TMPFS = "tmpfs"
|
||||
MOUNT_UDF = "udf"
|
||||
MOUNT_UFS = "ffs"
|
||||
MSG_BCAST = 0x100
|
||||
MSG_CMSG_CLOEXEC = 0x800
|
||||
MSG_CTRUNC = 0x20
|
||||
|
@ -993,6 +1083,7 @@ const (
|
|||
MSG_PEEK = 0x2
|
||||
MSG_TRUNC = 0x10
|
||||
MSG_WAITALL = 0x40
|
||||
MSG_WAITFORONE = 0x1000
|
||||
MS_ASYNC = 0x1
|
||||
MS_INVALIDATE = 0x4
|
||||
MS_SYNC = 0x2
|
||||
|
@ -1001,7 +1092,8 @@ const (
|
|||
NET_RT_FLAGS = 0x2
|
||||
NET_RT_IFLIST = 0x3
|
||||
NET_RT_IFNAMES = 0x6
|
||||
NET_RT_MAXID = 0x7
|
||||
NET_RT_MAXID = 0x8
|
||||
NET_RT_SOURCE = 0x7
|
||||
NET_RT_STATS = 0x4
|
||||
NET_RT_TABLE = 0x5
|
||||
NFDBITS = 0x20
|
||||
|
@ -1018,6 +1110,7 @@ const (
|
|||
NOTE_FORK = 0x40000000
|
||||
NOTE_LINK = 0x10
|
||||
NOTE_LOWAT = 0x1
|
||||
NOTE_OOB = 0x4
|
||||
NOTE_PCTRLMASK = 0xf0000000
|
||||
NOTE_PDATAMASK = 0xfffff
|
||||
NOTE_RENAME = 0x20
|
||||
|
@ -1154,7 +1247,7 @@ const (
|
|||
RTM_PROPOSAL = 0x13
|
||||
RTM_REDIRECT = 0x6
|
||||
RTM_RESOLVE = 0xb
|
||||
RTM_RTTUNIT = 0xf4240
|
||||
RTM_SOURCE = 0x16
|
||||
RTM_VERSION = 0x5
|
||||
RTV_EXPIRE = 0x4
|
||||
RTV_HOPCOUNT = 0x2
|
||||
|
@ -1172,6 +1265,9 @@ const (
|
|||
RUSAGE_THREAD = 0x1
|
||||
SCM_RIGHTS = 0x1
|
||||
SCM_TIMESTAMP = 0x4
|
||||
SEEK_CUR = 0x1
|
||||
SEEK_END = 0x2
|
||||
SEEK_SET = 0x0
|
||||
SHUT_RD = 0x0
|
||||
SHUT_RDWR = 0x2
|
||||
SHUT_WR = 0x1
|
||||
|
@ -1188,30 +1284,30 @@ const (
|
|||
SIOCBRDGDELS = 0x80606942
|
||||
SIOCBRDGFLUSH = 0x80606948
|
||||
SIOCBRDGFRL = 0x808c694e
|
||||
SIOCBRDGGCACHE = 0xc0186941
|
||||
SIOCBRDGGFD = 0xc0186952
|
||||
SIOCBRDGGHT = 0xc0186951
|
||||
SIOCBRDGGCACHE = 0xc0146941
|
||||
SIOCBRDGGFD = 0xc0146952
|
||||
SIOCBRDGGHT = 0xc0146951
|
||||
SIOCBRDGGIFFLGS = 0xc060693e
|
||||
SIOCBRDGGMA = 0xc0186953
|
||||
SIOCBRDGGMA = 0xc0146953
|
||||
SIOCBRDGGPARAM = 0xc0406958
|
||||
SIOCBRDGGPRI = 0xc0186950
|
||||
SIOCBRDGGPRI = 0xc0146950
|
||||
SIOCBRDGGRL = 0xc030694f
|
||||
SIOCBRDGGTO = 0xc0186946
|
||||
SIOCBRDGGTO = 0xc0146946
|
||||
SIOCBRDGIFS = 0xc0606942
|
||||
SIOCBRDGRTS = 0xc0206943
|
||||
SIOCBRDGSADDR = 0xc1286944
|
||||
SIOCBRDGSCACHE = 0x80186940
|
||||
SIOCBRDGSFD = 0x80186952
|
||||
SIOCBRDGSHT = 0x80186951
|
||||
SIOCBRDGSCACHE = 0x80146940
|
||||
SIOCBRDGSFD = 0x80146952
|
||||
SIOCBRDGSHT = 0x80146951
|
||||
SIOCBRDGSIFCOST = 0x80606955
|
||||
SIOCBRDGSIFFLGS = 0x8060693f
|
||||
SIOCBRDGSIFPRIO = 0x80606954
|
||||
SIOCBRDGSIFPROT = 0x8060694a
|
||||
SIOCBRDGSMA = 0x80186953
|
||||
SIOCBRDGSPRI = 0x80186950
|
||||
SIOCBRDGSPROTO = 0x8018695a
|
||||
SIOCBRDGSTO = 0x80186945
|
||||
SIOCBRDGSTXHC = 0x80186959
|
||||
SIOCBRDGSMA = 0x80146953
|
||||
SIOCBRDGSPRI = 0x80146950
|
||||
SIOCBRDGSPROTO = 0x8014695a
|
||||
SIOCBRDGSTO = 0x80146945
|
||||
SIOCBRDGSTXHC = 0x80146959
|
||||
SIOCDELLABEL = 0x80206997
|
||||
SIOCDELMULTI = 0x80206932
|
||||
SIOCDIFADDR = 0x80206919
|
||||
|
@ -1264,6 +1360,7 @@ const (
|
|||
SIOCGPWE3CTRLWORD = 0xc02069dc
|
||||
SIOCGPWE3FAT = 0xc02069dd
|
||||
SIOCGPWE3NEIGHBOR = 0xc21869de
|
||||
SIOCGRXHPRIO = 0xc02069db
|
||||
SIOCGSPPPPARAMS = 0xc0206994
|
||||
SIOCGTXHPRIO = 0xc02069c6
|
||||
SIOCGUMBINFO = 0xc02069be
|
||||
|
@ -1310,17 +1407,13 @@ const (
|
|||
SIOCSPWE3CTRLWORD = 0x802069dc
|
||||
SIOCSPWE3FAT = 0x802069dd
|
||||
SIOCSPWE3NEIGHBOR = 0x821869de
|
||||
SIOCSRXHPRIO = 0x802069db
|
||||
SIOCSSPPPPARAMS = 0x80206993
|
||||
SIOCSTXHPRIO = 0x802069c5
|
||||
SIOCSUMBPARAM = 0x802069bf
|
||||
SIOCSVH = 0xc02069f5
|
||||
SIOCSVNETFLOWID = 0x802069c3
|
||||
SIOCSVNETID = 0x802069a6
|
||||
SIOCSWGDPID = 0xc018695b
|
||||
SIOCSWGMAXFLOW = 0xc0186960
|
||||
SIOCSWGMAXGROUP = 0xc018695d
|
||||
SIOCSWSDPID = 0x8018695c
|
||||
SIOCSWSPORTNO = 0xc060695f
|
||||
SOCK_CLOEXEC = 0x8000
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_DNS = 0x1000
|
||||
|
@ -1335,6 +1428,7 @@ const (
|
|||
SO_BINDANY = 0x1000
|
||||
SO_BROADCAST = 0x20
|
||||
SO_DEBUG = 0x1
|
||||
SO_DOMAIN = 0x1024
|
||||
SO_DONTROUTE = 0x10
|
||||
SO_ERROR = 0x1007
|
||||
SO_KEEPALIVE = 0x8
|
||||
|
@ -1342,6 +1436,7 @@ const (
|
|||
SO_NETPROC = 0x1020
|
||||
SO_OOBINLINE = 0x100
|
||||
SO_PEERCRED = 0x1022
|
||||
SO_PROTOCOL = 0x1025
|
||||
SO_RCVBUF = 0x1002
|
||||
SO_RCVLOWAT = 0x1004
|
||||
SO_RCVTIMEO = 0x1006
|
||||
|
@ -1391,7 +1486,18 @@ const (
|
|||
TCOFLUSH = 0x2
|
||||
TCOOFF = 0x1
|
||||
TCOON = 0x2
|
||||
TCP_MAXBURST = 0x4
|
||||
TCPOPT_EOL = 0x0
|
||||
TCPOPT_MAXSEG = 0x2
|
||||
TCPOPT_NOP = 0x1
|
||||
TCPOPT_SACK = 0x5
|
||||
TCPOPT_SACK_HDR = 0x1010500
|
||||
TCPOPT_SACK_PERMITTED = 0x4
|
||||
TCPOPT_SACK_PERMIT_HDR = 0x1010402
|
||||
TCPOPT_SIGNATURE = 0x13
|
||||
TCPOPT_TIMESTAMP = 0x8
|
||||
TCPOPT_TSTAMP_HDR = 0x101080a
|
||||
TCPOPT_WINDOW = 0x3
|
||||
TCP_INFO = 0x9
|
||||
TCP_MAXSEG = 0x2
|
||||
TCP_MAXWIN = 0xffff
|
||||
TCP_MAX_SACK = 0x3
|
||||
|
@ -1400,6 +1506,7 @@ const (
|
|||
TCP_MSS = 0x200
|
||||
TCP_NODELAY = 0x1
|
||||
TCP_NOPUSH = 0x10
|
||||
TCP_SACKHOLE_LIMIT = 0x80
|
||||
TCP_SACK_ENABLE = 0x8
|
||||
TCSAFLUSH = 0x2
|
||||
TIMER_ABSTIME = 0x1
|
||||
|
@ -1768,7 +1875,7 @@ var signalList = [...]struct {
|
|||
{3, "SIGQUIT", "quit"},
|
||||
{4, "SIGILL", "illegal instruction"},
|
||||
{5, "SIGTRAP", "trace/BPT trap"},
|
||||
{6, "SIGABRT", "abort trap"},
|
||||
{6, "SIGIOT", "abort trap"},
|
||||
{7, "SIGEMT", "EMT trap"},
|
||||
{8, "SIGFPE", "floating point exception"},
|
||||
{9, "SIGKILL", "killed"},
|
||||
|
@ -1795,4 +1902,5 @@ var signalList = [...]struct {
|
|||
{30, "SIGUSR1", "user defined signal 1"},
|
||||
{31, "SIGUSR2", "user defined signal 2"},
|
||||
{32, "SIGTHR", "thread AST"},
|
||||
{28672, "SIGSTKSZ", "unknown signal"},
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue