deviceconfiguration.pb.go 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: lib/config/deviceconfiguration.proto
  3. package config
  4. import (
  5. fmt "fmt"
  6. proto "github.com/gogo/protobuf/proto"
  7. github_com_syncthing_syncthing_lib_protocol "github.com/syncthing/syncthing/lib/protocol"
  8. 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 DeviceConfiguration struct {
  24. DeviceID github_com_syncthing_syncthing_lib_protocol.DeviceID `protobuf:"bytes,1,opt,name=device_id,json=deviceId,proto3,customtype=github.com/syncthing/syncthing/lib/protocol.DeviceID" json:"deviceID" xml:"id,attr"`
  25. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name" xml:"name,attr,omitempty"`
  26. Addresses []string `protobuf:"bytes,3,rep,name=addresses,proto3" json:"addresses" xml:"address,omitempty" default:"dynamic"`
  27. Compression protocol.Compression `protobuf:"varint,4,opt,name=compression,proto3,enum=protocol.Compression" json:"compression" xml:"compression,attr"`
  28. CertName string `protobuf:"bytes,5,opt,name=cert_name,json=certName,proto3" json:"certName" xml:"certName,attr,omitempty"`
  29. Introducer bool `protobuf:"varint,6,opt,name=introducer,proto3" json:"introducer" xml:"introducer,attr"`
  30. SkipIntroductionRemovals bool `protobuf:"varint,7,opt,name=skip_introduction_removals,json=skipIntroductionRemovals,proto3" json:"skipIntroductionRemovals" xml:"skipIntroductionRemovals,attr"`
  31. IntroducedBy github_com_syncthing_syncthing_lib_protocol.DeviceID `protobuf:"bytes,8,opt,name=introduced_by,json=introducedBy,proto3,customtype=github.com/syncthing/syncthing/lib/protocol.DeviceID" json:"introducedBy" xml:"introducedBy,attr"`
  32. Paused bool `protobuf:"varint,9,opt,name=paused,proto3" json:"paused" xml:"paused"`
  33. AllowedNetworks []string `protobuf:"bytes,10,rep,name=allowed_networks,json=allowedNetworks,proto3" json:"allowedNetworks" xml:"allowedNetwork,omitempty"`
  34. AutoAcceptFolders bool `protobuf:"varint,11,opt,name=auto_accept_folders,json=autoAcceptFolders,proto3" json:"autoAcceptFolders" xml:"autoAcceptFolders"`
  35. MaxSendKbps int `protobuf:"varint,12,opt,name=max_send_kbps,json=maxSendKbps,proto3,casttype=int" json:"maxSendKbps" xml:"maxSendKbps"`
  36. MaxRecvKbps int `protobuf:"varint,13,opt,name=max_recv_kbps,json=maxRecvKbps,proto3,casttype=int" json:"maxRecvKbps" xml:"maxRecvKbps"`
  37. IgnoredFolders []ObservedFolder `protobuf:"bytes,14,rep,name=ignored_folders,json=ignoredFolders,proto3" json:"ignoredFolders" xml:"ignoredFolder"`
  38. PendingFolders []ObservedFolder `protobuf:"bytes,15,rep,name=pending_folders,json=pendingFolders,proto3" json:"pendingFolders" xml:"pendingFolder"`
  39. MaxRequestKiB int `protobuf:"varint,16,opt,name=max_request_kib,json=maxRequestKib,proto3,casttype=int" json:"maxRequestKiB" xml:"maxRequestKiB"`
  40. }
  41. func (m *DeviceConfiguration) Reset() { *m = DeviceConfiguration{} }
  42. func (m *DeviceConfiguration) String() string { return proto.CompactTextString(m) }
  43. func (*DeviceConfiguration) ProtoMessage() {}
  44. func (*DeviceConfiguration) Descriptor() ([]byte, []int) {
  45. return fileDescriptor_744b782bd13071dd, []int{0}
  46. }
  47. func (m *DeviceConfiguration) XXX_Unmarshal(b []byte) error {
  48. return m.Unmarshal(b)
  49. }
  50. func (m *DeviceConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  51. if deterministic {
  52. return xxx_messageInfo_DeviceConfiguration.Marshal(b, m, deterministic)
  53. } else {
  54. b = b[:cap(b)]
  55. n, err := m.MarshalToSizedBuffer(b)
  56. if err != nil {
  57. return nil, err
  58. }
  59. return b[:n], nil
  60. }
  61. }
  62. func (m *DeviceConfiguration) XXX_Merge(src proto.Message) {
  63. xxx_messageInfo_DeviceConfiguration.Merge(m, src)
  64. }
  65. func (m *DeviceConfiguration) XXX_Size() int {
  66. return m.ProtoSize()
  67. }
  68. func (m *DeviceConfiguration) XXX_DiscardUnknown() {
  69. xxx_messageInfo_DeviceConfiguration.DiscardUnknown(m)
  70. }
  71. var xxx_messageInfo_DeviceConfiguration proto.InternalMessageInfo
  72. func init() {
  73. proto.RegisterType((*DeviceConfiguration)(nil), "config.DeviceConfiguration")
  74. }
  75. func init() {
  76. proto.RegisterFile("lib/config/deviceconfiguration.proto", fileDescriptor_744b782bd13071dd)
  77. }
  78. var fileDescriptor_744b782bd13071dd = []byte{
  79. // 902 bytes of a gzipped FileDescriptorProto
  80. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x31, 0x6f, 0xdb, 0x46,
  81. 0x18, 0x15, 0xeb, 0xc4, 0xb6, 0xce, 0x96, 0x65, 0xd3, 0x88, 0xc3, 0x18, 0x88, 0x4e, 0x60, 0x35,
  82. 0x28, 0x68, 0x2a, 0x17, 0x6e, 0x27, 0xa3, 0x1d, 0xca, 0x04, 0x45, 0x03, 0xa3, 0x49, 0x7b, 0xdd,
  83. 0xbc, 0xb0, 0x24, 0xef, 0xac, 0x1c, 0x2c, 0xf2, 0x58, 0xf2, 0xa4, 0x48, 0x40, 0x87, 0x8e, 0x1d,
  84. 0x3a, 0x14, 0x59, 0xbb, 0x14, 0x1d, 0x3a, 0xf4, 0x97, 0x18, 0xe8, 0x60, 0x8d, 0x45, 0x87, 0x03,
  85. 0x62, 0x6f, 0x1c, 0x39, 0x66, 0x2a, 0x78, 0x47, 0x51, 0x24, 0x1d, 0x17, 0x06, 0xba, 0xdd, 0xbd,
  86. 0xf7, 0xee, 0xbd, 0xe3, 0xd3, 0x7d, 0x10, 0xe8, 0x8d, 0xa8, 0x7b, 0xe0, 0xb1, 0xe0, 0x94, 0x0e,
  87. 0x0f, 0x30, 0x99, 0x50, 0x8f, 0xa8, 0xcd, 0x38, 0x72, 0x38, 0x65, 0xc1, 0x20, 0x8c, 0x18, 0x67,
  88. 0xfa, 0xaa, 0x02, 0xf7, 0xf7, 0x32, 0xb5, 0x84, 0x3c, 0x36, 0x3a, 0x70, 0x49, 0xa8, 0xf8, 0xfd,
  89. 0x07, 0x25, 0x17, 0xe6, 0xc6, 0x24, 0x9a, 0x10, 0x9c, 0x53, 0x4d, 0x32, 0xe5, 0x6a, 0x69, 0xfe,
  90. 0xb5, 0x05, 0x76, 0x9f, 0xca, 0x8c, 0x27, 0xe5, 0x0c, 0xfd, 0x4f, 0x0d, 0x34, 0x55, 0xb6, 0x4d,
  91. 0xb1, 0xa1, 0x75, 0xb5, 0xfe, 0xa6, 0xf5, 0xb3, 0x76, 0x2e, 0x60, 0xe3, 0x1f, 0x01, 0x3f, 0x19,
  92. 0x52, 0xfe, 0x72, 0xec, 0x0e, 0x3c, 0xe6, 0x1f, 0xc4, 0xb3, 0xc0, 0xe3, 0x2f, 0x69, 0x30, 0x2c,
  93. 0xad, 0xca, 0x37, 0x1a, 0x28, 0xf7, 0x67, 0x4f, 0x2f, 0x05, 0x5c, 0x5f, 0xac, 0x13, 0x01, 0xd7,
  94. 0x71, 0xbe, 0x4e, 0x05, 0x6c, 0x4d, 0xfd, 0xd1, 0x91, 0x49, 0xf1, 0x63, 0x87, 0xf3, 0xc8, 0x4c,
  95. 0x2e, 0x7a, 0x6b, 0xf9, 0x3a, 0xbd, 0xe8, 0x15, 0xba, 0x9f, 0xe6, 0x3d, 0xed, 0xf5, 0xbc, 0x57,
  96. 0x78, 0xa0, 0x05, 0x83, 0xf5, 0xaf, 0xc1, 0x9d, 0xc0, 0xf1, 0x89, 0xf1, 0x5e, 0x57, 0xeb, 0x37,
  97. 0xad, 0x4f, 0x13, 0x01, 0xe5, 0x3e, 0x15, 0xf0, 0x81, 0x74, 0xce, 0x36, 0xd2, 0xef, 0x31, 0xf3,
  98. 0x29, 0x27, 0x7e, 0xc8, 0x67, 0x59, 0xca, 0xee, 0x3b, 0x70, 0x24, 0x4f, 0xea, 0x53, 0xd0, 0x74,
  99. 0x30, 0x8e, 0x48, 0x1c, 0x93, 0xd8, 0x58, 0xe9, 0xae, 0xf4, 0x9b, 0xd6, 0x49, 0x22, 0xe0, 0x12,
  100. 0x4c, 0x05, 0x7c, 0x24, 0xbd, 0x73, 0xa4, 0xe4, 0xdc, 0xc5, 0xe4, 0xd4, 0x19, 0x8f, 0xf8, 0x91,
  101. 0x89, 0x67, 0x81, 0xe3, 0x53, 0x2f, 0xcb, 0xda, 0xb9, 0xa6, 0x7b, 0x7b, 0xd1, 0x5b, 0xcb, 0x05,
  102. 0x68, 0xe9, 0xab, 0x4f, 0xc0, 0x86, 0xc7, 0xfc, 0x30, 0xdb, 0x51, 0x16, 0x18, 0x77, 0xba, 0x5a,
  103. 0x7f, 0xeb, 0xf0, 0xde, 0xa0, 0xa8, 0xf3, 0xc9, 0x92, 0xb4, 0x3e, 0x4b, 0x04, 0x2c, 0xab, 0x53,
  104. 0x01, 0xf7, 0xe4, 0xa5, 0x4a, 0x58, 0xd1, 0xe9, 0x76, 0x1d, 0x44, 0xe5, 0xa3, 0x3a, 0x01, 0x4d,
  105. 0x8f, 0x44, 0xdc, 0x96, 0x45, 0xde, 0x95, 0x45, 0x7e, 0x99, 0xfd, 0x4c, 0x19, 0xf8, 0x5c, 0x95,
  106. 0xf9, 0x50, 0x79, 0xe7, 0xc0, 0x3b, 0x0a, 0xbd, 0x7f, 0x03, 0x87, 0x0a, 0x17, 0xfd, 0x04, 0x00,
  107. 0x1a, 0xf0, 0x88, 0xe1, 0xb1, 0x47, 0x22, 0x63, 0xb5, 0xab, 0xf5, 0xd7, 0xad, 0xa3, 0x44, 0xc0,
  108. 0x12, 0x9a, 0x0a, 0x78, 0x4f, 0x3d, 0x88, 0x02, 0x2a, 0x3e, 0xa2, 0x5d, 0xc3, 0x50, 0xe9, 0x9c,
  109. 0xfe, 0xbb, 0x06, 0xf6, 0xe3, 0x33, 0x1a, 0xda, 0x0b, 0x2c, 0x7b, 0xc9, 0x76, 0x44, 0x7c, 0x36,
  110. 0x71, 0x46, 0xb1, 0xb1, 0x26, 0xc3, 0x70, 0x22, 0xa0, 0x91, 0xa9, 0x9e, 0x95, 0x44, 0x28, 0xd7,
  111. 0xa4, 0x02, 0xbe, 0x2f, 0xa3, 0x6f, 0x12, 0x14, 0x17, 0x79, 0xf8, 0x9f, 0x0a, 0x74, 0x63, 0x82,
  112. 0xfe, 0x87, 0x06, 0x5a, 0xc5, 0x9d, 0xb1, 0xed, 0xce, 0x8c, 0x75, 0x39, 0x5c, 0x3f, 0xfe, 0xaf,
  113. 0xe1, 0x4a, 0x04, 0xdc, 0x5c, 0xba, 0x5a, 0xb3, 0x54, 0xc0, 0xfb, 0xd5, 0x0e, 0xb1, 0x35, 0x2b,
  114. 0x2e, 0xbf, 0x73, 0x0d, 0xcd, 0x86, 0x0b, 0x55, 0x1c, 0xf4, 0x43, 0xb0, 0x1a, 0x3a, 0xe3, 0x98,
  115. 0x60, 0xa3, 0x29, 0x8b, 0xdb, 0x4f, 0x04, 0xcc, 0x91, 0x54, 0xc0, 0x4d, 0xe9, 0xae, 0xb6, 0x26,
  116. 0xca, 0x71, 0xfd, 0x07, 0xb0, 0xed, 0x8c, 0x46, 0xec, 0x15, 0xc1, 0x76, 0x40, 0xf8, 0x2b, 0x16,
  117. 0x9d, 0xc5, 0x06, 0x90, 0xd3, 0xf3, 0x4d, 0x22, 0x60, 0x3b, 0xe7, 0x9e, 0xe7, 0x54, 0x2a, 0x60,
  118. 0x47, 0xcd, 0x50, 0x05, 0xaf, 0xbe, 0x29, 0xe3, 0x26, 0x12, 0xd5, 0xed, 0xf4, 0xef, 0xc0, 0xae,
  119. 0x33, 0xe6, 0xcc, 0x76, 0x3c, 0x8f, 0x84, 0xdc, 0x3e, 0x65, 0x23, 0x4c, 0xa2, 0xd8, 0xd8, 0x90,
  120. 0xd7, 0xff, 0x28, 0x11, 0x70, 0x27, 0xa3, 0x3f, 0x97, 0xec, 0x17, 0x8a, 0x2c, 0x7a, 0xba, 0xc6,
  121. 0x98, 0xe8, 0xba, 0x5a, 0x7f, 0x01, 0x5a, 0xbe, 0x33, 0xb5, 0x63, 0x12, 0x60, 0xfb, 0xcc, 0x0d,
  122. 0x63, 0x63, 0xb3, 0xab, 0xf5, 0xef, 0x5a, 0x1f, 0x64, 0x73, 0xe8, 0x3b, 0xd3, 0x6f, 0x49, 0x80,
  123. 0x8f, 0xdd, 0x30, 0x73, 0xdd, 0x91, 0xae, 0x25, 0xcc, 0x7c, 0x2b, 0xe0, 0x0a, 0x0d, 0x38, 0x2a,
  124. 0x0b, 0x17, 0x86, 0x11, 0xf1, 0x26, 0xca, 0xb0, 0x55, 0x31, 0x44, 0xc4, 0x9b, 0xd4, 0x0d, 0x17,
  125. 0x58, 0xc5, 0x70, 0x01, 0xea, 0x01, 0x68, 0xd3, 0x61, 0xc0, 0x22, 0x82, 0x8b, 0xef, 0xdf, 0xea,
  126. 0xae, 0xf4, 0x37, 0x0e, 0xf7, 0x06, 0xea, 0xbf, 0x60, 0xf0, 0x22, 0xff, 0x2f, 0x50, 0xdf, 0x64,
  127. 0x7d, 0x98, 0x3d, 0xbb, 0x44, 0xc0, 0xad, 0xfc, 0xd8, 0xb2, 0x98, 0x5d, 0xf5, 0x80, 0xca, 0xb0,
  128. 0x89, 0x6a, 0xb2, 0x2c, 0x2f, 0x24, 0x01, 0xa6, 0xc1, 0xb0, 0xc8, 0x6b, 0xdf, 0x2e, 0x2f, 0x3f,
  129. 0x56, 0xcf, 0xab, 0xc0, 0x26, 0xaa, 0xc9, 0xf4, 0x5f, 0x35, 0xd0, 0x56, 0x8d, 0x7d, 0x3f, 0x26,
  130. 0x31, 0xb7, 0xcf, 0xa8, 0x6b, 0x6c, 0xcb, 0xce, 0xe2, 0x4b, 0x01, 0x5b, 0x5f, 0x65, 0x55, 0x48,
  131. 0xe6, 0x98, 0x5a, 0x89, 0x80, 0x2d, 0xbf, 0x0c, 0x14, 0x21, 0x15, 0x74, 0x51, 0x64, 0x72, 0xd1,
  132. 0xab, 0xc9, 0xeb, 0xc0, 0xeb, 0x79, 0xaf, 0x9a, 0x80, 0x2a, 0xbc, 0x6b, 0x1d, 0x9f, 0xbf, 0xe9,
  133. 0x34, 0xe6, 0x6f, 0x3a, 0x8d, 0xf3, 0xcb, 0x8e, 0x36, 0xbf, 0xec, 0x68, 0xbf, 0x5c, 0x75, 0x1a,
  134. 0xbf, 0x5d, 0x75, 0xb4, 0xf9, 0x55, 0xa7, 0xf1, 0xf7, 0x55, 0xa7, 0x71, 0xf2, 0xe8, 0x16, 0xd3,
  135. 0xad, 0x8a, 0x73, 0x57, 0xe5, 0x94, 0x7f, 0xfc, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xda, 0x35,
  136. 0x78, 0xb9, 0x0f, 0x08, 0x00, 0x00,
  137. }
  138. func (m *DeviceConfiguration) Marshal() (dAtA []byte, err error) {
  139. size := m.ProtoSize()
  140. dAtA = make([]byte, size)
  141. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  142. if err != nil {
  143. return nil, err
  144. }
  145. return dAtA[:n], nil
  146. }
  147. func (m *DeviceConfiguration) MarshalTo(dAtA []byte) (int, error) {
  148. size := m.ProtoSize()
  149. return m.MarshalToSizedBuffer(dAtA[:size])
  150. }
  151. func (m *DeviceConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  152. i := len(dAtA)
  153. _ = i
  154. var l int
  155. _ = l
  156. if m.MaxRequestKiB != 0 {
  157. i = encodeVarintDeviceconfiguration(dAtA, i, uint64(m.MaxRequestKiB))
  158. i--
  159. dAtA[i] = 0x1
  160. i--
  161. dAtA[i] = 0x80
  162. }
  163. if len(m.PendingFolders) > 0 {
  164. for iNdEx := len(m.PendingFolders) - 1; iNdEx >= 0; iNdEx-- {
  165. {
  166. size, err := m.PendingFolders[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  167. if err != nil {
  168. return 0, err
  169. }
  170. i -= size
  171. i = encodeVarintDeviceconfiguration(dAtA, i, uint64(size))
  172. }
  173. i--
  174. dAtA[i] = 0x7a
  175. }
  176. }
  177. if len(m.IgnoredFolders) > 0 {
  178. for iNdEx := len(m.IgnoredFolders) - 1; iNdEx >= 0; iNdEx-- {
  179. {
  180. size, err := m.IgnoredFolders[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  181. if err != nil {
  182. return 0, err
  183. }
  184. i -= size
  185. i = encodeVarintDeviceconfiguration(dAtA, i, uint64(size))
  186. }
  187. i--
  188. dAtA[i] = 0x72
  189. }
  190. }
  191. if m.MaxRecvKbps != 0 {
  192. i = encodeVarintDeviceconfiguration(dAtA, i, uint64(m.MaxRecvKbps))
  193. i--
  194. dAtA[i] = 0x68
  195. }
  196. if m.MaxSendKbps != 0 {
  197. i = encodeVarintDeviceconfiguration(dAtA, i, uint64(m.MaxSendKbps))
  198. i--
  199. dAtA[i] = 0x60
  200. }
  201. if m.AutoAcceptFolders {
  202. i--
  203. if m.AutoAcceptFolders {
  204. dAtA[i] = 1
  205. } else {
  206. dAtA[i] = 0
  207. }
  208. i--
  209. dAtA[i] = 0x58
  210. }
  211. if len(m.AllowedNetworks) > 0 {
  212. for iNdEx := len(m.AllowedNetworks) - 1; iNdEx >= 0; iNdEx-- {
  213. i -= len(m.AllowedNetworks[iNdEx])
  214. copy(dAtA[i:], m.AllowedNetworks[iNdEx])
  215. i = encodeVarintDeviceconfiguration(dAtA, i, uint64(len(m.AllowedNetworks[iNdEx])))
  216. i--
  217. dAtA[i] = 0x52
  218. }
  219. }
  220. if m.Paused {
  221. i--
  222. if m.Paused {
  223. dAtA[i] = 1
  224. } else {
  225. dAtA[i] = 0
  226. }
  227. i--
  228. dAtA[i] = 0x48
  229. }
  230. {
  231. size := m.IntroducedBy.ProtoSize()
  232. i -= size
  233. if _, err := m.IntroducedBy.MarshalTo(dAtA[i:]); err != nil {
  234. return 0, err
  235. }
  236. i = encodeVarintDeviceconfiguration(dAtA, i, uint64(size))
  237. }
  238. i--
  239. dAtA[i] = 0x42
  240. if m.SkipIntroductionRemovals {
  241. i--
  242. if m.SkipIntroductionRemovals {
  243. dAtA[i] = 1
  244. } else {
  245. dAtA[i] = 0
  246. }
  247. i--
  248. dAtA[i] = 0x38
  249. }
  250. if m.Introducer {
  251. i--
  252. if m.Introducer {
  253. dAtA[i] = 1
  254. } else {
  255. dAtA[i] = 0
  256. }
  257. i--
  258. dAtA[i] = 0x30
  259. }
  260. if len(m.CertName) > 0 {
  261. i -= len(m.CertName)
  262. copy(dAtA[i:], m.CertName)
  263. i = encodeVarintDeviceconfiguration(dAtA, i, uint64(len(m.CertName)))
  264. i--
  265. dAtA[i] = 0x2a
  266. }
  267. if m.Compression != 0 {
  268. i = encodeVarintDeviceconfiguration(dAtA, i, uint64(m.Compression))
  269. i--
  270. dAtA[i] = 0x20
  271. }
  272. if len(m.Addresses) > 0 {
  273. for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- {
  274. i -= len(m.Addresses[iNdEx])
  275. copy(dAtA[i:], m.Addresses[iNdEx])
  276. i = encodeVarintDeviceconfiguration(dAtA, i, uint64(len(m.Addresses[iNdEx])))
  277. i--
  278. dAtA[i] = 0x1a
  279. }
  280. }
  281. if len(m.Name) > 0 {
  282. i -= len(m.Name)
  283. copy(dAtA[i:], m.Name)
  284. i = encodeVarintDeviceconfiguration(dAtA, i, uint64(len(m.Name)))
  285. i--
  286. dAtA[i] = 0x12
  287. }
  288. {
  289. size := m.DeviceID.ProtoSize()
  290. i -= size
  291. if _, err := m.DeviceID.MarshalTo(dAtA[i:]); err != nil {
  292. return 0, err
  293. }
  294. i = encodeVarintDeviceconfiguration(dAtA, i, uint64(size))
  295. }
  296. i--
  297. dAtA[i] = 0xa
  298. return len(dAtA) - i, nil
  299. }
  300. func encodeVarintDeviceconfiguration(dAtA []byte, offset int, v uint64) int {
  301. offset -= sovDeviceconfiguration(v)
  302. base := offset
  303. for v >= 1<<7 {
  304. dAtA[offset] = uint8(v&0x7f | 0x80)
  305. v >>= 7
  306. offset++
  307. }
  308. dAtA[offset] = uint8(v)
  309. return base
  310. }
  311. func (m *DeviceConfiguration) ProtoSize() (n int) {
  312. if m == nil {
  313. return 0
  314. }
  315. var l int
  316. _ = l
  317. l = m.DeviceID.ProtoSize()
  318. n += 1 + l + sovDeviceconfiguration(uint64(l))
  319. l = len(m.Name)
  320. if l > 0 {
  321. n += 1 + l + sovDeviceconfiguration(uint64(l))
  322. }
  323. if len(m.Addresses) > 0 {
  324. for _, s := range m.Addresses {
  325. l = len(s)
  326. n += 1 + l + sovDeviceconfiguration(uint64(l))
  327. }
  328. }
  329. if m.Compression != 0 {
  330. n += 1 + sovDeviceconfiguration(uint64(m.Compression))
  331. }
  332. l = len(m.CertName)
  333. if l > 0 {
  334. n += 1 + l + sovDeviceconfiguration(uint64(l))
  335. }
  336. if m.Introducer {
  337. n += 2
  338. }
  339. if m.SkipIntroductionRemovals {
  340. n += 2
  341. }
  342. l = m.IntroducedBy.ProtoSize()
  343. n += 1 + l + sovDeviceconfiguration(uint64(l))
  344. if m.Paused {
  345. n += 2
  346. }
  347. if len(m.AllowedNetworks) > 0 {
  348. for _, s := range m.AllowedNetworks {
  349. l = len(s)
  350. n += 1 + l + sovDeviceconfiguration(uint64(l))
  351. }
  352. }
  353. if m.AutoAcceptFolders {
  354. n += 2
  355. }
  356. if m.MaxSendKbps != 0 {
  357. n += 1 + sovDeviceconfiguration(uint64(m.MaxSendKbps))
  358. }
  359. if m.MaxRecvKbps != 0 {
  360. n += 1 + sovDeviceconfiguration(uint64(m.MaxRecvKbps))
  361. }
  362. if len(m.IgnoredFolders) > 0 {
  363. for _, e := range m.IgnoredFolders {
  364. l = e.ProtoSize()
  365. n += 1 + l + sovDeviceconfiguration(uint64(l))
  366. }
  367. }
  368. if len(m.PendingFolders) > 0 {
  369. for _, e := range m.PendingFolders {
  370. l = e.ProtoSize()
  371. n += 1 + l + sovDeviceconfiguration(uint64(l))
  372. }
  373. }
  374. if m.MaxRequestKiB != 0 {
  375. n += 2 + sovDeviceconfiguration(uint64(m.MaxRequestKiB))
  376. }
  377. return n
  378. }
  379. func sovDeviceconfiguration(x uint64) (n int) {
  380. return (math_bits.Len64(x|1) + 6) / 7
  381. }
  382. func sozDeviceconfiguration(x uint64) (n int) {
  383. return sovDeviceconfiguration(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  384. }
  385. func (m *DeviceConfiguration) Unmarshal(dAtA []byte) error {
  386. l := len(dAtA)
  387. iNdEx := 0
  388. for iNdEx < l {
  389. preIndex := iNdEx
  390. var wire uint64
  391. for shift := uint(0); ; shift += 7 {
  392. if shift >= 64 {
  393. return ErrIntOverflowDeviceconfiguration
  394. }
  395. if iNdEx >= l {
  396. return io.ErrUnexpectedEOF
  397. }
  398. b := dAtA[iNdEx]
  399. iNdEx++
  400. wire |= uint64(b&0x7F) << shift
  401. if b < 0x80 {
  402. break
  403. }
  404. }
  405. fieldNum := int32(wire >> 3)
  406. wireType := int(wire & 0x7)
  407. if wireType == 4 {
  408. return fmt.Errorf("proto: DeviceConfiguration: wiretype end group for non-group")
  409. }
  410. if fieldNum <= 0 {
  411. return fmt.Errorf("proto: DeviceConfiguration: illegal tag %d (wire type %d)", fieldNum, wire)
  412. }
  413. switch fieldNum {
  414. case 1:
  415. if wireType != 2 {
  416. return fmt.Errorf("proto: wrong wireType = %d for field DeviceID", wireType)
  417. }
  418. var byteLen int
  419. for shift := uint(0); ; shift += 7 {
  420. if shift >= 64 {
  421. return ErrIntOverflowDeviceconfiguration
  422. }
  423. if iNdEx >= l {
  424. return io.ErrUnexpectedEOF
  425. }
  426. b := dAtA[iNdEx]
  427. iNdEx++
  428. byteLen |= int(b&0x7F) << shift
  429. if b < 0x80 {
  430. break
  431. }
  432. }
  433. if byteLen < 0 {
  434. return ErrInvalidLengthDeviceconfiguration
  435. }
  436. postIndex := iNdEx + byteLen
  437. if postIndex < 0 {
  438. return ErrInvalidLengthDeviceconfiguration
  439. }
  440. if postIndex > l {
  441. return io.ErrUnexpectedEOF
  442. }
  443. if err := m.DeviceID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  444. return err
  445. }
  446. iNdEx = postIndex
  447. case 2:
  448. if wireType != 2 {
  449. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  450. }
  451. var stringLen uint64
  452. for shift := uint(0); ; shift += 7 {
  453. if shift >= 64 {
  454. return ErrIntOverflowDeviceconfiguration
  455. }
  456. if iNdEx >= l {
  457. return io.ErrUnexpectedEOF
  458. }
  459. b := dAtA[iNdEx]
  460. iNdEx++
  461. stringLen |= uint64(b&0x7F) << shift
  462. if b < 0x80 {
  463. break
  464. }
  465. }
  466. intStringLen := int(stringLen)
  467. if intStringLen < 0 {
  468. return ErrInvalidLengthDeviceconfiguration
  469. }
  470. postIndex := iNdEx + intStringLen
  471. if postIndex < 0 {
  472. return ErrInvalidLengthDeviceconfiguration
  473. }
  474. if postIndex > l {
  475. return io.ErrUnexpectedEOF
  476. }
  477. m.Name = string(dAtA[iNdEx:postIndex])
  478. iNdEx = postIndex
  479. case 3:
  480. if wireType != 2 {
  481. return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType)
  482. }
  483. var stringLen uint64
  484. for shift := uint(0); ; shift += 7 {
  485. if shift >= 64 {
  486. return ErrIntOverflowDeviceconfiguration
  487. }
  488. if iNdEx >= l {
  489. return io.ErrUnexpectedEOF
  490. }
  491. b := dAtA[iNdEx]
  492. iNdEx++
  493. stringLen |= uint64(b&0x7F) << shift
  494. if b < 0x80 {
  495. break
  496. }
  497. }
  498. intStringLen := int(stringLen)
  499. if intStringLen < 0 {
  500. return ErrInvalidLengthDeviceconfiguration
  501. }
  502. postIndex := iNdEx + intStringLen
  503. if postIndex < 0 {
  504. return ErrInvalidLengthDeviceconfiguration
  505. }
  506. if postIndex > l {
  507. return io.ErrUnexpectedEOF
  508. }
  509. m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex]))
  510. iNdEx = postIndex
  511. case 4:
  512. if wireType != 0 {
  513. return fmt.Errorf("proto: wrong wireType = %d for field Compression", wireType)
  514. }
  515. m.Compression = 0
  516. for shift := uint(0); ; shift += 7 {
  517. if shift >= 64 {
  518. return ErrIntOverflowDeviceconfiguration
  519. }
  520. if iNdEx >= l {
  521. return io.ErrUnexpectedEOF
  522. }
  523. b := dAtA[iNdEx]
  524. iNdEx++
  525. m.Compression |= protocol.Compression(b&0x7F) << shift
  526. if b < 0x80 {
  527. break
  528. }
  529. }
  530. case 5:
  531. if wireType != 2 {
  532. return fmt.Errorf("proto: wrong wireType = %d for field CertName", wireType)
  533. }
  534. var stringLen uint64
  535. for shift := uint(0); ; shift += 7 {
  536. if shift >= 64 {
  537. return ErrIntOverflowDeviceconfiguration
  538. }
  539. if iNdEx >= l {
  540. return io.ErrUnexpectedEOF
  541. }
  542. b := dAtA[iNdEx]
  543. iNdEx++
  544. stringLen |= uint64(b&0x7F) << shift
  545. if b < 0x80 {
  546. break
  547. }
  548. }
  549. intStringLen := int(stringLen)
  550. if intStringLen < 0 {
  551. return ErrInvalidLengthDeviceconfiguration
  552. }
  553. postIndex := iNdEx + intStringLen
  554. if postIndex < 0 {
  555. return ErrInvalidLengthDeviceconfiguration
  556. }
  557. if postIndex > l {
  558. return io.ErrUnexpectedEOF
  559. }
  560. m.CertName = string(dAtA[iNdEx:postIndex])
  561. iNdEx = postIndex
  562. case 6:
  563. if wireType != 0 {
  564. return fmt.Errorf("proto: wrong wireType = %d for field Introducer", wireType)
  565. }
  566. var v int
  567. for shift := uint(0); ; shift += 7 {
  568. if shift >= 64 {
  569. return ErrIntOverflowDeviceconfiguration
  570. }
  571. if iNdEx >= l {
  572. return io.ErrUnexpectedEOF
  573. }
  574. b := dAtA[iNdEx]
  575. iNdEx++
  576. v |= int(b&0x7F) << shift
  577. if b < 0x80 {
  578. break
  579. }
  580. }
  581. m.Introducer = bool(v != 0)
  582. case 7:
  583. if wireType != 0 {
  584. return fmt.Errorf("proto: wrong wireType = %d for field SkipIntroductionRemovals", wireType)
  585. }
  586. var v int
  587. for shift := uint(0); ; shift += 7 {
  588. if shift >= 64 {
  589. return ErrIntOverflowDeviceconfiguration
  590. }
  591. if iNdEx >= l {
  592. return io.ErrUnexpectedEOF
  593. }
  594. b := dAtA[iNdEx]
  595. iNdEx++
  596. v |= int(b&0x7F) << shift
  597. if b < 0x80 {
  598. break
  599. }
  600. }
  601. m.SkipIntroductionRemovals = bool(v != 0)
  602. case 8:
  603. if wireType != 2 {
  604. return fmt.Errorf("proto: wrong wireType = %d for field IntroducedBy", wireType)
  605. }
  606. var byteLen int
  607. for shift := uint(0); ; shift += 7 {
  608. if shift >= 64 {
  609. return ErrIntOverflowDeviceconfiguration
  610. }
  611. if iNdEx >= l {
  612. return io.ErrUnexpectedEOF
  613. }
  614. b := dAtA[iNdEx]
  615. iNdEx++
  616. byteLen |= int(b&0x7F) << shift
  617. if b < 0x80 {
  618. break
  619. }
  620. }
  621. if byteLen < 0 {
  622. return ErrInvalidLengthDeviceconfiguration
  623. }
  624. postIndex := iNdEx + byteLen
  625. if postIndex < 0 {
  626. return ErrInvalidLengthDeviceconfiguration
  627. }
  628. if postIndex > l {
  629. return io.ErrUnexpectedEOF
  630. }
  631. if err := m.IntroducedBy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  632. return err
  633. }
  634. iNdEx = postIndex
  635. case 9:
  636. if wireType != 0 {
  637. return fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType)
  638. }
  639. var v int
  640. for shift := uint(0); ; shift += 7 {
  641. if shift >= 64 {
  642. return ErrIntOverflowDeviceconfiguration
  643. }
  644. if iNdEx >= l {
  645. return io.ErrUnexpectedEOF
  646. }
  647. b := dAtA[iNdEx]
  648. iNdEx++
  649. v |= int(b&0x7F) << shift
  650. if b < 0x80 {
  651. break
  652. }
  653. }
  654. m.Paused = bool(v != 0)
  655. case 10:
  656. if wireType != 2 {
  657. return fmt.Errorf("proto: wrong wireType = %d for field AllowedNetworks", wireType)
  658. }
  659. var stringLen uint64
  660. for shift := uint(0); ; shift += 7 {
  661. if shift >= 64 {
  662. return ErrIntOverflowDeviceconfiguration
  663. }
  664. if iNdEx >= l {
  665. return io.ErrUnexpectedEOF
  666. }
  667. b := dAtA[iNdEx]
  668. iNdEx++
  669. stringLen |= uint64(b&0x7F) << shift
  670. if b < 0x80 {
  671. break
  672. }
  673. }
  674. intStringLen := int(stringLen)
  675. if intStringLen < 0 {
  676. return ErrInvalidLengthDeviceconfiguration
  677. }
  678. postIndex := iNdEx + intStringLen
  679. if postIndex < 0 {
  680. return ErrInvalidLengthDeviceconfiguration
  681. }
  682. if postIndex > l {
  683. return io.ErrUnexpectedEOF
  684. }
  685. m.AllowedNetworks = append(m.AllowedNetworks, string(dAtA[iNdEx:postIndex]))
  686. iNdEx = postIndex
  687. case 11:
  688. if wireType != 0 {
  689. return fmt.Errorf("proto: wrong wireType = %d for field AutoAcceptFolders", wireType)
  690. }
  691. var v int
  692. for shift := uint(0); ; shift += 7 {
  693. if shift >= 64 {
  694. return ErrIntOverflowDeviceconfiguration
  695. }
  696. if iNdEx >= l {
  697. return io.ErrUnexpectedEOF
  698. }
  699. b := dAtA[iNdEx]
  700. iNdEx++
  701. v |= int(b&0x7F) << shift
  702. if b < 0x80 {
  703. break
  704. }
  705. }
  706. m.AutoAcceptFolders = bool(v != 0)
  707. case 12:
  708. if wireType != 0 {
  709. return fmt.Errorf("proto: wrong wireType = %d for field MaxSendKbps", wireType)
  710. }
  711. m.MaxSendKbps = 0
  712. for shift := uint(0); ; shift += 7 {
  713. if shift >= 64 {
  714. return ErrIntOverflowDeviceconfiguration
  715. }
  716. if iNdEx >= l {
  717. return io.ErrUnexpectedEOF
  718. }
  719. b := dAtA[iNdEx]
  720. iNdEx++
  721. m.MaxSendKbps |= int(b&0x7F) << shift
  722. if b < 0x80 {
  723. break
  724. }
  725. }
  726. case 13:
  727. if wireType != 0 {
  728. return fmt.Errorf("proto: wrong wireType = %d for field MaxRecvKbps", wireType)
  729. }
  730. m.MaxRecvKbps = 0
  731. for shift := uint(0); ; shift += 7 {
  732. if shift >= 64 {
  733. return ErrIntOverflowDeviceconfiguration
  734. }
  735. if iNdEx >= l {
  736. return io.ErrUnexpectedEOF
  737. }
  738. b := dAtA[iNdEx]
  739. iNdEx++
  740. m.MaxRecvKbps |= int(b&0x7F) << shift
  741. if b < 0x80 {
  742. break
  743. }
  744. }
  745. case 14:
  746. if wireType != 2 {
  747. return fmt.Errorf("proto: wrong wireType = %d for field IgnoredFolders", wireType)
  748. }
  749. var msglen int
  750. for shift := uint(0); ; shift += 7 {
  751. if shift >= 64 {
  752. return ErrIntOverflowDeviceconfiguration
  753. }
  754. if iNdEx >= l {
  755. return io.ErrUnexpectedEOF
  756. }
  757. b := dAtA[iNdEx]
  758. iNdEx++
  759. msglen |= int(b&0x7F) << shift
  760. if b < 0x80 {
  761. break
  762. }
  763. }
  764. if msglen < 0 {
  765. return ErrInvalidLengthDeviceconfiguration
  766. }
  767. postIndex := iNdEx + msglen
  768. if postIndex < 0 {
  769. return ErrInvalidLengthDeviceconfiguration
  770. }
  771. if postIndex > l {
  772. return io.ErrUnexpectedEOF
  773. }
  774. m.IgnoredFolders = append(m.IgnoredFolders, ObservedFolder{})
  775. if err := m.IgnoredFolders[len(m.IgnoredFolders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  776. return err
  777. }
  778. iNdEx = postIndex
  779. case 15:
  780. if wireType != 2 {
  781. return fmt.Errorf("proto: wrong wireType = %d for field PendingFolders", wireType)
  782. }
  783. var msglen int
  784. for shift := uint(0); ; shift += 7 {
  785. if shift >= 64 {
  786. return ErrIntOverflowDeviceconfiguration
  787. }
  788. if iNdEx >= l {
  789. return io.ErrUnexpectedEOF
  790. }
  791. b := dAtA[iNdEx]
  792. iNdEx++
  793. msglen |= int(b&0x7F) << shift
  794. if b < 0x80 {
  795. break
  796. }
  797. }
  798. if msglen < 0 {
  799. return ErrInvalidLengthDeviceconfiguration
  800. }
  801. postIndex := iNdEx + msglen
  802. if postIndex < 0 {
  803. return ErrInvalidLengthDeviceconfiguration
  804. }
  805. if postIndex > l {
  806. return io.ErrUnexpectedEOF
  807. }
  808. m.PendingFolders = append(m.PendingFolders, ObservedFolder{})
  809. if err := m.PendingFolders[len(m.PendingFolders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  810. return err
  811. }
  812. iNdEx = postIndex
  813. case 16:
  814. if wireType != 0 {
  815. return fmt.Errorf("proto: wrong wireType = %d for field MaxRequestKiB", wireType)
  816. }
  817. m.MaxRequestKiB = 0
  818. for shift := uint(0); ; shift += 7 {
  819. if shift >= 64 {
  820. return ErrIntOverflowDeviceconfiguration
  821. }
  822. if iNdEx >= l {
  823. return io.ErrUnexpectedEOF
  824. }
  825. b := dAtA[iNdEx]
  826. iNdEx++
  827. m.MaxRequestKiB |= int(b&0x7F) << shift
  828. if b < 0x80 {
  829. break
  830. }
  831. }
  832. default:
  833. iNdEx = preIndex
  834. skippy, err := skipDeviceconfiguration(dAtA[iNdEx:])
  835. if err != nil {
  836. return err
  837. }
  838. if skippy < 0 {
  839. return ErrInvalidLengthDeviceconfiguration
  840. }
  841. if (iNdEx + skippy) < 0 {
  842. return ErrInvalidLengthDeviceconfiguration
  843. }
  844. if (iNdEx + skippy) > l {
  845. return io.ErrUnexpectedEOF
  846. }
  847. iNdEx += skippy
  848. }
  849. }
  850. if iNdEx > l {
  851. return io.ErrUnexpectedEOF
  852. }
  853. return nil
  854. }
  855. func skipDeviceconfiguration(dAtA []byte) (n int, err error) {
  856. l := len(dAtA)
  857. iNdEx := 0
  858. depth := 0
  859. for iNdEx < l {
  860. var wire uint64
  861. for shift := uint(0); ; shift += 7 {
  862. if shift >= 64 {
  863. return 0, ErrIntOverflowDeviceconfiguration
  864. }
  865. if iNdEx >= l {
  866. return 0, io.ErrUnexpectedEOF
  867. }
  868. b := dAtA[iNdEx]
  869. iNdEx++
  870. wire |= (uint64(b) & 0x7F) << shift
  871. if b < 0x80 {
  872. break
  873. }
  874. }
  875. wireType := int(wire & 0x7)
  876. switch wireType {
  877. case 0:
  878. for shift := uint(0); ; shift += 7 {
  879. if shift >= 64 {
  880. return 0, ErrIntOverflowDeviceconfiguration
  881. }
  882. if iNdEx >= l {
  883. return 0, io.ErrUnexpectedEOF
  884. }
  885. iNdEx++
  886. if dAtA[iNdEx-1] < 0x80 {
  887. break
  888. }
  889. }
  890. case 1:
  891. iNdEx += 8
  892. case 2:
  893. var length int
  894. for shift := uint(0); ; shift += 7 {
  895. if shift >= 64 {
  896. return 0, ErrIntOverflowDeviceconfiguration
  897. }
  898. if iNdEx >= l {
  899. return 0, io.ErrUnexpectedEOF
  900. }
  901. b := dAtA[iNdEx]
  902. iNdEx++
  903. length |= (int(b) & 0x7F) << shift
  904. if b < 0x80 {
  905. break
  906. }
  907. }
  908. if length < 0 {
  909. return 0, ErrInvalidLengthDeviceconfiguration
  910. }
  911. iNdEx += length
  912. case 3:
  913. depth++
  914. case 4:
  915. if depth == 0 {
  916. return 0, ErrUnexpectedEndOfGroupDeviceconfiguration
  917. }
  918. depth--
  919. case 5:
  920. iNdEx += 4
  921. default:
  922. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  923. }
  924. if iNdEx < 0 {
  925. return 0, ErrInvalidLengthDeviceconfiguration
  926. }
  927. if depth == 0 {
  928. return iNdEx, nil
  929. }
  930. }
  931. return 0, io.ErrUnexpectedEOF
  932. }
  933. var (
  934. ErrInvalidLengthDeviceconfiguration = fmt.Errorf("proto: negative length found during unmarshaling")
  935. ErrIntOverflowDeviceconfiguration = fmt.Errorf("proto: integer overflow")
  936. ErrUnexpectedEndOfGroupDeviceconfiguration = fmt.Errorf("proto: unexpected end of group")
  937. )