From 02ace152db77f34a4dac4b5fc7a06f25c2d5b847 Mon Sep 17 00:00:00 2001 From: Johnson Xu <76180190+jxx-gg@users.noreply.github.com> Date: Thu, 25 Feb 2021 16:27:28 -0500 Subject: [PATCH 1/3] Refactor client.Run and add conn.go (#17) * refactor code * to address aaronbee's comments * better handling error in client.Start() * more update to ensure client.Cancel is always called after client.Start * call cancel as defer --- cmd/client/client.go | 22 ++--- go.mod | 1 + go.sum | 2 + tunnel/conn.go | 211 ++++++++++++++++++++++++++++++++++++++++ tunnel/tunnel.go | 219 ++++++++++++++++++++++-------------------- tunnel/tunnel_test.go | 30 +++++- 6 files changed, 363 insertions(+), 122 deletions(-) create mode 100644 tunnel/conn.go diff --git a/cmd/client/client.go b/cmd/client/client.go index 0ca2ef8..34ef666 100644 --- a/cmd/client/client.go +++ b/cmd/client/client.go @@ -155,31 +155,23 @@ func Run(ctx context.Context, conf Config) error { errCh := make(chan error, 2) go func() { - err := client.Run(ctx) - if err != nil { + if err := client.Register(ctx); err != nil { + errCh <- err + return + } + client.Start(ctx) + if err := client.Error(); err != nil { errCh <- err } }() // listen for any request to create a new session - cancels := make(map[tunnel.Target]func()) select { case target := <-peerAddCh: - ctx, cancels[target] = context.WithCancel(ctx) - if err := listen(ctx, client, conf.ListenAddress, target); err != nil { - errCh <- err - cancels[target]() - } - case target := <-peerDelCh: - cancels[target]() - delete(cancels, target) - } - - select { + return listen(ctx, client, conf.ListenAddress, target) case <-ctx.Done(): return ctx.Err() case err := <-errCh: return err } - } diff --git a/go.mod b/go.mod index 54ff57f..bb8a702 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/openconfig/grpctunnel go 1.14 require ( + github.com/cenkalti/backoff/v4 v4.1.0 // indirect github.com/golang/protobuf v1.4.3 google.golang.org/grpc v1.34.0 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 // indirect diff --git a/go.sum b/go.sum index a38e4dd..4545577 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/cenkalti/backoff/v4 v4.1.0 h1:c8LkOFQTzuO0WBM/ae5HdGQuZPfPxp7lqBRwQRm4fSc= +github.com/cenkalti/backoff/v4 v4.1.0/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= diff --git a/tunnel/conn.go b/tunnel/conn.go new file mode 100644 index 0000000..c323f90 --- /dev/null +++ b/tunnel/conn.go @@ -0,0 +1,211 @@ +package tunnel + +import ( + "context" + "fmt" + "io" + "log" + "net" + "strings" + "time" + + "github.com/cenkalti/backoff/v4" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + + tpb "github.com/openconfig/grpctunnel/proto/tunnel" +) + +var ( + // RetryBaseDelay is the initial retry interval for re-connecting tunnel server/client. + RetryBaseDelay = time.Second + // RetryMaxDelay caps the retry interval for re-connecting attempts. + RetryMaxDelay = time.Minute + // RetryRandomization is the randomization factor applied to the retry + // interval. + RetryRandomization = 0.5 +) + +// Conn is a wraper as a net.Conn interface. +type Conn struct { + io.ReadWriteCloser +} + +// LocalAddr is trivial implementation, in order to match interface net.Conn. +func (tc *Conn) LocalAddr() net.Addr { return nil } + +// RemoteAddr is trivial implementation, in order to match interface net.Conn. +func (tc *Conn) RemoteAddr() net.Addr { return nil } + +// SetDeadline is trivial implementation, in order to match interface net.Conn. +func (tc *Conn) SetDeadline(t time.Time) error { return nil } + +// SetReadDeadline is trivial implementation, in order to match interface net.Conn. +func (tc *Conn) SetReadDeadline(t time.Time) error { return nil } + +// SetWriteDeadline is trivial implementation, in order to match interface net.Conn. +func (tc *Conn) SetWriteDeadline(t time.Time) error { return nil } + +// ServerConn (re-)tries and returns a tunnel connection. +func ServerConn(ctx context.Context, ts *Server, addr string, target *Target) (*Conn, error) { + bo := backoff.NewExponentialBackOff() + bo.MaxElapsedTime = 0 // Retry Subscribe indefinitely. + bo.InitialInterval = RetryBaseDelay + bo.MaxInterval = RetryMaxDelay + bo.RandomizationFactor = RetryRandomization + + for { + session, err := ts.NewSession(ctx, ServerSession{Target: *target}) + if err == nil { + return &Conn{session}, nil + } + duration := bo.NextBackOff() + log.Printf("Failed to get tunnel connection: %v.\nRetrying in %s.", err, duration) + time.Sleep(duration) + + select { + case <-ctx.Done(): + return nil, ctx.Err() + default: + } + + } + +} + +func registerTunnelClient(ctx context.Context, addr string, cert string, l *Listener, + targets map[Target]struct{}) (*Client, error) { + opts := []grpc.DialOption{grpc.WithDefaultCallOptions()} + if cert == "" { + opts = append(opts, grpc.WithInsecure()) + } else { + creds, err := credentials.NewClientTLSFromFile(cert, "") + if err != nil { + return nil, fmt.Errorf("failed to load credentials: %v", err) + } + opts = append(opts, grpc.WithTransportCredentials(creds)) + } + var err error + l.cc, err = grpc.Dial(addr, opts...) + if err != nil { + return nil, fmt.Errorf("grpc dial error: %v", err) + } + + registerHandler := func(t Target) error { + if _, ok := targets[t]; !ok { + return fmt.Errorf("client cannot handle target ID: %s, type: %s", t.ID, t.Type) + } + log.Printf("register handler received id: %v, type: %v", t.ID, t.Type) + return nil + } + + handler := func(t Target, i io.ReadWriteCloser) error { + log.Printf("handler called for id: %v, type: %v", t.ID, t.Type) + l.chIO <- i + return nil + } + + client, err := NewClient(tpb.NewTunnelClient(l.cc), ClientConfig{ + RegisterHandler: registerHandler, + Handler: handler, + }, targets) + if err != nil { + return nil, fmt.Errorf("failed to create tunnel client: %v", err) + } + if err := client.Register(ctx); err != nil { + return nil, err + } + return client, nil +} + +// Listener wraps a tunnel connection. +type Listener struct { + conn []io.ReadWriteCloser + addr tunnelAddr + chIO chan io.ReadWriteCloser + chErr chan error + cc *grpc.ClientConn +} + +// Accept waits and returns a tunnel connection. +func (l *Listener) Accept() (net.Conn, error) { + select { + case err := <-l.chErr: + return nil, fmt.Errorf("failed to get tunnel listener: %v", err) + case conn := <-l.chIO: + l.conn = append(l.conn, conn) + log.Printf("tunnel listen setup") + return &Conn{conn}, nil + } +} + +// Close close the embedded connection. Will need more implementation to handle multiple connections. +func (l *Listener) Close() error { + var errs []string + if l.cc != nil { + if e := l.cc.Close(); e != nil { + errs = append(errs, fmt.Sprintf("failed to close listener.cc: %v", e)) + } + } + + if l.conn != nil { + for _, conn := range l.conn { + if e := conn.Close(); e != nil { + errs = append(errs, fmt.Sprintf("failed to close listener.conn: %v", e)) + } + } + } + if len(errs) > 0 { + return fmt.Errorf(strings.Join(errs, "\n")) + } + return nil +} + +// Addr is a trivial implementation. +func (l *Listener) Addr() net.Addr { return l.addr } + +type tunnelAddr struct { + network string + address string +} + +func (a tunnelAddr) Network() string { return a.network } +func (a tunnelAddr) String() string { return a.address } + +// Listen create a tunnel client and returns a Listener. +func Listen(ctx context.Context, addr string, cert string, targets map[Target]struct{}) (net.Listener, error) { + l := &Listener{} + l.addr = tunnelAddr{network: "tcp", address: addr} + l.chErr = make(chan error) + l.chIO = make(chan io.ReadWriteCloser) + + // Doing a for loop so that it will retry even the tunnel server is not reachable. + bo := backoff.NewExponentialBackOff() + bo.MaxElapsedTime = 0 // Retry Subscribe indefinitely. + bo.InitialInterval = RetryBaseDelay + bo.MaxInterval = RetryMaxDelay + bo.RandomizationFactor = RetryRandomization + + for { + if c, err := registerTunnelClient(ctx, addr, cert, l, targets); err == nil { + go func() { + c.Start(ctx) + if err := c.Error(); err != nil { + l.chErr <- err + } + }() + return l, nil + } + + // tunnel client establishes a tunnel session if it succeeded. + // retry if it fails. + select { + case err := <-l.chErr: + log.Printf("failed to get tunnel listener: %v", err) + default: + } + duration := bo.NextBackOff() + log.Printf("Tunnel listener will retry in %s.", duration) + time.Sleep(duration) + } +} diff --git a/tunnel/tunnel.go b/tunnel/tunnel.go index 1657332..31b8537 100644 --- a/tunnel/tunnel.go +++ b/tunnel/tunnel.go @@ -1102,10 +1102,9 @@ type ClientConfig struct { type Client struct { endpoint - block chan struct{} - Registered bool - tc tpb.TunnelClient - cc ClientConfig + block chan struct{} + tc tpb.TunnelClient + cc ClientConfig cmu sync.RWMutex rs *regSafeStream @@ -1115,6 +1114,32 @@ type Client struct { pmu sync.RWMutex peerTypeTargets map[string]map[Target]struct{} + + err error + emu sync.RWMutex + cancelFunc func() +} + +// cancel performs cancellations of Start() and streamHandler(), and records error. +func (c *Client) cancel(err error) { + c.emu.Lock() + defer c.emu.Unlock() + // Avoid calling multiple times. + if c.cancelFunc == nil { + return + } + + c.cancelFunc() + c.cancelFunc = nil + c.err = err +} + +// Error returns the error collected from streamHandler. +func (c *Client) Error() error { + c.emu.RLock() + defer c.emu.RUnlock() + + return c.err } // NewClient creates a new tunnel client. @@ -1138,7 +1163,6 @@ func NewClient(tc tpb.TunnelClient, cc ClientConfig, ts map[Target]struct{}) (*C increment: -1, }, targets: ts, - Registered: false, peerTypeTargets: peerTypeTargets, }, nil } @@ -1175,124 +1199,115 @@ func (c *Client) NewSession(target Target) (_ io.ReadWriteCloser, err error) { return ioe.rwc, nil } +// Register initializes the client register stream and determines the +// capabilities of the tunnel server. +func (c *Client) Register(ctx context.Context) (err error) { + c.cmu.Lock() + defer c.cmu.Unlock() + + ctx, c.cancelFunc = context.WithCancel(ctx) + stream, err := c.tc.Register(ctx, c.cc.Opts...) + if err != nil { + return fmt.Errorf("start: failed to create register stream: %v", err) + } + c.rs = ®SafeStream{regStream: stream} + p, ok := peer.FromContext(stream.Context()) + if !ok { + return errors.New("no peer from stream context") + } + c.addr = p.Addr + + for target := range c.targets { + c.NewTarget(target) + } + + for typ := range c.peerTypeTargets { + c.Subscribe(typ) + } + + return nil +} + // Run initializes the client register stream and determines the capabilities // of the tunnel server. Once done, it starts the stream handler responsible // for determining what to do with received requests. func (c *Client) Run(ctx context.Context) error { + if err := c.Register(ctx); err != nil { + return err + } + c.Start(ctx) + return c.Error() +} + +// Start handles received register stream requests. +func (c *Client) Start(ctx context.Context) { + var err error + defer func() { + c.cancel(err) + }() + select { case c.block <- struct{}{}: defer func() { <-c.block }() - // wrap critical section in a function to allow use of defer - setup := func() error { - c.cmu.Lock() - defer c.cmu.Unlock() - stream, err := c.tc.Register(ctx, c.cc.Opts...) - if err != nil { - return fmt.Errorf("start: failed to create register stream: %v", err) - } - c.rs = ®SafeStream{regStream: stream} - p, ok := peer.FromContext(stream.Context()) - if !ok { - return errors.New("no peer from stream context") - } - c.addr = p.Addr - - for target := range c.targets { - c.NewTarget(target) - } - - for typ := range c.peerTypeTargets { - c.Subscribe(typ) - } - - return nil - } - - if err := setup(); err != nil { - return err - } - c.Registered = true - return c.start(ctx) default: - return errors.New("client is already running") + err = errors.New("client is already running") + return } -} -// start handles received register stream requests. -func (c *Client) start(ctx context.Context) error { - errCh := make(chan error, 1) + for { + var reg *tpb.RegisterOp + reg, err = c.rs.Recv() + if err != nil { + return + } - go func() { - for { - reg, err := c.rs.Recv() - if err != nil { - select { - case errCh <- err: - default: - } + switch reg.Registration.(type) { + case *tpb.RegisterOp_Session: + session := reg.GetSession() + if !session.GetAccept() { + err = fmt.Errorf("connection %d not accepted by server", session.GetTag()) return } - - switch reg.Registration.(type) { - case *tpb.RegisterOp_Session: - session := reg.GetSession() - if !session.GetAccept() { - select { - case errCh <- fmt.Errorf("connection %d not accepted by server", session.GetTag()): - default: - } + tag := session.Tag + tID := session.GetTargetId() + tType := session.GetTargetType() + go func() { + if err := c.streamHandler(ctx, tag, Target{ID: tID, Type: tType}); err != nil { + c.cancel(err) + } + }() + case *tpb.RegisterOp_Target: + target := reg.GetTarget() + switch op := target.GetOp(); op { + case tpb.Target_ADD: + if e := c.addPeerTarget(target); e != nil { + err = fmt.Errorf("failed to add peer target: %v", e) return } - tag := session.Tag - tID := session.GetTargetId() - tType := session.GetTargetType() - go func() { - if err := c.streamHandler(ctx, tag, Target{ID: tID, Type: tType}); err != nil { - select { - case errCh <- err: - default: - } - } - }() - case *tpb.RegisterOp_Target: - target := reg.GetTarget() - switch op := target.GetOp(); op { - case tpb.Target_ADD: - if err := c.addPeerTarget(target); err != nil { - errCh <- fmt.Errorf("failed to add peer target: %v", err) - } - case tpb.Target_REMOVE: - if err := c.deletePeerTarget(target); err != nil { - errCh <- fmt.Errorf("failed to delete peer target: %v", err) - } - default: - // The rest are acks. - if !target.GetAccept() { - select { - case errCh <- fmt.Errorf("target registration (%s, %s) not accepted by server", target.TargetId, target.TargetType): - default: - } - return - } + case tpb.Target_REMOVE: + if e := c.deletePeerTarget(target); e != nil { + err = fmt.Errorf("failed to delete peer target: %v", e) + return + } + default: + if !target.GetAccept() { + err = fmt.Errorf("target registration (%s, %s) not accepted by server", target.TargetId, target.TargetType) + return } - case *tpb.RegisterOp_Subscription: - sub := reg.GetSubscription() - op := sub.GetOp() - if op == tpb.Subscription_SUBCRIBE || op == tpb.Subscription_UNSUBCRIBE { - if !sub.GetAccept() { - select { - case errCh <- fmt.Errorf("subscription request (%s) not accepted by server", sub.TargetType): - default: - } - return - } + } + case *tpb.RegisterOp_Subscription: + sub := reg.GetSubscription() + op := sub.GetOp() + if op == tpb.Subscription_SUBCRIBE || op == tpb.Subscription_UNSUBCRIBE { + if !sub.GetAccept() { + err = fmt.Errorf("subscription request (%s) not accepted by server", sub.TargetType) + return } } } - }() - return <-errCh + } } func (c *Client) streamHandler(ctx context.Context, tag int32, t Target) (e error) { diff --git a/tunnel/tunnel_test.go b/tunnel/tunnel_test.go index dd0f229..a862795 100644 --- a/tunnel/tunnel_test.go +++ b/tunnel/tunnel_test.go @@ -852,10 +852,14 @@ func TestClientRunBlocked(t *testing.T) { if err != nil { t.Fatalf("failed to create new client: %v", err) } + if err := c.Register(ctx); err != nil { + t.Fatalf("c.Register() failed: %v", err) + } chanErr := make(chan error, 2) clientRun := func() { - if err := c.Run(ctx); err != nil { + c.Start(ctx) + if err := c.Error(); err != nil { chanErr <- err } } @@ -881,6 +885,9 @@ func TestClientRunBlocked(t *testing.T) { time.Second*5, ) defer cancel() + if err := c.Register(ctx); err != nil { + t.Fatalf("c.Register() failed: %v", err) + } go clientRun() select { case <-ctx.Done(): @@ -955,7 +962,16 @@ func TestClientRun(t *testing.T) { } else { test.c.tc = test.tc } - err = test.c.Run(test.ctx) + err = test.c.Register(test.ctx) + if err != nil { + if !test.wantErr { + t.Fatalf("c.Register() got %v, want success", err) + } + return + } + + test.c.Start(test.ctx) + err = test.c.Error() if err == nil && test.wantErr { t.Fatal("c.Run() got success, want error") } @@ -1030,12 +1046,16 @@ func TestClientStart(t *testing.T) { c.addr = addr retCh := make(chan ioOrErr, 1) err = c.addConnection(-1, addr, retCh) - err = c.start(context.Background()) + + ctx := context.Background() + ctx, c.cancelFunc = context.WithCancel(ctx) + c.Start(ctx) + err = c.Error() if err == nil && test.wantErr { - t.Fatal("c.start() got success, want error") + t.Fatal("c.Start() got success, want error") } if err != nil && !test.wantErr { - t.Fatalf("c.start() got %v, want success", err) + t.Fatalf("c.Start() got %v, want success", err) } }) } From e785db18586bc3c778bd86a93295aef756850a0a Mon Sep 17 00:00:00 2001 From: Carl Lebsack Date: Mon, 1 Mar 2021 10:06:04 -0500 Subject: [PATCH 2/3] Protoversion (#19) * Version to tunnel.proto, add OpenFlow and P4 enums * Reorder enums by port --- proto/tunnel/tunnel.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/proto/tunnel/tunnel.proto b/proto/tunnel/tunnel.proto index 382f8a0..d61fed0 100644 --- a/proto/tunnel/tunnel.proto +++ b/proto/tunnel/tunnel.proto @@ -14,6 +14,8 @@ // limitations under the License. // +// Version: 0.1 + syntax = "proto3"; // Package grpctunnel defines a service specification for a TCP over gRPC proxy @@ -50,8 +52,12 @@ enum TargetType { UNKNOWN = 0; // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=22 SSH = 22; + // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=6653 + OPENFLOW = 6653; // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=9339 GNMI_GNOI = 9339; + // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=9559 + P4_RUNTIME = 9559; } message Target { From 4190afb59041b1aaeb4dd4bbf812e0b629bdc267 Mon Sep 17 00:00:00 2001 From: Johnson Xu Date: Mon, 1 Mar 2021 17:20:00 -0500 Subject: [PATCH 3/3] update to use --go-grpc_out for compile_protos.sh --- compile_protos.sh | 2 +- proto/tunnel/tunnel.pb.go | 264 +++++++++++++++++---------------- proto/tunnel/tunnel_grpc.pb.go | 8 +- 3 files changed, 143 insertions(+), 131 deletions(-) diff --git a/compile_protos.sh b/compile_protos.sh index 9624614..2c090d0 100755 --- a/compile_protos.sh +++ b/compile_protos.sh @@ -19,4 +19,4 @@ set -euo pipefail proto_imports=".:${GOPATH}/src/github.com/google/protobuf/src:${GOPATH}/src" # Go -protoc -I=$proto_imports --go_out=plugins=grpc,paths=source_relative:. proto/tunnel/tunnel.proto +protoc -I=$proto_imports --go_out=paths=source_relative:. proto/tunnel/tunnel.proto --go-grpc_out=. diff --git a/proto/tunnel/tunnel.pb.go b/proto/tunnel/tunnel.pb.go index a08d5cd..30e8267 100644 --- a/proto/tunnel/tunnel.pb.go +++ b/proto/tunnel/tunnel.pb.go @@ -14,11 +14,13 @@ // limitations under the License. // +// Version: 0.1 + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0-devel // protoc v3.12.4 -// source: github.com/openconfig/grpctunnel/proto/tunnel/tunnel.proto +// source: proto/tunnel/tunnel.proto // Package grpctunnel defines a service specification for a TCP over gRPC proxy // interface. This interface is set so that the tunnel can act as a transparent @@ -46,8 +48,12 @@ const ( TargetType_UNKNOWN TargetType = 0 // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=22 TargetType_SSH TargetType = 22 + // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=6653 + TargetType_OPENFLOW TargetType = 6653 // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=9339 TargetType_GNMI_GNOI TargetType = 9339 + // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=9559 + TargetType_P4_RUNTIME TargetType = 9559 ) // Enum value maps for TargetType. @@ -55,12 +61,16 @@ var ( TargetType_name = map[int32]string{ 0: "UNKNOWN", 22: "SSH", + 6653: "OPENFLOW", 9339: "GNMI_GNOI", + 9559: "P4_RUNTIME", } TargetType_value = map[string]int32{ - "UNKNOWN": 0, - "SSH": 22, - "GNMI_GNOI": 9339, + "UNKNOWN": 0, + "SSH": 22, + "OPENFLOW": 6653, + "GNMI_GNOI": 9339, + "P4_RUNTIME": 9559, } ) @@ -75,11 +85,11 @@ func (x TargetType) String() string { } func (TargetType) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_enumTypes[0].Descriptor() + return file_proto_tunnel_tunnel_proto_enumTypes[0].Descriptor() } func (TargetType) Type() protoreflect.EnumType { - return &file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_enumTypes[0] + return &file_proto_tunnel_tunnel_proto_enumTypes[0] } func (x TargetType) Number() protoreflect.EnumNumber { @@ -88,7 +98,7 @@ func (x TargetType) Number() protoreflect.EnumNumber { // Deprecated: Use TargetType.Descriptor instead. func (TargetType) EnumDescriptor() ([]byte, []int) { - return file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{0} + return file_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{0} } type Target_TargetOp int32 @@ -124,11 +134,11 @@ func (x Target_TargetOp) String() string { } func (Target_TargetOp) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_enumTypes[1].Descriptor() + return file_proto_tunnel_tunnel_proto_enumTypes[1].Descriptor() } func (Target_TargetOp) Type() protoreflect.EnumType { - return &file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_enumTypes[1] + return &file_proto_tunnel_tunnel_proto_enumTypes[1] } func (x Target_TargetOp) Number() protoreflect.EnumNumber { @@ -137,7 +147,7 @@ func (x Target_TargetOp) Number() protoreflect.EnumNumber { // Deprecated: Use Target_TargetOp.Descriptor instead. func (Target_TargetOp) EnumDescriptor() ([]byte, []int) { - return file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{2, 0} + return file_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{2, 0} } type Subscription_SubscriptionOp int32 @@ -173,11 +183,11 @@ func (x Subscription_SubscriptionOp) String() string { } func (Subscription_SubscriptionOp) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_enumTypes[2].Descriptor() + return file_proto_tunnel_tunnel_proto_enumTypes[2].Descriptor() } func (Subscription_SubscriptionOp) Type() protoreflect.EnumType { - return &file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_enumTypes[2] + return &file_proto_tunnel_tunnel_proto_enumTypes[2] } func (x Subscription_SubscriptionOp) Number() protoreflect.EnumNumber { @@ -186,7 +196,7 @@ func (x Subscription_SubscriptionOp) Number() protoreflect.EnumNumber { // Deprecated: Use Subscription_SubscriptionOp.Descriptor instead. func (Subscription_SubscriptionOp) EnumDescriptor() ([]byte, []int) { - return file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{4, 0} + return file_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{4, 0} } type Data struct { @@ -202,7 +212,7 @@ type Data struct { func (x *Data) Reset() { *x = Data{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[0] + mi := &file_proto_tunnel_tunnel_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -215,7 +225,7 @@ func (x *Data) String() string { func (*Data) ProtoMessage() {} func (x *Data) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[0] + mi := &file_proto_tunnel_tunnel_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -228,7 +238,7 @@ func (x *Data) ProtoReflect() protoreflect.Message { // Deprecated: Use Data.ProtoReflect.Descriptor instead. func (*Data) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{0} + return file_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{0} } func (x *Data) GetTag() int32 { @@ -267,7 +277,7 @@ type RegisterOp struct { func (x *RegisterOp) Reset() { *x = RegisterOp{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[1] + mi := &file_proto_tunnel_tunnel_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -280,7 +290,7 @@ func (x *RegisterOp) String() string { func (*RegisterOp) ProtoMessage() {} func (x *RegisterOp) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[1] + mi := &file_proto_tunnel_tunnel_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -293,7 +303,7 @@ func (x *RegisterOp) ProtoReflect() protoreflect.Message { // Deprecated: Use RegisterOp.ProtoReflect.Descriptor instead. func (*RegisterOp) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{1} + return file_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{1} } func (m *RegisterOp) GetRegistration() isRegisterOp_Registration { @@ -366,7 +376,7 @@ type Target struct { func (x *Target) Reset() { *x = Target{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[2] + mi := &file_proto_tunnel_tunnel_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -379,7 +389,7 @@ func (x *Target) String() string { func (*Target) ProtoMessage() {} func (x *Target) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[2] + mi := &file_proto_tunnel_tunnel_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -392,7 +402,7 @@ func (x *Target) ProtoReflect() protoreflect.Message { // Deprecated: Use Target.ProtoReflect.Descriptor instead. func (*Target) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{2} + return file_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{2} } func (x *Target) GetOp() Target_TargetOp { @@ -453,7 +463,7 @@ type Session struct { func (x *Session) Reset() { *x = Session{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[3] + mi := &file_proto_tunnel_tunnel_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -466,7 +476,7 @@ func (x *Session) String() string { func (*Session) ProtoMessage() {} func (x *Session) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[3] + mi := &file_proto_tunnel_tunnel_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -479,7 +489,7 @@ func (x *Session) ProtoReflect() protoreflect.Message { // Deprecated: Use Session.ProtoReflect.Descriptor instead. func (*Session) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{3} + return file_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{3} } func (x *Session) GetTag() int32 { @@ -534,7 +544,7 @@ type Subscription struct { func (x *Subscription) Reset() { *x = Subscription{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[4] + mi := &file_proto_tunnel_tunnel_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -547,7 +557,7 @@ func (x *Subscription) String() string { func (*Subscription) ProtoMessage() {} func (x *Subscription) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[4] + mi := &file_proto_tunnel_tunnel_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -560,7 +570,7 @@ func (x *Subscription) ProtoReflect() protoreflect.Message { // Deprecated: Use Subscription.ProtoReflect.Descriptor instead. func (*Subscription) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{4} + return file_proto_tunnel_tunnel_proto_rawDescGZIP(), []int{4} } func (x *Subscription) GetOp() Subscription_SubscriptionOp { @@ -591,95 +601,95 @@ func (x *Subscription) GetError() string { return "" } -var File_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto protoreflect.FileDescriptor - -var file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDesc = []byte{ - 0x0a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, - 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, - 0x65, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2f, - 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x72, - 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x22, 0x42, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, - 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x22, 0xbb, 0x01, 0x0a, - 0x0a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x70, 0x12, 0x2c, 0x0a, 0x06, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, - 0x00, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2f, 0x0a, 0x07, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, - 0x00, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x73, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x53, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xcf, 0x01, 0x0a, 0x06, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2b, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, 0x70, 0x52, 0x02, - 0x6f, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, +var File_proto_tunnel_tunnel_proto protoreflect.FileDescriptor + +var file_proto_tunnel_tunnel_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2f, 0x74, + 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x72, 0x70, + 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x22, 0x42, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x61, + 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x22, 0xbb, 0x01, 0x0a, 0x0a, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x70, 0x12, 0x2c, 0x0a, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x00, + 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2f, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, + 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x73, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xcf, 0x01, 0x0a, 0x06, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x12, 0x2b, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, 0x70, 0x52, 0x02, 0x6f, + 0x70, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2c, 0x0a, + 0x08, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, 0x70, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x44, 0x44, 0x10, 0x01, 0x12, + 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x10, 0x02, 0x22, 0x87, 0x01, 0x0a, 0x07, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x63, + 0x65, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1f, + 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xd3, 0x01, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, + 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x52, 0x02, 0x6f, 0x70, 0x12, + 0x16, 0x0a, 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2c, - 0x0a, 0x08, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, 0x70, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, - 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x44, 0x44, 0x10, 0x01, - 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x10, 0x02, 0x22, 0x87, 0x01, 0x0a, - 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, - 0x63, 0x65, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, - 0x70, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, - 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xd3, 0x01, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, - 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x52, 0x02, 0x6f, 0x70, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, - 0x3b, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4f, - 0x70, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, - 0x0a, 0x08, 0x53, 0x55, 0x42, 0x43, 0x52, 0x49, 0x42, 0x45, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, - 0x55, 0x4e, 0x53, 0x55, 0x42, 0x43, 0x52, 0x49, 0x42, 0x45, 0x10, 0x02, 0x2a, 0x32, 0x0a, 0x0a, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, - 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x53, 0x48, 0x10, 0x16, - 0x12, 0x0e, 0x0a, 0x09, 0x47, 0x4e, 0x4d, 0x49, 0x5f, 0x47, 0x4e, 0x4f, 0x49, 0x10, 0xfb, 0x48, - 0x32, 0x7a, 0x0a, 0x06, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x3e, 0x0a, 0x08, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, - 0x6e, 0x65, 0x6c, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x70, 0x1a, 0x16, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x4f, 0x70, 0x28, 0x01, 0x30, 0x01, 0x12, 0x30, 0x0a, 0x06, 0x54, 0x75, - 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x10, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, - 0x6c, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x10, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, - 0x6e, 0x65, 0x6c, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x28, 0x01, 0x30, 0x01, 0x42, 0x19, 0x5a, 0x17, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x3b, 0x67, 0x72, 0x70, - 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x3b, + 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, + 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, + 0x08, 0x53, 0x55, 0x42, 0x43, 0x52, 0x49, 0x42, 0x45, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x55, + 0x4e, 0x53, 0x55, 0x42, 0x43, 0x52, 0x49, 0x42, 0x45, 0x10, 0x02, 0x2a, 0x52, 0x0a, 0x0a, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x53, 0x48, 0x10, 0x16, 0x12, + 0x0d, 0x0a, 0x08, 0x4f, 0x50, 0x45, 0x4e, 0x46, 0x4c, 0x4f, 0x57, 0x10, 0xfd, 0x33, 0x12, 0x0e, + 0x0a, 0x09, 0x47, 0x4e, 0x4d, 0x49, 0x5f, 0x47, 0x4e, 0x4f, 0x49, 0x10, 0xfb, 0x48, 0x12, 0x0f, + 0x0a, 0x0a, 0x50, 0x34, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0xd7, 0x4a, 0x32, + 0x7a, 0x0a, 0x06, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x3e, 0x0a, 0x08, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, + 0x65, 0x6c, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x70, 0x1a, 0x16, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x4f, 0x70, 0x28, 0x01, 0x30, 0x01, 0x12, 0x30, 0x0a, 0x06, 0x54, 0x75, 0x6e, + 0x6e, 0x65, 0x6c, 0x12, 0x10, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, + 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x10, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x74, 0x75, 0x6e, 0x6e, + 0x65, 0x6c, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x28, 0x01, 0x30, 0x01, 0x42, 0x19, 0x5a, 0x17, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x3b, 0x67, 0x72, 0x70, 0x63, + 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescOnce sync.Once - file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescData = file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDesc + file_proto_tunnel_tunnel_proto_rawDescOnce sync.Once + file_proto_tunnel_tunnel_proto_rawDescData = file_proto_tunnel_tunnel_proto_rawDesc ) -func file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescGZIP() []byte { - file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescOnce.Do(func() { - file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescData) +func file_proto_tunnel_tunnel_proto_rawDescGZIP() []byte { + file_proto_tunnel_tunnel_proto_rawDescOnce.Do(func() { + file_proto_tunnel_tunnel_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_tunnel_tunnel_proto_rawDescData) }) - return file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDescData + return file_proto_tunnel_tunnel_proto_rawDescData } -var file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_goTypes = []interface{}{ +var file_proto_tunnel_tunnel_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_proto_tunnel_tunnel_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_proto_tunnel_tunnel_proto_goTypes = []interface{}{ (TargetType)(0), // 0: grpctunnel.TargetType (Target_TargetOp)(0), // 1: grpctunnel.Target.TargetOp (Subscription_SubscriptionOp)(0), // 2: grpctunnel.Subscription.SubscriptionOp @@ -689,7 +699,7 @@ var file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_goTypes = [] (*Session)(nil), // 6: grpctunnel.Session (*Subscription)(nil), // 7: grpctunnel.Subscription } -var file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_depIdxs = []int32{ +var file_proto_tunnel_tunnel_proto_depIdxs = []int32{ 5, // 0: grpctunnel.RegisterOp.target:type_name -> grpctunnel.Target 6, // 1: grpctunnel.RegisterOp.session:type_name -> grpctunnel.Session 7, // 2: grpctunnel.RegisterOp.subscription:type_name -> grpctunnel.Subscription @@ -706,13 +716,13 @@ var file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_depIdxs = [] 0, // [0:5] is the sub-list for field type_name } -func init() { file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_init() } -func file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_init() { - if File_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto != nil { +func init() { file_proto_tunnel_tunnel_proto_init() } +func file_proto_tunnel_tunnel_proto_init() { + if File_proto_tunnel_tunnel_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_proto_tunnel_tunnel_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data); i { case 0: return &v.state @@ -724,7 +734,7 @@ func file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_init() { return nil } } - file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_proto_tunnel_tunnel_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RegisterOp); i { case 0: return &v.state @@ -736,7 +746,7 @@ func file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_init() { return nil } } - file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_proto_tunnel_tunnel_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Target); i { case 0: return &v.state @@ -748,7 +758,7 @@ func file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_init() { return nil } } - file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_proto_tunnel_tunnel_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Session); i { case 0: return &v.state @@ -760,7 +770,7 @@ func file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_init() { return nil } } - file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_proto_tunnel_tunnel_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Subscription); i { case 0: return &v.state @@ -773,7 +783,7 @@ func file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_init() { } } } - file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes[1].OneofWrappers = []interface{}{ + file_proto_tunnel_tunnel_proto_msgTypes[1].OneofWrappers = []interface{}{ (*RegisterOp_Target)(nil), (*RegisterOp_Session)(nil), (*RegisterOp_Subscription)(nil), @@ -782,19 +792,19 @@ func file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDesc, + RawDescriptor: file_proto_tunnel_tunnel_proto_rawDesc, NumEnums: 3, NumMessages: 5, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_goTypes, - DependencyIndexes: file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_depIdxs, - EnumInfos: file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_enumTypes, - MessageInfos: file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_msgTypes, + GoTypes: file_proto_tunnel_tunnel_proto_goTypes, + DependencyIndexes: file_proto_tunnel_tunnel_proto_depIdxs, + EnumInfos: file_proto_tunnel_tunnel_proto_enumTypes, + MessageInfos: file_proto_tunnel_tunnel_proto_msgTypes, }.Build() - File_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto = out.File - file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_rawDesc = nil - file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_goTypes = nil - file_github_com_openconfig_grpctunnel_proto_tunnel_tunnel_proto_depIdxs = nil + File_proto_tunnel_tunnel_proto = out.File + file_proto_tunnel_tunnel_proto_rawDesc = nil + file_proto_tunnel_tunnel_proto_goTypes = nil + file_proto_tunnel_tunnel_proto_depIdxs = nil } diff --git a/proto/tunnel/tunnel_grpc.pb.go b/proto/tunnel/tunnel_grpc.pb.go index b8831c6..b2b7366 100644 --- a/proto/tunnel/tunnel_grpc.pb.go +++ b/proto/tunnel/tunnel_grpc.pb.go @@ -97,7 +97,7 @@ func (x *tunnelTunnelClient) Recv() (*Data, error) { } // TunnelServer is the server API for Tunnel service. -// All implementations should embed UnimplementedTunnelServer +// All implementations must embed UnimplementedTunnelServer // for forward compatibility type TunnelServer interface { // Register is used to register targets reachable via either the client @@ -106,9 +106,10 @@ type TunnelServer interface { // Tunnel allows the tunnel client and server to create a bidirectional stream // in which data can be forwarded. Tunnel(Tunnel_TunnelServer) error + mustEmbedUnimplementedTunnelServer() } -// UnimplementedTunnelServer should be embedded to have forward compatible implementations. +// UnimplementedTunnelServer must be embedded to have forward compatible implementations. type UnimplementedTunnelServer struct { } @@ -118,6 +119,7 @@ func (UnimplementedTunnelServer) Register(Tunnel_RegisterServer) error { func (UnimplementedTunnelServer) Tunnel(Tunnel_TunnelServer) error { return status.Errorf(codes.Unimplemented, "method Tunnel not implemented") } +func (UnimplementedTunnelServer) mustEmbedUnimplementedTunnelServer() {} // UnsafeTunnelServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to TunnelServer will @@ -203,5 +205,5 @@ var Tunnel_ServiceDesc = grpc.ServiceDesc{ ClientStreams: true, }, }, - Metadata: "github.com/openconfig/grpctunnel/proto/tunnel/tunnel.proto", + Metadata: "proto/tunnel/tunnel.proto", }