2019-07-10 20:59:43 +00:00
|
|
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
|
|
// source: github.com/crosbymichael/guard/api/v1/guard.proto
|
|
|
|
|
|
|
|
package v1
|
|
|
|
|
|
|
|
import (
|
|
|
|
context "context"
|
|
|
|
fmt "fmt"
|
|
|
|
proto "github.com/gogo/protobuf/proto"
|
|
|
|
types "github.com/gogo/protobuf/types"
|
|
|
|
grpc "google.golang.org/grpc"
|
|
|
|
io "io"
|
|
|
|
math "math"
|
|
|
|
reflect "reflect"
|
|
|
|
strings "strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
|
|
var _ = proto.Marshal
|
|
|
|
var _ = fmt.Errorf
|
|
|
|
var _ = math.Inf
|
|
|
|
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
|
|
// is compatible with the proto package it is being compiled against.
|
|
|
|
// A compilation error at this line likely means your copy of the
|
|
|
|
// proto package needs to be updated.
|
|
|
|
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
|
|
|
|
type CreateRequest struct {
|
|
|
|
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
|
|
ListenPort uint32 `protobuf:"varint,2,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"`
|
|
|
|
Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"`
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *CreateRequest) Reset() { *m = CreateRequest{} }
|
|
|
|
func (*CreateRequest) ProtoMessage() {}
|
|
|
|
func (*CreateRequest) Descriptor() ([]byte, []int) {
|
|
|
|
return fileDescriptor_ebe0601dd3932458, []int{0}
|
|
|
|
}
|
|
|
|
func (m *CreateRequest) XXX_Unmarshal(b []byte) error {
|
|
|
|
return m.Unmarshal(b)
|
|
|
|
}
|
|
|
|
func (m *CreateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
if deterministic {
|
|
|
|
return xxx_messageInfo_CreateRequest.Marshal(b, m, deterministic)
|
|
|
|
} else {
|
|
|
|
b = b[:cap(b)]
|
|
|
|
n, err := m.MarshalTo(b)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return b[:n], nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func (m *CreateRequest) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_CreateRequest.Merge(m, src)
|
|
|
|
}
|
|
|
|
func (m *CreateRequest) XXX_Size() int {
|
|
|
|
return m.Size()
|
|
|
|
}
|
|
|
|
func (m *CreateRequest) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_CreateRequest.DiscardUnknown(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
var xxx_messageInfo_CreateRequest proto.InternalMessageInfo
|
|
|
|
|
2019-07-10 21:35:46 +00:00
|
|
|
type TunnelResponse struct {
|
2019-07-10 20:59:43 +00:00
|
|
|
Tunnel *Tunnel `protobuf:"bytes,1,opt,name=tunnel,proto3" json:"tunnel,omitempty"`
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
}
|
|
|
|
|
2019-07-10 21:35:46 +00:00
|
|
|
func (m *TunnelResponse) Reset() { *m = TunnelResponse{} }
|
|
|
|
func (*TunnelResponse) ProtoMessage() {}
|
|
|
|
func (*TunnelResponse) Descriptor() ([]byte, []int) {
|
2019-07-10 20:59:43 +00:00
|
|
|
return fileDescriptor_ebe0601dd3932458, []int{1}
|
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
func (m *TunnelResponse) XXX_Unmarshal(b []byte) error {
|
2019-07-10 20:59:43 +00:00
|
|
|
return m.Unmarshal(b)
|
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
func (m *TunnelResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
2019-07-10 20:59:43 +00:00
|
|
|
if deterministic {
|
2019-07-10 21:35:46 +00:00
|
|
|
return xxx_messageInfo_TunnelResponse.Marshal(b, m, deterministic)
|
2019-07-10 20:59:43 +00:00
|
|
|
} else {
|
|
|
|
b = b[:cap(b)]
|
|
|
|
n, err := m.MarshalTo(b)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return b[:n], nil
|
|
|
|
}
|
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
func (m *TunnelResponse) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_TunnelResponse.Merge(m, src)
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
func (m *TunnelResponse) XXX_Size() int {
|
2019-07-10 20:59:43 +00:00
|
|
|
return m.Size()
|
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
func (m *TunnelResponse) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_TunnelResponse.DiscardUnknown(m)
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
|
2019-07-10 21:35:46 +00:00
|
|
|
var xxx_messageInfo_TunnelResponse proto.InternalMessageInfo
|
|
|
|
|
|
|
|
type AddPeerRequest struct {
|
|
|
|
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
|
|
Peer *Peer `protobuf:"bytes,2,opt,name=peer,proto3" json:"peer,omitempty"`
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *AddPeerRequest) Reset() { *m = AddPeerRequest{} }
|
|
|
|
func (*AddPeerRequest) ProtoMessage() {}
|
|
|
|
func (*AddPeerRequest) Descriptor() ([]byte, []int) {
|
|
|
|
return fileDescriptor_ebe0601dd3932458, []int{2}
|
|
|
|
}
|
|
|
|
func (m *AddPeerRequest) XXX_Unmarshal(b []byte) error {
|
|
|
|
return m.Unmarshal(b)
|
|
|
|
}
|
|
|
|
func (m *AddPeerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
if deterministic {
|
|
|
|
return xxx_messageInfo_AddPeerRequest.Marshal(b, m, deterministic)
|
|
|
|
} else {
|
|
|
|
b = b[:cap(b)]
|
|
|
|
n, err := m.MarshalTo(b)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return b[:n], nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func (m *AddPeerRequest) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_AddPeerRequest.Merge(m, src)
|
|
|
|
}
|
|
|
|
func (m *AddPeerRequest) XXX_Size() int {
|
|
|
|
return m.Size()
|
|
|
|
}
|
|
|
|
func (m *AddPeerRequest) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_AddPeerRequest.DiscardUnknown(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
var xxx_messageInfo_AddPeerRequest proto.InternalMessageInfo
|
|
|
|
|
|
|
|
type DeletePeerRequest struct {
|
|
|
|
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
|
|
PeerID string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *DeletePeerRequest) Reset() { *m = DeletePeerRequest{} }
|
|
|
|
func (*DeletePeerRequest) ProtoMessage() {}
|
|
|
|
func (*DeletePeerRequest) Descriptor() ([]byte, []int) {
|
|
|
|
return fileDescriptor_ebe0601dd3932458, []int{3}
|
|
|
|
}
|
|
|
|
func (m *DeletePeerRequest) XXX_Unmarshal(b []byte) error {
|
|
|
|
return m.Unmarshal(b)
|
|
|
|
}
|
|
|
|
func (m *DeletePeerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
if deterministic {
|
|
|
|
return xxx_messageInfo_DeletePeerRequest.Marshal(b, m, deterministic)
|
|
|
|
} else {
|
|
|
|
b = b[:cap(b)]
|
|
|
|
n, err := m.MarshalTo(b)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return b[:n], nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func (m *DeletePeerRequest) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_DeletePeerRequest.Merge(m, src)
|
|
|
|
}
|
|
|
|
func (m *DeletePeerRequest) XXX_Size() int {
|
|
|
|
return m.Size()
|
|
|
|
}
|
|
|
|
func (m *DeletePeerRequest) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_DeletePeerRequest.DiscardUnknown(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
var xxx_messageInfo_DeletePeerRequest proto.InternalMessageInfo
|
2019-07-10 20:59:43 +00:00
|
|
|
|
|
|
|
type DeleteRequest struct {
|
|
|
|
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *DeleteRequest) Reset() { *m = DeleteRequest{} }
|
|
|
|
func (*DeleteRequest) ProtoMessage() {}
|
|
|
|
func (*DeleteRequest) Descriptor() ([]byte, []int) {
|
2019-07-10 21:35:46 +00:00
|
|
|
return fileDescriptor_ebe0601dd3932458, []int{4}
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
func (m *DeleteRequest) XXX_Unmarshal(b []byte) error {
|
|
|
|
return m.Unmarshal(b)
|
|
|
|
}
|
|
|
|
func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
if deterministic {
|
|
|
|
return xxx_messageInfo_DeleteRequest.Marshal(b, m, deterministic)
|
|
|
|
} else {
|
|
|
|
b = b[:cap(b)]
|
|
|
|
n, err := m.MarshalTo(b)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return b[:n], nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func (m *DeleteRequest) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_DeleteRequest.Merge(m, src)
|
|
|
|
}
|
|
|
|
func (m *DeleteRequest) XXX_Size() int {
|
|
|
|
return m.Size()
|
|
|
|
}
|
|
|
|
func (m *DeleteRequest) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_DeleteRequest.DiscardUnknown(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
var xxx_messageInfo_DeleteRequest proto.InternalMessageInfo
|
|
|
|
|
|
|
|
type ListResponse struct {
|
|
|
|
Tunnels []*Tunnel `protobuf:"bytes,1,rep,name=tunnels,proto3" json:"tunnels,omitempty"`
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ListResponse) Reset() { *m = ListResponse{} }
|
|
|
|
func (*ListResponse) ProtoMessage() {}
|
|
|
|
func (*ListResponse) Descriptor() ([]byte, []int) {
|
2019-07-10 21:35:46 +00:00
|
|
|
return fileDescriptor_ebe0601dd3932458, []int{5}
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
func (m *ListResponse) XXX_Unmarshal(b []byte) error {
|
|
|
|
return m.Unmarshal(b)
|
|
|
|
}
|
|
|
|
func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
if deterministic {
|
|
|
|
return xxx_messageInfo_ListResponse.Marshal(b, m, deterministic)
|
|
|
|
} else {
|
|
|
|
b = b[:cap(b)]
|
|
|
|
n, err := m.MarshalTo(b)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return b[:n], nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func (m *ListResponse) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_ListResponse.Merge(m, src)
|
|
|
|
}
|
|
|
|
func (m *ListResponse) XXX_Size() int {
|
|
|
|
return m.Size()
|
|
|
|
}
|
|
|
|
func (m *ListResponse) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_ListResponse.DiscardUnknown(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
var xxx_messageInfo_ListResponse proto.InternalMessageInfo
|
|
|
|
|
|
|
|
type Tunnel struct {
|
|
|
|
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
|
|
PrivateKey string `protobuf:"bytes,2,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"`
|
|
|
|
ListenPort uint32 `protobuf:"varint,3,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"`
|
|
|
|
Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"`
|
|
|
|
DNS string `protobuf:"bytes,5,opt,name=dns,proto3" json:"dns,omitempty"`
|
|
|
|
Peers []*Peer `protobuf:"bytes,6,rep,name=peers,proto3" json:"peers,omitempty"`
|
|
|
|
Masquerade *Masquerade `protobuf:"bytes,7,opt,name=masquerade,proto3" json:"masquerade,omitempty"`
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Tunnel) Reset() { *m = Tunnel{} }
|
|
|
|
func (*Tunnel) ProtoMessage() {}
|
|
|
|
func (*Tunnel) Descriptor() ([]byte, []int) {
|
2019-07-10 21:35:46 +00:00
|
|
|
return fileDescriptor_ebe0601dd3932458, []int{6}
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
func (m *Tunnel) XXX_Unmarshal(b []byte) error {
|
|
|
|
return m.Unmarshal(b)
|
|
|
|
}
|
|
|
|
func (m *Tunnel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
if deterministic {
|
|
|
|
return xxx_messageInfo_Tunnel.Marshal(b, m, deterministic)
|
|
|
|
} else {
|
|
|
|
b = b[:cap(b)]
|
|
|
|
n, err := m.MarshalTo(b)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return b[:n], nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func (m *Tunnel) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_Tunnel.Merge(m, src)
|
|
|
|
}
|
|
|
|
func (m *Tunnel) XXX_Size() int {
|
|
|
|
return m.Size()
|
|
|
|
}
|
|
|
|
func (m *Tunnel) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_Tunnel.DiscardUnknown(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
var xxx_messageInfo_Tunnel proto.InternalMessageInfo
|
|
|
|
|
|
|
|
type Peer struct {
|
2019-07-10 21:35:46 +00:00
|
|
|
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
|
|
PublicKey string `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
|
|
|
|
AllowedIPs []string `protobuf:"bytes,3,rep,name=allowed_ips,json=allowedIps,proto3" json:"allowed_ips,omitempty"`
|
|
|
|
Endpoint string `protobuf:"bytes,4,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
|
|
|
|
PersistentKeepalive uint32 `protobuf:"varint,5,opt,name=persistent_keepalive,json=persistentKeepalive,proto3" json:"persistent_keepalive,omitempty"`
|
2019-07-10 20:59:43 +00:00
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Peer) Reset() { *m = Peer{} }
|
|
|
|
func (*Peer) ProtoMessage() {}
|
|
|
|
func (*Peer) Descriptor() ([]byte, []int) {
|
2019-07-10 21:35:46 +00:00
|
|
|
return fileDescriptor_ebe0601dd3932458, []int{7}
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
func (m *Peer) XXX_Unmarshal(b []byte) error {
|
|
|
|
return m.Unmarshal(b)
|
|
|
|
}
|
|
|
|
func (m *Peer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
if deterministic {
|
|
|
|
return xxx_messageInfo_Peer.Marshal(b, m, deterministic)
|
|
|
|
} else {
|
|
|
|
b = b[:cap(b)]
|
|
|
|
n, err := m.MarshalTo(b)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return b[:n], nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func (m *Peer) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_Peer.Merge(m, src)
|
|
|
|
}
|
|
|
|
func (m *Peer) XXX_Size() int {
|
|
|
|
return m.Size()
|
|
|
|
}
|
|
|
|
func (m *Peer) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_Peer.DiscardUnknown(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
var xxx_messageInfo_Peer proto.InternalMessageInfo
|
|
|
|
|
|
|
|
type Masquerade struct {
|
|
|
|
Interface string `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"`
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Masquerade) Reset() { *m = Masquerade{} }
|
|
|
|
func (*Masquerade) ProtoMessage() {}
|
|
|
|
func (*Masquerade) Descriptor() ([]byte, []int) {
|
2019-07-10 21:35:46 +00:00
|
|
|
return fileDescriptor_ebe0601dd3932458, []int{8}
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
func (m *Masquerade) XXX_Unmarshal(b []byte) error {
|
|
|
|
return m.Unmarshal(b)
|
|
|
|
}
|
|
|
|
func (m *Masquerade) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
if deterministic {
|
|
|
|
return xxx_messageInfo_Masquerade.Marshal(b, m, deterministic)
|
|
|
|
} else {
|
|
|
|
b = b[:cap(b)]
|
|
|
|
n, err := m.MarshalTo(b)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return b[:n], nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func (m *Masquerade) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_Masquerade.Merge(m, src)
|
|
|
|
}
|
|
|
|
func (m *Masquerade) XXX_Size() int {
|
|
|
|
return m.Size()
|
|
|
|
}
|
|
|
|
func (m *Masquerade) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_Masquerade.DiscardUnknown(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
var xxx_messageInfo_Masquerade proto.InternalMessageInfo
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
proto.RegisterType((*CreateRequest)(nil), "com.crosbymichael.guard.v1.CreateRequest")
|
2019-07-10 21:35:46 +00:00
|
|
|
proto.RegisterType((*TunnelResponse)(nil), "com.crosbymichael.guard.v1.TunnelResponse")
|
|
|
|
proto.RegisterType((*AddPeerRequest)(nil), "com.crosbymichael.guard.v1.AddPeerRequest")
|
|
|
|
proto.RegisterType((*DeletePeerRequest)(nil), "com.crosbymichael.guard.v1.DeletePeerRequest")
|
2019-07-10 20:59:43 +00:00
|
|
|
proto.RegisterType((*DeleteRequest)(nil), "com.crosbymichael.guard.v1.DeleteRequest")
|
|
|
|
proto.RegisterType((*ListResponse)(nil), "com.crosbymichael.guard.v1.ListResponse")
|
|
|
|
proto.RegisterType((*Tunnel)(nil), "com.crosbymichael.guard.v1.Tunnel")
|
|
|
|
proto.RegisterType((*Peer)(nil), "com.crosbymichael.guard.v1.Peer")
|
|
|
|
proto.RegisterType((*Masquerade)(nil), "com.crosbymichael.guard.v1.Masquerade")
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
proto.RegisterFile("github.com/crosbymichael/guard/api/v1/guard.proto", fileDescriptor_ebe0601dd3932458)
|
|
|
|
}
|
|
|
|
|
|
|
|
var fileDescriptor_ebe0601dd3932458 = []byte{
|
2019-07-10 21:35:46 +00:00
|
|
|
// 678 bytes of a gzipped FileDescriptorProto
|
|
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xc1, 0x6f, 0x12, 0x4f,
|
|
|
|
0x14, 0xee, 0x02, 0x5d, 0x7e, 0x3c, 0x7e, 0x34, 0x71, 0x6c, 0x9a, 0x15, 0x15, 0xc8, 0x9a, 0x28,
|
|
|
|
0x36, 0x71, 0x37, 0x54, 0xe3, 0x41, 0xbd, 0x14, 0xd1, 0x48, 0x5a, 0x0d, 0x59, 0x4d, 0x34, 0x1e,
|
|
|
|
0x24, 0x0b, 0xfb, 0x4a, 0x27, 0x5d, 0x76, 0xb7, 0x33, 0x03, 0x86, 0x9b, 0xff, 0x85, 0x7f, 0x8d,
|
|
|
|
0xf7, 0xde, 0xf4, 0xe8, 0x89, 0xd8, 0xfd, 0x4b, 0xcc, 0xce, 0x40, 0x29, 0x26, 0x5d, 0xd0, 0x1b,
|
|
|
|
0xf3, 0xde, 0xfb, 0xe6, 0xdb, 0xef, 0x7b, 0xf3, 0x1e, 0xd0, 0x18, 0x50, 0x71, 0x3c, 0xea, 0x59,
|
|
|
|
0xfd, 0x70, 0x68, 0xf7, 0x59, 0xc8, 0x7b, 0x93, 0x21, 0xed, 0x1f, 0xbb, 0xe8, 0xdb, 0x83, 0x91,
|
|
|
|
0xcb, 0x3c, 0xdb, 0x8d, 0xa8, 0x3d, 0x6e, 0xa8, 0x83, 0x15, 0xb1, 0x50, 0x84, 0xa4, 0xdc, 0x0f,
|
|
|
|
0x87, 0xd6, 0x52, 0xad, 0xa5, 0xd2, 0xe3, 0x46, 0x79, 0x7b, 0x10, 0x0e, 0x42, 0x59, 0x66, 0x27,
|
|
|
|
0xbf, 0x14, 0xa2, 0x7c, 0x73, 0x10, 0x86, 0x03, 0x1f, 0x6d, 0x79, 0xea, 0x8d, 0x8e, 0x6c, 0x1c,
|
|
|
|
0x46, 0x62, 0xa2, 0x92, 0x66, 0x0f, 0x4a, 0xcf, 0x19, 0xba, 0x02, 0x1d, 0x3c, 0x1d, 0x21, 0x17,
|
|
|
|
0x64, 0x07, 0x32, 0xd4, 0x33, 0xb4, 0x9a, 0x56, 0x2f, 0x34, 0xf5, 0x78, 0x5a, 0xcd, 0xb4, 0x5b,
|
|
|
|
0x4e, 0x86, 0x7a, 0xa4, 0x0a, 0x45, 0x9f, 0x72, 0x81, 0x41, 0x37, 0x0a, 0x99, 0x30, 0x32, 0x35,
|
|
|
|
0xad, 0x5e, 0x72, 0x40, 0x85, 0x3a, 0x21, 0x13, 0xc4, 0x80, 0xbc, 0xeb, 0x79, 0x0c, 0x39, 0x37,
|
|
|
|
0xb2, 0x09, 0xda, 0x99, 0x1f, 0xcd, 0x43, 0xd8, 0x7a, 0x37, 0x0a, 0x02, 0xf4, 0x1d, 0xe4, 0x51,
|
|
|
|
0x18, 0x70, 0x24, 0x4f, 0x40, 0x17, 0x32, 0x22, 0x89, 0x8a, 0x7b, 0xa6, 0x75, 0xb5, 0x2a, 0x6b,
|
|
|
|
0x86, 0x9d, 0x21, 0xcc, 0x4f, 0xb0, 0xb5, 0xef, 0x79, 0x1d, 0x44, 0xb6, 0xea, 0x93, 0x1f, 0x41,
|
|
|
|
0x2e, 0x42, 0x64, 0xf2, 0x5b, 0x8b, 0x7b, 0xb5, 0x34, 0x0e, 0x79, 0x9d, 0xac, 0x36, 0x3b, 0x70,
|
|
|
|
0xad, 0x85, 0x3e, 0x0a, 0x5c, 0x87, 0xe2, 0x0e, 0xe4, 0x13, 0x50, 0x97, 0x7a, 0x92, 0xa5, 0xd0,
|
|
|
|
0x84, 0x78, 0x5a, 0xd5, 0x13, 0x64, 0xbb, 0xe5, 0xe8, 0x49, 0xaa, 0xed, 0x99, 0xf7, 0xa0, 0xa4,
|
|
|
|
0x6e, 0x5c, 0x71, 0x9b, 0x79, 0x08, 0xff, 0x1f, 0x52, 0x2e, 0x2e, 0x6c, 0x7a, 0x06, 0x79, 0x25,
|
|
|
|
0x9a, 0x1b, 0x5a, 0x2d, 0xbb, 0xa6, 0x4f, 0x73, 0x88, 0xf9, 0x35, 0x03, 0xba, 0x8a, 0xa5, 0x35,
|
|
|
|
0x35, 0x62, 0x74, 0xec, 0x0a, 0xec, 0x9e, 0xe0, 0x44, 0x49, 0x70, 0x60, 0x16, 0x3a, 0xc0, 0xc9,
|
|
|
|
0x9f, 0x5d, 0xcf, 0xa6, 0x75, 0x3d, 0xb7, 0xd4, 0x75, 0x72, 0x03, 0xb2, 0x5e, 0xc0, 0x8d, 0x4d,
|
|
|
|
0x49, 0x9a, 0x8f, 0xa7, 0xd5, 0x6c, 0xeb, 0xcd, 0x5b, 0x27, 0x89, 0x91, 0xc7, 0xb0, 0x99, 0x58,
|
|
|
|
0xc3, 0x0d, 0x5d, 0xaa, 0x5a, 0xdd, 0x19, 0x55, 0x4e, 0x5e, 0x02, 0x0c, 0x5d, 0x7e, 0x3a, 0x42,
|
|
|
|
0xe6, 0x7a, 0x68, 0xe4, 0x65, 0x5b, 0xef, 0xa6, 0x81, 0x5f, 0x5f, 0x54, 0x3b, 0x97, 0x90, 0xe6,
|
|
|
|
0x37, 0x0d, 0x72, 0xc9, 0xbd, 0x57, 0xfa, 0x72, 0x1b, 0x20, 0x1a, 0xf5, 0x7c, 0xda, 0xbf, 0x64,
|
|
|
|
0x4b, 0x41, 0x45, 0x12, 0x57, 0x6c, 0x28, 0xba, 0xbe, 0x1f, 0x7e, 0x46, 0xaf, 0x4b, 0xa3, 0xe4,
|
|
|
|
0xb9, 0x67, 0xeb, 0x85, 0xe6, 0x56, 0x3c, 0xad, 0xc2, 0xbe, 0x0a, 0xb7, 0x3b, 0xdc, 0x81, 0x59,
|
|
|
|
0x49, 0x3b, 0xe2, 0xa4, 0x0c, 0xff, 0x61, 0xe0, 0x45, 0x21, 0x0d, 0xc4, 0xcc, 0xa6, 0x8b, 0x33,
|
|
|
|
0x69, 0xc0, 0x76, 0x84, 0x8c, 0x4b, 0x4b, 0x45, 0xf7, 0x04, 0x31, 0x72, 0x7d, 0x3a, 0x46, 0x69,
|
|
|
|
0x5c, 0xc9, 0xb9, 0xbe, 0xc8, 0x1d, 0xcc, 0x53, 0xe6, 0x2e, 0xc0, 0x42, 0x19, 0xb9, 0x05, 0x05,
|
|
|
|
0x1a, 0x08, 0x64, 0x47, 0x6e, 0x1f, 0x95, 0x16, 0x67, 0x11, 0xd8, 0xfb, 0x9e, 0x85, 0xc2, 0x7b,
|
|
|
|
0xca, 0x50, 0x7a, 0x42, 0xba, 0xa0, 0xab, 0x71, 0x27, 0xf7, 0xd3, 0x7c, 0x5b, 0x5a, 0x09, 0xe5,
|
|
|
|
0xdd, 0x35, 0x5e, 0xdd, 0xfc, 0xc9, 0x1e, 0x80, 0xae, 0xde, 0x7a, 0x3a, 0xc1, 0xd2, 0x3c, 0x94,
|
|
|
|
0x77, 0x2c, 0xb5, 0xa2, 0xac, 0xf9, 0x8a, 0xb2, 0x5e, 0x24, 0x2b, 0x8a, 0xbc, 0x82, 0x5c, 0x32,
|
|
|
|
0x0f, 0xe4, 0x8a, 0x7c, 0xb9, 0x9e, 0x46, 0xb1, 0x34, 0x49, 0x2e, 0xe4, 0x67, 0x4b, 0x83, 0xa4,
|
|
|
|
0xaa, 0x59, 0xde, 0x2c, 0x7f, 0xa5, 0x7c, 0x00, 0xb0, 0xd8, 0x1b, 0xe4, 0xc1, 0x6a, 0xf5, 0xff,
|
|
|
|
0x48, 0xd4, 0x6c, 0x9e, 0x9d, 0x57, 0x36, 0x7e, 0x9e, 0x57, 0x36, 0xbe, 0xc4, 0x15, 0xed, 0x2c,
|
|
|
|
0xae, 0x68, 0x3f, 0xe2, 0x8a, 0xf6, 0x2b, 0xae, 0x68, 0x1f, 0xeb, 0x6b, 0xfd, 0x9d, 0x3c, 0x1d,
|
|
|
|
0x37, 0x3e, 0x6c, 0xf4, 0x74, 0xe9, 0xe5, 0xc3, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x6d, 0xba,
|
|
|
|
0x1a, 0xed, 0x83, 0x06, 0x00, 0x00,
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
|
|
var _ context.Context
|
|
|
|
var _ grpc.ClientConn
|
|
|
|
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
|
|
// is compatible with the grpc package it is being compiled against.
|
|
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
|
|
|
|
// WireguardClient is the client API for Wireguard service.
|
|
|
|
//
|
|
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
|
|
type WireguardClient interface {
|
2019-07-10 21:35:46 +00:00
|
|
|
Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*TunnelResponse, error)
|
2019-07-10 20:59:43 +00:00
|
|
|
Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*types.Empty, error)
|
|
|
|
List(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*ListResponse, error)
|
2019-07-10 21:35:46 +00:00
|
|
|
AddPeer(ctx context.Context, in *AddPeerRequest, opts ...grpc.CallOption) (*TunnelResponse, error)
|
|
|
|
DeletePeer(ctx context.Context, in *DeletePeerRequest, opts ...grpc.CallOption) (*TunnelResponse, error)
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type wireguardClient struct {
|
|
|
|
cc *grpc.ClientConn
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewWireguardClient(cc *grpc.ClientConn) WireguardClient {
|
|
|
|
return &wireguardClient{cc}
|
|
|
|
}
|
|
|
|
|
2019-07-10 21:35:46 +00:00
|
|
|
func (c *wireguardClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*TunnelResponse, error) {
|
|
|
|
out := new(TunnelResponse)
|
2019-07-10 20:59:43 +00:00
|
|
|
err := c.cc.Invoke(ctx, "/com.crosbymichael.guard.v1.Wireguard/Create", in, out, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return out, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *wireguardClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*types.Empty, error) {
|
|
|
|
out := new(types.Empty)
|
|
|
|
err := c.cc.Invoke(ctx, "/com.crosbymichael.guard.v1.Wireguard/Delete", in, out, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return out, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *wireguardClient) List(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*ListResponse, error) {
|
|
|
|
out := new(ListResponse)
|
|
|
|
err := c.cc.Invoke(ctx, "/com.crosbymichael.guard.v1.Wireguard/List", in, out, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return out, nil
|
|
|
|
}
|
|
|
|
|
2019-07-10 21:35:46 +00:00
|
|
|
func (c *wireguardClient) AddPeer(ctx context.Context, in *AddPeerRequest, opts ...grpc.CallOption) (*TunnelResponse, error) {
|
|
|
|
out := new(TunnelResponse)
|
|
|
|
err := c.cc.Invoke(ctx, "/com.crosbymichael.guard.v1.Wireguard/AddPeer", in, out, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return out, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *wireguardClient) DeletePeer(ctx context.Context, in *DeletePeerRequest, opts ...grpc.CallOption) (*TunnelResponse, error) {
|
|
|
|
out := new(TunnelResponse)
|
|
|
|
err := c.cc.Invoke(ctx, "/com.crosbymichael.guard.v1.Wireguard/DeletePeer", in, out, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return out, nil
|
|
|
|
}
|
|
|
|
|
2019-07-10 20:59:43 +00:00
|
|
|
// WireguardServer is the server API for Wireguard service.
|
|
|
|
type WireguardServer interface {
|
2019-07-10 21:35:46 +00:00
|
|
|
Create(context.Context, *CreateRequest) (*TunnelResponse, error)
|
2019-07-10 20:59:43 +00:00
|
|
|
Delete(context.Context, *DeleteRequest) (*types.Empty, error)
|
|
|
|
List(context.Context, *types.Empty) (*ListResponse, error)
|
2019-07-10 21:35:46 +00:00
|
|
|
AddPeer(context.Context, *AddPeerRequest) (*TunnelResponse, error)
|
|
|
|
DeletePeer(context.Context, *DeletePeerRequest) (*TunnelResponse, error)
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func RegisterWireguardServer(s *grpc.Server, srv WireguardServer) {
|
|
|
|
s.RegisterService(&_Wireguard_serviceDesc, srv)
|
|
|
|
}
|
|
|
|
|
|
|
|
func _Wireguard_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
|
in := new(CreateRequest)
|
|
|
|
if err := dec(in); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
if interceptor == nil {
|
|
|
|
return srv.(WireguardServer).Create(ctx, in)
|
|
|
|
}
|
|
|
|
info := &grpc.UnaryServerInfo{
|
|
|
|
Server: srv,
|
|
|
|
FullMethod: "/com.crosbymichael.guard.v1.Wireguard/Create",
|
|
|
|
}
|
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
|
return srv.(WireguardServer).Create(ctx, req.(*CreateRequest))
|
|
|
|
}
|
|
|
|
return interceptor(ctx, in, info, handler)
|
|
|
|
}
|
|
|
|
|
|
|
|
func _Wireguard_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
|
in := new(DeleteRequest)
|
|
|
|
if err := dec(in); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
if interceptor == nil {
|
|
|
|
return srv.(WireguardServer).Delete(ctx, in)
|
|
|
|
}
|
|
|
|
info := &grpc.UnaryServerInfo{
|
|
|
|
Server: srv,
|
|
|
|
FullMethod: "/com.crosbymichael.guard.v1.Wireguard/Delete",
|
|
|
|
}
|
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
|
return srv.(WireguardServer).Delete(ctx, req.(*DeleteRequest))
|
|
|
|
}
|
|
|
|
return interceptor(ctx, in, info, handler)
|
|
|
|
}
|
|
|
|
|
|
|
|
func _Wireguard_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
|
in := new(types.Empty)
|
|
|
|
if err := dec(in); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
if interceptor == nil {
|
|
|
|
return srv.(WireguardServer).List(ctx, in)
|
|
|
|
}
|
|
|
|
info := &grpc.UnaryServerInfo{
|
|
|
|
Server: srv,
|
|
|
|
FullMethod: "/com.crosbymichael.guard.v1.Wireguard/List",
|
|
|
|
}
|
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
|
return srv.(WireguardServer).List(ctx, req.(*types.Empty))
|
|
|
|
}
|
|
|
|
return interceptor(ctx, in, info, handler)
|
|
|
|
}
|
|
|
|
|
2019-07-10 21:35:46 +00:00
|
|
|
func _Wireguard_AddPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
|
in := new(AddPeerRequest)
|
|
|
|
if err := dec(in); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
if interceptor == nil {
|
|
|
|
return srv.(WireguardServer).AddPeer(ctx, in)
|
|
|
|
}
|
|
|
|
info := &grpc.UnaryServerInfo{
|
|
|
|
Server: srv,
|
|
|
|
FullMethod: "/com.crosbymichael.guard.v1.Wireguard/AddPeer",
|
|
|
|
}
|
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
|
return srv.(WireguardServer).AddPeer(ctx, req.(*AddPeerRequest))
|
|
|
|
}
|
|
|
|
return interceptor(ctx, in, info, handler)
|
|
|
|
}
|
|
|
|
|
|
|
|
func _Wireguard_DeletePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
|
in := new(DeletePeerRequest)
|
|
|
|
if err := dec(in); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
if interceptor == nil {
|
|
|
|
return srv.(WireguardServer).DeletePeer(ctx, in)
|
|
|
|
}
|
|
|
|
info := &grpc.UnaryServerInfo{
|
|
|
|
Server: srv,
|
|
|
|
FullMethod: "/com.crosbymichael.guard.v1.Wireguard/DeletePeer",
|
|
|
|
}
|
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
|
return srv.(WireguardServer).DeletePeer(ctx, req.(*DeletePeerRequest))
|
|
|
|
}
|
|
|
|
return interceptor(ctx, in, info, handler)
|
|
|
|
}
|
|
|
|
|
2019-07-10 20:59:43 +00:00
|
|
|
var _Wireguard_serviceDesc = grpc.ServiceDesc{
|
|
|
|
ServiceName: "com.crosbymichael.guard.v1.Wireguard",
|
|
|
|
HandlerType: (*WireguardServer)(nil),
|
|
|
|
Methods: []grpc.MethodDesc{
|
|
|
|
{
|
|
|
|
MethodName: "Create",
|
|
|
|
Handler: _Wireguard_Create_Handler,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
MethodName: "Delete",
|
|
|
|
Handler: _Wireguard_Delete_Handler,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
MethodName: "List",
|
|
|
|
Handler: _Wireguard_List_Handler,
|
|
|
|
},
|
2019-07-10 21:35:46 +00:00
|
|
|
{
|
|
|
|
MethodName: "AddPeer",
|
|
|
|
Handler: _Wireguard_AddPeer_Handler,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
MethodName: "DeletePeer",
|
|
|
|
Handler: _Wireguard_DeletePeer_Handler,
|
|
|
|
},
|
2019-07-10 20:59:43 +00:00
|
|
|
},
|
|
|
|
Streams: []grpc.StreamDesc{},
|
|
|
|
Metadata: "github.com/crosbymichael/guard/api/v1/guard.proto",
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *CreateRequest) Marshal() (dAtA []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
dAtA = make([]byte, size)
|
|
|
|
n, err := m.MarshalTo(dAtA)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return dAtA[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *CreateRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
|
|
var i int
|
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if len(m.ID) > 0 {
|
|
|
|
dAtA[i] = 0xa
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(len(m.ID)))
|
|
|
|
i += copy(dAtA[i:], m.ID)
|
|
|
|
}
|
|
|
|
if m.ListenPort != 0 {
|
|
|
|
dAtA[i] = 0x10
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(m.ListenPort))
|
|
|
|
}
|
|
|
|
if len(m.Address) > 0 {
|
|
|
|
dAtA[i] = 0x1a
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(len(m.Address)))
|
|
|
|
i += copy(dAtA[i:], m.Address)
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return i, nil
|
|
|
|
}
|
|
|
|
|
2019-07-10 21:35:46 +00:00
|
|
|
func (m *TunnelResponse) Marshal() (dAtA []byte, err error) {
|
2019-07-10 20:59:43 +00:00
|
|
|
size := m.Size()
|
|
|
|
dAtA = make([]byte, size)
|
|
|
|
n, err := m.MarshalTo(dAtA)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return dAtA[:n], nil
|
|
|
|
}
|
|
|
|
|
2019-07-10 21:35:46 +00:00
|
|
|
func (m *TunnelResponse) MarshalTo(dAtA []byte) (int, error) {
|
2019-07-10 20:59:43 +00:00
|
|
|
var i int
|
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if m.Tunnel != nil {
|
|
|
|
dAtA[i] = 0xa
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(m.Tunnel.Size()))
|
|
|
|
n1, err := m.Tunnel.MarshalTo(dAtA[i:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n1
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return i, nil
|
|
|
|
}
|
|
|
|
|
2019-07-10 21:35:46 +00:00
|
|
|
func (m *AddPeerRequest) Marshal() (dAtA []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
dAtA = make([]byte, size)
|
|
|
|
n, err := m.MarshalTo(dAtA)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return dAtA[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *AddPeerRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
|
|
var i int
|
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if len(m.ID) > 0 {
|
|
|
|
dAtA[i] = 0xa
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(len(m.ID)))
|
|
|
|
i += copy(dAtA[i:], m.ID)
|
|
|
|
}
|
|
|
|
if m.Peer != nil {
|
|
|
|
dAtA[i] = 0x12
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(m.Peer.Size()))
|
|
|
|
n2, err := m.Peer.MarshalTo(dAtA[i:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n2
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return i, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *DeletePeerRequest) Marshal() (dAtA []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
dAtA = make([]byte, size)
|
|
|
|
n, err := m.MarshalTo(dAtA)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return dAtA[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *DeletePeerRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
|
|
var i int
|
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if len(m.ID) > 0 {
|
|
|
|
dAtA[i] = 0xa
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(len(m.ID)))
|
|
|
|
i += copy(dAtA[i:], m.ID)
|
|
|
|
}
|
|
|
|
if len(m.PeerID) > 0 {
|
|
|
|
dAtA[i] = 0x12
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(len(m.PeerID)))
|
|
|
|
i += copy(dAtA[i:], m.PeerID)
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return i, nil
|
|
|
|
}
|
|
|
|
|
2019-07-10 20:59:43 +00:00
|
|
|
func (m *DeleteRequest) Marshal() (dAtA []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
dAtA = make([]byte, size)
|
|
|
|
n, err := m.MarshalTo(dAtA)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return dAtA[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *DeleteRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
|
|
var i int
|
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if len(m.ID) > 0 {
|
|
|
|
dAtA[i] = 0xa
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(len(m.ID)))
|
|
|
|
i += copy(dAtA[i:], m.ID)
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return i, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ListResponse) Marshal() (dAtA []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
dAtA = make([]byte, size)
|
|
|
|
n, err := m.MarshalTo(dAtA)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return dAtA[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ListResponse) MarshalTo(dAtA []byte) (int, error) {
|
|
|
|
var i int
|
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if len(m.Tunnels) > 0 {
|
|
|
|
for _, msg := range m.Tunnels {
|
|
|
|
dAtA[i] = 0xa
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(msg.Size()))
|
|
|
|
n, err := msg.MarshalTo(dAtA[i:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return i, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Tunnel) Marshal() (dAtA []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
dAtA = make([]byte, size)
|
|
|
|
n, err := m.MarshalTo(dAtA)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return dAtA[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Tunnel) MarshalTo(dAtA []byte) (int, error) {
|
|
|
|
var i int
|
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if len(m.ID) > 0 {
|
|
|
|
dAtA[i] = 0xa
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(len(m.ID)))
|
|
|
|
i += copy(dAtA[i:], m.ID)
|
|
|
|
}
|
|
|
|
if len(m.PrivateKey) > 0 {
|
|
|
|
dAtA[i] = 0x12
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(len(m.PrivateKey)))
|
|
|
|
i += copy(dAtA[i:], m.PrivateKey)
|
|
|
|
}
|
|
|
|
if m.ListenPort != 0 {
|
|
|
|
dAtA[i] = 0x18
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(m.ListenPort))
|
|
|
|
}
|
|
|
|
if len(m.Address) > 0 {
|
|
|
|
dAtA[i] = 0x22
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(len(m.Address)))
|
|
|
|
i += copy(dAtA[i:], m.Address)
|
|
|
|
}
|
|
|
|
if len(m.DNS) > 0 {
|
|
|
|
dAtA[i] = 0x2a
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(len(m.DNS)))
|
|
|
|
i += copy(dAtA[i:], m.DNS)
|
|
|
|
}
|
|
|
|
if len(m.Peers) > 0 {
|
|
|
|
for _, msg := range m.Peers {
|
|
|
|
dAtA[i] = 0x32
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(msg.Size()))
|
|
|
|
n, err := msg.MarshalTo(dAtA[i:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i += n
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.Masquerade != nil {
|
|
|
|
dAtA[i] = 0x3a
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(m.Masquerade.Size()))
|
2019-07-10 21:35:46 +00:00
|
|
|
n3, err := m.Masquerade.MarshalTo(dAtA[i:])
|
2019-07-10 20:59:43 +00:00
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
i += n3
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return i, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Peer) Marshal() (dAtA []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
dAtA = make([]byte, size)
|
|
|
|
n, err := m.MarshalTo(dAtA)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return dAtA[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Peer) MarshalTo(dAtA []byte) (int, error) {
|
|
|
|
var i int
|
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
2019-07-10 21:35:46 +00:00
|
|
|
if len(m.ID) > 0 {
|
2019-07-10 20:59:43 +00:00
|
|
|
dAtA[i] = 0xa
|
|
|
|
i++
|
2019-07-10 21:35:46 +00:00
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(len(m.ID)))
|
|
|
|
i += copy(dAtA[i:], m.ID)
|
|
|
|
}
|
|
|
|
if len(m.PublicKey) > 0 {
|
|
|
|
dAtA[i] = 0x12
|
|
|
|
i++
|
2019-07-10 20:59:43 +00:00
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(len(m.PublicKey)))
|
|
|
|
i += copy(dAtA[i:], m.PublicKey)
|
|
|
|
}
|
|
|
|
if len(m.AllowedIPs) > 0 {
|
|
|
|
for _, s := range m.AllowedIPs {
|
2019-07-10 21:35:46 +00:00
|
|
|
dAtA[i] = 0x1a
|
2019-07-10 20:59:43 +00:00
|
|
|
i++
|
|
|
|
l = len(s)
|
|
|
|
for l >= 1<<7 {
|
|
|
|
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
|
|
|
|
l >>= 7
|
|
|
|
i++
|
|
|
|
}
|
|
|
|
dAtA[i] = uint8(l)
|
|
|
|
i++
|
|
|
|
i += copy(dAtA[i:], s)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(m.Endpoint) > 0 {
|
2019-07-10 21:35:46 +00:00
|
|
|
dAtA[i] = 0x22
|
2019-07-10 20:59:43 +00:00
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(len(m.Endpoint)))
|
|
|
|
i += copy(dAtA[i:], m.Endpoint)
|
|
|
|
}
|
|
|
|
if m.PersistentKeepalive != 0 {
|
2019-07-10 21:35:46 +00:00
|
|
|
dAtA[i] = 0x28
|
2019-07-10 20:59:43 +00:00
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(m.PersistentKeepalive))
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return i, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Masquerade) Marshal() (dAtA []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
dAtA = make([]byte, size)
|
|
|
|
n, err := m.MarshalTo(dAtA)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return dAtA[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Masquerade) MarshalTo(dAtA []byte) (int, error) {
|
|
|
|
var i int
|
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if len(m.Interface) > 0 {
|
|
|
|
dAtA[i] = 0xa
|
|
|
|
i++
|
|
|
|
i = encodeVarintGuard(dAtA, i, uint64(len(m.Interface)))
|
|
|
|
i += copy(dAtA[i:], m.Interface)
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return i, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func encodeVarintGuard(dAtA []byte, offset int, v uint64) int {
|
|
|
|
for v >= 1<<7 {
|
|
|
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
|
|
v >>= 7
|
|
|
|
offset++
|
|
|
|
}
|
|
|
|
dAtA[offset] = uint8(v)
|
|
|
|
return offset + 1
|
|
|
|
}
|
|
|
|
func (m *CreateRequest) Size() (n int) {
|
|
|
|
if m == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
l = len(m.ID)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
if m.ListenPort != 0 {
|
|
|
|
n += 1 + sovGuard(uint64(m.ListenPort))
|
|
|
|
}
|
|
|
|
l = len(m.Address)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
n += len(m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
2019-07-10 21:35:46 +00:00
|
|
|
func (m *TunnelResponse) Size() (n int) {
|
2019-07-10 20:59:43 +00:00
|
|
|
if m == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if m.Tunnel != nil {
|
|
|
|
l = m.Tunnel.Size()
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
n += len(m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
2019-07-10 21:35:46 +00:00
|
|
|
func (m *AddPeerRequest) Size() (n int) {
|
|
|
|
if m == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
l = len(m.ID)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
if m.Peer != nil {
|
|
|
|
l = m.Peer.Size()
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
n += len(m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *DeletePeerRequest) Size() (n int) {
|
|
|
|
if m == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
l = len(m.ID)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
l = len(m.PeerID)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
n += len(m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
2019-07-10 20:59:43 +00:00
|
|
|
func (m *DeleteRequest) Size() (n int) {
|
|
|
|
if m == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
l = len(m.ID)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
n += len(m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ListResponse) Size() (n int) {
|
|
|
|
if m == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if len(m.Tunnels) > 0 {
|
|
|
|
for _, e := range m.Tunnels {
|
|
|
|
l = e.Size()
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
n += len(m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Tunnel) Size() (n int) {
|
|
|
|
if m == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
l = len(m.ID)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
l = len(m.PrivateKey)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
if m.ListenPort != 0 {
|
|
|
|
n += 1 + sovGuard(uint64(m.ListenPort))
|
|
|
|
}
|
|
|
|
l = len(m.Address)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
l = len(m.DNS)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
if len(m.Peers) > 0 {
|
|
|
|
for _, e := range m.Peers {
|
|
|
|
l = e.Size()
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.Masquerade != nil {
|
|
|
|
l = m.Masquerade.Size()
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
n += len(m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Peer) Size() (n int) {
|
|
|
|
if m == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
var l int
|
|
|
|
_ = l
|
2019-07-10 21:35:46 +00:00
|
|
|
l = len(m.ID)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
2019-07-10 20:59:43 +00:00
|
|
|
l = len(m.PublicKey)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
if len(m.AllowedIPs) > 0 {
|
|
|
|
for _, s := range m.AllowedIPs {
|
|
|
|
l = len(s)
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l = len(m.Endpoint)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
if m.PersistentKeepalive != 0 {
|
|
|
|
n += 1 + sovGuard(uint64(m.PersistentKeepalive))
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
n += len(m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Masquerade) Size() (n int) {
|
|
|
|
if m == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
l = len(m.Interface)
|
|
|
|
if l > 0 {
|
|
|
|
n += 1 + l + sovGuard(uint64(l))
|
|
|
|
}
|
|
|
|
if m.XXX_unrecognized != nil {
|
|
|
|
n += len(m.XXX_unrecognized)
|
|
|
|
}
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
|
|
|
func sovGuard(x uint64) (n int) {
|
|
|
|
for {
|
|
|
|
n++
|
|
|
|
x >>= 7
|
|
|
|
if x == 0 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
func sozGuard(x uint64) (n int) {
|
|
|
|
return sovGuard(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
|
|
}
|
|
|
|
func (this *CreateRequest) String() string {
|
|
|
|
if this == nil {
|
|
|
|
return "nil"
|
|
|
|
}
|
|
|
|
s := strings.Join([]string{`&CreateRequest{`,
|
|
|
|
`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
|
|
|
|
`ListenPort:` + fmt.Sprintf("%v", this.ListenPort) + `,`,
|
|
|
|
`Address:` + fmt.Sprintf("%v", this.Address) + `,`,
|
|
|
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
|
|
`}`,
|
|
|
|
}, "")
|
|
|
|
return s
|
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
func (this *TunnelResponse) String() string {
|
2019-07-10 20:59:43 +00:00
|
|
|
if this == nil {
|
|
|
|
return "nil"
|
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
s := strings.Join([]string{`&TunnelResponse{`,
|
2019-07-10 20:59:43 +00:00
|
|
|
`Tunnel:` + strings.Replace(fmt.Sprintf("%v", this.Tunnel), "Tunnel", "Tunnel", 1) + `,`,
|
|
|
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
|
|
`}`,
|
|
|
|
}, "")
|
|
|
|
return s
|
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
func (this *AddPeerRequest) String() string {
|
|
|
|
if this == nil {
|
|
|
|
return "nil"
|
|
|
|
}
|
|
|
|
s := strings.Join([]string{`&AddPeerRequest{`,
|
|
|
|
`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
|
|
|
|
`Peer:` + strings.Replace(fmt.Sprintf("%v", this.Peer), "Peer", "Peer", 1) + `,`,
|
|
|
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
|
|
`}`,
|
|
|
|
}, "")
|
|
|
|
return s
|
|
|
|
}
|
|
|
|
func (this *DeletePeerRequest) String() string {
|
|
|
|
if this == nil {
|
|
|
|
return "nil"
|
|
|
|
}
|
|
|
|
s := strings.Join([]string{`&DeletePeerRequest{`,
|
|
|
|
`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
|
|
|
|
`PeerID:` + fmt.Sprintf("%v", this.PeerID) + `,`,
|
|
|
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
|
|
`}`,
|
|
|
|
}, "")
|
|
|
|
return s
|
|
|
|
}
|
2019-07-10 20:59:43 +00:00
|
|
|
func (this *DeleteRequest) String() string {
|
|
|
|
if this == nil {
|
|
|
|
return "nil"
|
|
|
|
}
|
|
|
|
s := strings.Join([]string{`&DeleteRequest{`,
|
|
|
|
`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
|
|
|
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
|
|
`}`,
|
|
|
|
}, "")
|
|
|
|
return s
|
|
|
|
}
|
|
|
|
func (this *ListResponse) String() string {
|
|
|
|
if this == nil {
|
|
|
|
return "nil"
|
|
|
|
}
|
|
|
|
s := strings.Join([]string{`&ListResponse{`,
|
|
|
|
`Tunnels:` + strings.Replace(fmt.Sprintf("%v", this.Tunnels), "Tunnel", "Tunnel", 1) + `,`,
|
|
|
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
|
|
`}`,
|
|
|
|
}, "")
|
|
|
|
return s
|
|
|
|
}
|
|
|
|
func (this *Tunnel) String() string {
|
|
|
|
if this == nil {
|
|
|
|
return "nil"
|
|
|
|
}
|
|
|
|
s := strings.Join([]string{`&Tunnel{`,
|
|
|
|
`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
|
|
|
|
`PrivateKey:` + fmt.Sprintf("%v", this.PrivateKey) + `,`,
|
|
|
|
`ListenPort:` + fmt.Sprintf("%v", this.ListenPort) + `,`,
|
|
|
|
`Address:` + fmt.Sprintf("%v", this.Address) + `,`,
|
|
|
|
`DNS:` + fmt.Sprintf("%v", this.DNS) + `,`,
|
|
|
|
`Peers:` + strings.Replace(fmt.Sprintf("%v", this.Peers), "Peer", "Peer", 1) + `,`,
|
|
|
|
`Masquerade:` + strings.Replace(fmt.Sprintf("%v", this.Masquerade), "Masquerade", "Masquerade", 1) + `,`,
|
|
|
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
|
|
`}`,
|
|
|
|
}, "")
|
|
|
|
return s
|
|
|
|
}
|
|
|
|
func (this *Peer) String() string {
|
|
|
|
if this == nil {
|
|
|
|
return "nil"
|
|
|
|
}
|
|
|
|
s := strings.Join([]string{`&Peer{`,
|
2019-07-10 21:35:46 +00:00
|
|
|
`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
|
2019-07-10 20:59:43 +00:00
|
|
|
`PublicKey:` + fmt.Sprintf("%v", this.PublicKey) + `,`,
|
|
|
|
`AllowedIPs:` + fmt.Sprintf("%v", this.AllowedIPs) + `,`,
|
|
|
|
`Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`,
|
|
|
|
`PersistentKeepalive:` + fmt.Sprintf("%v", this.PersistentKeepalive) + `,`,
|
|
|
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
|
|
`}`,
|
|
|
|
}, "")
|
|
|
|
return s
|
|
|
|
}
|
|
|
|
func (this *Masquerade) String() string {
|
|
|
|
if this == nil {
|
|
|
|
return "nil"
|
|
|
|
}
|
|
|
|
s := strings.Join([]string{`&Masquerade{`,
|
|
|
|
`Interface:` + fmt.Sprintf("%v", this.Interface) + `,`,
|
|
|
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
|
|
`}`,
|
|
|
|
}, "")
|
|
|
|
return s
|
|
|
|
}
|
|
|
|
func valueToStringGuard(v interface{}) string {
|
|
|
|
rv := reflect.ValueOf(v)
|
|
|
|
if rv.IsNil() {
|
|
|
|
return "nil"
|
|
|
|
}
|
|
|
|
pv := reflect.Indirect(rv).Interface()
|
|
|
|
return fmt.Sprintf("*%v", pv)
|
|
|
|
}
|
|
|
|
func (m *CreateRequest) Unmarshal(dAtA []byte) error {
|
|
|
|
l := len(dAtA)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
preIndex := iNdEx
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
|
|
|
return fmt.Errorf("proto: CreateRequest: wiretype end group for non-group")
|
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
|
|
|
return fmt.Errorf("proto: CreateRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
|
}
|
|
|
|
switch fieldNum {
|
|
|
|
case 1:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
|
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.ID = string(dAtA[iNdEx:postIndex])
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 2:
|
|
|
|
if wireType != 0 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ListenPort", wireType)
|
|
|
|
}
|
|
|
|
m.ListenPort = 0
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
m.ListenPort |= uint32(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
|
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Address = string(dAtA[iNdEx:postIndex])
|
|
|
|
iNdEx = postIndex
|
|
|
|
default:
|
|
|
|
iNdEx = preIndex
|
|
|
|
skippy, err := skipGuard(dAtA[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if skippy < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
func (m *TunnelResponse) Unmarshal(dAtA []byte) error {
|
2019-07-10 20:59:43 +00:00
|
|
|
l := len(dAtA)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
preIndex := iNdEx
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
2019-07-10 21:35:46 +00:00
|
|
|
return fmt.Errorf("proto: TunnelResponse: wiretype end group for non-group")
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
2019-07-10 21:35:46 +00:00
|
|
|
return fmt.Errorf("proto: TunnelResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
switch fieldNum {
|
|
|
|
case 1:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Tunnel", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= int(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.Tunnel == nil {
|
|
|
|
m.Tunnel = &Tunnel{}
|
|
|
|
}
|
|
|
|
if err := m.Tunnel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
default:
|
|
|
|
iNdEx = preIndex
|
|
|
|
skippy, err := skipGuard(dAtA[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if skippy < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
func (m *AddPeerRequest) Unmarshal(dAtA []byte) error {
|
2019-07-10 20:59:43 +00:00
|
|
|
l := len(dAtA)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
preIndex := iNdEx
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
2019-07-10 21:35:46 +00:00
|
|
|
return fmt.Errorf("proto: AddPeerRequest: wiretype end group for non-group")
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
2019-07-10 21:35:46 +00:00
|
|
|
return fmt.Errorf("proto: AddPeerRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
switch fieldNum {
|
|
|
|
case 1:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
|
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.ID = string(dAtA[iNdEx:postIndex])
|
|
|
|
iNdEx = postIndex
|
2019-07-10 21:35:46 +00:00
|
|
|
case 2:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Peer", wireType)
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= int(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.Peer == nil {
|
|
|
|
m.Peer = &Peer{}
|
|
|
|
}
|
|
|
|
if err := m.Peer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
default:
|
|
|
|
iNdEx = preIndex
|
|
|
|
skippy, err := skipGuard(dAtA[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if skippy < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func (m *DeletePeerRequest) Unmarshal(dAtA []byte) error {
|
|
|
|
l := len(dAtA)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
preIndex := iNdEx
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
|
|
|
return fmt.Errorf("proto: DeletePeerRequest: wiretype end group for non-group")
|
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
|
|
|
return fmt.Errorf("proto: DeletePeerRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
|
}
|
|
|
|
switch fieldNum {
|
|
|
|
case 1:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
|
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.ID = string(dAtA[iNdEx:postIndex])
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 2:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field PeerID", wireType)
|
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.PeerID = string(dAtA[iNdEx:postIndex])
|
|
|
|
iNdEx = postIndex
|
|
|
|
default:
|
|
|
|
iNdEx = preIndex
|
|
|
|
skippy, err := skipGuard(dAtA[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if skippy < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func (m *DeleteRequest) Unmarshal(dAtA []byte) error {
|
|
|
|
l := len(dAtA)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
preIndex := iNdEx
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
|
|
|
return fmt.Errorf("proto: DeleteRequest: wiretype end group for non-group")
|
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
|
|
|
return fmt.Errorf("proto: DeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
|
}
|
|
|
|
switch fieldNum {
|
|
|
|
case 1:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
|
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.ID = string(dAtA[iNdEx:postIndex])
|
|
|
|
iNdEx = postIndex
|
|
|
|
default:
|
|
|
|
iNdEx = preIndex
|
|
|
|
skippy, err := skipGuard(dAtA[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if skippy < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func (m *ListResponse) Unmarshal(dAtA []byte) error {
|
|
|
|
l := len(dAtA)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
preIndex := iNdEx
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
|
|
|
return fmt.Errorf("proto: ListResponse: wiretype end group for non-group")
|
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
|
|
|
return fmt.Errorf("proto: ListResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
|
}
|
|
|
|
switch fieldNum {
|
|
|
|
case 1:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Tunnels", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= int(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Tunnels = append(m.Tunnels, &Tunnel{})
|
|
|
|
if err := m.Tunnels[len(m.Tunnels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
default:
|
|
|
|
iNdEx = preIndex
|
|
|
|
skippy, err := skipGuard(dAtA[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if skippy < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func (m *Tunnel) Unmarshal(dAtA []byte) error {
|
|
|
|
l := len(dAtA)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
preIndex := iNdEx
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
|
|
|
return fmt.Errorf("proto: Tunnel: wiretype end group for non-group")
|
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
|
|
|
return fmt.Errorf("proto: Tunnel: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
|
}
|
|
|
|
switch fieldNum {
|
|
|
|
case 1:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
|
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.ID = string(dAtA[iNdEx:postIndex])
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 2:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field PrivateKey", wireType)
|
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.PrivateKey = string(dAtA[iNdEx:postIndex])
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 3:
|
|
|
|
if wireType != 0 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ListenPort", wireType)
|
|
|
|
}
|
|
|
|
m.ListenPort = 0
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
m.ListenPort |= uint32(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 4:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
|
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Address = string(dAtA[iNdEx:postIndex])
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 5:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field DNS", wireType)
|
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.DNS = string(dAtA[iNdEx:postIndex])
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 6:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Peers", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= int(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Peers = append(m.Peers, &Peer{})
|
|
|
|
if err := m.Peers[len(m.Peers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 7:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Masquerade", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
msglen |= int(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if m.Masquerade == nil {
|
|
|
|
m.Masquerade = &Masquerade{}
|
|
|
|
}
|
|
|
|
if err := m.Masquerade.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
default:
|
|
|
|
iNdEx = preIndex
|
|
|
|
skippy, err := skipGuard(dAtA[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if skippy < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func (m *Peer) Unmarshal(dAtA []byte) error {
|
|
|
|
l := len(dAtA)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
preIndex := iNdEx
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
|
|
|
return fmt.Errorf("proto: Peer: wiretype end group for non-group")
|
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
|
|
|
return fmt.Errorf("proto: Peer: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
|
}
|
|
|
|
switch fieldNum {
|
|
|
|
case 1:
|
|
|
|
if wireType != 2 {
|
2019-07-10 21:35:46 +00:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
m.ID = string(dAtA[iNdEx:postIndex])
|
2019-07-10 20:59:43 +00:00
|
|
|
iNdEx = postIndex
|
|
|
|
case 2:
|
|
|
|
if wireType != 2 {
|
2019-07-10 21:35:46 +00:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType)
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
m.PublicKey = string(dAtA[iNdEx:postIndex])
|
2019-07-10 20:59:43 +00:00
|
|
|
iNdEx = postIndex
|
|
|
|
case 3:
|
|
|
|
if wireType != 2 {
|
2019-07-10 21:35:46 +00:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AllowedIPs", wireType)
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
m.AllowedIPs = append(m.AllowedIPs, string(dAtA[iNdEx:postIndex]))
|
2019-07-10 20:59:43 +00:00
|
|
|
iNdEx = postIndex
|
|
|
|
case 4:
|
|
|
|
if wireType != 2 {
|
2019-07-10 21:35:46 +00:00
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType)
|
2019-07-10 20:59:43 +00:00
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2019-07-10 21:35:46 +00:00
|
|
|
m.Endpoint = string(dAtA[iNdEx:postIndex])
|
2019-07-10 20:59:43 +00:00
|
|
|
iNdEx = postIndex
|
2019-07-10 21:35:46 +00:00
|
|
|
case 5:
|
|
|
|
if wireType != 0 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field PersistentKeepalive", wireType)
|
|
|
|
}
|
|
|
|
m.PersistentKeepalive = 0
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
m.PersistentKeepalive |= uint32(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
2019-07-10 20:59:43 +00:00
|
|
|
default:
|
|
|
|
iNdEx = preIndex
|
|
|
|
skippy, err := skipGuard(dAtA[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if skippy < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func (m *Masquerade) Unmarshal(dAtA []byte) error {
|
|
|
|
l := len(dAtA)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
preIndex := iNdEx
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
|
|
|
return fmt.Errorf("proto: Masquerade: wiretype end group for non-group")
|
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
|
|
|
return fmt.Errorf("proto: Masquerade: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
|
}
|
|
|
|
switch fieldNum {
|
|
|
|
case 1:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Interface", wireType)
|
|
|
|
}
|
|
|
|
var stringLen uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
intStringLen := int(stringLen)
|
|
|
|
if intStringLen < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + intStringLen
|
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Interface = string(dAtA[iNdEx:postIndex])
|
|
|
|
iNdEx = postIndex
|
|
|
|
default:
|
|
|
|
iNdEx = preIndex
|
|
|
|
skippy, err := skipGuard(dAtA[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if skippy < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) < 0 {
|
|
|
|
return ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func skipGuard(dAtA []byte) (n int, err error) {
|
|
|
|
l := len(dAtA)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return 0, ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
switch wireType {
|
|
|
|
case 0:
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return 0, ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
iNdEx++
|
|
|
|
if dAtA[iNdEx-1] < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return iNdEx, nil
|
|
|
|
case 1:
|
|
|
|
iNdEx += 8
|
|
|
|
return iNdEx, nil
|
|
|
|
case 2:
|
|
|
|
var length int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return 0, ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
length |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if length < 0 {
|
|
|
|
return 0, ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
iNdEx += length
|
|
|
|
if iNdEx < 0 {
|
|
|
|
return 0, ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
return iNdEx, nil
|
|
|
|
case 3:
|
|
|
|
for {
|
|
|
|
var innerWire uint64
|
|
|
|
var start int = iNdEx
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return 0, ErrIntOverflowGuard
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
innerWire |= (uint64(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
innerWireType := int(innerWire & 0x7)
|
|
|
|
if innerWireType == 4 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
next, err := skipGuard(dAtA[start:])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
iNdEx = start + next
|
|
|
|
if iNdEx < 0 {
|
|
|
|
return 0, ErrInvalidLengthGuard
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return iNdEx, nil
|
|
|
|
case 4:
|
|
|
|
return iNdEx, nil
|
|
|
|
case 5:
|
|
|
|
iNdEx += 4
|
|
|
|
return iNdEx, nil
|
|
|
|
default:
|
|
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
panic("unreachable")
|
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
|
|
|
ErrInvalidLengthGuard = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
|
|
ErrIntOverflowGuard = fmt.Errorf("proto: integer overflow")
|
|
|
|
)
|