github.com/ethersphere/bee/v2@v2.2.0/pkg/p2p/libp2p/internal/handshake/pb/handshake.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: handshake.proto
     3  
     4  package pb
     5  
     6  import (
     7  	fmt "fmt"
     8  	proto "github.com/gogo/protobuf/proto"
     9  	io "io"
    10  	math "math"
    11  	math_bits "math/bits"
    12  )
    13  
    14  // Reference imports to suppress errors if they are not otherwise used.
    15  var _ = proto.Marshal
    16  var _ = fmt.Errorf
    17  var _ = math.Inf
    18  
    19  // This is a compile-time assertion to ensure that this generated file
    20  // is compatible with the proto package it is being compiled against.
    21  // A compilation error at this line likely means your copy of the
    22  // proto package needs to be updated.
    23  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    24  
    25  type Syn struct {
    26  	ObservedUnderlay []byte `protobuf:"bytes,1,opt,name=ObservedUnderlay,proto3" json:"ObservedUnderlay,omitempty"`
    27  }
    28  
    29  func (m *Syn) Reset()         { *m = Syn{} }
    30  func (m *Syn) String() string { return proto.CompactTextString(m) }
    31  func (*Syn) ProtoMessage()    {}
    32  func (*Syn) Descriptor() ([]byte, []int) {
    33  	return fileDescriptor_a77305914d5d202f, []int{0}
    34  }
    35  func (m *Syn) XXX_Unmarshal(b []byte) error {
    36  	return m.Unmarshal(b)
    37  }
    38  func (m *Syn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    39  	if deterministic {
    40  		return xxx_messageInfo_Syn.Marshal(b, m, deterministic)
    41  	} else {
    42  		b = b[:cap(b)]
    43  		n, err := m.MarshalToSizedBuffer(b)
    44  		if err != nil {
    45  			return nil, err
    46  		}
    47  		return b[:n], nil
    48  	}
    49  }
    50  func (m *Syn) XXX_Merge(src proto.Message) {
    51  	xxx_messageInfo_Syn.Merge(m, src)
    52  }
    53  func (m *Syn) XXX_Size() int {
    54  	return m.Size()
    55  }
    56  func (m *Syn) XXX_DiscardUnknown() {
    57  	xxx_messageInfo_Syn.DiscardUnknown(m)
    58  }
    59  
    60  var xxx_messageInfo_Syn proto.InternalMessageInfo
    61  
    62  func (m *Syn) GetObservedUnderlay() []byte {
    63  	if m != nil {
    64  		return m.ObservedUnderlay
    65  	}
    66  	return nil
    67  }
    68  
    69  type Ack struct {
    70  	Address        *BzzAddress `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"`
    71  	NetworkID      uint64      `protobuf:"varint,2,opt,name=NetworkID,proto3" json:"NetworkID,omitempty"`
    72  	FullNode       bool        `protobuf:"varint,3,opt,name=FullNode,proto3" json:"FullNode,omitempty"`
    73  	Nonce          []byte      `protobuf:"bytes,4,opt,name=Nonce,proto3" json:"Nonce,omitempty"`
    74  	WelcomeMessage string      `protobuf:"bytes,99,opt,name=WelcomeMessage,proto3" json:"WelcomeMessage,omitempty"`
    75  }
    76  
    77  func (m *Ack) Reset()         { *m = Ack{} }
    78  func (m *Ack) String() string { return proto.CompactTextString(m) }
    79  func (*Ack) ProtoMessage()    {}
    80  func (*Ack) Descriptor() ([]byte, []int) {
    81  	return fileDescriptor_a77305914d5d202f, []int{1}
    82  }
    83  func (m *Ack) XXX_Unmarshal(b []byte) error {
    84  	return m.Unmarshal(b)
    85  }
    86  func (m *Ack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    87  	if deterministic {
    88  		return xxx_messageInfo_Ack.Marshal(b, m, deterministic)
    89  	} else {
    90  		b = b[:cap(b)]
    91  		n, err := m.MarshalToSizedBuffer(b)
    92  		if err != nil {
    93  			return nil, err
    94  		}
    95  		return b[:n], nil
    96  	}
    97  }
    98  func (m *Ack) XXX_Merge(src proto.Message) {
    99  	xxx_messageInfo_Ack.Merge(m, src)
   100  }
   101  func (m *Ack) XXX_Size() int {
   102  	return m.Size()
   103  }
   104  func (m *Ack) XXX_DiscardUnknown() {
   105  	xxx_messageInfo_Ack.DiscardUnknown(m)
   106  }
   107  
   108  var xxx_messageInfo_Ack proto.InternalMessageInfo
   109  
   110  func (m *Ack) GetAddress() *BzzAddress {
   111  	if m != nil {
   112  		return m.Address
   113  	}
   114  	return nil
   115  }
   116  
   117  func (m *Ack) GetNetworkID() uint64 {
   118  	if m != nil {
   119  		return m.NetworkID
   120  	}
   121  	return 0
   122  }
   123  
   124  func (m *Ack) GetFullNode() bool {
   125  	if m != nil {
   126  		return m.FullNode
   127  	}
   128  	return false
   129  }
   130  
   131  func (m *Ack) GetNonce() []byte {
   132  	if m != nil {
   133  		return m.Nonce
   134  	}
   135  	return nil
   136  }
   137  
   138  func (m *Ack) GetWelcomeMessage() string {
   139  	if m != nil {
   140  		return m.WelcomeMessage
   141  	}
   142  	return ""
   143  }
   144  
   145  type SynAck struct {
   146  	Syn *Syn `protobuf:"bytes,1,opt,name=Syn,proto3" json:"Syn,omitempty"`
   147  	Ack *Ack `protobuf:"bytes,2,opt,name=Ack,proto3" json:"Ack,omitempty"`
   148  }
   149  
   150  func (m *SynAck) Reset()         { *m = SynAck{} }
   151  func (m *SynAck) String() string { return proto.CompactTextString(m) }
   152  func (*SynAck) ProtoMessage()    {}
   153  func (*SynAck) Descriptor() ([]byte, []int) {
   154  	return fileDescriptor_a77305914d5d202f, []int{2}
   155  }
   156  func (m *SynAck) XXX_Unmarshal(b []byte) error {
   157  	return m.Unmarshal(b)
   158  }
   159  func (m *SynAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   160  	if deterministic {
   161  		return xxx_messageInfo_SynAck.Marshal(b, m, deterministic)
   162  	} else {
   163  		b = b[:cap(b)]
   164  		n, err := m.MarshalToSizedBuffer(b)
   165  		if err != nil {
   166  			return nil, err
   167  		}
   168  		return b[:n], nil
   169  	}
   170  }
   171  func (m *SynAck) XXX_Merge(src proto.Message) {
   172  	xxx_messageInfo_SynAck.Merge(m, src)
   173  }
   174  func (m *SynAck) XXX_Size() int {
   175  	return m.Size()
   176  }
   177  func (m *SynAck) XXX_DiscardUnknown() {
   178  	xxx_messageInfo_SynAck.DiscardUnknown(m)
   179  }
   180  
   181  var xxx_messageInfo_SynAck proto.InternalMessageInfo
   182  
   183  func (m *SynAck) GetSyn() *Syn {
   184  	if m != nil {
   185  		return m.Syn
   186  	}
   187  	return nil
   188  }
   189  
   190  func (m *SynAck) GetAck() *Ack {
   191  	if m != nil {
   192  		return m.Ack
   193  	}
   194  	return nil
   195  }
   196  
   197  type BzzAddress struct {
   198  	Underlay  []byte `protobuf:"bytes,1,opt,name=Underlay,proto3" json:"Underlay,omitempty"`
   199  	Signature []byte `protobuf:"bytes,2,opt,name=Signature,proto3" json:"Signature,omitempty"`
   200  	Overlay   []byte `protobuf:"bytes,3,opt,name=Overlay,proto3" json:"Overlay,omitempty"`
   201  }
   202  
   203  func (m *BzzAddress) Reset()         { *m = BzzAddress{} }
   204  func (m *BzzAddress) String() string { return proto.CompactTextString(m) }
   205  func (*BzzAddress) ProtoMessage()    {}
   206  func (*BzzAddress) Descriptor() ([]byte, []int) {
   207  	return fileDescriptor_a77305914d5d202f, []int{3}
   208  }
   209  func (m *BzzAddress) XXX_Unmarshal(b []byte) error {
   210  	return m.Unmarshal(b)
   211  }
   212  func (m *BzzAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   213  	if deterministic {
   214  		return xxx_messageInfo_BzzAddress.Marshal(b, m, deterministic)
   215  	} else {
   216  		b = b[:cap(b)]
   217  		n, err := m.MarshalToSizedBuffer(b)
   218  		if err != nil {
   219  			return nil, err
   220  		}
   221  		return b[:n], nil
   222  	}
   223  }
   224  func (m *BzzAddress) XXX_Merge(src proto.Message) {
   225  	xxx_messageInfo_BzzAddress.Merge(m, src)
   226  }
   227  func (m *BzzAddress) XXX_Size() int {
   228  	return m.Size()
   229  }
   230  func (m *BzzAddress) XXX_DiscardUnknown() {
   231  	xxx_messageInfo_BzzAddress.DiscardUnknown(m)
   232  }
   233  
   234  var xxx_messageInfo_BzzAddress proto.InternalMessageInfo
   235  
   236  func (m *BzzAddress) GetUnderlay() []byte {
   237  	if m != nil {
   238  		return m.Underlay
   239  	}
   240  	return nil
   241  }
   242  
   243  func (m *BzzAddress) GetSignature() []byte {
   244  	if m != nil {
   245  		return m.Signature
   246  	}
   247  	return nil
   248  }
   249  
   250  func (m *BzzAddress) GetOverlay() []byte {
   251  	if m != nil {
   252  		return m.Overlay
   253  	}
   254  	return nil
   255  }
   256  
   257  func init() {
   258  	proto.RegisterType((*Syn)(nil), "handshake.Syn")
   259  	proto.RegisterType((*Ack)(nil), "handshake.Ack")
   260  	proto.RegisterType((*SynAck)(nil), "handshake.SynAck")
   261  	proto.RegisterType((*BzzAddress)(nil), "handshake.BzzAddress")
   262  }
   263  
   264  func init() { proto.RegisterFile("handshake.proto", fileDescriptor_a77305914d5d202f) }
   265  
   266  var fileDescriptor_a77305914d5d202f = []byte{
   267  	// 318 bytes of a gzipped FileDescriptorProto
   268  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xcd, 0x4a, 0xc3, 0x40,
   269  	0x14, 0x85, 0x3b, 0x4d, 0xed, 0xcf, 0xb5, 0x54, 0x19, 0x14, 0x82, 0x94, 0x10, 0xb2, 0x90, 0xe0,
   270  	0xa2, 0xa2, 0x3e, 0x41, 0x8b, 0x08, 0x82, 0xb6, 0x30, 0x41, 0x04, 0x57, 0xa6, 0x99, 0x4b, 0x2b,
   271  	0x89, 0x33, 0x65, 0xa6, 0xad, 0xa4, 0x4f, 0xe1, 0x93, 0xf8, 0x1c, 0x2e, 0xbb, 0x74, 0x29, 0xed,
   272  	0x8b, 0x48, 0xa6, 0x3f, 0xd1, 0xba, 0x3c, 0xe7, 0x9e, 0x99, 0xf9, 0xce, 0x1d, 0x38, 0x18, 0x86,
   273  	0x82, 0xeb, 0x61, 0x18, 0x63, 0x6b, 0xa4, 0xe4, 0x58, 0xd2, 0xda, 0xd6, 0xf0, 0x2e, 0xc0, 0x0a,
   274  	0x52, 0x41, 0xcf, 0xe0, 0xb0, 0xd7, 0xd7, 0xa8, 0xa6, 0xc8, 0x1f, 0x04, 0x47, 0x95, 0x84, 0xa9,
   275  	0x4d, 0x5c, 0xe2, 0xd7, 0xd9, 0x3f, 0xdf, 0xfb, 0x20, 0x60, 0xb5, 0xa3, 0x98, 0x9e, 0x43, 0xa5,
   276  	0xcd, 0xb9, 0x42, 0xad, 0x4d, 0x74, 0xff, 0xf2, 0xb8, 0x95, 0x3f, 0xd4, 0x99, 0xcd, 0xd6, 0x43,
   277  	0xb6, 0x49, 0xd1, 0x26, 0xd4, 0xba, 0x38, 0x7e, 0x93, 0x2a, 0xbe, 0xbd, 0xb6, 0x8b, 0x2e, 0xf1,
   278  	0x4b, 0x2c, 0x37, 0xe8, 0x09, 0x54, 0x6f, 0x26, 0x49, 0xd2, 0x95, 0x1c, 0x6d, 0xcb, 0x25, 0x7e,
   279  	0x95, 0x6d, 0x35, 0x3d, 0x82, 0xbd, 0xae, 0x14, 0x11, 0xda, 0x25, 0xc3, 0xb4, 0x12, 0xf4, 0x14,
   280  	0x1a, 0x8f, 0x98, 0x44, 0xf2, 0x15, 0xef, 0x51, 0xeb, 0x70, 0x80, 0x76, 0xe4, 0x12, 0xbf, 0xc6,
   281  	0x76, 0x5c, 0xef, 0x0e, 0xca, 0x41, 0x2a, 0x32, 0x64, 0xd7, 0xb4, 0x5d, 0xe3, 0x36, 0x7e, 0xe1,
   282  	0x06, 0xa9, 0x60, 0x66, 0x11, 0xae, 0xe9, 0x66, 0xe8, 0xfe, 0x26, 0xda, 0x51, 0xcc, 0xb2, 0x91,
   283  	0xf7, 0x0c, 0x90, 0x97, 0xcb, 0xa8, 0x77, 0x16, 0xb6, 0xd5, 0x59, 0xdf, 0xe0, 0x65, 0x20, 0xc2,
   284  	0xf1, 0x44, 0xa1, 0xb9, 0xb1, 0xce, 0x72, 0x83, 0xda, 0x50, 0xe9, 0x4d, 0x57, 0x07, 0x2d, 0x33,
   285  	0xdb, 0xc8, 0x4e, 0xf3, 0x73, 0xe1, 0x90, 0xf9, 0xc2, 0x21, 0xdf, 0x0b, 0x87, 0xbc, 0x2f, 0x9d,
   286  	0xc2, 0x7c, 0xe9, 0x14, 0xbe, 0x96, 0x4e, 0xe1, 0xa9, 0x38, 0xea, 0xf7, 0xcb, 0xe6, 0x0f, 0xaf,
   287  	0x7e, 0x02, 0x00, 0x00, 0xff, 0xff, 0x87, 0xa7, 0x49, 0x00, 0xd6, 0x01, 0x00, 0x00,
   288  }
   289  
   290  func (m *Syn) Marshal() (dAtA []byte, err error) {
   291  	size := m.Size()
   292  	dAtA = make([]byte, size)
   293  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   294  	if err != nil {
   295  		return nil, err
   296  	}
   297  	return dAtA[:n], nil
   298  }
   299  
   300  func (m *Syn) MarshalTo(dAtA []byte) (int, error) {
   301  	size := m.Size()
   302  	return m.MarshalToSizedBuffer(dAtA[:size])
   303  }
   304  
   305  func (m *Syn) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   306  	i := len(dAtA)
   307  	_ = i
   308  	var l int
   309  	_ = l
   310  	if len(m.ObservedUnderlay) > 0 {
   311  		i -= len(m.ObservedUnderlay)
   312  		copy(dAtA[i:], m.ObservedUnderlay)
   313  		i = encodeVarintHandshake(dAtA, i, uint64(len(m.ObservedUnderlay)))
   314  		i--
   315  		dAtA[i] = 0xa
   316  	}
   317  	return len(dAtA) - i, nil
   318  }
   319  
   320  func (m *Ack) Marshal() (dAtA []byte, err error) {
   321  	size := m.Size()
   322  	dAtA = make([]byte, size)
   323  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   324  	if err != nil {
   325  		return nil, err
   326  	}
   327  	return dAtA[:n], nil
   328  }
   329  
   330  func (m *Ack) MarshalTo(dAtA []byte) (int, error) {
   331  	size := m.Size()
   332  	return m.MarshalToSizedBuffer(dAtA[:size])
   333  }
   334  
   335  func (m *Ack) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   336  	i := len(dAtA)
   337  	_ = i
   338  	var l int
   339  	_ = l
   340  	if len(m.WelcomeMessage) > 0 {
   341  		i -= len(m.WelcomeMessage)
   342  		copy(dAtA[i:], m.WelcomeMessage)
   343  		i = encodeVarintHandshake(dAtA, i, uint64(len(m.WelcomeMessage)))
   344  		i--
   345  		dAtA[i] = 0x6
   346  		i--
   347  		dAtA[i] = 0x9a
   348  	}
   349  	if len(m.Nonce) > 0 {
   350  		i -= len(m.Nonce)
   351  		copy(dAtA[i:], m.Nonce)
   352  		i = encodeVarintHandshake(dAtA, i, uint64(len(m.Nonce)))
   353  		i--
   354  		dAtA[i] = 0x22
   355  	}
   356  	if m.FullNode {
   357  		i--
   358  		if m.FullNode {
   359  			dAtA[i] = 1
   360  		} else {
   361  			dAtA[i] = 0
   362  		}
   363  		i--
   364  		dAtA[i] = 0x18
   365  	}
   366  	if m.NetworkID != 0 {
   367  		i = encodeVarintHandshake(dAtA, i, uint64(m.NetworkID))
   368  		i--
   369  		dAtA[i] = 0x10
   370  	}
   371  	if m.Address != nil {
   372  		{
   373  			size, err := m.Address.MarshalToSizedBuffer(dAtA[:i])
   374  			if err != nil {
   375  				return 0, err
   376  			}
   377  			i -= size
   378  			i = encodeVarintHandshake(dAtA, i, uint64(size))
   379  		}
   380  		i--
   381  		dAtA[i] = 0xa
   382  	}
   383  	return len(dAtA) - i, nil
   384  }
   385  
   386  func (m *SynAck) Marshal() (dAtA []byte, err error) {
   387  	size := m.Size()
   388  	dAtA = make([]byte, size)
   389  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   390  	if err != nil {
   391  		return nil, err
   392  	}
   393  	return dAtA[:n], nil
   394  }
   395  
   396  func (m *SynAck) MarshalTo(dAtA []byte) (int, error) {
   397  	size := m.Size()
   398  	return m.MarshalToSizedBuffer(dAtA[:size])
   399  }
   400  
   401  func (m *SynAck) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   402  	i := len(dAtA)
   403  	_ = i
   404  	var l int
   405  	_ = l
   406  	if m.Ack != nil {
   407  		{
   408  			size, err := m.Ack.MarshalToSizedBuffer(dAtA[:i])
   409  			if err != nil {
   410  				return 0, err
   411  			}
   412  			i -= size
   413  			i = encodeVarintHandshake(dAtA, i, uint64(size))
   414  		}
   415  		i--
   416  		dAtA[i] = 0x12
   417  	}
   418  	if m.Syn != nil {
   419  		{
   420  			size, err := m.Syn.MarshalToSizedBuffer(dAtA[:i])
   421  			if err != nil {
   422  				return 0, err
   423  			}
   424  			i -= size
   425  			i = encodeVarintHandshake(dAtA, i, uint64(size))
   426  		}
   427  		i--
   428  		dAtA[i] = 0xa
   429  	}
   430  	return len(dAtA) - i, nil
   431  }
   432  
   433  func (m *BzzAddress) Marshal() (dAtA []byte, err error) {
   434  	size := m.Size()
   435  	dAtA = make([]byte, size)
   436  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   437  	if err != nil {
   438  		return nil, err
   439  	}
   440  	return dAtA[:n], nil
   441  }
   442  
   443  func (m *BzzAddress) MarshalTo(dAtA []byte) (int, error) {
   444  	size := m.Size()
   445  	return m.MarshalToSizedBuffer(dAtA[:size])
   446  }
   447  
   448  func (m *BzzAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   449  	i := len(dAtA)
   450  	_ = i
   451  	var l int
   452  	_ = l
   453  	if len(m.Overlay) > 0 {
   454  		i -= len(m.Overlay)
   455  		copy(dAtA[i:], m.Overlay)
   456  		i = encodeVarintHandshake(dAtA, i, uint64(len(m.Overlay)))
   457  		i--
   458  		dAtA[i] = 0x1a
   459  	}
   460  	if len(m.Signature) > 0 {
   461  		i -= len(m.Signature)
   462  		copy(dAtA[i:], m.Signature)
   463  		i = encodeVarintHandshake(dAtA, i, uint64(len(m.Signature)))
   464  		i--
   465  		dAtA[i] = 0x12
   466  	}
   467  	if len(m.Underlay) > 0 {
   468  		i -= len(m.Underlay)
   469  		copy(dAtA[i:], m.Underlay)
   470  		i = encodeVarintHandshake(dAtA, i, uint64(len(m.Underlay)))
   471  		i--
   472  		dAtA[i] = 0xa
   473  	}
   474  	return len(dAtA) - i, nil
   475  }
   476  
   477  func encodeVarintHandshake(dAtA []byte, offset int, v uint64) int {
   478  	offset -= sovHandshake(v)
   479  	base := offset
   480  	for v >= 1<<7 {
   481  		dAtA[offset] = uint8(v&0x7f | 0x80)
   482  		v >>= 7
   483  		offset++
   484  	}
   485  	dAtA[offset] = uint8(v)
   486  	return base
   487  }
   488  func (m *Syn) Size() (n int) {
   489  	if m == nil {
   490  		return 0
   491  	}
   492  	var l int
   493  	_ = l
   494  	l = len(m.ObservedUnderlay)
   495  	if l > 0 {
   496  		n += 1 + l + sovHandshake(uint64(l))
   497  	}
   498  	return n
   499  }
   500  
   501  func (m *Ack) Size() (n int) {
   502  	if m == nil {
   503  		return 0
   504  	}
   505  	var l int
   506  	_ = l
   507  	if m.Address != nil {
   508  		l = m.Address.Size()
   509  		n += 1 + l + sovHandshake(uint64(l))
   510  	}
   511  	if m.NetworkID != 0 {
   512  		n += 1 + sovHandshake(uint64(m.NetworkID))
   513  	}
   514  	if m.FullNode {
   515  		n += 2
   516  	}
   517  	l = len(m.Nonce)
   518  	if l > 0 {
   519  		n += 1 + l + sovHandshake(uint64(l))
   520  	}
   521  	l = len(m.WelcomeMessage)
   522  	if l > 0 {
   523  		n += 2 + l + sovHandshake(uint64(l))
   524  	}
   525  	return n
   526  }
   527  
   528  func (m *SynAck) Size() (n int) {
   529  	if m == nil {
   530  		return 0
   531  	}
   532  	var l int
   533  	_ = l
   534  	if m.Syn != nil {
   535  		l = m.Syn.Size()
   536  		n += 1 + l + sovHandshake(uint64(l))
   537  	}
   538  	if m.Ack != nil {
   539  		l = m.Ack.Size()
   540  		n += 1 + l + sovHandshake(uint64(l))
   541  	}
   542  	return n
   543  }
   544  
   545  func (m *BzzAddress) Size() (n int) {
   546  	if m == nil {
   547  		return 0
   548  	}
   549  	var l int
   550  	_ = l
   551  	l = len(m.Underlay)
   552  	if l > 0 {
   553  		n += 1 + l + sovHandshake(uint64(l))
   554  	}
   555  	l = len(m.Signature)
   556  	if l > 0 {
   557  		n += 1 + l + sovHandshake(uint64(l))
   558  	}
   559  	l = len(m.Overlay)
   560  	if l > 0 {
   561  		n += 1 + l + sovHandshake(uint64(l))
   562  	}
   563  	return n
   564  }
   565  
   566  func sovHandshake(x uint64) (n int) {
   567  	return (math_bits.Len64(x|1) + 6) / 7
   568  }
   569  func sozHandshake(x uint64) (n int) {
   570  	return sovHandshake(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   571  }
   572  func (m *Syn) Unmarshal(dAtA []byte) error {
   573  	l := len(dAtA)
   574  	iNdEx := 0
   575  	for iNdEx < l {
   576  		preIndex := iNdEx
   577  		var wire uint64
   578  		for shift := uint(0); ; shift += 7 {
   579  			if shift >= 64 {
   580  				return ErrIntOverflowHandshake
   581  			}
   582  			if iNdEx >= l {
   583  				return io.ErrUnexpectedEOF
   584  			}
   585  			b := dAtA[iNdEx]
   586  			iNdEx++
   587  			wire |= uint64(b&0x7F) << shift
   588  			if b < 0x80 {
   589  				break
   590  			}
   591  		}
   592  		fieldNum := int32(wire >> 3)
   593  		wireType := int(wire & 0x7)
   594  		if wireType == 4 {
   595  			return fmt.Errorf("proto: Syn: wiretype end group for non-group")
   596  		}
   597  		if fieldNum <= 0 {
   598  			return fmt.Errorf("proto: Syn: illegal tag %d (wire type %d)", fieldNum, wire)
   599  		}
   600  		switch fieldNum {
   601  		case 1:
   602  			if wireType != 2 {
   603  				return fmt.Errorf("proto: wrong wireType = %d for field ObservedUnderlay", wireType)
   604  			}
   605  			var byteLen int
   606  			for shift := uint(0); ; shift += 7 {
   607  				if shift >= 64 {
   608  					return ErrIntOverflowHandshake
   609  				}
   610  				if iNdEx >= l {
   611  					return io.ErrUnexpectedEOF
   612  				}
   613  				b := dAtA[iNdEx]
   614  				iNdEx++
   615  				byteLen |= int(b&0x7F) << shift
   616  				if b < 0x80 {
   617  					break
   618  				}
   619  			}
   620  			if byteLen < 0 {
   621  				return ErrInvalidLengthHandshake
   622  			}
   623  			postIndex := iNdEx + byteLen
   624  			if postIndex < 0 {
   625  				return ErrInvalidLengthHandshake
   626  			}
   627  			if postIndex > l {
   628  				return io.ErrUnexpectedEOF
   629  			}
   630  			m.ObservedUnderlay = append(m.ObservedUnderlay[:0], dAtA[iNdEx:postIndex]...)
   631  			if m.ObservedUnderlay == nil {
   632  				m.ObservedUnderlay = []byte{}
   633  			}
   634  			iNdEx = postIndex
   635  		default:
   636  			iNdEx = preIndex
   637  			skippy, err := skipHandshake(dAtA[iNdEx:])
   638  			if err != nil {
   639  				return err
   640  			}
   641  			if skippy < 0 {
   642  				return ErrInvalidLengthHandshake
   643  			}
   644  			if (iNdEx + skippy) < 0 {
   645  				return ErrInvalidLengthHandshake
   646  			}
   647  			if (iNdEx + skippy) > l {
   648  				return io.ErrUnexpectedEOF
   649  			}
   650  			iNdEx += skippy
   651  		}
   652  	}
   653  
   654  	if iNdEx > l {
   655  		return io.ErrUnexpectedEOF
   656  	}
   657  	return nil
   658  }
   659  func (m *Ack) Unmarshal(dAtA []byte) error {
   660  	l := len(dAtA)
   661  	iNdEx := 0
   662  	for iNdEx < l {
   663  		preIndex := iNdEx
   664  		var wire uint64
   665  		for shift := uint(0); ; shift += 7 {
   666  			if shift >= 64 {
   667  				return ErrIntOverflowHandshake
   668  			}
   669  			if iNdEx >= l {
   670  				return io.ErrUnexpectedEOF
   671  			}
   672  			b := dAtA[iNdEx]
   673  			iNdEx++
   674  			wire |= uint64(b&0x7F) << shift
   675  			if b < 0x80 {
   676  				break
   677  			}
   678  		}
   679  		fieldNum := int32(wire >> 3)
   680  		wireType := int(wire & 0x7)
   681  		if wireType == 4 {
   682  			return fmt.Errorf("proto: Ack: wiretype end group for non-group")
   683  		}
   684  		if fieldNum <= 0 {
   685  			return fmt.Errorf("proto: Ack: illegal tag %d (wire type %d)", fieldNum, wire)
   686  		}
   687  		switch fieldNum {
   688  		case 1:
   689  			if wireType != 2 {
   690  				return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
   691  			}
   692  			var msglen int
   693  			for shift := uint(0); ; shift += 7 {
   694  				if shift >= 64 {
   695  					return ErrIntOverflowHandshake
   696  				}
   697  				if iNdEx >= l {
   698  					return io.ErrUnexpectedEOF
   699  				}
   700  				b := dAtA[iNdEx]
   701  				iNdEx++
   702  				msglen |= int(b&0x7F) << shift
   703  				if b < 0x80 {
   704  					break
   705  				}
   706  			}
   707  			if msglen < 0 {
   708  				return ErrInvalidLengthHandshake
   709  			}
   710  			postIndex := iNdEx + msglen
   711  			if postIndex < 0 {
   712  				return ErrInvalidLengthHandshake
   713  			}
   714  			if postIndex > l {
   715  				return io.ErrUnexpectedEOF
   716  			}
   717  			if m.Address == nil {
   718  				m.Address = &BzzAddress{}
   719  			}
   720  			if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   721  				return err
   722  			}
   723  			iNdEx = postIndex
   724  		case 2:
   725  			if wireType != 0 {
   726  				return fmt.Errorf("proto: wrong wireType = %d for field NetworkID", wireType)
   727  			}
   728  			m.NetworkID = 0
   729  			for shift := uint(0); ; shift += 7 {
   730  				if shift >= 64 {
   731  					return ErrIntOverflowHandshake
   732  				}
   733  				if iNdEx >= l {
   734  					return io.ErrUnexpectedEOF
   735  				}
   736  				b := dAtA[iNdEx]
   737  				iNdEx++
   738  				m.NetworkID |= uint64(b&0x7F) << shift
   739  				if b < 0x80 {
   740  					break
   741  				}
   742  			}
   743  		case 3:
   744  			if wireType != 0 {
   745  				return fmt.Errorf("proto: wrong wireType = %d for field FullNode", wireType)
   746  			}
   747  			var v int
   748  			for shift := uint(0); ; shift += 7 {
   749  				if shift >= 64 {
   750  					return ErrIntOverflowHandshake
   751  				}
   752  				if iNdEx >= l {
   753  					return io.ErrUnexpectedEOF
   754  				}
   755  				b := dAtA[iNdEx]
   756  				iNdEx++
   757  				v |= int(b&0x7F) << shift
   758  				if b < 0x80 {
   759  					break
   760  				}
   761  			}
   762  			m.FullNode = bool(v != 0)
   763  		case 4:
   764  			if wireType != 2 {
   765  				return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType)
   766  			}
   767  			var byteLen int
   768  			for shift := uint(0); ; shift += 7 {
   769  				if shift >= 64 {
   770  					return ErrIntOverflowHandshake
   771  				}
   772  				if iNdEx >= l {
   773  					return io.ErrUnexpectedEOF
   774  				}
   775  				b := dAtA[iNdEx]
   776  				iNdEx++
   777  				byteLen |= int(b&0x7F) << shift
   778  				if b < 0x80 {
   779  					break
   780  				}
   781  			}
   782  			if byteLen < 0 {
   783  				return ErrInvalidLengthHandshake
   784  			}
   785  			postIndex := iNdEx + byteLen
   786  			if postIndex < 0 {
   787  				return ErrInvalidLengthHandshake
   788  			}
   789  			if postIndex > l {
   790  				return io.ErrUnexpectedEOF
   791  			}
   792  			m.Nonce = append(m.Nonce[:0], dAtA[iNdEx:postIndex]...)
   793  			if m.Nonce == nil {
   794  				m.Nonce = []byte{}
   795  			}
   796  			iNdEx = postIndex
   797  		case 99:
   798  			if wireType != 2 {
   799  				return fmt.Errorf("proto: wrong wireType = %d for field WelcomeMessage", wireType)
   800  			}
   801  			var stringLen uint64
   802  			for shift := uint(0); ; shift += 7 {
   803  				if shift >= 64 {
   804  					return ErrIntOverflowHandshake
   805  				}
   806  				if iNdEx >= l {
   807  					return io.ErrUnexpectedEOF
   808  				}
   809  				b := dAtA[iNdEx]
   810  				iNdEx++
   811  				stringLen |= uint64(b&0x7F) << shift
   812  				if b < 0x80 {
   813  					break
   814  				}
   815  			}
   816  			intStringLen := int(stringLen)
   817  			if intStringLen < 0 {
   818  				return ErrInvalidLengthHandshake
   819  			}
   820  			postIndex := iNdEx + intStringLen
   821  			if postIndex < 0 {
   822  				return ErrInvalidLengthHandshake
   823  			}
   824  			if postIndex > l {
   825  				return io.ErrUnexpectedEOF
   826  			}
   827  			m.WelcomeMessage = string(dAtA[iNdEx:postIndex])
   828  			iNdEx = postIndex
   829  		default:
   830  			iNdEx = preIndex
   831  			skippy, err := skipHandshake(dAtA[iNdEx:])
   832  			if err != nil {
   833  				return err
   834  			}
   835  			if skippy < 0 {
   836  				return ErrInvalidLengthHandshake
   837  			}
   838  			if (iNdEx + skippy) < 0 {
   839  				return ErrInvalidLengthHandshake
   840  			}
   841  			if (iNdEx + skippy) > l {
   842  				return io.ErrUnexpectedEOF
   843  			}
   844  			iNdEx += skippy
   845  		}
   846  	}
   847  
   848  	if iNdEx > l {
   849  		return io.ErrUnexpectedEOF
   850  	}
   851  	return nil
   852  }
   853  func (m *SynAck) Unmarshal(dAtA []byte) error {
   854  	l := len(dAtA)
   855  	iNdEx := 0
   856  	for iNdEx < l {
   857  		preIndex := iNdEx
   858  		var wire uint64
   859  		for shift := uint(0); ; shift += 7 {
   860  			if shift >= 64 {
   861  				return ErrIntOverflowHandshake
   862  			}
   863  			if iNdEx >= l {
   864  				return io.ErrUnexpectedEOF
   865  			}
   866  			b := dAtA[iNdEx]
   867  			iNdEx++
   868  			wire |= uint64(b&0x7F) << shift
   869  			if b < 0x80 {
   870  				break
   871  			}
   872  		}
   873  		fieldNum := int32(wire >> 3)
   874  		wireType := int(wire & 0x7)
   875  		if wireType == 4 {
   876  			return fmt.Errorf("proto: SynAck: wiretype end group for non-group")
   877  		}
   878  		if fieldNum <= 0 {
   879  			return fmt.Errorf("proto: SynAck: illegal tag %d (wire type %d)", fieldNum, wire)
   880  		}
   881  		switch fieldNum {
   882  		case 1:
   883  			if wireType != 2 {
   884  				return fmt.Errorf("proto: wrong wireType = %d for field Syn", wireType)
   885  			}
   886  			var msglen int
   887  			for shift := uint(0); ; shift += 7 {
   888  				if shift >= 64 {
   889  					return ErrIntOverflowHandshake
   890  				}
   891  				if iNdEx >= l {
   892  					return io.ErrUnexpectedEOF
   893  				}
   894  				b := dAtA[iNdEx]
   895  				iNdEx++
   896  				msglen |= int(b&0x7F) << shift
   897  				if b < 0x80 {
   898  					break
   899  				}
   900  			}
   901  			if msglen < 0 {
   902  				return ErrInvalidLengthHandshake
   903  			}
   904  			postIndex := iNdEx + msglen
   905  			if postIndex < 0 {
   906  				return ErrInvalidLengthHandshake
   907  			}
   908  			if postIndex > l {
   909  				return io.ErrUnexpectedEOF
   910  			}
   911  			if m.Syn == nil {
   912  				m.Syn = &Syn{}
   913  			}
   914  			if err := m.Syn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   915  				return err
   916  			}
   917  			iNdEx = postIndex
   918  		case 2:
   919  			if wireType != 2 {
   920  				return fmt.Errorf("proto: wrong wireType = %d for field Ack", wireType)
   921  			}
   922  			var msglen int
   923  			for shift := uint(0); ; shift += 7 {
   924  				if shift >= 64 {
   925  					return ErrIntOverflowHandshake
   926  				}
   927  				if iNdEx >= l {
   928  					return io.ErrUnexpectedEOF
   929  				}
   930  				b := dAtA[iNdEx]
   931  				iNdEx++
   932  				msglen |= int(b&0x7F) << shift
   933  				if b < 0x80 {
   934  					break
   935  				}
   936  			}
   937  			if msglen < 0 {
   938  				return ErrInvalidLengthHandshake
   939  			}
   940  			postIndex := iNdEx + msglen
   941  			if postIndex < 0 {
   942  				return ErrInvalidLengthHandshake
   943  			}
   944  			if postIndex > l {
   945  				return io.ErrUnexpectedEOF
   946  			}
   947  			if m.Ack == nil {
   948  				m.Ack = &Ack{}
   949  			}
   950  			if err := m.Ack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   951  				return err
   952  			}
   953  			iNdEx = postIndex
   954  		default:
   955  			iNdEx = preIndex
   956  			skippy, err := skipHandshake(dAtA[iNdEx:])
   957  			if err != nil {
   958  				return err
   959  			}
   960  			if skippy < 0 {
   961  				return ErrInvalidLengthHandshake
   962  			}
   963  			if (iNdEx + skippy) < 0 {
   964  				return ErrInvalidLengthHandshake
   965  			}
   966  			if (iNdEx + skippy) > l {
   967  				return io.ErrUnexpectedEOF
   968  			}
   969  			iNdEx += skippy
   970  		}
   971  	}
   972  
   973  	if iNdEx > l {
   974  		return io.ErrUnexpectedEOF
   975  	}
   976  	return nil
   977  }
   978  func (m *BzzAddress) Unmarshal(dAtA []byte) error {
   979  	l := len(dAtA)
   980  	iNdEx := 0
   981  	for iNdEx < l {
   982  		preIndex := iNdEx
   983  		var wire uint64
   984  		for shift := uint(0); ; shift += 7 {
   985  			if shift >= 64 {
   986  				return ErrIntOverflowHandshake
   987  			}
   988  			if iNdEx >= l {
   989  				return io.ErrUnexpectedEOF
   990  			}
   991  			b := dAtA[iNdEx]
   992  			iNdEx++
   993  			wire |= uint64(b&0x7F) << shift
   994  			if b < 0x80 {
   995  				break
   996  			}
   997  		}
   998  		fieldNum := int32(wire >> 3)
   999  		wireType := int(wire & 0x7)
  1000  		if wireType == 4 {
  1001  			return fmt.Errorf("proto: BzzAddress: wiretype end group for non-group")
  1002  		}
  1003  		if fieldNum <= 0 {
  1004  			return fmt.Errorf("proto: BzzAddress: illegal tag %d (wire type %d)", fieldNum, wire)
  1005  		}
  1006  		switch fieldNum {
  1007  		case 1:
  1008  			if wireType != 2 {
  1009  				return fmt.Errorf("proto: wrong wireType = %d for field Underlay", wireType)
  1010  			}
  1011  			var byteLen int
  1012  			for shift := uint(0); ; shift += 7 {
  1013  				if shift >= 64 {
  1014  					return ErrIntOverflowHandshake
  1015  				}
  1016  				if iNdEx >= l {
  1017  					return io.ErrUnexpectedEOF
  1018  				}
  1019  				b := dAtA[iNdEx]
  1020  				iNdEx++
  1021  				byteLen |= int(b&0x7F) << shift
  1022  				if b < 0x80 {
  1023  					break
  1024  				}
  1025  			}
  1026  			if byteLen < 0 {
  1027  				return ErrInvalidLengthHandshake
  1028  			}
  1029  			postIndex := iNdEx + byteLen
  1030  			if postIndex < 0 {
  1031  				return ErrInvalidLengthHandshake
  1032  			}
  1033  			if postIndex > l {
  1034  				return io.ErrUnexpectedEOF
  1035  			}
  1036  			m.Underlay = append(m.Underlay[:0], dAtA[iNdEx:postIndex]...)
  1037  			if m.Underlay == nil {
  1038  				m.Underlay = []byte{}
  1039  			}
  1040  			iNdEx = postIndex
  1041  		case 2:
  1042  			if wireType != 2 {
  1043  				return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType)
  1044  			}
  1045  			var byteLen int
  1046  			for shift := uint(0); ; shift += 7 {
  1047  				if shift >= 64 {
  1048  					return ErrIntOverflowHandshake
  1049  				}
  1050  				if iNdEx >= l {
  1051  					return io.ErrUnexpectedEOF
  1052  				}
  1053  				b := dAtA[iNdEx]
  1054  				iNdEx++
  1055  				byteLen |= int(b&0x7F) << shift
  1056  				if b < 0x80 {
  1057  					break
  1058  				}
  1059  			}
  1060  			if byteLen < 0 {
  1061  				return ErrInvalidLengthHandshake
  1062  			}
  1063  			postIndex := iNdEx + byteLen
  1064  			if postIndex < 0 {
  1065  				return ErrInvalidLengthHandshake
  1066  			}
  1067  			if postIndex > l {
  1068  				return io.ErrUnexpectedEOF
  1069  			}
  1070  			m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...)
  1071  			if m.Signature == nil {
  1072  				m.Signature = []byte{}
  1073  			}
  1074  			iNdEx = postIndex
  1075  		case 3:
  1076  			if wireType != 2 {
  1077  				return fmt.Errorf("proto: wrong wireType = %d for field Overlay", wireType)
  1078  			}
  1079  			var byteLen int
  1080  			for shift := uint(0); ; shift += 7 {
  1081  				if shift >= 64 {
  1082  					return ErrIntOverflowHandshake
  1083  				}
  1084  				if iNdEx >= l {
  1085  					return io.ErrUnexpectedEOF
  1086  				}
  1087  				b := dAtA[iNdEx]
  1088  				iNdEx++
  1089  				byteLen |= int(b&0x7F) << shift
  1090  				if b < 0x80 {
  1091  					break
  1092  				}
  1093  			}
  1094  			if byteLen < 0 {
  1095  				return ErrInvalidLengthHandshake
  1096  			}
  1097  			postIndex := iNdEx + byteLen
  1098  			if postIndex < 0 {
  1099  				return ErrInvalidLengthHandshake
  1100  			}
  1101  			if postIndex > l {
  1102  				return io.ErrUnexpectedEOF
  1103  			}
  1104  			m.Overlay = append(m.Overlay[:0], dAtA[iNdEx:postIndex]...)
  1105  			if m.Overlay == nil {
  1106  				m.Overlay = []byte{}
  1107  			}
  1108  			iNdEx = postIndex
  1109  		default:
  1110  			iNdEx = preIndex
  1111  			skippy, err := skipHandshake(dAtA[iNdEx:])
  1112  			if err != nil {
  1113  				return err
  1114  			}
  1115  			if skippy < 0 {
  1116  				return ErrInvalidLengthHandshake
  1117  			}
  1118  			if (iNdEx + skippy) < 0 {
  1119  				return ErrInvalidLengthHandshake
  1120  			}
  1121  			if (iNdEx + skippy) > l {
  1122  				return io.ErrUnexpectedEOF
  1123  			}
  1124  			iNdEx += skippy
  1125  		}
  1126  	}
  1127  
  1128  	if iNdEx > l {
  1129  		return io.ErrUnexpectedEOF
  1130  	}
  1131  	return nil
  1132  }
  1133  func skipHandshake(dAtA []byte) (n int, err error) {
  1134  	l := len(dAtA)
  1135  	iNdEx := 0
  1136  	depth := 0
  1137  	for iNdEx < l {
  1138  		var wire uint64
  1139  		for shift := uint(0); ; shift += 7 {
  1140  			if shift >= 64 {
  1141  				return 0, ErrIntOverflowHandshake
  1142  			}
  1143  			if iNdEx >= l {
  1144  				return 0, io.ErrUnexpectedEOF
  1145  			}
  1146  			b := dAtA[iNdEx]
  1147  			iNdEx++
  1148  			wire |= (uint64(b) & 0x7F) << shift
  1149  			if b < 0x80 {
  1150  				break
  1151  			}
  1152  		}
  1153  		wireType := int(wire & 0x7)
  1154  		switch wireType {
  1155  		case 0:
  1156  			for shift := uint(0); ; shift += 7 {
  1157  				if shift >= 64 {
  1158  					return 0, ErrIntOverflowHandshake
  1159  				}
  1160  				if iNdEx >= l {
  1161  					return 0, io.ErrUnexpectedEOF
  1162  				}
  1163  				iNdEx++
  1164  				if dAtA[iNdEx-1] < 0x80 {
  1165  					break
  1166  				}
  1167  			}
  1168  		case 1:
  1169  			iNdEx += 8
  1170  		case 2:
  1171  			var length int
  1172  			for shift := uint(0); ; shift += 7 {
  1173  				if shift >= 64 {
  1174  					return 0, ErrIntOverflowHandshake
  1175  				}
  1176  				if iNdEx >= l {
  1177  					return 0, io.ErrUnexpectedEOF
  1178  				}
  1179  				b := dAtA[iNdEx]
  1180  				iNdEx++
  1181  				length |= (int(b) & 0x7F) << shift
  1182  				if b < 0x80 {
  1183  					break
  1184  				}
  1185  			}
  1186  			if length < 0 {
  1187  				return 0, ErrInvalidLengthHandshake
  1188  			}
  1189  			iNdEx += length
  1190  		case 3:
  1191  			depth++
  1192  		case 4:
  1193  			if depth == 0 {
  1194  				return 0, ErrUnexpectedEndOfGroupHandshake
  1195  			}
  1196  			depth--
  1197  		case 5:
  1198  			iNdEx += 4
  1199  		default:
  1200  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1201  		}
  1202  		if iNdEx < 0 {
  1203  			return 0, ErrInvalidLengthHandshake
  1204  		}
  1205  		if depth == 0 {
  1206  			return iNdEx, nil
  1207  		}
  1208  	}
  1209  	return 0, io.ErrUnexpectedEOF
  1210  }
  1211  
  1212  var (
  1213  	ErrInvalidLengthHandshake        = fmt.Errorf("proto: negative length found during unmarshaling")
  1214  	ErrIntOverflowHandshake          = fmt.Errorf("proto: integer overflow")
  1215  	ErrUnexpectedEndOfGroupHandshake = fmt.Errorf("proto: unexpected end of group")
  1216  )