local.pb.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: lib/discover/local.proto
  3. package discover
  4. import (
  5. fmt "fmt"
  6. _ "github.com/gogo/protobuf/gogoproto"
  7. proto "github.com/gogo/protobuf/proto"
  8. github_com_syncthing_syncthing_lib_protocol "github.com/syncthing/syncthing/lib/protocol"
  9. _ "github.com/syncthing/syncthing/proto/ext"
  10. io "io"
  11. math "math"
  12. math_bits "math/bits"
  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. // This is a compile-time assertion to ensure that this generated file
  19. // is compatible with the proto package it is being compiled against.
  20. // A compilation error at this line likely means your copy of the
  21. // proto package needs to be updated.
  22. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
  23. type Announce struct {
  24. ID github_com_syncthing_syncthing_lib_protocol.DeviceID `protobuf:"bytes,1,opt,name=id,proto3,customtype=github.com/syncthing/syncthing/lib/protocol.DeviceID" json:"id" xml:"id"`
  25. Addresses []string `protobuf:"bytes,2,rep,name=addresses,proto3" json:"addresses" xml:"address"`
  26. InstanceID int64 `protobuf:"varint,3,opt,name=instance_id,json=instanceId,proto3" json:"instanceId" xml:"instanceId"`
  27. }
  28. func (m *Announce) Reset() { *m = Announce{} }
  29. func (m *Announce) String() string { return proto.CompactTextString(m) }
  30. func (*Announce) ProtoMessage() {}
  31. func (*Announce) Descriptor() ([]byte, []int) {
  32. return fileDescriptor_18afca46562fdaf4, []int{0}
  33. }
  34. func (m *Announce) XXX_Unmarshal(b []byte) error {
  35. return m.Unmarshal(b)
  36. }
  37. func (m *Announce) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  38. if deterministic {
  39. return xxx_messageInfo_Announce.Marshal(b, m, deterministic)
  40. } else {
  41. b = b[:cap(b)]
  42. n, err := m.MarshalToSizedBuffer(b)
  43. if err != nil {
  44. return nil, err
  45. }
  46. return b[:n], nil
  47. }
  48. }
  49. func (m *Announce) XXX_Merge(src proto.Message) {
  50. xxx_messageInfo_Announce.Merge(m, src)
  51. }
  52. func (m *Announce) XXX_Size() int {
  53. return m.ProtoSize()
  54. }
  55. func (m *Announce) XXX_DiscardUnknown() {
  56. xxx_messageInfo_Announce.DiscardUnknown(m)
  57. }
  58. var xxx_messageInfo_Announce proto.InternalMessageInfo
  59. func init() {
  60. proto.RegisterType((*Announce)(nil), "discover.Announce")
  61. }
  62. func init() { proto.RegisterFile("lib/discover/local.proto", fileDescriptor_18afca46562fdaf4) }
  63. var fileDescriptor_18afca46562fdaf4 = []byte{
  64. // 334 bytes of a gzipped FileDescriptorProto
  65. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x31, 0x6b, 0xe3, 0x30,
  66. 0x18, 0x86, 0x2d, 0x05, 0x8e, 0x44, 0x77, 0x07, 0x87, 0x27, 0x93, 0x41, 0x0a, 0xbe, 0x0c, 0x81,
  67. 0x42, 0x3c, 0xb4, 0x53, 0x29, 0x85, 0x1a, 0x2f, 0x1e, 0xba, 0x64, 0xec, 0xd0, 0x10, 0x4b, 0xaa,
  68. 0x23, 0x70, 0xa4, 0x60, 0x39, 0x21, 0xfd, 0x07, 0x1d, 0x4b, 0xb6, 0x6e, 0xfd, 0x39, 0x19, 0x3d,
  69. 0x96, 0x0e, 0x82, 0xd8, 0x5b, 0xc6, 0xfc, 0x82, 0x12, 0x25, 0x69, 0x32, 0x76, 0x7b, 0xf5, 0xe8,
  70. 0x95, 0x78, 0xf8, 0x3e, 0xe4, 0x65, 0x22, 0x09, 0x98, 0xd0, 0x54, 0xcd, 0x79, 0x1e, 0x64, 0x8a,
  71. 0x8e, 0xb2, 0xfe, 0x34, 0x57, 0x85, 0x72, 0x9b, 0x47, 0xda, 0xfe, 0x9f, 0xf3, 0xa9, 0xd2, 0x81,
  72. 0xc5, 0xc9, 0xec, 0x29, 0x48, 0x55, 0xaa, 0xec, 0xc1, 0xa6, 0x7d, 0xbd, 0xdd, 0xe2, 0x8b, 0x62,
  73. 0x1f, 0xfd, 0x37, 0x88, 0x9a, 0x77, 0x52, 0xaa, 0x99, 0xa4, 0xdc, 0x95, 0x08, 0x0a, 0xe6, 0x81,
  74. 0x0e, 0xe8, 0xfd, 0x09, 0x1f, 0x57, 0x86, 0x38, 0x9f, 0x86, 0x5c, 0xa5, 0xa2, 0x18, 0xcf, 0x92,
  75. 0x3e, 0x55, 0x93, 0x40, 0x3f, 0x4b, 0x5a, 0x8c, 0x85, 0x4c, 0xcf, 0xd2, 0xce, 0xc9, 0x7e, 0x45,
  76. 0x55, 0xd6, 0x8f, 0xf8, 0x5c, 0x50, 0x1e, 0x47, 0x95, 0x21, 0x30, 0x8e, 0x36, 0x86, 0x40, 0xc1,
  77. 0xb6, 0x86, 0x34, 0x17, 0x93, 0xec, 0xda, 0x17, 0xcc, 0x7f, 0x29, 0xbb, 0x60, 0x59, 0x76, 0x61,
  78. 0x1c, 0x0d, 0xa0, 0x60, 0xee, 0x0d, 0x6a, 0x8d, 0x18, 0xcb, 0xb9, 0xd6, 0x5c, 0x7b, 0xb0, 0xd3,
  79. 0xe8, 0xb5, 0x42, 0xbc, 0x31, 0xe4, 0x04, 0xb7, 0x86, 0xfc, 0xb5, 0x6f, 0x0f, 0xc4, 0x1f, 0x9c,
  80. 0xee, 0xdc, 0x21, 0xfa, 0x2d, 0xa4, 0x2e, 0x46, 0x92, 0xf2, 0xa1, 0x60, 0x5e, 0xa3, 0x03, 0x7a,
  81. 0x8d, 0xf0, 0xb6, 0x32, 0x04, 0xc5, 0x07, 0x6c, 0x15, 0xd0, 0xb1, 0x14, 0xef, 0x54, 0xfe, 0xed,
  82. 0x55, 0xbe, 0x91, 0xbf, 0x2c, 0xbb, 0x67, 0xfd, 0xc1, 0x59, 0x3b, 0xbc, 0x5f, 0xad, 0xb1, 0x53,
  83. 0xae, 0xb1, 0xb3, 0xaa, 0x30, 0x28, 0x2b, 0x0c, 0x5e, 0x6b, 0xec, 0xbc, 0xd7, 0x18, 0x94, 0x35,
  84. 0x76, 0x3e, 0x6a, 0xec, 0x3c, 0x5c, 0xfc, 0x60, 0x38, 0xc7, 0xd5, 0x24, 0xbf, 0xec, 0x98, 0x2e,
  85. 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xdc, 0xe8, 0x9a, 0xd0, 0xc7, 0x01, 0x00, 0x00,
  86. }
  87. func (m *Announce) Marshal() (dAtA []byte, err error) {
  88. size := m.ProtoSize()
  89. dAtA = make([]byte, size)
  90. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  91. if err != nil {
  92. return nil, err
  93. }
  94. return dAtA[:n], nil
  95. }
  96. func (m *Announce) MarshalTo(dAtA []byte) (int, error) {
  97. size := m.ProtoSize()
  98. return m.MarshalToSizedBuffer(dAtA[:size])
  99. }
  100. func (m *Announce) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  101. i := len(dAtA)
  102. _ = i
  103. var l int
  104. _ = l
  105. if m.InstanceID != 0 {
  106. i = encodeVarintLocal(dAtA, i, uint64(m.InstanceID))
  107. i--
  108. dAtA[i] = 0x18
  109. }
  110. if len(m.Addresses) > 0 {
  111. for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- {
  112. i -= len(m.Addresses[iNdEx])
  113. copy(dAtA[i:], m.Addresses[iNdEx])
  114. i = encodeVarintLocal(dAtA, i, uint64(len(m.Addresses[iNdEx])))
  115. i--
  116. dAtA[i] = 0x12
  117. }
  118. }
  119. {
  120. size := m.ID.ProtoSize()
  121. i -= size
  122. if _, err := m.ID.MarshalTo(dAtA[i:]); err != nil {
  123. return 0, err
  124. }
  125. i = encodeVarintLocal(dAtA, i, uint64(size))
  126. }
  127. i--
  128. dAtA[i] = 0xa
  129. return len(dAtA) - i, nil
  130. }
  131. func encodeVarintLocal(dAtA []byte, offset int, v uint64) int {
  132. offset -= sovLocal(v)
  133. base := offset
  134. for v >= 1<<7 {
  135. dAtA[offset] = uint8(v&0x7f | 0x80)
  136. v >>= 7
  137. offset++
  138. }
  139. dAtA[offset] = uint8(v)
  140. return base
  141. }
  142. func (m *Announce) ProtoSize() (n int) {
  143. if m == nil {
  144. return 0
  145. }
  146. var l int
  147. _ = l
  148. l = m.ID.ProtoSize()
  149. n += 1 + l + sovLocal(uint64(l))
  150. if len(m.Addresses) > 0 {
  151. for _, s := range m.Addresses {
  152. l = len(s)
  153. n += 1 + l + sovLocal(uint64(l))
  154. }
  155. }
  156. if m.InstanceID != 0 {
  157. n += 1 + sovLocal(uint64(m.InstanceID))
  158. }
  159. return n
  160. }
  161. func sovLocal(x uint64) (n int) {
  162. return (math_bits.Len64(x|1) + 6) / 7
  163. }
  164. func sozLocal(x uint64) (n int) {
  165. return sovLocal(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  166. }
  167. func (m *Announce) Unmarshal(dAtA []byte) error {
  168. l := len(dAtA)
  169. iNdEx := 0
  170. for iNdEx < l {
  171. preIndex := iNdEx
  172. var wire uint64
  173. for shift := uint(0); ; shift += 7 {
  174. if shift >= 64 {
  175. return ErrIntOverflowLocal
  176. }
  177. if iNdEx >= l {
  178. return io.ErrUnexpectedEOF
  179. }
  180. b := dAtA[iNdEx]
  181. iNdEx++
  182. wire |= uint64(b&0x7F) << shift
  183. if b < 0x80 {
  184. break
  185. }
  186. }
  187. fieldNum := int32(wire >> 3)
  188. wireType := int(wire & 0x7)
  189. if wireType == 4 {
  190. return fmt.Errorf("proto: Announce: wiretype end group for non-group")
  191. }
  192. if fieldNum <= 0 {
  193. return fmt.Errorf("proto: Announce: illegal tag %d (wire type %d)", fieldNum, wire)
  194. }
  195. switch fieldNum {
  196. case 1:
  197. if wireType != 2 {
  198. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  199. }
  200. var byteLen int
  201. for shift := uint(0); ; shift += 7 {
  202. if shift >= 64 {
  203. return ErrIntOverflowLocal
  204. }
  205. if iNdEx >= l {
  206. return io.ErrUnexpectedEOF
  207. }
  208. b := dAtA[iNdEx]
  209. iNdEx++
  210. byteLen |= int(b&0x7F) << shift
  211. if b < 0x80 {
  212. break
  213. }
  214. }
  215. if byteLen < 0 {
  216. return ErrInvalidLengthLocal
  217. }
  218. postIndex := iNdEx + byteLen
  219. if postIndex < 0 {
  220. return ErrInvalidLengthLocal
  221. }
  222. if postIndex > l {
  223. return io.ErrUnexpectedEOF
  224. }
  225. if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  226. return err
  227. }
  228. iNdEx = postIndex
  229. case 2:
  230. if wireType != 2 {
  231. return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType)
  232. }
  233. var stringLen uint64
  234. for shift := uint(0); ; shift += 7 {
  235. if shift >= 64 {
  236. return ErrIntOverflowLocal
  237. }
  238. if iNdEx >= l {
  239. return io.ErrUnexpectedEOF
  240. }
  241. b := dAtA[iNdEx]
  242. iNdEx++
  243. stringLen |= uint64(b&0x7F) << shift
  244. if b < 0x80 {
  245. break
  246. }
  247. }
  248. intStringLen := int(stringLen)
  249. if intStringLen < 0 {
  250. return ErrInvalidLengthLocal
  251. }
  252. postIndex := iNdEx + intStringLen
  253. if postIndex < 0 {
  254. return ErrInvalidLengthLocal
  255. }
  256. if postIndex > l {
  257. return io.ErrUnexpectedEOF
  258. }
  259. m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex]))
  260. iNdEx = postIndex
  261. case 3:
  262. if wireType != 0 {
  263. return fmt.Errorf("proto: wrong wireType = %d for field InstanceID", wireType)
  264. }
  265. m.InstanceID = 0
  266. for shift := uint(0); ; shift += 7 {
  267. if shift >= 64 {
  268. return ErrIntOverflowLocal
  269. }
  270. if iNdEx >= l {
  271. return io.ErrUnexpectedEOF
  272. }
  273. b := dAtA[iNdEx]
  274. iNdEx++
  275. m.InstanceID |= int64(b&0x7F) << shift
  276. if b < 0x80 {
  277. break
  278. }
  279. }
  280. default:
  281. iNdEx = preIndex
  282. skippy, err := skipLocal(dAtA[iNdEx:])
  283. if err != nil {
  284. return err
  285. }
  286. if skippy < 0 {
  287. return ErrInvalidLengthLocal
  288. }
  289. if (iNdEx + skippy) < 0 {
  290. return ErrInvalidLengthLocal
  291. }
  292. if (iNdEx + skippy) > l {
  293. return io.ErrUnexpectedEOF
  294. }
  295. iNdEx += skippy
  296. }
  297. }
  298. if iNdEx > l {
  299. return io.ErrUnexpectedEOF
  300. }
  301. return nil
  302. }
  303. func skipLocal(dAtA []byte) (n int, err error) {
  304. l := len(dAtA)
  305. iNdEx := 0
  306. depth := 0
  307. for iNdEx < l {
  308. var wire uint64
  309. for shift := uint(0); ; shift += 7 {
  310. if shift >= 64 {
  311. return 0, ErrIntOverflowLocal
  312. }
  313. if iNdEx >= l {
  314. return 0, io.ErrUnexpectedEOF
  315. }
  316. b := dAtA[iNdEx]
  317. iNdEx++
  318. wire |= (uint64(b) & 0x7F) << shift
  319. if b < 0x80 {
  320. break
  321. }
  322. }
  323. wireType := int(wire & 0x7)
  324. switch wireType {
  325. case 0:
  326. for shift := uint(0); ; shift += 7 {
  327. if shift >= 64 {
  328. return 0, ErrIntOverflowLocal
  329. }
  330. if iNdEx >= l {
  331. return 0, io.ErrUnexpectedEOF
  332. }
  333. iNdEx++
  334. if dAtA[iNdEx-1] < 0x80 {
  335. break
  336. }
  337. }
  338. case 1:
  339. iNdEx += 8
  340. case 2:
  341. var length int
  342. for shift := uint(0); ; shift += 7 {
  343. if shift >= 64 {
  344. return 0, ErrIntOverflowLocal
  345. }
  346. if iNdEx >= l {
  347. return 0, io.ErrUnexpectedEOF
  348. }
  349. b := dAtA[iNdEx]
  350. iNdEx++
  351. length |= (int(b) & 0x7F) << shift
  352. if b < 0x80 {
  353. break
  354. }
  355. }
  356. if length < 0 {
  357. return 0, ErrInvalidLengthLocal
  358. }
  359. iNdEx += length
  360. case 3:
  361. depth++
  362. case 4:
  363. if depth == 0 {
  364. return 0, ErrUnexpectedEndOfGroupLocal
  365. }
  366. depth--
  367. case 5:
  368. iNdEx += 4
  369. default:
  370. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  371. }
  372. if iNdEx < 0 {
  373. return 0, ErrInvalidLengthLocal
  374. }
  375. if depth == 0 {
  376. return iNdEx, nil
  377. }
  378. }
  379. return 0, io.ErrUnexpectedEOF
  380. }
  381. var (
  382. ErrInvalidLengthLocal = fmt.Errorf("proto: negative length found during unmarshaling")
  383. ErrIntOverflowLocal = fmt.Errorf("proto: integer overflow")
  384. ErrUnexpectedEndOfGroupLocal = fmt.Errorf("proto: unexpected end of group")
  385. )