You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

779 lines
18 KiB

  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: proto/p2p/pex_msgs.proto
  3. package p2p
  4. import (
  5. fmt "fmt"
  6. _ "github.com/gogo/protobuf/gogoproto"
  7. proto "github.com/gogo/protobuf/proto"
  8. io "io"
  9. math "math"
  10. math_bits "math/bits"
  11. )
  12. // Reference imports to suppress errors if they are not otherwise used.
  13. var _ = proto.Marshal
  14. var _ = fmt.Errorf
  15. var _ = math.Inf
  16. // This is a compile-time assertion to ensure that this generated file
  17. // is compatible with the proto package it is being compiled against.
  18. // A compilation error at this line likely means your copy of the
  19. // proto package needs to be updated.
  20. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
  21. type PexRequest struct {
  22. }
  23. func (m *PexRequest) Reset() { *m = PexRequest{} }
  24. func (m *PexRequest) String() string { return proto.CompactTextString(m) }
  25. func (*PexRequest) ProtoMessage() {}
  26. func (*PexRequest) Descriptor() ([]byte, []int) {
  27. return fileDescriptor_b4d6fe6b009e47d8, []int{0}
  28. }
  29. func (m *PexRequest) XXX_Unmarshal(b []byte) error {
  30. return m.Unmarshal(b)
  31. }
  32. func (m *PexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  33. if deterministic {
  34. return xxx_messageInfo_PexRequest.Marshal(b, m, deterministic)
  35. } else {
  36. b = b[:cap(b)]
  37. n, err := m.MarshalToSizedBuffer(b)
  38. if err != nil {
  39. return nil, err
  40. }
  41. return b[:n], nil
  42. }
  43. }
  44. func (m *PexRequest) XXX_Merge(src proto.Message) {
  45. xxx_messageInfo_PexRequest.Merge(m, src)
  46. }
  47. func (m *PexRequest) XXX_Size() int {
  48. return m.Size()
  49. }
  50. func (m *PexRequest) XXX_DiscardUnknown() {
  51. xxx_messageInfo_PexRequest.DiscardUnknown(m)
  52. }
  53. var xxx_messageInfo_PexRequest proto.InternalMessageInfo
  54. type PexAddrs struct {
  55. Addrs []NetAddress `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs"`
  56. }
  57. func (m *PexAddrs) Reset() { *m = PexAddrs{} }
  58. func (m *PexAddrs) String() string { return proto.CompactTextString(m) }
  59. func (*PexAddrs) ProtoMessage() {}
  60. func (*PexAddrs) Descriptor() ([]byte, []int) {
  61. return fileDescriptor_b4d6fe6b009e47d8, []int{1}
  62. }
  63. func (m *PexAddrs) XXX_Unmarshal(b []byte) error {
  64. return m.Unmarshal(b)
  65. }
  66. func (m *PexAddrs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  67. if deterministic {
  68. return xxx_messageInfo_PexAddrs.Marshal(b, m, deterministic)
  69. } else {
  70. b = b[:cap(b)]
  71. n, err := m.MarshalToSizedBuffer(b)
  72. if err != nil {
  73. return nil, err
  74. }
  75. return b[:n], nil
  76. }
  77. }
  78. func (m *PexAddrs) XXX_Merge(src proto.Message) {
  79. xxx_messageInfo_PexAddrs.Merge(m, src)
  80. }
  81. func (m *PexAddrs) XXX_Size() int {
  82. return m.Size()
  83. }
  84. func (m *PexAddrs) XXX_DiscardUnknown() {
  85. xxx_messageInfo_PexAddrs.DiscardUnknown(m)
  86. }
  87. var xxx_messageInfo_PexAddrs proto.InternalMessageInfo
  88. func (m *PexAddrs) GetAddrs() []NetAddress {
  89. if m != nil {
  90. return m.Addrs
  91. }
  92. return nil
  93. }
  94. type Message struct {
  95. // Types that are valid to be assigned to Sum:
  96. // *Message_PexRequest
  97. // *Message_PexAddrs
  98. Sum isMessage_Sum `protobuf_oneof:"sum"`
  99. }
  100. func (m *Message) Reset() { *m = Message{} }
  101. func (m *Message) String() string { return proto.CompactTextString(m) }
  102. func (*Message) ProtoMessage() {}
  103. func (*Message) Descriptor() ([]byte, []int) {
  104. return fileDescriptor_b4d6fe6b009e47d8, []int{2}
  105. }
  106. func (m *Message) XXX_Unmarshal(b []byte) error {
  107. return m.Unmarshal(b)
  108. }
  109. func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  110. if deterministic {
  111. return xxx_messageInfo_Message.Marshal(b, m, deterministic)
  112. } else {
  113. b = b[:cap(b)]
  114. n, err := m.MarshalToSizedBuffer(b)
  115. if err != nil {
  116. return nil, err
  117. }
  118. return b[:n], nil
  119. }
  120. }
  121. func (m *Message) XXX_Merge(src proto.Message) {
  122. xxx_messageInfo_Message.Merge(m, src)
  123. }
  124. func (m *Message) XXX_Size() int {
  125. return m.Size()
  126. }
  127. func (m *Message) XXX_DiscardUnknown() {
  128. xxx_messageInfo_Message.DiscardUnknown(m)
  129. }
  130. var xxx_messageInfo_Message proto.InternalMessageInfo
  131. type isMessage_Sum interface {
  132. isMessage_Sum()
  133. MarshalTo([]byte) (int, error)
  134. Size() int
  135. }
  136. type Message_PexRequest struct {
  137. PexRequest *PexRequest `protobuf:"bytes,1,opt,name=pex_request,json=pexRequest,proto3,oneof" json:"pex_request,omitempty"`
  138. }
  139. type Message_PexAddrs struct {
  140. PexAddrs *PexAddrs `protobuf:"bytes,2,opt,name=pex_addrs,json=pexAddrs,proto3,oneof" json:"pex_addrs,omitempty"`
  141. }
  142. func (*Message_PexRequest) isMessage_Sum() {}
  143. func (*Message_PexAddrs) isMessage_Sum() {}
  144. func (m *Message) GetSum() isMessage_Sum {
  145. if m != nil {
  146. return m.Sum
  147. }
  148. return nil
  149. }
  150. func (m *Message) GetPexRequest() *PexRequest {
  151. if x, ok := m.GetSum().(*Message_PexRequest); ok {
  152. return x.PexRequest
  153. }
  154. return nil
  155. }
  156. func (m *Message) GetPexAddrs() *PexAddrs {
  157. if x, ok := m.GetSum().(*Message_PexAddrs); ok {
  158. return x.PexAddrs
  159. }
  160. return nil
  161. }
  162. // XXX_OneofWrappers is for the internal use of the proto package.
  163. func (*Message) XXX_OneofWrappers() []interface{} {
  164. return []interface{}{
  165. (*Message_PexRequest)(nil),
  166. (*Message_PexAddrs)(nil),
  167. }
  168. }
  169. func init() {
  170. proto.RegisterType((*PexRequest)(nil), "tendermint.p2p.PexRequest")
  171. proto.RegisterType((*PexAddrs)(nil), "tendermint.p2p.PexAddrs")
  172. proto.RegisterType((*Message)(nil), "tendermint.p2p.Message")
  173. }
  174. func init() { proto.RegisterFile("proto/p2p/pex_msgs.proto", fileDescriptor_b4d6fe6b009e47d8) }
  175. var fileDescriptor_b4d6fe6b009e47d8 = []byte{
  176. // 278 bytes of a gzipped FileDescriptorProto
  177. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x28, 0x28, 0xca, 0x2f,
  178. 0xc9, 0xd7, 0x2f, 0x30, 0x2a, 0xd0, 0x2f, 0x48, 0xad, 0x88, 0xcf, 0x2d, 0x4e, 0x2f, 0xd6, 0x03,
  179. 0x0b, 0x09, 0xf1, 0x95, 0xa4, 0xe6, 0xa5, 0xa4, 0x16, 0xe5, 0x66, 0xe6, 0x95, 0xe8, 0x15, 0x18,
  180. 0x15, 0x48, 0x89, 0x22, 0x54, 0x96, 0x54, 0x16, 0xa4, 0x42, 0x95, 0x49, 0xa9, 0x95, 0x64, 0x64,
  181. 0x16, 0xa5, 0xc4, 0x17, 0x24, 0x16, 0x95, 0x54, 0xea, 0x43, 0x94, 0xa4, 0xe7, 0xa7, 0xe7, 0x23,
  182. 0x58, 0x10, 0x75, 0x4a, 0x3c, 0x5c, 0x5c, 0x01, 0xa9, 0x15, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5,
  183. 0x25, 0x4a, 0x4e, 0x5c, 0x1c, 0x01, 0xa9, 0x15, 0x8e, 0x29, 0x29, 0x45, 0xc5, 0x42, 0x66, 0x5c,
  184. 0xac, 0x89, 0x20, 0x86, 0x04, 0xa3, 0x02, 0xb3, 0x06, 0xb7, 0x91, 0x94, 0x1e, 0xaa, 0xc5, 0x7a,
  185. 0x7e, 0xa9, 0x25, 0x20, 0x85, 0xa9, 0xc5, 0xc5, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41,
  186. 0x94, 0x2b, 0x75, 0x30, 0x72, 0xb1, 0xfb, 0xa6, 0x16, 0x17, 0x27, 0xa6, 0xa7, 0x0a, 0xd9, 0x72,
  187. 0x71, 0x83, 0x9c, 0x5f, 0x04, 0x31, 0x5e, 0x82, 0x51, 0x81, 0x11, 0x9b, 0x49, 0x08, 0x07, 0x78,
  188. 0x30, 0x04, 0x71, 0x15, 0xc0, 0x79, 0x42, 0xe6, 0x5c, 0x9c, 0x20, 0xed, 0x10, 0x67, 0x30, 0x81,
  189. 0x35, 0x4b, 0x60, 0xd1, 0x0c, 0x76, 0xaf, 0x07, 0x43, 0x10, 0x47, 0x01, 0x94, 0xed, 0xc4, 0xca,
  190. 0xc5, 0x5c, 0x5c, 0x9a, 0xeb, 0xe4, 0x72, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f,
  191. 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c,
  192. 0x51, 0x5a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x08, 0x03, 0x91,
  193. 0x99, 0xf0, 0x60, 0x4d, 0x62, 0x03, 0x33, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x15, 0x30,
  194. 0x3c, 0xbc, 0x94, 0x01, 0x00, 0x00,
  195. }
  196. func (m *PexRequest) Marshal() (dAtA []byte, err error) {
  197. size := m.Size()
  198. dAtA = make([]byte, size)
  199. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  200. if err != nil {
  201. return nil, err
  202. }
  203. return dAtA[:n], nil
  204. }
  205. func (m *PexRequest) MarshalTo(dAtA []byte) (int, error) {
  206. size := m.Size()
  207. return m.MarshalToSizedBuffer(dAtA[:size])
  208. }
  209. func (m *PexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  210. i := len(dAtA)
  211. _ = i
  212. var l int
  213. _ = l
  214. return len(dAtA) - i, nil
  215. }
  216. func (m *PexAddrs) Marshal() (dAtA []byte, err error) {
  217. size := m.Size()
  218. dAtA = make([]byte, size)
  219. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  220. if err != nil {
  221. return nil, err
  222. }
  223. return dAtA[:n], nil
  224. }
  225. func (m *PexAddrs) MarshalTo(dAtA []byte) (int, error) {
  226. size := m.Size()
  227. return m.MarshalToSizedBuffer(dAtA[:size])
  228. }
  229. func (m *PexAddrs) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  230. i := len(dAtA)
  231. _ = i
  232. var l int
  233. _ = l
  234. if len(m.Addrs) > 0 {
  235. for iNdEx := len(m.Addrs) - 1; iNdEx >= 0; iNdEx-- {
  236. {
  237. size, err := m.Addrs[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  238. if err != nil {
  239. return 0, err
  240. }
  241. i -= size
  242. i = encodeVarintPexMsgs(dAtA, i, uint64(size))
  243. }
  244. i--
  245. dAtA[i] = 0xa
  246. }
  247. }
  248. return len(dAtA) - i, nil
  249. }
  250. func (m *Message) Marshal() (dAtA []byte, err error) {
  251. size := m.Size()
  252. dAtA = make([]byte, size)
  253. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  254. if err != nil {
  255. return nil, err
  256. }
  257. return dAtA[:n], nil
  258. }
  259. func (m *Message) MarshalTo(dAtA []byte) (int, error) {
  260. size := m.Size()
  261. return m.MarshalToSizedBuffer(dAtA[:size])
  262. }
  263. func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  264. i := len(dAtA)
  265. _ = i
  266. var l int
  267. _ = l
  268. if m.Sum != nil {
  269. {
  270. size := m.Sum.Size()
  271. i -= size
  272. if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil {
  273. return 0, err
  274. }
  275. }
  276. }
  277. return len(dAtA) - i, nil
  278. }
  279. func (m *Message_PexRequest) MarshalTo(dAtA []byte) (int, error) {
  280. size := m.Size()
  281. return m.MarshalToSizedBuffer(dAtA[:size])
  282. }
  283. func (m *Message_PexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  284. i := len(dAtA)
  285. if m.PexRequest != nil {
  286. {
  287. size, err := m.PexRequest.MarshalToSizedBuffer(dAtA[:i])
  288. if err != nil {
  289. return 0, err
  290. }
  291. i -= size
  292. i = encodeVarintPexMsgs(dAtA, i, uint64(size))
  293. }
  294. i--
  295. dAtA[i] = 0xa
  296. }
  297. return len(dAtA) - i, nil
  298. }
  299. func (m *Message_PexAddrs) MarshalTo(dAtA []byte) (int, error) {
  300. size := m.Size()
  301. return m.MarshalToSizedBuffer(dAtA[:size])
  302. }
  303. func (m *Message_PexAddrs) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  304. i := len(dAtA)
  305. if m.PexAddrs != nil {
  306. {
  307. size, err := m.PexAddrs.MarshalToSizedBuffer(dAtA[:i])
  308. if err != nil {
  309. return 0, err
  310. }
  311. i -= size
  312. i = encodeVarintPexMsgs(dAtA, i, uint64(size))
  313. }
  314. i--
  315. dAtA[i] = 0x12
  316. }
  317. return len(dAtA) - i, nil
  318. }
  319. func encodeVarintPexMsgs(dAtA []byte, offset int, v uint64) int {
  320. offset -= sovPexMsgs(v)
  321. base := offset
  322. for v >= 1<<7 {
  323. dAtA[offset] = uint8(v&0x7f | 0x80)
  324. v >>= 7
  325. offset++
  326. }
  327. dAtA[offset] = uint8(v)
  328. return base
  329. }
  330. func (m *PexRequest) Size() (n int) {
  331. if m == nil {
  332. return 0
  333. }
  334. var l int
  335. _ = l
  336. return n
  337. }
  338. func (m *PexAddrs) Size() (n int) {
  339. if m == nil {
  340. return 0
  341. }
  342. var l int
  343. _ = l
  344. if len(m.Addrs) > 0 {
  345. for _, e := range m.Addrs {
  346. l = e.Size()
  347. n += 1 + l + sovPexMsgs(uint64(l))
  348. }
  349. }
  350. return n
  351. }
  352. func (m *Message) Size() (n int) {
  353. if m == nil {
  354. return 0
  355. }
  356. var l int
  357. _ = l
  358. if m.Sum != nil {
  359. n += m.Sum.Size()
  360. }
  361. return n
  362. }
  363. func (m *Message_PexRequest) Size() (n int) {
  364. if m == nil {
  365. return 0
  366. }
  367. var l int
  368. _ = l
  369. if m.PexRequest != nil {
  370. l = m.PexRequest.Size()
  371. n += 1 + l + sovPexMsgs(uint64(l))
  372. }
  373. return n
  374. }
  375. func (m *Message_PexAddrs) Size() (n int) {
  376. if m == nil {
  377. return 0
  378. }
  379. var l int
  380. _ = l
  381. if m.PexAddrs != nil {
  382. l = m.PexAddrs.Size()
  383. n += 1 + l + sovPexMsgs(uint64(l))
  384. }
  385. return n
  386. }
  387. func sovPexMsgs(x uint64) (n int) {
  388. return (math_bits.Len64(x|1) + 6) / 7
  389. }
  390. func sozPexMsgs(x uint64) (n int) {
  391. return sovPexMsgs(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  392. }
  393. func (m *PexRequest) Unmarshal(dAtA []byte) error {
  394. l := len(dAtA)
  395. iNdEx := 0
  396. for iNdEx < l {
  397. preIndex := iNdEx
  398. var wire uint64
  399. for shift := uint(0); ; shift += 7 {
  400. if shift >= 64 {
  401. return ErrIntOverflowPexMsgs
  402. }
  403. if iNdEx >= l {
  404. return io.ErrUnexpectedEOF
  405. }
  406. b := dAtA[iNdEx]
  407. iNdEx++
  408. wire |= uint64(b&0x7F) << shift
  409. if b < 0x80 {
  410. break
  411. }
  412. }
  413. fieldNum := int32(wire >> 3)
  414. wireType := int(wire & 0x7)
  415. if wireType == 4 {
  416. return fmt.Errorf("proto: PexRequest: wiretype end group for non-group")
  417. }
  418. if fieldNum <= 0 {
  419. return fmt.Errorf("proto: PexRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  420. }
  421. switch fieldNum {
  422. default:
  423. iNdEx = preIndex
  424. skippy, err := skipPexMsgs(dAtA[iNdEx:])
  425. if err != nil {
  426. return err
  427. }
  428. if skippy < 0 {
  429. return ErrInvalidLengthPexMsgs
  430. }
  431. if (iNdEx + skippy) < 0 {
  432. return ErrInvalidLengthPexMsgs
  433. }
  434. if (iNdEx + skippy) > l {
  435. return io.ErrUnexpectedEOF
  436. }
  437. iNdEx += skippy
  438. }
  439. }
  440. if iNdEx > l {
  441. return io.ErrUnexpectedEOF
  442. }
  443. return nil
  444. }
  445. func (m *PexAddrs) Unmarshal(dAtA []byte) error {
  446. l := len(dAtA)
  447. iNdEx := 0
  448. for iNdEx < l {
  449. preIndex := iNdEx
  450. var wire uint64
  451. for shift := uint(0); ; shift += 7 {
  452. if shift >= 64 {
  453. return ErrIntOverflowPexMsgs
  454. }
  455. if iNdEx >= l {
  456. return io.ErrUnexpectedEOF
  457. }
  458. b := dAtA[iNdEx]
  459. iNdEx++
  460. wire |= uint64(b&0x7F) << shift
  461. if b < 0x80 {
  462. break
  463. }
  464. }
  465. fieldNum := int32(wire >> 3)
  466. wireType := int(wire & 0x7)
  467. if wireType == 4 {
  468. return fmt.Errorf("proto: PexAddrs: wiretype end group for non-group")
  469. }
  470. if fieldNum <= 0 {
  471. return fmt.Errorf("proto: PexAddrs: illegal tag %d (wire type %d)", fieldNum, wire)
  472. }
  473. switch fieldNum {
  474. case 1:
  475. if wireType != 2 {
  476. return fmt.Errorf("proto: wrong wireType = %d for field Addrs", wireType)
  477. }
  478. var msglen int
  479. for shift := uint(0); ; shift += 7 {
  480. if shift >= 64 {
  481. return ErrIntOverflowPexMsgs
  482. }
  483. if iNdEx >= l {
  484. return io.ErrUnexpectedEOF
  485. }
  486. b := dAtA[iNdEx]
  487. iNdEx++
  488. msglen |= int(b&0x7F) << shift
  489. if b < 0x80 {
  490. break
  491. }
  492. }
  493. if msglen < 0 {
  494. return ErrInvalidLengthPexMsgs
  495. }
  496. postIndex := iNdEx + msglen
  497. if postIndex < 0 {
  498. return ErrInvalidLengthPexMsgs
  499. }
  500. if postIndex > l {
  501. return io.ErrUnexpectedEOF
  502. }
  503. m.Addrs = append(m.Addrs, NetAddress{})
  504. if err := m.Addrs[len(m.Addrs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  505. return err
  506. }
  507. iNdEx = postIndex
  508. default:
  509. iNdEx = preIndex
  510. skippy, err := skipPexMsgs(dAtA[iNdEx:])
  511. if err != nil {
  512. return err
  513. }
  514. if skippy < 0 {
  515. return ErrInvalidLengthPexMsgs
  516. }
  517. if (iNdEx + skippy) < 0 {
  518. return ErrInvalidLengthPexMsgs
  519. }
  520. if (iNdEx + skippy) > l {
  521. return io.ErrUnexpectedEOF
  522. }
  523. iNdEx += skippy
  524. }
  525. }
  526. if iNdEx > l {
  527. return io.ErrUnexpectedEOF
  528. }
  529. return nil
  530. }
  531. func (m *Message) Unmarshal(dAtA []byte) error {
  532. l := len(dAtA)
  533. iNdEx := 0
  534. for iNdEx < l {
  535. preIndex := iNdEx
  536. var wire uint64
  537. for shift := uint(0); ; shift += 7 {
  538. if shift >= 64 {
  539. return ErrIntOverflowPexMsgs
  540. }
  541. if iNdEx >= l {
  542. return io.ErrUnexpectedEOF
  543. }
  544. b := dAtA[iNdEx]
  545. iNdEx++
  546. wire |= uint64(b&0x7F) << shift
  547. if b < 0x80 {
  548. break
  549. }
  550. }
  551. fieldNum := int32(wire >> 3)
  552. wireType := int(wire & 0x7)
  553. if wireType == 4 {
  554. return fmt.Errorf("proto: Message: wiretype end group for non-group")
  555. }
  556. if fieldNum <= 0 {
  557. return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire)
  558. }
  559. switch fieldNum {
  560. case 1:
  561. if wireType != 2 {
  562. return fmt.Errorf("proto: wrong wireType = %d for field PexRequest", wireType)
  563. }
  564. var msglen int
  565. for shift := uint(0); ; shift += 7 {
  566. if shift >= 64 {
  567. return ErrIntOverflowPexMsgs
  568. }
  569. if iNdEx >= l {
  570. return io.ErrUnexpectedEOF
  571. }
  572. b := dAtA[iNdEx]
  573. iNdEx++
  574. msglen |= int(b&0x7F) << shift
  575. if b < 0x80 {
  576. break
  577. }
  578. }
  579. if msglen < 0 {
  580. return ErrInvalidLengthPexMsgs
  581. }
  582. postIndex := iNdEx + msglen
  583. if postIndex < 0 {
  584. return ErrInvalidLengthPexMsgs
  585. }
  586. if postIndex > l {
  587. return io.ErrUnexpectedEOF
  588. }
  589. v := &PexRequest{}
  590. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  591. return err
  592. }
  593. m.Sum = &Message_PexRequest{v}
  594. iNdEx = postIndex
  595. case 2:
  596. if wireType != 2 {
  597. return fmt.Errorf("proto: wrong wireType = %d for field PexAddrs", wireType)
  598. }
  599. var msglen int
  600. for shift := uint(0); ; shift += 7 {
  601. if shift >= 64 {
  602. return ErrIntOverflowPexMsgs
  603. }
  604. if iNdEx >= l {
  605. return io.ErrUnexpectedEOF
  606. }
  607. b := dAtA[iNdEx]
  608. iNdEx++
  609. msglen |= int(b&0x7F) << shift
  610. if b < 0x80 {
  611. break
  612. }
  613. }
  614. if msglen < 0 {
  615. return ErrInvalidLengthPexMsgs
  616. }
  617. postIndex := iNdEx + msglen
  618. if postIndex < 0 {
  619. return ErrInvalidLengthPexMsgs
  620. }
  621. if postIndex > l {
  622. return io.ErrUnexpectedEOF
  623. }
  624. v := &PexAddrs{}
  625. if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  626. return err
  627. }
  628. m.Sum = &Message_PexAddrs{v}
  629. iNdEx = postIndex
  630. default:
  631. iNdEx = preIndex
  632. skippy, err := skipPexMsgs(dAtA[iNdEx:])
  633. if err != nil {
  634. return err
  635. }
  636. if skippy < 0 {
  637. return ErrInvalidLengthPexMsgs
  638. }
  639. if (iNdEx + skippy) < 0 {
  640. return ErrInvalidLengthPexMsgs
  641. }
  642. if (iNdEx + skippy) > l {
  643. return io.ErrUnexpectedEOF
  644. }
  645. iNdEx += skippy
  646. }
  647. }
  648. if iNdEx > l {
  649. return io.ErrUnexpectedEOF
  650. }
  651. return nil
  652. }
  653. func skipPexMsgs(dAtA []byte) (n int, err error) {
  654. l := len(dAtA)
  655. iNdEx := 0
  656. depth := 0
  657. for iNdEx < l {
  658. var wire uint64
  659. for shift := uint(0); ; shift += 7 {
  660. if shift >= 64 {
  661. return 0, ErrIntOverflowPexMsgs
  662. }
  663. if iNdEx >= l {
  664. return 0, io.ErrUnexpectedEOF
  665. }
  666. b := dAtA[iNdEx]
  667. iNdEx++
  668. wire |= (uint64(b) & 0x7F) << shift
  669. if b < 0x80 {
  670. break
  671. }
  672. }
  673. wireType := int(wire & 0x7)
  674. switch wireType {
  675. case 0:
  676. for shift := uint(0); ; shift += 7 {
  677. if shift >= 64 {
  678. return 0, ErrIntOverflowPexMsgs
  679. }
  680. if iNdEx >= l {
  681. return 0, io.ErrUnexpectedEOF
  682. }
  683. iNdEx++
  684. if dAtA[iNdEx-1] < 0x80 {
  685. break
  686. }
  687. }
  688. case 1:
  689. iNdEx += 8
  690. case 2:
  691. var length int
  692. for shift := uint(0); ; shift += 7 {
  693. if shift >= 64 {
  694. return 0, ErrIntOverflowPexMsgs
  695. }
  696. if iNdEx >= l {
  697. return 0, io.ErrUnexpectedEOF
  698. }
  699. b := dAtA[iNdEx]
  700. iNdEx++
  701. length |= (int(b) & 0x7F) << shift
  702. if b < 0x80 {
  703. break
  704. }
  705. }
  706. if length < 0 {
  707. return 0, ErrInvalidLengthPexMsgs
  708. }
  709. iNdEx += length
  710. case 3:
  711. depth++
  712. case 4:
  713. if depth == 0 {
  714. return 0, ErrUnexpectedEndOfGroupPexMsgs
  715. }
  716. depth--
  717. case 5:
  718. iNdEx += 4
  719. default:
  720. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  721. }
  722. if iNdEx < 0 {
  723. return 0, ErrInvalidLengthPexMsgs
  724. }
  725. if depth == 0 {
  726. return iNdEx, nil
  727. }
  728. }
  729. return 0, io.ErrUnexpectedEOF
  730. }
  731. var (
  732. ErrInvalidLengthPexMsgs = fmt.Errorf("proto: negative length found during unmarshaling")
  733. ErrIntOverflowPexMsgs = fmt.Errorf("proto: integer overflow")
  734. ErrUnexpectedEndOfGroupPexMsgs = fmt.Errorf("proto: unexpected end of group")
  735. )