3
0

nebula.pb.go 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919
  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 NebulaMeta struct {
  83. Type NebulaMeta_MessageType `protobuf:"varint,1,opt,name=Type,proto3,enum=nebula.NebulaMeta_MessageType" json:"Type,omitempty"`
  84. Details *NebulaMetaDetails `protobuf:"bytes,2,opt,name=Details,proto3" json:"Details,omitempty"`
  85. }
  86. func (m *NebulaMeta) Reset() { *m = NebulaMeta{} }
  87. func (m *NebulaMeta) String() string { return proto.CompactTextString(m) }
  88. func (*NebulaMeta) ProtoMessage() {}
  89. func (*NebulaMeta) Descriptor() ([]byte, []int) {
  90. return fileDescriptor_2d65afa7693df5ef, []int{0}
  91. }
  92. func (m *NebulaMeta) XXX_Unmarshal(b []byte) error {
  93. return m.Unmarshal(b)
  94. }
  95. func (m *NebulaMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  96. if deterministic {
  97. return xxx_messageInfo_NebulaMeta.Marshal(b, m, deterministic)
  98. } else {
  99. b = b[:cap(b)]
  100. n, err := m.MarshalToSizedBuffer(b)
  101. if err != nil {
  102. return nil, err
  103. }
  104. return b[:n], nil
  105. }
  106. }
  107. func (m *NebulaMeta) XXX_Merge(src proto.Message) {
  108. xxx_messageInfo_NebulaMeta.Merge(m, src)
  109. }
  110. func (m *NebulaMeta) XXX_Size() int {
  111. return m.Size()
  112. }
  113. func (m *NebulaMeta) XXX_DiscardUnknown() {
  114. xxx_messageInfo_NebulaMeta.DiscardUnknown(m)
  115. }
  116. var xxx_messageInfo_NebulaMeta proto.InternalMessageInfo
  117. func (m *NebulaMeta) GetType() NebulaMeta_MessageType {
  118. if m != nil {
  119. return m.Type
  120. }
  121. return NebulaMeta_None
  122. }
  123. func (m *NebulaMeta) GetDetails() *NebulaMetaDetails {
  124. if m != nil {
  125. return m.Details
  126. }
  127. return nil
  128. }
  129. type NebulaMetaDetails struct {
  130. VpnIp uint32 `protobuf:"varint,1,opt,name=VpnIp,proto3" json:"VpnIp,omitempty"`
  131. Ip4AndPorts []*Ip4AndPort `protobuf:"bytes,2,rep,name=Ip4AndPorts,proto3" json:"Ip4AndPorts,omitempty"`
  132. Ip6AndPorts []*Ip6AndPort `protobuf:"bytes,4,rep,name=Ip6AndPorts,proto3" json:"Ip6AndPorts,omitempty"`
  133. Counter uint32 `protobuf:"varint,3,opt,name=counter,proto3" json:"counter,omitempty"`
  134. }
  135. func (m *NebulaMetaDetails) Reset() { *m = NebulaMetaDetails{} }
  136. func (m *NebulaMetaDetails) String() string { return proto.CompactTextString(m) }
  137. func (*NebulaMetaDetails) ProtoMessage() {}
  138. func (*NebulaMetaDetails) Descriptor() ([]byte, []int) {
  139. return fileDescriptor_2d65afa7693df5ef, []int{1}
  140. }
  141. func (m *NebulaMetaDetails) XXX_Unmarshal(b []byte) error {
  142. return m.Unmarshal(b)
  143. }
  144. func (m *NebulaMetaDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  145. if deterministic {
  146. return xxx_messageInfo_NebulaMetaDetails.Marshal(b, m, deterministic)
  147. } else {
  148. b = b[:cap(b)]
  149. n, err := m.MarshalToSizedBuffer(b)
  150. if err != nil {
  151. return nil, err
  152. }
  153. return b[:n], nil
  154. }
  155. }
  156. func (m *NebulaMetaDetails) XXX_Merge(src proto.Message) {
  157. xxx_messageInfo_NebulaMetaDetails.Merge(m, src)
  158. }
  159. func (m *NebulaMetaDetails) XXX_Size() int {
  160. return m.Size()
  161. }
  162. func (m *NebulaMetaDetails) XXX_DiscardUnknown() {
  163. xxx_messageInfo_NebulaMetaDetails.DiscardUnknown(m)
  164. }
  165. var xxx_messageInfo_NebulaMetaDetails proto.InternalMessageInfo
  166. func (m *NebulaMetaDetails) GetVpnIp() uint32 {
  167. if m != nil {
  168. return m.VpnIp
  169. }
  170. return 0
  171. }
  172. func (m *NebulaMetaDetails) GetIp4AndPorts() []*Ip4AndPort {
  173. if m != nil {
  174. return m.Ip4AndPorts
  175. }
  176. return nil
  177. }
  178. func (m *NebulaMetaDetails) GetIp6AndPorts() []*Ip6AndPort {
  179. if m != nil {
  180. return m.Ip6AndPorts
  181. }
  182. return nil
  183. }
  184. func (m *NebulaMetaDetails) GetCounter() uint32 {
  185. if m != nil {
  186. return m.Counter
  187. }
  188. return 0
  189. }
  190. type Ip4AndPort struct {
  191. Ip uint32 `protobuf:"varint,1,opt,name=Ip,proto3" json:"Ip,omitempty"`
  192. Port uint32 `protobuf:"varint,2,opt,name=Port,proto3" json:"Port,omitempty"`
  193. }
  194. func (m *Ip4AndPort) Reset() { *m = Ip4AndPort{} }
  195. func (m *Ip4AndPort) String() string { return proto.CompactTextString(m) }
  196. func (*Ip4AndPort) ProtoMessage() {}
  197. func (*Ip4AndPort) Descriptor() ([]byte, []int) {
  198. return fileDescriptor_2d65afa7693df5ef, []int{2}
  199. }
  200. func (m *Ip4AndPort) XXX_Unmarshal(b []byte) error {
  201. return m.Unmarshal(b)
  202. }
  203. func (m *Ip4AndPort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  204. if deterministic {
  205. return xxx_messageInfo_Ip4AndPort.Marshal(b, m, deterministic)
  206. } else {
  207. b = b[:cap(b)]
  208. n, err := m.MarshalToSizedBuffer(b)
  209. if err != nil {
  210. return nil, err
  211. }
  212. return b[:n], nil
  213. }
  214. }
  215. func (m *Ip4AndPort) XXX_Merge(src proto.Message) {
  216. xxx_messageInfo_Ip4AndPort.Merge(m, src)
  217. }
  218. func (m *Ip4AndPort) XXX_Size() int {
  219. return m.Size()
  220. }
  221. func (m *Ip4AndPort) XXX_DiscardUnknown() {
  222. xxx_messageInfo_Ip4AndPort.DiscardUnknown(m)
  223. }
  224. var xxx_messageInfo_Ip4AndPort proto.InternalMessageInfo
  225. func (m *Ip4AndPort) GetIp() uint32 {
  226. if m != nil {
  227. return m.Ip
  228. }
  229. return 0
  230. }
  231. func (m *Ip4AndPort) GetPort() uint32 {
  232. if m != nil {
  233. return m.Port
  234. }
  235. return 0
  236. }
  237. type Ip6AndPort struct {
  238. Hi uint64 `protobuf:"varint,1,opt,name=Hi,proto3" json:"Hi,omitempty"`
  239. Lo uint64 `protobuf:"varint,2,opt,name=Lo,proto3" json:"Lo,omitempty"`
  240. Port uint32 `protobuf:"varint,3,opt,name=Port,proto3" json:"Port,omitempty"`
  241. }
  242. func (m *Ip6AndPort) Reset() { *m = Ip6AndPort{} }
  243. func (m *Ip6AndPort) String() string { return proto.CompactTextString(m) }
  244. func (*Ip6AndPort) ProtoMessage() {}
  245. func (*Ip6AndPort) Descriptor() ([]byte, []int) {
  246. return fileDescriptor_2d65afa7693df5ef, []int{3}
  247. }
  248. func (m *Ip6AndPort) XXX_Unmarshal(b []byte) error {
  249. return m.Unmarshal(b)
  250. }
  251. func (m *Ip6AndPort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  252. if deterministic {
  253. return xxx_messageInfo_Ip6AndPort.Marshal(b, m, deterministic)
  254. } else {
  255. b = b[:cap(b)]
  256. n, err := m.MarshalToSizedBuffer(b)
  257. if err != nil {
  258. return nil, err
  259. }
  260. return b[:n], nil
  261. }
  262. }
  263. func (m *Ip6AndPort) XXX_Merge(src proto.Message) {
  264. xxx_messageInfo_Ip6AndPort.Merge(m, src)
  265. }
  266. func (m *Ip6AndPort) XXX_Size() int {
  267. return m.Size()
  268. }
  269. func (m *Ip6AndPort) XXX_DiscardUnknown() {
  270. xxx_messageInfo_Ip6AndPort.DiscardUnknown(m)
  271. }
  272. var xxx_messageInfo_Ip6AndPort proto.InternalMessageInfo
  273. func (m *Ip6AndPort) GetHi() uint64 {
  274. if m != nil {
  275. return m.Hi
  276. }
  277. return 0
  278. }
  279. func (m *Ip6AndPort) GetLo() uint64 {
  280. if m != nil {
  281. return m.Lo
  282. }
  283. return 0
  284. }
  285. func (m *Ip6AndPort) GetPort() uint32 {
  286. if m != nil {
  287. return m.Port
  288. }
  289. return 0
  290. }
  291. type NebulaPing struct {
  292. Type NebulaPing_MessageType `protobuf:"varint,1,opt,name=Type,proto3,enum=nebula.NebulaPing_MessageType" json:"Type,omitempty"`
  293. Time uint64 `protobuf:"varint,2,opt,name=Time,proto3" json:"Time,omitempty"`
  294. }
  295. func (m *NebulaPing) Reset() { *m = NebulaPing{} }
  296. func (m *NebulaPing) String() string { return proto.CompactTextString(m) }
  297. func (*NebulaPing) ProtoMessage() {}
  298. func (*NebulaPing) Descriptor() ([]byte, []int) {
  299. return fileDescriptor_2d65afa7693df5ef, []int{4}
  300. }
  301. func (m *NebulaPing) XXX_Unmarshal(b []byte) error {
  302. return m.Unmarshal(b)
  303. }
  304. func (m *NebulaPing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  305. if deterministic {
  306. return xxx_messageInfo_NebulaPing.Marshal(b, m, deterministic)
  307. } else {
  308. b = b[:cap(b)]
  309. n, err := m.MarshalToSizedBuffer(b)
  310. if err != nil {
  311. return nil, err
  312. }
  313. return b[:n], nil
  314. }
  315. }
  316. func (m *NebulaPing) XXX_Merge(src proto.Message) {
  317. xxx_messageInfo_NebulaPing.Merge(m, src)
  318. }
  319. func (m *NebulaPing) XXX_Size() int {
  320. return m.Size()
  321. }
  322. func (m *NebulaPing) XXX_DiscardUnknown() {
  323. xxx_messageInfo_NebulaPing.DiscardUnknown(m)
  324. }
  325. var xxx_messageInfo_NebulaPing proto.InternalMessageInfo
  326. func (m *NebulaPing) GetType() NebulaPing_MessageType {
  327. if m != nil {
  328. return m.Type
  329. }
  330. return NebulaPing_Ping
  331. }
  332. func (m *NebulaPing) GetTime() uint64 {
  333. if m != nil {
  334. return m.Time
  335. }
  336. return 0
  337. }
  338. type NebulaHandshake struct {
  339. Details *NebulaHandshakeDetails `protobuf:"bytes,1,opt,name=Details,proto3" json:"Details,omitempty"`
  340. Hmac []byte `protobuf:"bytes,2,opt,name=Hmac,proto3" json:"Hmac,omitempty"`
  341. }
  342. func (m *NebulaHandshake) Reset() { *m = NebulaHandshake{} }
  343. func (m *NebulaHandshake) String() string { return proto.CompactTextString(m) }
  344. func (*NebulaHandshake) ProtoMessage() {}
  345. func (*NebulaHandshake) Descriptor() ([]byte, []int) {
  346. return fileDescriptor_2d65afa7693df5ef, []int{5}
  347. }
  348. func (m *NebulaHandshake) XXX_Unmarshal(b []byte) error {
  349. return m.Unmarshal(b)
  350. }
  351. func (m *NebulaHandshake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  352. if deterministic {
  353. return xxx_messageInfo_NebulaHandshake.Marshal(b, m, deterministic)
  354. } else {
  355. b = b[:cap(b)]
  356. n, err := m.MarshalToSizedBuffer(b)
  357. if err != nil {
  358. return nil, err
  359. }
  360. return b[:n], nil
  361. }
  362. }
  363. func (m *NebulaHandshake) XXX_Merge(src proto.Message) {
  364. xxx_messageInfo_NebulaHandshake.Merge(m, src)
  365. }
  366. func (m *NebulaHandshake) XXX_Size() int {
  367. return m.Size()
  368. }
  369. func (m *NebulaHandshake) XXX_DiscardUnknown() {
  370. xxx_messageInfo_NebulaHandshake.DiscardUnknown(m)
  371. }
  372. var xxx_messageInfo_NebulaHandshake proto.InternalMessageInfo
  373. func (m *NebulaHandshake) GetDetails() *NebulaHandshakeDetails {
  374. if m != nil {
  375. return m.Details
  376. }
  377. return nil
  378. }
  379. func (m *NebulaHandshake) GetHmac() []byte {
  380. if m != nil {
  381. return m.Hmac
  382. }
  383. return nil
  384. }
  385. type NebulaHandshakeDetails struct {
  386. Cert []byte `protobuf:"bytes,1,opt,name=Cert,proto3" json:"Cert,omitempty"`
  387. InitiatorIndex uint32 `protobuf:"varint,2,opt,name=InitiatorIndex,proto3" json:"InitiatorIndex,omitempty"`
  388. ResponderIndex uint32 `protobuf:"varint,3,opt,name=ResponderIndex,proto3" json:"ResponderIndex,omitempty"`
  389. Cookie uint64 `protobuf:"varint,4,opt,name=Cookie,proto3" json:"Cookie,omitempty"`
  390. Time uint64 `protobuf:"varint,5,opt,name=Time,proto3" json:"Time,omitempty"`
  391. }
  392. func (m *NebulaHandshakeDetails) Reset() { *m = NebulaHandshakeDetails{} }
  393. func (m *NebulaHandshakeDetails) String() string { return proto.CompactTextString(m) }
  394. func (*NebulaHandshakeDetails) ProtoMessage() {}
  395. func (*NebulaHandshakeDetails) Descriptor() ([]byte, []int) {
  396. return fileDescriptor_2d65afa7693df5ef, []int{6}
  397. }
  398. func (m *NebulaHandshakeDetails) XXX_Unmarshal(b []byte) error {
  399. return m.Unmarshal(b)
  400. }
  401. func (m *NebulaHandshakeDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  402. if deterministic {
  403. return xxx_messageInfo_NebulaHandshakeDetails.Marshal(b, m, deterministic)
  404. } else {
  405. b = b[:cap(b)]
  406. n, err := m.MarshalToSizedBuffer(b)
  407. if err != nil {
  408. return nil, err
  409. }
  410. return b[:n], nil
  411. }
  412. }
  413. func (m *NebulaHandshakeDetails) XXX_Merge(src proto.Message) {
  414. xxx_messageInfo_NebulaHandshakeDetails.Merge(m, src)
  415. }
  416. func (m *NebulaHandshakeDetails) XXX_Size() int {
  417. return m.Size()
  418. }
  419. func (m *NebulaHandshakeDetails) XXX_DiscardUnknown() {
  420. xxx_messageInfo_NebulaHandshakeDetails.DiscardUnknown(m)
  421. }
  422. var xxx_messageInfo_NebulaHandshakeDetails proto.InternalMessageInfo
  423. func (m *NebulaHandshakeDetails) GetCert() []byte {
  424. if m != nil {
  425. return m.Cert
  426. }
  427. return nil
  428. }
  429. func (m *NebulaHandshakeDetails) GetInitiatorIndex() uint32 {
  430. if m != nil {
  431. return m.InitiatorIndex
  432. }
  433. return 0
  434. }
  435. func (m *NebulaHandshakeDetails) GetResponderIndex() uint32 {
  436. if m != nil {
  437. return m.ResponderIndex
  438. }
  439. return 0
  440. }
  441. func (m *NebulaHandshakeDetails) GetCookie() uint64 {
  442. if m != nil {
  443. return m.Cookie
  444. }
  445. return 0
  446. }
  447. func (m *NebulaHandshakeDetails) GetTime() uint64 {
  448. if m != nil {
  449. return m.Time
  450. }
  451. return 0
  452. }
  453. func init() {
  454. proto.RegisterEnum("nebula.NebulaMeta_MessageType", NebulaMeta_MessageType_name, NebulaMeta_MessageType_value)
  455. proto.RegisterEnum("nebula.NebulaPing_MessageType", NebulaPing_MessageType_name, NebulaPing_MessageType_value)
  456. proto.RegisterType((*NebulaMeta)(nil), "nebula.NebulaMeta")
  457. proto.RegisterType((*NebulaMetaDetails)(nil), "nebula.NebulaMetaDetails")
  458. proto.RegisterType((*Ip4AndPort)(nil), "nebula.Ip4AndPort")
  459. proto.RegisterType((*Ip6AndPort)(nil), "nebula.Ip6AndPort")
  460. proto.RegisterType((*NebulaPing)(nil), "nebula.NebulaPing")
  461. proto.RegisterType((*NebulaHandshake)(nil), "nebula.NebulaHandshake")
  462. proto.RegisterType((*NebulaHandshakeDetails)(nil), "nebula.NebulaHandshakeDetails")
  463. }
  464. func init() { proto.RegisterFile("nebula.proto", fileDescriptor_2d65afa7693df5ef) }
  465. var fileDescriptor_2d65afa7693df5ef = []byte{
  466. // 570 bytes of a gzipped FileDescriptorProto
  467. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0x41, 0x6f, 0xda, 0x4c,
  468. 0x10, 0x65, 0x8d, 0x21, 0xc9, 0x90, 0x10, 0x7f, 0xfb, 0xb5, 0x08, 0x7a, 0xb0, 0x22, 0x1f, 0x2a,
  469. 0x4e, 0xa4, 0x82, 0x08, 0xf5, 0xd8, 0x96, 0x1e, 0x40, 0x0a, 0x88, 0x5a, 0x69, 0x2b, 0xf5, 0x52,
  470. 0x2d, 0xf6, 0x16, 0xaf, 0x80, 0x5d, 0xd7, 0x5e, 0xaa, 0xf0, 0x2f, 0xfa, 0x33, 0x7a, 0xeb, 0xdf,
  471. 0xe8, 0xa1, 0x87, 0x1c, 0x7a, 0xe8, 0xb1, 0x82, 0x3f, 0x52, 0xed, 0xda, 0xd8, 0x04, 0xa2, 0xde,
  472. 0xe6, 0xcd, 0xbc, 0x37, 0x3b, 0x3c, 0x3f, 0x01, 0xa7, 0x9c, 0x4e, 0x96, 0x73, 0xd2, 0x0a, 0x23,
  473. 0x21, 0x05, 0x2e, 0x27, 0xc8, 0xf9, 0x69, 0x00, 0x8c, 0x74, 0x39, 0xa4, 0x92, 0xe0, 0x36, 0x98,
  474. 0x37, 0xab, 0x90, 0xd6, 0xd1, 0x05, 0x6a, 0x56, 0xdb, 0x76, 0x2b, 0xd5, 0xe4, 0x8c, 0xd6, 0x90,
  475. 0xc6, 0x31, 0x99, 0x52, 0xc5, 0x72, 0x35, 0x17, 0x77, 0xe0, 0xe8, 0x35, 0x95, 0x84, 0xcd, 0xe3,
  476. 0xba, 0x71, 0x81, 0x9a, 0x95, 0x76, 0xe3, 0x50, 0x96, 0x12, 0xdc, 0x2d, 0xd3, 0xf9, 0x85, 0xa0,
  477. 0xb2, 0xb3, 0x0a, 0x1f, 0x83, 0x39, 0x12, 0x9c, 0x5a, 0x05, 0x7c, 0x06, 0x27, 0x7d, 0x11, 0xcb,
  478. 0x37, 0x4b, 0x1a, 0xad, 0x2c, 0x84, 0x31, 0x54, 0x33, 0xe8, 0xd2, 0x70, 0xbe, 0xb2, 0x0c, 0xfc,
  479. 0x04, 0x6a, 0xaa, 0xf7, 0x36, 0xf4, 0x89, 0xa4, 0x23, 0x21, 0xd9, 0x27, 0xe6, 0x11, 0xc9, 0x04,
  480. 0xb7, 0x8a, 0xb8, 0x01, 0x8f, 0xd5, 0x6c, 0x28, 0xbe, 0x50, 0xff, 0xde, 0xc8, 0xdc, 0x8e, 0xc6,
  481. 0x4b, 0xee, 0x05, 0xf7, 0x46, 0x25, 0x5c, 0x05, 0x50, 0xa3, 0xf7, 0x81, 0x20, 0x0b, 0x66, 0x95,
  482. 0xf1, 0xff, 0x70, 0x9e, 0xe3, 0xe4, 0xd9, 0x23, 0x75, 0xd9, 0x98, 0xc8, 0xa0, 0x17, 0x50, 0x6f,
  483. 0x66, 0x1d, 0xab, 0xcb, 0x32, 0x98, 0x50, 0x4e, 0x9c, 0xef, 0x08, 0xfe, 0x3b, 0xf8, 0xd5, 0xf8,
  484. 0x11, 0x94, 0xde, 0x85, 0x7c, 0x10, 0x6a, 0x5b, 0xcf, 0xdc, 0x04, 0xe0, 0x2b, 0xa8, 0x0c, 0xc2,
  485. 0xab, 0x97, 0xdc, 0x1f, 0x8b, 0x48, 0x2a, 0xef, 0x8a, 0xcd, 0x4a, 0x1b, 0x6f, 0xbd, 0xcb, 0x47,
  486. 0xee, 0x2e, 0x2d, 0x51, 0x75, 0x33, 0x95, 0xb9, 0xaf, 0xea, 0xee, 0xa8, 0x32, 0x1a, 0xae, 0xc3,
  487. 0x91, 0x27, 0x96, 0x5c, 0xd2, 0xa8, 0x5e, 0xd4, 0x37, 0x6c, 0xa1, 0xf3, 0x0c, 0x20, 0x5f, 0x8f,
  488. 0xab, 0x60, 0x64, 0x67, 0x1a, 0x83, 0x10, 0x63, 0x30, 0x55, 0x5f, 0x7f, 0xd8, 0x33, 0x57, 0xd7,
  489. 0xce, 0x0b, 0xa5, 0xe8, 0xee, 0x28, 0xfa, 0x4c, 0x2b, 0x4c, 0xd7, 0xe8, 0x33, 0x85, 0xaf, 0x85,
  490. 0xe6, 0x9b, 0xae, 0x71, 0x2d, 0xb2, 0x0d, 0xc5, 0x9d, 0x0d, 0xb7, 0xdb, 0xcc, 0x8d, 0x19, 0x9f,
  491. 0xfe, 0x3b, 0x73, 0x8a, 0xf1, 0x40, 0xe6, 0x30, 0x98, 0x37, 0x6c, 0x41, 0xd3, 0x77, 0x74, 0xed,
  492. 0x38, 0x07, 0x89, 0x52, 0x62, 0xab, 0x80, 0x4f, 0xa0, 0x94, 0x7c, 0x1f, 0xe4, 0x7c, 0x84, 0xf3,
  493. 0x64, 0x6f, 0x9f, 0x70, 0x3f, 0x0e, 0xc8, 0x8c, 0xe2, 0xe7, 0x79, 0x7c, 0x91, 0x8e, 0xef, 0xde,
  494. 0x05, 0x19, 0x73, 0x3f, 0xc3, 0xea, 0x88, 0xfe, 0x82, 0x78, 0xfa, 0x88, 0x53, 0x57, 0xd7, 0xce,
  495. 0x37, 0x04, 0xb5, 0x87, 0x75, 0x8a, 0xde, 0xa3, 0x91, 0xd4, 0xaf, 0x9c, 0xba, 0xba, 0xc6, 0x4f,
  496. 0xa1, 0x3a, 0xe0, 0x4c, 0x32, 0x22, 0x45, 0x34, 0xe0, 0x3e, 0xbd, 0x4d, 0x9d, 0xde, 0xeb, 0x2a,
  497. 0x9e, 0x4b, 0xe3, 0x50, 0x70, 0x9f, 0xa6, 0xbc, 0xc4, 0xcf, 0xbd, 0x2e, 0xae, 0x41, 0xb9, 0x27,
  498. 0xc4, 0x8c, 0xd1, 0xba, 0xa9, 0x9d, 0x49, 0x51, 0xe6, 0x57, 0x29, 0xf7, 0xeb, 0x55, 0xe7, 0xc7,
  499. 0xda, 0x46, 0x77, 0x6b, 0x1b, 0xfd, 0x59, 0xdb, 0xe8, 0xeb, 0xc6, 0x2e, 0xdc, 0x6d, 0xec, 0xc2,
  500. 0xef, 0x8d, 0x5d, 0xf8, 0xd0, 0x98, 0x32, 0x19, 0x2c, 0x27, 0x2d, 0x4f, 0x2c, 0x2e, 0xe3, 0x39,
  501. 0xf1, 0x66, 0xc1, 0xe7, 0xcb, 0xc4, 0x93, 0x49, 0x59, 0xff, 0x7d, 0x74, 0xfe, 0x06, 0x00, 0x00,
  502. 0xff, 0xff, 0x20, 0x00, 0x2b, 0x46, 0x4e, 0x04, 0x00, 0x00,
  503. }
  504. func (m *NebulaMeta) Marshal() (dAtA []byte, err error) {
  505. size := m.Size()
  506. dAtA = make([]byte, size)
  507. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  508. if err != nil {
  509. return nil, err
  510. }
  511. return dAtA[:n], nil
  512. }
  513. func (m *NebulaMeta) MarshalTo(dAtA []byte) (int, error) {
  514. size := m.Size()
  515. return m.MarshalToSizedBuffer(dAtA[:size])
  516. }
  517. func (m *NebulaMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  518. i := len(dAtA)
  519. _ = i
  520. var l int
  521. _ = l
  522. if m.Details != nil {
  523. {
  524. size, err := m.Details.MarshalToSizedBuffer(dAtA[:i])
  525. if err != nil {
  526. return 0, err
  527. }
  528. i -= size
  529. i = encodeVarintNebula(dAtA, i, uint64(size))
  530. }
  531. i--
  532. dAtA[i] = 0x12
  533. }
  534. if m.Type != 0 {
  535. i = encodeVarintNebula(dAtA, i, uint64(m.Type))
  536. i--
  537. dAtA[i] = 0x8
  538. }
  539. return len(dAtA) - i, nil
  540. }
  541. func (m *NebulaMetaDetails) Marshal() (dAtA []byte, err error) {
  542. size := m.Size()
  543. dAtA = make([]byte, size)
  544. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  545. if err != nil {
  546. return nil, err
  547. }
  548. return dAtA[:n], nil
  549. }
  550. func (m *NebulaMetaDetails) MarshalTo(dAtA []byte) (int, error) {
  551. size := m.Size()
  552. return m.MarshalToSizedBuffer(dAtA[:size])
  553. }
  554. func (m *NebulaMetaDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  555. i := len(dAtA)
  556. _ = i
  557. var l int
  558. _ = l
  559. if len(m.Ip6AndPorts) > 0 {
  560. for iNdEx := len(m.Ip6AndPorts) - 1; iNdEx >= 0; iNdEx-- {
  561. {
  562. size, err := m.Ip6AndPorts[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  563. if err != nil {
  564. return 0, err
  565. }
  566. i -= size
  567. i = encodeVarintNebula(dAtA, i, uint64(size))
  568. }
  569. i--
  570. dAtA[i] = 0x22
  571. }
  572. }
  573. if m.Counter != 0 {
  574. i = encodeVarintNebula(dAtA, i, uint64(m.Counter))
  575. i--
  576. dAtA[i] = 0x18
  577. }
  578. if len(m.Ip4AndPorts) > 0 {
  579. for iNdEx := len(m.Ip4AndPorts) - 1; iNdEx >= 0; iNdEx-- {
  580. {
  581. size, err := m.Ip4AndPorts[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  582. if err != nil {
  583. return 0, err
  584. }
  585. i -= size
  586. i = encodeVarintNebula(dAtA, i, uint64(size))
  587. }
  588. i--
  589. dAtA[i] = 0x12
  590. }
  591. }
  592. if m.VpnIp != 0 {
  593. i = encodeVarintNebula(dAtA, i, uint64(m.VpnIp))
  594. i--
  595. dAtA[i] = 0x8
  596. }
  597. return len(dAtA) - i, nil
  598. }
  599. func (m *Ip4AndPort) Marshal() (dAtA []byte, err error) {
  600. size := m.Size()
  601. dAtA = make([]byte, size)
  602. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  603. if err != nil {
  604. return nil, err
  605. }
  606. return dAtA[:n], nil
  607. }
  608. func (m *Ip4AndPort) MarshalTo(dAtA []byte) (int, error) {
  609. size := m.Size()
  610. return m.MarshalToSizedBuffer(dAtA[:size])
  611. }
  612. func (m *Ip4AndPort) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  613. i := len(dAtA)
  614. _ = i
  615. var l int
  616. _ = l
  617. if m.Port != 0 {
  618. i = encodeVarintNebula(dAtA, i, uint64(m.Port))
  619. i--
  620. dAtA[i] = 0x10
  621. }
  622. if m.Ip != 0 {
  623. i = encodeVarintNebula(dAtA, i, uint64(m.Ip))
  624. i--
  625. dAtA[i] = 0x8
  626. }
  627. return len(dAtA) - i, nil
  628. }
  629. func (m *Ip6AndPort) Marshal() (dAtA []byte, err error) {
  630. size := m.Size()
  631. dAtA = make([]byte, size)
  632. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  633. if err != nil {
  634. return nil, err
  635. }
  636. return dAtA[:n], nil
  637. }
  638. func (m *Ip6AndPort) MarshalTo(dAtA []byte) (int, error) {
  639. size := m.Size()
  640. return m.MarshalToSizedBuffer(dAtA[:size])
  641. }
  642. func (m *Ip6AndPort) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  643. i := len(dAtA)
  644. _ = i
  645. var l int
  646. _ = l
  647. if m.Port != 0 {
  648. i = encodeVarintNebula(dAtA, i, uint64(m.Port))
  649. i--
  650. dAtA[i] = 0x18
  651. }
  652. if m.Lo != 0 {
  653. i = encodeVarintNebula(dAtA, i, uint64(m.Lo))
  654. i--
  655. dAtA[i] = 0x10
  656. }
  657. if m.Hi != 0 {
  658. i = encodeVarintNebula(dAtA, i, uint64(m.Hi))
  659. i--
  660. dAtA[i] = 0x8
  661. }
  662. return len(dAtA) - i, nil
  663. }
  664. func (m *NebulaPing) Marshal() (dAtA []byte, err error) {
  665. size := m.Size()
  666. dAtA = make([]byte, size)
  667. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  668. if err != nil {
  669. return nil, err
  670. }
  671. return dAtA[:n], nil
  672. }
  673. func (m *NebulaPing) MarshalTo(dAtA []byte) (int, error) {
  674. size := m.Size()
  675. return m.MarshalToSizedBuffer(dAtA[:size])
  676. }
  677. func (m *NebulaPing) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  678. i := len(dAtA)
  679. _ = i
  680. var l int
  681. _ = l
  682. if m.Time != 0 {
  683. i = encodeVarintNebula(dAtA, i, uint64(m.Time))
  684. i--
  685. dAtA[i] = 0x10
  686. }
  687. if m.Type != 0 {
  688. i = encodeVarintNebula(dAtA, i, uint64(m.Type))
  689. i--
  690. dAtA[i] = 0x8
  691. }
  692. return len(dAtA) - i, nil
  693. }
  694. func (m *NebulaHandshake) Marshal() (dAtA []byte, err error) {
  695. size := m.Size()
  696. dAtA = make([]byte, size)
  697. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  698. if err != nil {
  699. return nil, err
  700. }
  701. return dAtA[:n], nil
  702. }
  703. func (m *NebulaHandshake) MarshalTo(dAtA []byte) (int, error) {
  704. size := m.Size()
  705. return m.MarshalToSizedBuffer(dAtA[:size])
  706. }
  707. func (m *NebulaHandshake) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  708. i := len(dAtA)
  709. _ = i
  710. var l int
  711. _ = l
  712. if len(m.Hmac) > 0 {
  713. i -= len(m.Hmac)
  714. copy(dAtA[i:], m.Hmac)
  715. i = encodeVarintNebula(dAtA, i, uint64(len(m.Hmac)))
  716. i--
  717. dAtA[i] = 0x12
  718. }
  719. if m.Details != nil {
  720. {
  721. size, err := m.Details.MarshalToSizedBuffer(dAtA[:i])
  722. if err != nil {
  723. return 0, err
  724. }
  725. i -= size
  726. i = encodeVarintNebula(dAtA, i, uint64(size))
  727. }
  728. i--
  729. dAtA[i] = 0xa
  730. }
  731. return len(dAtA) - i, nil
  732. }
  733. func (m *NebulaHandshakeDetails) Marshal() (dAtA []byte, err error) {
  734. size := m.Size()
  735. dAtA = make([]byte, size)
  736. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  737. if err != nil {
  738. return nil, err
  739. }
  740. return dAtA[:n], nil
  741. }
  742. func (m *NebulaHandshakeDetails) MarshalTo(dAtA []byte) (int, error) {
  743. size := m.Size()
  744. return m.MarshalToSizedBuffer(dAtA[:size])
  745. }
  746. func (m *NebulaHandshakeDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  747. i := len(dAtA)
  748. _ = i
  749. var l int
  750. _ = l
  751. if m.Time != 0 {
  752. i = encodeVarintNebula(dAtA, i, uint64(m.Time))
  753. i--
  754. dAtA[i] = 0x28
  755. }
  756. if m.Cookie != 0 {
  757. i = encodeVarintNebula(dAtA, i, uint64(m.Cookie))
  758. i--
  759. dAtA[i] = 0x20
  760. }
  761. if m.ResponderIndex != 0 {
  762. i = encodeVarintNebula(dAtA, i, uint64(m.ResponderIndex))
  763. i--
  764. dAtA[i] = 0x18
  765. }
  766. if m.InitiatorIndex != 0 {
  767. i = encodeVarintNebula(dAtA, i, uint64(m.InitiatorIndex))
  768. i--
  769. dAtA[i] = 0x10
  770. }
  771. if len(m.Cert) > 0 {
  772. i -= len(m.Cert)
  773. copy(dAtA[i:], m.Cert)
  774. i = encodeVarintNebula(dAtA, i, uint64(len(m.Cert)))
  775. i--
  776. dAtA[i] = 0xa
  777. }
  778. return len(dAtA) - i, nil
  779. }
  780. func encodeVarintNebula(dAtA []byte, offset int, v uint64) int {
  781. offset -= sovNebula(v)
  782. base := offset
  783. for v >= 1<<7 {
  784. dAtA[offset] = uint8(v&0x7f | 0x80)
  785. v >>= 7
  786. offset++
  787. }
  788. dAtA[offset] = uint8(v)
  789. return base
  790. }
  791. func (m *NebulaMeta) Size() (n int) {
  792. if m == nil {
  793. return 0
  794. }
  795. var l int
  796. _ = l
  797. if m.Type != 0 {
  798. n += 1 + sovNebula(uint64(m.Type))
  799. }
  800. if m.Details != nil {
  801. l = m.Details.Size()
  802. n += 1 + l + sovNebula(uint64(l))
  803. }
  804. return n
  805. }
  806. func (m *NebulaMetaDetails) Size() (n int) {
  807. if m == nil {
  808. return 0
  809. }
  810. var l int
  811. _ = l
  812. if m.VpnIp != 0 {
  813. n += 1 + sovNebula(uint64(m.VpnIp))
  814. }
  815. if len(m.Ip4AndPorts) > 0 {
  816. for _, e := range m.Ip4AndPorts {
  817. l = e.Size()
  818. n += 1 + l + sovNebula(uint64(l))
  819. }
  820. }
  821. if m.Counter != 0 {
  822. n += 1 + sovNebula(uint64(m.Counter))
  823. }
  824. if len(m.Ip6AndPorts) > 0 {
  825. for _, e := range m.Ip6AndPorts {
  826. l = e.Size()
  827. n += 1 + l + sovNebula(uint64(l))
  828. }
  829. }
  830. return n
  831. }
  832. func (m *Ip4AndPort) Size() (n int) {
  833. if m == nil {
  834. return 0
  835. }
  836. var l int
  837. _ = l
  838. if m.Ip != 0 {
  839. n += 1 + sovNebula(uint64(m.Ip))
  840. }
  841. if m.Port != 0 {
  842. n += 1 + sovNebula(uint64(m.Port))
  843. }
  844. return n
  845. }
  846. func (m *Ip6AndPort) Size() (n int) {
  847. if m == nil {
  848. return 0
  849. }
  850. var l int
  851. _ = l
  852. if m.Hi != 0 {
  853. n += 1 + sovNebula(uint64(m.Hi))
  854. }
  855. if m.Lo != 0 {
  856. n += 1 + sovNebula(uint64(m.Lo))
  857. }
  858. if m.Port != 0 {
  859. n += 1 + sovNebula(uint64(m.Port))
  860. }
  861. return n
  862. }
  863. func (m *NebulaPing) Size() (n int) {
  864. if m == nil {
  865. return 0
  866. }
  867. var l int
  868. _ = l
  869. if m.Type != 0 {
  870. n += 1 + sovNebula(uint64(m.Type))
  871. }
  872. if m.Time != 0 {
  873. n += 1 + sovNebula(uint64(m.Time))
  874. }
  875. return n
  876. }
  877. func (m *NebulaHandshake) Size() (n int) {
  878. if m == nil {
  879. return 0
  880. }
  881. var l int
  882. _ = l
  883. if m.Details != nil {
  884. l = m.Details.Size()
  885. n += 1 + l + sovNebula(uint64(l))
  886. }
  887. l = len(m.Hmac)
  888. if l > 0 {
  889. n += 1 + l + sovNebula(uint64(l))
  890. }
  891. return n
  892. }
  893. func (m *NebulaHandshakeDetails) Size() (n int) {
  894. if m == nil {
  895. return 0
  896. }
  897. var l int
  898. _ = l
  899. l = len(m.Cert)
  900. if l > 0 {
  901. n += 1 + l + sovNebula(uint64(l))
  902. }
  903. if m.InitiatorIndex != 0 {
  904. n += 1 + sovNebula(uint64(m.InitiatorIndex))
  905. }
  906. if m.ResponderIndex != 0 {
  907. n += 1 + sovNebula(uint64(m.ResponderIndex))
  908. }
  909. if m.Cookie != 0 {
  910. n += 1 + sovNebula(uint64(m.Cookie))
  911. }
  912. if m.Time != 0 {
  913. n += 1 + sovNebula(uint64(m.Time))
  914. }
  915. return n
  916. }
  917. func sovNebula(x uint64) (n int) {
  918. return (math_bits.Len64(x|1) + 6) / 7
  919. }
  920. func sozNebula(x uint64) (n int) {
  921. return sovNebula(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  922. }
  923. func (m *NebulaMeta) Unmarshal(dAtA []byte) error {
  924. l := len(dAtA)
  925. iNdEx := 0
  926. for iNdEx < l {
  927. preIndex := iNdEx
  928. var wire uint64
  929. for shift := uint(0); ; shift += 7 {
  930. if shift >= 64 {
  931. return ErrIntOverflowNebula
  932. }
  933. if iNdEx >= l {
  934. return io.ErrUnexpectedEOF
  935. }
  936. b := dAtA[iNdEx]
  937. iNdEx++
  938. wire |= uint64(b&0x7F) << shift
  939. if b < 0x80 {
  940. break
  941. }
  942. }
  943. fieldNum := int32(wire >> 3)
  944. wireType := int(wire & 0x7)
  945. if wireType == 4 {
  946. return fmt.Errorf("proto: NebulaMeta: wiretype end group for non-group")
  947. }
  948. if fieldNum <= 0 {
  949. return fmt.Errorf("proto: NebulaMeta: illegal tag %d (wire type %d)", fieldNum, wire)
  950. }
  951. switch fieldNum {
  952. case 1:
  953. if wireType != 0 {
  954. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  955. }
  956. m.Type = 0
  957. for shift := uint(0); ; shift += 7 {
  958. if shift >= 64 {
  959. return ErrIntOverflowNebula
  960. }
  961. if iNdEx >= l {
  962. return io.ErrUnexpectedEOF
  963. }
  964. b := dAtA[iNdEx]
  965. iNdEx++
  966. m.Type |= NebulaMeta_MessageType(b&0x7F) << shift
  967. if b < 0x80 {
  968. break
  969. }
  970. }
  971. case 2:
  972. if wireType != 2 {
  973. return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType)
  974. }
  975. var msglen int
  976. for shift := uint(0); ; shift += 7 {
  977. if shift >= 64 {
  978. return ErrIntOverflowNebula
  979. }
  980. if iNdEx >= l {
  981. return io.ErrUnexpectedEOF
  982. }
  983. b := dAtA[iNdEx]
  984. iNdEx++
  985. msglen |= int(b&0x7F) << shift
  986. if b < 0x80 {
  987. break
  988. }
  989. }
  990. if msglen < 0 {
  991. return ErrInvalidLengthNebula
  992. }
  993. postIndex := iNdEx + msglen
  994. if postIndex < 0 {
  995. return ErrInvalidLengthNebula
  996. }
  997. if postIndex > l {
  998. return io.ErrUnexpectedEOF
  999. }
  1000. if m.Details == nil {
  1001. m.Details = &NebulaMetaDetails{}
  1002. }
  1003. if err := m.Details.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1004. return err
  1005. }
  1006. iNdEx = postIndex
  1007. default:
  1008. iNdEx = preIndex
  1009. skippy, err := skipNebula(dAtA[iNdEx:])
  1010. if err != nil {
  1011. return err
  1012. }
  1013. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1014. return ErrInvalidLengthNebula
  1015. }
  1016. if (iNdEx + skippy) > l {
  1017. return io.ErrUnexpectedEOF
  1018. }
  1019. iNdEx += skippy
  1020. }
  1021. }
  1022. if iNdEx > l {
  1023. return io.ErrUnexpectedEOF
  1024. }
  1025. return nil
  1026. }
  1027. func (m *NebulaMetaDetails) Unmarshal(dAtA []byte) error {
  1028. l := len(dAtA)
  1029. iNdEx := 0
  1030. for iNdEx < l {
  1031. preIndex := iNdEx
  1032. var wire uint64
  1033. for shift := uint(0); ; shift += 7 {
  1034. if shift >= 64 {
  1035. return ErrIntOverflowNebula
  1036. }
  1037. if iNdEx >= l {
  1038. return io.ErrUnexpectedEOF
  1039. }
  1040. b := dAtA[iNdEx]
  1041. iNdEx++
  1042. wire |= uint64(b&0x7F) << shift
  1043. if b < 0x80 {
  1044. break
  1045. }
  1046. }
  1047. fieldNum := int32(wire >> 3)
  1048. wireType := int(wire & 0x7)
  1049. if wireType == 4 {
  1050. return fmt.Errorf("proto: NebulaMetaDetails: wiretype end group for non-group")
  1051. }
  1052. if fieldNum <= 0 {
  1053. return fmt.Errorf("proto: NebulaMetaDetails: illegal tag %d (wire type %d)", fieldNum, wire)
  1054. }
  1055. switch fieldNum {
  1056. case 1:
  1057. if wireType != 0 {
  1058. return fmt.Errorf("proto: wrong wireType = %d for field VpnIp", wireType)
  1059. }
  1060. m.VpnIp = 0
  1061. for shift := uint(0); ; shift += 7 {
  1062. if shift >= 64 {
  1063. return ErrIntOverflowNebula
  1064. }
  1065. if iNdEx >= l {
  1066. return io.ErrUnexpectedEOF
  1067. }
  1068. b := dAtA[iNdEx]
  1069. iNdEx++
  1070. m.VpnIp |= uint32(b&0x7F) << shift
  1071. if b < 0x80 {
  1072. break
  1073. }
  1074. }
  1075. case 2:
  1076. if wireType != 2 {
  1077. return fmt.Errorf("proto: wrong wireType = %d for field Ip4AndPorts", wireType)
  1078. }
  1079. var msglen int
  1080. for shift := uint(0); ; shift += 7 {
  1081. if shift >= 64 {
  1082. return ErrIntOverflowNebula
  1083. }
  1084. if iNdEx >= l {
  1085. return io.ErrUnexpectedEOF
  1086. }
  1087. b := dAtA[iNdEx]
  1088. iNdEx++
  1089. msglen |= int(b&0x7F) << shift
  1090. if b < 0x80 {
  1091. break
  1092. }
  1093. }
  1094. if msglen < 0 {
  1095. return ErrInvalidLengthNebula
  1096. }
  1097. postIndex := iNdEx + msglen
  1098. if postIndex < 0 {
  1099. return ErrInvalidLengthNebula
  1100. }
  1101. if postIndex > l {
  1102. return io.ErrUnexpectedEOF
  1103. }
  1104. m.Ip4AndPorts = append(m.Ip4AndPorts, &Ip4AndPort{})
  1105. if err := m.Ip4AndPorts[len(m.Ip4AndPorts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1106. return err
  1107. }
  1108. iNdEx = postIndex
  1109. case 3:
  1110. if wireType != 0 {
  1111. return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType)
  1112. }
  1113. m.Counter = 0
  1114. for shift := uint(0); ; shift += 7 {
  1115. if shift >= 64 {
  1116. return ErrIntOverflowNebula
  1117. }
  1118. if iNdEx >= l {
  1119. return io.ErrUnexpectedEOF
  1120. }
  1121. b := dAtA[iNdEx]
  1122. iNdEx++
  1123. m.Counter |= uint32(b&0x7F) << shift
  1124. if b < 0x80 {
  1125. break
  1126. }
  1127. }
  1128. case 4:
  1129. if wireType != 2 {
  1130. return fmt.Errorf("proto: wrong wireType = %d for field Ip6AndPorts", wireType)
  1131. }
  1132. var msglen int
  1133. for shift := uint(0); ; shift += 7 {
  1134. if shift >= 64 {
  1135. return ErrIntOverflowNebula
  1136. }
  1137. if iNdEx >= l {
  1138. return io.ErrUnexpectedEOF
  1139. }
  1140. b := dAtA[iNdEx]
  1141. iNdEx++
  1142. msglen |= int(b&0x7F) << shift
  1143. if b < 0x80 {
  1144. break
  1145. }
  1146. }
  1147. if msglen < 0 {
  1148. return ErrInvalidLengthNebula
  1149. }
  1150. postIndex := iNdEx + msglen
  1151. if postIndex < 0 {
  1152. return ErrInvalidLengthNebula
  1153. }
  1154. if postIndex > l {
  1155. return io.ErrUnexpectedEOF
  1156. }
  1157. m.Ip6AndPorts = append(m.Ip6AndPorts, &Ip6AndPort{})
  1158. if err := m.Ip6AndPorts[len(m.Ip6AndPorts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1159. return err
  1160. }
  1161. iNdEx = postIndex
  1162. default:
  1163. iNdEx = preIndex
  1164. skippy, err := skipNebula(dAtA[iNdEx:])
  1165. if err != nil {
  1166. return err
  1167. }
  1168. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1169. return ErrInvalidLengthNebula
  1170. }
  1171. if (iNdEx + skippy) > l {
  1172. return io.ErrUnexpectedEOF
  1173. }
  1174. iNdEx += skippy
  1175. }
  1176. }
  1177. if iNdEx > l {
  1178. return io.ErrUnexpectedEOF
  1179. }
  1180. return nil
  1181. }
  1182. func (m *Ip4AndPort) Unmarshal(dAtA []byte) error {
  1183. l := len(dAtA)
  1184. iNdEx := 0
  1185. for iNdEx < l {
  1186. preIndex := iNdEx
  1187. var wire uint64
  1188. for shift := uint(0); ; shift += 7 {
  1189. if shift >= 64 {
  1190. return ErrIntOverflowNebula
  1191. }
  1192. if iNdEx >= l {
  1193. return io.ErrUnexpectedEOF
  1194. }
  1195. b := dAtA[iNdEx]
  1196. iNdEx++
  1197. wire |= uint64(b&0x7F) << shift
  1198. if b < 0x80 {
  1199. break
  1200. }
  1201. }
  1202. fieldNum := int32(wire >> 3)
  1203. wireType := int(wire & 0x7)
  1204. if wireType == 4 {
  1205. return fmt.Errorf("proto: Ip4AndPort: wiretype end group for non-group")
  1206. }
  1207. if fieldNum <= 0 {
  1208. return fmt.Errorf("proto: Ip4AndPort: illegal tag %d (wire type %d)", fieldNum, wire)
  1209. }
  1210. switch fieldNum {
  1211. case 1:
  1212. if wireType != 0 {
  1213. return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType)
  1214. }
  1215. m.Ip = 0
  1216. for shift := uint(0); ; shift += 7 {
  1217. if shift >= 64 {
  1218. return ErrIntOverflowNebula
  1219. }
  1220. if iNdEx >= l {
  1221. return io.ErrUnexpectedEOF
  1222. }
  1223. b := dAtA[iNdEx]
  1224. iNdEx++
  1225. m.Ip |= uint32(b&0x7F) << shift
  1226. if b < 0x80 {
  1227. break
  1228. }
  1229. }
  1230. case 2:
  1231. if wireType != 0 {
  1232. return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType)
  1233. }
  1234. m.Port = 0
  1235. for shift := uint(0); ; shift += 7 {
  1236. if shift >= 64 {
  1237. return ErrIntOverflowNebula
  1238. }
  1239. if iNdEx >= l {
  1240. return io.ErrUnexpectedEOF
  1241. }
  1242. b := dAtA[iNdEx]
  1243. iNdEx++
  1244. m.Port |= uint32(b&0x7F) << shift
  1245. if b < 0x80 {
  1246. break
  1247. }
  1248. }
  1249. default:
  1250. iNdEx = preIndex
  1251. skippy, err := skipNebula(dAtA[iNdEx:])
  1252. if err != nil {
  1253. return err
  1254. }
  1255. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1256. return ErrInvalidLengthNebula
  1257. }
  1258. if (iNdEx + skippy) > l {
  1259. return io.ErrUnexpectedEOF
  1260. }
  1261. iNdEx += skippy
  1262. }
  1263. }
  1264. if iNdEx > l {
  1265. return io.ErrUnexpectedEOF
  1266. }
  1267. return nil
  1268. }
  1269. func (m *Ip6AndPort) Unmarshal(dAtA []byte) error {
  1270. l := len(dAtA)
  1271. iNdEx := 0
  1272. for iNdEx < l {
  1273. preIndex := iNdEx
  1274. var wire uint64
  1275. for shift := uint(0); ; shift += 7 {
  1276. if shift >= 64 {
  1277. return ErrIntOverflowNebula
  1278. }
  1279. if iNdEx >= l {
  1280. return io.ErrUnexpectedEOF
  1281. }
  1282. b := dAtA[iNdEx]
  1283. iNdEx++
  1284. wire |= uint64(b&0x7F) << shift
  1285. if b < 0x80 {
  1286. break
  1287. }
  1288. }
  1289. fieldNum := int32(wire >> 3)
  1290. wireType := int(wire & 0x7)
  1291. if wireType == 4 {
  1292. return fmt.Errorf("proto: Ip6AndPort: wiretype end group for non-group")
  1293. }
  1294. if fieldNum <= 0 {
  1295. return fmt.Errorf("proto: Ip6AndPort: illegal tag %d (wire type %d)", fieldNum, wire)
  1296. }
  1297. switch fieldNum {
  1298. case 1:
  1299. if wireType != 0 {
  1300. return fmt.Errorf("proto: wrong wireType = %d for field Hi", wireType)
  1301. }
  1302. m.Hi = 0
  1303. for shift := uint(0); ; shift += 7 {
  1304. if shift >= 64 {
  1305. return ErrIntOverflowNebula
  1306. }
  1307. if iNdEx >= l {
  1308. return io.ErrUnexpectedEOF
  1309. }
  1310. b := dAtA[iNdEx]
  1311. iNdEx++
  1312. m.Hi |= uint64(b&0x7F) << shift
  1313. if b < 0x80 {
  1314. break
  1315. }
  1316. }
  1317. case 2:
  1318. if wireType != 0 {
  1319. return fmt.Errorf("proto: wrong wireType = %d for field Lo", wireType)
  1320. }
  1321. m.Lo = 0
  1322. for shift := uint(0); ; shift += 7 {
  1323. if shift >= 64 {
  1324. return ErrIntOverflowNebula
  1325. }
  1326. if iNdEx >= l {
  1327. return io.ErrUnexpectedEOF
  1328. }
  1329. b := dAtA[iNdEx]
  1330. iNdEx++
  1331. m.Lo |= uint64(b&0x7F) << shift
  1332. if b < 0x80 {
  1333. break
  1334. }
  1335. }
  1336. case 3:
  1337. if wireType != 0 {
  1338. return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType)
  1339. }
  1340. m.Port = 0
  1341. for shift := uint(0); ; shift += 7 {
  1342. if shift >= 64 {
  1343. return ErrIntOverflowNebula
  1344. }
  1345. if iNdEx >= l {
  1346. return io.ErrUnexpectedEOF
  1347. }
  1348. b := dAtA[iNdEx]
  1349. iNdEx++
  1350. m.Port |= uint32(b&0x7F) << shift
  1351. if b < 0x80 {
  1352. break
  1353. }
  1354. }
  1355. default:
  1356. iNdEx = preIndex
  1357. skippy, err := skipNebula(dAtA[iNdEx:])
  1358. if err != nil {
  1359. return err
  1360. }
  1361. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1362. return ErrInvalidLengthNebula
  1363. }
  1364. if (iNdEx + skippy) > l {
  1365. return io.ErrUnexpectedEOF
  1366. }
  1367. iNdEx += skippy
  1368. }
  1369. }
  1370. if iNdEx > l {
  1371. return io.ErrUnexpectedEOF
  1372. }
  1373. return nil
  1374. }
  1375. func (m *NebulaPing) Unmarshal(dAtA []byte) error {
  1376. l := len(dAtA)
  1377. iNdEx := 0
  1378. for iNdEx < l {
  1379. preIndex := iNdEx
  1380. var wire uint64
  1381. for shift := uint(0); ; shift += 7 {
  1382. if shift >= 64 {
  1383. return ErrIntOverflowNebula
  1384. }
  1385. if iNdEx >= l {
  1386. return io.ErrUnexpectedEOF
  1387. }
  1388. b := dAtA[iNdEx]
  1389. iNdEx++
  1390. wire |= uint64(b&0x7F) << shift
  1391. if b < 0x80 {
  1392. break
  1393. }
  1394. }
  1395. fieldNum := int32(wire >> 3)
  1396. wireType := int(wire & 0x7)
  1397. if wireType == 4 {
  1398. return fmt.Errorf("proto: NebulaPing: wiretype end group for non-group")
  1399. }
  1400. if fieldNum <= 0 {
  1401. return fmt.Errorf("proto: NebulaPing: illegal tag %d (wire type %d)", fieldNum, wire)
  1402. }
  1403. switch fieldNum {
  1404. case 1:
  1405. if wireType != 0 {
  1406. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  1407. }
  1408. m.Type = 0
  1409. for shift := uint(0); ; shift += 7 {
  1410. if shift >= 64 {
  1411. return ErrIntOverflowNebula
  1412. }
  1413. if iNdEx >= l {
  1414. return io.ErrUnexpectedEOF
  1415. }
  1416. b := dAtA[iNdEx]
  1417. iNdEx++
  1418. m.Type |= NebulaPing_MessageType(b&0x7F) << shift
  1419. if b < 0x80 {
  1420. break
  1421. }
  1422. }
  1423. case 2:
  1424. if wireType != 0 {
  1425. return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
  1426. }
  1427. m.Time = 0
  1428. for shift := uint(0); ; shift += 7 {
  1429. if shift >= 64 {
  1430. return ErrIntOverflowNebula
  1431. }
  1432. if iNdEx >= l {
  1433. return io.ErrUnexpectedEOF
  1434. }
  1435. b := dAtA[iNdEx]
  1436. iNdEx++
  1437. m.Time |= uint64(b&0x7F) << shift
  1438. if b < 0x80 {
  1439. break
  1440. }
  1441. }
  1442. default:
  1443. iNdEx = preIndex
  1444. skippy, err := skipNebula(dAtA[iNdEx:])
  1445. if err != nil {
  1446. return err
  1447. }
  1448. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1449. return ErrInvalidLengthNebula
  1450. }
  1451. if (iNdEx + skippy) > l {
  1452. return io.ErrUnexpectedEOF
  1453. }
  1454. iNdEx += skippy
  1455. }
  1456. }
  1457. if iNdEx > l {
  1458. return io.ErrUnexpectedEOF
  1459. }
  1460. return nil
  1461. }
  1462. func (m *NebulaHandshake) Unmarshal(dAtA []byte) error {
  1463. l := len(dAtA)
  1464. iNdEx := 0
  1465. for iNdEx < l {
  1466. preIndex := iNdEx
  1467. var wire uint64
  1468. for shift := uint(0); ; shift += 7 {
  1469. if shift >= 64 {
  1470. return ErrIntOverflowNebula
  1471. }
  1472. if iNdEx >= l {
  1473. return io.ErrUnexpectedEOF
  1474. }
  1475. b := dAtA[iNdEx]
  1476. iNdEx++
  1477. wire |= uint64(b&0x7F) << shift
  1478. if b < 0x80 {
  1479. break
  1480. }
  1481. }
  1482. fieldNum := int32(wire >> 3)
  1483. wireType := int(wire & 0x7)
  1484. if wireType == 4 {
  1485. return fmt.Errorf("proto: NebulaHandshake: wiretype end group for non-group")
  1486. }
  1487. if fieldNum <= 0 {
  1488. return fmt.Errorf("proto: NebulaHandshake: illegal tag %d (wire type %d)", fieldNum, wire)
  1489. }
  1490. switch fieldNum {
  1491. case 1:
  1492. if wireType != 2 {
  1493. return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType)
  1494. }
  1495. var msglen int
  1496. for shift := uint(0); ; shift += 7 {
  1497. if shift >= 64 {
  1498. return ErrIntOverflowNebula
  1499. }
  1500. if iNdEx >= l {
  1501. return io.ErrUnexpectedEOF
  1502. }
  1503. b := dAtA[iNdEx]
  1504. iNdEx++
  1505. msglen |= int(b&0x7F) << shift
  1506. if b < 0x80 {
  1507. break
  1508. }
  1509. }
  1510. if msglen < 0 {
  1511. return ErrInvalidLengthNebula
  1512. }
  1513. postIndex := iNdEx + msglen
  1514. if postIndex < 0 {
  1515. return ErrInvalidLengthNebula
  1516. }
  1517. if postIndex > l {
  1518. return io.ErrUnexpectedEOF
  1519. }
  1520. if m.Details == nil {
  1521. m.Details = &NebulaHandshakeDetails{}
  1522. }
  1523. if err := m.Details.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1524. return err
  1525. }
  1526. iNdEx = postIndex
  1527. case 2:
  1528. if wireType != 2 {
  1529. return fmt.Errorf("proto: wrong wireType = %d for field Hmac", wireType)
  1530. }
  1531. var byteLen int
  1532. for shift := uint(0); ; shift += 7 {
  1533. if shift >= 64 {
  1534. return ErrIntOverflowNebula
  1535. }
  1536. if iNdEx >= l {
  1537. return io.ErrUnexpectedEOF
  1538. }
  1539. b := dAtA[iNdEx]
  1540. iNdEx++
  1541. byteLen |= int(b&0x7F) << shift
  1542. if b < 0x80 {
  1543. break
  1544. }
  1545. }
  1546. if byteLen < 0 {
  1547. return ErrInvalidLengthNebula
  1548. }
  1549. postIndex := iNdEx + byteLen
  1550. if postIndex < 0 {
  1551. return ErrInvalidLengthNebula
  1552. }
  1553. if postIndex > l {
  1554. return io.ErrUnexpectedEOF
  1555. }
  1556. m.Hmac = append(m.Hmac[:0], dAtA[iNdEx:postIndex]...)
  1557. if m.Hmac == nil {
  1558. m.Hmac = []byte{}
  1559. }
  1560. iNdEx = postIndex
  1561. default:
  1562. iNdEx = preIndex
  1563. skippy, err := skipNebula(dAtA[iNdEx:])
  1564. if err != nil {
  1565. return err
  1566. }
  1567. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1568. return ErrInvalidLengthNebula
  1569. }
  1570. if (iNdEx + skippy) > l {
  1571. return io.ErrUnexpectedEOF
  1572. }
  1573. iNdEx += skippy
  1574. }
  1575. }
  1576. if iNdEx > l {
  1577. return io.ErrUnexpectedEOF
  1578. }
  1579. return nil
  1580. }
  1581. func (m *NebulaHandshakeDetails) Unmarshal(dAtA []byte) error {
  1582. l := len(dAtA)
  1583. iNdEx := 0
  1584. for iNdEx < l {
  1585. preIndex := iNdEx
  1586. var wire uint64
  1587. for shift := uint(0); ; shift += 7 {
  1588. if shift >= 64 {
  1589. return ErrIntOverflowNebula
  1590. }
  1591. if iNdEx >= l {
  1592. return io.ErrUnexpectedEOF
  1593. }
  1594. b := dAtA[iNdEx]
  1595. iNdEx++
  1596. wire |= uint64(b&0x7F) << shift
  1597. if b < 0x80 {
  1598. break
  1599. }
  1600. }
  1601. fieldNum := int32(wire >> 3)
  1602. wireType := int(wire & 0x7)
  1603. if wireType == 4 {
  1604. return fmt.Errorf("proto: NebulaHandshakeDetails: wiretype end group for non-group")
  1605. }
  1606. if fieldNum <= 0 {
  1607. return fmt.Errorf("proto: NebulaHandshakeDetails: illegal tag %d (wire type %d)", fieldNum, wire)
  1608. }
  1609. switch fieldNum {
  1610. case 1:
  1611. if wireType != 2 {
  1612. return fmt.Errorf("proto: wrong wireType = %d for field Cert", wireType)
  1613. }
  1614. var byteLen int
  1615. for shift := uint(0); ; shift += 7 {
  1616. if shift >= 64 {
  1617. return ErrIntOverflowNebula
  1618. }
  1619. if iNdEx >= l {
  1620. return io.ErrUnexpectedEOF
  1621. }
  1622. b := dAtA[iNdEx]
  1623. iNdEx++
  1624. byteLen |= int(b&0x7F) << shift
  1625. if b < 0x80 {
  1626. break
  1627. }
  1628. }
  1629. if byteLen < 0 {
  1630. return ErrInvalidLengthNebula
  1631. }
  1632. postIndex := iNdEx + byteLen
  1633. if postIndex < 0 {
  1634. return ErrInvalidLengthNebula
  1635. }
  1636. if postIndex > l {
  1637. return io.ErrUnexpectedEOF
  1638. }
  1639. m.Cert = append(m.Cert[:0], dAtA[iNdEx:postIndex]...)
  1640. if m.Cert == nil {
  1641. m.Cert = []byte{}
  1642. }
  1643. iNdEx = postIndex
  1644. case 2:
  1645. if wireType != 0 {
  1646. return fmt.Errorf("proto: wrong wireType = %d for field InitiatorIndex", wireType)
  1647. }
  1648. m.InitiatorIndex = 0
  1649. for shift := uint(0); ; shift += 7 {
  1650. if shift >= 64 {
  1651. return ErrIntOverflowNebula
  1652. }
  1653. if iNdEx >= l {
  1654. return io.ErrUnexpectedEOF
  1655. }
  1656. b := dAtA[iNdEx]
  1657. iNdEx++
  1658. m.InitiatorIndex |= uint32(b&0x7F) << shift
  1659. if b < 0x80 {
  1660. break
  1661. }
  1662. }
  1663. case 3:
  1664. if wireType != 0 {
  1665. return fmt.Errorf("proto: wrong wireType = %d for field ResponderIndex", wireType)
  1666. }
  1667. m.ResponderIndex = 0
  1668. for shift := uint(0); ; shift += 7 {
  1669. if shift >= 64 {
  1670. return ErrIntOverflowNebula
  1671. }
  1672. if iNdEx >= l {
  1673. return io.ErrUnexpectedEOF
  1674. }
  1675. b := dAtA[iNdEx]
  1676. iNdEx++
  1677. m.ResponderIndex |= uint32(b&0x7F) << shift
  1678. if b < 0x80 {
  1679. break
  1680. }
  1681. }
  1682. case 4:
  1683. if wireType != 0 {
  1684. return fmt.Errorf("proto: wrong wireType = %d for field Cookie", wireType)
  1685. }
  1686. m.Cookie = 0
  1687. for shift := uint(0); ; shift += 7 {
  1688. if shift >= 64 {
  1689. return ErrIntOverflowNebula
  1690. }
  1691. if iNdEx >= l {
  1692. return io.ErrUnexpectedEOF
  1693. }
  1694. b := dAtA[iNdEx]
  1695. iNdEx++
  1696. m.Cookie |= uint64(b&0x7F) << shift
  1697. if b < 0x80 {
  1698. break
  1699. }
  1700. }
  1701. case 5:
  1702. if wireType != 0 {
  1703. return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
  1704. }
  1705. m.Time = 0
  1706. for shift := uint(0); ; shift += 7 {
  1707. if shift >= 64 {
  1708. return ErrIntOverflowNebula
  1709. }
  1710. if iNdEx >= l {
  1711. return io.ErrUnexpectedEOF
  1712. }
  1713. b := dAtA[iNdEx]
  1714. iNdEx++
  1715. m.Time |= uint64(b&0x7F) << shift
  1716. if b < 0x80 {
  1717. break
  1718. }
  1719. }
  1720. default:
  1721. iNdEx = preIndex
  1722. skippy, err := skipNebula(dAtA[iNdEx:])
  1723. if err != nil {
  1724. return err
  1725. }
  1726. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1727. return ErrInvalidLengthNebula
  1728. }
  1729. if (iNdEx + skippy) > l {
  1730. return io.ErrUnexpectedEOF
  1731. }
  1732. iNdEx += skippy
  1733. }
  1734. }
  1735. if iNdEx > l {
  1736. return io.ErrUnexpectedEOF
  1737. }
  1738. return nil
  1739. }
  1740. func skipNebula(dAtA []byte) (n int, err error) {
  1741. l := len(dAtA)
  1742. iNdEx := 0
  1743. depth := 0
  1744. for iNdEx < l {
  1745. var wire uint64
  1746. for shift := uint(0); ; shift += 7 {
  1747. if shift >= 64 {
  1748. return 0, ErrIntOverflowNebula
  1749. }
  1750. if iNdEx >= l {
  1751. return 0, io.ErrUnexpectedEOF
  1752. }
  1753. b := dAtA[iNdEx]
  1754. iNdEx++
  1755. wire |= (uint64(b) & 0x7F) << shift
  1756. if b < 0x80 {
  1757. break
  1758. }
  1759. }
  1760. wireType := int(wire & 0x7)
  1761. switch wireType {
  1762. case 0:
  1763. for shift := uint(0); ; shift += 7 {
  1764. if shift >= 64 {
  1765. return 0, ErrIntOverflowNebula
  1766. }
  1767. if iNdEx >= l {
  1768. return 0, io.ErrUnexpectedEOF
  1769. }
  1770. iNdEx++
  1771. if dAtA[iNdEx-1] < 0x80 {
  1772. break
  1773. }
  1774. }
  1775. case 1:
  1776. iNdEx += 8
  1777. case 2:
  1778. var length int
  1779. for shift := uint(0); ; shift += 7 {
  1780. if shift >= 64 {
  1781. return 0, ErrIntOverflowNebula
  1782. }
  1783. if iNdEx >= l {
  1784. return 0, io.ErrUnexpectedEOF
  1785. }
  1786. b := dAtA[iNdEx]
  1787. iNdEx++
  1788. length |= (int(b) & 0x7F) << shift
  1789. if b < 0x80 {
  1790. break
  1791. }
  1792. }
  1793. if length < 0 {
  1794. return 0, ErrInvalidLengthNebula
  1795. }
  1796. iNdEx += length
  1797. case 3:
  1798. depth++
  1799. case 4:
  1800. if depth == 0 {
  1801. return 0, ErrUnexpectedEndOfGroupNebula
  1802. }
  1803. depth--
  1804. case 5:
  1805. iNdEx += 4
  1806. default:
  1807. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1808. }
  1809. if iNdEx < 0 {
  1810. return 0, ErrInvalidLengthNebula
  1811. }
  1812. if depth == 0 {
  1813. return iNdEx, nil
  1814. }
  1815. }
  1816. return 0, io.ErrUnexpectedEOF
  1817. }
  1818. var (
  1819. ErrInvalidLengthNebula = fmt.Errorf("proto: negative length found during unmarshaling")
  1820. ErrIntOverflowNebula = fmt.Errorf("proto: integer overflow")
  1821. ErrUnexpectedEndOfGroupNebula = fmt.Errorf("proto: unexpected end of group")
  1822. )