869 lines
23 KiB
Go
869 lines
23 KiB
Go
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: circuitv1.proto
|
|
|
|
package circuitv1_pb
|
|
|
|
import (
|
|
fmt "fmt"
|
|
github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
|
|
proto "github.com/gogo/protobuf/proto"
|
|
io "io"
|
|
math "math"
|
|
math_bits "math/bits"
|
|
)
|
|
|
|
// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
type CircuitRelay_Status int32
|
|
|
|
const (
|
|
CircuitRelay_SUCCESS CircuitRelay_Status = 100
|
|
CircuitRelay_HOP_SRC_ADDR_TOO_LONG CircuitRelay_Status = 220
|
|
CircuitRelay_HOP_DST_ADDR_TOO_LONG CircuitRelay_Status = 221
|
|
CircuitRelay_HOP_SRC_MULTIADDR_INVALID CircuitRelay_Status = 250
|
|
CircuitRelay_HOP_DST_MULTIADDR_INVALID CircuitRelay_Status = 251
|
|
CircuitRelay_HOP_NO_CONN_TO_DST CircuitRelay_Status = 260
|
|
CircuitRelay_HOP_CANT_DIAL_DST CircuitRelay_Status = 261
|
|
CircuitRelay_HOP_CANT_OPEN_DST_STREAM CircuitRelay_Status = 262
|
|
CircuitRelay_HOP_CANT_SPEAK_RELAY CircuitRelay_Status = 270
|
|
CircuitRelay_HOP_CANT_RELAY_TO_SELF CircuitRelay_Status = 280
|
|
CircuitRelay_STOP_SRC_ADDR_TOO_LONG CircuitRelay_Status = 320
|
|
CircuitRelay_STOP_DST_ADDR_TOO_LONG CircuitRelay_Status = 321
|
|
CircuitRelay_STOP_SRC_MULTIADDR_INVALID CircuitRelay_Status = 350
|
|
CircuitRelay_STOP_DST_MULTIADDR_INVALID CircuitRelay_Status = 351
|
|
CircuitRelay_STOP_RELAY_REFUSED CircuitRelay_Status = 390
|
|
CircuitRelay_MALFORMED_MESSAGE CircuitRelay_Status = 400
|
|
)
|
|
|
|
var CircuitRelay_Status_name = map[int32]string{
|
|
100: "SUCCESS",
|
|
220: "HOP_SRC_ADDR_TOO_LONG",
|
|
221: "HOP_DST_ADDR_TOO_LONG",
|
|
250: "HOP_SRC_MULTIADDR_INVALID",
|
|
251: "HOP_DST_MULTIADDR_INVALID",
|
|
260: "HOP_NO_CONN_TO_DST",
|
|
261: "HOP_CANT_DIAL_DST",
|
|
262: "HOP_CANT_OPEN_DST_STREAM",
|
|
270: "HOP_CANT_SPEAK_RELAY",
|
|
280: "HOP_CANT_RELAY_TO_SELF",
|
|
320: "STOP_SRC_ADDR_TOO_LONG",
|
|
321: "STOP_DST_ADDR_TOO_LONG",
|
|
350: "STOP_SRC_MULTIADDR_INVALID",
|
|
351: "STOP_DST_MULTIADDR_INVALID",
|
|
390: "STOP_RELAY_REFUSED",
|
|
400: "MALFORMED_MESSAGE",
|
|
}
|
|
|
|
var CircuitRelay_Status_value = map[string]int32{
|
|
"SUCCESS": 100,
|
|
"HOP_SRC_ADDR_TOO_LONG": 220,
|
|
"HOP_DST_ADDR_TOO_LONG": 221,
|
|
"HOP_SRC_MULTIADDR_INVALID": 250,
|
|
"HOP_DST_MULTIADDR_INVALID": 251,
|
|
"HOP_NO_CONN_TO_DST": 260,
|
|
"HOP_CANT_DIAL_DST": 261,
|
|
"HOP_CANT_OPEN_DST_STREAM": 262,
|
|
"HOP_CANT_SPEAK_RELAY": 270,
|
|
"HOP_CANT_RELAY_TO_SELF": 280,
|
|
"STOP_SRC_ADDR_TOO_LONG": 320,
|
|
"STOP_DST_ADDR_TOO_LONG": 321,
|
|
"STOP_SRC_MULTIADDR_INVALID": 350,
|
|
"STOP_DST_MULTIADDR_INVALID": 351,
|
|
"STOP_RELAY_REFUSED": 390,
|
|
"MALFORMED_MESSAGE": 400,
|
|
}
|
|
|
|
func (x CircuitRelay_Status) Enum() *CircuitRelay_Status {
|
|
p := new(CircuitRelay_Status)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x CircuitRelay_Status) String() string {
|
|
return proto.EnumName(CircuitRelay_Status_name, int32(x))
|
|
}
|
|
|
|
func (x *CircuitRelay_Status) UnmarshalJSON(data []byte) error {
|
|
value, err := proto.UnmarshalJSONEnum(CircuitRelay_Status_value, data, "CircuitRelay_Status")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
*x = CircuitRelay_Status(value)
|
|
return nil
|
|
}
|
|
|
|
func (CircuitRelay_Status) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_129c008e7addef67, []int{0, 0}
|
|
}
|
|
|
|
type CircuitRelay_Type int32
|
|
|
|
const (
|
|
CircuitRelay_HOP CircuitRelay_Type = 1
|
|
CircuitRelay_STOP CircuitRelay_Type = 2
|
|
CircuitRelay_STATUS CircuitRelay_Type = 3
|
|
CircuitRelay_CAN_HOP CircuitRelay_Type = 4
|
|
)
|
|
|
|
var CircuitRelay_Type_name = map[int32]string{
|
|
1: "HOP",
|
|
2: "STOP",
|
|
3: "STATUS",
|
|
4: "CAN_HOP",
|
|
}
|
|
|
|
var CircuitRelay_Type_value = map[string]int32{
|
|
"HOP": 1,
|
|
"STOP": 2,
|
|
"STATUS": 3,
|
|
"CAN_HOP": 4,
|
|
}
|
|
|
|
func (x CircuitRelay_Type) Enum() *CircuitRelay_Type {
|
|
p := new(CircuitRelay_Type)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x CircuitRelay_Type) String() string {
|
|
return proto.EnumName(CircuitRelay_Type_name, int32(x))
|
|
}
|
|
|
|
func (x *CircuitRelay_Type) UnmarshalJSON(data []byte) error {
|
|
value, err := proto.UnmarshalJSONEnum(CircuitRelay_Type_value, data, "CircuitRelay_Type")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
*x = CircuitRelay_Type(value)
|
|
return nil
|
|
}
|
|
|
|
func (CircuitRelay_Type) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_129c008e7addef67, []int{0, 1}
|
|
}
|
|
|
|
type CircuitRelay struct {
|
|
Type *CircuitRelay_Type `protobuf:"varint,1,opt,name=type,enum=circuitv1.pb.CircuitRelay_Type" json:"type,omitempty"`
|
|
SrcPeer *CircuitRelay_Peer `protobuf:"bytes,2,opt,name=srcPeer" json:"srcPeer,omitempty"`
|
|
DstPeer *CircuitRelay_Peer `protobuf:"bytes,3,opt,name=dstPeer" json:"dstPeer,omitempty"`
|
|
Code *CircuitRelay_Status `protobuf:"varint,4,opt,name=code,enum=circuitv1.pb.CircuitRelay_Status" json:"code,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *CircuitRelay) Reset() { *m = CircuitRelay{} }
|
|
func (m *CircuitRelay) String() string { return proto.CompactTextString(m) }
|
|
func (*CircuitRelay) ProtoMessage() {}
|
|
func (*CircuitRelay) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_129c008e7addef67, []int{0}
|
|
}
|
|
func (m *CircuitRelay) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *CircuitRelay) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_CircuitRelay.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *CircuitRelay) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_CircuitRelay.Merge(m, src)
|
|
}
|
|
func (m *CircuitRelay) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *CircuitRelay) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_CircuitRelay.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_CircuitRelay proto.InternalMessageInfo
|
|
|
|
func (m *CircuitRelay) GetType() CircuitRelay_Type {
|
|
if m != nil && m.Type != nil {
|
|
return *m.Type
|
|
}
|
|
return CircuitRelay_HOP
|
|
}
|
|
|
|
func (m *CircuitRelay) GetSrcPeer() *CircuitRelay_Peer {
|
|
if m != nil {
|
|
return m.SrcPeer
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *CircuitRelay) GetDstPeer() *CircuitRelay_Peer {
|
|
if m != nil {
|
|
return m.DstPeer
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *CircuitRelay) GetCode() CircuitRelay_Status {
|
|
if m != nil && m.Code != nil {
|
|
return *m.Code
|
|
}
|
|
return CircuitRelay_SUCCESS
|
|
}
|
|
|
|
type CircuitRelay_Peer struct {
|
|
Id []byte `protobuf:"bytes,1,req,name=id" json:"id,omitempty"`
|
|
Addrs [][]byte `protobuf:"bytes,2,rep,name=addrs" json:"addrs,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *CircuitRelay_Peer) Reset() { *m = CircuitRelay_Peer{} }
|
|
func (m *CircuitRelay_Peer) String() string { return proto.CompactTextString(m) }
|
|
func (*CircuitRelay_Peer) ProtoMessage() {}
|
|
func (*CircuitRelay_Peer) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_129c008e7addef67, []int{0, 0}
|
|
}
|
|
func (m *CircuitRelay_Peer) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *CircuitRelay_Peer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_CircuitRelay_Peer.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *CircuitRelay_Peer) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_CircuitRelay_Peer.Merge(m, src)
|
|
}
|
|
func (m *CircuitRelay_Peer) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *CircuitRelay_Peer) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_CircuitRelay_Peer.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_CircuitRelay_Peer proto.InternalMessageInfo
|
|
|
|
func (m *CircuitRelay_Peer) GetId() []byte {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *CircuitRelay_Peer) GetAddrs() [][]byte {
|
|
if m != nil {
|
|
return m.Addrs
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterEnum("circuitv1.pb.CircuitRelay_Status", CircuitRelay_Status_name, CircuitRelay_Status_value)
|
|
proto.RegisterEnum("circuitv1.pb.CircuitRelay_Type", CircuitRelay_Type_name, CircuitRelay_Type_value)
|
|
proto.RegisterType((*CircuitRelay)(nil), "circuitv1.pb.CircuitRelay")
|
|
proto.RegisterType((*CircuitRelay_Peer)(nil), "circuitv1.pb.CircuitRelay.Peer")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("circuitv1.proto", fileDescriptor_129c008e7addef67) }
|
|
|
|
var fileDescriptor_129c008e7addef67 = []byte{
|
|
// 475 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4d, 0x6f, 0xd3, 0x30,
|
|
0x18, 0x80, 0x65, 0x27, 0xb4, 0xe8, 0x5d, 0x35, 0x8c, 0x35, 0x46, 0x56, 0x44, 0x57, 0x7a, 0xea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 0x3b, 0x70, 0xc2, 0xea, 0x52, 0x92, 0x77, 0x87, 0x8a, 0x47, 0xe4, 0xcc, 0xb3, 0x3b,
|
|
0xe8, 0xb3, 0xb8, 0x2b, 0x64, 0x9f, 0x47, 0xa6, 0xcf, 0x95, 0x62, 0xc7, 0x9c, 0xbc, 0xf3, 0x5a,
|
|
0x47, 0xe0, 0xdb, 0xaf, 0x95, 0x56, 0xc1, 0x3b, 0x11, 0x03, 0x82, 0xe8, 0x75, 0xf0, 0xed, 0x09,
|
|
0x04, 0x53, 0x80, 0x8a, 0xd2, 0x4c, 0x0f, 0x15, 0xf1, 0xec, 0x0b, 0x0e, 0x59, 0x62, 0xac, 0xe2,
|
|
0x3f, 0xa9, 0x7d, 0x59, 0x36, 0xd0, 0xd7, 0x65, 0x03, 0xfd, 0x5a, 0x36, 0xd0, 0xdf, 0x00, 0x00,
|
|
0x00, 0xff, 0xff, 0x52, 0xcc, 0x98, 0x82, 0x47, 0x03, 0x00, 0x00,
|
|
}
|
|
|
|
func (m *CircuitRelay) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *CircuitRelay) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *CircuitRelay) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.XXX_unrecognized != nil {
|
|
i -= len(m.XXX_unrecognized)
|
|
copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
if m.Code != nil {
|
|
i = encodeVarintCircuitv1(dAtA, i, uint64(*m.Code))
|
|
i--
|
|
dAtA[i] = 0x20
|
|
}
|
|
if m.DstPeer != nil {
|
|
{
|
|
size, err := m.DstPeer.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintCircuitv1(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x1a
|
|
}
|
|
if m.SrcPeer != nil {
|
|
{
|
|
size, err := m.SrcPeer.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintCircuitv1(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
if m.Type != nil {
|
|
i = encodeVarintCircuitv1(dAtA, i, uint64(*m.Type))
|
|
i--
|
|
dAtA[i] = 0x8
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *CircuitRelay_Peer) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *CircuitRelay_Peer) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *CircuitRelay_Peer) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.XXX_unrecognized != nil {
|
|
i -= len(m.XXX_unrecognized)
|
|
copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
if len(m.Addrs) > 0 {
|
|
for iNdEx := len(m.Addrs) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.Addrs[iNdEx])
|
|
copy(dAtA[i:], m.Addrs[iNdEx])
|
|
i = encodeVarintCircuitv1(dAtA, i, uint64(len(m.Addrs[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
}
|
|
if m.Id == nil {
|
|
return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("id")
|
|
} else {
|
|
i -= len(m.Id)
|
|
copy(dAtA[i:], m.Id)
|
|
i = encodeVarintCircuitv1(dAtA, i, uint64(len(m.Id)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func encodeVarintCircuitv1(dAtA []byte, offset int, v uint64) int {
|
|
offset -= sovCircuitv1(v)
|
|
base := offset
|
|
for v >= 1<<7 {
|
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
v >>= 7
|
|
offset++
|
|
}
|
|
dAtA[offset] = uint8(v)
|
|
return base
|
|
}
|
|
func (m *CircuitRelay) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Type != nil {
|
|
n += 1 + sovCircuitv1(uint64(*m.Type))
|
|
}
|
|
if m.SrcPeer != nil {
|
|
l = m.SrcPeer.Size()
|
|
n += 1 + l + sovCircuitv1(uint64(l))
|
|
}
|
|
if m.DstPeer != nil {
|
|
l = m.DstPeer.Size()
|
|
n += 1 + l + sovCircuitv1(uint64(l))
|
|
}
|
|
if m.Code != nil {
|
|
n += 1 + sovCircuitv1(uint64(*m.Code))
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *CircuitRelay_Peer) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Id != nil {
|
|
l = len(m.Id)
|
|
n += 1 + l + sovCircuitv1(uint64(l))
|
|
}
|
|
if len(m.Addrs) > 0 {
|
|
for _, b := range m.Addrs {
|
|
l = len(b)
|
|
n += 1 + l + sovCircuitv1(uint64(l))
|
|
}
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovCircuitv1(x uint64) (n int) {
|
|
return (math_bits.Len64(x|1) + 6) / 7
|
|
}
|
|
func sozCircuitv1(x uint64) (n int) {
|
|
return sovCircuitv1(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
func (m *CircuitRelay) 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 ErrIntOverflowCircuitv1
|
|
}
|
|
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: CircuitRelay: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: CircuitRelay: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
|
|
}
|
|
var v CircuitRelay_Type
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowCircuitv1
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
v |= CircuitRelay_Type(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
m.Type = &v
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field SrcPeer", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowCircuitv1
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthCircuitv1
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthCircuitv1
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.SrcPeer == nil {
|
|
m.SrcPeer = &CircuitRelay_Peer{}
|
|
}
|
|
if err := m.SrcPeer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field DstPeer", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowCircuitv1
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthCircuitv1
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthCircuitv1
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.DstPeer == nil {
|
|
m.DstPeer = &CircuitRelay_Peer{}
|
|
}
|
|
if err := m.DstPeer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 4:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType)
|
|
}
|
|
var v CircuitRelay_Status
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowCircuitv1
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
v |= CircuitRelay_Status(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
m.Code = &v
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipCircuitv1(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthCircuitv1
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthCircuitv1
|
|
}
|
|
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 *CircuitRelay_Peer) Unmarshal(dAtA []byte) error {
|
|
var hasFields [1]uint64
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowCircuitv1
|
|
}
|
|
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 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowCircuitv1
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return ErrInvalidLengthCircuitv1
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthCircuitv1
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Id = append(m.Id[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.Id == nil {
|
|
m.Id = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
hasFields[0] |= uint64(0x00000001)
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Addrs", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowCircuitv1
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return ErrInvalidLengthCircuitv1
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthCircuitv1
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Addrs = append(m.Addrs, make([]byte, postIndex-iNdEx))
|
|
copy(m.Addrs[len(m.Addrs)-1], dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipCircuitv1(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthCircuitv1
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthCircuitv1
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
if hasFields[0]&uint64(0x00000001) == 0 {
|
|
return github_com_gogo_protobuf_proto.NewRequiredNotSetError("id")
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func skipCircuitv1(dAtA []byte) (n int, err error) {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
depth := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowCircuitv1
|
|
}
|
|
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, ErrIntOverflowCircuitv1
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx++
|
|
if dAtA[iNdEx-1] < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 1:
|
|
iNdEx += 8
|
|
case 2:
|
|
var length int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowCircuitv1
|
|
}
|
|
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, ErrInvalidLengthCircuitv1
|
|
}
|
|
iNdEx += length
|
|
case 3:
|
|
depth++
|
|
case 4:
|
|
if depth == 0 {
|
|
return 0, ErrUnexpectedEndOfGroupCircuitv1
|
|
}
|
|
depth--
|
|
case 5:
|
|
iNdEx += 4
|
|
default:
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
}
|
|
if iNdEx < 0 {
|
|
return 0, ErrInvalidLengthCircuitv1
|
|
}
|
|
if depth == 0 {
|
|
return iNdEx, nil
|
|
}
|
|
}
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
|
|
var (
|
|
ErrInvalidLengthCircuitv1 = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
ErrIntOverflowCircuitv1 = fmt.Errorf("proto: integer overflow")
|
|
ErrUnexpectedEndOfGroupCircuitv1 = fmt.Errorf("proto: unexpected end of group")
|
|
)
|