nebula.pb.go 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358
  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. // 685 bytes of a gzipped FileDescriptorProto
  566. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xc1, 0x6e, 0xd3, 0x4a,
  567. 0x14, 0x8d, 0x1d, 0x27, 0x6d, 0x6e, 0x9a, 0xd4, 0xef, 0xf6, 0x11, 0x52, 0x84, 0xac, 0xe0, 0x05,
  568. 0xca, 0x2a, 0xad, 0xd2, 0x52, 0xb1, 0x04, 0x82, 0x50, 0x22, 0xb5, 0x55, 0x18, 0x15, 0x90, 0xd8,
  569. 0xa0, 0x69, 0x32, 0xd4, 0x56, 0x92, 0x19, 0xd7, 0x9e, 0xa0, 0xe6, 0x2f, 0xf8, 0x0c, 0x3e, 0x80,
  570. 0x8f, 0x60, 0x81, 0x44, 0x17, 0x2c, 0x58, 0xa2, 0xf6, 0x47, 0xd0, 0x8c, 0x1d, 0xc7, 0x49, 0x03,
  571. 0xbb, 0x39, 0xf7, 0x9e, 0x33, 0x73, 0xe6, 0xcc, 0xd5, 0xc0, 0x16, 0x67, 0xe7, 0xd3, 0x31, 0x6d,
  572. 0x05, 0xa1, 0x90, 0x02, 0x8b, 0x31, 0x72, 0xbf, 0x9b, 0x00, 0xa7, 0x7a, 0x79, 0xc2, 0x24, 0xc5,
  573. 0x36, 0x58, 0x67, 0xb3, 0x80, 0xd5, 0x8d, 0x86, 0xd1, 0xac, 0xb6, 0x9d, 0x56, 0xa2, 0x59, 0x30,
  574. 0x5a, 0x27, 0x2c, 0x8a, 0xe8, 0x05, 0x53, 0x2c, 0xa2, 0xb9, 0x78, 0x00, 0x1b, 0x2f, 0x99, 0xa4,
  575. 0xfe, 0x38, 0xaa, 0x9b, 0x0d, 0xa3, 0x59, 0x6e, 0xef, 0xde, 0x95, 0x25, 0x04, 0x32, 0x67, 0xba,
  576. 0x3f, 0x0d, 0x28, 0x67, 0xb6, 0xc2, 0x4d, 0xb0, 0x4e, 0x05, 0x67, 0x76, 0x0e, 0x2b, 0x50, 0xea,
  577. 0x8a, 0x48, 0xbe, 0x9e, 0xb2, 0x70, 0x66, 0x1b, 0x88, 0x50, 0x4d, 0x21, 0x61, 0xc1, 0x78, 0x66,
  578. 0x9b, 0xf8, 0x00, 0x6a, 0xaa, 0xf6, 0x26, 0x18, 0x52, 0xc9, 0x4e, 0x85, 0xf4, 0x3f, 0xfa, 0x03,
  579. 0x2a, 0x7d, 0xc1, 0xed, 0x3c, 0xee, 0xc2, 0x3d, 0xd5, 0x3b, 0x11, 0x9f, 0xd8, 0x70, 0xa9, 0x65,
  580. 0xcd, 0x5b, 0xfd, 0x29, 0x1f, 0x78, 0x4b, 0xad, 0x02, 0x56, 0x01, 0x54, 0xeb, 0x9d, 0x27, 0xe8,
  581. 0xc4, 0xb7, 0x8b, 0xb8, 0x03, 0xdb, 0x0b, 0x1c, 0x1f, 0xbb, 0xa1, 0x9c, 0xf5, 0xa9, 0xf4, 0x3a,
  582. 0x1e, 0x1b, 0x8c, 0xec, 0x4d, 0xe5, 0x2c, 0x85, 0x31, 0xa5, 0xe4, 0xfe, 0x30, 0xe0, 0xbf, 0x3b,
  583. 0xb7, 0xc6, 0xff, 0xa1, 0xf0, 0x36, 0xe0, 0xbd, 0x40, 0xc7, 0x5a, 0x21, 0x31, 0xc0, 0x43, 0x28,
  584. 0xf7, 0x82, 0xc3, 0xe7, 0x7c, 0xd8, 0x17, 0xa1, 0x54, 0xd9, 0xe5, 0x9b, 0xe5, 0x36, 0xce, 0xb3,
  585. 0x5b, 0xb4, 0x48, 0x96, 0x16, 0xab, 0x8e, 0x52, 0x95, 0xb5, 0xaa, 0x3a, 0xca, 0xa8, 0x52, 0x1a,
  586. 0x3a, 0x00, 0x84, 0x8d, 0xe9, 0x2c, 0xb6, 0x51, 0x68, 0xe4, 0x9b, 0x15, 0x92, 0xa9, 0x60, 0x1d,
  587. 0x36, 0x06, 0x62, 0xca, 0x25, 0x0b, 0xeb, 0x79, 0xed, 0x71, 0x0e, 0xdd, 0x7d, 0x80, 0xc5, 0xf1,
  588. 0x58, 0x05, 0x33, 0xbd, 0x86, 0xd9, 0x0b, 0x10, 0xc1, 0x52, 0x75, 0xfd, 0xf0, 0x15, 0xa2, 0xd7,
  589. 0xee, 0x33, 0xa5, 0x38, 0xca, 0x28, 0xba, 0xbe, 0x56, 0x58, 0xc4, 0xec, 0xfa, 0x0a, 0x1f, 0x0b,
  590. 0xcd, 0xb7, 0x88, 0x79, 0x2c, 0xd2, 0x1d, 0xf2, 0x99, 0x1d, 0xae, 0xe6, 0x33, 0xd9, 0xf7, 0xf9,
  591. 0xc5, 0xbf, 0x67, 0x52, 0x31, 0xd6, 0xcc, 0x24, 0x82, 0x75, 0xe6, 0x4f, 0x58, 0x72, 0x8e, 0x5e,
  592. 0xbb, 0xee, 0x9d, 0x89, 0x53, 0x62, 0x3b, 0x87, 0x25, 0x28, 0xc4, 0xef, 0x67, 0xb8, 0x1f, 0x60,
  593. 0x3b, 0xde, 0xb7, 0x4b, 0xf9, 0x30, 0xf2, 0xe8, 0x88, 0xe1, 0xd3, 0xc5, 0x78, 0x1b, 0x7a, 0xbc,
  594. 0x57, 0x1c, 0xa4, 0xcc, 0xd5, 0x19, 0x57, 0x26, 0xba, 0x13, 0x3a, 0xd0, 0x26, 0xb6, 0x88, 0x5e,
  595. 0xbb, 0x5f, 0x0c, 0xa8, 0xad, 0xd7, 0x29, 0x7a, 0x87, 0x85, 0x52, 0x9f, 0xb2, 0x45, 0xf4, 0x1a,
  596. 0x1f, 0x43, 0xb5, 0xc7, 0x7d, 0xe9, 0x53, 0x29, 0xc2, 0x1e, 0x1f, 0xb2, 0xab, 0x24, 0xe9, 0x95,
  597. 0xaa, 0xe2, 0x11, 0x16, 0x05, 0x82, 0x0f, 0x59, 0xc2, 0x8b, 0xf3, 0x5c, 0xa9, 0x62, 0x0d, 0x8a,
  598. 0x1d, 0x21, 0x46, 0x3e, 0xab, 0x5b, 0x3a, 0x99, 0x04, 0xa5, 0x79, 0x15, 0x32, 0x79, 0x7d, 0x35,
  599. 0xa1, 0x12, 0x5b, 0xed, 0x08, 0x2e, 0x43, 0x31, 0xc6, 0x27, 0x4b, 0x2f, 0xf1, 0x68, 0x39, 0x87,
  600. 0x84, 0xb4, 0xe6, 0x31, 0xf6, 0x61, 0x27, 0xb5, 0xab, 0x67, 0x2e, 0x7b, 0x93, 0x75, 0x2d, 0xa5,
  601. 0x48, 0x8d, 0x67, 0x14, 0xf1, 0x9d, 0xd6, 0xb5, 0xf0, 0x21, 0x94, 0x34, 0x3a, 0x13, 0xbd, 0x40,
  602. 0xdf, 0xad, 0x42, 0x16, 0x05, 0x6c, 0x40, 0x59, 0x83, 0x57, 0xa1, 0x98, 0xe8, 0xf9, 0x57, 0xfd,
  603. 0x6c, 0xc9, 0xed, 0xfe, 0xed, 0x3b, 0xaa, 0x01, 0x76, 0x42, 0x46, 0x25, 0xd3, 0x6c, 0xc2, 0x2e,
  604. 0xa7, 0x2c, 0x92, 0xb6, 0x81, 0xf7, 0x61, 0x67, 0xa9, 0xae, 0x2c, 0x45, 0xcc, 0x36, 0x5f, 0x1c,
  605. 0x7c, 0xbb, 0x71, 0x8c, 0xeb, 0x1b, 0xc7, 0xf8, 0x7d, 0xe3, 0x18, 0x9f, 0x6f, 0x9d, 0xdc, 0xf5,
  606. 0xad, 0x93, 0xfb, 0x75, 0xeb, 0xe4, 0xde, 0xef, 0x5e, 0xf8, 0xd2, 0x9b, 0x9e, 0xb7, 0x06, 0x62,
  607. 0xb2, 0x17, 0x8d, 0xe9, 0x60, 0xe4, 0x5d, 0xee, 0xc5, 0x11, 0x9e, 0x17, 0xf5, 0xaf, 0x7c, 0xf0,
  608. 0x27, 0x00, 0x00, 0xff, 0xff, 0xd3, 0x87, 0x83, 0x6c, 0xa5, 0x05, 0x00, 0x00,
  609. }
  610. func (m *NebulaMeta) Marshal() (dAtA []byte, err error) {
  611. size := m.Size()
  612. dAtA = make([]byte, size)
  613. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  614. if err != nil {
  615. return nil, err
  616. }
  617. return dAtA[:n], nil
  618. }
  619. func (m *NebulaMeta) MarshalTo(dAtA []byte) (int, error) {
  620. size := m.Size()
  621. return m.MarshalToSizedBuffer(dAtA[:size])
  622. }
  623. func (m *NebulaMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  624. i := len(dAtA)
  625. _ = i
  626. var l int
  627. _ = l
  628. if m.Details != nil {
  629. {
  630. size, err := m.Details.MarshalToSizedBuffer(dAtA[:i])
  631. if err != nil {
  632. return 0, err
  633. }
  634. i -= size
  635. i = encodeVarintNebula(dAtA, i, uint64(size))
  636. }
  637. i--
  638. dAtA[i] = 0x12
  639. }
  640. if m.Type != 0 {
  641. i = encodeVarintNebula(dAtA, i, uint64(m.Type))
  642. i--
  643. dAtA[i] = 0x8
  644. }
  645. return len(dAtA) - i, nil
  646. }
  647. func (m *NebulaMetaDetails) Marshal() (dAtA []byte, err error) {
  648. size := m.Size()
  649. dAtA = make([]byte, size)
  650. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  651. if err != nil {
  652. return nil, err
  653. }
  654. return dAtA[:n], nil
  655. }
  656. func (m *NebulaMetaDetails) MarshalTo(dAtA []byte) (int, error) {
  657. size := m.Size()
  658. return m.MarshalToSizedBuffer(dAtA[:size])
  659. }
  660. func (m *NebulaMetaDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  661. i := len(dAtA)
  662. _ = i
  663. var l int
  664. _ = l
  665. if len(m.RelayVpnIp) > 0 {
  666. dAtA3 := make([]byte, len(m.RelayVpnIp)*10)
  667. var j2 int
  668. for _, num := range m.RelayVpnIp {
  669. for num >= 1<<7 {
  670. dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80)
  671. num >>= 7
  672. j2++
  673. }
  674. dAtA3[j2] = uint8(num)
  675. j2++
  676. }
  677. i -= j2
  678. copy(dAtA[i:], dAtA3[:j2])
  679. i = encodeVarintNebula(dAtA, i, uint64(j2))
  680. i--
  681. dAtA[i] = 0x2a
  682. }
  683. if len(m.Ip6AndPorts) > 0 {
  684. for iNdEx := len(m.Ip6AndPorts) - 1; iNdEx >= 0; iNdEx-- {
  685. {
  686. size, err := m.Ip6AndPorts[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  687. if err != nil {
  688. return 0, err
  689. }
  690. i -= size
  691. i = encodeVarintNebula(dAtA, i, uint64(size))
  692. }
  693. i--
  694. dAtA[i] = 0x22
  695. }
  696. }
  697. if m.Counter != 0 {
  698. i = encodeVarintNebula(dAtA, i, uint64(m.Counter))
  699. i--
  700. dAtA[i] = 0x18
  701. }
  702. if len(m.Ip4AndPorts) > 0 {
  703. for iNdEx := len(m.Ip4AndPorts) - 1; iNdEx >= 0; iNdEx-- {
  704. {
  705. size, err := m.Ip4AndPorts[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  706. if err != nil {
  707. return 0, err
  708. }
  709. i -= size
  710. i = encodeVarintNebula(dAtA, i, uint64(size))
  711. }
  712. i--
  713. dAtA[i] = 0x12
  714. }
  715. }
  716. if m.VpnIp != 0 {
  717. i = encodeVarintNebula(dAtA, i, uint64(m.VpnIp))
  718. i--
  719. dAtA[i] = 0x8
  720. }
  721. return len(dAtA) - i, nil
  722. }
  723. func (m *Ip4AndPort) Marshal() (dAtA []byte, err error) {
  724. size := m.Size()
  725. dAtA = make([]byte, size)
  726. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  727. if err != nil {
  728. return nil, err
  729. }
  730. return dAtA[:n], nil
  731. }
  732. func (m *Ip4AndPort) MarshalTo(dAtA []byte) (int, error) {
  733. size := m.Size()
  734. return m.MarshalToSizedBuffer(dAtA[:size])
  735. }
  736. func (m *Ip4AndPort) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  737. i := len(dAtA)
  738. _ = i
  739. var l int
  740. _ = l
  741. if m.Port != 0 {
  742. i = encodeVarintNebula(dAtA, i, uint64(m.Port))
  743. i--
  744. dAtA[i] = 0x10
  745. }
  746. if m.Ip != 0 {
  747. i = encodeVarintNebula(dAtA, i, uint64(m.Ip))
  748. i--
  749. dAtA[i] = 0x8
  750. }
  751. return len(dAtA) - i, nil
  752. }
  753. func (m *Ip6AndPort) Marshal() (dAtA []byte, err error) {
  754. size := m.Size()
  755. dAtA = make([]byte, size)
  756. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  757. if err != nil {
  758. return nil, err
  759. }
  760. return dAtA[:n], nil
  761. }
  762. func (m *Ip6AndPort) MarshalTo(dAtA []byte) (int, error) {
  763. size := m.Size()
  764. return m.MarshalToSizedBuffer(dAtA[:size])
  765. }
  766. func (m *Ip6AndPort) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  767. i := len(dAtA)
  768. _ = i
  769. var l int
  770. _ = l
  771. if m.Port != 0 {
  772. i = encodeVarintNebula(dAtA, i, uint64(m.Port))
  773. i--
  774. dAtA[i] = 0x18
  775. }
  776. if m.Lo != 0 {
  777. i = encodeVarintNebula(dAtA, i, uint64(m.Lo))
  778. i--
  779. dAtA[i] = 0x10
  780. }
  781. if m.Hi != 0 {
  782. i = encodeVarintNebula(dAtA, i, uint64(m.Hi))
  783. i--
  784. dAtA[i] = 0x8
  785. }
  786. return len(dAtA) - i, nil
  787. }
  788. func (m *NebulaPing) Marshal() (dAtA []byte, err error) {
  789. size := m.Size()
  790. dAtA = make([]byte, size)
  791. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  792. if err != nil {
  793. return nil, err
  794. }
  795. return dAtA[:n], nil
  796. }
  797. func (m *NebulaPing) MarshalTo(dAtA []byte) (int, error) {
  798. size := m.Size()
  799. return m.MarshalToSizedBuffer(dAtA[:size])
  800. }
  801. func (m *NebulaPing) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  802. i := len(dAtA)
  803. _ = i
  804. var l int
  805. _ = l
  806. if m.Time != 0 {
  807. i = encodeVarintNebula(dAtA, i, uint64(m.Time))
  808. i--
  809. dAtA[i] = 0x10
  810. }
  811. if m.Type != 0 {
  812. i = encodeVarintNebula(dAtA, i, uint64(m.Type))
  813. i--
  814. dAtA[i] = 0x8
  815. }
  816. return len(dAtA) - i, nil
  817. }
  818. func (m *NebulaHandshake) Marshal() (dAtA []byte, err error) {
  819. size := m.Size()
  820. dAtA = make([]byte, size)
  821. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  822. if err != nil {
  823. return nil, err
  824. }
  825. return dAtA[:n], nil
  826. }
  827. func (m *NebulaHandshake) MarshalTo(dAtA []byte) (int, error) {
  828. size := m.Size()
  829. return m.MarshalToSizedBuffer(dAtA[:size])
  830. }
  831. func (m *NebulaHandshake) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  832. i := len(dAtA)
  833. _ = i
  834. var l int
  835. _ = l
  836. if len(m.Hmac) > 0 {
  837. i -= len(m.Hmac)
  838. copy(dAtA[i:], m.Hmac)
  839. i = encodeVarintNebula(dAtA, i, uint64(len(m.Hmac)))
  840. i--
  841. dAtA[i] = 0x12
  842. }
  843. if m.Details != nil {
  844. {
  845. size, err := m.Details.MarshalToSizedBuffer(dAtA[:i])
  846. if err != nil {
  847. return 0, err
  848. }
  849. i -= size
  850. i = encodeVarintNebula(dAtA, i, uint64(size))
  851. }
  852. i--
  853. dAtA[i] = 0xa
  854. }
  855. return len(dAtA) - i, nil
  856. }
  857. func (m *NebulaHandshakeDetails) Marshal() (dAtA []byte, err error) {
  858. size := m.Size()
  859. dAtA = make([]byte, size)
  860. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  861. if err != nil {
  862. return nil, err
  863. }
  864. return dAtA[:n], nil
  865. }
  866. func (m *NebulaHandshakeDetails) MarshalTo(dAtA []byte) (int, error) {
  867. size := m.Size()
  868. return m.MarshalToSizedBuffer(dAtA[:size])
  869. }
  870. func (m *NebulaHandshakeDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  871. i := len(dAtA)
  872. _ = i
  873. var l int
  874. _ = l
  875. if m.Time != 0 {
  876. i = encodeVarintNebula(dAtA, i, uint64(m.Time))
  877. i--
  878. dAtA[i] = 0x28
  879. }
  880. if m.Cookie != 0 {
  881. i = encodeVarintNebula(dAtA, i, uint64(m.Cookie))
  882. i--
  883. dAtA[i] = 0x20
  884. }
  885. if m.ResponderIndex != 0 {
  886. i = encodeVarintNebula(dAtA, i, uint64(m.ResponderIndex))
  887. i--
  888. dAtA[i] = 0x18
  889. }
  890. if m.InitiatorIndex != 0 {
  891. i = encodeVarintNebula(dAtA, i, uint64(m.InitiatorIndex))
  892. i--
  893. dAtA[i] = 0x10
  894. }
  895. if len(m.Cert) > 0 {
  896. i -= len(m.Cert)
  897. copy(dAtA[i:], m.Cert)
  898. i = encodeVarintNebula(dAtA, i, uint64(len(m.Cert)))
  899. i--
  900. dAtA[i] = 0xa
  901. }
  902. return len(dAtA) - i, nil
  903. }
  904. func (m *NebulaControl) Marshal() (dAtA []byte, err error) {
  905. size := m.Size()
  906. dAtA = make([]byte, size)
  907. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  908. if err != nil {
  909. return nil, err
  910. }
  911. return dAtA[:n], nil
  912. }
  913. func (m *NebulaControl) MarshalTo(dAtA []byte) (int, error) {
  914. size := m.Size()
  915. return m.MarshalToSizedBuffer(dAtA[:size])
  916. }
  917. func (m *NebulaControl) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  918. i := len(dAtA)
  919. _ = i
  920. var l int
  921. _ = l
  922. if m.RelayFromIp != 0 {
  923. i = encodeVarintNebula(dAtA, i, uint64(m.RelayFromIp))
  924. i--
  925. dAtA[i] = 0x28
  926. }
  927. if m.RelayToIp != 0 {
  928. i = encodeVarintNebula(dAtA, i, uint64(m.RelayToIp))
  929. i--
  930. dAtA[i] = 0x20
  931. }
  932. if m.ResponderRelayIndex != 0 {
  933. i = encodeVarintNebula(dAtA, i, uint64(m.ResponderRelayIndex))
  934. i--
  935. dAtA[i] = 0x18
  936. }
  937. if m.InitiatorRelayIndex != 0 {
  938. i = encodeVarintNebula(dAtA, i, uint64(m.InitiatorRelayIndex))
  939. i--
  940. dAtA[i] = 0x10
  941. }
  942. if m.Type != 0 {
  943. i = encodeVarintNebula(dAtA, i, uint64(m.Type))
  944. i--
  945. dAtA[i] = 0x8
  946. }
  947. return len(dAtA) - i, nil
  948. }
  949. func encodeVarintNebula(dAtA []byte, offset int, v uint64) int {
  950. offset -= sovNebula(v)
  951. base := offset
  952. for v >= 1<<7 {
  953. dAtA[offset] = uint8(v&0x7f | 0x80)
  954. v >>= 7
  955. offset++
  956. }
  957. dAtA[offset] = uint8(v)
  958. return base
  959. }
  960. func (m *NebulaMeta) Size() (n int) {
  961. if m == nil {
  962. return 0
  963. }
  964. var l int
  965. _ = l
  966. if m.Type != 0 {
  967. n += 1 + sovNebula(uint64(m.Type))
  968. }
  969. if m.Details != nil {
  970. l = m.Details.Size()
  971. n += 1 + l + sovNebula(uint64(l))
  972. }
  973. return n
  974. }
  975. func (m *NebulaMetaDetails) Size() (n int) {
  976. if m == nil {
  977. return 0
  978. }
  979. var l int
  980. _ = l
  981. if m.VpnIp != 0 {
  982. n += 1 + sovNebula(uint64(m.VpnIp))
  983. }
  984. if len(m.Ip4AndPorts) > 0 {
  985. for _, e := range m.Ip4AndPorts {
  986. l = e.Size()
  987. n += 1 + l + sovNebula(uint64(l))
  988. }
  989. }
  990. if m.Counter != 0 {
  991. n += 1 + sovNebula(uint64(m.Counter))
  992. }
  993. if len(m.Ip6AndPorts) > 0 {
  994. for _, e := range m.Ip6AndPorts {
  995. l = e.Size()
  996. n += 1 + l + sovNebula(uint64(l))
  997. }
  998. }
  999. if len(m.RelayVpnIp) > 0 {
  1000. l = 0
  1001. for _, e := range m.RelayVpnIp {
  1002. l += sovNebula(uint64(e))
  1003. }
  1004. n += 1 + sovNebula(uint64(l)) + l
  1005. }
  1006. return n
  1007. }
  1008. func (m *Ip4AndPort) Size() (n int) {
  1009. if m == nil {
  1010. return 0
  1011. }
  1012. var l int
  1013. _ = l
  1014. if m.Ip != 0 {
  1015. n += 1 + sovNebula(uint64(m.Ip))
  1016. }
  1017. if m.Port != 0 {
  1018. n += 1 + sovNebula(uint64(m.Port))
  1019. }
  1020. return n
  1021. }
  1022. func (m *Ip6AndPort) Size() (n int) {
  1023. if m == nil {
  1024. return 0
  1025. }
  1026. var l int
  1027. _ = l
  1028. if m.Hi != 0 {
  1029. n += 1 + sovNebula(uint64(m.Hi))
  1030. }
  1031. if m.Lo != 0 {
  1032. n += 1 + sovNebula(uint64(m.Lo))
  1033. }
  1034. if m.Port != 0 {
  1035. n += 1 + sovNebula(uint64(m.Port))
  1036. }
  1037. return n
  1038. }
  1039. func (m *NebulaPing) Size() (n int) {
  1040. if m == nil {
  1041. return 0
  1042. }
  1043. var l int
  1044. _ = l
  1045. if m.Type != 0 {
  1046. n += 1 + sovNebula(uint64(m.Type))
  1047. }
  1048. if m.Time != 0 {
  1049. n += 1 + sovNebula(uint64(m.Time))
  1050. }
  1051. return n
  1052. }
  1053. func (m *NebulaHandshake) Size() (n int) {
  1054. if m == nil {
  1055. return 0
  1056. }
  1057. var l int
  1058. _ = l
  1059. if m.Details != nil {
  1060. l = m.Details.Size()
  1061. n += 1 + l + sovNebula(uint64(l))
  1062. }
  1063. l = len(m.Hmac)
  1064. if l > 0 {
  1065. n += 1 + l + sovNebula(uint64(l))
  1066. }
  1067. return n
  1068. }
  1069. func (m *NebulaHandshakeDetails) Size() (n int) {
  1070. if m == nil {
  1071. return 0
  1072. }
  1073. var l int
  1074. _ = l
  1075. l = len(m.Cert)
  1076. if l > 0 {
  1077. n += 1 + l + sovNebula(uint64(l))
  1078. }
  1079. if m.InitiatorIndex != 0 {
  1080. n += 1 + sovNebula(uint64(m.InitiatorIndex))
  1081. }
  1082. if m.ResponderIndex != 0 {
  1083. n += 1 + sovNebula(uint64(m.ResponderIndex))
  1084. }
  1085. if m.Cookie != 0 {
  1086. n += 1 + sovNebula(uint64(m.Cookie))
  1087. }
  1088. if m.Time != 0 {
  1089. n += 1 + sovNebula(uint64(m.Time))
  1090. }
  1091. return n
  1092. }
  1093. func (m *NebulaControl) Size() (n int) {
  1094. if m == nil {
  1095. return 0
  1096. }
  1097. var l int
  1098. _ = l
  1099. if m.Type != 0 {
  1100. n += 1 + sovNebula(uint64(m.Type))
  1101. }
  1102. if m.InitiatorRelayIndex != 0 {
  1103. n += 1 + sovNebula(uint64(m.InitiatorRelayIndex))
  1104. }
  1105. if m.ResponderRelayIndex != 0 {
  1106. n += 1 + sovNebula(uint64(m.ResponderRelayIndex))
  1107. }
  1108. if m.RelayToIp != 0 {
  1109. n += 1 + sovNebula(uint64(m.RelayToIp))
  1110. }
  1111. if m.RelayFromIp != 0 {
  1112. n += 1 + sovNebula(uint64(m.RelayFromIp))
  1113. }
  1114. return n
  1115. }
  1116. func sovNebula(x uint64) (n int) {
  1117. return (math_bits.Len64(x|1) + 6) / 7
  1118. }
  1119. func sozNebula(x uint64) (n int) {
  1120. return sovNebula(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  1121. }
  1122. func (m *NebulaMeta) Unmarshal(dAtA []byte) error {
  1123. l := len(dAtA)
  1124. iNdEx := 0
  1125. for iNdEx < l {
  1126. preIndex := iNdEx
  1127. var wire uint64
  1128. for shift := uint(0); ; shift += 7 {
  1129. if shift >= 64 {
  1130. return ErrIntOverflowNebula
  1131. }
  1132. if iNdEx >= l {
  1133. return io.ErrUnexpectedEOF
  1134. }
  1135. b := dAtA[iNdEx]
  1136. iNdEx++
  1137. wire |= uint64(b&0x7F) << shift
  1138. if b < 0x80 {
  1139. break
  1140. }
  1141. }
  1142. fieldNum := int32(wire >> 3)
  1143. wireType := int(wire & 0x7)
  1144. if wireType == 4 {
  1145. return fmt.Errorf("proto: NebulaMeta: wiretype end group for non-group")
  1146. }
  1147. if fieldNum <= 0 {
  1148. return fmt.Errorf("proto: NebulaMeta: illegal tag %d (wire type %d)", fieldNum, wire)
  1149. }
  1150. switch fieldNum {
  1151. case 1:
  1152. if wireType != 0 {
  1153. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  1154. }
  1155. m.Type = 0
  1156. for shift := uint(0); ; shift += 7 {
  1157. if shift >= 64 {
  1158. return ErrIntOverflowNebula
  1159. }
  1160. if iNdEx >= l {
  1161. return io.ErrUnexpectedEOF
  1162. }
  1163. b := dAtA[iNdEx]
  1164. iNdEx++
  1165. m.Type |= NebulaMeta_MessageType(b&0x7F) << shift
  1166. if b < 0x80 {
  1167. break
  1168. }
  1169. }
  1170. case 2:
  1171. if wireType != 2 {
  1172. return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType)
  1173. }
  1174. var msglen int
  1175. for shift := uint(0); ; shift += 7 {
  1176. if shift >= 64 {
  1177. return ErrIntOverflowNebula
  1178. }
  1179. if iNdEx >= l {
  1180. return io.ErrUnexpectedEOF
  1181. }
  1182. b := dAtA[iNdEx]
  1183. iNdEx++
  1184. msglen |= int(b&0x7F) << shift
  1185. if b < 0x80 {
  1186. break
  1187. }
  1188. }
  1189. if msglen < 0 {
  1190. return ErrInvalidLengthNebula
  1191. }
  1192. postIndex := iNdEx + msglen
  1193. if postIndex < 0 {
  1194. return ErrInvalidLengthNebula
  1195. }
  1196. if postIndex > l {
  1197. return io.ErrUnexpectedEOF
  1198. }
  1199. if m.Details == nil {
  1200. m.Details = &NebulaMetaDetails{}
  1201. }
  1202. if err := m.Details.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1203. return err
  1204. }
  1205. iNdEx = postIndex
  1206. default:
  1207. iNdEx = preIndex
  1208. skippy, err := skipNebula(dAtA[iNdEx:])
  1209. if err != nil {
  1210. return err
  1211. }
  1212. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1213. return ErrInvalidLengthNebula
  1214. }
  1215. if (iNdEx + skippy) > l {
  1216. return io.ErrUnexpectedEOF
  1217. }
  1218. iNdEx += skippy
  1219. }
  1220. }
  1221. if iNdEx > l {
  1222. return io.ErrUnexpectedEOF
  1223. }
  1224. return nil
  1225. }
  1226. func (m *NebulaMetaDetails) Unmarshal(dAtA []byte) error {
  1227. l := len(dAtA)
  1228. iNdEx := 0
  1229. for iNdEx < l {
  1230. preIndex := iNdEx
  1231. var wire uint64
  1232. for shift := uint(0); ; shift += 7 {
  1233. if shift >= 64 {
  1234. return ErrIntOverflowNebula
  1235. }
  1236. if iNdEx >= l {
  1237. return io.ErrUnexpectedEOF
  1238. }
  1239. b := dAtA[iNdEx]
  1240. iNdEx++
  1241. wire |= uint64(b&0x7F) << shift
  1242. if b < 0x80 {
  1243. break
  1244. }
  1245. }
  1246. fieldNum := int32(wire >> 3)
  1247. wireType := int(wire & 0x7)
  1248. if wireType == 4 {
  1249. return fmt.Errorf("proto: NebulaMetaDetails: wiretype end group for non-group")
  1250. }
  1251. if fieldNum <= 0 {
  1252. return fmt.Errorf("proto: NebulaMetaDetails: illegal tag %d (wire type %d)", fieldNum, wire)
  1253. }
  1254. switch fieldNum {
  1255. case 1:
  1256. if wireType != 0 {
  1257. return fmt.Errorf("proto: wrong wireType = %d for field VpnIp", wireType)
  1258. }
  1259. m.VpnIp = 0
  1260. for shift := uint(0); ; shift += 7 {
  1261. if shift >= 64 {
  1262. return ErrIntOverflowNebula
  1263. }
  1264. if iNdEx >= l {
  1265. return io.ErrUnexpectedEOF
  1266. }
  1267. b := dAtA[iNdEx]
  1268. iNdEx++
  1269. m.VpnIp |= uint32(b&0x7F) << shift
  1270. if b < 0x80 {
  1271. break
  1272. }
  1273. }
  1274. case 2:
  1275. if wireType != 2 {
  1276. return fmt.Errorf("proto: wrong wireType = %d for field Ip4AndPorts", wireType)
  1277. }
  1278. var msglen int
  1279. for shift := uint(0); ; shift += 7 {
  1280. if shift >= 64 {
  1281. return ErrIntOverflowNebula
  1282. }
  1283. if iNdEx >= l {
  1284. return io.ErrUnexpectedEOF
  1285. }
  1286. b := dAtA[iNdEx]
  1287. iNdEx++
  1288. msglen |= int(b&0x7F) << shift
  1289. if b < 0x80 {
  1290. break
  1291. }
  1292. }
  1293. if msglen < 0 {
  1294. return ErrInvalidLengthNebula
  1295. }
  1296. postIndex := iNdEx + msglen
  1297. if postIndex < 0 {
  1298. return ErrInvalidLengthNebula
  1299. }
  1300. if postIndex > l {
  1301. return io.ErrUnexpectedEOF
  1302. }
  1303. m.Ip4AndPorts = append(m.Ip4AndPorts, &Ip4AndPort{})
  1304. if err := m.Ip4AndPorts[len(m.Ip4AndPorts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1305. return err
  1306. }
  1307. iNdEx = postIndex
  1308. case 3:
  1309. if wireType != 0 {
  1310. return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType)
  1311. }
  1312. m.Counter = 0
  1313. for shift := uint(0); ; shift += 7 {
  1314. if shift >= 64 {
  1315. return ErrIntOverflowNebula
  1316. }
  1317. if iNdEx >= l {
  1318. return io.ErrUnexpectedEOF
  1319. }
  1320. b := dAtA[iNdEx]
  1321. iNdEx++
  1322. m.Counter |= uint32(b&0x7F) << shift
  1323. if b < 0x80 {
  1324. break
  1325. }
  1326. }
  1327. case 4:
  1328. if wireType != 2 {
  1329. return fmt.Errorf("proto: wrong wireType = %d for field Ip6AndPorts", wireType)
  1330. }
  1331. var msglen int
  1332. for shift := uint(0); ; shift += 7 {
  1333. if shift >= 64 {
  1334. return ErrIntOverflowNebula
  1335. }
  1336. if iNdEx >= l {
  1337. return io.ErrUnexpectedEOF
  1338. }
  1339. b := dAtA[iNdEx]
  1340. iNdEx++
  1341. msglen |= int(b&0x7F) << shift
  1342. if b < 0x80 {
  1343. break
  1344. }
  1345. }
  1346. if msglen < 0 {
  1347. return ErrInvalidLengthNebula
  1348. }
  1349. postIndex := iNdEx + msglen
  1350. if postIndex < 0 {
  1351. return ErrInvalidLengthNebula
  1352. }
  1353. if postIndex > l {
  1354. return io.ErrUnexpectedEOF
  1355. }
  1356. m.Ip6AndPorts = append(m.Ip6AndPorts, &Ip6AndPort{})
  1357. if err := m.Ip6AndPorts[len(m.Ip6AndPorts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1358. return err
  1359. }
  1360. iNdEx = postIndex
  1361. case 5:
  1362. if wireType == 0 {
  1363. var v uint32
  1364. for shift := uint(0); ; shift += 7 {
  1365. if shift >= 64 {
  1366. return ErrIntOverflowNebula
  1367. }
  1368. if iNdEx >= l {
  1369. return io.ErrUnexpectedEOF
  1370. }
  1371. b := dAtA[iNdEx]
  1372. iNdEx++
  1373. v |= uint32(b&0x7F) << shift
  1374. if b < 0x80 {
  1375. break
  1376. }
  1377. }
  1378. m.RelayVpnIp = append(m.RelayVpnIp, v)
  1379. } else if wireType == 2 {
  1380. var packedLen int
  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. packedLen |= int(b&0x7F) << shift
  1391. if b < 0x80 {
  1392. break
  1393. }
  1394. }
  1395. if packedLen < 0 {
  1396. return ErrInvalidLengthNebula
  1397. }
  1398. postIndex := iNdEx + packedLen
  1399. if postIndex < 0 {
  1400. return ErrInvalidLengthNebula
  1401. }
  1402. if postIndex > l {
  1403. return io.ErrUnexpectedEOF
  1404. }
  1405. var elementCount int
  1406. var count int
  1407. for _, integer := range dAtA[iNdEx:postIndex] {
  1408. if integer < 128 {
  1409. count++
  1410. }
  1411. }
  1412. elementCount = count
  1413. if elementCount != 0 && len(m.RelayVpnIp) == 0 {
  1414. m.RelayVpnIp = make([]uint32, 0, elementCount)
  1415. }
  1416. for iNdEx < postIndex {
  1417. var v uint32
  1418. for shift := uint(0); ; shift += 7 {
  1419. if shift >= 64 {
  1420. return ErrIntOverflowNebula
  1421. }
  1422. if iNdEx >= l {
  1423. return io.ErrUnexpectedEOF
  1424. }
  1425. b := dAtA[iNdEx]
  1426. iNdEx++
  1427. v |= uint32(b&0x7F) << shift
  1428. if b < 0x80 {
  1429. break
  1430. }
  1431. }
  1432. m.RelayVpnIp = append(m.RelayVpnIp, v)
  1433. }
  1434. } else {
  1435. return fmt.Errorf("proto: wrong wireType = %d for field RelayVpnIp", wireType)
  1436. }
  1437. default:
  1438. iNdEx = preIndex
  1439. skippy, err := skipNebula(dAtA[iNdEx:])
  1440. if err != nil {
  1441. return err
  1442. }
  1443. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1444. return ErrInvalidLengthNebula
  1445. }
  1446. if (iNdEx + skippy) > l {
  1447. return io.ErrUnexpectedEOF
  1448. }
  1449. iNdEx += skippy
  1450. }
  1451. }
  1452. if iNdEx > l {
  1453. return io.ErrUnexpectedEOF
  1454. }
  1455. return nil
  1456. }
  1457. func (m *Ip4AndPort) Unmarshal(dAtA []byte) error {
  1458. l := len(dAtA)
  1459. iNdEx := 0
  1460. for iNdEx < l {
  1461. preIndex := iNdEx
  1462. var wire uint64
  1463. for shift := uint(0); ; shift += 7 {
  1464. if shift >= 64 {
  1465. return ErrIntOverflowNebula
  1466. }
  1467. if iNdEx >= l {
  1468. return io.ErrUnexpectedEOF
  1469. }
  1470. b := dAtA[iNdEx]
  1471. iNdEx++
  1472. wire |= uint64(b&0x7F) << shift
  1473. if b < 0x80 {
  1474. break
  1475. }
  1476. }
  1477. fieldNum := int32(wire >> 3)
  1478. wireType := int(wire & 0x7)
  1479. if wireType == 4 {
  1480. return fmt.Errorf("proto: Ip4AndPort: wiretype end group for non-group")
  1481. }
  1482. if fieldNum <= 0 {
  1483. return fmt.Errorf("proto: Ip4AndPort: illegal tag %d (wire type %d)", fieldNum, wire)
  1484. }
  1485. switch fieldNum {
  1486. case 1:
  1487. if wireType != 0 {
  1488. return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType)
  1489. }
  1490. m.Ip = 0
  1491. for shift := uint(0); ; shift += 7 {
  1492. if shift >= 64 {
  1493. return ErrIntOverflowNebula
  1494. }
  1495. if iNdEx >= l {
  1496. return io.ErrUnexpectedEOF
  1497. }
  1498. b := dAtA[iNdEx]
  1499. iNdEx++
  1500. m.Ip |= uint32(b&0x7F) << shift
  1501. if b < 0x80 {
  1502. break
  1503. }
  1504. }
  1505. case 2:
  1506. if wireType != 0 {
  1507. return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType)
  1508. }
  1509. m.Port = 0
  1510. for shift := uint(0); ; shift += 7 {
  1511. if shift >= 64 {
  1512. return ErrIntOverflowNebula
  1513. }
  1514. if iNdEx >= l {
  1515. return io.ErrUnexpectedEOF
  1516. }
  1517. b := dAtA[iNdEx]
  1518. iNdEx++
  1519. m.Port |= uint32(b&0x7F) << shift
  1520. if b < 0x80 {
  1521. break
  1522. }
  1523. }
  1524. default:
  1525. iNdEx = preIndex
  1526. skippy, err := skipNebula(dAtA[iNdEx:])
  1527. if err != nil {
  1528. return err
  1529. }
  1530. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1531. return ErrInvalidLengthNebula
  1532. }
  1533. if (iNdEx + skippy) > l {
  1534. return io.ErrUnexpectedEOF
  1535. }
  1536. iNdEx += skippy
  1537. }
  1538. }
  1539. if iNdEx > l {
  1540. return io.ErrUnexpectedEOF
  1541. }
  1542. return nil
  1543. }
  1544. func (m *Ip6AndPort) Unmarshal(dAtA []byte) error {
  1545. l := len(dAtA)
  1546. iNdEx := 0
  1547. for iNdEx < l {
  1548. preIndex := iNdEx
  1549. var wire uint64
  1550. for shift := uint(0); ; shift += 7 {
  1551. if shift >= 64 {
  1552. return ErrIntOverflowNebula
  1553. }
  1554. if iNdEx >= l {
  1555. return io.ErrUnexpectedEOF
  1556. }
  1557. b := dAtA[iNdEx]
  1558. iNdEx++
  1559. wire |= uint64(b&0x7F) << shift
  1560. if b < 0x80 {
  1561. break
  1562. }
  1563. }
  1564. fieldNum := int32(wire >> 3)
  1565. wireType := int(wire & 0x7)
  1566. if wireType == 4 {
  1567. return fmt.Errorf("proto: Ip6AndPort: wiretype end group for non-group")
  1568. }
  1569. if fieldNum <= 0 {
  1570. return fmt.Errorf("proto: Ip6AndPort: illegal tag %d (wire type %d)", fieldNum, wire)
  1571. }
  1572. switch fieldNum {
  1573. case 1:
  1574. if wireType != 0 {
  1575. return fmt.Errorf("proto: wrong wireType = %d for field Hi", wireType)
  1576. }
  1577. m.Hi = 0
  1578. for shift := uint(0); ; shift += 7 {
  1579. if shift >= 64 {
  1580. return ErrIntOverflowNebula
  1581. }
  1582. if iNdEx >= l {
  1583. return io.ErrUnexpectedEOF
  1584. }
  1585. b := dAtA[iNdEx]
  1586. iNdEx++
  1587. m.Hi |= uint64(b&0x7F) << shift
  1588. if b < 0x80 {
  1589. break
  1590. }
  1591. }
  1592. case 2:
  1593. if wireType != 0 {
  1594. return fmt.Errorf("proto: wrong wireType = %d for field Lo", wireType)
  1595. }
  1596. m.Lo = 0
  1597. for shift := uint(0); ; shift += 7 {
  1598. if shift >= 64 {
  1599. return ErrIntOverflowNebula
  1600. }
  1601. if iNdEx >= l {
  1602. return io.ErrUnexpectedEOF
  1603. }
  1604. b := dAtA[iNdEx]
  1605. iNdEx++
  1606. m.Lo |= uint64(b&0x7F) << shift
  1607. if b < 0x80 {
  1608. break
  1609. }
  1610. }
  1611. case 3:
  1612. if wireType != 0 {
  1613. return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType)
  1614. }
  1615. m.Port = 0
  1616. for shift := uint(0); ; shift += 7 {
  1617. if shift >= 64 {
  1618. return ErrIntOverflowNebula
  1619. }
  1620. if iNdEx >= l {
  1621. return io.ErrUnexpectedEOF
  1622. }
  1623. b := dAtA[iNdEx]
  1624. iNdEx++
  1625. m.Port |= uint32(b&0x7F) << shift
  1626. if b < 0x80 {
  1627. break
  1628. }
  1629. }
  1630. default:
  1631. iNdEx = preIndex
  1632. skippy, err := skipNebula(dAtA[iNdEx:])
  1633. if err != nil {
  1634. return err
  1635. }
  1636. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1637. return ErrInvalidLengthNebula
  1638. }
  1639. if (iNdEx + skippy) > l {
  1640. return io.ErrUnexpectedEOF
  1641. }
  1642. iNdEx += skippy
  1643. }
  1644. }
  1645. if iNdEx > l {
  1646. return io.ErrUnexpectedEOF
  1647. }
  1648. return nil
  1649. }
  1650. func (m *NebulaPing) Unmarshal(dAtA []byte) error {
  1651. l := len(dAtA)
  1652. iNdEx := 0
  1653. for iNdEx < l {
  1654. preIndex := iNdEx
  1655. var wire uint64
  1656. for shift := uint(0); ; shift += 7 {
  1657. if shift >= 64 {
  1658. return ErrIntOverflowNebula
  1659. }
  1660. if iNdEx >= l {
  1661. return io.ErrUnexpectedEOF
  1662. }
  1663. b := dAtA[iNdEx]
  1664. iNdEx++
  1665. wire |= uint64(b&0x7F) << shift
  1666. if b < 0x80 {
  1667. break
  1668. }
  1669. }
  1670. fieldNum := int32(wire >> 3)
  1671. wireType := int(wire & 0x7)
  1672. if wireType == 4 {
  1673. return fmt.Errorf("proto: NebulaPing: wiretype end group for non-group")
  1674. }
  1675. if fieldNum <= 0 {
  1676. return fmt.Errorf("proto: NebulaPing: illegal tag %d (wire type %d)", fieldNum, wire)
  1677. }
  1678. switch fieldNum {
  1679. case 1:
  1680. if wireType != 0 {
  1681. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  1682. }
  1683. m.Type = 0
  1684. for shift := uint(0); ; shift += 7 {
  1685. if shift >= 64 {
  1686. return ErrIntOverflowNebula
  1687. }
  1688. if iNdEx >= l {
  1689. return io.ErrUnexpectedEOF
  1690. }
  1691. b := dAtA[iNdEx]
  1692. iNdEx++
  1693. m.Type |= NebulaPing_MessageType(b&0x7F) << shift
  1694. if b < 0x80 {
  1695. break
  1696. }
  1697. }
  1698. case 2:
  1699. if wireType != 0 {
  1700. return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
  1701. }
  1702. m.Time = 0
  1703. for shift := uint(0); ; shift += 7 {
  1704. if shift >= 64 {
  1705. return ErrIntOverflowNebula
  1706. }
  1707. if iNdEx >= l {
  1708. return io.ErrUnexpectedEOF
  1709. }
  1710. b := dAtA[iNdEx]
  1711. iNdEx++
  1712. m.Time |= uint64(b&0x7F) << shift
  1713. if b < 0x80 {
  1714. break
  1715. }
  1716. }
  1717. default:
  1718. iNdEx = preIndex
  1719. skippy, err := skipNebula(dAtA[iNdEx:])
  1720. if err != nil {
  1721. return err
  1722. }
  1723. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1724. return ErrInvalidLengthNebula
  1725. }
  1726. if (iNdEx + skippy) > l {
  1727. return io.ErrUnexpectedEOF
  1728. }
  1729. iNdEx += skippy
  1730. }
  1731. }
  1732. if iNdEx > l {
  1733. return io.ErrUnexpectedEOF
  1734. }
  1735. return nil
  1736. }
  1737. func (m *NebulaHandshake) Unmarshal(dAtA []byte) error {
  1738. l := len(dAtA)
  1739. iNdEx := 0
  1740. for iNdEx < l {
  1741. preIndex := iNdEx
  1742. var wire uint64
  1743. for shift := uint(0); ; shift += 7 {
  1744. if shift >= 64 {
  1745. return ErrIntOverflowNebula
  1746. }
  1747. if iNdEx >= l {
  1748. return io.ErrUnexpectedEOF
  1749. }
  1750. b := dAtA[iNdEx]
  1751. iNdEx++
  1752. wire |= uint64(b&0x7F) << shift
  1753. if b < 0x80 {
  1754. break
  1755. }
  1756. }
  1757. fieldNum := int32(wire >> 3)
  1758. wireType := int(wire & 0x7)
  1759. if wireType == 4 {
  1760. return fmt.Errorf("proto: NebulaHandshake: wiretype end group for non-group")
  1761. }
  1762. if fieldNum <= 0 {
  1763. return fmt.Errorf("proto: NebulaHandshake: illegal tag %d (wire type %d)", fieldNum, wire)
  1764. }
  1765. switch fieldNum {
  1766. case 1:
  1767. if wireType != 2 {
  1768. return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType)
  1769. }
  1770. var msglen int
  1771. for shift := uint(0); ; shift += 7 {
  1772. if shift >= 64 {
  1773. return ErrIntOverflowNebula
  1774. }
  1775. if iNdEx >= l {
  1776. return io.ErrUnexpectedEOF
  1777. }
  1778. b := dAtA[iNdEx]
  1779. iNdEx++
  1780. msglen |= int(b&0x7F) << shift
  1781. if b < 0x80 {
  1782. break
  1783. }
  1784. }
  1785. if msglen < 0 {
  1786. return ErrInvalidLengthNebula
  1787. }
  1788. postIndex := iNdEx + msglen
  1789. if postIndex < 0 {
  1790. return ErrInvalidLengthNebula
  1791. }
  1792. if postIndex > l {
  1793. return io.ErrUnexpectedEOF
  1794. }
  1795. if m.Details == nil {
  1796. m.Details = &NebulaHandshakeDetails{}
  1797. }
  1798. if err := m.Details.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1799. return err
  1800. }
  1801. iNdEx = postIndex
  1802. case 2:
  1803. if wireType != 2 {
  1804. return fmt.Errorf("proto: wrong wireType = %d for field Hmac", wireType)
  1805. }
  1806. var byteLen int
  1807. for shift := uint(0); ; shift += 7 {
  1808. if shift >= 64 {
  1809. return ErrIntOverflowNebula
  1810. }
  1811. if iNdEx >= l {
  1812. return io.ErrUnexpectedEOF
  1813. }
  1814. b := dAtA[iNdEx]
  1815. iNdEx++
  1816. byteLen |= int(b&0x7F) << shift
  1817. if b < 0x80 {
  1818. break
  1819. }
  1820. }
  1821. if byteLen < 0 {
  1822. return ErrInvalidLengthNebula
  1823. }
  1824. postIndex := iNdEx + byteLen
  1825. if postIndex < 0 {
  1826. return ErrInvalidLengthNebula
  1827. }
  1828. if postIndex > l {
  1829. return io.ErrUnexpectedEOF
  1830. }
  1831. m.Hmac = append(m.Hmac[:0], dAtA[iNdEx:postIndex]...)
  1832. if m.Hmac == nil {
  1833. m.Hmac = []byte{}
  1834. }
  1835. iNdEx = postIndex
  1836. default:
  1837. iNdEx = preIndex
  1838. skippy, err := skipNebula(dAtA[iNdEx:])
  1839. if err != nil {
  1840. return err
  1841. }
  1842. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1843. return ErrInvalidLengthNebula
  1844. }
  1845. if (iNdEx + skippy) > l {
  1846. return io.ErrUnexpectedEOF
  1847. }
  1848. iNdEx += skippy
  1849. }
  1850. }
  1851. if iNdEx > l {
  1852. return io.ErrUnexpectedEOF
  1853. }
  1854. return nil
  1855. }
  1856. func (m *NebulaHandshakeDetails) Unmarshal(dAtA []byte) error {
  1857. l := len(dAtA)
  1858. iNdEx := 0
  1859. for iNdEx < l {
  1860. preIndex := iNdEx
  1861. var wire uint64
  1862. for shift := uint(0); ; shift += 7 {
  1863. if shift >= 64 {
  1864. return ErrIntOverflowNebula
  1865. }
  1866. if iNdEx >= l {
  1867. return io.ErrUnexpectedEOF
  1868. }
  1869. b := dAtA[iNdEx]
  1870. iNdEx++
  1871. wire |= uint64(b&0x7F) << shift
  1872. if b < 0x80 {
  1873. break
  1874. }
  1875. }
  1876. fieldNum := int32(wire >> 3)
  1877. wireType := int(wire & 0x7)
  1878. if wireType == 4 {
  1879. return fmt.Errorf("proto: NebulaHandshakeDetails: wiretype end group for non-group")
  1880. }
  1881. if fieldNum <= 0 {
  1882. return fmt.Errorf("proto: NebulaHandshakeDetails: illegal tag %d (wire type %d)", fieldNum, wire)
  1883. }
  1884. switch fieldNum {
  1885. case 1:
  1886. if wireType != 2 {
  1887. return fmt.Errorf("proto: wrong wireType = %d for field Cert", wireType)
  1888. }
  1889. var byteLen int
  1890. for shift := uint(0); ; shift += 7 {
  1891. if shift >= 64 {
  1892. return ErrIntOverflowNebula
  1893. }
  1894. if iNdEx >= l {
  1895. return io.ErrUnexpectedEOF
  1896. }
  1897. b := dAtA[iNdEx]
  1898. iNdEx++
  1899. byteLen |= int(b&0x7F) << shift
  1900. if b < 0x80 {
  1901. break
  1902. }
  1903. }
  1904. if byteLen < 0 {
  1905. return ErrInvalidLengthNebula
  1906. }
  1907. postIndex := iNdEx + byteLen
  1908. if postIndex < 0 {
  1909. return ErrInvalidLengthNebula
  1910. }
  1911. if postIndex > l {
  1912. return io.ErrUnexpectedEOF
  1913. }
  1914. m.Cert = append(m.Cert[:0], dAtA[iNdEx:postIndex]...)
  1915. if m.Cert == nil {
  1916. m.Cert = []byte{}
  1917. }
  1918. iNdEx = postIndex
  1919. case 2:
  1920. if wireType != 0 {
  1921. return fmt.Errorf("proto: wrong wireType = %d for field InitiatorIndex", wireType)
  1922. }
  1923. m.InitiatorIndex = 0
  1924. for shift := uint(0); ; shift += 7 {
  1925. if shift >= 64 {
  1926. return ErrIntOverflowNebula
  1927. }
  1928. if iNdEx >= l {
  1929. return io.ErrUnexpectedEOF
  1930. }
  1931. b := dAtA[iNdEx]
  1932. iNdEx++
  1933. m.InitiatorIndex |= uint32(b&0x7F) << shift
  1934. if b < 0x80 {
  1935. break
  1936. }
  1937. }
  1938. case 3:
  1939. if wireType != 0 {
  1940. return fmt.Errorf("proto: wrong wireType = %d for field ResponderIndex", wireType)
  1941. }
  1942. m.ResponderIndex = 0
  1943. for shift := uint(0); ; shift += 7 {
  1944. if shift >= 64 {
  1945. return ErrIntOverflowNebula
  1946. }
  1947. if iNdEx >= l {
  1948. return io.ErrUnexpectedEOF
  1949. }
  1950. b := dAtA[iNdEx]
  1951. iNdEx++
  1952. m.ResponderIndex |= uint32(b&0x7F) << shift
  1953. if b < 0x80 {
  1954. break
  1955. }
  1956. }
  1957. case 4:
  1958. if wireType != 0 {
  1959. return fmt.Errorf("proto: wrong wireType = %d for field Cookie", wireType)
  1960. }
  1961. m.Cookie = 0
  1962. for shift := uint(0); ; shift += 7 {
  1963. if shift >= 64 {
  1964. return ErrIntOverflowNebula
  1965. }
  1966. if iNdEx >= l {
  1967. return io.ErrUnexpectedEOF
  1968. }
  1969. b := dAtA[iNdEx]
  1970. iNdEx++
  1971. m.Cookie |= uint64(b&0x7F) << shift
  1972. if b < 0x80 {
  1973. break
  1974. }
  1975. }
  1976. case 5:
  1977. if wireType != 0 {
  1978. return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
  1979. }
  1980. m.Time = 0
  1981. for shift := uint(0); ; shift += 7 {
  1982. if shift >= 64 {
  1983. return ErrIntOverflowNebula
  1984. }
  1985. if iNdEx >= l {
  1986. return io.ErrUnexpectedEOF
  1987. }
  1988. b := dAtA[iNdEx]
  1989. iNdEx++
  1990. m.Time |= uint64(b&0x7F) << shift
  1991. if b < 0x80 {
  1992. break
  1993. }
  1994. }
  1995. default:
  1996. iNdEx = preIndex
  1997. skippy, err := skipNebula(dAtA[iNdEx:])
  1998. if err != nil {
  1999. return err
  2000. }
  2001. if (skippy < 0) || (iNdEx+skippy) < 0 {
  2002. return ErrInvalidLengthNebula
  2003. }
  2004. if (iNdEx + skippy) > l {
  2005. return io.ErrUnexpectedEOF
  2006. }
  2007. iNdEx += skippy
  2008. }
  2009. }
  2010. if iNdEx > l {
  2011. return io.ErrUnexpectedEOF
  2012. }
  2013. return nil
  2014. }
  2015. func (m *NebulaControl) Unmarshal(dAtA []byte) error {
  2016. l := len(dAtA)
  2017. iNdEx := 0
  2018. for iNdEx < l {
  2019. preIndex := iNdEx
  2020. var wire uint64
  2021. for shift := uint(0); ; shift += 7 {
  2022. if shift >= 64 {
  2023. return ErrIntOverflowNebula
  2024. }
  2025. if iNdEx >= l {
  2026. return io.ErrUnexpectedEOF
  2027. }
  2028. b := dAtA[iNdEx]
  2029. iNdEx++
  2030. wire |= uint64(b&0x7F) << shift
  2031. if b < 0x80 {
  2032. break
  2033. }
  2034. }
  2035. fieldNum := int32(wire >> 3)
  2036. wireType := int(wire & 0x7)
  2037. if wireType == 4 {
  2038. return fmt.Errorf("proto: NebulaControl: wiretype end group for non-group")
  2039. }
  2040. if fieldNum <= 0 {
  2041. return fmt.Errorf("proto: NebulaControl: illegal tag %d (wire type %d)", fieldNum, wire)
  2042. }
  2043. switch fieldNum {
  2044. case 1:
  2045. if wireType != 0 {
  2046. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  2047. }
  2048. m.Type = 0
  2049. for shift := uint(0); ; shift += 7 {
  2050. if shift >= 64 {
  2051. return ErrIntOverflowNebula
  2052. }
  2053. if iNdEx >= l {
  2054. return io.ErrUnexpectedEOF
  2055. }
  2056. b := dAtA[iNdEx]
  2057. iNdEx++
  2058. m.Type |= NebulaControl_MessageType(b&0x7F) << shift
  2059. if b < 0x80 {
  2060. break
  2061. }
  2062. }
  2063. case 2:
  2064. if wireType != 0 {
  2065. return fmt.Errorf("proto: wrong wireType = %d for field InitiatorRelayIndex", wireType)
  2066. }
  2067. m.InitiatorRelayIndex = 0
  2068. for shift := uint(0); ; shift += 7 {
  2069. if shift >= 64 {
  2070. return ErrIntOverflowNebula
  2071. }
  2072. if iNdEx >= l {
  2073. return io.ErrUnexpectedEOF
  2074. }
  2075. b := dAtA[iNdEx]
  2076. iNdEx++
  2077. m.InitiatorRelayIndex |= uint32(b&0x7F) << shift
  2078. if b < 0x80 {
  2079. break
  2080. }
  2081. }
  2082. case 3:
  2083. if wireType != 0 {
  2084. return fmt.Errorf("proto: wrong wireType = %d for field ResponderRelayIndex", wireType)
  2085. }
  2086. m.ResponderRelayIndex = 0
  2087. for shift := uint(0); ; shift += 7 {
  2088. if shift >= 64 {
  2089. return ErrIntOverflowNebula
  2090. }
  2091. if iNdEx >= l {
  2092. return io.ErrUnexpectedEOF
  2093. }
  2094. b := dAtA[iNdEx]
  2095. iNdEx++
  2096. m.ResponderRelayIndex |= uint32(b&0x7F) << shift
  2097. if b < 0x80 {
  2098. break
  2099. }
  2100. }
  2101. case 4:
  2102. if wireType != 0 {
  2103. return fmt.Errorf("proto: wrong wireType = %d for field RelayToIp", wireType)
  2104. }
  2105. m.RelayToIp = 0
  2106. for shift := uint(0); ; shift += 7 {
  2107. if shift >= 64 {
  2108. return ErrIntOverflowNebula
  2109. }
  2110. if iNdEx >= l {
  2111. return io.ErrUnexpectedEOF
  2112. }
  2113. b := dAtA[iNdEx]
  2114. iNdEx++
  2115. m.RelayToIp |= uint32(b&0x7F) << shift
  2116. if b < 0x80 {
  2117. break
  2118. }
  2119. }
  2120. case 5:
  2121. if wireType != 0 {
  2122. return fmt.Errorf("proto: wrong wireType = %d for field RelayFromIp", wireType)
  2123. }
  2124. m.RelayFromIp = 0
  2125. for shift := uint(0); ; shift += 7 {
  2126. if shift >= 64 {
  2127. return ErrIntOverflowNebula
  2128. }
  2129. if iNdEx >= l {
  2130. return io.ErrUnexpectedEOF
  2131. }
  2132. b := dAtA[iNdEx]
  2133. iNdEx++
  2134. m.RelayFromIp |= uint32(b&0x7F) << shift
  2135. if b < 0x80 {
  2136. break
  2137. }
  2138. }
  2139. default:
  2140. iNdEx = preIndex
  2141. skippy, err := skipNebula(dAtA[iNdEx:])
  2142. if err != nil {
  2143. return err
  2144. }
  2145. if (skippy < 0) || (iNdEx+skippy) < 0 {
  2146. return ErrInvalidLengthNebula
  2147. }
  2148. if (iNdEx + skippy) > l {
  2149. return io.ErrUnexpectedEOF
  2150. }
  2151. iNdEx += skippy
  2152. }
  2153. }
  2154. if iNdEx > l {
  2155. return io.ErrUnexpectedEOF
  2156. }
  2157. return nil
  2158. }
  2159. func skipNebula(dAtA []byte) (n int, err error) {
  2160. l := len(dAtA)
  2161. iNdEx := 0
  2162. depth := 0
  2163. for iNdEx < l {
  2164. var wire uint64
  2165. for shift := uint(0); ; shift += 7 {
  2166. if shift >= 64 {
  2167. return 0, ErrIntOverflowNebula
  2168. }
  2169. if iNdEx >= l {
  2170. return 0, io.ErrUnexpectedEOF
  2171. }
  2172. b := dAtA[iNdEx]
  2173. iNdEx++
  2174. wire |= (uint64(b) & 0x7F) << shift
  2175. if b < 0x80 {
  2176. break
  2177. }
  2178. }
  2179. wireType := int(wire & 0x7)
  2180. switch wireType {
  2181. case 0:
  2182. for shift := uint(0); ; shift += 7 {
  2183. if shift >= 64 {
  2184. return 0, ErrIntOverflowNebula
  2185. }
  2186. if iNdEx >= l {
  2187. return 0, io.ErrUnexpectedEOF
  2188. }
  2189. iNdEx++
  2190. if dAtA[iNdEx-1] < 0x80 {
  2191. break
  2192. }
  2193. }
  2194. case 1:
  2195. iNdEx += 8
  2196. case 2:
  2197. var length int
  2198. for shift := uint(0); ; shift += 7 {
  2199. if shift >= 64 {
  2200. return 0, ErrIntOverflowNebula
  2201. }
  2202. if iNdEx >= l {
  2203. return 0, io.ErrUnexpectedEOF
  2204. }
  2205. b := dAtA[iNdEx]
  2206. iNdEx++
  2207. length |= (int(b) & 0x7F) << shift
  2208. if b < 0x80 {
  2209. break
  2210. }
  2211. }
  2212. if length < 0 {
  2213. return 0, ErrInvalidLengthNebula
  2214. }
  2215. iNdEx += length
  2216. case 3:
  2217. depth++
  2218. case 4:
  2219. if depth == 0 {
  2220. return 0, ErrUnexpectedEndOfGroupNebula
  2221. }
  2222. depth--
  2223. case 5:
  2224. iNdEx += 4
  2225. default:
  2226. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  2227. }
  2228. if iNdEx < 0 {
  2229. return 0, ErrInvalidLengthNebula
  2230. }
  2231. if depth == 0 {
  2232. return iNdEx, nil
  2233. }
  2234. }
  2235. return 0, io.ErrUnexpectedEOF
  2236. }
  2237. var (
  2238. ErrInvalidLengthNebula = fmt.Errorf("proto: negative length found during unmarshaling")
  2239. ErrIntOverflowNebula = fmt.Errorf("proto: integer overflow")
  2240. ErrUnexpectedEndOfGroupNebula = fmt.Errorf("proto: unexpected end of group")
  2241. )