add tcp-pinger for measuring rtt of mailservers
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
92d6b1c439
commit
4c313c7032
2
Makefile
2
Makefile
|
@ -267,7 +267,7 @@ canary-test: node-canary
|
|||
|
||||
lint-install:
|
||||
@# The following installs a specific version of golangci-lint, which is appropriate for a CI server to avoid different results from build to build
|
||||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | BINARY=$(GOLANGCI_BINARY) bash -s -- -d -b $(GOPATH)/bin v1.18.0
|
||||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | BINARY=$(GOLANGCI_BINARY) bash -s -- -d -b $(GOPATH)/bin v1.21.0
|
||||
|
||||
lint:
|
||||
@echo "lint"
|
||||
|
|
2
go.mod
2
go.mod
|
@ -27,11 +27,13 @@ require (
|
|||
github.com/mutecomm/go-sqlcipher v0.0.0-20190227152316-55dbde17881f
|
||||
github.com/okzk/sdnotify v0.0.0-20180710141335-d9becc38acbd
|
||||
github.com/pborman/uuid v1.2.0
|
||||
github.com/pkg/errors v0.8.1
|
||||
github.com/prometheus/client_golang v1.2.1
|
||||
github.com/russolsen/transit v0.0.0-20180705123435-0794b4c4505a
|
||||
github.com/status-im/migrate/v4 v4.6.2-status.2
|
||||
github.com/status-im/rendezvous v1.3.0
|
||||
github.com/status-im/status-protocol-go v0.5.1
|
||||
github.com/status-im/tcp-shaker v0.0.0-20191114194237-215893130501
|
||||
github.com/status-im/whisper v1.5.2
|
||||
github.com/stretchr/testify v1.4.0
|
||||
github.com/syndtr/goleveldb v1.0.0
|
||||
|
|
22
go.sum
22
go.sum
|
@ -311,14 +311,17 @@ github.com/libp2p/go-eventbus v0.1.0 h1:mlawomSAjjkk97QnYiEmHsLu7E136+2oCWSHRUvM
|
|||
github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4=
|
||||
github.com/libp2p/go-flow-metrics v0.0.1 h1:0gxuFd2GuK7IIP5pKljLwps6TvcuYgvG7Atqi3INF5s=
|
||||
github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZxBdp967ls1g+k8=
|
||||
github.com/libp2p/go-libp2p v0.1.1 h1:52sB0TJuDk2nYMcMfHOKaPoaayDZjaYVCq6Vk1ejUTk=
|
||||
github.com/libp2p/go-libp2p v0.1.1/go.mod h1:I00BRo1UuUSdpuc8Q2mN7yDF/oTUTRAX6JWpTiK9Rp8=
|
||||
github.com/libp2p/go-libp2p v0.4.0 h1:nV2q3fdhL80OWtPyBrsoWKcw32qC4TbbR+iGjEOMRaU=
|
||||
github.com/libp2p/go-libp2p v0.4.0/go.mod h1:9EsEIf9p2UDuwtPd0DwJsAl0qXVxgAnuDGRvHbfATfI=
|
||||
github.com/libp2p/go-libp2p-autonat v0.1.0 h1:aCWAu43Ri4nU0ZPO7NyLzUvvfqd0nE3dX0R/ZGYVgOU=
|
||||
github.com/libp2p/go-libp2p-autonat v0.1.0/go.mod h1:1tLf2yXxiE/oKGtDwPYWTSYG3PtvYlJmg7NeVtPRqH8=
|
||||
github.com/libp2p/go-libp2p-blankhost v0.1.1 h1:X919sCh+KLqJcNRApj43xCSiQRYqOSI88Fdf55ngf78=
|
||||
github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro=
|
||||
github.com/libp2p/go-libp2p-blankhost v0.1.4 h1:I96SWjR4rK9irDHcHq3XHN6hawCRTPUADzkJacgZLvk=
|
||||
github.com/libp2p/go-libp2p-blankhost v0.1.4/go.mod h1:oJF0saYsAXQCSfDq254GMNmLNz6ZTHTOvtF4ZydUvwU=
|
||||
github.com/libp2p/go-libp2p-circuit v0.1.0 h1:eniLL3Y9aq/sryfyV1IAHj5rlvuyj3b7iz8tSiZpdhY=
|
||||
github.com/libp2p/go-libp2p-circuit v0.1.0/go.mod h1:Ahq4cY3V9VJcHcn1SBXjr78AbFkZeIRmfunbA7pmFh8=
|
||||
github.com/libp2p/go-libp2p-circuit v0.1.3 h1:WsMYYaA0PwdpgJSQu12EzPYf5ypkLSTgcOsWr7DYrgI=
|
||||
github.com/libp2p/go-libp2p-circuit v0.1.3/go.mod h1:Xqh2TjSy8DD5iV2cCOMzdynd6h8OTBGoV1AWbWor3qM=
|
||||
|
@ -329,6 +332,7 @@ github.com/libp2p/go-libp2p-core v0.2.0/go.mod h1:X0eyB0Gy93v0DZtSYbEM7RnMChm9Uv
|
|||
github.com/libp2p/go-libp2p-core v0.2.2/go.mod h1:8fcwTbsG2B+lTgRJ1ICZtiM5GWCWZVoVrLaDRvIRng0=
|
||||
github.com/libp2p/go-libp2p-core v0.2.3 h1:zXikZ5pLfebtTMeIYfcwVQ2Pae77O0FIwDquwM6AGNM=
|
||||
github.com/libp2p/go-libp2p-core v0.2.3/go.mod h1:GqhyQqyIAPsxFYXHMjfXgMv03lxsvM0mFzuYA9Ib42A=
|
||||
github.com/libp2p/go-libp2p-crypto v0.1.0 h1:k9MFy+o2zGDNGsaoZl0MA3iZ75qXxr9OOoAZF+sD5OQ=
|
||||
github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI=
|
||||
github.com/libp2p/go-libp2p-discovery v0.1.0 h1:j+R6cokKcGbnZLf4kcNwpx6mDEUPF3N6SrqMymQhmvs=
|
||||
github.com/libp2p/go-libp2p-discovery v0.1.0/go.mod h1:4F/x+aldVHjHDHuX85x1zWoFTGElt8HnoDzwkFZm29g=
|
||||
|
@ -340,18 +344,23 @@ github.com/libp2p/go-libp2p-mplex v0.2.1/go.mod h1:SC99Rxs8Vuzrf/6WhmH41kNn13TiY
|
|||
github.com/libp2p/go-libp2p-nat v0.0.4 h1:+KXK324yaY701On8a0aGjTnw8467kW3ExKcqW2wwmyw=
|
||||
github.com/libp2p/go-libp2p-nat v0.0.4/go.mod h1:N9Js/zVtAXqaeT99cXgTV9e75KpnWCvVOiGzlcHmBbY=
|
||||
github.com/libp2p/go-libp2p-netutil v0.1.0/go.mod h1:3Qv/aDqtMLTUyQeundkKsA+YCThNdbQD54k3TqjpbFU=
|
||||
github.com/libp2p/go-libp2p-peer v0.2.0 h1:EQ8kMjaCUwt/Y5uLgjT8iY2qg0mGUT0N1zUjer50DsY=
|
||||
github.com/libp2p/go-libp2p-peer v0.2.0/go.mod h1:RCffaCvUyW2CJmG2gAWVqwePwW7JMgxjsHm7+J5kjWY=
|
||||
github.com/libp2p/go-libp2p-peerstore v0.1.0 h1:MKh7pRNPHSh1fLPj8u/M/s/napdmeNpoi9BRy9lPN0E=
|
||||
github.com/libp2p/go-libp2p-peerstore v0.1.0/go.mod h1:2CeHkQsr8svp4fZ+Oi9ykN1HBb6u0MOvdJ7YIsmcwtY=
|
||||
github.com/libp2p/go-libp2p-peerstore v0.1.3 h1:wMgajt1uM2tMiqf4M+4qWKVyyFc8SfA+84VV9glZq1M=
|
||||
github.com/libp2p/go-libp2p-peerstore v0.1.3/go.mod h1:BJ9sHlm59/80oSkpWgr1MyY1ciXAXV397W6h1GH/uKI=
|
||||
github.com/libp2p/go-libp2p-secio v0.1.0 h1:NNP5KLxuP97sE5Bu3iuwOWyT/dKEGMN5zSLMWdB7GTQ=
|
||||
github.com/libp2p/go-libp2p-secio v0.1.0/go.mod h1:tMJo2w7h3+wN4pgU2LSYeiKPrfqBgkOsdiKK77hE7c8=
|
||||
github.com/libp2p/go-libp2p-secio v0.2.0 h1:ywzZBsWEEz2KNTn5RtzauEDq5RFEefPsttXYwAWqHng=
|
||||
github.com/libp2p/go-libp2p-secio v0.2.0/go.mod h1:2JdZepB8J5V9mBp79BmwsaPQhRPNN2NrnB2lKQcdy6g=
|
||||
github.com/libp2p/go-libp2p-swarm v0.1.0 h1:HrFk2p0awrGEgch9JXK/qp/hfjqQfgNxpLWnCiWPg5s=
|
||||
github.com/libp2p/go-libp2p-swarm v0.1.0/go.mod h1:wQVsCdjsuZoc730CgOvh5ox6K8evllckjebkdiY5ta4=
|
||||
github.com/libp2p/go-libp2p-swarm v0.2.2 h1:T4hUpgEs2r371PweU3DuH7EOmBIdTBCwWs+FLcgx3bQ=
|
||||
github.com/libp2p/go-libp2p-swarm v0.2.2/go.mod h1:fvmtQ0T1nErXym1/aa1uJEyN7JzaTNyBcHImCxRpPKU=
|
||||
github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E=
|
||||
github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E=
|
||||
github.com/libp2p/go-libp2p-testing v0.0.4 h1:Qev57UR47GcLPXWjrunv5aLIQGO4n9mhI/8/EIrEEFc=
|
||||
github.com/libp2p/go-libp2p-testing v0.0.4/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E=
|
||||
github.com/libp2p/go-libp2p-testing v0.1.0 h1:WaFRj/t3HdMZGNZqnU2pS7pDRBmMeoDx7/HDNpeyT9U=
|
||||
github.com/libp2p/go-libp2p-testing v0.1.0/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0=
|
||||
|
@ -360,12 +369,14 @@ github.com/libp2p/go-libp2p-transport-upgrader v0.1.1/go.mod h1:IEtA6or8JUbsV07q
|
|||
github.com/libp2p/go-libp2p-yamux v0.2.0/go.mod h1:Db2gU+XfLpm6E4rG5uGCFX6uXA8MEXOxFcRoXUODaK8=
|
||||
github.com/libp2p/go-libp2p-yamux v0.2.1 h1:Q3XYNiKCC2vIxrvUJL+Jg1kiyeEaIDNKLjgEjo3VQdI=
|
||||
github.com/libp2p/go-libp2p-yamux v0.2.1/go.mod h1:1FBXiHDk1VyRM1C0aez2bCfHQ4vMZKkAQzZbkSQt5fI=
|
||||
github.com/libp2p/go-maddr-filter v0.0.4 h1:hx8HIuuwk34KePddrp2mM5ivgPkZ09JH4AvsALRbFUs=
|
||||
github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q=
|
||||
github.com/libp2p/go-maddr-filter v0.0.5 h1:CW3AgbMO6vUvT4kf87y4N+0P8KUl2aqLYhrGyDUbLSg=
|
||||
github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M=
|
||||
github.com/libp2p/go-mplex v0.0.3/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0=
|
||||
github.com/libp2p/go-mplex v0.1.0 h1:/nBTy5+1yRyY82YaO6HXQRnO5IAGsXTjEJaR3LdTPc0=
|
||||
github.com/libp2p/go-mplex v0.1.0/go.mod h1:SXgmdki2kwCUlCCbfGLEgHjC4pFqhTp0ZoV6aiKgxDU=
|
||||
github.com/libp2p/go-msgio v0.0.2 h1:ivPvEKHxmVkTClHzg6RXTYHqaJQ0V9cDbq+6lKb3UV0=
|
||||
github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ=
|
||||
github.com/libp2p/go-msgio v0.0.4 h1:agEFehY3zWJFUHK6SEMR7UYmk2z6kC3oeCM7ybLhguA=
|
||||
github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ=
|
||||
|
@ -380,9 +391,11 @@ github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA2
|
|||
github.com/libp2p/go-stream-muxer v0.0.1/go.mod h1:bAo8x7YkSpadMTbtTaxGVHWUQsR/l5MEaHbKaliuT14=
|
||||
github.com/libp2p/go-stream-muxer-multistream v0.2.0 h1:714bRJ4Zy9mdhyTLJ+ZKiROmAFwUHpeRidG+q7LTQOg=
|
||||
github.com/libp2p/go-stream-muxer-multistream v0.2.0/go.mod h1:j9eyPol/LLRqT+GPLSxvimPhNph4sfYfMoDPd7HkzIc=
|
||||
github.com/libp2p/go-tcp-transport v0.1.0 h1:IGhowvEqyMFknOar4FWCKSWE0zL36UFKQtiRQD60/8o=
|
||||
github.com/libp2p/go-tcp-transport v0.1.0/go.mod h1:oJ8I5VXryj493DEJ7OsBieu8fcg2nHGctwtInJVpipc=
|
||||
github.com/libp2p/go-tcp-transport v0.1.1 h1:yGlqURmqgNA2fvzjSgZNlHcsd/IulAnKM8Ncu+vlqnw=
|
||||
github.com/libp2p/go-tcp-transport v0.1.1/go.mod h1:3HzGvLbx6etZjnFlERyakbaYPdfjg2pWP97dFZworkY=
|
||||
github.com/libp2p/go-ws-transport v0.1.0 h1:F+0OvvdmPTDsVc4AjPHjV7L7Pk1B7D5QwtDcKE2oag4=
|
||||
github.com/libp2p/go-ws-transport v0.1.0/go.mod h1:rjw1MG1LU9YDC6gzmwObkPd/Sqwhw7yT74kj3raBFuo=
|
||||
github.com/libp2p/go-ws-transport v0.1.2 h1:VnxQcLfSGtqupqPpBNu8fUiCv+IN1RJ2BcVqQEM+z8E=
|
||||
github.com/libp2p/go-ws-transport v0.1.2/go.mod h1:dsh2Ld8F+XNmzpkaAijmg5Is+e9l6/1tK/6VFOdN69Y=
|
||||
|
@ -443,12 +456,15 @@ github.com/multiformats/go-multiaddr v0.1.0/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lg
|
|||
github.com/multiformats/go-multiaddr v0.1.1 h1:rVAztJYMhCQ7vEFr8FvxW3mS+HF2eY/oPbOMeS0ZDnE=
|
||||
github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo=
|
||||
github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q=
|
||||
github.com/multiformats/go-multiaddr-dns v0.0.2 h1:/Bbsgsy3R6e3jf2qBahzNHzww6usYaZ0NhNH3sqdFS8=
|
||||
github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q=
|
||||
github.com/multiformats/go-multiaddr-dns v0.1.0 h1:gsPeMvo91XvcsNlQXgJgfjYjbsVV99bvveguUvDBpyQ=
|
||||
github.com/multiformats/go-multiaddr-dns v0.1.0/go.mod h1:01k2RAqtoXIuPa3DCavAE9/6jc6nM0H3EgZyfUhN2oY=
|
||||
github.com/multiformats/go-multiaddr-fmt v0.0.1 h1:5YjeOIzbX8OTKVaN72aOzGIYW7PnrZrnkDyOfAWRSMA=
|
||||
github.com/multiformats/go-multiaddr-fmt v0.0.1/go.mod h1:aBYjqL4T/7j4Qx+R73XSv/8JsgnRFlf0w2KGLCmXl3Q=
|
||||
github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E=
|
||||
github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo=
|
||||
github.com/multiformats/go-multiaddr-net v0.0.1 h1:76O59E3FavvHqNg7jvzWzsPSW5JSi/ek0E4eiDVbg9g=
|
||||
github.com/multiformats/go-multiaddr-net v0.0.1/go.mod h1:nw6HSxNmCIQH27XPGBuX+d1tnvM7ihcFwHMSstNAVUU=
|
||||
github.com/multiformats/go-multiaddr-net v0.1.0 h1:ZepO8Ezwovd+7b5XPPDhQhayk1yt0AJpzQBpq9fejx4=
|
||||
github.com/multiformats/go-multiaddr-net v0.1.0/go.mod h1:5JNbcfBOP4dnhoZOv10JJVkJO0pCCEf8mTnipAo2UZQ=
|
||||
|
@ -584,6 +600,8 @@ github.com/status-im/rendezvous v1.3.0 h1:7RK/MXXW+tlm0asKm1u7Qp7Yni6AO29a7j8+E4
|
|||
github.com/status-im/rendezvous v1.3.0/go.mod h1:+hzjuP+j/XzLPeF6E50b88pWOTLdTcwjvNYt+Gh1W1s=
|
||||
github.com/status-im/status-protocol-go v0.5.1 h1:mCqYJrL/zWMScFjSLdboL5WANLn01Cz8bAxBwPxww7k=
|
||||
github.com/status-im/status-protocol-go v0.5.1/go.mod h1:KR/eihnrUq2dZegUOVjrA/1poSNhasA/o82VYyRgeB0=
|
||||
github.com/status-im/tcp-shaker v0.0.0-20191114194237-215893130501 h1:oa0KU5jJRNtXaM/P465MhvSFo/HM2O8qi2DDuPcd7ro=
|
||||
github.com/status-im/tcp-shaker v0.0.0-20191114194237-215893130501/go.mod h1:RYo/itke1oU5k/6sj9DNM3QAwtE5rZSgg5JnkOv83hk=
|
||||
github.com/status-im/whisper v1.5.2 h1:26NgiKusmPic38eQdtXnaY+iaQ/LuQ3Dh0kCGYT/Uxs=
|
||||
github.com/status-im/whisper v1.5.2/go.mod h1:emrOxzJme0k66QtbbQ2bdd3P8RCdLZ8sTD7SkwH1s2s=
|
||||
github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 h1:gIlAHnH1vJb5vwEjIp5kBj/eu99p/bl0Ay2goiPe5xE=
|
||||
|
@ -722,8 +740,9 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190927073244-c990c680b611/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/ntt0swNk5oYBziWeTCvY=
|
||||
golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056 h1:dHtDnRWQtSx0Hjq9kvKFpBh9uPPKfQN70NZZmvssGwk=
|
||||
golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.0.0-20171227012246-e19ae1496984/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=
|
||||
|
@ -744,6 +763,7 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3
|
|||
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-20190425222832-ad9eeb80039a/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20191109212701-97ad0ed33101 h1:LCmXVkvpQCDj724eX6irUTPCJP5GelFHxqGSWL2D1R0=
|
||||
golang.org/x/tools v0.0.0-20191109212701-97ad0ed33101/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
# Description
|
||||
|
||||
This module is used by the Status app to select mailservers based on their RTT(Round Trip Time).
|
||||
|
||||
It is exposed via the JSON RPC endpoint in the [`services/mailservers/tcp_ping.go`](../services/mailservers/tcp_ping.go) file.
|
||||
|
||||
# Usage
|
||||
|
||||
The simplest way to use the `mailserver_Ping` RPC command is using `curl`.
|
||||
|
||||
The call takes one struct argument which contains two attributes:
|
||||
|
||||
* `addresses` - A list of `enode` addresses to ping.
|
||||
* `timeoutMs` - Call timeout given in milliseconds.
|
||||
|
||||
The return value consists of a list of objects representing a result for each mailserver, each containing following attributes:
|
||||
|
||||
* `address` - The `enode` address of given mailserver.
|
||||
* `rtt_ms` - Round Trip Time given in milliseconds. Set to `-1` in case of an error.`
|
||||
* `error` - A text of error that caused the ping failure.
|
||||
|
||||
# Example
|
||||
|
||||
```bash
|
||||
$ cat >payload.json <<EOL
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "mailservers_ping",
|
||||
"params": [
|
||||
{
|
||||
"addresses": [
|
||||
"enode://c42f368a23fa98ee546fd247220759062323249ef657d26d357a777443aec04db1b29a3a22ef3e7c548e18493ddaf51a31b0aed6079bd6ebe5ae838fcfaf3a49@206.189.243.162:443",
|
||||
"enode://c42f368a23fa98ee546fd247220759062323249ef657d26d357a777443aec04db1b29a3a22ef3e7c548e18493ddaf51a31b0aed6079bd6ebe5ae838fcfaf3a49@206.189.243.162:999"
|
||||
],
|
||||
"timeoutMs": 500
|
||||
}
|
||||
],
|
||||
"id": 1
|
||||
}
|
||||
EOL
|
||||
|
||||
$ curl -s localhost:8545 -H 'content-type: application/json' -d @payload.json
|
||||
```
|
||||
```json
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
"result": [
|
||||
{
|
||||
"address": "enode://c42f368a23fa98ee546fd247220759062323249ef657d26d357a777443aec04db1b29a3a22ef3e7c548e18493ddaf51a31b0aed6079bd6ebe5ae838fcfaf3a49@206.189.243.162:443",
|
||||
"rtt_ms": 31,
|
||||
"error": null
|
||||
},
|
||||
{
|
||||
"address": "enode://c42f368a23fa98ee546fd247220759062323249ef657d26d357a777443aec04db1b29a3a22ef3e7c548e18493ddaf51a31b0aed6079bd6ebe5ae838fcfaf3a49@206.189.243.162:999",
|
||||
"rtt_ms": -1,
|
||||
"error": "tcp check timeout: I/O timeout"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
# Links
|
||||
|
||||
* https://github.com/status-im/status-react/issues/9394
|
||||
* https://github.com/status-im/status-go/pull/1672
|
||||
* https://github.com/status-im/tcp-shaker
|
|
@ -0,0 +1,98 @@
|
|||
package rtt
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
errors "github.com/pkg/errors"
|
||||
tcp "github.com/status-im/tcp-shaker"
|
||||
)
|
||||
|
||||
type Result struct {
|
||||
Addr string
|
||||
RTTMs int
|
||||
Err error
|
||||
}
|
||||
|
||||
// timeoutError indicates an error due to TCP connection timeout.
|
||||
// tcp-shaker returns an error implementing this interface in such a case.
|
||||
type timeoutError interface {
|
||||
Timeout() bool
|
||||
}
|
||||
|
||||
func runCheck(c *tcp.Checker, address string, timeout time.Duration) Result {
|
||||
// mesaure RTT
|
||||
start := time.Now()
|
||||
// TCP Ping
|
||||
err := c.CheckAddr(address, timeout)
|
||||
// measure RTT
|
||||
elapsed := time.Since(start)
|
||||
latency := int(elapsed.Nanoseconds() / 1e6)
|
||||
|
||||
if err != nil { // don't confuse users with valid latency values on error
|
||||
latency = -1
|
||||
switch err.(type) {
|
||||
case timeoutError:
|
||||
err = errors.Wrap(err, "tcp check timeout")
|
||||
case tcp.ErrConnect:
|
||||
err = errors.Wrap(err, "unable to connect")
|
||||
}
|
||||
}
|
||||
|
||||
return Result{
|
||||
Addr: address,
|
||||
RTTMs: latency,
|
||||
Err: err,
|
||||
}
|
||||
}
|
||||
|
||||
func waitForResults(errCh <-chan error, resCh <-chan Result) (results []Result, err error) {
|
||||
for {
|
||||
select {
|
||||
case err = <-errCh:
|
||||
return nil, err
|
||||
case res, ok := <-resCh:
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
results = append(results, res)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func CheckHosts(addresses []string, timeout time.Duration) ([]Result, error) {
|
||||
c := tcp.NewChecker()
|
||||
|
||||
// channel for receiving possible checking loop failure
|
||||
errCh := make(chan error, 1)
|
||||
|
||||
// stop the checking loop when function exists
|
||||
ctx, stopChecker := context.WithCancel(context.Background())
|
||||
defer stopChecker()
|
||||
|
||||
// loop that queries Epoll and pipes events to CheckAddr() calls
|
||||
go func() {
|
||||
errCh <- c.CheckingLoop(ctx)
|
||||
}()
|
||||
// wait for CheckingLoop to prepare the epoll/kqueue
|
||||
<-c.WaitReady()
|
||||
|
||||
// channel for returning results from concurrent checks
|
||||
resCh := make(chan Result, len(addresses))
|
||||
|
||||
var wg sync.WaitGroup
|
||||
for i := 0; i < len(addresses); i++ {
|
||||
wg.Add(1)
|
||||
go func(address string, resCh chan<- Result) {
|
||||
defer wg.Done()
|
||||
resCh <- runCheck(c, address, timeout)
|
||||
}(addresses[i], resCh)
|
||||
}
|
||||
// wait for all the routines to finish before closing results channel
|
||||
wg.Wait()
|
||||
close(resCh)
|
||||
|
||||
// wait for the results for all addresses or a checking loop error
|
||||
return waitForResults(errCh, resCh)
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
package mailservers
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/p2p/enode"
|
||||
"github.com/ethereum/go-ethereum/p2p/enr"
|
||||
|
||||
"github.com/status-im/status-go/rtt"
|
||||
)
|
||||
|
||||
type PingQuery struct {
|
||||
Addresses []string `json:"addresses"`
|
||||
TimeoutMs int `json:"timeoutMs"`
|
||||
}
|
||||
|
||||
type PingResult struct {
|
||||
ENode string `json:"address"`
|
||||
RTTMs int `json:"rtt_ms"`
|
||||
Err *string `json:"error"`
|
||||
}
|
||||
|
||||
func (pr *PingResult) Update(rttMs int, err error) {
|
||||
if err != nil {
|
||||
errStr := err.Error()
|
||||
pr.Err = &errStr
|
||||
}
|
||||
pr.RTTMs = rttMs
|
||||
}
|
||||
|
||||
func enodeToAddr(enodeAddr string) (string, error) {
|
||||
node, err := enode.ParseV4(enodeAddr)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
var ip4 enr.IPv4
|
||||
err = node.Load(&ip4)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
var tcp enr.TCP
|
||||
err = node.Load(&tcp)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return fmt.Sprintf("%s:%d", net.IP(ip4).String(), tcp), nil
|
||||
}
|
||||
|
||||
func parseEnodes(enodes []string) (map[string]*PingResult, []string) {
|
||||
// parse enode addreses into normal host + port addresses
|
||||
results := make(map[string]*PingResult, len(enodes))
|
||||
var toPing []string
|
||||
|
||||
for i := range enodes {
|
||||
addr, err := enodeToAddr(enodes[i])
|
||||
if err != nil {
|
||||
// using enode since it's irrelevant but needs to be unique
|
||||
errStr := err.Error()
|
||||
results[enodes[i]] = &PingResult{ENode: enodes[i], Err: &errStr}
|
||||
continue
|
||||
}
|
||||
results[addr] = &PingResult{ENode: enodes[i]}
|
||||
toPing = append(toPing, addr)
|
||||
}
|
||||
return results, toPing
|
||||
}
|
||||
|
||||
func mapValues(m map[string]*PingResult) []*PingResult {
|
||||
rval := make([]*PingResult, 0, len(m))
|
||||
for _, value := range m {
|
||||
rval = append(rval, value)
|
||||
}
|
||||
return rval
|
||||
}
|
||||
|
||||
func (a *API) Ping(ctx context.Context, pq PingQuery) ([]*PingResult, error) {
|
||||
timeout := time.Duration(pq.TimeoutMs) * time.Millisecond
|
||||
|
||||
// parse enodes into pingable addresses
|
||||
resultsMap, toPing := parseEnodes(pq.Addresses)
|
||||
|
||||
// run the checks concurrently
|
||||
results, err := rtt.CheckHosts(toPing, timeout)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// set ping results
|
||||
for i := range results {
|
||||
r := results[i]
|
||||
pr := resultsMap[r.Addr]
|
||||
if pr == nil {
|
||||
continue
|
||||
}
|
||||
pr.Update(r.RTTMs, r.Err)
|
||||
}
|
||||
|
||||
return mapValues(resultsMap), nil
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
|
||||
# Folders
|
||||
_obj
|
||||
_test
|
||||
|
||||
# Architecture specific extensions/prefixes
|
||||
*.[568vq]
|
||||
[568vq].out
|
||||
|
||||
*.cgo1.go
|
||||
*.cgo2.c
|
||||
_cgo_defun.c
|
||||
_cgo_gotypes.go
|
||||
_cgo_export.*
|
||||
|
||||
_testmain.go
|
||||
|
||||
*.exe
|
||||
*.test
|
||||
*.prof
|
|
@ -0,0 +1,12 @@
|
|||
os:
|
||||
- linux
|
||||
- osx
|
||||
language: go
|
||||
go:
|
||||
- "master"
|
||||
- "1.11.x"
|
||||
install:
|
||||
- go get "github.com/pkg/errors"
|
||||
- go get "golang.org/x/sys/unix"
|
||||
script: go test -v -bench=. -benchmem ./...
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# Contributing to TCP Shaker
|
||||
|
||||
## Styleguide
|
||||
### Git commit message
|
||||
|
||||
- Capitalize the first letter ("Add feature" not "add feature")
|
||||
- Limit the first line to 50 characters or less
|
||||
- Details below the first line should be wrapped to 72 characters
|
||||
- Use the present tense ("Add feature" not "Added feature")
|
||||
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
|
||||
|
||||
Please squash your commits into a single commit when appropriate. This simplifies future cherry picks and keeps the git log clean.
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Tevin Zhang
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -0,0 +1,94 @@
|
|||
# TCP Checker :heartbeat:
|
||||
|
||||
[![Go Report Card](https://goreportcard.com/badge/github.com/tevino/tcp-shaker)](https://goreportcard.com/report/github.com/tevino/tcp-shaker)
|
||||
[![GoDoc](https://godoc.org/github.com/tevino/tcp-shaker?status.svg)](https://godoc.org/github.com/tevino/tcp-shaker)
|
||||
[![Build Status](https://travis-ci.org/tevino/tcp-shaker.svg?branch=master)](https://travis-ci.org/tevino/tcp-shaker)
|
||||
|
||||
This package is used to perform TCP handshake without ACK, which useful for TCP health checking.
|
||||
|
||||
HAProxy does this exactly the same, which is:
|
||||
|
||||
1. SYN
|
||||
2. SYN-ACK
|
||||
3. RST
|
||||
|
||||
This implementation has been running on tens of thousands of production servers for years.
|
||||
|
||||
## Why do I have to do this
|
||||
|
||||
In most cases when you establish a TCP connection(e.g. via `net.Dial`), these are the first three packets between the client and server([TCP three-way handshake][tcp-handshake]):
|
||||
|
||||
1. Client -> Server: SYN
|
||||
2. Server -> Client: SYN-ACK
|
||||
3. Client -> Server: ACK
|
||||
|
||||
**This package tries to avoid the last ACK when doing handshakes.**
|
||||
|
||||
By sending the last ACK, the connection is considered established.
|
||||
|
||||
However, as for TCP health checking the server could be considered alive right after it sends back SYN-ACK,
|
||||
|
||||
that renders the last ACK unnecessary or even harmful in some cases.
|
||||
|
||||
### Benefits
|
||||
|
||||
By avoiding the last ACK
|
||||
|
||||
1. Less packets better efficiency
|
||||
2. The health checking is less obvious
|
||||
|
||||
The second one is essential because it bothers the server less.
|
||||
|
||||
This means the application level server will not notice the health checking traffic at all, **thus the act of health checking will not be
|
||||
considered as some misbehavior of client.**
|
||||
|
||||
## Requirements
|
||||
|
||||
- Linux 2.4 or newer
|
||||
|
||||
There is a **fake implementation** for **non-Linux** platform which is equivalent to:
|
||||
|
||||
```go
|
||||
conn, err := net.DialTimeout("tcp", addr, timeout)
|
||||
conn.Close()
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```go
|
||||
import "github.com/tevino/tcp-shaker"
|
||||
|
||||
c := NewChecker()
|
||||
|
||||
ctx, stopChecker := context.WithCancel(context.Background())
|
||||
defer stopChecker()
|
||||
go func() {
|
||||
if err := c.CheckingLoop(ctx); err != nil {
|
||||
fmt.Println("checking loop stopped due to fatal error: ", err)
|
||||
}
|
||||
}()
|
||||
|
||||
<-c.WaitReady()
|
||||
|
||||
timeout := time.Second * 1
|
||||
err := c.CheckAddr("google.com:80", timeout)
|
||||
switch err {
|
||||
case ErrTimeout:
|
||||
fmt.Println("Connect to Google timed out")
|
||||
case nil:
|
||||
fmt.Println("Connect to Google succeeded")
|
||||
default:
|
||||
fmt.Println("Error occurred while connecting: ", err)
|
||||
}
|
||||
```
|
||||
|
||||
## TODO
|
||||
|
||||
- [ ] IPv6 support (Test environment needed, PRs are welcome)
|
||||
|
||||
## Special thanks to contributors
|
||||
|
||||
- @lujjjh Added zero linger support for non-Linux platform
|
||||
- @jakubgs Fixed compatibility on Android
|
||||
|
||||
[tcp-handshake]: https://en.wikipedia.org/wiki/Handshaking#TCP_three-way_handshake
|
|
@ -0,0 +1,215 @@
|
|||
// +build darwin
|
||||
|
||||
package tcp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// Checker contains an epoll instance for TCP handshake checking
|
||||
type Checker struct {
|
||||
pipePool
|
||||
resultPipes
|
||||
pollerLock sync.Mutex
|
||||
_kqueueFd int32
|
||||
zeroLinger bool
|
||||
isReady chan struct{}
|
||||
}
|
||||
|
||||
// NewChecker creates a Checker with linger set to zero.
|
||||
func NewChecker() *Checker {
|
||||
return NewCheckerZeroLinger(true)
|
||||
}
|
||||
|
||||
// NewCheckerZeroLinger creates a Checker with zeroLinger set to given value.
|
||||
func NewCheckerZeroLinger(zeroLinger bool) *Checker {
|
||||
return &Checker{
|
||||
pipePool: newPipePoolSyncPool(),
|
||||
resultPipes: newResultPipesSyncMap(),
|
||||
_kqueueFd: -1,
|
||||
zeroLinger: zeroLinger,
|
||||
isReady: make(chan struct{}),
|
||||
}
|
||||
}
|
||||
|
||||
// CheckingLoop must be called before anything else.
|
||||
// NOTE: this function blocks until ctx got canceled.
|
||||
func (c *Checker) CheckingLoop(ctx context.Context) error {
|
||||
kqueue, err := c.createPoller()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error creating poller")
|
||||
}
|
||||
defer c.closePoller()
|
||||
|
||||
c.setReady()
|
||||
defer c.resetReady()
|
||||
|
||||
return c.pollingLoop(ctx, kqueue)
|
||||
}
|
||||
|
||||
func (c *Checker) createPoller() (int, error) {
|
||||
c.pollerLock.Lock()
|
||||
defer c.pollerLock.Unlock()
|
||||
|
||||
if c.getKQueueAtomic() > 0 {
|
||||
// return if already initialized
|
||||
return -1, ErrCheckerAlreadyStarted
|
||||
}
|
||||
|
||||
kqueue, err := createPoller()
|
||||
if err != nil {
|
||||
return -1, err
|
||||
}
|
||||
c.setKQueueAtomic(kqueue)
|
||||
|
||||
return kqueue, nil
|
||||
}
|
||||
|
||||
func (c *Checker) closePoller() error {
|
||||
c.pollerLock.Lock()
|
||||
defer c.pollerLock.Unlock()
|
||||
var err error
|
||||
if c.getKQueueAtomic() > 0 {
|
||||
err = unix.Close(c.getKQueueAtomic())
|
||||
}
|
||||
c.setKQueueAtomic(-1)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *Checker) setReady() {
|
||||
close(c.isReady)
|
||||
}
|
||||
|
||||
func (c *Checker) resetReady() {
|
||||
c.isReady = make(chan struct{})
|
||||
}
|
||||
|
||||
const pollerTimeout = time.Second
|
||||
|
||||
func (c *Checker) pollingLoop(ctx context.Context, kqueue int) error {
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return nil
|
||||
default:
|
||||
evts, err := pollEvents(kqueue, pollerTimeout)
|
||||
if err != nil {
|
||||
// fatal error
|
||||
return errors.Wrap(err, "error during polling loop")
|
||||
}
|
||||
|
||||
c.handlePollerEvents(evts)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Checker) handlePollerEvents(evts []event) {
|
||||
for _, e := range evts {
|
||||
if pipe, exists := c.resultPipes.popResultPipe(e.Fd); exists {
|
||||
pipe <- e.Err
|
||||
}
|
||||
// error pipe not found
|
||||
// in this case, e.Fd should have been handled in the previous event.
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Checker) getKQueueAtomic() int {
|
||||
return int(atomic.LoadInt32(&c._kqueueFd))
|
||||
}
|
||||
|
||||
func (c *Checker) setKQueueAtomic(fd int) {
|
||||
atomic.StoreInt32(&c._kqueueFd, int32(fd))
|
||||
}
|
||||
|
||||
// CheckAddr performs a TCP check with given TCP address and timeout
|
||||
// A successful check will result in nil error
|
||||
// ErrTimeout is returned if timeout
|
||||
// zeroLinger is an optional parameter indicating if linger should be set to zero
|
||||
// for this particular connection
|
||||
// Note: timeout includes domain resolving
|
||||
func (c *Checker) CheckAddr(addr string, timeout time.Duration) (err error) {
|
||||
return c.CheckAddrZeroLinger(addr, timeout, c.zeroLinger)
|
||||
}
|
||||
|
||||
// CheckAddrZeroLinger is like CheckAddr with an extra parameter indicating whether to enable zero linger.
|
||||
func (c *Checker) CheckAddrZeroLinger(addr string, timeout time.Duration, zeroLinger bool) error {
|
||||
// Set deadline
|
||||
deadline := time.Now().Add(timeout)
|
||||
|
||||
// Parse address
|
||||
rAddr, err := parseSockAddr(addr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Create socket with options set
|
||||
fd, err := createSocketZeroLinger(zeroLinger)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Socket closes after the right socket event returns
|
||||
defer unix.Close(fd)
|
||||
|
||||
// Connect to the address
|
||||
if success, cErr := connect(fd, rAddr); cErr != nil {
|
||||
// If there was an error, return it.
|
||||
return &ErrConnect{cErr}
|
||||
} else if success {
|
||||
// If the connect was successful, we are done.
|
||||
return nil
|
||||
}
|
||||
// Otherwise wait for the result of connect.
|
||||
return c.waitConnectResult(fd, deadline.Sub(time.Now()))
|
||||
}
|
||||
|
||||
func (c *Checker) waitConnectResult(fd int, timeout time.Duration) error {
|
||||
// get a pipe of connect result
|
||||
resultPipe := c.getPipe()
|
||||
defer func() {
|
||||
c.resultPipes.deregisterResultPipe(fd)
|
||||
c.putBackPipe(resultPipe)
|
||||
}()
|
||||
|
||||
// this must be done before registerEvents
|
||||
c.resultPipes.registerResultPipe(fd, resultPipe)
|
||||
// Register to epoll for later error checking
|
||||
err := registerEvents(c.KQueue(), fd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Wait for connect result
|
||||
err = c.waitPipeTimeout(resultPipe, timeout)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *Checker) waitPipeTimeout(pipe chan error, timeout time.Duration) error {
|
||||
select {
|
||||
case ret := <-pipe:
|
||||
return ret
|
||||
case <-time.After(timeout):
|
||||
return ErrTimeout
|
||||
}
|
||||
}
|
||||
|
||||
// WaitReady returns a chan which is closed when the Checker is ready for use.
|
||||
func (c *Checker) WaitReady() <-chan struct{} {
|
||||
return c.isReady
|
||||
}
|
||||
|
||||
// IsReady returns a bool indicates whether the Checker is ready for use
|
||||
func (c *Checker) IsReady() bool {
|
||||
return c.getKQueueAtomic() > 0
|
||||
}
|
||||
|
||||
// PollerFd returns the inner fd of poller instance.
|
||||
// NOTE: Use this only when you really know what you are doing.
|
||||
func (c *Checker) KQueue() int {
|
||||
return c.getKQueueAtomic()
|
||||
}
|
|
@ -0,0 +1,212 @@
|
|||
// +build linux
|
||||
|
||||
package tcp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// Checker contains an epoll instance for TCP handshake checking
|
||||
type Checker struct {
|
||||
pipePool
|
||||
resultPipes
|
||||
pollerLock sync.Mutex
|
||||
_pollerFd int32
|
||||
zeroLinger bool
|
||||
isReady chan struct{}
|
||||
}
|
||||
|
||||
// NewChecker creates a Checker with linger set to zero.
|
||||
func NewChecker() *Checker {
|
||||
return NewCheckerZeroLinger(true)
|
||||
}
|
||||
|
||||
// NewCheckerZeroLinger creates a Checker with zeroLinger set to given value.
|
||||
func NewCheckerZeroLinger(zeroLinger bool) *Checker {
|
||||
return &Checker{
|
||||
pipePool: newPipePoolSyncPool(),
|
||||
resultPipes: newResultPipesSyncMap(),
|
||||
_pollerFd: -1,
|
||||
zeroLinger: zeroLinger,
|
||||
isReady: make(chan struct{}),
|
||||
}
|
||||
}
|
||||
|
||||
// CheckingLoop must be called before anything else.
|
||||
// NOTE: this function blocks until ctx got canceled.
|
||||
func (c *Checker) CheckingLoop(ctx context.Context) error {
|
||||
pollerFd, err := c.createPoller()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error creating poller")
|
||||
}
|
||||
defer c.closePoller()
|
||||
|
||||
c.setReady()
|
||||
defer c.resetReady()
|
||||
|
||||
return c.pollingLoop(ctx, pollerFd)
|
||||
}
|
||||
|
||||
func (c *Checker) createPoller() (int, error) {
|
||||
c.pollerLock.Lock()
|
||||
defer c.pollerLock.Unlock()
|
||||
|
||||
if c.PollerFDAtomic() > 0 {
|
||||
// return if already initialized
|
||||
return -1, ErrCheckerAlreadyStarted
|
||||
}
|
||||
|
||||
pollerFd, err := createPoller()
|
||||
if err != nil {
|
||||
return -1, err
|
||||
}
|
||||
c.setPollerFD(pollerFd)
|
||||
|
||||
return pollerFd, nil
|
||||
}
|
||||
|
||||
func (c *Checker) closePoller() error {
|
||||
c.pollerLock.Lock()
|
||||
defer c.pollerLock.Unlock()
|
||||
var err error
|
||||
if c.PollerFDAtomic() > 0 {
|
||||
err = unix.Close(c.PollerFDAtomic())
|
||||
}
|
||||
c.setPollerFD(-1)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *Checker) setReady() {
|
||||
close(c.isReady)
|
||||
}
|
||||
|
||||
func (c *Checker) resetReady() {
|
||||
c.isReady = make(chan struct{})
|
||||
}
|
||||
|
||||
const pollerTimeout = time.Second
|
||||
|
||||
func (c *Checker) pollingLoop(ctx context.Context, pollerFd int) error {
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return nil
|
||||
default:
|
||||
evts, err := pollEvents(pollerFd, pollerTimeout)
|
||||
if err != nil {
|
||||
// fatal error
|
||||
return errors.Wrap(err, "error during polling loop")
|
||||
}
|
||||
|
||||
c.handlePollerEvents(evts)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Checker) handlePollerEvents(evts []event) {
|
||||
for _, e := range evts {
|
||||
if pipe, exists := c.resultPipes.popResultPipe(e.Fd); exists {
|
||||
pipe <- e.Err
|
||||
}
|
||||
// error pipe not found
|
||||
// in this case, e.Fd should have been handled in the previous event.
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Checker) PollerFDAtomic() int {
|
||||
return int(atomic.LoadInt32(&c._pollerFd))
|
||||
}
|
||||
|
||||
func (c *Checker) setPollerFD(fd int) {
|
||||
atomic.StoreInt32(&c._pollerFd, int32(fd))
|
||||
}
|
||||
|
||||
// CheckAddr performs a TCP check with given TCP address and timeout
|
||||
// A successful check will result in nil error
|
||||
// ErrTimeout is returned if timeout
|
||||
// zeroLinger is an optional parameter indicating if linger should be set to zero
|
||||
// for this particular connection
|
||||
// Note: timeout includes domain resolving
|
||||
func (c *Checker) CheckAddr(addr string, timeout time.Duration) (err error) {
|
||||
return c.CheckAddrZeroLinger(addr, timeout, c.zeroLinger)
|
||||
}
|
||||
|
||||
// CheckAddrZeroLinger is like CheckAddr with an extra parameter indicating whether to enable zero linger.
|
||||
func (c *Checker) CheckAddrZeroLinger(addr string, timeout time.Duration, zeroLinger bool) error {
|
||||
// Set deadline
|
||||
deadline := time.Now().Add(timeout)
|
||||
|
||||
// Parse address
|
||||
rAddr, err := parseSockAddr(addr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Create socket with options set
|
||||
fd, err := createSocketZeroLinger(zeroLinger)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Socket closes after the right socket event returns
|
||||
defer unix.Close(fd)
|
||||
|
||||
// Connect to the address
|
||||
if success, cErr := connect(fd, rAddr); cErr != nil {
|
||||
// If there was an error, return it.
|
||||
return &ErrConnect{cErr}
|
||||
} else if success {
|
||||
// If the connect was successful, we are done.
|
||||
return nil
|
||||
}
|
||||
// Otherwise wait for the result of connect.
|
||||
return c.waitConnectResult(fd, deadline.Sub(time.Now()))
|
||||
}
|
||||
|
||||
func (c *Checker) waitConnectResult(fd int, timeout time.Duration) error {
|
||||
// get a pipe of connect result
|
||||
resultPipe := c.getPipe()
|
||||
defer func() {
|
||||
c.resultPipes.deregisterResultPipe(fd)
|
||||
c.putBackPipe(resultPipe)
|
||||
}()
|
||||
|
||||
// this must be done before registerEvents
|
||||
c.resultPipes.registerResultPipe(fd, resultPipe)
|
||||
// Register to epoll for later error checking
|
||||
if err := registerEvents(c.PollerFDAtomic(), fd); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Wait for connect result
|
||||
return c.waitPipeTimeout(resultPipe, timeout)
|
||||
}
|
||||
|
||||
func (c *Checker) waitPipeTimeout(pipe chan error, timeout time.Duration) error {
|
||||
select {
|
||||
case ret := <-pipe:
|
||||
return ret
|
||||
case <-time.After(timeout):
|
||||
return ErrTimeout
|
||||
}
|
||||
}
|
||||
|
||||
// WaitReady returns a chan which is closed when the Checker is ready for use.
|
||||
func (c *Checker) WaitReady() <-chan struct{} {
|
||||
return c.isReady
|
||||
}
|
||||
|
||||
// IsReady returns a bool indicates whether the Checker is ready for use
|
||||
func (c *Checker) IsReady() bool {
|
||||
return c.PollerFDAtomic() > 0
|
||||
}
|
||||
|
||||
// PollerFd returns the inner fd of poller instance.
|
||||
// NOTE: Use this only when you really know what you are doing.
|
||||
func (c *Checker) PollerFd() int {
|
||||
return c.PollerFDAtomic()
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
// +build windows
|
||||
// WARNING: This is a dummy package, windows suppor is not implemented yet.
|
||||
|
||||
package tcp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Checker is a fake implementation.
|
||||
type Checker struct {
|
||||
isReady chan struct{}
|
||||
}
|
||||
|
||||
func NewChecker() *Checker {
|
||||
return NewCheckerZeroLinger(true)
|
||||
}
|
||||
|
||||
func NewCheckerZeroLinger(zeroLinger bool) *Checker {
|
||||
isReady := make(chan struct{})
|
||||
close(isReady)
|
||||
return &Checker{isReady: isReady}
|
||||
}
|
||||
|
||||
func (c *Checker) CheckingLoop(ctx context.Context) error {
|
||||
<-ctx.Done()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Checker) CheckAddr(addr string, timeout time.Duration) error {
|
||||
return c.CheckAddrZeroLinger(addr, timeout, false)
|
||||
}
|
||||
|
||||
func (c *Checker) CheckAddrZeroLinger(addr string, timeout time.Duration, zeroLinger bool) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Checker) IsReady() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (c *Checker) WaitReady() <-chan struct{} {
|
||||
return c.isReady
|
||||
}
|
||||
|
||||
func (c *Checker) Close() error {
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
Package tcp is used to perform TCP handshake without ACK, which useful for TCP health checking.
|
||||
HAProxy does this exactly the same, which is:
|
||||
|
||||
1. SYN
|
||||
2. SYN-ACK
|
||||
3. RST
|
||||
|
||||
Why do I have to do this
|
||||
|
||||
In most cases when you establish a TCP connection(e.g. via net.Dial), these are the first three packets between the client and server(TCP three-way handshake):
|
||||
|
||||
1. Client -> Server: SYN
|
||||
2. Server -> Client: SYN-ACK
|
||||
3. Client -> Server: ACK
|
||||
|
||||
This package tries to avoid the last ACK when doing handshakes.
|
||||
|
||||
By sending the last ACK, the connection is considered established.
|
||||
|
||||
However, as for TCP health checking the server could be considered alive right after it sends back SYN-ACK, that renders the last ACK unnecessary or even harmful in some cases.
|
||||
|
||||
Benefits
|
||||
|
||||
By avoiding the last ACK
|
||||
|
||||
1. Less packets better efficiency
|
||||
2. The health checking is less obvious
|
||||
|
||||
The second one is essential because it bothers the server less.
|
||||
|
||||
This means the application level server will not notice the health checking traffic at all, thus the act of health checking will not be considered as some misbehavior of client.
|
||||
*/
|
||||
package tcp
|
|
@ -0,0 +1,32 @@
|
|||
// +build darwin linux
|
||||
|
||||
package tcp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// ErrTimeout indicates I/O timeout
|
||||
var ErrTimeout = &timeoutError{}
|
||||
|
||||
type timeoutError struct{}
|
||||
|
||||
func (e *timeoutError) Error() string { return "I/O timeout" }
|
||||
func (e *timeoutError) Timeout() bool { return true }
|
||||
func (e *timeoutError) Temporary() bool { return true }
|
||||
|
||||
// ErrConnect is an error occurs while connecting to the host
|
||||
// To get the detail of underlying error, lookup ErrorCode() in 'man 2 connect'
|
||||
type ErrConnect struct {
|
||||
error
|
||||
}
|
||||
|
||||
// newErrConnect returns a ErrConnect with given error code
|
||||
func newErrConnect(errCode int) *ErrConnect {
|
||||
return &ErrConnect{unix.Errno(errCode)}
|
||||
}
|
||||
|
||||
// ErrCheckerAlreadyStarted indicates there is another instance of CheckingLoop running.
|
||||
var ErrCheckerAlreadyStarted = errors.New("Checker was already started")
|
|
@ -0,0 +1,16 @@
|
|||
// +build windows
|
||||
|
||||
package tcp
|
||||
|
||||
import "errors"
|
||||
|
||||
// ErrTimeout indicates I/O timeout
|
||||
var ErrTimeout = &timeoutError{}
|
||||
|
||||
type timeoutError struct{}
|
||||
|
||||
type ErrConnect struct {
|
||||
error
|
||||
}
|
||||
|
||||
var ErrCheckerAlreadyStarted = errors.New("Checker was already started")
|
|
@ -0,0 +1,6 @@
|
|||
package tcp
|
||||
|
||||
type event struct {
|
||||
Fd int
|
||||
Err error
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
module github.com/status-im/tcp-shaker
|
||||
|
||||
go 1.13
|
||||
|
||||
require golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056 // indirect
|
|
@ -0,0 +1,2 @@
|
|||
golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056 h1:dHtDnRWQtSx0Hjq9kvKFpBh9uPPKfQN70NZZmvssGwk=
|
||||
golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
@ -0,0 +1,6 @@
|
|||
package tcp
|
||||
|
||||
type pipePool interface {
|
||||
getPipe() chan error
|
||||
putBackPipe(chan error)
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package tcp
|
||||
|
||||
type pipePoolDummy struct{}
|
||||
|
||||
func newPipePoolDummy() *pipePoolDummy {
|
||||
return &pipePoolDummy{}
|
||||
}
|
||||
|
||||
func (*pipePoolDummy) getPipe() chan error {
|
||||
return make(chan error, 1)
|
||||
}
|
||||
|
||||
func (*pipePoolDummy) putBackPipe(pipe chan error) {}
|
|
@ -0,0 +1,31 @@
|
|||
package tcp
|
||||
|
||||
import "sync"
|
||||
|
||||
type pipePoolSyncPool struct {
|
||||
pool sync.Pool
|
||||
}
|
||||
|
||||
func newPipePoolSyncPool() *pipePoolSyncPool {
|
||||
return &pipePoolSyncPool{sync.Pool{
|
||||
New: func() interface{} {
|
||||
return make(chan error, 1)
|
||||
}},
|
||||
}
|
||||
}
|
||||
|
||||
func (p *pipePoolSyncPool) getPipe() chan error {
|
||||
return p.pool.Get().(chan error)
|
||||
}
|
||||
|
||||
func (p *pipePoolSyncPool) putBackPipe(pipe chan error) {
|
||||
p.cleanPipe(pipe)
|
||||
p.pool.Put(pipe)
|
||||
}
|
||||
|
||||
func (p *pipePoolSyncPool) cleanPipe(pipe chan error) {
|
||||
select {
|
||||
case <-pipe:
|
||||
default:
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package tcp
|
||||
|
||||
type resultPipes interface {
|
||||
popResultPipe(int) (chan error, bool)
|
||||
deregisterResultPipe(int)
|
||||
registerResultPipe(int, chan error)
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package tcp
|
||||
|
||||
import "sync"
|
||||
|
||||
type resultPipesMU struct {
|
||||
l sync.Mutex
|
||||
fdResultPipes map[int]chan error
|
||||
}
|
||||
|
||||
func newResultPipesMU() *resultPipesMU {
|
||||
return &resultPipesMU{fdResultPipes: make(map[int]chan error)}
|
||||
}
|
||||
|
||||
func (r *resultPipesMU) popResultPipe(fd int) (chan error, bool) {
|
||||
r.l.Lock()
|
||||
p, exists := r.fdResultPipes[fd]
|
||||
if exists {
|
||||
delete(r.fdResultPipes, fd)
|
||||
}
|
||||
r.l.Unlock()
|
||||
return p, exists
|
||||
}
|
||||
|
||||
func (r *resultPipesMU) deregisterResultPipe(fd int) {
|
||||
r.l.Lock()
|
||||
delete(r.fdResultPipes, fd)
|
||||
r.l.Unlock()
|
||||
}
|
||||
|
||||
func (r *resultPipesMU) registerResultPipe(fd int, pipe chan error) {
|
||||
// NOTE: the pipe should have been put back if c.fdResultPipes[fd] exists.
|
||||
r.l.Lock()
|
||||
r.fdResultPipes[fd] = pipe
|
||||
r.l.Unlock()
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package tcp
|
||||
|
||||
import "sync"
|
||||
|
||||
type resultPipesSyncMap struct {
|
||||
sync.Map
|
||||
}
|
||||
|
||||
func newResultPipesSyncMap() *resultPipesSyncMap {
|
||||
return &resultPipesSyncMap{}
|
||||
}
|
||||
|
||||
func (r *resultPipesSyncMap) popResultPipe(fd int) (chan error, bool) {
|
||||
p, exist := r.Load(fd)
|
||||
if exist {
|
||||
r.Delete(fd)
|
||||
}
|
||||
if p != nil {
|
||||
return p.(chan error), exist
|
||||
}
|
||||
return nil, exist
|
||||
}
|
||||
|
||||
func (r *resultPipesSyncMap) deregisterResultPipe(fd int) {
|
||||
r.Delete(fd)
|
||||
}
|
||||
|
||||
func (r *resultPipesSyncMap) registerResultPipe(fd int, pipe chan error) {
|
||||
// NOTE: the pipe should have been put back if c.fdResultPipes[fd] exists.
|
||||
r.Store(fd, pipe)
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
// +build !windows
|
||||
|
||||
package tcp
|
||||
|
||||
import (
|
||||
"net"
|
||||
"runtime"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// parseSockAddr resolves given addr to unix.Sockaddr
|
||||
func parseSockAddr(addr string) (unix.Sockaddr, error) {
|
||||
tAddr, err := net.ResolveTCPAddr("tcp", addr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var addr4 [4]byte
|
||||
if tAddr.IP != nil {
|
||||
copy(addr4[:], tAddr.IP.To4()) // copy last 4 bytes of slice to array
|
||||
}
|
||||
return &unix.SockaddrInet4{Port: tAddr.Port, Addr: addr4}, nil
|
||||
}
|
||||
|
||||
// connect calls the connect syscall with error handled.
|
||||
func connect(fd int, addr unix.Sockaddr) (success bool, err error) {
|
||||
// Connect() sends the actual SYN
|
||||
switch serr := unix.Connect(fd, addr); serr {
|
||||
case unix.EALREADY, unix.EINPROGRESS, unix.EINTR:
|
||||
// Connection could not be made immediately but asynchronously.
|
||||
success = false
|
||||
err = nil
|
||||
case nil, unix.EISCONN:
|
||||
// The specified socket is already connected.
|
||||
success = true
|
||||
err = nil
|
||||
case unix.EINVAL:
|
||||
// On Solaris we can see EINVAL if the socket has
|
||||
// already been accepted and closed by the server.
|
||||
// Treat this as a successful connection--writes to
|
||||
// the socket will see EOF. For details and a test
|
||||
// case in C see https://golang.org/issue/6828.
|
||||
if runtime.GOOS == "solaris" {
|
||||
success = true
|
||||
err = nil
|
||||
} else {
|
||||
// error must be reported
|
||||
success = false
|
||||
err = serr
|
||||
}
|
||||
default:
|
||||
// Connect error.
|
||||
success = false
|
||||
err = serr
|
||||
}
|
||||
return success, err
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
// +build darwin
|
||||
|
||||
package tcp
|
||||
|
||||
import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
const maxKEvents = 32
|
||||
|
||||
// createSocket creates a socket with necessary options set.
|
||||
func createSocketZeroLinger(zeroLinger bool) (fd int, err error) {
|
||||
// Create socket
|
||||
fd, err = _createNonBlockingSocket()
|
||||
if err == nil {
|
||||
if zeroLinger {
|
||||
err = _setZeroLinger(fd)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// createNonBlockingSocket creates a non-blocking socket with necessary options all set.
|
||||
func _createNonBlockingSocket() (int, error) {
|
||||
// Create socket
|
||||
fd, err := _createSocket()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
// Set necessary options
|
||||
err = _setSockOpts(fd)
|
||||
if err != nil {
|
||||
unix.Close(fd)
|
||||
}
|
||||
return fd, err
|
||||
}
|
||||
|
||||
// createSocket creates a socket with CloseOnExec set
|
||||
func _createSocket() (int, error) {
|
||||
fd, err := unix.Socket(unix.AF_INET, unix.SOCK_STREAM, 0)
|
||||
if err != nil {
|
||||
return 0, os.NewSyscallError("socket", err)
|
||||
}
|
||||
|
||||
//unix.CloseOnExec(fd)
|
||||
return fd, err
|
||||
}
|
||||
|
||||
// setSockOpts sets SOCK_NONBLOCK and TCP_NODELAY for given fd
|
||||
func _setSockOpts(fd int) error {
|
||||
err := unix.SetNonblock(fd, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return unix.SetsockoptInt(fd, unix.IPPROTO_TCP, unix.TCP_NODELAY, 0)
|
||||
}
|
||||
|
||||
var zeroLinger = unix.Linger{Onoff: 1, Linger: 0}
|
||||
|
||||
// setLinger sets SO_Linger with 0 timeout to given fd
|
||||
func _setZeroLinger(fd int) error {
|
||||
return unix.SetsockoptLinger(fd, unix.SOL_SOCKET, unix.SO_LINGER, &zeroLinger)
|
||||
}
|
||||
|
||||
func createPoller() (kq int, err error) {
|
||||
kq, err = unix.Kqueue()
|
||||
if err != nil {
|
||||
err = os.NewSyscallError("kqueue", err)
|
||||
}
|
||||
return kq, err
|
||||
}
|
||||
|
||||
// registerEvents registers given fd with read events.
|
||||
func registerEvents(kq, fd int) error {
|
||||
eventFilter := unix.Kevent_t{}
|
||||
unix.SetKevent(&eventFilter, fd, unix.EVFILT_WRITE, unix.EV_ADD|unix.EV_ONESHOT)
|
||||
// doesn't block, just sets the events we are interested in
|
||||
_, err := unix.Kevent(kq, []unix.Kevent_t{eventFilter}, []unix.Kevent_t{}, nil)
|
||||
if err != nil {
|
||||
return os.NewSyscallError("kevent", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func pollEvents(kq int, timeout time.Duration) ([]event, error) {
|
||||
tsTimeout := unix.NsecToTimespec(timeout.Nanoseconds())
|
||||
rEvents := make([]unix.Kevent_t, maxKEvents)
|
||||
// this blocks, waiting for socket events
|
||||
nEvents, err := unix.Kevent(kq, []unix.Kevent_t{}, rEvents, &tsTimeout)
|
||||
if err != nil {
|
||||
if err == unix.EINTR {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, os.NewSyscallError("kevent", err)
|
||||
}
|
||||
|
||||
var events = make([]event, 0, nEvents)
|
||||
|
||||
for i := 0; i < nEvents; i++ {
|
||||
var fd = int(rEvents[i].Ident)
|
||||
var evt = event{Fd: fd, Err: nil}
|
||||
|
||||
errCode, err := unix.GetsockoptInt(fd, unix.SOL_SOCKET, unix.SO_ERROR)
|
||||
if err != nil {
|
||||
evt.Err = os.NewSyscallError("getsockopt", err)
|
||||
}
|
||||
if errCode != 0 {
|
||||
evt.Err = newErrConnect(errCode)
|
||||
}
|
||||
events = append(events, evt)
|
||||
}
|
||||
return events, nil
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
// +build linux
|
||||
|
||||
package tcp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
const maxEpollEvents = 32
|
||||
|
||||
// createSocket creates a socket with necessary options set.
|
||||
func createSocketZeroLinger(zeroLinger bool) (fd int, err error) {
|
||||
// Create socket
|
||||
fd, err = _createNonBlockingSocket()
|
||||
if err == nil {
|
||||
if zeroLinger {
|
||||
err = _setZeroLinger(fd)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// createNonBlockingSocket creates a non-blocking socket with necessary options all set.
|
||||
func _createNonBlockingSocket() (int, error) {
|
||||
// Create socket
|
||||
fd, err := _createSocket()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
// Set necessary options
|
||||
err = _setSockOpts(fd)
|
||||
if err != nil {
|
||||
unix.Close(fd)
|
||||
}
|
||||
return fd, err
|
||||
}
|
||||
|
||||
// createSocket creates a socket with CloseOnExec set
|
||||
func _createSocket() (int, error) {
|
||||
fd, err := unix.Socket(unix.AF_INET, unix.SOCK_STREAM, 0)
|
||||
if err != nil {
|
||||
return 0, os.NewSyscallError("socket", err)
|
||||
}
|
||||
|
||||
unix.CloseOnExec(fd)
|
||||
return fd, err
|
||||
}
|
||||
|
||||
// setSockOpts sets SOCK_NONBLOCK and TCP_QUICKACK for given fd
|
||||
func _setSockOpts(fd int) error {
|
||||
err := unix.SetNonblock(fd, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return unix.SetsockoptInt(fd, unix.IPPROTO_TCP, unix.TCP_QUICKACK, 0)
|
||||
}
|
||||
|
||||
var zeroLinger = unix.Linger{Onoff: 1, Linger: 0}
|
||||
|
||||
// setLinger sets SO_Linger with 0 timeout to given fd
|
||||
func _setZeroLinger(fd int) error {
|
||||
return unix.SetsockoptLinger(fd, unix.SOL_SOCKET, unix.SO_LINGER, &zeroLinger)
|
||||
}
|
||||
|
||||
func createPoller() (fd int, err error) {
|
||||
fd, err = unix.EpollCreate1(unix.EPOLL_CLOEXEC)
|
||||
if err != nil {
|
||||
err = os.NewSyscallError("epoll_create1", err)
|
||||
}
|
||||
return fd, err
|
||||
}
|
||||
|
||||
// registerEvents registers given fd with read and write events.
|
||||
func registerEvents(pollerFd int, fd int) error {
|
||||
var event unix.EpollEvent
|
||||
event.Events = unix.EPOLLOUT | unix.EPOLLIN | unix.EPOLLET
|
||||
event.Fd = int32(fd)
|
||||
if err := unix.EpollCtl(pollerFd, unix.EPOLL_CTL_ADD, fd, &event); err != nil {
|
||||
return os.NewSyscallError(fmt.Sprintf("epoll_ctl(%d, ADD, %d, ...)", pollerFd, fd), err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func pollEvents(pollerFd int, timeout time.Duration) ([]event, error) {
|
||||
var timeoutMS = int(timeout.Nanoseconds() / 1e6)
|
||||
var epollEvents [maxEpollEvents]unix.EpollEvent
|
||||
// this blocks, waiting for socket events
|
||||
nEvents, err := unix.EpollWait(pollerFd, epollEvents[:], timeoutMS)
|
||||
if err != nil {
|
||||
if err == unix.EINTR {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, os.NewSyscallError("epoll_wait", err)
|
||||
}
|
||||
|
||||
var events = make([]event, 0, nEvents)
|
||||
|
||||
for i := 0; i < nEvents; i++ {
|
||||
var fd = int(epollEvents[i].Fd)
|
||||
var evt = event{Fd: fd, Err: nil}
|
||||
|
||||
errCode, err := unix.GetsockoptInt(fd, unix.SOL_SOCKET, unix.SO_ERROR)
|
||||
if err != nil {
|
||||
evt.Err = os.NewSyscallError("getsockopt", err)
|
||||
}
|
||||
if errCode != 0 {
|
||||
evt.Err = newErrConnect(errCode)
|
||||
}
|
||||
events = append(events, evt)
|
||||
}
|
||||
return events, nil
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build linux,!arm,!arm64,!ppc64,!ppc64le,!s390x
|
||||
|
||||
package cpu
|
||||
|
||||
func doinit() {}
|
|
@ -7,5 +7,3 @@
|
|||
package cpu
|
||||
|
||||
const cacheLineSize = 32
|
||||
|
||||
func doinit() {}
|
||||
|
|
|
@ -7,5 +7,3 @@
|
|||
package cpu
|
||||
|
||||
const cacheLineSize = 32
|
||||
|
||||
func doinit() {}
|
||||
|
|
|
@ -7,5 +7,3 @@
|
|||
package cpu
|
||||
|
||||
const cacheLineSize = 64
|
||||
|
||||
func doinit() {}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build riscv64
|
||||
|
||||
package cpu
|
||||
|
||||
const cacheLineSize = 32
|
|
@ -11,5 +11,3 @@ package cpu
|
|||
// rules are good enough.
|
||||
|
||||
const cacheLineSize = 0
|
||||
|
||||
func doinit() {}
|
||||
|
|
|
@ -23,6 +23,7 @@ const (
|
|||
HCI_CHANNEL_USER = 1
|
||||
HCI_CHANNEL_MONITOR = 2
|
||||
HCI_CHANNEL_CONTROL = 3
|
||||
HCI_CHANNEL_LOGGING = 4
|
||||
)
|
||||
|
||||
// Socketoption Level
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||
|
||||
package unix
|
||||
|
||||
// Set adds fd to the set fds.
|
||||
func (fds *FdSet) Set(fd int) {
|
||||
fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS))
|
||||
}
|
||||
|
||||
// Clear removes fd from the set fds.
|
||||
func (fds *FdSet) Clear(fd int) {
|
||||
fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS))
|
||||
}
|
||||
|
||||
// IsSet returns whether fd is in the set fds.
|
||||
func (fds *FdSet) IsSet(fd int) bool {
|
||||
return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0
|
||||
}
|
||||
|
||||
// Zero clears the set fds.
|
||||
func (fds *FdSet) Zero() {
|
||||
for i := range fds.Bits {
|
||||
fds.Bits[i] = 0
|
||||
}
|
||||
}
|
|
@ -190,6 +190,7 @@ struct ltchars {
|
|||
#include <linux/can.h>
|
||||
#include <linux/capability.h>
|
||||
#include <linux/cryptouser.h>
|
||||
#include <linux/devlink.h>
|
||||
#include <linux/errqueue.h>
|
||||
#include <linux/falloc.h>
|
||||
#include <linux/fanotify.h>
|
||||
|
@ -524,6 +525,7 @@ ccflags="$@"
|
|||
$2 ~ /^(HDIO|WIN|SMART)_/ ||
|
||||
$2 ~ /^CRYPTO_/ ||
|
||||
$2 ~ /^TIPC_/ ||
|
||||
$2 ~ /^DEVLINK_/ ||
|
||||
$2 !~ "WMESGLEN" &&
|
||||
$2 ~ /^W[A-Z0-9]+$/ ||
|
||||
$2 ~/^PPPIOC/ ||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
// 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.
|
||||
|
||||
package unix
|
||||
|
||||
// Round the length of a raw sockaddr up to align it properly.
|
||||
func cmsgAlignOf(salen int) int {
|
||||
salign := SizeofPtr
|
||||
if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) {
|
||||
// 64-bit Dragonfly before the September 2019 ABI changes still requires
|
||||
// 32-bit aligned access to network subsystem.
|
||||
salign = 4
|
||||
}
|
||||
return (salen + salign - 1) & ^(salign - 1)
|
||||
}
|
|
@ -17,7 +17,7 @@ func UnixCredentials(ucred *Ucred) []byte {
|
|||
h.Level = SOL_SOCKET
|
||||
h.Type = SCM_CREDENTIALS
|
||||
h.SetLen(CmsgLen(SizeofUcred))
|
||||
*((*Ucred)(cmsgData(h))) = *ucred
|
||||
*(*Ucred)(h.data(0)) = *ucred
|
||||
return b
|
||||
}
|
||||
|
||||
|
|
|
@ -9,35 +9,9 @@
|
|||
package unix
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// Round the length of a raw sockaddr up to align it properly.
|
||||
func cmsgAlignOf(salen int) int {
|
||||
salign := SizeofPtr
|
||||
|
||||
switch runtime.GOOS {
|
||||
case "aix":
|
||||
// There is no alignment on AIX.
|
||||
salign = 1
|
||||
case "darwin", "dragonfly", "solaris", "illumos":
|
||||
// NOTE: It seems like 64-bit Darwin, DragonFly BSD,
|
||||
// illumos, and Solaris kernels still require 32-bit
|
||||
// aligned access to network subsystem.
|
||||
if SizeofPtr == 8 {
|
||||
salign = 4
|
||||
}
|
||||
case "netbsd", "openbsd":
|
||||
// NetBSD and OpenBSD armv7 require 64-bit alignment.
|
||||
if runtime.GOARCH == "arm" {
|
||||
salign = 8
|
||||
}
|
||||
}
|
||||
|
||||
return (salen + salign - 1) & ^(salign - 1)
|
||||
}
|
||||
|
||||
// CmsgLen returns the value to store in the Len field of the Cmsghdr
|
||||
// structure, taking into account any necessary alignment.
|
||||
func CmsgLen(datalen int) int {
|
||||
|
@ -50,8 +24,8 @@ func CmsgSpace(datalen int) int {
|
|||
return cmsgAlignOf(SizeofCmsghdr) + cmsgAlignOf(datalen)
|
||||
}
|
||||
|
||||
func cmsgData(h *Cmsghdr) unsafe.Pointer {
|
||||
return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(SizeofCmsghdr)))
|
||||
func (h *Cmsghdr) data(offset uintptr) unsafe.Pointer {
|
||||
return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(SizeofCmsghdr)) + offset)
|
||||
}
|
||||
|
||||
// SocketControlMessage represents a socket control message.
|
||||
|
@ -94,10 +68,8 @@ func UnixRights(fds ...int) []byte {
|
|||
h.Level = SOL_SOCKET
|
||||
h.Type = SCM_RIGHTS
|
||||
h.SetLen(CmsgLen(datalen))
|
||||
data := cmsgData(h)
|
||||
for _, fd := range fds {
|
||||
*(*int32)(data) = int32(fd)
|
||||
data = unsafe.Pointer(uintptr(data) + 4)
|
||||
for i, fd := range fds {
|
||||
*(*int32)(h.data(4 * uintptr(i))) = int32(fd)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build aix darwin freebsd linux netbsd openbsd solaris
|
||||
|
||||
package unix
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
)
|
||||
|
||||
// Round the length of a raw sockaddr up to align it properly.
|
||||
func cmsgAlignOf(salen int) int {
|
||||
salign := SizeofPtr
|
||||
|
||||
// dragonfly needs to check ABI version at runtime, see cmsgAlignOf in
|
||||
// sockcmsg_dragonfly.go
|
||||
switch runtime.GOOS {
|
||||
case "aix":
|
||||
// There is no alignment on AIX.
|
||||
salign = 1
|
||||
case "darwin", "illumos", "solaris":
|
||||
// NOTE: It seems like 64-bit Darwin, Illumos and Solaris
|
||||
// kernels still require 32-bit aligned access to network
|
||||
// subsystem.
|
||||
if SizeofPtr == 8 {
|
||||
salign = 4
|
||||
}
|
||||
case "netbsd", "openbsd":
|
||||
// NetBSD and OpenBSD armv7 require 64-bit alignment.
|
||||
if runtime.GOARCH == "arm" {
|
||||
salign = 8
|
||||
}
|
||||
}
|
||||
|
||||
return (salen + salign - 1) & ^(salign - 1)
|
||||
}
|
|
@ -237,7 +237,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
|
|||
break
|
||||
}
|
||||
}
|
||||
bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
|
||||
bytes := (*[len(pp.Path)]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
|
||||
sa.Name = string(bytes)
|
||||
return sa, nil
|
||||
|
||||
|
|
|
@ -27,8 +27,6 @@ func libc_fdopendir_trampoline()
|
|||
|
||||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
||||
// Simulate Getdirentries using fdopendir/readdir_r/closedir.
|
||||
const ptrSize = unsafe.Sizeof(uintptr(0))
|
||||
|
||||
// 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
|
||||
|
|
|
@ -339,6 +339,8 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
|||
|
||||
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL
|
||||
|
||||
func Uname(uname *Utsname) error {
|
||||
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
|
||||
n := unsafe.Sizeof(uname.Sysname)
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
"syscall"
|
||||
)
|
||||
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
|
||||
|
||||
func setTimespec(sec, nsec int64) Timespec {
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
"syscall"
|
||||
)
|
||||
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
|
||||
|
||||
func setTimespec(sec, nsec int64) Timespec {
|
||||
|
|
|
@ -12,10 +12,6 @@ func ptrace(request int, pid int, addr uintptr, data uintptr) error {
|
|||
return ENOTSUP
|
||||
}
|
||||
|
||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error {
|
||||
return ENOTSUP
|
||||
}
|
||||
|
||||
func setTimespec(sec, nsec int64) Timespec {
|
||||
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
|
||||
}
|
||||
|
|
|
@ -14,10 +14,6 @@ func ptrace(request int, pid int, addr uintptr, data uintptr) error {
|
|||
return ENOTSUP
|
||||
}
|
||||
|
||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error {
|
||||
return ENOTSUP
|
||||
}
|
||||
|
||||
func setTimespec(sec, nsec int64) Timespec {
|
||||
return Timespec{Sec: sec, Nsec: nsec}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,25 @@
|
|||
|
||||
package unix
|
||||
|
||||
import "unsafe"
|
||||
import (
|
||||
"sync"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
// See version list in https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/sys/param.h
|
||||
var (
|
||||
osreldateOnce sync.Once
|
||||
osreldate uint32
|
||||
)
|
||||
|
||||
// First __DragonFly_version after September 2019 ABI changes
|
||||
// http://lists.dragonflybsd.org/pipermail/users/2019-September/358280.html
|
||||
const _dragonflyABIChangeVersion = 500705
|
||||
|
||||
func supportsABI(ver uint32) bool {
|
||||
osreldateOnce.Do(func() { osreldate, _ = SysctlUint32("kern.osreldate") })
|
||||
return osreldate >= ver
|
||||
}
|
||||
|
||||
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
|
||||
type SockaddrDatalink struct {
|
||||
|
@ -152,6 +168,8 @@ func setattrlistTimes(path string, times []Timespec, flags int) error {
|
|||
|
||||
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
|
||||
func sysctlUname(mib []_C_int, old *byte, oldlen *uintptr) error {
|
||||
err := sysctl(mib, old, oldlen, nil, 0)
|
||||
if err != nil {
|
||||
|
|
|
@ -36,8 +36,6 @@ var (
|
|||
// INO64_FIRST from /usr/src/lib/libc/sys/compat-ino64.h
|
||||
const _ino64First = 1200031
|
||||
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
|
||||
func supportsABI(ver uint32) bool {
|
||||
osreldateOnce.Do(func() { osreldate, _ = SysctlUint32("kern.osreldate") })
|
||||
return osreldate >= ver
|
||||
|
@ -203,6 +201,8 @@ func setattrlistTimes(path string, times []Timespec, flags int) error {
|
|||
|
||||
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
|
||||
func Uname(uname *Utsname) error {
|
||||
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
|
||||
n := unsafe.Sizeof(uname.Sysname)
|
||||
|
@ -462,8 +462,12 @@ func convertFromDirents11(buf []byte, old []byte) int {
|
|||
dstPos := 0
|
||||
srcPos := 0
|
||||
for dstPos+fixedSize < len(buf) && srcPos+oldFixedSize < len(old) {
|
||||
dstDirent := (*Dirent)(unsafe.Pointer(&buf[dstPos]))
|
||||
srcDirent := (*dirent_freebsd11)(unsafe.Pointer(&old[srcPos]))
|
||||
var dstDirent Dirent
|
||||
var srcDirent dirent_freebsd11
|
||||
|
||||
// If multiple direntries are written, sometimes when we reach the final one,
|
||||
// we may have cap of old less than size of dirent_freebsd11.
|
||||
copy((*[unsafe.Sizeof(srcDirent)]byte)(unsafe.Pointer(&srcDirent))[:], old[srcPos:])
|
||||
|
||||
reclen := roundup(fixedSize+int(srcDirent.Namlen)+1, 8)
|
||||
if dstPos+reclen > len(buf) {
|
||||
|
@ -479,6 +483,7 @@ func convertFromDirents11(buf []byte, old []byte) int {
|
|||
dstDirent.Pad1 = 0
|
||||
|
||||
copy(dstDirent.Name[:], srcDirent.Name[:srcDirent.Namlen])
|
||||
copy(buf[dstPos:], (*[unsafe.Sizeof(dstDirent)]byte)(unsafe.Pointer(&dstDirent))[:])
|
||||
padding := buf[dstPos+fixedSize+int(dstDirent.Namlen) : dstPos+reclen]
|
||||
for i := range padding {
|
||||
padding[i] = 0
|
||||
|
|
|
@ -884,7 +884,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
|
|||
for n < len(pp.Path) && pp.Path[n] != 0 {
|
||||
n++
|
||||
}
|
||||
bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
|
||||
bytes := (*[len(pp.Path)]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
|
||||
sa.Name = string(bytes)
|
||||
return sa, nil
|
||||
|
||||
|
|
|
@ -18,8 +18,6 @@ import (
|
|||
"unsafe"
|
||||
)
|
||||
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
|
||||
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
|
||||
type SockaddrDatalink struct {
|
||||
Len uint8
|
||||
|
@ -189,6 +187,8 @@ func setattrlistTimes(path string, times []Timespec, flags int) error {
|
|||
|
||||
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
|
||||
func IoctlGetPtmget(fd int, req uint) (*Ptmget, error) {
|
||||
var value Ptmget
|
||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||
|
|
|
@ -18,8 +18,6 @@ import (
|
|||
"unsafe"
|
||||
)
|
||||
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
|
||||
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
|
||||
type SockaddrDatalink struct {
|
||||
Len uint8
|
||||
|
@ -180,6 +178,8 @@ func setattrlistTimes(path string, times []Timespec, flags int) error {
|
|||
|
||||
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
|
||||
//sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error)
|
||||
|
||||
func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
|
||||
|
|
|
@ -391,7 +391,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
|
|||
for n < len(pp.Path) && pp.Path[n] != 0 {
|
||||
n++
|
||||
}
|
||||
bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
|
||||
bytes := (*[len(pp.Path)]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
|
||||
sa.Name = string(bytes)
|
||||
return sa, nil
|
||||
|
||||
|
|
|
@ -461,6 +461,12 @@ const (
|
|||
CSUSP = 0x1a
|
||||
DAXFS_MAGIC = 0x64646178
|
||||
DEBUGFS_MAGIC = 0x64626720
|
||||
DEVLINK_CMD_ESWITCH_MODE_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_MODE_SET = 0x1e
|
||||
DEVLINK_GENL_MCGRP_CONFIG_NAME = "config"
|
||||
DEVLINK_GENL_NAME = "devlink"
|
||||
DEVLINK_GENL_VERSION = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
||||
DEVPTS_SUPER_MAGIC = 0x1cd1
|
||||
DMA_BUF_MAGIC = 0x444d4142
|
||||
DT_BLK = 0x6
|
||||
|
|
|
@ -461,6 +461,12 @@ const (
|
|||
CSUSP = 0x1a
|
||||
DAXFS_MAGIC = 0x64646178
|
||||
DEBUGFS_MAGIC = 0x64626720
|
||||
DEVLINK_CMD_ESWITCH_MODE_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_MODE_SET = 0x1e
|
||||
DEVLINK_GENL_MCGRP_CONFIG_NAME = "config"
|
||||
DEVLINK_GENL_NAME = "devlink"
|
||||
DEVLINK_GENL_VERSION = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
||||
DEVPTS_SUPER_MAGIC = 0x1cd1
|
||||
DMA_BUF_MAGIC = 0x444d4142
|
||||
DT_BLK = 0x6
|
||||
|
|
|
@ -461,6 +461,12 @@ const (
|
|||
CSUSP = 0x1a
|
||||
DAXFS_MAGIC = 0x64646178
|
||||
DEBUGFS_MAGIC = 0x64626720
|
||||
DEVLINK_CMD_ESWITCH_MODE_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_MODE_SET = 0x1e
|
||||
DEVLINK_GENL_MCGRP_CONFIG_NAME = "config"
|
||||
DEVLINK_GENL_NAME = "devlink"
|
||||
DEVLINK_GENL_VERSION = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
||||
DEVPTS_SUPER_MAGIC = 0x1cd1
|
||||
DMA_BUF_MAGIC = 0x444d4142
|
||||
DT_BLK = 0x6
|
||||
|
|
|
@ -461,6 +461,12 @@ const (
|
|||
CSUSP = 0x1a
|
||||
DAXFS_MAGIC = 0x64646178
|
||||
DEBUGFS_MAGIC = 0x64626720
|
||||
DEVLINK_CMD_ESWITCH_MODE_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_MODE_SET = 0x1e
|
||||
DEVLINK_GENL_MCGRP_CONFIG_NAME = "config"
|
||||
DEVLINK_GENL_NAME = "devlink"
|
||||
DEVLINK_GENL_VERSION = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
||||
DEVPTS_SUPER_MAGIC = 0x1cd1
|
||||
DMA_BUF_MAGIC = 0x444d4142
|
||||
DT_BLK = 0x6
|
||||
|
|
|
@ -461,6 +461,12 @@ const (
|
|||
CSUSP = 0x1a
|
||||
DAXFS_MAGIC = 0x64646178
|
||||
DEBUGFS_MAGIC = 0x64626720
|
||||
DEVLINK_CMD_ESWITCH_MODE_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_MODE_SET = 0x1e
|
||||
DEVLINK_GENL_MCGRP_CONFIG_NAME = "config"
|
||||
DEVLINK_GENL_NAME = "devlink"
|
||||
DEVLINK_GENL_VERSION = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
||||
DEVPTS_SUPER_MAGIC = 0x1cd1
|
||||
DMA_BUF_MAGIC = 0x444d4142
|
||||
DT_BLK = 0x6
|
||||
|
|
|
@ -461,6 +461,12 @@ const (
|
|||
CSUSP = 0x1a
|
||||
DAXFS_MAGIC = 0x64646178
|
||||
DEBUGFS_MAGIC = 0x64626720
|
||||
DEVLINK_CMD_ESWITCH_MODE_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_MODE_SET = 0x1e
|
||||
DEVLINK_GENL_MCGRP_CONFIG_NAME = "config"
|
||||
DEVLINK_GENL_NAME = "devlink"
|
||||
DEVLINK_GENL_VERSION = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
||||
DEVPTS_SUPER_MAGIC = 0x1cd1
|
||||
DMA_BUF_MAGIC = 0x444d4142
|
||||
DT_BLK = 0x6
|
||||
|
|
|
@ -461,6 +461,12 @@ const (
|
|||
CSUSP = 0x1a
|
||||
DAXFS_MAGIC = 0x64646178
|
||||
DEBUGFS_MAGIC = 0x64626720
|
||||
DEVLINK_CMD_ESWITCH_MODE_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_MODE_SET = 0x1e
|
||||
DEVLINK_GENL_MCGRP_CONFIG_NAME = "config"
|
||||
DEVLINK_GENL_NAME = "devlink"
|
||||
DEVLINK_GENL_VERSION = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
||||
DEVPTS_SUPER_MAGIC = 0x1cd1
|
||||
DMA_BUF_MAGIC = 0x444d4142
|
||||
DT_BLK = 0x6
|
||||
|
|
|
@ -461,6 +461,12 @@ const (
|
|||
CSUSP = 0x1a
|
||||
DAXFS_MAGIC = 0x64646178
|
||||
DEBUGFS_MAGIC = 0x64626720
|
||||
DEVLINK_CMD_ESWITCH_MODE_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_MODE_SET = 0x1e
|
||||
DEVLINK_GENL_MCGRP_CONFIG_NAME = "config"
|
||||
DEVLINK_GENL_NAME = "devlink"
|
||||
DEVLINK_GENL_VERSION = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
||||
DEVPTS_SUPER_MAGIC = 0x1cd1
|
||||
DMA_BUF_MAGIC = 0x444d4142
|
||||
DT_BLK = 0x6
|
||||
|
|
|
@ -461,6 +461,12 @@ const (
|
|||
CSUSP = 0x1a
|
||||
DAXFS_MAGIC = 0x64646178
|
||||
DEBUGFS_MAGIC = 0x64626720
|
||||
DEVLINK_CMD_ESWITCH_MODE_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_MODE_SET = 0x1e
|
||||
DEVLINK_GENL_MCGRP_CONFIG_NAME = "config"
|
||||
DEVLINK_GENL_NAME = "devlink"
|
||||
DEVLINK_GENL_VERSION = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
||||
DEVPTS_SUPER_MAGIC = 0x1cd1
|
||||
DMA_BUF_MAGIC = 0x444d4142
|
||||
DT_BLK = 0x6
|
||||
|
|
|
@ -461,6 +461,12 @@ const (
|
|||
CSUSP = 0x1a
|
||||
DAXFS_MAGIC = 0x64646178
|
||||
DEBUGFS_MAGIC = 0x64626720
|
||||
DEVLINK_CMD_ESWITCH_MODE_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_MODE_SET = 0x1e
|
||||
DEVLINK_GENL_MCGRP_CONFIG_NAME = "config"
|
||||
DEVLINK_GENL_NAME = "devlink"
|
||||
DEVLINK_GENL_VERSION = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
||||
DEVPTS_SUPER_MAGIC = 0x1cd1
|
||||
DMA_BUF_MAGIC = 0x444d4142
|
||||
DT_BLK = 0x6
|
||||
|
|
|
@ -461,6 +461,12 @@ const (
|
|||
CSUSP = 0x1a
|
||||
DAXFS_MAGIC = 0x64646178
|
||||
DEBUGFS_MAGIC = 0x64626720
|
||||
DEVLINK_CMD_ESWITCH_MODE_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_MODE_SET = 0x1e
|
||||
DEVLINK_GENL_MCGRP_CONFIG_NAME = "config"
|
||||
DEVLINK_GENL_NAME = "devlink"
|
||||
DEVLINK_GENL_VERSION = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
||||
DEVPTS_SUPER_MAGIC = 0x1cd1
|
||||
DMA_BUF_MAGIC = 0x444d4142
|
||||
DT_BLK = 0x6
|
||||
|
|
|
@ -461,6 +461,12 @@ const (
|
|||
CSUSP = 0x1a
|
||||
DAXFS_MAGIC = 0x64646178
|
||||
DEBUGFS_MAGIC = 0x64626720
|
||||
DEVLINK_CMD_ESWITCH_MODE_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_MODE_SET = 0x1e
|
||||
DEVLINK_GENL_MCGRP_CONFIG_NAME = "config"
|
||||
DEVLINK_GENL_NAME = "devlink"
|
||||
DEVLINK_GENL_VERSION = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
||||
DEVPTS_SUPER_MAGIC = 0x1cd1
|
||||
DMA_BUF_MAGIC = 0x444d4142
|
||||
DT_BLK = 0x6
|
||||
|
|
|
@ -464,6 +464,12 @@ const (
|
|||
CSUSP = 0x1a
|
||||
DAXFS_MAGIC = 0x64646178
|
||||
DEBUGFS_MAGIC = 0x64626720
|
||||
DEVLINK_CMD_ESWITCH_MODE_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_MODE_SET = 0x1e
|
||||
DEVLINK_GENL_MCGRP_CONFIG_NAME = "config"
|
||||
DEVLINK_GENL_NAME = "devlink"
|
||||
DEVLINK_GENL_VERSION = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
||||
DEVPTS_SUPER_MAGIC = 0x1cd1
|
||||
DMA_BUF_MAGIC = 0x444d4142
|
||||
DT_BLK = 0x6
|
||||
|
|
|
@ -547,6 +547,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(mib) > 0 {
|
||||
_p0 = unsafe.Pointer(&mib[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
||||
_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(offset>>32), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags), 0, 0)
|
||||
if e1 != 0 {
|
||||
|
@ -1683,22 +1699,6 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(mib) > 0 {
|
||||
_p0 = unsafe.Pointer(&mib[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||
if e1 != 0 {
|
||||
|
|
|
@ -757,6 +757,27 @@ func libc_ioctl_trampoline()
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(mib) > 0 {
|
||||
_p0 = unsafe.Pointer(&mib[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := syscall_syscall6(funcPC(libc_sysctl_trampoline), uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_sysctl_trampoline()
|
||||
|
||||
//go:linkname libc_sysctl libc_sysctl
|
||||
//go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
||||
_, _, e1 := syscall_syscall9(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(offset>>32), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags), 0, 0)
|
||||
if e1 != 0 {
|
||||
|
@ -2321,27 +2342,6 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(mib) > 0 {
|
||||
_p0 = unsafe.Pointer(&mib[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := syscall_syscall6(funcPC(libc___sysctl_trampoline), uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc___sysctl_trampoline()
|
||||
|
||||
//go:linkname libc___sysctl libc___sysctl
|
||||
//go:cgo_import_dynamic libc___sysctl __sysctl "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||
_, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||
if e1 != 0 {
|
||||
|
|
|
@ -88,6 +88,8 @@ TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_kill(SB)
|
||||
TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ioctl(SB)
|
||||
TEXT ·libc_sysctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sysctl(SB)
|
||||
TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendfile(SB)
|
||||
TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0
|
||||
|
@ -104,8 +106,6 @@ TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_chown(SB)
|
||||
TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chroot(SB)
|
||||
TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_clock_gettime(SB)
|
||||
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_close(SB)
|
||||
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
||||
|
@ -262,8 +262,6 @@ TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_mmap(SB)
|
||||
TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_munmap(SB)
|
||||
TEXT ·libc___sysctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc___sysctl(SB)
|
||||
TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ptrace(SB)
|
||||
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
||||
|
|
|
@ -547,6 +547,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(mib) > 0 {
|
||||
_p0 = unsafe.Pointer(&mib[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
||||
_, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
|
||||
if e1 != 0 {
|
||||
|
@ -1683,22 +1699,6 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(mib) > 0 {
|
||||
_p0 = unsafe.Pointer(&mib[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||
if e1 != 0 {
|
||||
|
|
|
@ -757,6 +757,27 @@ func libc_ioctl_trampoline()
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(mib) > 0 {
|
||||
_p0 = unsafe.Pointer(&mib[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := syscall_syscall6(funcPC(libc_sysctl_trampoline), uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_sysctl_trampoline()
|
||||
|
||||
//go:linkname libc_sysctl libc_sysctl
|
||||
//go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
||||
_, _, e1 := syscall_syscall6(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
|
||||
if e1 != 0 {
|
||||
|
@ -2321,27 +2342,6 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(mib) > 0 {
|
||||
_p0 = unsafe.Pointer(&mib[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := syscall_syscall6(funcPC(libc___sysctl_trampoline), uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc___sysctl_trampoline()
|
||||
|
||||
//go:linkname libc___sysctl libc___sysctl
|
||||
//go:cgo_import_dynamic libc___sysctl __sysctl "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||
_, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||
if e1 != 0 {
|
||||
|
|
|
@ -88,6 +88,8 @@ TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_kill(SB)
|
||||
TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ioctl(SB)
|
||||
TEXT ·libc_sysctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sysctl(SB)
|
||||
TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendfile(SB)
|
||||
TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0
|
||||
|
@ -262,8 +264,6 @@ TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_mmap(SB)
|
||||
TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_munmap(SB)
|
||||
TEXT ·libc___sysctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc___sysctl(SB)
|
||||
TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ptrace(SB)
|
||||
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
||||
|
|
|
@ -547,6 +547,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(mib) > 0 {
|
||||
_p0 = unsafe.Pointer(&mib[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
||||
_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(offset>>32), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags), 0, 0)
|
||||
if e1 != 0 {
|
||||
|
|
|
@ -757,6 +757,27 @@ func libc_ioctl_trampoline()
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(mib) > 0 {
|
||||
_p0 = unsafe.Pointer(&mib[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := syscall_syscall6(funcPC(libc_sysctl_trampoline), uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_sysctl_trampoline()
|
||||
|
||||
//go:linkname libc_sysctl libc_sysctl
|
||||
//go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
||||
_, _, e1 := syscall_syscall9(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(offset>>32), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags), 0, 0)
|
||||
if e1 != 0 {
|
||||
|
|
|
@ -547,6 +547,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(mib) > 0 {
|
||||
_p0 = unsafe.Pointer(&mib[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
||||
_, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
|
||||
if e1 != 0 {
|
||||
|
|
|
@ -757,6 +757,27 @@ func libc_ioctl_trampoline()
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(mib) > 0 {
|
||||
_p0 = unsafe.Pointer(&mib[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := syscall_syscall6(funcPC(libc_sysctl_trampoline), uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_sysctl_trampoline()
|
||||
|
||||
//go:linkname libc_sysctl libc_sysctl
|
||||
//go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
||||
_, _, e1 := syscall_syscall6(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
|
||||
if e1 != 0 {
|
||||
|
|
|
@ -88,6 +88,8 @@ TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_kill(SB)
|
||||
TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ioctl(SB)
|
||||
TEXT ·libc_sysctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sysctl(SB)
|
||||
TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendfile(SB)
|
||||
TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0
|
||||
|
@ -104,8 +106,6 @@ TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_chown(SB)
|
||||
TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chroot(SB)
|
||||
TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_clock_gettime(SB)
|
||||
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_close(SB)
|
||||
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
||||
|
|
|
@ -397,7 +397,7 @@ type Reg struct {
|
|||
}
|
||||
|
||||
type FpReg struct {
|
||||
Fp_q [32]uint128
|
||||
Fp_q [512]uint8
|
||||
Fp_sr uint32
|
||||
Fp_cr uint32
|
||||
}
|
||||
|
|
|
@ -2626,3 +2626,132 @@ const (
|
|||
SYSLOG_ACTION_SIZE_UNREAD = 9
|
||||
SYSLOG_ACTION_SIZE_BUFFER = 10
|
||||
)
|
||||
|
||||
const (
|
||||
DEVLINK_CMD_UNSPEC = 0x0
|
||||
DEVLINK_CMD_GET = 0x1
|
||||
DEVLINK_CMD_SET = 0x2
|
||||
DEVLINK_CMD_NEW = 0x3
|
||||
DEVLINK_CMD_DEL = 0x4
|
||||
DEVLINK_CMD_PORT_GET = 0x5
|
||||
DEVLINK_CMD_PORT_SET = 0x6
|
||||
DEVLINK_CMD_PORT_NEW = 0x7
|
||||
DEVLINK_CMD_PORT_DEL = 0x8
|
||||
DEVLINK_CMD_PORT_SPLIT = 0x9
|
||||
DEVLINK_CMD_PORT_UNSPLIT = 0xa
|
||||
DEVLINK_CMD_SB_GET = 0xb
|
||||
DEVLINK_CMD_SB_SET = 0xc
|
||||
DEVLINK_CMD_SB_NEW = 0xd
|
||||
DEVLINK_CMD_SB_DEL = 0xe
|
||||
DEVLINK_CMD_SB_POOL_GET = 0xf
|
||||
DEVLINK_CMD_SB_POOL_SET = 0x10
|
||||
DEVLINK_CMD_SB_POOL_NEW = 0x11
|
||||
DEVLINK_CMD_SB_POOL_DEL = 0x12
|
||||
DEVLINK_CMD_SB_PORT_POOL_GET = 0x13
|
||||
DEVLINK_CMD_SB_PORT_POOL_SET = 0x14
|
||||
DEVLINK_CMD_SB_PORT_POOL_NEW = 0x15
|
||||
DEVLINK_CMD_SB_PORT_POOL_DEL = 0x16
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_GET = 0x17
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_SET = 0x18
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_NEW = 0x19
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_DEL = 0x1a
|
||||
DEVLINK_CMD_SB_OCC_SNAPSHOT = 0x1b
|
||||
DEVLINK_CMD_SB_OCC_MAX_CLEAR = 0x1c
|
||||
DEVLINK_CMD_ESWITCH_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_SET = 0x1e
|
||||
DEVLINK_CMD_DPIPE_TABLE_GET = 0x1f
|
||||
DEVLINK_CMD_DPIPE_ENTRIES_GET = 0x20
|
||||
DEVLINK_CMD_DPIPE_HEADERS_GET = 0x21
|
||||
DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET = 0x22
|
||||
DEVLINK_CMD_MAX = 0x3c
|
||||
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
||||
DEVLINK_PORT_TYPE_AUTO = 0x1
|
||||
DEVLINK_PORT_TYPE_ETH = 0x2
|
||||
DEVLINK_PORT_TYPE_IB = 0x3
|
||||
DEVLINK_SB_POOL_TYPE_INGRESS = 0x0
|
||||
DEVLINK_SB_POOL_TYPE_EGRESS = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TYPE_STATIC = 0x0
|
||||
DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC = 0x1
|
||||
DEVLINK_ESWITCH_MODE_LEGACY = 0x0
|
||||
DEVLINK_ESWITCH_MODE_SWITCHDEV = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_INLINE_MODE_LINK = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NETWORK = 0x2
|
||||
DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 0x3
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 0x1
|
||||
DEVLINK_ATTR_UNSPEC = 0x0
|
||||
DEVLINK_ATTR_BUS_NAME = 0x1
|
||||
DEVLINK_ATTR_DEV_NAME = 0x2
|
||||
DEVLINK_ATTR_PORT_INDEX = 0x3
|
||||
DEVLINK_ATTR_PORT_TYPE = 0x4
|
||||
DEVLINK_ATTR_PORT_DESIRED_TYPE = 0x5
|
||||
DEVLINK_ATTR_PORT_NETDEV_IFINDEX = 0x6
|
||||
DEVLINK_ATTR_PORT_NETDEV_NAME = 0x7
|
||||
DEVLINK_ATTR_PORT_IBDEV_NAME = 0x8
|
||||
DEVLINK_ATTR_PORT_SPLIT_COUNT = 0x9
|
||||
DEVLINK_ATTR_PORT_SPLIT_GROUP = 0xa
|
||||
DEVLINK_ATTR_SB_INDEX = 0xb
|
||||
DEVLINK_ATTR_SB_SIZE = 0xc
|
||||
DEVLINK_ATTR_SB_INGRESS_POOL_COUNT = 0xd
|
||||
DEVLINK_ATTR_SB_EGRESS_POOL_COUNT = 0xe
|
||||
DEVLINK_ATTR_SB_INGRESS_TC_COUNT = 0xf
|
||||
DEVLINK_ATTR_SB_EGRESS_TC_COUNT = 0x10
|
||||
DEVLINK_ATTR_SB_POOL_INDEX = 0x11
|
||||
DEVLINK_ATTR_SB_POOL_TYPE = 0x12
|
||||
DEVLINK_ATTR_SB_POOL_SIZE = 0x13
|
||||
DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE = 0x14
|
||||
DEVLINK_ATTR_SB_THRESHOLD = 0x15
|
||||
DEVLINK_ATTR_SB_TC_INDEX = 0x16
|
||||
DEVLINK_ATTR_SB_OCC_CUR = 0x17
|
||||
DEVLINK_ATTR_SB_OCC_MAX = 0x18
|
||||
DEVLINK_ATTR_ESWITCH_MODE = 0x19
|
||||
DEVLINK_ATTR_ESWITCH_INLINE_MODE = 0x1a
|
||||
DEVLINK_ATTR_DPIPE_TABLES = 0x1b
|
||||
DEVLINK_ATTR_DPIPE_TABLE = 0x1c
|
||||
DEVLINK_ATTR_DPIPE_TABLE_NAME = 0x1d
|
||||
DEVLINK_ATTR_DPIPE_TABLE_SIZE = 0x1e
|
||||
DEVLINK_ATTR_DPIPE_TABLE_MATCHES = 0x1f
|
||||
DEVLINK_ATTR_DPIPE_TABLE_ACTIONS = 0x20
|
||||
DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED = 0x21
|
||||
DEVLINK_ATTR_DPIPE_ENTRIES = 0x22
|
||||
DEVLINK_ATTR_DPIPE_ENTRY = 0x23
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_INDEX = 0x24
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES = 0x25
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES = 0x26
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_COUNTER = 0x27
|
||||
DEVLINK_ATTR_DPIPE_MATCH = 0x28
|
||||
DEVLINK_ATTR_DPIPE_MATCH_VALUE = 0x29
|
||||
DEVLINK_ATTR_DPIPE_MATCH_TYPE = 0x2a
|
||||
DEVLINK_ATTR_DPIPE_ACTION = 0x2b
|
||||
DEVLINK_ATTR_DPIPE_ACTION_VALUE = 0x2c
|
||||
DEVLINK_ATTR_DPIPE_ACTION_TYPE = 0x2d
|
||||
DEVLINK_ATTR_DPIPE_VALUE = 0x2e
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MASK = 0x2f
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MAPPING = 0x30
|
||||
DEVLINK_ATTR_DPIPE_HEADERS = 0x31
|
||||
DEVLINK_ATTR_DPIPE_HEADER = 0x32
|
||||
DEVLINK_ATTR_DPIPE_HEADER_NAME = 0x33
|
||||
DEVLINK_ATTR_DPIPE_HEADER_ID = 0x34
|
||||
DEVLINK_ATTR_DPIPE_HEADER_FIELDS = 0x35
|
||||
DEVLINK_ATTR_DPIPE_HEADER_GLOBAL = 0x36
|
||||
DEVLINK_ATTR_DPIPE_HEADER_INDEX = 0x37
|
||||
DEVLINK_ATTR_DPIPE_FIELD = 0x38
|
||||
DEVLINK_ATTR_DPIPE_FIELD_NAME = 0x39
|
||||
DEVLINK_ATTR_DPIPE_FIELD_ID = 0x3a
|
||||
DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH = 0x3b
|
||||
DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c
|
||||
DEVLINK_ATTR_PAD = 0x3d
|
||||
DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e
|
||||
DEVLINK_ATTR_MAX = 0x80
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
|
||||
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
|
||||
DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY = 0x0
|
||||
DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV4_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV6_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_HEADER_ETHERNET = 0x0
|
||||
DEVLINK_DPIPE_HEADER_IPV4 = 0x1
|
||||
DEVLINK_DPIPE_HEADER_IPV6 = 0x2
|
||||
)
|
||||
|
|
|
@ -2640,3 +2640,132 @@ const (
|
|||
SYSLOG_ACTION_SIZE_UNREAD = 9
|
||||
SYSLOG_ACTION_SIZE_BUFFER = 10
|
||||
)
|
||||
|
||||
const (
|
||||
DEVLINK_CMD_UNSPEC = 0x0
|
||||
DEVLINK_CMD_GET = 0x1
|
||||
DEVLINK_CMD_SET = 0x2
|
||||
DEVLINK_CMD_NEW = 0x3
|
||||
DEVLINK_CMD_DEL = 0x4
|
||||
DEVLINK_CMD_PORT_GET = 0x5
|
||||
DEVLINK_CMD_PORT_SET = 0x6
|
||||
DEVLINK_CMD_PORT_NEW = 0x7
|
||||
DEVLINK_CMD_PORT_DEL = 0x8
|
||||
DEVLINK_CMD_PORT_SPLIT = 0x9
|
||||
DEVLINK_CMD_PORT_UNSPLIT = 0xa
|
||||
DEVLINK_CMD_SB_GET = 0xb
|
||||
DEVLINK_CMD_SB_SET = 0xc
|
||||
DEVLINK_CMD_SB_NEW = 0xd
|
||||
DEVLINK_CMD_SB_DEL = 0xe
|
||||
DEVLINK_CMD_SB_POOL_GET = 0xf
|
||||
DEVLINK_CMD_SB_POOL_SET = 0x10
|
||||
DEVLINK_CMD_SB_POOL_NEW = 0x11
|
||||
DEVLINK_CMD_SB_POOL_DEL = 0x12
|
||||
DEVLINK_CMD_SB_PORT_POOL_GET = 0x13
|
||||
DEVLINK_CMD_SB_PORT_POOL_SET = 0x14
|
||||
DEVLINK_CMD_SB_PORT_POOL_NEW = 0x15
|
||||
DEVLINK_CMD_SB_PORT_POOL_DEL = 0x16
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_GET = 0x17
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_SET = 0x18
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_NEW = 0x19
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_DEL = 0x1a
|
||||
DEVLINK_CMD_SB_OCC_SNAPSHOT = 0x1b
|
||||
DEVLINK_CMD_SB_OCC_MAX_CLEAR = 0x1c
|
||||
DEVLINK_CMD_ESWITCH_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_SET = 0x1e
|
||||
DEVLINK_CMD_DPIPE_TABLE_GET = 0x1f
|
||||
DEVLINK_CMD_DPIPE_ENTRIES_GET = 0x20
|
||||
DEVLINK_CMD_DPIPE_HEADERS_GET = 0x21
|
||||
DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET = 0x22
|
||||
DEVLINK_CMD_MAX = 0x3c
|
||||
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
||||
DEVLINK_PORT_TYPE_AUTO = 0x1
|
||||
DEVLINK_PORT_TYPE_ETH = 0x2
|
||||
DEVLINK_PORT_TYPE_IB = 0x3
|
||||
DEVLINK_SB_POOL_TYPE_INGRESS = 0x0
|
||||
DEVLINK_SB_POOL_TYPE_EGRESS = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TYPE_STATIC = 0x0
|
||||
DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC = 0x1
|
||||
DEVLINK_ESWITCH_MODE_LEGACY = 0x0
|
||||
DEVLINK_ESWITCH_MODE_SWITCHDEV = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_INLINE_MODE_LINK = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NETWORK = 0x2
|
||||
DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 0x3
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 0x1
|
||||
DEVLINK_ATTR_UNSPEC = 0x0
|
||||
DEVLINK_ATTR_BUS_NAME = 0x1
|
||||
DEVLINK_ATTR_DEV_NAME = 0x2
|
||||
DEVLINK_ATTR_PORT_INDEX = 0x3
|
||||
DEVLINK_ATTR_PORT_TYPE = 0x4
|
||||
DEVLINK_ATTR_PORT_DESIRED_TYPE = 0x5
|
||||
DEVLINK_ATTR_PORT_NETDEV_IFINDEX = 0x6
|
||||
DEVLINK_ATTR_PORT_NETDEV_NAME = 0x7
|
||||
DEVLINK_ATTR_PORT_IBDEV_NAME = 0x8
|
||||
DEVLINK_ATTR_PORT_SPLIT_COUNT = 0x9
|
||||
DEVLINK_ATTR_PORT_SPLIT_GROUP = 0xa
|
||||
DEVLINK_ATTR_SB_INDEX = 0xb
|
||||
DEVLINK_ATTR_SB_SIZE = 0xc
|
||||
DEVLINK_ATTR_SB_INGRESS_POOL_COUNT = 0xd
|
||||
DEVLINK_ATTR_SB_EGRESS_POOL_COUNT = 0xe
|
||||
DEVLINK_ATTR_SB_INGRESS_TC_COUNT = 0xf
|
||||
DEVLINK_ATTR_SB_EGRESS_TC_COUNT = 0x10
|
||||
DEVLINK_ATTR_SB_POOL_INDEX = 0x11
|
||||
DEVLINK_ATTR_SB_POOL_TYPE = 0x12
|
||||
DEVLINK_ATTR_SB_POOL_SIZE = 0x13
|
||||
DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE = 0x14
|
||||
DEVLINK_ATTR_SB_THRESHOLD = 0x15
|
||||
DEVLINK_ATTR_SB_TC_INDEX = 0x16
|
||||
DEVLINK_ATTR_SB_OCC_CUR = 0x17
|
||||
DEVLINK_ATTR_SB_OCC_MAX = 0x18
|
||||
DEVLINK_ATTR_ESWITCH_MODE = 0x19
|
||||
DEVLINK_ATTR_ESWITCH_INLINE_MODE = 0x1a
|
||||
DEVLINK_ATTR_DPIPE_TABLES = 0x1b
|
||||
DEVLINK_ATTR_DPIPE_TABLE = 0x1c
|
||||
DEVLINK_ATTR_DPIPE_TABLE_NAME = 0x1d
|
||||
DEVLINK_ATTR_DPIPE_TABLE_SIZE = 0x1e
|
||||
DEVLINK_ATTR_DPIPE_TABLE_MATCHES = 0x1f
|
||||
DEVLINK_ATTR_DPIPE_TABLE_ACTIONS = 0x20
|
||||
DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED = 0x21
|
||||
DEVLINK_ATTR_DPIPE_ENTRIES = 0x22
|
||||
DEVLINK_ATTR_DPIPE_ENTRY = 0x23
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_INDEX = 0x24
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES = 0x25
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES = 0x26
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_COUNTER = 0x27
|
||||
DEVLINK_ATTR_DPIPE_MATCH = 0x28
|
||||
DEVLINK_ATTR_DPIPE_MATCH_VALUE = 0x29
|
||||
DEVLINK_ATTR_DPIPE_MATCH_TYPE = 0x2a
|
||||
DEVLINK_ATTR_DPIPE_ACTION = 0x2b
|
||||
DEVLINK_ATTR_DPIPE_ACTION_VALUE = 0x2c
|
||||
DEVLINK_ATTR_DPIPE_ACTION_TYPE = 0x2d
|
||||
DEVLINK_ATTR_DPIPE_VALUE = 0x2e
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MASK = 0x2f
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MAPPING = 0x30
|
||||
DEVLINK_ATTR_DPIPE_HEADERS = 0x31
|
||||
DEVLINK_ATTR_DPIPE_HEADER = 0x32
|
||||
DEVLINK_ATTR_DPIPE_HEADER_NAME = 0x33
|
||||
DEVLINK_ATTR_DPIPE_HEADER_ID = 0x34
|
||||
DEVLINK_ATTR_DPIPE_HEADER_FIELDS = 0x35
|
||||
DEVLINK_ATTR_DPIPE_HEADER_GLOBAL = 0x36
|
||||
DEVLINK_ATTR_DPIPE_HEADER_INDEX = 0x37
|
||||
DEVLINK_ATTR_DPIPE_FIELD = 0x38
|
||||
DEVLINK_ATTR_DPIPE_FIELD_NAME = 0x39
|
||||
DEVLINK_ATTR_DPIPE_FIELD_ID = 0x3a
|
||||
DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH = 0x3b
|
||||
DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c
|
||||
DEVLINK_ATTR_PAD = 0x3d
|
||||
DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e
|
||||
DEVLINK_ATTR_MAX = 0x80
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
|
||||
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
|
||||
DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY = 0x0
|
||||
DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV4_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV6_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_HEADER_ETHERNET = 0x0
|
||||
DEVLINK_DPIPE_HEADER_IPV4 = 0x1
|
||||
DEVLINK_DPIPE_HEADER_IPV6 = 0x2
|
||||
)
|
||||
|
|
|
@ -2617,3 +2617,132 @@ const (
|
|||
SYSLOG_ACTION_SIZE_UNREAD = 9
|
||||
SYSLOG_ACTION_SIZE_BUFFER = 10
|
||||
)
|
||||
|
||||
const (
|
||||
DEVLINK_CMD_UNSPEC = 0x0
|
||||
DEVLINK_CMD_GET = 0x1
|
||||
DEVLINK_CMD_SET = 0x2
|
||||
DEVLINK_CMD_NEW = 0x3
|
||||
DEVLINK_CMD_DEL = 0x4
|
||||
DEVLINK_CMD_PORT_GET = 0x5
|
||||
DEVLINK_CMD_PORT_SET = 0x6
|
||||
DEVLINK_CMD_PORT_NEW = 0x7
|
||||
DEVLINK_CMD_PORT_DEL = 0x8
|
||||
DEVLINK_CMD_PORT_SPLIT = 0x9
|
||||
DEVLINK_CMD_PORT_UNSPLIT = 0xa
|
||||
DEVLINK_CMD_SB_GET = 0xb
|
||||
DEVLINK_CMD_SB_SET = 0xc
|
||||
DEVLINK_CMD_SB_NEW = 0xd
|
||||
DEVLINK_CMD_SB_DEL = 0xe
|
||||
DEVLINK_CMD_SB_POOL_GET = 0xf
|
||||
DEVLINK_CMD_SB_POOL_SET = 0x10
|
||||
DEVLINK_CMD_SB_POOL_NEW = 0x11
|
||||
DEVLINK_CMD_SB_POOL_DEL = 0x12
|
||||
DEVLINK_CMD_SB_PORT_POOL_GET = 0x13
|
||||
DEVLINK_CMD_SB_PORT_POOL_SET = 0x14
|
||||
DEVLINK_CMD_SB_PORT_POOL_NEW = 0x15
|
||||
DEVLINK_CMD_SB_PORT_POOL_DEL = 0x16
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_GET = 0x17
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_SET = 0x18
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_NEW = 0x19
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_DEL = 0x1a
|
||||
DEVLINK_CMD_SB_OCC_SNAPSHOT = 0x1b
|
||||
DEVLINK_CMD_SB_OCC_MAX_CLEAR = 0x1c
|
||||
DEVLINK_CMD_ESWITCH_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_SET = 0x1e
|
||||
DEVLINK_CMD_DPIPE_TABLE_GET = 0x1f
|
||||
DEVLINK_CMD_DPIPE_ENTRIES_GET = 0x20
|
||||
DEVLINK_CMD_DPIPE_HEADERS_GET = 0x21
|
||||
DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET = 0x22
|
||||
DEVLINK_CMD_MAX = 0x3c
|
||||
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
||||
DEVLINK_PORT_TYPE_AUTO = 0x1
|
||||
DEVLINK_PORT_TYPE_ETH = 0x2
|
||||
DEVLINK_PORT_TYPE_IB = 0x3
|
||||
DEVLINK_SB_POOL_TYPE_INGRESS = 0x0
|
||||
DEVLINK_SB_POOL_TYPE_EGRESS = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TYPE_STATIC = 0x0
|
||||
DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC = 0x1
|
||||
DEVLINK_ESWITCH_MODE_LEGACY = 0x0
|
||||
DEVLINK_ESWITCH_MODE_SWITCHDEV = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_INLINE_MODE_LINK = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NETWORK = 0x2
|
||||
DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 0x3
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 0x1
|
||||
DEVLINK_ATTR_UNSPEC = 0x0
|
||||
DEVLINK_ATTR_BUS_NAME = 0x1
|
||||
DEVLINK_ATTR_DEV_NAME = 0x2
|
||||
DEVLINK_ATTR_PORT_INDEX = 0x3
|
||||
DEVLINK_ATTR_PORT_TYPE = 0x4
|
||||
DEVLINK_ATTR_PORT_DESIRED_TYPE = 0x5
|
||||
DEVLINK_ATTR_PORT_NETDEV_IFINDEX = 0x6
|
||||
DEVLINK_ATTR_PORT_NETDEV_NAME = 0x7
|
||||
DEVLINK_ATTR_PORT_IBDEV_NAME = 0x8
|
||||
DEVLINK_ATTR_PORT_SPLIT_COUNT = 0x9
|
||||
DEVLINK_ATTR_PORT_SPLIT_GROUP = 0xa
|
||||
DEVLINK_ATTR_SB_INDEX = 0xb
|
||||
DEVLINK_ATTR_SB_SIZE = 0xc
|
||||
DEVLINK_ATTR_SB_INGRESS_POOL_COUNT = 0xd
|
||||
DEVLINK_ATTR_SB_EGRESS_POOL_COUNT = 0xe
|
||||
DEVLINK_ATTR_SB_INGRESS_TC_COUNT = 0xf
|
||||
DEVLINK_ATTR_SB_EGRESS_TC_COUNT = 0x10
|
||||
DEVLINK_ATTR_SB_POOL_INDEX = 0x11
|
||||
DEVLINK_ATTR_SB_POOL_TYPE = 0x12
|
||||
DEVLINK_ATTR_SB_POOL_SIZE = 0x13
|
||||
DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE = 0x14
|
||||
DEVLINK_ATTR_SB_THRESHOLD = 0x15
|
||||
DEVLINK_ATTR_SB_TC_INDEX = 0x16
|
||||
DEVLINK_ATTR_SB_OCC_CUR = 0x17
|
||||
DEVLINK_ATTR_SB_OCC_MAX = 0x18
|
||||
DEVLINK_ATTR_ESWITCH_MODE = 0x19
|
||||
DEVLINK_ATTR_ESWITCH_INLINE_MODE = 0x1a
|
||||
DEVLINK_ATTR_DPIPE_TABLES = 0x1b
|
||||
DEVLINK_ATTR_DPIPE_TABLE = 0x1c
|
||||
DEVLINK_ATTR_DPIPE_TABLE_NAME = 0x1d
|
||||
DEVLINK_ATTR_DPIPE_TABLE_SIZE = 0x1e
|
||||
DEVLINK_ATTR_DPIPE_TABLE_MATCHES = 0x1f
|
||||
DEVLINK_ATTR_DPIPE_TABLE_ACTIONS = 0x20
|
||||
DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED = 0x21
|
||||
DEVLINK_ATTR_DPIPE_ENTRIES = 0x22
|
||||
DEVLINK_ATTR_DPIPE_ENTRY = 0x23
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_INDEX = 0x24
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES = 0x25
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES = 0x26
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_COUNTER = 0x27
|
||||
DEVLINK_ATTR_DPIPE_MATCH = 0x28
|
||||
DEVLINK_ATTR_DPIPE_MATCH_VALUE = 0x29
|
||||
DEVLINK_ATTR_DPIPE_MATCH_TYPE = 0x2a
|
||||
DEVLINK_ATTR_DPIPE_ACTION = 0x2b
|
||||
DEVLINK_ATTR_DPIPE_ACTION_VALUE = 0x2c
|
||||
DEVLINK_ATTR_DPIPE_ACTION_TYPE = 0x2d
|
||||
DEVLINK_ATTR_DPIPE_VALUE = 0x2e
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MASK = 0x2f
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MAPPING = 0x30
|
||||
DEVLINK_ATTR_DPIPE_HEADERS = 0x31
|
||||
DEVLINK_ATTR_DPIPE_HEADER = 0x32
|
||||
DEVLINK_ATTR_DPIPE_HEADER_NAME = 0x33
|
||||
DEVLINK_ATTR_DPIPE_HEADER_ID = 0x34
|
||||
DEVLINK_ATTR_DPIPE_HEADER_FIELDS = 0x35
|
||||
DEVLINK_ATTR_DPIPE_HEADER_GLOBAL = 0x36
|
||||
DEVLINK_ATTR_DPIPE_HEADER_INDEX = 0x37
|
||||
DEVLINK_ATTR_DPIPE_FIELD = 0x38
|
||||
DEVLINK_ATTR_DPIPE_FIELD_NAME = 0x39
|
||||
DEVLINK_ATTR_DPIPE_FIELD_ID = 0x3a
|
||||
DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH = 0x3b
|
||||
DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c
|
||||
DEVLINK_ATTR_PAD = 0x3d
|
||||
DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e
|
||||
DEVLINK_ATTR_MAX = 0x80
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
|
||||
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
|
||||
DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY = 0x0
|
||||
DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV4_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV6_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_HEADER_ETHERNET = 0x0
|
||||
DEVLINK_DPIPE_HEADER_IPV4 = 0x1
|
||||
DEVLINK_DPIPE_HEADER_IPV6 = 0x2
|
||||
)
|
||||
|
|
|
@ -2619,3 +2619,132 @@ const (
|
|||
SYSLOG_ACTION_SIZE_UNREAD = 9
|
||||
SYSLOG_ACTION_SIZE_BUFFER = 10
|
||||
)
|
||||
|
||||
const (
|
||||
DEVLINK_CMD_UNSPEC = 0x0
|
||||
DEVLINK_CMD_GET = 0x1
|
||||
DEVLINK_CMD_SET = 0x2
|
||||
DEVLINK_CMD_NEW = 0x3
|
||||
DEVLINK_CMD_DEL = 0x4
|
||||
DEVLINK_CMD_PORT_GET = 0x5
|
||||
DEVLINK_CMD_PORT_SET = 0x6
|
||||
DEVLINK_CMD_PORT_NEW = 0x7
|
||||
DEVLINK_CMD_PORT_DEL = 0x8
|
||||
DEVLINK_CMD_PORT_SPLIT = 0x9
|
||||
DEVLINK_CMD_PORT_UNSPLIT = 0xa
|
||||
DEVLINK_CMD_SB_GET = 0xb
|
||||
DEVLINK_CMD_SB_SET = 0xc
|
||||
DEVLINK_CMD_SB_NEW = 0xd
|
||||
DEVLINK_CMD_SB_DEL = 0xe
|
||||
DEVLINK_CMD_SB_POOL_GET = 0xf
|
||||
DEVLINK_CMD_SB_POOL_SET = 0x10
|
||||
DEVLINK_CMD_SB_POOL_NEW = 0x11
|
||||
DEVLINK_CMD_SB_POOL_DEL = 0x12
|
||||
DEVLINK_CMD_SB_PORT_POOL_GET = 0x13
|
||||
DEVLINK_CMD_SB_PORT_POOL_SET = 0x14
|
||||
DEVLINK_CMD_SB_PORT_POOL_NEW = 0x15
|
||||
DEVLINK_CMD_SB_PORT_POOL_DEL = 0x16
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_GET = 0x17
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_SET = 0x18
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_NEW = 0x19
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_DEL = 0x1a
|
||||
DEVLINK_CMD_SB_OCC_SNAPSHOT = 0x1b
|
||||
DEVLINK_CMD_SB_OCC_MAX_CLEAR = 0x1c
|
||||
DEVLINK_CMD_ESWITCH_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_SET = 0x1e
|
||||
DEVLINK_CMD_DPIPE_TABLE_GET = 0x1f
|
||||
DEVLINK_CMD_DPIPE_ENTRIES_GET = 0x20
|
||||
DEVLINK_CMD_DPIPE_HEADERS_GET = 0x21
|
||||
DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET = 0x22
|
||||
DEVLINK_CMD_MAX = 0x3c
|
||||
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
||||
DEVLINK_PORT_TYPE_AUTO = 0x1
|
||||
DEVLINK_PORT_TYPE_ETH = 0x2
|
||||
DEVLINK_PORT_TYPE_IB = 0x3
|
||||
DEVLINK_SB_POOL_TYPE_INGRESS = 0x0
|
||||
DEVLINK_SB_POOL_TYPE_EGRESS = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TYPE_STATIC = 0x0
|
||||
DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC = 0x1
|
||||
DEVLINK_ESWITCH_MODE_LEGACY = 0x0
|
||||
DEVLINK_ESWITCH_MODE_SWITCHDEV = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_INLINE_MODE_LINK = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NETWORK = 0x2
|
||||
DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 0x3
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 0x1
|
||||
DEVLINK_ATTR_UNSPEC = 0x0
|
||||
DEVLINK_ATTR_BUS_NAME = 0x1
|
||||
DEVLINK_ATTR_DEV_NAME = 0x2
|
||||
DEVLINK_ATTR_PORT_INDEX = 0x3
|
||||
DEVLINK_ATTR_PORT_TYPE = 0x4
|
||||
DEVLINK_ATTR_PORT_DESIRED_TYPE = 0x5
|
||||
DEVLINK_ATTR_PORT_NETDEV_IFINDEX = 0x6
|
||||
DEVLINK_ATTR_PORT_NETDEV_NAME = 0x7
|
||||
DEVLINK_ATTR_PORT_IBDEV_NAME = 0x8
|
||||
DEVLINK_ATTR_PORT_SPLIT_COUNT = 0x9
|
||||
DEVLINK_ATTR_PORT_SPLIT_GROUP = 0xa
|
||||
DEVLINK_ATTR_SB_INDEX = 0xb
|
||||
DEVLINK_ATTR_SB_SIZE = 0xc
|
||||
DEVLINK_ATTR_SB_INGRESS_POOL_COUNT = 0xd
|
||||
DEVLINK_ATTR_SB_EGRESS_POOL_COUNT = 0xe
|
||||
DEVLINK_ATTR_SB_INGRESS_TC_COUNT = 0xf
|
||||
DEVLINK_ATTR_SB_EGRESS_TC_COUNT = 0x10
|
||||
DEVLINK_ATTR_SB_POOL_INDEX = 0x11
|
||||
DEVLINK_ATTR_SB_POOL_TYPE = 0x12
|
||||
DEVLINK_ATTR_SB_POOL_SIZE = 0x13
|
||||
DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE = 0x14
|
||||
DEVLINK_ATTR_SB_THRESHOLD = 0x15
|
||||
DEVLINK_ATTR_SB_TC_INDEX = 0x16
|
||||
DEVLINK_ATTR_SB_OCC_CUR = 0x17
|
||||
DEVLINK_ATTR_SB_OCC_MAX = 0x18
|
||||
DEVLINK_ATTR_ESWITCH_MODE = 0x19
|
||||
DEVLINK_ATTR_ESWITCH_INLINE_MODE = 0x1a
|
||||
DEVLINK_ATTR_DPIPE_TABLES = 0x1b
|
||||
DEVLINK_ATTR_DPIPE_TABLE = 0x1c
|
||||
DEVLINK_ATTR_DPIPE_TABLE_NAME = 0x1d
|
||||
DEVLINK_ATTR_DPIPE_TABLE_SIZE = 0x1e
|
||||
DEVLINK_ATTR_DPIPE_TABLE_MATCHES = 0x1f
|
||||
DEVLINK_ATTR_DPIPE_TABLE_ACTIONS = 0x20
|
||||
DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED = 0x21
|
||||
DEVLINK_ATTR_DPIPE_ENTRIES = 0x22
|
||||
DEVLINK_ATTR_DPIPE_ENTRY = 0x23
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_INDEX = 0x24
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES = 0x25
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES = 0x26
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_COUNTER = 0x27
|
||||
DEVLINK_ATTR_DPIPE_MATCH = 0x28
|
||||
DEVLINK_ATTR_DPIPE_MATCH_VALUE = 0x29
|
||||
DEVLINK_ATTR_DPIPE_MATCH_TYPE = 0x2a
|
||||
DEVLINK_ATTR_DPIPE_ACTION = 0x2b
|
||||
DEVLINK_ATTR_DPIPE_ACTION_VALUE = 0x2c
|
||||
DEVLINK_ATTR_DPIPE_ACTION_TYPE = 0x2d
|
||||
DEVLINK_ATTR_DPIPE_VALUE = 0x2e
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MASK = 0x2f
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MAPPING = 0x30
|
||||
DEVLINK_ATTR_DPIPE_HEADERS = 0x31
|
||||
DEVLINK_ATTR_DPIPE_HEADER = 0x32
|
||||
DEVLINK_ATTR_DPIPE_HEADER_NAME = 0x33
|
||||
DEVLINK_ATTR_DPIPE_HEADER_ID = 0x34
|
||||
DEVLINK_ATTR_DPIPE_HEADER_FIELDS = 0x35
|
||||
DEVLINK_ATTR_DPIPE_HEADER_GLOBAL = 0x36
|
||||
DEVLINK_ATTR_DPIPE_HEADER_INDEX = 0x37
|
||||
DEVLINK_ATTR_DPIPE_FIELD = 0x38
|
||||
DEVLINK_ATTR_DPIPE_FIELD_NAME = 0x39
|
||||
DEVLINK_ATTR_DPIPE_FIELD_ID = 0x3a
|
||||
DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH = 0x3b
|
||||
DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c
|
||||
DEVLINK_ATTR_PAD = 0x3d
|
||||
DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e
|
||||
DEVLINK_ATTR_MAX = 0x80
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
|
||||
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
|
||||
DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY = 0x0
|
||||
DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV4_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV6_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_HEADER_ETHERNET = 0x0
|
||||
DEVLINK_DPIPE_HEADER_IPV4 = 0x1
|
||||
DEVLINK_DPIPE_HEADER_IPV6 = 0x2
|
||||
)
|
||||
|
|
|
@ -2623,3 +2623,132 @@ const (
|
|||
SYSLOG_ACTION_SIZE_UNREAD = 9
|
||||
SYSLOG_ACTION_SIZE_BUFFER = 10
|
||||
)
|
||||
|
||||
const (
|
||||
DEVLINK_CMD_UNSPEC = 0x0
|
||||
DEVLINK_CMD_GET = 0x1
|
||||
DEVLINK_CMD_SET = 0x2
|
||||
DEVLINK_CMD_NEW = 0x3
|
||||
DEVLINK_CMD_DEL = 0x4
|
||||
DEVLINK_CMD_PORT_GET = 0x5
|
||||
DEVLINK_CMD_PORT_SET = 0x6
|
||||
DEVLINK_CMD_PORT_NEW = 0x7
|
||||
DEVLINK_CMD_PORT_DEL = 0x8
|
||||
DEVLINK_CMD_PORT_SPLIT = 0x9
|
||||
DEVLINK_CMD_PORT_UNSPLIT = 0xa
|
||||
DEVLINK_CMD_SB_GET = 0xb
|
||||
DEVLINK_CMD_SB_SET = 0xc
|
||||
DEVLINK_CMD_SB_NEW = 0xd
|
||||
DEVLINK_CMD_SB_DEL = 0xe
|
||||
DEVLINK_CMD_SB_POOL_GET = 0xf
|
||||
DEVLINK_CMD_SB_POOL_SET = 0x10
|
||||
DEVLINK_CMD_SB_POOL_NEW = 0x11
|
||||
DEVLINK_CMD_SB_POOL_DEL = 0x12
|
||||
DEVLINK_CMD_SB_PORT_POOL_GET = 0x13
|
||||
DEVLINK_CMD_SB_PORT_POOL_SET = 0x14
|
||||
DEVLINK_CMD_SB_PORT_POOL_NEW = 0x15
|
||||
DEVLINK_CMD_SB_PORT_POOL_DEL = 0x16
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_GET = 0x17
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_SET = 0x18
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_NEW = 0x19
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_DEL = 0x1a
|
||||
DEVLINK_CMD_SB_OCC_SNAPSHOT = 0x1b
|
||||
DEVLINK_CMD_SB_OCC_MAX_CLEAR = 0x1c
|
||||
DEVLINK_CMD_ESWITCH_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_SET = 0x1e
|
||||
DEVLINK_CMD_DPIPE_TABLE_GET = 0x1f
|
||||
DEVLINK_CMD_DPIPE_ENTRIES_GET = 0x20
|
||||
DEVLINK_CMD_DPIPE_HEADERS_GET = 0x21
|
||||
DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET = 0x22
|
||||
DEVLINK_CMD_MAX = 0x3c
|
||||
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
||||
DEVLINK_PORT_TYPE_AUTO = 0x1
|
||||
DEVLINK_PORT_TYPE_ETH = 0x2
|
||||
DEVLINK_PORT_TYPE_IB = 0x3
|
||||
DEVLINK_SB_POOL_TYPE_INGRESS = 0x0
|
||||
DEVLINK_SB_POOL_TYPE_EGRESS = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TYPE_STATIC = 0x0
|
||||
DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC = 0x1
|
||||
DEVLINK_ESWITCH_MODE_LEGACY = 0x0
|
||||
DEVLINK_ESWITCH_MODE_SWITCHDEV = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_INLINE_MODE_LINK = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NETWORK = 0x2
|
||||
DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 0x3
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 0x1
|
||||
DEVLINK_ATTR_UNSPEC = 0x0
|
||||
DEVLINK_ATTR_BUS_NAME = 0x1
|
||||
DEVLINK_ATTR_DEV_NAME = 0x2
|
||||
DEVLINK_ATTR_PORT_INDEX = 0x3
|
||||
DEVLINK_ATTR_PORT_TYPE = 0x4
|
||||
DEVLINK_ATTR_PORT_DESIRED_TYPE = 0x5
|
||||
DEVLINK_ATTR_PORT_NETDEV_IFINDEX = 0x6
|
||||
DEVLINK_ATTR_PORT_NETDEV_NAME = 0x7
|
||||
DEVLINK_ATTR_PORT_IBDEV_NAME = 0x8
|
||||
DEVLINK_ATTR_PORT_SPLIT_COUNT = 0x9
|
||||
DEVLINK_ATTR_PORT_SPLIT_GROUP = 0xa
|
||||
DEVLINK_ATTR_SB_INDEX = 0xb
|
||||
DEVLINK_ATTR_SB_SIZE = 0xc
|
||||
DEVLINK_ATTR_SB_INGRESS_POOL_COUNT = 0xd
|
||||
DEVLINK_ATTR_SB_EGRESS_POOL_COUNT = 0xe
|
||||
DEVLINK_ATTR_SB_INGRESS_TC_COUNT = 0xf
|
||||
DEVLINK_ATTR_SB_EGRESS_TC_COUNT = 0x10
|
||||
DEVLINK_ATTR_SB_POOL_INDEX = 0x11
|
||||
DEVLINK_ATTR_SB_POOL_TYPE = 0x12
|
||||
DEVLINK_ATTR_SB_POOL_SIZE = 0x13
|
||||
DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE = 0x14
|
||||
DEVLINK_ATTR_SB_THRESHOLD = 0x15
|
||||
DEVLINK_ATTR_SB_TC_INDEX = 0x16
|
||||
DEVLINK_ATTR_SB_OCC_CUR = 0x17
|
||||
DEVLINK_ATTR_SB_OCC_MAX = 0x18
|
||||
DEVLINK_ATTR_ESWITCH_MODE = 0x19
|
||||
DEVLINK_ATTR_ESWITCH_INLINE_MODE = 0x1a
|
||||
DEVLINK_ATTR_DPIPE_TABLES = 0x1b
|
||||
DEVLINK_ATTR_DPIPE_TABLE = 0x1c
|
||||
DEVLINK_ATTR_DPIPE_TABLE_NAME = 0x1d
|
||||
DEVLINK_ATTR_DPIPE_TABLE_SIZE = 0x1e
|
||||
DEVLINK_ATTR_DPIPE_TABLE_MATCHES = 0x1f
|
||||
DEVLINK_ATTR_DPIPE_TABLE_ACTIONS = 0x20
|
||||
DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED = 0x21
|
||||
DEVLINK_ATTR_DPIPE_ENTRIES = 0x22
|
||||
DEVLINK_ATTR_DPIPE_ENTRY = 0x23
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_INDEX = 0x24
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES = 0x25
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES = 0x26
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_COUNTER = 0x27
|
||||
DEVLINK_ATTR_DPIPE_MATCH = 0x28
|
||||
DEVLINK_ATTR_DPIPE_MATCH_VALUE = 0x29
|
||||
DEVLINK_ATTR_DPIPE_MATCH_TYPE = 0x2a
|
||||
DEVLINK_ATTR_DPIPE_ACTION = 0x2b
|
||||
DEVLINK_ATTR_DPIPE_ACTION_VALUE = 0x2c
|
||||
DEVLINK_ATTR_DPIPE_ACTION_TYPE = 0x2d
|
||||
DEVLINK_ATTR_DPIPE_VALUE = 0x2e
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MASK = 0x2f
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MAPPING = 0x30
|
||||
DEVLINK_ATTR_DPIPE_HEADERS = 0x31
|
||||
DEVLINK_ATTR_DPIPE_HEADER = 0x32
|
||||
DEVLINK_ATTR_DPIPE_HEADER_NAME = 0x33
|
||||
DEVLINK_ATTR_DPIPE_HEADER_ID = 0x34
|
||||
DEVLINK_ATTR_DPIPE_HEADER_FIELDS = 0x35
|
||||
DEVLINK_ATTR_DPIPE_HEADER_GLOBAL = 0x36
|
||||
DEVLINK_ATTR_DPIPE_HEADER_INDEX = 0x37
|
||||
DEVLINK_ATTR_DPIPE_FIELD = 0x38
|
||||
DEVLINK_ATTR_DPIPE_FIELD_NAME = 0x39
|
||||
DEVLINK_ATTR_DPIPE_FIELD_ID = 0x3a
|
||||
DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH = 0x3b
|
||||
DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c
|
||||
DEVLINK_ATTR_PAD = 0x3d
|
||||
DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e
|
||||
DEVLINK_ATTR_MAX = 0x80
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
|
||||
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
|
||||
DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY = 0x0
|
||||
DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV4_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV6_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_HEADER_ETHERNET = 0x0
|
||||
DEVLINK_DPIPE_HEADER_IPV4 = 0x1
|
||||
DEVLINK_DPIPE_HEADER_IPV6 = 0x2
|
||||
)
|
||||
|
|
|
@ -2621,3 +2621,132 @@ const (
|
|||
SYSLOG_ACTION_SIZE_UNREAD = 9
|
||||
SYSLOG_ACTION_SIZE_BUFFER = 10
|
||||
)
|
||||
|
||||
const (
|
||||
DEVLINK_CMD_UNSPEC = 0x0
|
||||
DEVLINK_CMD_GET = 0x1
|
||||
DEVLINK_CMD_SET = 0x2
|
||||
DEVLINK_CMD_NEW = 0x3
|
||||
DEVLINK_CMD_DEL = 0x4
|
||||
DEVLINK_CMD_PORT_GET = 0x5
|
||||
DEVLINK_CMD_PORT_SET = 0x6
|
||||
DEVLINK_CMD_PORT_NEW = 0x7
|
||||
DEVLINK_CMD_PORT_DEL = 0x8
|
||||
DEVLINK_CMD_PORT_SPLIT = 0x9
|
||||
DEVLINK_CMD_PORT_UNSPLIT = 0xa
|
||||
DEVLINK_CMD_SB_GET = 0xb
|
||||
DEVLINK_CMD_SB_SET = 0xc
|
||||
DEVLINK_CMD_SB_NEW = 0xd
|
||||
DEVLINK_CMD_SB_DEL = 0xe
|
||||
DEVLINK_CMD_SB_POOL_GET = 0xf
|
||||
DEVLINK_CMD_SB_POOL_SET = 0x10
|
||||
DEVLINK_CMD_SB_POOL_NEW = 0x11
|
||||
DEVLINK_CMD_SB_POOL_DEL = 0x12
|
||||
DEVLINK_CMD_SB_PORT_POOL_GET = 0x13
|
||||
DEVLINK_CMD_SB_PORT_POOL_SET = 0x14
|
||||
DEVLINK_CMD_SB_PORT_POOL_NEW = 0x15
|
||||
DEVLINK_CMD_SB_PORT_POOL_DEL = 0x16
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_GET = 0x17
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_SET = 0x18
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_NEW = 0x19
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_DEL = 0x1a
|
||||
DEVLINK_CMD_SB_OCC_SNAPSHOT = 0x1b
|
||||
DEVLINK_CMD_SB_OCC_MAX_CLEAR = 0x1c
|
||||
DEVLINK_CMD_ESWITCH_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_SET = 0x1e
|
||||
DEVLINK_CMD_DPIPE_TABLE_GET = 0x1f
|
||||
DEVLINK_CMD_DPIPE_ENTRIES_GET = 0x20
|
||||
DEVLINK_CMD_DPIPE_HEADERS_GET = 0x21
|
||||
DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET = 0x22
|
||||
DEVLINK_CMD_MAX = 0x3c
|
||||
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
||||
DEVLINK_PORT_TYPE_AUTO = 0x1
|
||||
DEVLINK_PORT_TYPE_ETH = 0x2
|
||||
DEVLINK_PORT_TYPE_IB = 0x3
|
||||
DEVLINK_SB_POOL_TYPE_INGRESS = 0x0
|
||||
DEVLINK_SB_POOL_TYPE_EGRESS = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TYPE_STATIC = 0x0
|
||||
DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC = 0x1
|
||||
DEVLINK_ESWITCH_MODE_LEGACY = 0x0
|
||||
DEVLINK_ESWITCH_MODE_SWITCHDEV = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_INLINE_MODE_LINK = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NETWORK = 0x2
|
||||
DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 0x3
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 0x1
|
||||
DEVLINK_ATTR_UNSPEC = 0x0
|
||||
DEVLINK_ATTR_BUS_NAME = 0x1
|
||||
DEVLINK_ATTR_DEV_NAME = 0x2
|
||||
DEVLINK_ATTR_PORT_INDEX = 0x3
|
||||
DEVLINK_ATTR_PORT_TYPE = 0x4
|
||||
DEVLINK_ATTR_PORT_DESIRED_TYPE = 0x5
|
||||
DEVLINK_ATTR_PORT_NETDEV_IFINDEX = 0x6
|
||||
DEVLINK_ATTR_PORT_NETDEV_NAME = 0x7
|
||||
DEVLINK_ATTR_PORT_IBDEV_NAME = 0x8
|
||||
DEVLINK_ATTR_PORT_SPLIT_COUNT = 0x9
|
||||
DEVLINK_ATTR_PORT_SPLIT_GROUP = 0xa
|
||||
DEVLINK_ATTR_SB_INDEX = 0xb
|
||||
DEVLINK_ATTR_SB_SIZE = 0xc
|
||||
DEVLINK_ATTR_SB_INGRESS_POOL_COUNT = 0xd
|
||||
DEVLINK_ATTR_SB_EGRESS_POOL_COUNT = 0xe
|
||||
DEVLINK_ATTR_SB_INGRESS_TC_COUNT = 0xf
|
||||
DEVLINK_ATTR_SB_EGRESS_TC_COUNT = 0x10
|
||||
DEVLINK_ATTR_SB_POOL_INDEX = 0x11
|
||||
DEVLINK_ATTR_SB_POOL_TYPE = 0x12
|
||||
DEVLINK_ATTR_SB_POOL_SIZE = 0x13
|
||||
DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE = 0x14
|
||||
DEVLINK_ATTR_SB_THRESHOLD = 0x15
|
||||
DEVLINK_ATTR_SB_TC_INDEX = 0x16
|
||||
DEVLINK_ATTR_SB_OCC_CUR = 0x17
|
||||
DEVLINK_ATTR_SB_OCC_MAX = 0x18
|
||||
DEVLINK_ATTR_ESWITCH_MODE = 0x19
|
||||
DEVLINK_ATTR_ESWITCH_INLINE_MODE = 0x1a
|
||||
DEVLINK_ATTR_DPIPE_TABLES = 0x1b
|
||||
DEVLINK_ATTR_DPIPE_TABLE = 0x1c
|
||||
DEVLINK_ATTR_DPIPE_TABLE_NAME = 0x1d
|
||||
DEVLINK_ATTR_DPIPE_TABLE_SIZE = 0x1e
|
||||
DEVLINK_ATTR_DPIPE_TABLE_MATCHES = 0x1f
|
||||
DEVLINK_ATTR_DPIPE_TABLE_ACTIONS = 0x20
|
||||
DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED = 0x21
|
||||
DEVLINK_ATTR_DPIPE_ENTRIES = 0x22
|
||||
DEVLINK_ATTR_DPIPE_ENTRY = 0x23
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_INDEX = 0x24
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES = 0x25
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES = 0x26
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_COUNTER = 0x27
|
||||
DEVLINK_ATTR_DPIPE_MATCH = 0x28
|
||||
DEVLINK_ATTR_DPIPE_MATCH_VALUE = 0x29
|
||||
DEVLINK_ATTR_DPIPE_MATCH_TYPE = 0x2a
|
||||
DEVLINK_ATTR_DPIPE_ACTION = 0x2b
|
||||
DEVLINK_ATTR_DPIPE_ACTION_VALUE = 0x2c
|
||||
DEVLINK_ATTR_DPIPE_ACTION_TYPE = 0x2d
|
||||
DEVLINK_ATTR_DPIPE_VALUE = 0x2e
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MASK = 0x2f
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MAPPING = 0x30
|
||||
DEVLINK_ATTR_DPIPE_HEADERS = 0x31
|
||||
DEVLINK_ATTR_DPIPE_HEADER = 0x32
|
||||
DEVLINK_ATTR_DPIPE_HEADER_NAME = 0x33
|
||||
DEVLINK_ATTR_DPIPE_HEADER_ID = 0x34
|
||||
DEVLINK_ATTR_DPIPE_HEADER_FIELDS = 0x35
|
||||
DEVLINK_ATTR_DPIPE_HEADER_GLOBAL = 0x36
|
||||
DEVLINK_ATTR_DPIPE_HEADER_INDEX = 0x37
|
||||
DEVLINK_ATTR_DPIPE_FIELD = 0x38
|
||||
DEVLINK_ATTR_DPIPE_FIELD_NAME = 0x39
|
||||
DEVLINK_ATTR_DPIPE_FIELD_ID = 0x3a
|
||||
DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH = 0x3b
|
||||
DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c
|
||||
DEVLINK_ATTR_PAD = 0x3d
|
||||
DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e
|
||||
DEVLINK_ATTR_MAX = 0x80
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
|
||||
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
|
||||
DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY = 0x0
|
||||
DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV4_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV6_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_HEADER_ETHERNET = 0x0
|
||||
DEVLINK_DPIPE_HEADER_IPV4 = 0x1
|
||||
DEVLINK_DPIPE_HEADER_IPV6 = 0x2
|
||||
)
|
||||
|
|
|
@ -2621,3 +2621,132 @@ const (
|
|||
SYSLOG_ACTION_SIZE_UNREAD = 9
|
||||
SYSLOG_ACTION_SIZE_BUFFER = 10
|
||||
)
|
||||
|
||||
const (
|
||||
DEVLINK_CMD_UNSPEC = 0x0
|
||||
DEVLINK_CMD_GET = 0x1
|
||||
DEVLINK_CMD_SET = 0x2
|
||||
DEVLINK_CMD_NEW = 0x3
|
||||
DEVLINK_CMD_DEL = 0x4
|
||||
DEVLINK_CMD_PORT_GET = 0x5
|
||||
DEVLINK_CMD_PORT_SET = 0x6
|
||||
DEVLINK_CMD_PORT_NEW = 0x7
|
||||
DEVLINK_CMD_PORT_DEL = 0x8
|
||||
DEVLINK_CMD_PORT_SPLIT = 0x9
|
||||
DEVLINK_CMD_PORT_UNSPLIT = 0xa
|
||||
DEVLINK_CMD_SB_GET = 0xb
|
||||
DEVLINK_CMD_SB_SET = 0xc
|
||||
DEVLINK_CMD_SB_NEW = 0xd
|
||||
DEVLINK_CMD_SB_DEL = 0xe
|
||||
DEVLINK_CMD_SB_POOL_GET = 0xf
|
||||
DEVLINK_CMD_SB_POOL_SET = 0x10
|
||||
DEVLINK_CMD_SB_POOL_NEW = 0x11
|
||||
DEVLINK_CMD_SB_POOL_DEL = 0x12
|
||||
DEVLINK_CMD_SB_PORT_POOL_GET = 0x13
|
||||
DEVLINK_CMD_SB_PORT_POOL_SET = 0x14
|
||||
DEVLINK_CMD_SB_PORT_POOL_NEW = 0x15
|
||||
DEVLINK_CMD_SB_PORT_POOL_DEL = 0x16
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_GET = 0x17
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_SET = 0x18
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_NEW = 0x19
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_DEL = 0x1a
|
||||
DEVLINK_CMD_SB_OCC_SNAPSHOT = 0x1b
|
||||
DEVLINK_CMD_SB_OCC_MAX_CLEAR = 0x1c
|
||||
DEVLINK_CMD_ESWITCH_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_SET = 0x1e
|
||||
DEVLINK_CMD_DPIPE_TABLE_GET = 0x1f
|
||||
DEVLINK_CMD_DPIPE_ENTRIES_GET = 0x20
|
||||
DEVLINK_CMD_DPIPE_HEADERS_GET = 0x21
|
||||
DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET = 0x22
|
||||
DEVLINK_CMD_MAX = 0x3c
|
||||
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
||||
DEVLINK_PORT_TYPE_AUTO = 0x1
|
||||
DEVLINK_PORT_TYPE_ETH = 0x2
|
||||
DEVLINK_PORT_TYPE_IB = 0x3
|
||||
DEVLINK_SB_POOL_TYPE_INGRESS = 0x0
|
||||
DEVLINK_SB_POOL_TYPE_EGRESS = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TYPE_STATIC = 0x0
|
||||
DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC = 0x1
|
||||
DEVLINK_ESWITCH_MODE_LEGACY = 0x0
|
||||
DEVLINK_ESWITCH_MODE_SWITCHDEV = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_INLINE_MODE_LINK = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NETWORK = 0x2
|
||||
DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 0x3
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 0x1
|
||||
DEVLINK_ATTR_UNSPEC = 0x0
|
||||
DEVLINK_ATTR_BUS_NAME = 0x1
|
||||
DEVLINK_ATTR_DEV_NAME = 0x2
|
||||
DEVLINK_ATTR_PORT_INDEX = 0x3
|
||||
DEVLINK_ATTR_PORT_TYPE = 0x4
|
||||
DEVLINK_ATTR_PORT_DESIRED_TYPE = 0x5
|
||||
DEVLINK_ATTR_PORT_NETDEV_IFINDEX = 0x6
|
||||
DEVLINK_ATTR_PORT_NETDEV_NAME = 0x7
|
||||
DEVLINK_ATTR_PORT_IBDEV_NAME = 0x8
|
||||
DEVLINK_ATTR_PORT_SPLIT_COUNT = 0x9
|
||||
DEVLINK_ATTR_PORT_SPLIT_GROUP = 0xa
|
||||
DEVLINK_ATTR_SB_INDEX = 0xb
|
||||
DEVLINK_ATTR_SB_SIZE = 0xc
|
||||
DEVLINK_ATTR_SB_INGRESS_POOL_COUNT = 0xd
|
||||
DEVLINK_ATTR_SB_EGRESS_POOL_COUNT = 0xe
|
||||
DEVLINK_ATTR_SB_INGRESS_TC_COUNT = 0xf
|
||||
DEVLINK_ATTR_SB_EGRESS_TC_COUNT = 0x10
|
||||
DEVLINK_ATTR_SB_POOL_INDEX = 0x11
|
||||
DEVLINK_ATTR_SB_POOL_TYPE = 0x12
|
||||
DEVLINK_ATTR_SB_POOL_SIZE = 0x13
|
||||
DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE = 0x14
|
||||
DEVLINK_ATTR_SB_THRESHOLD = 0x15
|
||||
DEVLINK_ATTR_SB_TC_INDEX = 0x16
|
||||
DEVLINK_ATTR_SB_OCC_CUR = 0x17
|
||||
DEVLINK_ATTR_SB_OCC_MAX = 0x18
|
||||
DEVLINK_ATTR_ESWITCH_MODE = 0x19
|
||||
DEVLINK_ATTR_ESWITCH_INLINE_MODE = 0x1a
|
||||
DEVLINK_ATTR_DPIPE_TABLES = 0x1b
|
||||
DEVLINK_ATTR_DPIPE_TABLE = 0x1c
|
||||
DEVLINK_ATTR_DPIPE_TABLE_NAME = 0x1d
|
||||
DEVLINK_ATTR_DPIPE_TABLE_SIZE = 0x1e
|
||||
DEVLINK_ATTR_DPIPE_TABLE_MATCHES = 0x1f
|
||||
DEVLINK_ATTR_DPIPE_TABLE_ACTIONS = 0x20
|
||||
DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED = 0x21
|
||||
DEVLINK_ATTR_DPIPE_ENTRIES = 0x22
|
||||
DEVLINK_ATTR_DPIPE_ENTRY = 0x23
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_INDEX = 0x24
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES = 0x25
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES = 0x26
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_COUNTER = 0x27
|
||||
DEVLINK_ATTR_DPIPE_MATCH = 0x28
|
||||
DEVLINK_ATTR_DPIPE_MATCH_VALUE = 0x29
|
||||
DEVLINK_ATTR_DPIPE_MATCH_TYPE = 0x2a
|
||||
DEVLINK_ATTR_DPIPE_ACTION = 0x2b
|
||||
DEVLINK_ATTR_DPIPE_ACTION_VALUE = 0x2c
|
||||
DEVLINK_ATTR_DPIPE_ACTION_TYPE = 0x2d
|
||||
DEVLINK_ATTR_DPIPE_VALUE = 0x2e
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MASK = 0x2f
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MAPPING = 0x30
|
||||
DEVLINK_ATTR_DPIPE_HEADERS = 0x31
|
||||
DEVLINK_ATTR_DPIPE_HEADER = 0x32
|
||||
DEVLINK_ATTR_DPIPE_HEADER_NAME = 0x33
|
||||
DEVLINK_ATTR_DPIPE_HEADER_ID = 0x34
|
||||
DEVLINK_ATTR_DPIPE_HEADER_FIELDS = 0x35
|
||||
DEVLINK_ATTR_DPIPE_HEADER_GLOBAL = 0x36
|
||||
DEVLINK_ATTR_DPIPE_HEADER_INDEX = 0x37
|
||||
DEVLINK_ATTR_DPIPE_FIELD = 0x38
|
||||
DEVLINK_ATTR_DPIPE_FIELD_NAME = 0x39
|
||||
DEVLINK_ATTR_DPIPE_FIELD_ID = 0x3a
|
||||
DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH = 0x3b
|
||||
DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c
|
||||
DEVLINK_ATTR_PAD = 0x3d
|
||||
DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e
|
||||
DEVLINK_ATTR_MAX = 0x80
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
|
||||
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
|
||||
DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY = 0x0
|
||||
DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV4_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV6_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_HEADER_ETHERNET = 0x0
|
||||
DEVLINK_DPIPE_HEADER_IPV4 = 0x1
|
||||
DEVLINK_DPIPE_HEADER_IPV6 = 0x2
|
||||
)
|
||||
|
|
|
@ -2623,3 +2623,132 @@ const (
|
|||
SYSLOG_ACTION_SIZE_UNREAD = 9
|
||||
SYSLOG_ACTION_SIZE_BUFFER = 10
|
||||
)
|
||||
|
||||
const (
|
||||
DEVLINK_CMD_UNSPEC = 0x0
|
||||
DEVLINK_CMD_GET = 0x1
|
||||
DEVLINK_CMD_SET = 0x2
|
||||
DEVLINK_CMD_NEW = 0x3
|
||||
DEVLINK_CMD_DEL = 0x4
|
||||
DEVLINK_CMD_PORT_GET = 0x5
|
||||
DEVLINK_CMD_PORT_SET = 0x6
|
||||
DEVLINK_CMD_PORT_NEW = 0x7
|
||||
DEVLINK_CMD_PORT_DEL = 0x8
|
||||
DEVLINK_CMD_PORT_SPLIT = 0x9
|
||||
DEVLINK_CMD_PORT_UNSPLIT = 0xa
|
||||
DEVLINK_CMD_SB_GET = 0xb
|
||||
DEVLINK_CMD_SB_SET = 0xc
|
||||
DEVLINK_CMD_SB_NEW = 0xd
|
||||
DEVLINK_CMD_SB_DEL = 0xe
|
||||
DEVLINK_CMD_SB_POOL_GET = 0xf
|
||||
DEVLINK_CMD_SB_POOL_SET = 0x10
|
||||
DEVLINK_CMD_SB_POOL_NEW = 0x11
|
||||
DEVLINK_CMD_SB_POOL_DEL = 0x12
|
||||
DEVLINK_CMD_SB_PORT_POOL_GET = 0x13
|
||||
DEVLINK_CMD_SB_PORT_POOL_SET = 0x14
|
||||
DEVLINK_CMD_SB_PORT_POOL_NEW = 0x15
|
||||
DEVLINK_CMD_SB_PORT_POOL_DEL = 0x16
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_GET = 0x17
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_SET = 0x18
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_NEW = 0x19
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_DEL = 0x1a
|
||||
DEVLINK_CMD_SB_OCC_SNAPSHOT = 0x1b
|
||||
DEVLINK_CMD_SB_OCC_MAX_CLEAR = 0x1c
|
||||
DEVLINK_CMD_ESWITCH_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_SET = 0x1e
|
||||
DEVLINK_CMD_DPIPE_TABLE_GET = 0x1f
|
||||
DEVLINK_CMD_DPIPE_ENTRIES_GET = 0x20
|
||||
DEVLINK_CMD_DPIPE_HEADERS_GET = 0x21
|
||||
DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET = 0x22
|
||||
DEVLINK_CMD_MAX = 0x3c
|
||||
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
||||
DEVLINK_PORT_TYPE_AUTO = 0x1
|
||||
DEVLINK_PORT_TYPE_ETH = 0x2
|
||||
DEVLINK_PORT_TYPE_IB = 0x3
|
||||
DEVLINK_SB_POOL_TYPE_INGRESS = 0x0
|
||||
DEVLINK_SB_POOL_TYPE_EGRESS = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TYPE_STATIC = 0x0
|
||||
DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC = 0x1
|
||||
DEVLINK_ESWITCH_MODE_LEGACY = 0x0
|
||||
DEVLINK_ESWITCH_MODE_SWITCHDEV = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_INLINE_MODE_LINK = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NETWORK = 0x2
|
||||
DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 0x3
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 0x1
|
||||
DEVLINK_ATTR_UNSPEC = 0x0
|
||||
DEVLINK_ATTR_BUS_NAME = 0x1
|
||||
DEVLINK_ATTR_DEV_NAME = 0x2
|
||||
DEVLINK_ATTR_PORT_INDEX = 0x3
|
||||
DEVLINK_ATTR_PORT_TYPE = 0x4
|
||||
DEVLINK_ATTR_PORT_DESIRED_TYPE = 0x5
|
||||
DEVLINK_ATTR_PORT_NETDEV_IFINDEX = 0x6
|
||||
DEVLINK_ATTR_PORT_NETDEV_NAME = 0x7
|
||||
DEVLINK_ATTR_PORT_IBDEV_NAME = 0x8
|
||||
DEVLINK_ATTR_PORT_SPLIT_COUNT = 0x9
|
||||
DEVLINK_ATTR_PORT_SPLIT_GROUP = 0xa
|
||||
DEVLINK_ATTR_SB_INDEX = 0xb
|
||||
DEVLINK_ATTR_SB_SIZE = 0xc
|
||||
DEVLINK_ATTR_SB_INGRESS_POOL_COUNT = 0xd
|
||||
DEVLINK_ATTR_SB_EGRESS_POOL_COUNT = 0xe
|
||||
DEVLINK_ATTR_SB_INGRESS_TC_COUNT = 0xf
|
||||
DEVLINK_ATTR_SB_EGRESS_TC_COUNT = 0x10
|
||||
DEVLINK_ATTR_SB_POOL_INDEX = 0x11
|
||||
DEVLINK_ATTR_SB_POOL_TYPE = 0x12
|
||||
DEVLINK_ATTR_SB_POOL_SIZE = 0x13
|
||||
DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE = 0x14
|
||||
DEVLINK_ATTR_SB_THRESHOLD = 0x15
|
||||
DEVLINK_ATTR_SB_TC_INDEX = 0x16
|
||||
DEVLINK_ATTR_SB_OCC_CUR = 0x17
|
||||
DEVLINK_ATTR_SB_OCC_MAX = 0x18
|
||||
DEVLINK_ATTR_ESWITCH_MODE = 0x19
|
||||
DEVLINK_ATTR_ESWITCH_INLINE_MODE = 0x1a
|
||||
DEVLINK_ATTR_DPIPE_TABLES = 0x1b
|
||||
DEVLINK_ATTR_DPIPE_TABLE = 0x1c
|
||||
DEVLINK_ATTR_DPIPE_TABLE_NAME = 0x1d
|
||||
DEVLINK_ATTR_DPIPE_TABLE_SIZE = 0x1e
|
||||
DEVLINK_ATTR_DPIPE_TABLE_MATCHES = 0x1f
|
||||
DEVLINK_ATTR_DPIPE_TABLE_ACTIONS = 0x20
|
||||
DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED = 0x21
|
||||
DEVLINK_ATTR_DPIPE_ENTRIES = 0x22
|
||||
DEVLINK_ATTR_DPIPE_ENTRY = 0x23
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_INDEX = 0x24
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES = 0x25
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES = 0x26
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_COUNTER = 0x27
|
||||
DEVLINK_ATTR_DPIPE_MATCH = 0x28
|
||||
DEVLINK_ATTR_DPIPE_MATCH_VALUE = 0x29
|
||||
DEVLINK_ATTR_DPIPE_MATCH_TYPE = 0x2a
|
||||
DEVLINK_ATTR_DPIPE_ACTION = 0x2b
|
||||
DEVLINK_ATTR_DPIPE_ACTION_VALUE = 0x2c
|
||||
DEVLINK_ATTR_DPIPE_ACTION_TYPE = 0x2d
|
||||
DEVLINK_ATTR_DPIPE_VALUE = 0x2e
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MASK = 0x2f
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MAPPING = 0x30
|
||||
DEVLINK_ATTR_DPIPE_HEADERS = 0x31
|
||||
DEVLINK_ATTR_DPIPE_HEADER = 0x32
|
||||
DEVLINK_ATTR_DPIPE_HEADER_NAME = 0x33
|
||||
DEVLINK_ATTR_DPIPE_HEADER_ID = 0x34
|
||||
DEVLINK_ATTR_DPIPE_HEADER_FIELDS = 0x35
|
||||
DEVLINK_ATTR_DPIPE_HEADER_GLOBAL = 0x36
|
||||
DEVLINK_ATTR_DPIPE_HEADER_INDEX = 0x37
|
||||
DEVLINK_ATTR_DPIPE_FIELD = 0x38
|
||||
DEVLINK_ATTR_DPIPE_FIELD_NAME = 0x39
|
||||
DEVLINK_ATTR_DPIPE_FIELD_ID = 0x3a
|
||||
DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH = 0x3b
|
||||
DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c
|
||||
DEVLINK_ATTR_PAD = 0x3d
|
||||
DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e
|
||||
DEVLINK_ATTR_MAX = 0x80
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
|
||||
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
|
||||
DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY = 0x0
|
||||
DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV4_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV6_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_HEADER_ETHERNET = 0x0
|
||||
DEVLINK_DPIPE_HEADER_IPV4 = 0x1
|
||||
DEVLINK_DPIPE_HEADER_IPV6 = 0x2
|
||||
)
|
||||
|
|
|
@ -2629,3 +2629,132 @@ const (
|
|||
SYSLOG_ACTION_SIZE_UNREAD = 9
|
||||
SYSLOG_ACTION_SIZE_BUFFER = 10
|
||||
)
|
||||
|
||||
const (
|
||||
DEVLINK_CMD_UNSPEC = 0x0
|
||||
DEVLINK_CMD_GET = 0x1
|
||||
DEVLINK_CMD_SET = 0x2
|
||||
DEVLINK_CMD_NEW = 0x3
|
||||
DEVLINK_CMD_DEL = 0x4
|
||||
DEVLINK_CMD_PORT_GET = 0x5
|
||||
DEVLINK_CMD_PORT_SET = 0x6
|
||||
DEVLINK_CMD_PORT_NEW = 0x7
|
||||
DEVLINK_CMD_PORT_DEL = 0x8
|
||||
DEVLINK_CMD_PORT_SPLIT = 0x9
|
||||
DEVLINK_CMD_PORT_UNSPLIT = 0xa
|
||||
DEVLINK_CMD_SB_GET = 0xb
|
||||
DEVLINK_CMD_SB_SET = 0xc
|
||||
DEVLINK_CMD_SB_NEW = 0xd
|
||||
DEVLINK_CMD_SB_DEL = 0xe
|
||||
DEVLINK_CMD_SB_POOL_GET = 0xf
|
||||
DEVLINK_CMD_SB_POOL_SET = 0x10
|
||||
DEVLINK_CMD_SB_POOL_NEW = 0x11
|
||||
DEVLINK_CMD_SB_POOL_DEL = 0x12
|
||||
DEVLINK_CMD_SB_PORT_POOL_GET = 0x13
|
||||
DEVLINK_CMD_SB_PORT_POOL_SET = 0x14
|
||||
DEVLINK_CMD_SB_PORT_POOL_NEW = 0x15
|
||||
DEVLINK_CMD_SB_PORT_POOL_DEL = 0x16
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_GET = 0x17
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_SET = 0x18
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_NEW = 0x19
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_DEL = 0x1a
|
||||
DEVLINK_CMD_SB_OCC_SNAPSHOT = 0x1b
|
||||
DEVLINK_CMD_SB_OCC_MAX_CLEAR = 0x1c
|
||||
DEVLINK_CMD_ESWITCH_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_SET = 0x1e
|
||||
DEVLINK_CMD_DPIPE_TABLE_GET = 0x1f
|
||||
DEVLINK_CMD_DPIPE_ENTRIES_GET = 0x20
|
||||
DEVLINK_CMD_DPIPE_HEADERS_GET = 0x21
|
||||
DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET = 0x22
|
||||
DEVLINK_CMD_MAX = 0x3c
|
||||
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
||||
DEVLINK_PORT_TYPE_AUTO = 0x1
|
||||
DEVLINK_PORT_TYPE_ETH = 0x2
|
||||
DEVLINK_PORT_TYPE_IB = 0x3
|
||||
DEVLINK_SB_POOL_TYPE_INGRESS = 0x0
|
||||
DEVLINK_SB_POOL_TYPE_EGRESS = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TYPE_STATIC = 0x0
|
||||
DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC = 0x1
|
||||
DEVLINK_ESWITCH_MODE_LEGACY = 0x0
|
||||
DEVLINK_ESWITCH_MODE_SWITCHDEV = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_INLINE_MODE_LINK = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NETWORK = 0x2
|
||||
DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 0x3
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 0x1
|
||||
DEVLINK_ATTR_UNSPEC = 0x0
|
||||
DEVLINK_ATTR_BUS_NAME = 0x1
|
||||
DEVLINK_ATTR_DEV_NAME = 0x2
|
||||
DEVLINK_ATTR_PORT_INDEX = 0x3
|
||||
DEVLINK_ATTR_PORT_TYPE = 0x4
|
||||
DEVLINK_ATTR_PORT_DESIRED_TYPE = 0x5
|
||||
DEVLINK_ATTR_PORT_NETDEV_IFINDEX = 0x6
|
||||
DEVLINK_ATTR_PORT_NETDEV_NAME = 0x7
|
||||
DEVLINK_ATTR_PORT_IBDEV_NAME = 0x8
|
||||
DEVLINK_ATTR_PORT_SPLIT_COUNT = 0x9
|
||||
DEVLINK_ATTR_PORT_SPLIT_GROUP = 0xa
|
||||
DEVLINK_ATTR_SB_INDEX = 0xb
|
||||
DEVLINK_ATTR_SB_SIZE = 0xc
|
||||
DEVLINK_ATTR_SB_INGRESS_POOL_COUNT = 0xd
|
||||
DEVLINK_ATTR_SB_EGRESS_POOL_COUNT = 0xe
|
||||
DEVLINK_ATTR_SB_INGRESS_TC_COUNT = 0xf
|
||||
DEVLINK_ATTR_SB_EGRESS_TC_COUNT = 0x10
|
||||
DEVLINK_ATTR_SB_POOL_INDEX = 0x11
|
||||
DEVLINK_ATTR_SB_POOL_TYPE = 0x12
|
||||
DEVLINK_ATTR_SB_POOL_SIZE = 0x13
|
||||
DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE = 0x14
|
||||
DEVLINK_ATTR_SB_THRESHOLD = 0x15
|
||||
DEVLINK_ATTR_SB_TC_INDEX = 0x16
|
||||
DEVLINK_ATTR_SB_OCC_CUR = 0x17
|
||||
DEVLINK_ATTR_SB_OCC_MAX = 0x18
|
||||
DEVLINK_ATTR_ESWITCH_MODE = 0x19
|
||||
DEVLINK_ATTR_ESWITCH_INLINE_MODE = 0x1a
|
||||
DEVLINK_ATTR_DPIPE_TABLES = 0x1b
|
||||
DEVLINK_ATTR_DPIPE_TABLE = 0x1c
|
||||
DEVLINK_ATTR_DPIPE_TABLE_NAME = 0x1d
|
||||
DEVLINK_ATTR_DPIPE_TABLE_SIZE = 0x1e
|
||||
DEVLINK_ATTR_DPIPE_TABLE_MATCHES = 0x1f
|
||||
DEVLINK_ATTR_DPIPE_TABLE_ACTIONS = 0x20
|
||||
DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED = 0x21
|
||||
DEVLINK_ATTR_DPIPE_ENTRIES = 0x22
|
||||
DEVLINK_ATTR_DPIPE_ENTRY = 0x23
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_INDEX = 0x24
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES = 0x25
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES = 0x26
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_COUNTER = 0x27
|
||||
DEVLINK_ATTR_DPIPE_MATCH = 0x28
|
||||
DEVLINK_ATTR_DPIPE_MATCH_VALUE = 0x29
|
||||
DEVLINK_ATTR_DPIPE_MATCH_TYPE = 0x2a
|
||||
DEVLINK_ATTR_DPIPE_ACTION = 0x2b
|
||||
DEVLINK_ATTR_DPIPE_ACTION_VALUE = 0x2c
|
||||
DEVLINK_ATTR_DPIPE_ACTION_TYPE = 0x2d
|
||||
DEVLINK_ATTR_DPIPE_VALUE = 0x2e
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MASK = 0x2f
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MAPPING = 0x30
|
||||
DEVLINK_ATTR_DPIPE_HEADERS = 0x31
|
||||
DEVLINK_ATTR_DPIPE_HEADER = 0x32
|
||||
DEVLINK_ATTR_DPIPE_HEADER_NAME = 0x33
|
||||
DEVLINK_ATTR_DPIPE_HEADER_ID = 0x34
|
||||
DEVLINK_ATTR_DPIPE_HEADER_FIELDS = 0x35
|
||||
DEVLINK_ATTR_DPIPE_HEADER_GLOBAL = 0x36
|
||||
DEVLINK_ATTR_DPIPE_HEADER_INDEX = 0x37
|
||||
DEVLINK_ATTR_DPIPE_FIELD = 0x38
|
||||
DEVLINK_ATTR_DPIPE_FIELD_NAME = 0x39
|
||||
DEVLINK_ATTR_DPIPE_FIELD_ID = 0x3a
|
||||
DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH = 0x3b
|
||||
DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c
|
||||
DEVLINK_ATTR_PAD = 0x3d
|
||||
DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e
|
||||
DEVLINK_ATTR_MAX = 0x80
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
|
||||
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
|
||||
DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY = 0x0
|
||||
DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV4_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV6_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_HEADER_ETHERNET = 0x0
|
||||
DEVLINK_DPIPE_HEADER_IPV4 = 0x1
|
||||
DEVLINK_DPIPE_HEADER_IPV6 = 0x2
|
||||
)
|
||||
|
|
|
@ -2629,3 +2629,132 @@ const (
|
|||
SYSLOG_ACTION_SIZE_UNREAD = 9
|
||||
SYSLOG_ACTION_SIZE_BUFFER = 10
|
||||
)
|
||||
|
||||
const (
|
||||
DEVLINK_CMD_UNSPEC = 0x0
|
||||
DEVLINK_CMD_GET = 0x1
|
||||
DEVLINK_CMD_SET = 0x2
|
||||
DEVLINK_CMD_NEW = 0x3
|
||||
DEVLINK_CMD_DEL = 0x4
|
||||
DEVLINK_CMD_PORT_GET = 0x5
|
||||
DEVLINK_CMD_PORT_SET = 0x6
|
||||
DEVLINK_CMD_PORT_NEW = 0x7
|
||||
DEVLINK_CMD_PORT_DEL = 0x8
|
||||
DEVLINK_CMD_PORT_SPLIT = 0x9
|
||||
DEVLINK_CMD_PORT_UNSPLIT = 0xa
|
||||
DEVLINK_CMD_SB_GET = 0xb
|
||||
DEVLINK_CMD_SB_SET = 0xc
|
||||
DEVLINK_CMD_SB_NEW = 0xd
|
||||
DEVLINK_CMD_SB_DEL = 0xe
|
||||
DEVLINK_CMD_SB_POOL_GET = 0xf
|
||||
DEVLINK_CMD_SB_POOL_SET = 0x10
|
||||
DEVLINK_CMD_SB_POOL_NEW = 0x11
|
||||
DEVLINK_CMD_SB_POOL_DEL = 0x12
|
||||
DEVLINK_CMD_SB_PORT_POOL_GET = 0x13
|
||||
DEVLINK_CMD_SB_PORT_POOL_SET = 0x14
|
||||
DEVLINK_CMD_SB_PORT_POOL_NEW = 0x15
|
||||
DEVLINK_CMD_SB_PORT_POOL_DEL = 0x16
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_GET = 0x17
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_SET = 0x18
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_NEW = 0x19
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_DEL = 0x1a
|
||||
DEVLINK_CMD_SB_OCC_SNAPSHOT = 0x1b
|
||||
DEVLINK_CMD_SB_OCC_MAX_CLEAR = 0x1c
|
||||
DEVLINK_CMD_ESWITCH_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_SET = 0x1e
|
||||
DEVLINK_CMD_DPIPE_TABLE_GET = 0x1f
|
||||
DEVLINK_CMD_DPIPE_ENTRIES_GET = 0x20
|
||||
DEVLINK_CMD_DPIPE_HEADERS_GET = 0x21
|
||||
DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET = 0x22
|
||||
DEVLINK_CMD_MAX = 0x3c
|
||||
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
||||
DEVLINK_PORT_TYPE_AUTO = 0x1
|
||||
DEVLINK_PORT_TYPE_ETH = 0x2
|
||||
DEVLINK_PORT_TYPE_IB = 0x3
|
||||
DEVLINK_SB_POOL_TYPE_INGRESS = 0x0
|
||||
DEVLINK_SB_POOL_TYPE_EGRESS = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TYPE_STATIC = 0x0
|
||||
DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC = 0x1
|
||||
DEVLINK_ESWITCH_MODE_LEGACY = 0x0
|
||||
DEVLINK_ESWITCH_MODE_SWITCHDEV = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_INLINE_MODE_LINK = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NETWORK = 0x2
|
||||
DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 0x3
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 0x1
|
||||
DEVLINK_ATTR_UNSPEC = 0x0
|
||||
DEVLINK_ATTR_BUS_NAME = 0x1
|
||||
DEVLINK_ATTR_DEV_NAME = 0x2
|
||||
DEVLINK_ATTR_PORT_INDEX = 0x3
|
||||
DEVLINK_ATTR_PORT_TYPE = 0x4
|
||||
DEVLINK_ATTR_PORT_DESIRED_TYPE = 0x5
|
||||
DEVLINK_ATTR_PORT_NETDEV_IFINDEX = 0x6
|
||||
DEVLINK_ATTR_PORT_NETDEV_NAME = 0x7
|
||||
DEVLINK_ATTR_PORT_IBDEV_NAME = 0x8
|
||||
DEVLINK_ATTR_PORT_SPLIT_COUNT = 0x9
|
||||
DEVLINK_ATTR_PORT_SPLIT_GROUP = 0xa
|
||||
DEVLINK_ATTR_SB_INDEX = 0xb
|
||||
DEVLINK_ATTR_SB_SIZE = 0xc
|
||||
DEVLINK_ATTR_SB_INGRESS_POOL_COUNT = 0xd
|
||||
DEVLINK_ATTR_SB_EGRESS_POOL_COUNT = 0xe
|
||||
DEVLINK_ATTR_SB_INGRESS_TC_COUNT = 0xf
|
||||
DEVLINK_ATTR_SB_EGRESS_TC_COUNT = 0x10
|
||||
DEVLINK_ATTR_SB_POOL_INDEX = 0x11
|
||||
DEVLINK_ATTR_SB_POOL_TYPE = 0x12
|
||||
DEVLINK_ATTR_SB_POOL_SIZE = 0x13
|
||||
DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE = 0x14
|
||||
DEVLINK_ATTR_SB_THRESHOLD = 0x15
|
||||
DEVLINK_ATTR_SB_TC_INDEX = 0x16
|
||||
DEVLINK_ATTR_SB_OCC_CUR = 0x17
|
||||
DEVLINK_ATTR_SB_OCC_MAX = 0x18
|
||||
DEVLINK_ATTR_ESWITCH_MODE = 0x19
|
||||
DEVLINK_ATTR_ESWITCH_INLINE_MODE = 0x1a
|
||||
DEVLINK_ATTR_DPIPE_TABLES = 0x1b
|
||||
DEVLINK_ATTR_DPIPE_TABLE = 0x1c
|
||||
DEVLINK_ATTR_DPIPE_TABLE_NAME = 0x1d
|
||||
DEVLINK_ATTR_DPIPE_TABLE_SIZE = 0x1e
|
||||
DEVLINK_ATTR_DPIPE_TABLE_MATCHES = 0x1f
|
||||
DEVLINK_ATTR_DPIPE_TABLE_ACTIONS = 0x20
|
||||
DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED = 0x21
|
||||
DEVLINK_ATTR_DPIPE_ENTRIES = 0x22
|
||||
DEVLINK_ATTR_DPIPE_ENTRY = 0x23
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_INDEX = 0x24
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES = 0x25
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES = 0x26
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_COUNTER = 0x27
|
||||
DEVLINK_ATTR_DPIPE_MATCH = 0x28
|
||||
DEVLINK_ATTR_DPIPE_MATCH_VALUE = 0x29
|
||||
DEVLINK_ATTR_DPIPE_MATCH_TYPE = 0x2a
|
||||
DEVLINK_ATTR_DPIPE_ACTION = 0x2b
|
||||
DEVLINK_ATTR_DPIPE_ACTION_VALUE = 0x2c
|
||||
DEVLINK_ATTR_DPIPE_ACTION_TYPE = 0x2d
|
||||
DEVLINK_ATTR_DPIPE_VALUE = 0x2e
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MASK = 0x2f
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MAPPING = 0x30
|
||||
DEVLINK_ATTR_DPIPE_HEADERS = 0x31
|
||||
DEVLINK_ATTR_DPIPE_HEADER = 0x32
|
||||
DEVLINK_ATTR_DPIPE_HEADER_NAME = 0x33
|
||||
DEVLINK_ATTR_DPIPE_HEADER_ID = 0x34
|
||||
DEVLINK_ATTR_DPIPE_HEADER_FIELDS = 0x35
|
||||
DEVLINK_ATTR_DPIPE_HEADER_GLOBAL = 0x36
|
||||
DEVLINK_ATTR_DPIPE_HEADER_INDEX = 0x37
|
||||
DEVLINK_ATTR_DPIPE_FIELD = 0x38
|
||||
DEVLINK_ATTR_DPIPE_FIELD_NAME = 0x39
|
||||
DEVLINK_ATTR_DPIPE_FIELD_ID = 0x3a
|
||||
DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH = 0x3b
|
||||
DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c
|
||||
DEVLINK_ATTR_PAD = 0x3d
|
||||
DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e
|
||||
DEVLINK_ATTR_MAX = 0x80
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
|
||||
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
|
||||
DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY = 0x0
|
||||
DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV4_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV6_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_HEADER_ETHERNET = 0x0
|
||||
DEVLINK_DPIPE_HEADER_IPV4 = 0x1
|
||||
DEVLINK_DPIPE_HEADER_IPV6 = 0x2
|
||||
)
|
||||
|
|
|
@ -2647,3 +2647,132 @@ const (
|
|||
SYSLOG_ACTION_SIZE_UNREAD = 9
|
||||
SYSLOG_ACTION_SIZE_BUFFER = 10
|
||||
)
|
||||
|
||||
const (
|
||||
DEVLINK_CMD_UNSPEC = 0x0
|
||||
DEVLINK_CMD_GET = 0x1
|
||||
DEVLINK_CMD_SET = 0x2
|
||||
DEVLINK_CMD_NEW = 0x3
|
||||
DEVLINK_CMD_DEL = 0x4
|
||||
DEVLINK_CMD_PORT_GET = 0x5
|
||||
DEVLINK_CMD_PORT_SET = 0x6
|
||||
DEVLINK_CMD_PORT_NEW = 0x7
|
||||
DEVLINK_CMD_PORT_DEL = 0x8
|
||||
DEVLINK_CMD_PORT_SPLIT = 0x9
|
||||
DEVLINK_CMD_PORT_UNSPLIT = 0xa
|
||||
DEVLINK_CMD_SB_GET = 0xb
|
||||
DEVLINK_CMD_SB_SET = 0xc
|
||||
DEVLINK_CMD_SB_NEW = 0xd
|
||||
DEVLINK_CMD_SB_DEL = 0xe
|
||||
DEVLINK_CMD_SB_POOL_GET = 0xf
|
||||
DEVLINK_CMD_SB_POOL_SET = 0x10
|
||||
DEVLINK_CMD_SB_POOL_NEW = 0x11
|
||||
DEVLINK_CMD_SB_POOL_DEL = 0x12
|
||||
DEVLINK_CMD_SB_PORT_POOL_GET = 0x13
|
||||
DEVLINK_CMD_SB_PORT_POOL_SET = 0x14
|
||||
DEVLINK_CMD_SB_PORT_POOL_NEW = 0x15
|
||||
DEVLINK_CMD_SB_PORT_POOL_DEL = 0x16
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_GET = 0x17
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_SET = 0x18
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_NEW = 0x19
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_DEL = 0x1a
|
||||
DEVLINK_CMD_SB_OCC_SNAPSHOT = 0x1b
|
||||
DEVLINK_CMD_SB_OCC_MAX_CLEAR = 0x1c
|
||||
DEVLINK_CMD_ESWITCH_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_SET = 0x1e
|
||||
DEVLINK_CMD_DPIPE_TABLE_GET = 0x1f
|
||||
DEVLINK_CMD_DPIPE_ENTRIES_GET = 0x20
|
||||
DEVLINK_CMD_DPIPE_HEADERS_GET = 0x21
|
||||
DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET = 0x22
|
||||
DEVLINK_CMD_MAX = 0x3c
|
||||
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
||||
DEVLINK_PORT_TYPE_AUTO = 0x1
|
||||
DEVLINK_PORT_TYPE_ETH = 0x2
|
||||
DEVLINK_PORT_TYPE_IB = 0x3
|
||||
DEVLINK_SB_POOL_TYPE_INGRESS = 0x0
|
||||
DEVLINK_SB_POOL_TYPE_EGRESS = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TYPE_STATIC = 0x0
|
||||
DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC = 0x1
|
||||
DEVLINK_ESWITCH_MODE_LEGACY = 0x0
|
||||
DEVLINK_ESWITCH_MODE_SWITCHDEV = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_INLINE_MODE_LINK = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NETWORK = 0x2
|
||||
DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 0x3
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 0x1
|
||||
DEVLINK_ATTR_UNSPEC = 0x0
|
||||
DEVLINK_ATTR_BUS_NAME = 0x1
|
||||
DEVLINK_ATTR_DEV_NAME = 0x2
|
||||
DEVLINK_ATTR_PORT_INDEX = 0x3
|
||||
DEVLINK_ATTR_PORT_TYPE = 0x4
|
||||
DEVLINK_ATTR_PORT_DESIRED_TYPE = 0x5
|
||||
DEVLINK_ATTR_PORT_NETDEV_IFINDEX = 0x6
|
||||
DEVLINK_ATTR_PORT_NETDEV_NAME = 0x7
|
||||
DEVLINK_ATTR_PORT_IBDEV_NAME = 0x8
|
||||
DEVLINK_ATTR_PORT_SPLIT_COUNT = 0x9
|
||||
DEVLINK_ATTR_PORT_SPLIT_GROUP = 0xa
|
||||
DEVLINK_ATTR_SB_INDEX = 0xb
|
||||
DEVLINK_ATTR_SB_SIZE = 0xc
|
||||
DEVLINK_ATTR_SB_INGRESS_POOL_COUNT = 0xd
|
||||
DEVLINK_ATTR_SB_EGRESS_POOL_COUNT = 0xe
|
||||
DEVLINK_ATTR_SB_INGRESS_TC_COUNT = 0xf
|
||||
DEVLINK_ATTR_SB_EGRESS_TC_COUNT = 0x10
|
||||
DEVLINK_ATTR_SB_POOL_INDEX = 0x11
|
||||
DEVLINK_ATTR_SB_POOL_TYPE = 0x12
|
||||
DEVLINK_ATTR_SB_POOL_SIZE = 0x13
|
||||
DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE = 0x14
|
||||
DEVLINK_ATTR_SB_THRESHOLD = 0x15
|
||||
DEVLINK_ATTR_SB_TC_INDEX = 0x16
|
||||
DEVLINK_ATTR_SB_OCC_CUR = 0x17
|
||||
DEVLINK_ATTR_SB_OCC_MAX = 0x18
|
||||
DEVLINK_ATTR_ESWITCH_MODE = 0x19
|
||||
DEVLINK_ATTR_ESWITCH_INLINE_MODE = 0x1a
|
||||
DEVLINK_ATTR_DPIPE_TABLES = 0x1b
|
||||
DEVLINK_ATTR_DPIPE_TABLE = 0x1c
|
||||
DEVLINK_ATTR_DPIPE_TABLE_NAME = 0x1d
|
||||
DEVLINK_ATTR_DPIPE_TABLE_SIZE = 0x1e
|
||||
DEVLINK_ATTR_DPIPE_TABLE_MATCHES = 0x1f
|
||||
DEVLINK_ATTR_DPIPE_TABLE_ACTIONS = 0x20
|
||||
DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED = 0x21
|
||||
DEVLINK_ATTR_DPIPE_ENTRIES = 0x22
|
||||
DEVLINK_ATTR_DPIPE_ENTRY = 0x23
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_INDEX = 0x24
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES = 0x25
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES = 0x26
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_COUNTER = 0x27
|
||||
DEVLINK_ATTR_DPIPE_MATCH = 0x28
|
||||
DEVLINK_ATTR_DPIPE_MATCH_VALUE = 0x29
|
||||
DEVLINK_ATTR_DPIPE_MATCH_TYPE = 0x2a
|
||||
DEVLINK_ATTR_DPIPE_ACTION = 0x2b
|
||||
DEVLINK_ATTR_DPIPE_ACTION_VALUE = 0x2c
|
||||
DEVLINK_ATTR_DPIPE_ACTION_TYPE = 0x2d
|
||||
DEVLINK_ATTR_DPIPE_VALUE = 0x2e
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MASK = 0x2f
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MAPPING = 0x30
|
||||
DEVLINK_ATTR_DPIPE_HEADERS = 0x31
|
||||
DEVLINK_ATTR_DPIPE_HEADER = 0x32
|
||||
DEVLINK_ATTR_DPIPE_HEADER_NAME = 0x33
|
||||
DEVLINK_ATTR_DPIPE_HEADER_ID = 0x34
|
||||
DEVLINK_ATTR_DPIPE_HEADER_FIELDS = 0x35
|
||||
DEVLINK_ATTR_DPIPE_HEADER_GLOBAL = 0x36
|
||||
DEVLINK_ATTR_DPIPE_HEADER_INDEX = 0x37
|
||||
DEVLINK_ATTR_DPIPE_FIELD = 0x38
|
||||
DEVLINK_ATTR_DPIPE_FIELD_NAME = 0x39
|
||||
DEVLINK_ATTR_DPIPE_FIELD_ID = 0x3a
|
||||
DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH = 0x3b
|
||||
DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c
|
||||
DEVLINK_ATTR_PAD = 0x3d
|
||||
DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e
|
||||
DEVLINK_ATTR_MAX = 0x80
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
|
||||
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
|
||||
DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY = 0x0
|
||||
DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV4_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV6_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_HEADER_ETHERNET = 0x0
|
||||
DEVLINK_DPIPE_HEADER_IPV4 = 0x1
|
||||
DEVLINK_DPIPE_HEADER_IPV6 = 0x2
|
||||
)
|
||||
|
|
|
@ -2643,3 +2643,132 @@ const (
|
|||
SYSLOG_ACTION_SIZE_UNREAD = 9
|
||||
SYSLOG_ACTION_SIZE_BUFFER = 10
|
||||
)
|
||||
|
||||
const (
|
||||
DEVLINK_CMD_UNSPEC = 0x0
|
||||
DEVLINK_CMD_GET = 0x1
|
||||
DEVLINK_CMD_SET = 0x2
|
||||
DEVLINK_CMD_NEW = 0x3
|
||||
DEVLINK_CMD_DEL = 0x4
|
||||
DEVLINK_CMD_PORT_GET = 0x5
|
||||
DEVLINK_CMD_PORT_SET = 0x6
|
||||
DEVLINK_CMD_PORT_NEW = 0x7
|
||||
DEVLINK_CMD_PORT_DEL = 0x8
|
||||
DEVLINK_CMD_PORT_SPLIT = 0x9
|
||||
DEVLINK_CMD_PORT_UNSPLIT = 0xa
|
||||
DEVLINK_CMD_SB_GET = 0xb
|
||||
DEVLINK_CMD_SB_SET = 0xc
|
||||
DEVLINK_CMD_SB_NEW = 0xd
|
||||
DEVLINK_CMD_SB_DEL = 0xe
|
||||
DEVLINK_CMD_SB_POOL_GET = 0xf
|
||||
DEVLINK_CMD_SB_POOL_SET = 0x10
|
||||
DEVLINK_CMD_SB_POOL_NEW = 0x11
|
||||
DEVLINK_CMD_SB_POOL_DEL = 0x12
|
||||
DEVLINK_CMD_SB_PORT_POOL_GET = 0x13
|
||||
DEVLINK_CMD_SB_PORT_POOL_SET = 0x14
|
||||
DEVLINK_CMD_SB_PORT_POOL_NEW = 0x15
|
||||
DEVLINK_CMD_SB_PORT_POOL_DEL = 0x16
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_GET = 0x17
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_SET = 0x18
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_NEW = 0x19
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_DEL = 0x1a
|
||||
DEVLINK_CMD_SB_OCC_SNAPSHOT = 0x1b
|
||||
DEVLINK_CMD_SB_OCC_MAX_CLEAR = 0x1c
|
||||
DEVLINK_CMD_ESWITCH_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_SET = 0x1e
|
||||
DEVLINK_CMD_DPIPE_TABLE_GET = 0x1f
|
||||
DEVLINK_CMD_DPIPE_ENTRIES_GET = 0x20
|
||||
DEVLINK_CMD_DPIPE_HEADERS_GET = 0x21
|
||||
DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET = 0x22
|
||||
DEVLINK_CMD_MAX = 0x3c
|
||||
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
||||
DEVLINK_PORT_TYPE_AUTO = 0x1
|
||||
DEVLINK_PORT_TYPE_ETH = 0x2
|
||||
DEVLINK_PORT_TYPE_IB = 0x3
|
||||
DEVLINK_SB_POOL_TYPE_INGRESS = 0x0
|
||||
DEVLINK_SB_POOL_TYPE_EGRESS = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TYPE_STATIC = 0x0
|
||||
DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC = 0x1
|
||||
DEVLINK_ESWITCH_MODE_LEGACY = 0x0
|
||||
DEVLINK_ESWITCH_MODE_SWITCHDEV = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_INLINE_MODE_LINK = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NETWORK = 0x2
|
||||
DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 0x3
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 0x1
|
||||
DEVLINK_ATTR_UNSPEC = 0x0
|
||||
DEVLINK_ATTR_BUS_NAME = 0x1
|
||||
DEVLINK_ATTR_DEV_NAME = 0x2
|
||||
DEVLINK_ATTR_PORT_INDEX = 0x3
|
||||
DEVLINK_ATTR_PORT_TYPE = 0x4
|
||||
DEVLINK_ATTR_PORT_DESIRED_TYPE = 0x5
|
||||
DEVLINK_ATTR_PORT_NETDEV_IFINDEX = 0x6
|
||||
DEVLINK_ATTR_PORT_NETDEV_NAME = 0x7
|
||||
DEVLINK_ATTR_PORT_IBDEV_NAME = 0x8
|
||||
DEVLINK_ATTR_PORT_SPLIT_COUNT = 0x9
|
||||
DEVLINK_ATTR_PORT_SPLIT_GROUP = 0xa
|
||||
DEVLINK_ATTR_SB_INDEX = 0xb
|
||||
DEVLINK_ATTR_SB_SIZE = 0xc
|
||||
DEVLINK_ATTR_SB_INGRESS_POOL_COUNT = 0xd
|
||||
DEVLINK_ATTR_SB_EGRESS_POOL_COUNT = 0xe
|
||||
DEVLINK_ATTR_SB_INGRESS_TC_COUNT = 0xf
|
||||
DEVLINK_ATTR_SB_EGRESS_TC_COUNT = 0x10
|
||||
DEVLINK_ATTR_SB_POOL_INDEX = 0x11
|
||||
DEVLINK_ATTR_SB_POOL_TYPE = 0x12
|
||||
DEVLINK_ATTR_SB_POOL_SIZE = 0x13
|
||||
DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE = 0x14
|
||||
DEVLINK_ATTR_SB_THRESHOLD = 0x15
|
||||
DEVLINK_ATTR_SB_TC_INDEX = 0x16
|
||||
DEVLINK_ATTR_SB_OCC_CUR = 0x17
|
||||
DEVLINK_ATTR_SB_OCC_MAX = 0x18
|
||||
DEVLINK_ATTR_ESWITCH_MODE = 0x19
|
||||
DEVLINK_ATTR_ESWITCH_INLINE_MODE = 0x1a
|
||||
DEVLINK_ATTR_DPIPE_TABLES = 0x1b
|
||||
DEVLINK_ATTR_DPIPE_TABLE = 0x1c
|
||||
DEVLINK_ATTR_DPIPE_TABLE_NAME = 0x1d
|
||||
DEVLINK_ATTR_DPIPE_TABLE_SIZE = 0x1e
|
||||
DEVLINK_ATTR_DPIPE_TABLE_MATCHES = 0x1f
|
||||
DEVLINK_ATTR_DPIPE_TABLE_ACTIONS = 0x20
|
||||
DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED = 0x21
|
||||
DEVLINK_ATTR_DPIPE_ENTRIES = 0x22
|
||||
DEVLINK_ATTR_DPIPE_ENTRY = 0x23
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_INDEX = 0x24
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES = 0x25
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES = 0x26
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_COUNTER = 0x27
|
||||
DEVLINK_ATTR_DPIPE_MATCH = 0x28
|
||||
DEVLINK_ATTR_DPIPE_MATCH_VALUE = 0x29
|
||||
DEVLINK_ATTR_DPIPE_MATCH_TYPE = 0x2a
|
||||
DEVLINK_ATTR_DPIPE_ACTION = 0x2b
|
||||
DEVLINK_ATTR_DPIPE_ACTION_VALUE = 0x2c
|
||||
DEVLINK_ATTR_DPIPE_ACTION_TYPE = 0x2d
|
||||
DEVLINK_ATTR_DPIPE_VALUE = 0x2e
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MASK = 0x2f
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MAPPING = 0x30
|
||||
DEVLINK_ATTR_DPIPE_HEADERS = 0x31
|
||||
DEVLINK_ATTR_DPIPE_HEADER = 0x32
|
||||
DEVLINK_ATTR_DPIPE_HEADER_NAME = 0x33
|
||||
DEVLINK_ATTR_DPIPE_HEADER_ID = 0x34
|
||||
DEVLINK_ATTR_DPIPE_HEADER_FIELDS = 0x35
|
||||
DEVLINK_ATTR_DPIPE_HEADER_GLOBAL = 0x36
|
||||
DEVLINK_ATTR_DPIPE_HEADER_INDEX = 0x37
|
||||
DEVLINK_ATTR_DPIPE_FIELD = 0x38
|
||||
DEVLINK_ATTR_DPIPE_FIELD_NAME = 0x39
|
||||
DEVLINK_ATTR_DPIPE_FIELD_ID = 0x3a
|
||||
DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH = 0x3b
|
||||
DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c
|
||||
DEVLINK_ATTR_PAD = 0x3d
|
||||
DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e
|
||||
DEVLINK_ATTR_MAX = 0x80
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
|
||||
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
|
||||
DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY = 0x0
|
||||
DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV4_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV6_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_HEADER_ETHERNET = 0x0
|
||||
DEVLINK_DPIPE_HEADER_IPV4 = 0x1
|
||||
DEVLINK_DPIPE_HEADER_IPV6 = 0x2
|
||||
)
|
||||
|
|
|
@ -2624,3 +2624,132 @@ const (
|
|||
SYSLOG_ACTION_SIZE_UNREAD = 9
|
||||
SYSLOG_ACTION_SIZE_BUFFER = 10
|
||||
)
|
||||
|
||||
const (
|
||||
DEVLINK_CMD_UNSPEC = 0x0
|
||||
DEVLINK_CMD_GET = 0x1
|
||||
DEVLINK_CMD_SET = 0x2
|
||||
DEVLINK_CMD_NEW = 0x3
|
||||
DEVLINK_CMD_DEL = 0x4
|
||||
DEVLINK_CMD_PORT_GET = 0x5
|
||||
DEVLINK_CMD_PORT_SET = 0x6
|
||||
DEVLINK_CMD_PORT_NEW = 0x7
|
||||
DEVLINK_CMD_PORT_DEL = 0x8
|
||||
DEVLINK_CMD_PORT_SPLIT = 0x9
|
||||
DEVLINK_CMD_PORT_UNSPLIT = 0xa
|
||||
DEVLINK_CMD_SB_GET = 0xb
|
||||
DEVLINK_CMD_SB_SET = 0xc
|
||||
DEVLINK_CMD_SB_NEW = 0xd
|
||||
DEVLINK_CMD_SB_DEL = 0xe
|
||||
DEVLINK_CMD_SB_POOL_GET = 0xf
|
||||
DEVLINK_CMD_SB_POOL_SET = 0x10
|
||||
DEVLINK_CMD_SB_POOL_NEW = 0x11
|
||||
DEVLINK_CMD_SB_POOL_DEL = 0x12
|
||||
DEVLINK_CMD_SB_PORT_POOL_GET = 0x13
|
||||
DEVLINK_CMD_SB_PORT_POOL_SET = 0x14
|
||||
DEVLINK_CMD_SB_PORT_POOL_NEW = 0x15
|
||||
DEVLINK_CMD_SB_PORT_POOL_DEL = 0x16
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_GET = 0x17
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_SET = 0x18
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_NEW = 0x19
|
||||
DEVLINK_CMD_SB_TC_POOL_BIND_DEL = 0x1a
|
||||
DEVLINK_CMD_SB_OCC_SNAPSHOT = 0x1b
|
||||
DEVLINK_CMD_SB_OCC_MAX_CLEAR = 0x1c
|
||||
DEVLINK_CMD_ESWITCH_GET = 0x1d
|
||||
DEVLINK_CMD_ESWITCH_SET = 0x1e
|
||||
DEVLINK_CMD_DPIPE_TABLE_GET = 0x1f
|
||||
DEVLINK_CMD_DPIPE_ENTRIES_GET = 0x20
|
||||
DEVLINK_CMD_DPIPE_HEADERS_GET = 0x21
|
||||
DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET = 0x22
|
||||
DEVLINK_CMD_MAX = 0x3c
|
||||
DEVLINK_PORT_TYPE_NOTSET = 0x0
|
||||
DEVLINK_PORT_TYPE_AUTO = 0x1
|
||||
DEVLINK_PORT_TYPE_ETH = 0x2
|
||||
DEVLINK_PORT_TYPE_IB = 0x3
|
||||
DEVLINK_SB_POOL_TYPE_INGRESS = 0x0
|
||||
DEVLINK_SB_POOL_TYPE_EGRESS = 0x1
|
||||
DEVLINK_SB_THRESHOLD_TYPE_STATIC = 0x0
|
||||
DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC = 0x1
|
||||
DEVLINK_ESWITCH_MODE_LEGACY = 0x0
|
||||
DEVLINK_ESWITCH_MODE_SWITCHDEV = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_INLINE_MODE_LINK = 0x1
|
||||
DEVLINK_ESWITCH_INLINE_MODE_NETWORK = 0x2
|
||||
DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 0x3
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_NONE = 0x0
|
||||
DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 0x1
|
||||
DEVLINK_ATTR_UNSPEC = 0x0
|
||||
DEVLINK_ATTR_BUS_NAME = 0x1
|
||||
DEVLINK_ATTR_DEV_NAME = 0x2
|
||||
DEVLINK_ATTR_PORT_INDEX = 0x3
|
||||
DEVLINK_ATTR_PORT_TYPE = 0x4
|
||||
DEVLINK_ATTR_PORT_DESIRED_TYPE = 0x5
|
||||
DEVLINK_ATTR_PORT_NETDEV_IFINDEX = 0x6
|
||||
DEVLINK_ATTR_PORT_NETDEV_NAME = 0x7
|
||||
DEVLINK_ATTR_PORT_IBDEV_NAME = 0x8
|
||||
DEVLINK_ATTR_PORT_SPLIT_COUNT = 0x9
|
||||
DEVLINK_ATTR_PORT_SPLIT_GROUP = 0xa
|
||||
DEVLINK_ATTR_SB_INDEX = 0xb
|
||||
DEVLINK_ATTR_SB_SIZE = 0xc
|
||||
DEVLINK_ATTR_SB_INGRESS_POOL_COUNT = 0xd
|
||||
DEVLINK_ATTR_SB_EGRESS_POOL_COUNT = 0xe
|
||||
DEVLINK_ATTR_SB_INGRESS_TC_COUNT = 0xf
|
||||
DEVLINK_ATTR_SB_EGRESS_TC_COUNT = 0x10
|
||||
DEVLINK_ATTR_SB_POOL_INDEX = 0x11
|
||||
DEVLINK_ATTR_SB_POOL_TYPE = 0x12
|
||||
DEVLINK_ATTR_SB_POOL_SIZE = 0x13
|
||||
DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE = 0x14
|
||||
DEVLINK_ATTR_SB_THRESHOLD = 0x15
|
||||
DEVLINK_ATTR_SB_TC_INDEX = 0x16
|
||||
DEVLINK_ATTR_SB_OCC_CUR = 0x17
|
||||
DEVLINK_ATTR_SB_OCC_MAX = 0x18
|
||||
DEVLINK_ATTR_ESWITCH_MODE = 0x19
|
||||
DEVLINK_ATTR_ESWITCH_INLINE_MODE = 0x1a
|
||||
DEVLINK_ATTR_DPIPE_TABLES = 0x1b
|
||||
DEVLINK_ATTR_DPIPE_TABLE = 0x1c
|
||||
DEVLINK_ATTR_DPIPE_TABLE_NAME = 0x1d
|
||||
DEVLINK_ATTR_DPIPE_TABLE_SIZE = 0x1e
|
||||
DEVLINK_ATTR_DPIPE_TABLE_MATCHES = 0x1f
|
||||
DEVLINK_ATTR_DPIPE_TABLE_ACTIONS = 0x20
|
||||
DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED = 0x21
|
||||
DEVLINK_ATTR_DPIPE_ENTRIES = 0x22
|
||||
DEVLINK_ATTR_DPIPE_ENTRY = 0x23
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_INDEX = 0x24
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES = 0x25
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES = 0x26
|
||||
DEVLINK_ATTR_DPIPE_ENTRY_COUNTER = 0x27
|
||||
DEVLINK_ATTR_DPIPE_MATCH = 0x28
|
||||
DEVLINK_ATTR_DPIPE_MATCH_VALUE = 0x29
|
||||
DEVLINK_ATTR_DPIPE_MATCH_TYPE = 0x2a
|
||||
DEVLINK_ATTR_DPIPE_ACTION = 0x2b
|
||||
DEVLINK_ATTR_DPIPE_ACTION_VALUE = 0x2c
|
||||
DEVLINK_ATTR_DPIPE_ACTION_TYPE = 0x2d
|
||||
DEVLINK_ATTR_DPIPE_VALUE = 0x2e
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MASK = 0x2f
|
||||
DEVLINK_ATTR_DPIPE_VALUE_MAPPING = 0x30
|
||||
DEVLINK_ATTR_DPIPE_HEADERS = 0x31
|
||||
DEVLINK_ATTR_DPIPE_HEADER = 0x32
|
||||
DEVLINK_ATTR_DPIPE_HEADER_NAME = 0x33
|
||||
DEVLINK_ATTR_DPIPE_HEADER_ID = 0x34
|
||||
DEVLINK_ATTR_DPIPE_HEADER_FIELDS = 0x35
|
||||
DEVLINK_ATTR_DPIPE_HEADER_GLOBAL = 0x36
|
||||
DEVLINK_ATTR_DPIPE_HEADER_INDEX = 0x37
|
||||
DEVLINK_ATTR_DPIPE_FIELD = 0x38
|
||||
DEVLINK_ATTR_DPIPE_FIELD_NAME = 0x39
|
||||
DEVLINK_ATTR_DPIPE_FIELD_ID = 0x3a
|
||||
DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH = 0x3b
|
||||
DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c
|
||||
DEVLINK_ATTR_PAD = 0x3d
|
||||
DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e
|
||||
DEVLINK_ATTR_MAX = 0x80
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
|
||||
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
|
||||
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
|
||||
DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY = 0x0
|
||||
DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV4_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_FIELD_IPV6_DST_IP = 0x0
|
||||
DEVLINK_DPIPE_HEADER_ETHERNET = 0x0
|
||||
DEVLINK_DPIPE_HEADER_IPV4 = 0x1
|
||||
DEVLINK_DPIPE_HEADER_IPV6 = 0x2
|
||||
)
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !go1.12
|
||||
|
||||
// This file is here to allow bodyless functions with go:linkname for Go 1.11
|
||||
// and earlier (see https://golang.org/issue/23311).
|
|
@ -229,13 +229,15 @@ func LookupSID(system, account string) (sid *SID, domain string, accType uint32,
|
|||
|
||||
// String converts SID to a string format suitable for display, storage, or transmission.
|
||||
func (sid *SID) String() string {
|
||||
// From https://docs.microsoft.com/en-us/windows/win32/secbiomet/general-constants
|
||||
const SecurityMaxSidSize = 68
|
||||
var s *uint16
|
||||
e := ConvertSidToStringSid(sid, &s)
|
||||
if e != nil {
|
||||
return ""
|
||||
}
|
||||
defer LocalFree((Handle)(unsafe.Pointer(s)))
|
||||
return UTF16ToString((*[(1 << 30) - 1]uint16)(unsafe.Pointer(s))[:])
|
||||
return UTF16ToString((*[SecurityMaxSidSize]uint16)(unsafe.Pointer(s))[:])
|
||||
}
|
||||
|
||||
// Len returns the length, in bytes, of a valid security identifier SID.
|
||||
|
|
|
@ -314,6 +314,9 @@ func NewCallbackCDecl(fn interface{}) uintptr {
|
|||
//sys rtlGetVersion(info *OsVersionInfoEx) (ret error) = ntdll.RtlGetVersion
|
||||
//sys rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNumber *uint32) = ntdll.RtlGetNtVersionNumbers
|
||||
|
||||
// Process Status API (PSAPI)
|
||||
//sys EnumProcesses(processIds []uint32, bytesReturned *uint32) (err error) = psapi.EnumProcesses
|
||||
|
||||
// syscall interface implementation for other packages
|
||||
|
||||
// GetCurrentProcess returns the handle for the current process.
|
||||
|
@ -410,7 +413,11 @@ func Open(path string, mode int, perm uint32) (fd Handle, err error) {
|
|||
default:
|
||||
createmode = OPEN_EXISTING
|
||||
}
|
||||
h, e := CreateFile(pathp, access, sharemode, sa, createmode, FILE_ATTRIBUTE_NORMAL, 0)
|
||||
var attrs uint32 = FILE_ATTRIBUTE_NORMAL
|
||||
if perm&S_IWRITE == 0 {
|
||||
attrs = FILE_ATTRIBUTE_READONLY
|
||||
}
|
||||
h, e := CreateFile(pathp, access, sharemode, sa, createmode, attrs, 0)
|
||||
return h, e
|
||||
}
|
||||
|
||||
|
@ -857,7 +864,7 @@ func (rsa *RawSockaddrAny) Sockaddr() (Sockaddr, error) {
|
|||
for n < len(pp.Path) && pp.Path[n] != 0 {
|
||||
n++
|
||||
}
|
||||
bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
|
||||
bytes := (*[len(pp.Path)]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
|
||||
sa.Name = string(bytes)
|
||||
return sa, nil
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ var (
|
|||
moduser32 = NewLazySystemDLL("user32.dll")
|
||||
modole32 = NewLazySystemDLL("ole32.dll")
|
||||
modntdll = NewLazySystemDLL("ntdll.dll")
|
||||
modpsapi = NewLazySystemDLL("psapi.dll")
|
||||
modws2_32 = NewLazySystemDLL("ws2_32.dll")
|
||||
moddnsapi = NewLazySystemDLL("dnsapi.dll")
|
||||
modiphlpapi = NewLazySystemDLL("iphlpapi.dll")
|
||||
|
@ -247,6 +248,7 @@ var (
|
|||
procCoTaskMemFree = modole32.NewProc("CoTaskMemFree")
|
||||
procRtlGetVersion = modntdll.NewProc("RtlGetVersion")
|
||||
procRtlGetNtVersionNumbers = modntdll.NewProc("RtlGetNtVersionNumbers")
|
||||
procEnumProcesses = modpsapi.NewProc("EnumProcesses")
|
||||
procWSAStartup = modws2_32.NewProc("WSAStartup")
|
||||
procWSACleanup = modws2_32.NewProc("WSACleanup")
|
||||
procWSAIoctl = modws2_32.NewProc("WSAIoctl")
|
||||
|
@ -2758,6 +2760,22 @@ func rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNum
|
|||
return
|
||||
}
|
||||
|
||||
func EnumProcesses(processIds []uint32, bytesReturned *uint32) (err error) {
|
||||
var _p0 *uint32
|
||||
if len(processIds) > 0 {
|
||||
_p0 = &processIds[0]
|
||||
}
|
||||
r1, _, e1 := syscall.Syscall(procEnumProcesses.Addr(), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(processIds)), uintptr(unsafe.Pointer(bytesReturned)))
|
||||
if r1 == 0 {
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
} else {
|
||||
err = syscall.EINVAL
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func WSAStartup(verreq uint32, data *WSAData) (sockerr error) {
|
||||
r0, _, _ := syscall.Syscall(procWSAStartup.Addr(), 2, uintptr(verreq), uintptr(unsafe.Pointer(data)), 0)
|
||||
if r0 != 0 {
|
||||
|
|
|
@ -392,6 +392,8 @@ github.com/status-im/status-protocol-go/transport/whisper/types
|
|||
github.com/status-im/status-protocol-go/types
|
||||
github.com/status-im/status-protocol-go/v1
|
||||
github.com/status-im/status-protocol-go/zaputil
|
||||
# github.com/status-im/tcp-shaker v0.0.0-20191114194237-215893130501
|
||||
github.com/status-im/tcp-shaker
|
||||
# github.com/status-im/whisper v1.5.2
|
||||
github.com/status-im/whisper/whisperv6
|
||||
# github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570
|
||||
|
@ -499,7 +501,7 @@ golang.org/x/net/internal/socket
|
|||
golang.org/x/net/ipv4
|
||||
# golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
|
||||
golang.org/x/sync/syncmap
|
||||
# golang.org/x/sys v0.0.0-20191010194322-b09406accb47
|
||||
# golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056
|
||||
golang.org/x/sys/cpu
|
||||
golang.org/x/sys/unix
|
||||
golang.org/x/sys/windows
|
||||
|
|
Loading…
Reference in New Issue