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