nebula.pb.go 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: nebula.proto
  3. package nebula
  4. import (
  5. fmt "fmt"
  6. proto "github.com/gogo/protobuf/proto"
  7. io "io"
  8. math "math"
  9. math_bits "math/bits"
  10. )
  11. // Reference imports to suppress errors if they are not otherwise used.
  12. var _ = proto.Marshal
  13. var _ = fmt.Errorf
  14. var _ = math.Inf
  15. // This is a compile-time assertion to ensure that this generated file
  16. // is compatible with the proto package it is being compiled against.
  17. // A compilation error at this line likely means your copy of the
  18. // proto package needs to be updated.
  19. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
  20. type NebulaMeta_MessageType int32
  21. const (
  22. NebulaMeta_None NebulaMeta_MessageType = 0
  23. NebulaMeta_HostQuery NebulaMeta_MessageType = 1
  24. NebulaMeta_HostQueryReply NebulaMeta_MessageType = 2
  25. NebulaMeta_HostUpdateNotification NebulaMeta_MessageType = 3
  26. NebulaMeta_HostMovedNotification NebulaMeta_MessageType = 4
  27. NebulaMeta_HostPunchNotification NebulaMeta_MessageType = 5
  28. NebulaMeta_HostWhoami NebulaMeta_MessageType = 6
  29. NebulaMeta_HostWhoamiReply NebulaMeta_MessageType = 7
  30. NebulaMeta_PathCheck NebulaMeta_MessageType = 8
  31. NebulaMeta_PathCheckReply NebulaMeta_MessageType = 9
  32. )
  33. var NebulaMeta_MessageType_name = map[int32]string{
  34. 0: "None",
  35. 1: "HostQuery",
  36. 2: "HostQueryReply",
  37. 3: "HostUpdateNotification",
  38. 4: "HostMovedNotification",
  39. 5: "HostPunchNotification",
  40. 6: "HostWhoami",
  41. 7: "HostWhoamiReply",
  42. 8: "PathCheck",
  43. 9: "PathCheckReply",
  44. }
  45. var NebulaMeta_MessageType_value = map[string]int32{
  46. "None": 0,
  47. "HostQuery": 1,
  48. "HostQueryReply": 2,
  49. "HostUpdateNotification": 3,
  50. "HostMovedNotification": 4,
  51. "HostPunchNotification": 5,
  52. "HostWhoami": 6,
  53. "HostWhoamiReply": 7,
  54. "PathCheck": 8,
  55. "PathCheckReply": 9,
  56. }
  57. func (x NebulaMeta_MessageType) String() string {
  58. return proto.EnumName(NebulaMeta_MessageType_name, int32(x))
  59. }
  60. func (NebulaMeta_MessageType) EnumDescriptor() ([]byte, []int) {
  61. return fileDescriptor_2d65afa7693df5ef, []int{0, 0}
  62. }
  63. type NebulaPing_MessageType int32
  64. const (
  65. NebulaPing_Ping NebulaPing_MessageType = 0
  66. NebulaPing_Reply NebulaPing_MessageType = 1
  67. )
  68. var NebulaPing_MessageType_name = map[int32]string{
  69. 0: "Ping",
  70. 1: "Reply",
  71. }
  72. var NebulaPing_MessageType_value = map[string]int32{
  73. "Ping": 0,
  74. "Reply": 1,
  75. }
  76. func (x NebulaPing_MessageType) String() string {
  77. return proto.EnumName(NebulaPing_MessageType_name, int32(x))
  78. }
  79. func (NebulaPing_MessageType) EnumDescriptor() ([]byte, []int) {
  80. return fileDescriptor_2d65afa7693df5ef, []int{4, 0}
  81. }
  82. type NebulaControl_MessageType int32
  83. const (
  84. NebulaControl_None NebulaControl_MessageType = 0
  85. NebulaControl_CreateRelayRequest NebulaControl_MessageType = 1
  86. NebulaControl_CreateRelayResponse NebulaControl_MessageType = 2
  87. )
  88. var NebulaControl_MessageType_name = map[int32]string{
  89. 0: "None",
  90. 1: "CreateRelayRequest",
  91. 2: "CreateRelayResponse",
  92. }
  93. var NebulaControl_MessageType_value = map[string]int32{
  94. "None": 0,
  95. "CreateRelayRequest": 1,
  96. "CreateRelayResponse": 2,
  97. }
  98. func (x NebulaControl_MessageType) String() string {
  99. return proto.EnumName(NebulaControl_MessageType_name, int32(x))
  100. }
  101. func (NebulaControl_MessageType) EnumDescriptor() ([]byte, []int) {
  102. return fileDescriptor_2d65afa7693df5ef, []int{7, 0}
  103. }
  104. type NebulaMeta struct {
  105. Type NebulaMeta_MessageType `protobuf:"varint,1,opt,name=Type,proto3,enum=nebula.NebulaMeta_MessageType" json:"Type,omitempty"`
  106. Details *NebulaMetaDetails `protobuf:"bytes,2,opt,name=Details,proto3" json:"Details,omitempty"`
  107. }
  108. func (m *NebulaMeta) Reset() { *m = NebulaMeta{} }
  109. func (m *NebulaMeta) String() string { return proto.CompactTextString(m) }
  110. func (*NebulaMeta) ProtoMessage() {}
  111. func (*NebulaMeta) Descriptor() ([]byte, []int) {
  112. return fileDescriptor_2d65afa7693df5ef, []int{0}
  113. }
  114. func (m *NebulaMeta) XXX_Unmarshal(b []byte) error {
  115. return m.Unmarshal(b)
  116. }
  117. func (m *NebulaMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  118. if deterministic {
  119. return xxx_messageInfo_NebulaMeta.Marshal(b, m, deterministic)
  120. } else {
  121. b = b[:cap(b)]
  122. n, err := m.MarshalToSizedBuffer(b)
  123. if err != nil {
  124. return nil, err
  125. }
  126. return b[:n], nil
  127. }
  128. }
  129. func (m *NebulaMeta) XXX_Merge(src proto.Message) {
  130. xxx_messageInfo_NebulaMeta.Merge(m, src)
  131. }
  132. func (m *NebulaMeta) XXX_Size() int {
  133. return m.Size()
  134. }
  135. func (m *NebulaMeta) XXX_DiscardUnknown() {
  136. xxx_messageInfo_NebulaMeta.DiscardUnknown(m)
  137. }
  138. var xxx_messageInfo_NebulaMeta proto.InternalMessageInfo
  139. func (m *NebulaMeta) GetType() NebulaMeta_MessageType {
  140. if m != nil {
  141. return m.Type
  142. }
  143. return NebulaMeta_None
  144. }
  145. func (m *NebulaMeta) GetDetails() *NebulaMetaDetails {
  146. if m != nil {
  147. return m.Details
  148. }
  149. return nil
  150. }
  151. type NebulaMetaDetails struct {
  152. VpnIp uint32 `protobuf:"varint,1,opt,name=VpnIp,proto3" json:"VpnIp,omitempty"`
  153. Ip4AndPorts []*Ip4AndPort `protobuf:"bytes,2,rep,name=Ip4AndPorts,proto3" json:"Ip4AndPorts,omitempty"`
  154. Ip6AndPorts []*Ip6AndPort `protobuf:"bytes,4,rep,name=Ip6AndPorts,proto3" json:"Ip6AndPorts,omitempty"`
  155. RelayVpnIp []uint32 `protobuf:"varint,5,rep,packed,name=RelayVpnIp,proto3" json:"RelayVpnIp,omitempty"`
  156. Counter uint32 `protobuf:"varint,3,opt,name=counter,proto3" json:"counter,omitempty"`
  157. }
  158. func (m *NebulaMetaDetails) Reset() { *m = NebulaMetaDetails{} }
  159. func (m *NebulaMetaDetails) String() string { return proto.CompactTextString(m) }
  160. func (*NebulaMetaDetails) ProtoMessage() {}
  161. func (*NebulaMetaDetails) Descriptor() ([]byte, []int) {
  162. return fileDescriptor_2d65afa7693df5ef, []int{1}
  163. }
  164. func (m *NebulaMetaDetails) XXX_Unmarshal(b []byte) error {
  165. return m.Unmarshal(b)
  166. }
  167. func (m *NebulaMetaDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  168. if deterministic {
  169. return xxx_messageInfo_NebulaMetaDetails.Marshal(b, m, deterministic)
  170. } else {
  171. b = b[:cap(b)]
  172. n, err := m.MarshalToSizedBuffer(b)
  173. if err != nil {
  174. return nil, err
  175. }
  176. return b[:n], nil
  177. }
  178. }
  179. func (m *NebulaMetaDetails) XXX_Merge(src proto.Message) {
  180. xxx_messageInfo_NebulaMetaDetails.Merge(m, src)
  181. }
  182. func (m *NebulaMetaDetails) XXX_Size() int {
  183. return m.Size()
  184. }
  185. func (m *NebulaMetaDetails) XXX_DiscardUnknown() {
  186. xxx_messageInfo_NebulaMetaDetails.DiscardUnknown(m)
  187. }
  188. var xxx_messageInfo_NebulaMetaDetails proto.InternalMessageInfo
  189. func (m *NebulaMetaDetails) GetVpnIp() uint32 {
  190. if m != nil {
  191. return m.VpnIp
  192. }
  193. return 0
  194. }
  195. func (m *NebulaMetaDetails) GetIp4AndPorts() []*Ip4AndPort {
  196. if m != nil {
  197. return m.Ip4AndPorts
  198. }
  199. return nil
  200. }
  201. func (m *NebulaMetaDetails) GetIp6AndPorts() []*Ip6AndPort {
  202. if m != nil {
  203. return m.Ip6AndPorts
  204. }
  205. return nil
  206. }
  207. func (m *NebulaMetaDetails) GetRelayVpnIp() []uint32 {
  208. if m != nil {
  209. return m.RelayVpnIp
  210. }
  211. return nil
  212. }
  213. func (m *NebulaMetaDetails) GetCounter() uint32 {
  214. if m != nil {
  215. return m.Counter
  216. }
  217. return 0
  218. }
  219. type Ip4AndPort struct {
  220. Ip uint32 `protobuf:"varint,1,opt,name=Ip,proto3" json:"Ip,omitempty"`
  221. Port uint32 `protobuf:"varint,2,opt,name=Port,proto3" json:"Port,omitempty"`
  222. }
  223. func (m *Ip4AndPort) Reset() { *m = Ip4AndPort{} }
  224. func (m *Ip4AndPort) String() string { return proto.CompactTextString(m) }
  225. func (*Ip4AndPort) ProtoMessage() {}
  226. func (*Ip4AndPort) Descriptor() ([]byte, []int) {
  227. return fileDescriptor_2d65afa7693df5ef, []int{2}
  228. }
  229. func (m *Ip4AndPort) XXX_Unmarshal(b []byte) error {
  230. return m.Unmarshal(b)
  231. }
  232. func (m *Ip4AndPort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  233. if deterministic {
  234. return xxx_messageInfo_Ip4AndPort.Marshal(b, m, deterministic)
  235. } else {
  236. b = b[:cap(b)]
  237. n, err := m.MarshalToSizedBuffer(b)
  238. if err != nil {
  239. return nil, err
  240. }
  241. return b[:n], nil
  242. }
  243. }
  244. func (m *Ip4AndPort) XXX_Merge(src proto.Message) {
  245. xxx_messageInfo_Ip4AndPort.Merge(m, src)
  246. }
  247. func (m *Ip4AndPort) XXX_Size() int {
  248. return m.Size()
  249. }
  250. func (m *Ip4AndPort) XXX_DiscardUnknown() {
  251. xxx_messageInfo_Ip4AndPort.DiscardUnknown(m)
  252. }
  253. var xxx_messageInfo_Ip4AndPort proto.InternalMessageInfo
  254. func (m *Ip4AndPort) GetIp() uint32 {
  255. if m != nil {
  256. return m.Ip
  257. }
  258. return 0
  259. }
  260. func (m *Ip4AndPort) GetPort() uint32 {
  261. if m != nil {
  262. return m.Port
  263. }
  264. return 0
  265. }
  266. type Ip6AndPort struct {
  267. Hi uint64 `protobuf:"varint,1,opt,name=Hi,proto3" json:"Hi,omitempty"`
  268. Lo uint64 `protobuf:"varint,2,opt,name=Lo,proto3" json:"Lo,omitempty"`
  269. Port uint32 `protobuf:"varint,3,opt,name=Port,proto3" json:"Port,omitempty"`
  270. }
  271. func (m *Ip6AndPort) Reset() { *m = Ip6AndPort{} }
  272. func (m *Ip6AndPort) String() string { return proto.CompactTextString(m) }
  273. func (*Ip6AndPort) ProtoMessage() {}
  274. func (*Ip6AndPort) Descriptor() ([]byte, []int) {
  275. return fileDescriptor_2d65afa7693df5ef, []int{3}
  276. }
  277. func (m *Ip6AndPort) XXX_Unmarshal(b []byte) error {
  278. return m.Unmarshal(b)
  279. }
  280. func (m *Ip6AndPort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  281. if deterministic {
  282. return xxx_messageInfo_Ip6AndPort.Marshal(b, m, deterministic)
  283. } else {
  284. b = b[:cap(b)]
  285. n, err := m.MarshalToSizedBuffer(b)
  286. if err != nil {
  287. return nil, err
  288. }
  289. return b[:n], nil
  290. }
  291. }
  292. func (m *Ip6AndPort) XXX_Merge(src proto.Message) {
  293. xxx_messageInfo_Ip6AndPort.Merge(m, src)
  294. }
  295. func (m *Ip6AndPort) XXX_Size() int {
  296. return m.Size()
  297. }
  298. func (m *Ip6AndPort) XXX_DiscardUnknown() {
  299. xxx_messageInfo_Ip6AndPort.DiscardUnknown(m)
  300. }
  301. var xxx_messageInfo_Ip6AndPort proto.InternalMessageInfo
  302. func (m *Ip6AndPort) GetHi() uint64 {
  303. if m != nil {
  304. return m.Hi
  305. }
  306. return 0
  307. }
  308. func (m *Ip6AndPort) GetLo() uint64 {
  309. if m != nil {
  310. return m.Lo
  311. }
  312. return 0
  313. }
  314. func (m *Ip6AndPort) GetPort() uint32 {
  315. if m != nil {
  316. return m.Port
  317. }
  318. return 0
  319. }
  320. type NebulaPing struct {
  321. Type NebulaPing_MessageType `protobuf:"varint,1,opt,name=Type,proto3,enum=nebula.NebulaPing_MessageType" json:"Type,omitempty"`
  322. Time uint64 `protobuf:"varint,2,opt,name=Time,proto3" json:"Time,omitempty"`
  323. }
  324. func (m *NebulaPing) Reset() { *m = NebulaPing{} }
  325. func (m *NebulaPing) String() string { return proto.CompactTextString(m) }
  326. func (*NebulaPing) ProtoMessage() {}
  327. func (*NebulaPing) Descriptor() ([]byte, []int) {
  328. return fileDescriptor_2d65afa7693df5ef, []int{4}
  329. }
  330. func (m *NebulaPing) XXX_Unmarshal(b []byte) error {
  331. return m.Unmarshal(b)
  332. }
  333. func (m *NebulaPing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  334. if deterministic {
  335. return xxx_messageInfo_NebulaPing.Marshal(b, m, deterministic)
  336. } else {
  337. b = b[:cap(b)]
  338. n, err := m.MarshalToSizedBuffer(b)
  339. if err != nil {
  340. return nil, err
  341. }
  342. return b[:n], nil
  343. }
  344. }
  345. func (m *NebulaPing) XXX_Merge(src proto.Message) {
  346. xxx_messageInfo_NebulaPing.Merge(m, src)
  347. }
  348. func (m *NebulaPing) XXX_Size() int {
  349. return m.Size()
  350. }
  351. func (m *NebulaPing) XXX_DiscardUnknown() {
  352. xxx_messageInfo_NebulaPing.DiscardUnknown(m)
  353. }
  354. var xxx_messageInfo_NebulaPing proto.InternalMessageInfo
  355. func (m *NebulaPing) GetType() NebulaPing_MessageType {
  356. if m != nil {
  357. return m.Type
  358. }
  359. return NebulaPing_Ping
  360. }
  361. func (m *NebulaPing) GetTime() uint64 {
  362. if m != nil {
  363. return m.Time
  364. }
  365. return 0
  366. }
  367. type NebulaHandshake struct {
  368. Details *NebulaHandshakeDetails `protobuf:"bytes,1,opt,name=Details,proto3" json:"Details,omitempty"`
  369. Hmac []byte `protobuf:"bytes,2,opt,name=Hmac,proto3" json:"Hmac,omitempty"`
  370. }
  371. func (m *NebulaHandshake) Reset() { *m = NebulaHandshake{} }
  372. func (m *NebulaHandshake) String() string { return proto.CompactTextString(m) }
  373. func (*NebulaHandshake) ProtoMessage() {}
  374. func (*NebulaHandshake) Descriptor() ([]byte, []int) {
  375. return fileDescriptor_2d65afa7693df5ef, []int{5}
  376. }
  377. func (m *NebulaHandshake) XXX_Unmarshal(b []byte) error {
  378. return m.Unmarshal(b)
  379. }
  380. func (m *NebulaHandshake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  381. if deterministic {
  382. return xxx_messageInfo_NebulaHandshake.Marshal(b, m, deterministic)
  383. } else {
  384. b = b[:cap(b)]
  385. n, err := m.MarshalToSizedBuffer(b)
  386. if err != nil {
  387. return nil, err
  388. }
  389. return b[:n], nil
  390. }
  391. }
  392. func (m *NebulaHandshake) XXX_Merge(src proto.Message) {
  393. xxx_messageInfo_NebulaHandshake.Merge(m, src)
  394. }
  395. func (m *NebulaHandshake) XXX_Size() int {
  396. return m.Size()
  397. }
  398. func (m *NebulaHandshake) XXX_DiscardUnknown() {
  399. xxx_messageInfo_NebulaHandshake.DiscardUnknown(m)
  400. }
  401. var xxx_messageInfo_NebulaHandshake proto.InternalMessageInfo
  402. func (m *NebulaHandshake) GetDetails() *NebulaHandshakeDetails {
  403. if m != nil {
  404. return m.Details
  405. }
  406. return nil
  407. }
  408. func (m *NebulaHandshake) GetHmac() []byte {
  409. if m != nil {
  410. return m.Hmac
  411. }
  412. return nil
  413. }
  414. type NebulaHandshakeDetails struct {
  415. Cert []byte `protobuf:"bytes,1,opt,name=Cert,proto3" json:"Cert,omitempty"`
  416. InitiatorIndex uint32 `protobuf:"varint,2,opt,name=InitiatorIndex,proto3" json:"InitiatorIndex,omitempty"`
  417. ResponderIndex uint32 `protobuf:"varint,3,opt,name=ResponderIndex,proto3" json:"ResponderIndex,omitempty"`
  418. Cookie uint64 `protobuf:"varint,4,opt,name=Cookie,proto3" json:"Cookie,omitempty"`
  419. Time uint64 `protobuf:"varint,5,opt,name=Time,proto3" json:"Time,omitempty"`
  420. }
  421. func (m *NebulaHandshakeDetails) Reset() { *m = NebulaHandshakeDetails{} }
  422. func (m *NebulaHandshakeDetails) String() string { return proto.CompactTextString(m) }
  423. func (*NebulaHandshakeDetails) ProtoMessage() {}
  424. func (*NebulaHandshakeDetails) Descriptor() ([]byte, []int) {
  425. return fileDescriptor_2d65afa7693df5ef, []int{6}
  426. }
  427. func (m *NebulaHandshakeDetails) XXX_Unmarshal(b []byte) error {
  428. return m.Unmarshal(b)
  429. }
  430. func (m *NebulaHandshakeDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  431. if deterministic {
  432. return xxx_messageInfo_NebulaHandshakeDetails.Marshal(b, m, deterministic)
  433. } else {
  434. b = b[:cap(b)]
  435. n, err := m.MarshalToSizedBuffer(b)
  436. if err != nil {
  437. return nil, err
  438. }
  439. return b[:n], nil
  440. }
  441. }
  442. func (m *NebulaHandshakeDetails) XXX_Merge(src proto.Message) {
  443. xxx_messageInfo_NebulaHandshakeDetails.Merge(m, src)
  444. }
  445. func (m *NebulaHandshakeDetails) XXX_Size() int {
  446. return m.Size()
  447. }
  448. func (m *NebulaHandshakeDetails) XXX_DiscardUnknown() {
  449. xxx_messageInfo_NebulaHandshakeDetails.DiscardUnknown(m)
  450. }
  451. var xxx_messageInfo_NebulaHandshakeDetails proto.InternalMessageInfo
  452. func (m *NebulaHandshakeDetails) GetCert() []byte {
  453. if m != nil {
  454. return m.Cert
  455. }
  456. return nil
  457. }
  458. func (m *NebulaHandshakeDetails) GetInitiatorIndex() uint32 {
  459. if m != nil {
  460. return m.InitiatorIndex
  461. }
  462. return 0
  463. }
  464. func (m *NebulaHandshakeDetails) GetResponderIndex() uint32 {
  465. if m != nil {
  466. return m.ResponderIndex
  467. }
  468. return 0
  469. }
  470. func (m *NebulaHandshakeDetails) GetCookie() uint64 {
  471. if m != nil {
  472. return m.Cookie
  473. }
  474. return 0
  475. }
  476. func (m *NebulaHandshakeDetails) GetTime() uint64 {
  477. if m != nil {
  478. return m.Time
  479. }
  480. return 0
  481. }
  482. type NebulaControl struct {
  483. Type NebulaControl_MessageType `protobuf:"varint,1,opt,name=Type,proto3,enum=nebula.NebulaControl_MessageType" json:"Type,omitempty"`
  484. InitiatorRelayIndex uint32 `protobuf:"varint,2,opt,name=InitiatorRelayIndex,proto3" json:"InitiatorRelayIndex,omitempty"`
  485. ResponderRelayIndex uint32 `protobuf:"varint,3,opt,name=ResponderRelayIndex,proto3" json:"ResponderRelayIndex,omitempty"`
  486. RelayToIp uint32 `protobuf:"varint,4,opt,name=RelayToIp,proto3" json:"RelayToIp,omitempty"`
  487. RelayFromIp uint32 `protobuf:"varint,5,opt,name=RelayFromIp,proto3" json:"RelayFromIp,omitempty"`
  488. }
  489. func (m *NebulaControl) Reset() { *m = NebulaControl{} }
  490. func (m *NebulaControl) String() string { return proto.CompactTextString(m) }
  491. func (*NebulaControl) ProtoMessage() {}
  492. func (*NebulaControl) Descriptor() ([]byte, []int) {
  493. return fileDescriptor_2d65afa7693df5ef, []int{7}
  494. }
  495. func (m *NebulaControl) XXX_Unmarshal(b []byte) error {
  496. return m.Unmarshal(b)
  497. }
  498. func (m *NebulaControl) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  499. if deterministic {
  500. return xxx_messageInfo_NebulaControl.Marshal(b, m, deterministic)
  501. } else {
  502. b = b[:cap(b)]
  503. n, err := m.MarshalToSizedBuffer(b)
  504. if err != nil {
  505. return nil, err
  506. }
  507. return b[:n], nil
  508. }
  509. }
  510. func (m *NebulaControl) XXX_Merge(src proto.Message) {
  511. xxx_messageInfo_NebulaControl.Merge(m, src)
  512. }
  513. func (m *NebulaControl) XXX_Size() int {
  514. return m.Size()
  515. }
  516. func (m *NebulaControl) XXX_DiscardUnknown() {
  517. xxx_messageInfo_NebulaControl.DiscardUnknown(m)
  518. }
  519. var xxx_messageInfo_NebulaControl proto.InternalMessageInfo
  520. func (m *NebulaControl) GetType() NebulaControl_MessageType {
  521. if m != nil {
  522. return m.Type
  523. }
  524. return NebulaControl_None
  525. }
  526. func (m *NebulaControl) GetInitiatorRelayIndex() uint32 {
  527. if m != nil {
  528. return m.InitiatorRelayIndex
  529. }
  530. return 0
  531. }
  532. func (m *NebulaControl) GetResponderRelayIndex() uint32 {
  533. if m != nil {
  534. return m.ResponderRelayIndex
  535. }
  536. return 0
  537. }
  538. func (m *NebulaControl) GetRelayToIp() uint32 {
  539. if m != nil {
  540. return m.RelayToIp
  541. }
  542. return 0
  543. }
  544. func (m *NebulaControl) GetRelayFromIp() uint32 {
  545. if m != nil {
  546. return m.RelayFromIp
  547. }
  548. return 0
  549. }
  550. func init() {
  551. proto.RegisterEnum("nebula.NebulaMeta_MessageType", NebulaMeta_MessageType_name, NebulaMeta_MessageType_value)
  552. proto.RegisterEnum("nebula.NebulaPing_MessageType", NebulaPing_MessageType_name, NebulaPing_MessageType_value)
  553. proto.RegisterEnum("nebula.NebulaControl_MessageType", NebulaControl_MessageType_name, NebulaControl_MessageType_value)
  554. proto.RegisterType((*NebulaMeta)(nil), "nebula.NebulaMeta")
  555. proto.RegisterType((*NebulaMetaDetails)(nil), "nebula.NebulaMetaDetails")
  556. proto.RegisterType((*Ip4AndPort)(nil), "nebula.Ip4AndPort")
  557. proto.RegisterType((*Ip6AndPort)(nil), "nebula.Ip6AndPort")
  558. proto.RegisterType((*NebulaPing)(nil), "nebula.NebulaPing")
  559. proto.RegisterType((*NebulaHandshake)(nil), "nebula.NebulaHandshake")
  560. proto.RegisterType((*NebulaHandshakeDetails)(nil), "nebula.NebulaHandshakeDetails")
  561. proto.RegisterType((*NebulaControl)(nil), "nebula.NebulaControl")
  562. }
  563. func init() { proto.RegisterFile("nebula.proto", fileDescriptor_2d65afa7693df5ef) }
  564. var fileDescriptor_2d65afa7693df5ef = []byte{
  565. // 696 bytes of a gzipped FileDescriptorProto
  566. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xcd, 0x6e, 0xd3, 0x4a,
  567. 0x14, 0x8e, 0x1d, 0xe7, 0xef, 0xa4, 0x49, 0x7d, 0x4f, 0xef, 0xcd, 0x4d, 0xaf, 0xae, 0xac, 0xe0,
  568. 0x05, 0xca, 0x2a, 0xad, 0xd2, 0x52, 0xb1, 0x04, 0x82, 0x50, 0x52, 0xb5, 0x55, 0x18, 0x15, 0x90,
  569. 0xd8, 0xa0, 0x69, 0x32, 0xd4, 0x56, 0x12, 0x8f, 0x6b, 0x4f, 0x50, 0xf3, 0x16, 0x3c, 0x4c, 0x1f,
  570. 0x82, 0x05, 0x12, 0x5d, 0xb0, 0x60, 0x89, 0xda, 0x17, 0x41, 0x33, 0x76, 0x6c, 0x27, 0x0d, 0xec,
  571. 0xce, 0xcf, 0xf7, 0xcd, 0x7c, 0xe7, 0x9b, 0x63, 0xc3, 0x96, 0xc7, 0x2e, 0xe6, 0x53, 0xda, 0xf1,
  572. 0x03, 0x2e, 0x38, 0x16, 0xa3, 0xcc, 0xfe, 0xaa, 0x03, 0x9c, 0xa9, 0xf0, 0x94, 0x09, 0x8a, 0x5d,
  573. 0x30, 0xce, 0x17, 0x3e, 0x6b, 0x6a, 0x2d, 0xad, 0x5d, 0xef, 0x5a, 0x9d, 0x98, 0x93, 0x22, 0x3a,
  574. 0xa7, 0x2c, 0x0c, 0xe9, 0x25, 0x93, 0x28, 0xa2, 0xb0, 0x78, 0x00, 0xa5, 0x97, 0x4c, 0x50, 0x77,
  575. 0x1a, 0x36, 0xf5, 0x96, 0xd6, 0xae, 0x76, 0x77, 0x1f, 0xd2, 0x62, 0x00, 0x59, 0x22, 0xed, 0xef,
  576. 0x1a, 0x54, 0x33, 0x47, 0x61, 0x19, 0x8c, 0x33, 0xee, 0x31, 0x33, 0x87, 0x35, 0xa8, 0xf4, 0x79,
  577. 0x28, 0x5e, 0xcf, 0x59, 0xb0, 0x30, 0x35, 0x44, 0xa8, 0x27, 0x29, 0x61, 0xfe, 0x74, 0x61, 0xea,
  578. 0xf8, 0x1f, 0x34, 0x64, 0xed, 0x8d, 0x3f, 0xa6, 0x82, 0x9d, 0x71, 0xe1, 0x7e, 0x74, 0x47, 0x54,
  579. 0xb8, 0xdc, 0x33, 0xf3, 0xb8, 0x0b, 0xff, 0xc8, 0xde, 0x29, 0xff, 0xc4, 0xc6, 0x2b, 0x2d, 0x63,
  580. 0xd9, 0x1a, 0xce, 0xbd, 0x91, 0xb3, 0xd2, 0x2a, 0x60, 0x1d, 0x40, 0xb6, 0xde, 0x39, 0x9c, 0xce,
  581. 0x5c, 0xb3, 0x88, 0x3b, 0xb0, 0x9d, 0xe6, 0xd1, 0xb5, 0x25, 0xa9, 0x6c, 0x48, 0x85, 0xd3, 0x73,
  582. 0xd8, 0x68, 0x62, 0x96, 0xa5, 0xb2, 0x24, 0x8d, 0x20, 0x15, 0xfb, 0x9b, 0x06, 0x7f, 0x3d, 0x98,
  583. 0x1a, 0xff, 0x86, 0xc2, 0x5b, 0xdf, 0x1b, 0xf8, 0xca, 0xd6, 0x1a, 0x89, 0x12, 0x3c, 0x84, 0xea,
  584. 0xc0, 0x3f, 0x7c, 0xee, 0x8d, 0x87, 0x3c, 0x10, 0xd2, 0xbb, 0x7c, 0xbb, 0xda, 0xc5, 0xa5, 0x77,
  585. 0x69, 0x8b, 0x64, 0x61, 0x11, 0xeb, 0x28, 0x61, 0x19, 0xeb, 0xac, 0xa3, 0x0c, 0x2b, 0x81, 0xa1,
  586. 0x05, 0x40, 0xd8, 0x94, 0x2e, 0x22, 0x19, 0x85, 0x56, 0xbe, 0x5d, 0x23, 0x99, 0x0a, 0x36, 0xa1,
  587. 0x34, 0xe2, 0x73, 0x4f, 0xb0, 0xa0, 0x99, 0x57, 0x1a, 0x97, 0xa9, 0xbd, 0x0f, 0x90, 0x5e, 0x8f,
  588. 0x75, 0xd0, 0x93, 0x31, 0xf4, 0x81, 0x8f, 0x08, 0x86, 0xac, 0xab, 0x87, 0xaf, 0x11, 0x15, 0xdb,
  589. 0xcf, 0x24, 0xe3, 0x28, 0xc3, 0xe8, 0xbb, 0x8a, 0x61, 0x10, 0xbd, 0xef, 0xca, 0xfc, 0x84, 0x2b,
  590. 0xbc, 0x41, 0xf4, 0x13, 0x9e, 0x9c, 0x90, 0xcf, 0x9c, 0x70, 0xbd, 0xdc, 0xc9, 0xa1, 0xeb, 0x5d,
  591. 0xfe, 0x79, 0x27, 0x25, 0x62, 0xc3, 0x4e, 0x22, 0x18, 0xe7, 0xee, 0x8c, 0xc5, 0xf7, 0xa8, 0xd8,
  592. 0xb6, 0x1f, 0x6c, 0x9c, 0x24, 0x9b, 0x39, 0xac, 0x40, 0x21, 0x7a, 0x3f, 0xcd, 0xfe, 0x00, 0xdb,
  593. 0xd1, 0xb9, 0x7d, 0xea, 0x8d, 0x43, 0x87, 0x4e, 0x18, 0x3e, 0x4d, 0xd7, 0x5b, 0x53, 0xeb, 0xbd,
  594. 0xa6, 0x20, 0x41, 0xae, 0xef, 0xb8, 0x14, 0xd1, 0x9f, 0xd1, 0x91, 0x12, 0xb1, 0x45, 0x54, 0x6c,
  595. 0xdf, 0x68, 0xd0, 0xd8, 0xcc, 0x93, 0xf0, 0x1e, 0x0b, 0x84, 0xba, 0x65, 0x8b, 0xa8, 0x18, 0x1f,
  596. 0x43, 0x7d, 0xe0, 0xb9, 0xc2, 0xa5, 0x82, 0x07, 0x03, 0x6f, 0xcc, 0xae, 0x63, 0xa7, 0xd7, 0xaa,
  597. 0x12, 0x47, 0x58, 0xe8, 0x73, 0x6f, 0xcc, 0x62, 0x5c, 0xe4, 0xe7, 0x5a, 0x15, 0x1b, 0x50, 0xec,
  598. 0x71, 0x3e, 0x71, 0x59, 0xd3, 0x50, 0xce, 0xc4, 0x59, 0xe2, 0x57, 0x21, 0xf5, 0xeb, 0xd8, 0x28,
  599. 0x17, 0xcd, 0xd2, 0xb1, 0x51, 0x2e, 0x99, 0x65, 0xfb, 0x46, 0x87, 0x5a, 0x24, 0xbb, 0xc7, 0x3d,
  600. 0x11, 0xf0, 0x29, 0x3e, 0x59, 0x79, 0x95, 0x47, 0xab, 0x9e, 0xc4, 0xa0, 0x0d, 0x0f, 0xb3, 0x0f,
  601. 0x3b, 0x89, 0x74, 0xb5, 0x7f, 0xd9, 0xa9, 0x36, 0xb5, 0x24, 0x23, 0x19, 0x22, 0xc3, 0x88, 0xe6,
  602. 0xdb, 0xd4, 0xc2, 0xff, 0xa1, 0xa2, 0xb2, 0x73, 0x3e, 0xf0, 0xd5, 0x9c, 0x35, 0x92, 0x16, 0xb0,
  603. 0x05, 0x55, 0x95, 0xbc, 0x0a, 0xf8, 0x4c, 0x7d, 0x0b, 0xb2, 0x9f, 0x2d, 0xd9, 0xfd, 0xdf, 0xfd,
  604. 0x9a, 0x1a, 0x80, 0xbd, 0x80, 0x51, 0xc1, 0x14, 0x9a, 0xb0, 0xab, 0x39, 0x0b, 0x85, 0xa9, 0xe1,
  605. 0xbf, 0xb0, 0xb3, 0x52, 0x97, 0x92, 0x42, 0x66, 0xea, 0x2f, 0x0e, 0xbe, 0xdc, 0x59, 0xda, 0xed,
  606. 0x9d, 0xa5, 0xfd, 0xbc, 0xb3, 0xb4, 0xcf, 0xf7, 0x56, 0xee, 0xf6, 0xde, 0xca, 0xfd, 0xb8, 0xb7,
  607. 0x72, 0xef, 0x77, 0x2f, 0x5d, 0xe1, 0xcc, 0x2f, 0x3a, 0x23, 0x3e, 0xdb, 0x0b, 0xa7, 0x74, 0x34,
  608. 0x71, 0xae, 0xf6, 0x22, 0x0b, 0x2f, 0x8a, 0xea, 0x0f, 0x7d, 0xf0, 0x2b, 0x00, 0x00, 0xff, 0xff,
  609. 0xcd, 0xd7, 0xbe, 0xd5, 0xb1, 0x05, 0x00, 0x00,
  610. }
  611. func (m *NebulaMeta) Marshal() (dAtA []byte, err error) {
  612. size := m.Size()
  613. dAtA = make([]byte, size)
  614. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  615. if err != nil {
  616. return nil, err
  617. }
  618. return dAtA[:n], nil
  619. }
  620. func (m *NebulaMeta) MarshalTo(dAtA []byte) (int, error) {
  621. size := m.Size()
  622. return m.MarshalToSizedBuffer(dAtA[:size])
  623. }
  624. func (m *NebulaMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  625. i := len(dAtA)
  626. _ = i
  627. var l int
  628. _ = l
  629. if m.Details != nil {
  630. {
  631. size, err := m.Details.MarshalToSizedBuffer(dAtA[:i])
  632. if err != nil {
  633. return 0, err
  634. }
  635. i -= size
  636. i = encodeVarintNebula(dAtA, i, uint64(size))
  637. }
  638. i--
  639. dAtA[i] = 0x12
  640. }
  641. if m.Type != 0 {
  642. i = encodeVarintNebula(dAtA, i, uint64(m.Type))
  643. i--
  644. dAtA[i] = 0x8
  645. }
  646. return len(dAtA) - i, nil
  647. }
  648. func (m *NebulaMetaDetails) Marshal() (dAtA []byte, err error) {
  649. size := m.Size()
  650. dAtA = make([]byte, size)
  651. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  652. if err != nil {
  653. return nil, err
  654. }
  655. return dAtA[:n], nil
  656. }
  657. func (m *NebulaMetaDetails) MarshalTo(dAtA []byte) (int, error) {
  658. size := m.Size()
  659. return m.MarshalToSizedBuffer(dAtA[:size])
  660. }
  661. func (m *NebulaMetaDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  662. i := len(dAtA)
  663. _ = i
  664. var l int
  665. _ = l
  666. if len(m.RelayVpnIp) > 0 {
  667. dAtA3 := make([]byte, len(m.RelayVpnIp)*10)
  668. var j2 int
  669. for _, num := range m.RelayVpnIp {
  670. for num >= 1<<7 {
  671. dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80)
  672. num >>= 7
  673. j2++
  674. }
  675. dAtA3[j2] = uint8(num)
  676. j2++
  677. }
  678. i -= j2
  679. copy(dAtA[i:], dAtA3[:j2])
  680. i = encodeVarintNebula(dAtA, i, uint64(j2))
  681. i--
  682. dAtA[i] = 0x2a
  683. }
  684. if len(m.Ip6AndPorts) > 0 {
  685. for iNdEx := len(m.Ip6AndPorts) - 1; iNdEx >= 0; iNdEx-- {
  686. {
  687. size, err := m.Ip6AndPorts[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  688. if err != nil {
  689. return 0, err
  690. }
  691. i -= size
  692. i = encodeVarintNebula(dAtA, i, uint64(size))
  693. }
  694. i--
  695. dAtA[i] = 0x22
  696. }
  697. }
  698. if m.Counter != 0 {
  699. i = encodeVarintNebula(dAtA, i, uint64(m.Counter))
  700. i--
  701. dAtA[i] = 0x18
  702. }
  703. if len(m.Ip4AndPorts) > 0 {
  704. for iNdEx := len(m.Ip4AndPorts) - 1; iNdEx >= 0; iNdEx-- {
  705. {
  706. size, err := m.Ip4AndPorts[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  707. if err != nil {
  708. return 0, err
  709. }
  710. i -= size
  711. i = encodeVarintNebula(dAtA, i, uint64(size))
  712. }
  713. i--
  714. dAtA[i] = 0x12
  715. }
  716. }
  717. if m.VpnIp != 0 {
  718. i = encodeVarintNebula(dAtA, i, uint64(m.VpnIp))
  719. i--
  720. dAtA[i] = 0x8
  721. }
  722. return len(dAtA) - i, nil
  723. }
  724. func (m *Ip4AndPort) Marshal() (dAtA []byte, err error) {
  725. size := m.Size()
  726. dAtA = make([]byte, size)
  727. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  728. if err != nil {
  729. return nil, err
  730. }
  731. return dAtA[:n], nil
  732. }
  733. func (m *Ip4AndPort) MarshalTo(dAtA []byte) (int, error) {
  734. size := m.Size()
  735. return m.MarshalToSizedBuffer(dAtA[:size])
  736. }
  737. func (m *Ip4AndPort) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  738. i := len(dAtA)
  739. _ = i
  740. var l int
  741. _ = l
  742. if m.Port != 0 {
  743. i = encodeVarintNebula(dAtA, i, uint64(m.Port))
  744. i--
  745. dAtA[i] = 0x10
  746. }
  747. if m.Ip != 0 {
  748. i = encodeVarintNebula(dAtA, i, uint64(m.Ip))
  749. i--
  750. dAtA[i] = 0x8
  751. }
  752. return len(dAtA) - i, nil
  753. }
  754. func (m *Ip6AndPort) Marshal() (dAtA []byte, err error) {
  755. size := m.Size()
  756. dAtA = make([]byte, size)
  757. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  758. if err != nil {
  759. return nil, err
  760. }
  761. return dAtA[:n], nil
  762. }
  763. func (m *Ip6AndPort) MarshalTo(dAtA []byte) (int, error) {
  764. size := m.Size()
  765. return m.MarshalToSizedBuffer(dAtA[:size])
  766. }
  767. func (m *Ip6AndPort) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  768. i := len(dAtA)
  769. _ = i
  770. var l int
  771. _ = l
  772. if m.Port != 0 {
  773. i = encodeVarintNebula(dAtA, i, uint64(m.Port))
  774. i--
  775. dAtA[i] = 0x18
  776. }
  777. if m.Lo != 0 {
  778. i = encodeVarintNebula(dAtA, i, uint64(m.Lo))
  779. i--
  780. dAtA[i] = 0x10
  781. }
  782. if m.Hi != 0 {
  783. i = encodeVarintNebula(dAtA, i, uint64(m.Hi))
  784. i--
  785. dAtA[i] = 0x8
  786. }
  787. return len(dAtA) - i, nil
  788. }
  789. func (m *NebulaPing) Marshal() (dAtA []byte, err error) {
  790. size := m.Size()
  791. dAtA = make([]byte, size)
  792. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  793. if err != nil {
  794. return nil, err
  795. }
  796. return dAtA[:n], nil
  797. }
  798. func (m *NebulaPing) MarshalTo(dAtA []byte) (int, error) {
  799. size := m.Size()
  800. return m.MarshalToSizedBuffer(dAtA[:size])
  801. }
  802. func (m *NebulaPing) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  803. i := len(dAtA)
  804. _ = i
  805. var l int
  806. _ = l
  807. if m.Time != 0 {
  808. i = encodeVarintNebula(dAtA, i, uint64(m.Time))
  809. i--
  810. dAtA[i] = 0x10
  811. }
  812. if m.Type != 0 {
  813. i = encodeVarintNebula(dAtA, i, uint64(m.Type))
  814. i--
  815. dAtA[i] = 0x8
  816. }
  817. return len(dAtA) - i, nil
  818. }
  819. func (m *NebulaHandshake) Marshal() (dAtA []byte, err error) {
  820. size := m.Size()
  821. dAtA = make([]byte, size)
  822. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  823. if err != nil {
  824. return nil, err
  825. }
  826. return dAtA[:n], nil
  827. }
  828. func (m *NebulaHandshake) MarshalTo(dAtA []byte) (int, error) {
  829. size := m.Size()
  830. return m.MarshalToSizedBuffer(dAtA[:size])
  831. }
  832. func (m *NebulaHandshake) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  833. i := len(dAtA)
  834. _ = i
  835. var l int
  836. _ = l
  837. if len(m.Hmac) > 0 {
  838. i -= len(m.Hmac)
  839. copy(dAtA[i:], m.Hmac)
  840. i = encodeVarintNebula(dAtA, i, uint64(len(m.Hmac)))
  841. i--
  842. dAtA[i] = 0x12
  843. }
  844. if m.Details != nil {
  845. {
  846. size, err := m.Details.MarshalToSizedBuffer(dAtA[:i])
  847. if err != nil {
  848. return 0, err
  849. }
  850. i -= size
  851. i = encodeVarintNebula(dAtA, i, uint64(size))
  852. }
  853. i--
  854. dAtA[i] = 0xa
  855. }
  856. return len(dAtA) - i, nil
  857. }
  858. func (m *NebulaHandshakeDetails) Marshal() (dAtA []byte, err error) {
  859. size := m.Size()
  860. dAtA = make([]byte, size)
  861. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  862. if err != nil {
  863. return nil, err
  864. }
  865. return dAtA[:n], nil
  866. }
  867. func (m *NebulaHandshakeDetails) MarshalTo(dAtA []byte) (int, error) {
  868. size := m.Size()
  869. return m.MarshalToSizedBuffer(dAtA[:size])
  870. }
  871. func (m *NebulaHandshakeDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  872. i := len(dAtA)
  873. _ = i
  874. var l int
  875. _ = l
  876. if m.Time != 0 {
  877. i = encodeVarintNebula(dAtA, i, uint64(m.Time))
  878. i--
  879. dAtA[i] = 0x28
  880. }
  881. if m.Cookie != 0 {
  882. i = encodeVarintNebula(dAtA, i, uint64(m.Cookie))
  883. i--
  884. dAtA[i] = 0x20
  885. }
  886. if m.ResponderIndex != 0 {
  887. i = encodeVarintNebula(dAtA, i, uint64(m.ResponderIndex))
  888. i--
  889. dAtA[i] = 0x18
  890. }
  891. if m.InitiatorIndex != 0 {
  892. i = encodeVarintNebula(dAtA, i, uint64(m.InitiatorIndex))
  893. i--
  894. dAtA[i] = 0x10
  895. }
  896. if len(m.Cert) > 0 {
  897. i -= len(m.Cert)
  898. copy(dAtA[i:], m.Cert)
  899. i = encodeVarintNebula(dAtA, i, uint64(len(m.Cert)))
  900. i--
  901. dAtA[i] = 0xa
  902. }
  903. return len(dAtA) - i, nil
  904. }
  905. func (m *NebulaControl) Marshal() (dAtA []byte, err error) {
  906. size := m.Size()
  907. dAtA = make([]byte, size)
  908. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  909. if err != nil {
  910. return nil, err
  911. }
  912. return dAtA[:n], nil
  913. }
  914. func (m *NebulaControl) MarshalTo(dAtA []byte) (int, error) {
  915. size := m.Size()
  916. return m.MarshalToSizedBuffer(dAtA[:size])
  917. }
  918. func (m *NebulaControl) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  919. i := len(dAtA)
  920. _ = i
  921. var l int
  922. _ = l
  923. if m.RelayFromIp != 0 {
  924. i = encodeVarintNebula(dAtA, i, uint64(m.RelayFromIp))
  925. i--
  926. dAtA[i] = 0x28
  927. }
  928. if m.RelayToIp != 0 {
  929. i = encodeVarintNebula(dAtA, i, uint64(m.RelayToIp))
  930. i--
  931. dAtA[i] = 0x20
  932. }
  933. if m.ResponderRelayIndex != 0 {
  934. i = encodeVarintNebula(dAtA, i, uint64(m.ResponderRelayIndex))
  935. i--
  936. dAtA[i] = 0x18
  937. }
  938. if m.InitiatorRelayIndex != 0 {
  939. i = encodeVarintNebula(dAtA, i, uint64(m.InitiatorRelayIndex))
  940. i--
  941. dAtA[i] = 0x10
  942. }
  943. if m.Type != 0 {
  944. i = encodeVarintNebula(dAtA, i, uint64(m.Type))
  945. i--
  946. dAtA[i] = 0x8
  947. }
  948. return len(dAtA) - i, nil
  949. }
  950. func encodeVarintNebula(dAtA []byte, offset int, v uint64) int {
  951. offset -= sovNebula(v)
  952. base := offset
  953. for v >= 1<<7 {
  954. dAtA[offset] = uint8(v&0x7f | 0x80)
  955. v >>= 7
  956. offset++
  957. }
  958. dAtA[offset] = uint8(v)
  959. return base
  960. }
  961. func (m *NebulaMeta) Size() (n int) {
  962. if m == nil {
  963. return 0
  964. }
  965. var l int
  966. _ = l
  967. if m.Type != 0 {
  968. n += 1 + sovNebula(uint64(m.Type))
  969. }
  970. if m.Details != nil {
  971. l = m.Details.Size()
  972. n += 1 + l + sovNebula(uint64(l))
  973. }
  974. return n
  975. }
  976. func (m *NebulaMetaDetails) Size() (n int) {
  977. if m == nil {
  978. return 0
  979. }
  980. var l int
  981. _ = l
  982. if m.VpnIp != 0 {
  983. n += 1 + sovNebula(uint64(m.VpnIp))
  984. }
  985. if len(m.Ip4AndPorts) > 0 {
  986. for _, e := range m.Ip4AndPorts {
  987. l = e.Size()
  988. n += 1 + l + sovNebula(uint64(l))
  989. }
  990. }
  991. if m.Counter != 0 {
  992. n += 1 + sovNebula(uint64(m.Counter))
  993. }
  994. if len(m.Ip6AndPorts) > 0 {
  995. for _, e := range m.Ip6AndPorts {
  996. l = e.Size()
  997. n += 1 + l + sovNebula(uint64(l))
  998. }
  999. }
  1000. if len(m.RelayVpnIp) > 0 {
  1001. l = 0
  1002. for _, e := range m.RelayVpnIp {
  1003. l += sovNebula(uint64(e))
  1004. }
  1005. n += 1 + sovNebula(uint64(l)) + l
  1006. }
  1007. return n
  1008. }
  1009. func (m *Ip4AndPort) Size() (n int) {
  1010. if m == nil {
  1011. return 0
  1012. }
  1013. var l int
  1014. _ = l
  1015. if m.Ip != 0 {
  1016. n += 1 + sovNebula(uint64(m.Ip))
  1017. }
  1018. if m.Port != 0 {
  1019. n += 1 + sovNebula(uint64(m.Port))
  1020. }
  1021. return n
  1022. }
  1023. func (m *Ip6AndPort) Size() (n int) {
  1024. if m == nil {
  1025. return 0
  1026. }
  1027. var l int
  1028. _ = l
  1029. if m.Hi != 0 {
  1030. n += 1 + sovNebula(uint64(m.Hi))
  1031. }
  1032. if m.Lo != 0 {
  1033. n += 1 + sovNebula(uint64(m.Lo))
  1034. }
  1035. if m.Port != 0 {
  1036. n += 1 + sovNebula(uint64(m.Port))
  1037. }
  1038. return n
  1039. }
  1040. func (m *NebulaPing) Size() (n int) {
  1041. if m == nil {
  1042. return 0
  1043. }
  1044. var l int
  1045. _ = l
  1046. if m.Type != 0 {
  1047. n += 1 + sovNebula(uint64(m.Type))
  1048. }
  1049. if m.Time != 0 {
  1050. n += 1 + sovNebula(uint64(m.Time))
  1051. }
  1052. return n
  1053. }
  1054. func (m *NebulaHandshake) Size() (n int) {
  1055. if m == nil {
  1056. return 0
  1057. }
  1058. var l int
  1059. _ = l
  1060. if m.Details != nil {
  1061. l = m.Details.Size()
  1062. n += 1 + l + sovNebula(uint64(l))
  1063. }
  1064. l = len(m.Hmac)
  1065. if l > 0 {
  1066. n += 1 + l + sovNebula(uint64(l))
  1067. }
  1068. return n
  1069. }
  1070. func (m *NebulaHandshakeDetails) Size() (n int) {
  1071. if m == nil {
  1072. return 0
  1073. }
  1074. var l int
  1075. _ = l
  1076. l = len(m.Cert)
  1077. if l > 0 {
  1078. n += 1 + l + sovNebula(uint64(l))
  1079. }
  1080. if m.InitiatorIndex != 0 {
  1081. n += 1 + sovNebula(uint64(m.InitiatorIndex))
  1082. }
  1083. if m.ResponderIndex != 0 {
  1084. n += 1 + sovNebula(uint64(m.ResponderIndex))
  1085. }
  1086. if m.Cookie != 0 {
  1087. n += 1 + sovNebula(uint64(m.Cookie))
  1088. }
  1089. if m.Time != 0 {
  1090. n += 1 + sovNebula(uint64(m.Time))
  1091. }
  1092. return n
  1093. }
  1094. func (m *NebulaControl) Size() (n int) {
  1095. if m == nil {
  1096. return 0
  1097. }
  1098. var l int
  1099. _ = l
  1100. if m.Type != 0 {
  1101. n += 1 + sovNebula(uint64(m.Type))
  1102. }
  1103. if m.InitiatorRelayIndex != 0 {
  1104. n += 1 + sovNebula(uint64(m.InitiatorRelayIndex))
  1105. }
  1106. if m.ResponderRelayIndex != 0 {
  1107. n += 1 + sovNebula(uint64(m.ResponderRelayIndex))
  1108. }
  1109. if m.RelayToIp != 0 {
  1110. n += 1 + sovNebula(uint64(m.RelayToIp))
  1111. }
  1112. if m.RelayFromIp != 0 {
  1113. n += 1 + sovNebula(uint64(m.RelayFromIp))
  1114. }
  1115. return n
  1116. }
  1117. func sovNebula(x uint64) (n int) {
  1118. return (math_bits.Len64(x|1) + 6) / 7
  1119. }
  1120. func sozNebula(x uint64) (n int) {
  1121. return sovNebula(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  1122. }
  1123. func (m *NebulaMeta) Unmarshal(dAtA []byte) error {
  1124. l := len(dAtA)
  1125. iNdEx := 0
  1126. for iNdEx < l {
  1127. preIndex := iNdEx
  1128. var wire uint64
  1129. for shift := uint(0); ; shift += 7 {
  1130. if shift >= 64 {
  1131. return ErrIntOverflowNebula
  1132. }
  1133. if iNdEx >= l {
  1134. return io.ErrUnexpectedEOF
  1135. }
  1136. b := dAtA[iNdEx]
  1137. iNdEx++
  1138. wire |= uint64(b&0x7F) << shift
  1139. if b < 0x80 {
  1140. break
  1141. }
  1142. }
  1143. fieldNum := int32(wire >> 3)
  1144. wireType := int(wire & 0x7)
  1145. if wireType == 4 {
  1146. return fmt.Errorf("proto: NebulaMeta: wiretype end group for non-group")
  1147. }
  1148. if fieldNum <= 0 {
  1149. return fmt.Errorf("proto: NebulaMeta: illegal tag %d (wire type %d)", fieldNum, wire)
  1150. }
  1151. switch fieldNum {
  1152. case 1:
  1153. if wireType != 0 {
  1154. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  1155. }
  1156. m.Type = 0
  1157. for shift := uint(0); ; shift += 7 {
  1158. if shift >= 64 {
  1159. return ErrIntOverflowNebula
  1160. }
  1161. if iNdEx >= l {
  1162. return io.ErrUnexpectedEOF
  1163. }
  1164. b := dAtA[iNdEx]
  1165. iNdEx++
  1166. m.Type |= NebulaMeta_MessageType(b&0x7F) << shift
  1167. if b < 0x80 {
  1168. break
  1169. }
  1170. }
  1171. case 2:
  1172. if wireType != 2 {
  1173. return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType)
  1174. }
  1175. var msglen int
  1176. for shift := uint(0); ; shift += 7 {
  1177. if shift >= 64 {
  1178. return ErrIntOverflowNebula
  1179. }
  1180. if iNdEx >= l {
  1181. return io.ErrUnexpectedEOF
  1182. }
  1183. b := dAtA[iNdEx]
  1184. iNdEx++
  1185. msglen |= int(b&0x7F) << shift
  1186. if b < 0x80 {
  1187. break
  1188. }
  1189. }
  1190. if msglen < 0 {
  1191. return ErrInvalidLengthNebula
  1192. }
  1193. postIndex := iNdEx + msglen
  1194. if postIndex < 0 {
  1195. return ErrInvalidLengthNebula
  1196. }
  1197. if postIndex > l {
  1198. return io.ErrUnexpectedEOF
  1199. }
  1200. if m.Details == nil {
  1201. m.Details = &NebulaMetaDetails{}
  1202. }
  1203. if err := m.Details.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1204. return err
  1205. }
  1206. iNdEx = postIndex
  1207. default:
  1208. iNdEx = preIndex
  1209. skippy, err := skipNebula(dAtA[iNdEx:])
  1210. if err != nil {
  1211. return err
  1212. }
  1213. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1214. return ErrInvalidLengthNebula
  1215. }
  1216. if (iNdEx + skippy) > l {
  1217. return io.ErrUnexpectedEOF
  1218. }
  1219. iNdEx += skippy
  1220. }
  1221. }
  1222. if iNdEx > l {
  1223. return io.ErrUnexpectedEOF
  1224. }
  1225. return nil
  1226. }
  1227. func (m *NebulaMetaDetails) Unmarshal(dAtA []byte) error {
  1228. l := len(dAtA)
  1229. iNdEx := 0
  1230. for iNdEx < l {
  1231. preIndex := iNdEx
  1232. var wire uint64
  1233. for shift := uint(0); ; shift += 7 {
  1234. if shift >= 64 {
  1235. return ErrIntOverflowNebula
  1236. }
  1237. if iNdEx >= l {
  1238. return io.ErrUnexpectedEOF
  1239. }
  1240. b := dAtA[iNdEx]
  1241. iNdEx++
  1242. wire |= uint64(b&0x7F) << shift
  1243. if b < 0x80 {
  1244. break
  1245. }
  1246. }
  1247. fieldNum := int32(wire >> 3)
  1248. wireType := int(wire & 0x7)
  1249. if wireType == 4 {
  1250. return fmt.Errorf("proto: NebulaMetaDetails: wiretype end group for non-group")
  1251. }
  1252. if fieldNum <= 0 {
  1253. return fmt.Errorf("proto: NebulaMetaDetails: illegal tag %d (wire type %d)", fieldNum, wire)
  1254. }
  1255. switch fieldNum {
  1256. case 1:
  1257. if wireType != 0 {
  1258. return fmt.Errorf("proto: wrong wireType = %d for field VpnIp", wireType)
  1259. }
  1260. m.VpnIp = 0
  1261. for shift := uint(0); ; shift += 7 {
  1262. if shift >= 64 {
  1263. return ErrIntOverflowNebula
  1264. }
  1265. if iNdEx >= l {
  1266. return io.ErrUnexpectedEOF
  1267. }
  1268. b := dAtA[iNdEx]
  1269. iNdEx++
  1270. m.VpnIp |= uint32(b&0x7F) << shift
  1271. if b < 0x80 {
  1272. break
  1273. }
  1274. }
  1275. case 2:
  1276. if wireType != 2 {
  1277. return fmt.Errorf("proto: wrong wireType = %d for field Ip4AndPorts", wireType)
  1278. }
  1279. var msglen int
  1280. for shift := uint(0); ; shift += 7 {
  1281. if shift >= 64 {
  1282. return ErrIntOverflowNebula
  1283. }
  1284. if iNdEx >= l {
  1285. return io.ErrUnexpectedEOF
  1286. }
  1287. b := dAtA[iNdEx]
  1288. iNdEx++
  1289. msglen |= int(b&0x7F) << shift
  1290. if b < 0x80 {
  1291. break
  1292. }
  1293. }
  1294. if msglen < 0 {
  1295. return ErrInvalidLengthNebula
  1296. }
  1297. postIndex := iNdEx + msglen
  1298. if postIndex < 0 {
  1299. return ErrInvalidLengthNebula
  1300. }
  1301. if postIndex > l {
  1302. return io.ErrUnexpectedEOF
  1303. }
  1304. m.Ip4AndPorts = append(m.Ip4AndPorts, &Ip4AndPort{})
  1305. if err := m.Ip4AndPorts[len(m.Ip4AndPorts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1306. return err
  1307. }
  1308. iNdEx = postIndex
  1309. case 3:
  1310. if wireType != 0 {
  1311. return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType)
  1312. }
  1313. m.Counter = 0
  1314. for shift := uint(0); ; shift += 7 {
  1315. if shift >= 64 {
  1316. return ErrIntOverflowNebula
  1317. }
  1318. if iNdEx >= l {
  1319. return io.ErrUnexpectedEOF
  1320. }
  1321. b := dAtA[iNdEx]
  1322. iNdEx++
  1323. m.Counter |= uint32(b&0x7F) << shift
  1324. if b < 0x80 {
  1325. break
  1326. }
  1327. }
  1328. case 4:
  1329. if wireType != 2 {
  1330. return fmt.Errorf("proto: wrong wireType = %d for field Ip6AndPorts", wireType)
  1331. }
  1332. var msglen int
  1333. for shift := uint(0); ; shift += 7 {
  1334. if shift >= 64 {
  1335. return ErrIntOverflowNebula
  1336. }
  1337. if iNdEx >= l {
  1338. return io.ErrUnexpectedEOF
  1339. }
  1340. b := dAtA[iNdEx]
  1341. iNdEx++
  1342. msglen |= int(b&0x7F) << shift
  1343. if b < 0x80 {
  1344. break
  1345. }
  1346. }
  1347. if msglen < 0 {
  1348. return ErrInvalidLengthNebula
  1349. }
  1350. postIndex := iNdEx + msglen
  1351. if postIndex < 0 {
  1352. return ErrInvalidLengthNebula
  1353. }
  1354. if postIndex > l {
  1355. return io.ErrUnexpectedEOF
  1356. }
  1357. m.Ip6AndPorts = append(m.Ip6AndPorts, &Ip6AndPort{})
  1358. if err := m.Ip6AndPorts[len(m.Ip6AndPorts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1359. return err
  1360. }
  1361. iNdEx = postIndex
  1362. case 5:
  1363. if wireType == 0 {
  1364. var v uint32
  1365. for shift := uint(0); ; shift += 7 {
  1366. if shift >= 64 {
  1367. return ErrIntOverflowNebula
  1368. }
  1369. if iNdEx >= l {
  1370. return io.ErrUnexpectedEOF
  1371. }
  1372. b := dAtA[iNdEx]
  1373. iNdEx++
  1374. v |= uint32(b&0x7F) << shift
  1375. if b < 0x80 {
  1376. break
  1377. }
  1378. }
  1379. m.RelayVpnIp = append(m.RelayVpnIp, v)
  1380. } else if wireType == 2 {
  1381. var packedLen int
  1382. for shift := uint(0); ; shift += 7 {
  1383. if shift >= 64 {
  1384. return ErrIntOverflowNebula
  1385. }
  1386. if iNdEx >= l {
  1387. return io.ErrUnexpectedEOF
  1388. }
  1389. b := dAtA[iNdEx]
  1390. iNdEx++
  1391. packedLen |= int(b&0x7F) << shift
  1392. if b < 0x80 {
  1393. break
  1394. }
  1395. }
  1396. if packedLen < 0 {
  1397. return ErrInvalidLengthNebula
  1398. }
  1399. postIndex := iNdEx + packedLen
  1400. if postIndex < 0 {
  1401. return ErrInvalidLengthNebula
  1402. }
  1403. if postIndex > l {
  1404. return io.ErrUnexpectedEOF
  1405. }
  1406. var elementCount int
  1407. var count int
  1408. for _, integer := range dAtA[iNdEx:postIndex] {
  1409. if integer < 128 {
  1410. count++
  1411. }
  1412. }
  1413. elementCount = count
  1414. if elementCount != 0 && len(m.RelayVpnIp) == 0 {
  1415. m.RelayVpnIp = make([]uint32, 0, elementCount)
  1416. }
  1417. for iNdEx < postIndex {
  1418. var v uint32
  1419. for shift := uint(0); ; shift += 7 {
  1420. if shift >= 64 {
  1421. return ErrIntOverflowNebula
  1422. }
  1423. if iNdEx >= l {
  1424. return io.ErrUnexpectedEOF
  1425. }
  1426. b := dAtA[iNdEx]
  1427. iNdEx++
  1428. v |= uint32(b&0x7F) << shift
  1429. if b < 0x80 {
  1430. break
  1431. }
  1432. }
  1433. m.RelayVpnIp = append(m.RelayVpnIp, v)
  1434. }
  1435. } else {
  1436. return fmt.Errorf("proto: wrong wireType = %d for field RelayVpnIp", wireType)
  1437. }
  1438. default:
  1439. iNdEx = preIndex
  1440. skippy, err := skipNebula(dAtA[iNdEx:])
  1441. if err != nil {
  1442. return err
  1443. }
  1444. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1445. return ErrInvalidLengthNebula
  1446. }
  1447. if (iNdEx + skippy) > l {
  1448. return io.ErrUnexpectedEOF
  1449. }
  1450. iNdEx += skippy
  1451. }
  1452. }
  1453. if iNdEx > l {
  1454. return io.ErrUnexpectedEOF
  1455. }
  1456. return nil
  1457. }
  1458. func (m *Ip4AndPort) Unmarshal(dAtA []byte) error {
  1459. l := len(dAtA)
  1460. iNdEx := 0
  1461. for iNdEx < l {
  1462. preIndex := iNdEx
  1463. var wire uint64
  1464. for shift := uint(0); ; shift += 7 {
  1465. if shift >= 64 {
  1466. return ErrIntOverflowNebula
  1467. }
  1468. if iNdEx >= l {
  1469. return io.ErrUnexpectedEOF
  1470. }
  1471. b := dAtA[iNdEx]
  1472. iNdEx++
  1473. wire |= uint64(b&0x7F) << shift
  1474. if b < 0x80 {
  1475. break
  1476. }
  1477. }
  1478. fieldNum := int32(wire >> 3)
  1479. wireType := int(wire & 0x7)
  1480. if wireType == 4 {
  1481. return fmt.Errorf("proto: Ip4AndPort: wiretype end group for non-group")
  1482. }
  1483. if fieldNum <= 0 {
  1484. return fmt.Errorf("proto: Ip4AndPort: illegal tag %d (wire type %d)", fieldNum, wire)
  1485. }
  1486. switch fieldNum {
  1487. case 1:
  1488. if wireType != 0 {
  1489. return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType)
  1490. }
  1491. m.Ip = 0
  1492. for shift := uint(0); ; shift += 7 {
  1493. if shift >= 64 {
  1494. return ErrIntOverflowNebula
  1495. }
  1496. if iNdEx >= l {
  1497. return io.ErrUnexpectedEOF
  1498. }
  1499. b := dAtA[iNdEx]
  1500. iNdEx++
  1501. m.Ip |= uint32(b&0x7F) << shift
  1502. if b < 0x80 {
  1503. break
  1504. }
  1505. }
  1506. case 2:
  1507. if wireType != 0 {
  1508. return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType)
  1509. }
  1510. m.Port = 0
  1511. for shift := uint(0); ; shift += 7 {
  1512. if shift >= 64 {
  1513. return ErrIntOverflowNebula
  1514. }
  1515. if iNdEx >= l {
  1516. return io.ErrUnexpectedEOF
  1517. }
  1518. b := dAtA[iNdEx]
  1519. iNdEx++
  1520. m.Port |= uint32(b&0x7F) << shift
  1521. if b < 0x80 {
  1522. break
  1523. }
  1524. }
  1525. default:
  1526. iNdEx = preIndex
  1527. skippy, err := skipNebula(dAtA[iNdEx:])
  1528. if err != nil {
  1529. return err
  1530. }
  1531. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1532. return ErrInvalidLengthNebula
  1533. }
  1534. if (iNdEx + skippy) > l {
  1535. return io.ErrUnexpectedEOF
  1536. }
  1537. iNdEx += skippy
  1538. }
  1539. }
  1540. if iNdEx > l {
  1541. return io.ErrUnexpectedEOF
  1542. }
  1543. return nil
  1544. }
  1545. func (m *Ip6AndPort) Unmarshal(dAtA []byte) error {
  1546. l := len(dAtA)
  1547. iNdEx := 0
  1548. for iNdEx < l {
  1549. preIndex := iNdEx
  1550. var wire uint64
  1551. for shift := uint(0); ; shift += 7 {
  1552. if shift >= 64 {
  1553. return ErrIntOverflowNebula
  1554. }
  1555. if iNdEx >= l {
  1556. return io.ErrUnexpectedEOF
  1557. }
  1558. b := dAtA[iNdEx]
  1559. iNdEx++
  1560. wire |= uint64(b&0x7F) << shift
  1561. if b < 0x80 {
  1562. break
  1563. }
  1564. }
  1565. fieldNum := int32(wire >> 3)
  1566. wireType := int(wire & 0x7)
  1567. if wireType == 4 {
  1568. return fmt.Errorf("proto: Ip6AndPort: wiretype end group for non-group")
  1569. }
  1570. if fieldNum <= 0 {
  1571. return fmt.Errorf("proto: Ip6AndPort: illegal tag %d (wire type %d)", fieldNum, wire)
  1572. }
  1573. switch fieldNum {
  1574. case 1:
  1575. if wireType != 0 {
  1576. return fmt.Errorf("proto: wrong wireType = %d for field Hi", wireType)
  1577. }
  1578. m.Hi = 0
  1579. for shift := uint(0); ; shift += 7 {
  1580. if shift >= 64 {
  1581. return ErrIntOverflowNebula
  1582. }
  1583. if iNdEx >= l {
  1584. return io.ErrUnexpectedEOF
  1585. }
  1586. b := dAtA[iNdEx]
  1587. iNdEx++
  1588. m.Hi |= uint64(b&0x7F) << shift
  1589. if b < 0x80 {
  1590. break
  1591. }
  1592. }
  1593. case 2:
  1594. if wireType != 0 {
  1595. return fmt.Errorf("proto: wrong wireType = %d for field Lo", wireType)
  1596. }
  1597. m.Lo = 0
  1598. for shift := uint(0); ; shift += 7 {
  1599. if shift >= 64 {
  1600. return ErrIntOverflowNebula
  1601. }
  1602. if iNdEx >= l {
  1603. return io.ErrUnexpectedEOF
  1604. }
  1605. b := dAtA[iNdEx]
  1606. iNdEx++
  1607. m.Lo |= uint64(b&0x7F) << shift
  1608. if b < 0x80 {
  1609. break
  1610. }
  1611. }
  1612. case 3:
  1613. if wireType != 0 {
  1614. return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType)
  1615. }
  1616. m.Port = 0
  1617. for shift := uint(0); ; shift += 7 {
  1618. if shift >= 64 {
  1619. return ErrIntOverflowNebula
  1620. }
  1621. if iNdEx >= l {
  1622. return io.ErrUnexpectedEOF
  1623. }
  1624. b := dAtA[iNdEx]
  1625. iNdEx++
  1626. m.Port |= uint32(b&0x7F) << shift
  1627. if b < 0x80 {
  1628. break
  1629. }
  1630. }
  1631. default:
  1632. iNdEx = preIndex
  1633. skippy, err := skipNebula(dAtA[iNdEx:])
  1634. if err != nil {
  1635. return err
  1636. }
  1637. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1638. return ErrInvalidLengthNebula
  1639. }
  1640. if (iNdEx + skippy) > l {
  1641. return io.ErrUnexpectedEOF
  1642. }
  1643. iNdEx += skippy
  1644. }
  1645. }
  1646. if iNdEx > l {
  1647. return io.ErrUnexpectedEOF
  1648. }
  1649. return nil
  1650. }
  1651. func (m *NebulaPing) Unmarshal(dAtA []byte) error {
  1652. l := len(dAtA)
  1653. iNdEx := 0
  1654. for iNdEx < l {
  1655. preIndex := iNdEx
  1656. var wire uint64
  1657. for shift := uint(0); ; shift += 7 {
  1658. if shift >= 64 {
  1659. return ErrIntOverflowNebula
  1660. }
  1661. if iNdEx >= l {
  1662. return io.ErrUnexpectedEOF
  1663. }
  1664. b := dAtA[iNdEx]
  1665. iNdEx++
  1666. wire |= uint64(b&0x7F) << shift
  1667. if b < 0x80 {
  1668. break
  1669. }
  1670. }
  1671. fieldNum := int32(wire >> 3)
  1672. wireType := int(wire & 0x7)
  1673. if wireType == 4 {
  1674. return fmt.Errorf("proto: NebulaPing: wiretype end group for non-group")
  1675. }
  1676. if fieldNum <= 0 {
  1677. return fmt.Errorf("proto: NebulaPing: illegal tag %d (wire type %d)", fieldNum, wire)
  1678. }
  1679. switch fieldNum {
  1680. case 1:
  1681. if wireType != 0 {
  1682. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  1683. }
  1684. m.Type = 0
  1685. for shift := uint(0); ; shift += 7 {
  1686. if shift >= 64 {
  1687. return ErrIntOverflowNebula
  1688. }
  1689. if iNdEx >= l {
  1690. return io.ErrUnexpectedEOF
  1691. }
  1692. b := dAtA[iNdEx]
  1693. iNdEx++
  1694. m.Type |= NebulaPing_MessageType(b&0x7F) << shift
  1695. if b < 0x80 {
  1696. break
  1697. }
  1698. }
  1699. case 2:
  1700. if wireType != 0 {
  1701. return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
  1702. }
  1703. m.Time = 0
  1704. for shift := uint(0); ; shift += 7 {
  1705. if shift >= 64 {
  1706. return ErrIntOverflowNebula
  1707. }
  1708. if iNdEx >= l {
  1709. return io.ErrUnexpectedEOF
  1710. }
  1711. b := dAtA[iNdEx]
  1712. iNdEx++
  1713. m.Time |= uint64(b&0x7F) << shift
  1714. if b < 0x80 {
  1715. break
  1716. }
  1717. }
  1718. default:
  1719. iNdEx = preIndex
  1720. skippy, err := skipNebula(dAtA[iNdEx:])
  1721. if err != nil {
  1722. return err
  1723. }
  1724. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1725. return ErrInvalidLengthNebula
  1726. }
  1727. if (iNdEx + skippy) > l {
  1728. return io.ErrUnexpectedEOF
  1729. }
  1730. iNdEx += skippy
  1731. }
  1732. }
  1733. if iNdEx > l {
  1734. return io.ErrUnexpectedEOF
  1735. }
  1736. return nil
  1737. }
  1738. func (m *NebulaHandshake) Unmarshal(dAtA []byte) error {
  1739. l := len(dAtA)
  1740. iNdEx := 0
  1741. for iNdEx < l {
  1742. preIndex := iNdEx
  1743. var wire uint64
  1744. for shift := uint(0); ; shift += 7 {
  1745. if shift >= 64 {
  1746. return ErrIntOverflowNebula
  1747. }
  1748. if iNdEx >= l {
  1749. return io.ErrUnexpectedEOF
  1750. }
  1751. b := dAtA[iNdEx]
  1752. iNdEx++
  1753. wire |= uint64(b&0x7F) << shift
  1754. if b < 0x80 {
  1755. break
  1756. }
  1757. }
  1758. fieldNum := int32(wire >> 3)
  1759. wireType := int(wire & 0x7)
  1760. if wireType == 4 {
  1761. return fmt.Errorf("proto: NebulaHandshake: wiretype end group for non-group")
  1762. }
  1763. if fieldNum <= 0 {
  1764. return fmt.Errorf("proto: NebulaHandshake: illegal tag %d (wire type %d)", fieldNum, wire)
  1765. }
  1766. switch fieldNum {
  1767. case 1:
  1768. if wireType != 2 {
  1769. return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType)
  1770. }
  1771. var msglen int
  1772. for shift := uint(0); ; shift += 7 {
  1773. if shift >= 64 {
  1774. return ErrIntOverflowNebula
  1775. }
  1776. if iNdEx >= l {
  1777. return io.ErrUnexpectedEOF
  1778. }
  1779. b := dAtA[iNdEx]
  1780. iNdEx++
  1781. msglen |= int(b&0x7F) << shift
  1782. if b < 0x80 {
  1783. break
  1784. }
  1785. }
  1786. if msglen < 0 {
  1787. return ErrInvalidLengthNebula
  1788. }
  1789. postIndex := iNdEx + msglen
  1790. if postIndex < 0 {
  1791. return ErrInvalidLengthNebula
  1792. }
  1793. if postIndex > l {
  1794. return io.ErrUnexpectedEOF
  1795. }
  1796. if m.Details == nil {
  1797. m.Details = &NebulaHandshakeDetails{}
  1798. }
  1799. if err := m.Details.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1800. return err
  1801. }
  1802. iNdEx = postIndex
  1803. case 2:
  1804. if wireType != 2 {
  1805. return fmt.Errorf("proto: wrong wireType = %d for field Hmac", wireType)
  1806. }
  1807. var byteLen int
  1808. for shift := uint(0); ; shift += 7 {
  1809. if shift >= 64 {
  1810. return ErrIntOverflowNebula
  1811. }
  1812. if iNdEx >= l {
  1813. return io.ErrUnexpectedEOF
  1814. }
  1815. b := dAtA[iNdEx]
  1816. iNdEx++
  1817. byteLen |= int(b&0x7F) << shift
  1818. if b < 0x80 {
  1819. break
  1820. }
  1821. }
  1822. if byteLen < 0 {
  1823. return ErrInvalidLengthNebula
  1824. }
  1825. postIndex := iNdEx + byteLen
  1826. if postIndex < 0 {
  1827. return ErrInvalidLengthNebula
  1828. }
  1829. if postIndex > l {
  1830. return io.ErrUnexpectedEOF
  1831. }
  1832. m.Hmac = append(m.Hmac[:0], dAtA[iNdEx:postIndex]...)
  1833. if m.Hmac == nil {
  1834. m.Hmac = []byte{}
  1835. }
  1836. iNdEx = postIndex
  1837. default:
  1838. iNdEx = preIndex
  1839. skippy, err := skipNebula(dAtA[iNdEx:])
  1840. if err != nil {
  1841. return err
  1842. }
  1843. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1844. return ErrInvalidLengthNebula
  1845. }
  1846. if (iNdEx + skippy) > l {
  1847. return io.ErrUnexpectedEOF
  1848. }
  1849. iNdEx += skippy
  1850. }
  1851. }
  1852. if iNdEx > l {
  1853. return io.ErrUnexpectedEOF
  1854. }
  1855. return nil
  1856. }
  1857. func (m *NebulaHandshakeDetails) Unmarshal(dAtA []byte) error {
  1858. l := len(dAtA)
  1859. iNdEx := 0
  1860. for iNdEx < l {
  1861. preIndex := iNdEx
  1862. var wire uint64
  1863. for shift := uint(0); ; shift += 7 {
  1864. if shift >= 64 {
  1865. return ErrIntOverflowNebula
  1866. }
  1867. if iNdEx >= l {
  1868. return io.ErrUnexpectedEOF
  1869. }
  1870. b := dAtA[iNdEx]
  1871. iNdEx++
  1872. wire |= uint64(b&0x7F) << shift
  1873. if b < 0x80 {
  1874. break
  1875. }
  1876. }
  1877. fieldNum := int32(wire >> 3)
  1878. wireType := int(wire & 0x7)
  1879. if wireType == 4 {
  1880. return fmt.Errorf("proto: NebulaHandshakeDetails: wiretype end group for non-group")
  1881. }
  1882. if fieldNum <= 0 {
  1883. return fmt.Errorf("proto: NebulaHandshakeDetails: illegal tag %d (wire type %d)", fieldNum, wire)
  1884. }
  1885. switch fieldNum {
  1886. case 1:
  1887. if wireType != 2 {
  1888. return fmt.Errorf("proto: wrong wireType = %d for field Cert", wireType)
  1889. }
  1890. var byteLen int
  1891. for shift := uint(0); ; shift += 7 {
  1892. if shift >= 64 {
  1893. return ErrIntOverflowNebula
  1894. }
  1895. if iNdEx >= l {
  1896. return io.ErrUnexpectedEOF
  1897. }
  1898. b := dAtA[iNdEx]
  1899. iNdEx++
  1900. byteLen |= int(b&0x7F) << shift
  1901. if b < 0x80 {
  1902. break
  1903. }
  1904. }
  1905. if byteLen < 0 {
  1906. return ErrInvalidLengthNebula
  1907. }
  1908. postIndex := iNdEx + byteLen
  1909. if postIndex < 0 {
  1910. return ErrInvalidLengthNebula
  1911. }
  1912. if postIndex > l {
  1913. return io.ErrUnexpectedEOF
  1914. }
  1915. m.Cert = append(m.Cert[:0], dAtA[iNdEx:postIndex]...)
  1916. if m.Cert == nil {
  1917. m.Cert = []byte{}
  1918. }
  1919. iNdEx = postIndex
  1920. case 2:
  1921. if wireType != 0 {
  1922. return fmt.Errorf("proto: wrong wireType = %d for field InitiatorIndex", wireType)
  1923. }
  1924. m.InitiatorIndex = 0
  1925. for shift := uint(0); ; shift += 7 {
  1926. if shift >= 64 {
  1927. return ErrIntOverflowNebula
  1928. }
  1929. if iNdEx >= l {
  1930. return io.ErrUnexpectedEOF
  1931. }
  1932. b := dAtA[iNdEx]
  1933. iNdEx++
  1934. m.InitiatorIndex |= uint32(b&0x7F) << shift
  1935. if b < 0x80 {
  1936. break
  1937. }
  1938. }
  1939. case 3:
  1940. if wireType != 0 {
  1941. return fmt.Errorf("proto: wrong wireType = %d for field ResponderIndex", wireType)
  1942. }
  1943. m.ResponderIndex = 0
  1944. for shift := uint(0); ; shift += 7 {
  1945. if shift >= 64 {
  1946. return ErrIntOverflowNebula
  1947. }
  1948. if iNdEx >= l {
  1949. return io.ErrUnexpectedEOF
  1950. }
  1951. b := dAtA[iNdEx]
  1952. iNdEx++
  1953. m.ResponderIndex |= uint32(b&0x7F) << shift
  1954. if b < 0x80 {
  1955. break
  1956. }
  1957. }
  1958. case 4:
  1959. if wireType != 0 {
  1960. return fmt.Errorf("proto: wrong wireType = %d for field Cookie", wireType)
  1961. }
  1962. m.Cookie = 0
  1963. for shift := uint(0); ; shift += 7 {
  1964. if shift >= 64 {
  1965. return ErrIntOverflowNebula
  1966. }
  1967. if iNdEx >= l {
  1968. return io.ErrUnexpectedEOF
  1969. }
  1970. b := dAtA[iNdEx]
  1971. iNdEx++
  1972. m.Cookie |= uint64(b&0x7F) << shift
  1973. if b < 0x80 {
  1974. break
  1975. }
  1976. }
  1977. case 5:
  1978. if wireType != 0 {
  1979. return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
  1980. }
  1981. m.Time = 0
  1982. for shift := uint(0); ; shift += 7 {
  1983. if shift >= 64 {
  1984. return ErrIntOverflowNebula
  1985. }
  1986. if iNdEx >= l {
  1987. return io.ErrUnexpectedEOF
  1988. }
  1989. b := dAtA[iNdEx]
  1990. iNdEx++
  1991. m.Time |= uint64(b&0x7F) << shift
  1992. if b < 0x80 {
  1993. break
  1994. }
  1995. }
  1996. default:
  1997. iNdEx = preIndex
  1998. skippy, err := skipNebula(dAtA[iNdEx:])
  1999. if err != nil {
  2000. return err
  2001. }
  2002. if (skippy < 0) || (iNdEx+skippy) < 0 {
  2003. return ErrInvalidLengthNebula
  2004. }
  2005. if (iNdEx + skippy) > l {
  2006. return io.ErrUnexpectedEOF
  2007. }
  2008. iNdEx += skippy
  2009. }
  2010. }
  2011. if iNdEx > l {
  2012. return io.ErrUnexpectedEOF
  2013. }
  2014. return nil
  2015. }
  2016. func (m *NebulaControl) Unmarshal(dAtA []byte) error {
  2017. l := len(dAtA)
  2018. iNdEx := 0
  2019. for iNdEx < l {
  2020. preIndex := iNdEx
  2021. var wire uint64
  2022. for shift := uint(0); ; shift += 7 {
  2023. if shift >= 64 {
  2024. return ErrIntOverflowNebula
  2025. }
  2026. if iNdEx >= l {
  2027. return io.ErrUnexpectedEOF
  2028. }
  2029. b := dAtA[iNdEx]
  2030. iNdEx++
  2031. wire |= uint64(b&0x7F) << shift
  2032. if b < 0x80 {
  2033. break
  2034. }
  2035. }
  2036. fieldNum := int32(wire >> 3)
  2037. wireType := int(wire & 0x7)
  2038. if wireType == 4 {
  2039. return fmt.Errorf("proto: NebulaControl: wiretype end group for non-group")
  2040. }
  2041. if fieldNum <= 0 {
  2042. return fmt.Errorf("proto: NebulaControl: illegal tag %d (wire type %d)", fieldNum, wire)
  2043. }
  2044. switch fieldNum {
  2045. case 1:
  2046. if wireType != 0 {
  2047. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  2048. }
  2049. m.Type = 0
  2050. for shift := uint(0); ; shift += 7 {
  2051. if shift >= 64 {
  2052. return ErrIntOverflowNebula
  2053. }
  2054. if iNdEx >= l {
  2055. return io.ErrUnexpectedEOF
  2056. }
  2057. b := dAtA[iNdEx]
  2058. iNdEx++
  2059. m.Type |= NebulaControl_MessageType(b&0x7F) << shift
  2060. if b < 0x80 {
  2061. break
  2062. }
  2063. }
  2064. case 2:
  2065. if wireType != 0 {
  2066. return fmt.Errorf("proto: wrong wireType = %d for field InitiatorRelayIndex", wireType)
  2067. }
  2068. m.InitiatorRelayIndex = 0
  2069. for shift := uint(0); ; shift += 7 {
  2070. if shift >= 64 {
  2071. return ErrIntOverflowNebula
  2072. }
  2073. if iNdEx >= l {
  2074. return io.ErrUnexpectedEOF
  2075. }
  2076. b := dAtA[iNdEx]
  2077. iNdEx++
  2078. m.InitiatorRelayIndex |= uint32(b&0x7F) << shift
  2079. if b < 0x80 {
  2080. break
  2081. }
  2082. }
  2083. case 3:
  2084. if wireType != 0 {
  2085. return fmt.Errorf("proto: wrong wireType = %d for field ResponderRelayIndex", wireType)
  2086. }
  2087. m.ResponderRelayIndex = 0
  2088. for shift := uint(0); ; shift += 7 {
  2089. if shift >= 64 {
  2090. return ErrIntOverflowNebula
  2091. }
  2092. if iNdEx >= l {
  2093. return io.ErrUnexpectedEOF
  2094. }
  2095. b := dAtA[iNdEx]
  2096. iNdEx++
  2097. m.ResponderRelayIndex |= uint32(b&0x7F) << shift
  2098. if b < 0x80 {
  2099. break
  2100. }
  2101. }
  2102. case 4:
  2103. if wireType != 0 {
  2104. return fmt.Errorf("proto: wrong wireType = %d for field RelayToIp", wireType)
  2105. }
  2106. m.RelayToIp = 0
  2107. for shift := uint(0); ; shift += 7 {
  2108. if shift >= 64 {
  2109. return ErrIntOverflowNebula
  2110. }
  2111. if iNdEx >= l {
  2112. return io.ErrUnexpectedEOF
  2113. }
  2114. b := dAtA[iNdEx]
  2115. iNdEx++
  2116. m.RelayToIp |= uint32(b&0x7F) << shift
  2117. if b < 0x80 {
  2118. break
  2119. }
  2120. }
  2121. case 5:
  2122. if wireType != 0 {
  2123. return fmt.Errorf("proto: wrong wireType = %d for field RelayFromIp", wireType)
  2124. }
  2125. m.RelayFromIp = 0
  2126. for shift := uint(0); ; shift += 7 {
  2127. if shift >= 64 {
  2128. return ErrIntOverflowNebula
  2129. }
  2130. if iNdEx >= l {
  2131. return io.ErrUnexpectedEOF
  2132. }
  2133. b := dAtA[iNdEx]
  2134. iNdEx++
  2135. m.RelayFromIp |= uint32(b&0x7F) << shift
  2136. if b < 0x80 {
  2137. break
  2138. }
  2139. }
  2140. default:
  2141. iNdEx = preIndex
  2142. skippy, err := skipNebula(dAtA[iNdEx:])
  2143. if err != nil {
  2144. return err
  2145. }
  2146. if (skippy < 0) || (iNdEx+skippy) < 0 {
  2147. return ErrInvalidLengthNebula
  2148. }
  2149. if (iNdEx + skippy) > l {
  2150. return io.ErrUnexpectedEOF
  2151. }
  2152. iNdEx += skippy
  2153. }
  2154. }
  2155. if iNdEx > l {
  2156. return io.ErrUnexpectedEOF
  2157. }
  2158. return nil
  2159. }
  2160. func skipNebula(dAtA []byte) (n int, err error) {
  2161. l := len(dAtA)
  2162. iNdEx := 0
  2163. depth := 0
  2164. for iNdEx < l {
  2165. var wire uint64
  2166. for shift := uint(0); ; shift += 7 {
  2167. if shift >= 64 {
  2168. return 0, ErrIntOverflowNebula
  2169. }
  2170. if iNdEx >= l {
  2171. return 0, io.ErrUnexpectedEOF
  2172. }
  2173. b := dAtA[iNdEx]
  2174. iNdEx++
  2175. wire |= (uint64(b) & 0x7F) << shift
  2176. if b < 0x80 {
  2177. break
  2178. }
  2179. }
  2180. wireType := int(wire & 0x7)
  2181. switch wireType {
  2182. case 0:
  2183. for shift := uint(0); ; shift += 7 {
  2184. if shift >= 64 {
  2185. return 0, ErrIntOverflowNebula
  2186. }
  2187. if iNdEx >= l {
  2188. return 0, io.ErrUnexpectedEOF
  2189. }
  2190. iNdEx++
  2191. if dAtA[iNdEx-1] < 0x80 {
  2192. break
  2193. }
  2194. }
  2195. case 1:
  2196. iNdEx += 8
  2197. case 2:
  2198. var length int
  2199. for shift := uint(0); ; shift += 7 {
  2200. if shift >= 64 {
  2201. return 0, ErrIntOverflowNebula
  2202. }
  2203. if iNdEx >= l {
  2204. return 0, io.ErrUnexpectedEOF
  2205. }
  2206. b := dAtA[iNdEx]
  2207. iNdEx++
  2208. length |= (int(b) & 0x7F) << shift
  2209. if b < 0x80 {
  2210. break
  2211. }
  2212. }
  2213. if length < 0 {
  2214. return 0, ErrInvalidLengthNebula
  2215. }
  2216. iNdEx += length
  2217. case 3:
  2218. depth++
  2219. case 4:
  2220. if depth == 0 {
  2221. return 0, ErrUnexpectedEndOfGroupNebula
  2222. }
  2223. depth--
  2224. case 5:
  2225. iNdEx += 4
  2226. default:
  2227. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  2228. }
  2229. if iNdEx < 0 {
  2230. return 0, ErrInvalidLengthNebula
  2231. }
  2232. if depth == 0 {
  2233. return iNdEx, nil
  2234. }
  2235. }
  2236. return 0, io.ErrUnexpectedEOF
  2237. }
  2238. var (
  2239. ErrInvalidLengthNebula = fmt.Errorf("proto: negative length found during unmarshaling")
  2240. ErrIntOverflowNebula = fmt.Errorf("proto: integer overflow")
  2241. ErrUnexpectedEndOfGroupNebula = fmt.Errorf("proto: unexpected end of group")
  2242. )