1// Code generated by protoc-gen-gogo. DO NOT EDIT. 2// source: autonat.proto 3 4package autonat_pb 5 6import ( 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. 15var _ = proto.Marshal 16var _ = fmt.Errorf 17var _ = 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. 23const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 24 25type Message_MessageType int32 26 27const ( 28 Message_DIAL Message_MessageType = 0 29 Message_DIAL_RESPONSE Message_MessageType = 1 30) 31 32var Message_MessageType_name = map[int32]string{ 33 0: "DIAL", 34 1: "DIAL_RESPONSE", 35} 36 37var Message_MessageType_value = map[string]int32{ 38 "DIAL": 0, 39 "DIAL_RESPONSE": 1, 40} 41 42func (x Message_MessageType) Enum() *Message_MessageType { 43 p := new(Message_MessageType) 44 *p = x 45 return p 46} 47 48func (x Message_MessageType) String() string { 49 return proto.EnumName(Message_MessageType_name, int32(x)) 50} 51 52func (x *Message_MessageType) UnmarshalJSON(data []byte) error { 53 value, err := proto.UnmarshalJSONEnum(Message_MessageType_value, data, "Message_MessageType") 54 if err != nil { 55 return err 56 } 57 *x = Message_MessageType(value) 58 return nil 59} 60 61func (Message_MessageType) EnumDescriptor() ([]byte, []int) { 62 return fileDescriptor_a04e278ef61ac07a, []int{0, 0} 63} 64 65type Message_ResponseStatus int32 66 67const ( 68 Message_OK Message_ResponseStatus = 0 69 Message_E_DIAL_ERROR Message_ResponseStatus = 100 70 Message_E_DIAL_REFUSED Message_ResponseStatus = 101 71 Message_E_BAD_REQUEST Message_ResponseStatus = 200 72 Message_E_INTERNAL_ERROR Message_ResponseStatus = 300 73) 74 75var Message_ResponseStatus_name = map[int32]string{ 76 0: "OK", 77 100: "E_DIAL_ERROR", 78 101: "E_DIAL_REFUSED", 79 200: "E_BAD_REQUEST", 80 300: "E_INTERNAL_ERROR", 81} 82 83var Message_ResponseStatus_value = map[string]int32{ 84 "OK": 0, 85 "E_DIAL_ERROR": 100, 86 "E_DIAL_REFUSED": 101, 87 "E_BAD_REQUEST": 200, 88 "E_INTERNAL_ERROR": 300, 89} 90 91func (x Message_ResponseStatus) Enum() *Message_ResponseStatus { 92 p := new(Message_ResponseStatus) 93 *p = x 94 return p 95} 96 97func (x Message_ResponseStatus) String() string { 98 return proto.EnumName(Message_ResponseStatus_name, int32(x)) 99} 100 101func (x *Message_ResponseStatus) UnmarshalJSON(data []byte) error { 102 value, err := proto.UnmarshalJSONEnum(Message_ResponseStatus_value, data, "Message_ResponseStatus") 103 if err != nil { 104 return err 105 } 106 *x = Message_ResponseStatus(value) 107 return nil 108} 109 110func (Message_ResponseStatus) EnumDescriptor() ([]byte, []int) { 111 return fileDescriptor_a04e278ef61ac07a, []int{0, 1} 112} 113 114type Message struct { 115 Type *Message_MessageType `protobuf:"varint,1,opt,name=type,enum=autonat.pb.Message_MessageType" json:"type,omitempty"` 116 Dial *Message_Dial `protobuf:"bytes,2,opt,name=dial" json:"dial,omitempty"` 117 DialResponse *Message_DialResponse `protobuf:"bytes,3,opt,name=dialResponse" json:"dialResponse,omitempty"` 118 XXX_NoUnkeyedLiteral struct{} `json:"-"` 119 XXX_unrecognized []byte `json:"-"` 120 XXX_sizecache int32 `json:"-"` 121} 122 123func (m *Message) Reset() { *m = Message{} } 124func (m *Message) String() string { return proto.CompactTextString(m) } 125func (*Message) ProtoMessage() {} 126func (*Message) Descriptor() ([]byte, []int) { 127 return fileDescriptor_a04e278ef61ac07a, []int{0} 128} 129func (m *Message) XXX_Unmarshal(b []byte) error { 130 return m.Unmarshal(b) 131} 132func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 133 if deterministic { 134 return xxx_messageInfo_Message.Marshal(b, m, deterministic) 135 } else { 136 b = b[:cap(b)] 137 n, err := m.MarshalToSizedBuffer(b) 138 if err != nil { 139 return nil, err 140 } 141 return b[:n], nil 142 } 143} 144func (m *Message) XXX_Merge(src proto.Message) { 145 xxx_messageInfo_Message.Merge(m, src) 146} 147func (m *Message) XXX_Size() int { 148 return m.Size() 149} 150func (m *Message) XXX_DiscardUnknown() { 151 xxx_messageInfo_Message.DiscardUnknown(m) 152} 153 154var xxx_messageInfo_Message proto.InternalMessageInfo 155 156func (m *Message) GetType() Message_MessageType { 157 if m != nil && m.Type != nil { 158 return *m.Type 159 } 160 return Message_DIAL 161} 162 163func (m *Message) GetDial() *Message_Dial { 164 if m != nil { 165 return m.Dial 166 } 167 return nil 168} 169 170func (m *Message) GetDialResponse() *Message_DialResponse { 171 if m != nil { 172 return m.DialResponse 173 } 174 return nil 175} 176 177type Message_PeerInfo struct { 178 Id []byte `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` 179 Addrs [][]byte `protobuf:"bytes,2,rep,name=addrs" json:"addrs,omitempty"` 180 XXX_NoUnkeyedLiteral struct{} `json:"-"` 181 XXX_unrecognized []byte `json:"-"` 182 XXX_sizecache int32 `json:"-"` 183} 184 185func (m *Message_PeerInfo) Reset() { *m = Message_PeerInfo{} } 186func (m *Message_PeerInfo) String() string { return proto.CompactTextString(m) } 187func (*Message_PeerInfo) ProtoMessage() {} 188func (*Message_PeerInfo) Descriptor() ([]byte, []int) { 189 return fileDescriptor_a04e278ef61ac07a, []int{0, 0} 190} 191func (m *Message_PeerInfo) XXX_Unmarshal(b []byte) error { 192 return m.Unmarshal(b) 193} 194func (m *Message_PeerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 195 if deterministic { 196 return xxx_messageInfo_Message_PeerInfo.Marshal(b, m, deterministic) 197 } else { 198 b = b[:cap(b)] 199 n, err := m.MarshalToSizedBuffer(b) 200 if err != nil { 201 return nil, err 202 } 203 return b[:n], nil 204 } 205} 206func (m *Message_PeerInfo) XXX_Merge(src proto.Message) { 207 xxx_messageInfo_Message_PeerInfo.Merge(m, src) 208} 209func (m *Message_PeerInfo) XXX_Size() int { 210 return m.Size() 211} 212func (m *Message_PeerInfo) XXX_DiscardUnknown() { 213 xxx_messageInfo_Message_PeerInfo.DiscardUnknown(m) 214} 215 216var xxx_messageInfo_Message_PeerInfo proto.InternalMessageInfo 217 218func (m *Message_PeerInfo) GetId() []byte { 219 if m != nil { 220 return m.Id 221 } 222 return nil 223} 224 225func (m *Message_PeerInfo) GetAddrs() [][]byte { 226 if m != nil { 227 return m.Addrs 228 } 229 return nil 230} 231 232type Message_Dial struct { 233 Peer *Message_PeerInfo `protobuf:"bytes,1,opt,name=peer" json:"peer,omitempty"` 234 XXX_NoUnkeyedLiteral struct{} `json:"-"` 235 XXX_unrecognized []byte `json:"-"` 236 XXX_sizecache int32 `json:"-"` 237} 238 239func (m *Message_Dial) Reset() { *m = Message_Dial{} } 240func (m *Message_Dial) String() string { return proto.CompactTextString(m) } 241func (*Message_Dial) ProtoMessage() {} 242func (*Message_Dial) Descriptor() ([]byte, []int) { 243 return fileDescriptor_a04e278ef61ac07a, []int{0, 1} 244} 245func (m *Message_Dial) XXX_Unmarshal(b []byte) error { 246 return m.Unmarshal(b) 247} 248func (m *Message_Dial) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 249 if deterministic { 250 return xxx_messageInfo_Message_Dial.Marshal(b, m, deterministic) 251 } else { 252 b = b[:cap(b)] 253 n, err := m.MarshalToSizedBuffer(b) 254 if err != nil { 255 return nil, err 256 } 257 return b[:n], nil 258 } 259} 260func (m *Message_Dial) XXX_Merge(src proto.Message) { 261 xxx_messageInfo_Message_Dial.Merge(m, src) 262} 263func (m *Message_Dial) XXX_Size() int { 264 return m.Size() 265} 266func (m *Message_Dial) XXX_DiscardUnknown() { 267 xxx_messageInfo_Message_Dial.DiscardUnknown(m) 268} 269 270var xxx_messageInfo_Message_Dial proto.InternalMessageInfo 271 272func (m *Message_Dial) GetPeer() *Message_PeerInfo { 273 if m != nil { 274 return m.Peer 275 } 276 return nil 277} 278 279type Message_DialResponse struct { 280 Status *Message_ResponseStatus `protobuf:"varint,1,opt,name=status,enum=autonat.pb.Message_ResponseStatus" json:"status,omitempty"` 281 StatusText *string `protobuf:"bytes,2,opt,name=statusText" json:"statusText,omitempty"` 282 Addr []byte `protobuf:"bytes,3,opt,name=addr" json:"addr,omitempty"` 283 XXX_NoUnkeyedLiteral struct{} `json:"-"` 284 XXX_unrecognized []byte `json:"-"` 285 XXX_sizecache int32 `json:"-"` 286} 287 288func (m *Message_DialResponse) Reset() { *m = Message_DialResponse{} } 289func (m *Message_DialResponse) String() string { return proto.CompactTextString(m) } 290func (*Message_DialResponse) ProtoMessage() {} 291func (*Message_DialResponse) Descriptor() ([]byte, []int) { 292 return fileDescriptor_a04e278ef61ac07a, []int{0, 2} 293} 294func (m *Message_DialResponse) XXX_Unmarshal(b []byte) error { 295 return m.Unmarshal(b) 296} 297func (m *Message_DialResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 298 if deterministic { 299 return xxx_messageInfo_Message_DialResponse.Marshal(b, m, deterministic) 300 } else { 301 b = b[:cap(b)] 302 n, err := m.MarshalToSizedBuffer(b) 303 if err != nil { 304 return nil, err 305 } 306 return b[:n], nil 307 } 308} 309func (m *Message_DialResponse) XXX_Merge(src proto.Message) { 310 xxx_messageInfo_Message_DialResponse.Merge(m, src) 311} 312func (m *Message_DialResponse) XXX_Size() int { 313 return m.Size() 314} 315func (m *Message_DialResponse) XXX_DiscardUnknown() { 316 xxx_messageInfo_Message_DialResponse.DiscardUnknown(m) 317} 318 319var xxx_messageInfo_Message_DialResponse proto.InternalMessageInfo 320 321func (m *Message_DialResponse) GetStatus() Message_ResponseStatus { 322 if m != nil && m.Status != nil { 323 return *m.Status 324 } 325 return Message_OK 326} 327 328func (m *Message_DialResponse) GetStatusText() string { 329 if m != nil && m.StatusText != nil { 330 return *m.StatusText 331 } 332 return "" 333} 334 335func (m *Message_DialResponse) GetAddr() []byte { 336 if m != nil { 337 return m.Addr 338 } 339 return nil 340} 341 342func init() { 343 proto.RegisterEnum("autonat.pb.Message_MessageType", Message_MessageType_name, Message_MessageType_value) 344 proto.RegisterEnum("autonat.pb.Message_ResponseStatus", Message_ResponseStatus_name, Message_ResponseStatus_value) 345 proto.RegisterType((*Message)(nil), "autonat.pb.Message") 346 proto.RegisterType((*Message_PeerInfo)(nil), "autonat.pb.Message.PeerInfo") 347 proto.RegisterType((*Message_Dial)(nil), "autonat.pb.Message.Dial") 348 proto.RegisterType((*Message_DialResponse)(nil), "autonat.pb.Message.DialResponse") 349} 350 351func init() { proto.RegisterFile("autonat.proto", fileDescriptor_a04e278ef61ac07a) } 352 353var fileDescriptor_a04e278ef61ac07a = []byte{ 354 // 372 bytes of a gzipped FileDescriptorProto 355 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xcf, 0x8a, 0xda, 0x50, 356 0x14, 0xc6, 0xbd, 0x31, 0xb5, 0xf6, 0x18, 0xc3, 0xed, 0xa1, 0x85, 0x20, 0x25, 0x0d, 0x59, 0x49, 357 0x29, 0x22, 0x76, 0x53, 0xba, 0x53, 0x72, 0x0b, 0xd2, 0x56, 0xed, 0x49, 0x5c, 0x87, 0x94, 0xdc, 358 0x0e, 0x01, 0x31, 0x21, 0x89, 0x30, 0x6e, 0xe6, 0x89, 0x66, 0x3b, 0xef, 0xe0, 0x72, 0x1e, 0x61, 359 0xf0, 0x49, 0x86, 0x5c, 0xa3, 0xa3, 0xe0, 0xac, 0xce, 0x1f, 0x7e, 0xdf, 0x39, 0x1f, 0x1f, 0x74, 360 0xa3, 0x4d, 0x99, 0xae, 0xa3, 0x72, 0x90, 0xe5, 0x69, 0x99, 0x22, 0x9c, 0xc6, 0x7f, 0xee, 0x83, 361 0x0e, 0x6f, 0xff, 0xc8, 0xa2, 0x88, 0x6e, 0x24, 0x7e, 0x03, 0xbd, 0xdc, 0x66, 0xd2, 0x62, 0x0e, 362 0xeb, 0x9b, 0xa3, 0xcf, 0x83, 0x17, 0x6c, 0x50, 0x23, 0xc7, 0x1a, 0x6c, 0x33, 0x49, 0x0a, 0xc6, 363 0xaf, 0xa0, 0xc7, 0x49, 0xb4, 0xb2, 0x34, 0x87, 0xf5, 0x3b, 0x23, 0xeb, 0x9a, 0xc8, 0x4b, 0xa2, 364 0x15, 0x29, 0x0a, 0x3d, 0x30, 0xaa, 0x4a, 0xb2, 0xc8, 0xd2, 0x75, 0x21, 0xad, 0xa6, 0x52, 0x39, 365 0xaf, 0xaa, 0x6a, 0x8e, 0x2e, 0x54, 0xbd, 0x21, 0xb4, 0x17, 0x52, 0xe6, 0xd3, 0xf5, 0xff, 0x14, 366 0x4d, 0xd0, 0x92, 0x58, 0x59, 0x36, 0x48, 0x4b, 0x62, 0xfc, 0x00, 0x6f, 0xa2, 0x38, 0xce, 0x0b, 367 0x4b, 0x73, 0x9a, 0x7d, 0x83, 0x0e, 0x43, 0xef, 0x3b, 0xe8, 0xd5, 0x3d, 0x1c, 0x82, 0x9e, 0x49, 368 0x99, 0x2b, 0xbe, 0x33, 0xfa, 0x74, 0xed, 0xef, 0xf1, 0x32, 0x29, 0xb2, 0x77, 0x07, 0xc6, 0xb9, 369 0x13, 0xfc, 0x01, 0xad, 0xa2, 0x8c, 0xca, 0x4d, 0x51, 0xc7, 0xe4, 0x5e, 0xbb, 0x71, 0xa4, 0x7d, 370 0x45, 0x52, 0xad, 0x40, 0x1b, 0xe0, 0xd0, 0x05, 0xf2, 0xb6, 0x54, 0x89, 0xbd, 0xa3, 0xb3, 0x0d, 371 0x22, 0xe8, 0x95, 0x5d, 0x95, 0x8a, 0x41, 0xaa, 0x77, 0xbf, 0x40, 0xe7, 0x2c, 0x74, 0x6c, 0x83, 372 0xee, 0x4d, 0xc7, 0xbf, 0x79, 0x03, 0xdf, 0x43, 0xb7, 0xea, 0x42, 0x12, 0xfe, 0x62, 0x3e, 0xf3, 373 0x05, 0x67, 0x6e, 0x02, 0xe6, 0xe5, 0x67, 0x6c, 0x81, 0x36, 0xff, 0xc5, 0x1b, 0xc8, 0xc1, 0x10, 374 0xa1, 0xc2, 0x05, 0xd1, 0x9c, 0x78, 0x8c, 0x08, 0x66, 0xbd, 0x21, 0xf1, 0x73, 0xe9, 0x0b, 0x8f, 375 0x4b, 0x44, 0xe8, 0x8a, 0x70, 0x32, 0xf6, 0x42, 0x12, 0x7f, 0x97, 0xc2, 0x0f, 0xf8, 0x8e, 0xe1, 376 0x47, 0xe0, 0x22, 0x9c, 0xce, 0x02, 0x41, 0xb3, 0x93, 0xfa, 0x5e, 0x9b, 0x18, 0xbb, 0xbd, 0xcd, 377 0x1e, 0xf7, 0x36, 0x7b, 0xda, 0xdb, 0xec, 0x39, 0x00, 0x00, 0xff, 0xff, 0x8e, 0xe2, 0x93, 0x4e, 378 0x61, 0x02, 0x00, 0x00, 379} 380 381func (m *Message) Marshal() (dAtA []byte, err error) { 382 size := m.Size() 383 dAtA = make([]byte, size) 384 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 385 if err != nil { 386 return nil, err 387 } 388 return dAtA[:n], nil 389} 390 391func (m *Message) MarshalTo(dAtA []byte) (int, error) { 392 size := m.Size() 393 return m.MarshalToSizedBuffer(dAtA[:size]) 394} 395 396func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { 397 i := len(dAtA) 398 _ = i 399 var l int 400 _ = l 401 if m.XXX_unrecognized != nil { 402 i -= len(m.XXX_unrecognized) 403 copy(dAtA[i:], m.XXX_unrecognized) 404 } 405 if m.DialResponse != nil { 406 { 407 size, err := m.DialResponse.MarshalToSizedBuffer(dAtA[:i]) 408 if err != nil { 409 return 0, err 410 } 411 i -= size 412 i = encodeVarintAutonat(dAtA, i, uint64(size)) 413 } 414 i-- 415 dAtA[i] = 0x1a 416 } 417 if m.Dial != nil { 418 { 419 size, err := m.Dial.MarshalToSizedBuffer(dAtA[:i]) 420 if err != nil { 421 return 0, err 422 } 423 i -= size 424 i = encodeVarintAutonat(dAtA, i, uint64(size)) 425 } 426 i-- 427 dAtA[i] = 0x12 428 } 429 if m.Type != nil { 430 i = encodeVarintAutonat(dAtA, i, uint64(*m.Type)) 431 i-- 432 dAtA[i] = 0x8 433 } 434 return len(dAtA) - i, nil 435} 436 437func (m *Message_PeerInfo) Marshal() (dAtA []byte, err error) { 438 size := m.Size() 439 dAtA = make([]byte, size) 440 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 441 if err != nil { 442 return nil, err 443 } 444 return dAtA[:n], nil 445} 446 447func (m *Message_PeerInfo) MarshalTo(dAtA []byte) (int, error) { 448 size := m.Size() 449 return m.MarshalToSizedBuffer(dAtA[:size]) 450} 451 452func (m *Message_PeerInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { 453 i := len(dAtA) 454 _ = i 455 var l int 456 _ = l 457 if m.XXX_unrecognized != nil { 458 i -= len(m.XXX_unrecognized) 459 copy(dAtA[i:], m.XXX_unrecognized) 460 } 461 if len(m.Addrs) > 0 { 462 for iNdEx := len(m.Addrs) - 1; iNdEx >= 0; iNdEx-- { 463 i -= len(m.Addrs[iNdEx]) 464 copy(dAtA[i:], m.Addrs[iNdEx]) 465 i = encodeVarintAutonat(dAtA, i, uint64(len(m.Addrs[iNdEx]))) 466 i-- 467 dAtA[i] = 0x12 468 } 469 } 470 if m.Id != nil { 471 i -= len(m.Id) 472 copy(dAtA[i:], m.Id) 473 i = encodeVarintAutonat(dAtA, i, uint64(len(m.Id))) 474 i-- 475 dAtA[i] = 0xa 476 } 477 return len(dAtA) - i, nil 478} 479 480func (m *Message_Dial) Marshal() (dAtA []byte, err error) { 481 size := m.Size() 482 dAtA = make([]byte, size) 483 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 484 if err != nil { 485 return nil, err 486 } 487 return dAtA[:n], nil 488} 489 490func (m *Message_Dial) MarshalTo(dAtA []byte) (int, error) { 491 size := m.Size() 492 return m.MarshalToSizedBuffer(dAtA[:size]) 493} 494 495func (m *Message_Dial) MarshalToSizedBuffer(dAtA []byte) (int, error) { 496 i := len(dAtA) 497 _ = i 498 var l int 499 _ = l 500 if m.XXX_unrecognized != nil { 501 i -= len(m.XXX_unrecognized) 502 copy(dAtA[i:], m.XXX_unrecognized) 503 } 504 if m.Peer != nil { 505 { 506 size, err := m.Peer.MarshalToSizedBuffer(dAtA[:i]) 507 if err != nil { 508 return 0, err 509 } 510 i -= size 511 i = encodeVarintAutonat(dAtA, i, uint64(size)) 512 } 513 i-- 514 dAtA[i] = 0xa 515 } 516 return len(dAtA) - i, nil 517} 518 519func (m *Message_DialResponse) Marshal() (dAtA []byte, err error) { 520 size := m.Size() 521 dAtA = make([]byte, size) 522 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 523 if err != nil { 524 return nil, err 525 } 526 return dAtA[:n], nil 527} 528 529func (m *Message_DialResponse) MarshalTo(dAtA []byte) (int, error) { 530 size := m.Size() 531 return m.MarshalToSizedBuffer(dAtA[:size]) 532} 533 534func (m *Message_DialResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 535 i := len(dAtA) 536 _ = i 537 var l int 538 _ = l 539 if m.XXX_unrecognized != nil { 540 i -= len(m.XXX_unrecognized) 541 copy(dAtA[i:], m.XXX_unrecognized) 542 } 543 if m.Addr != nil { 544 i -= len(m.Addr) 545 copy(dAtA[i:], m.Addr) 546 i = encodeVarintAutonat(dAtA, i, uint64(len(m.Addr))) 547 i-- 548 dAtA[i] = 0x1a 549 } 550 if m.StatusText != nil { 551 i -= len(*m.StatusText) 552 copy(dAtA[i:], *m.StatusText) 553 i = encodeVarintAutonat(dAtA, i, uint64(len(*m.StatusText))) 554 i-- 555 dAtA[i] = 0x12 556 } 557 if m.Status != nil { 558 i = encodeVarintAutonat(dAtA, i, uint64(*m.Status)) 559 i-- 560 dAtA[i] = 0x8 561 } 562 return len(dAtA) - i, nil 563} 564 565func encodeVarintAutonat(dAtA []byte, offset int, v uint64) int { 566 offset -= sovAutonat(v) 567 base := offset 568 for v >= 1<<7 { 569 dAtA[offset] = uint8(v&0x7f | 0x80) 570 v >>= 7 571 offset++ 572 } 573 dAtA[offset] = uint8(v) 574 return base 575} 576func (m *Message) Size() (n int) { 577 if m == nil { 578 return 0 579 } 580 var l int 581 _ = l 582 if m.Type != nil { 583 n += 1 + sovAutonat(uint64(*m.Type)) 584 } 585 if m.Dial != nil { 586 l = m.Dial.Size() 587 n += 1 + l + sovAutonat(uint64(l)) 588 } 589 if m.DialResponse != nil { 590 l = m.DialResponse.Size() 591 n += 1 + l + sovAutonat(uint64(l)) 592 } 593 if m.XXX_unrecognized != nil { 594 n += len(m.XXX_unrecognized) 595 } 596 return n 597} 598 599func (m *Message_PeerInfo) Size() (n int) { 600 if m == nil { 601 return 0 602 } 603 var l int 604 _ = l 605 if m.Id != nil { 606 l = len(m.Id) 607 n += 1 + l + sovAutonat(uint64(l)) 608 } 609 if len(m.Addrs) > 0 { 610 for _, b := range m.Addrs { 611 l = len(b) 612 n += 1 + l + sovAutonat(uint64(l)) 613 } 614 } 615 if m.XXX_unrecognized != nil { 616 n += len(m.XXX_unrecognized) 617 } 618 return n 619} 620 621func (m *Message_Dial) Size() (n int) { 622 if m == nil { 623 return 0 624 } 625 var l int 626 _ = l 627 if m.Peer != nil { 628 l = m.Peer.Size() 629 n += 1 + l + sovAutonat(uint64(l)) 630 } 631 if m.XXX_unrecognized != nil { 632 n += len(m.XXX_unrecognized) 633 } 634 return n 635} 636 637func (m *Message_DialResponse) Size() (n int) { 638 if m == nil { 639 return 0 640 } 641 var l int 642 _ = l 643 if m.Status != nil { 644 n += 1 + sovAutonat(uint64(*m.Status)) 645 } 646 if m.StatusText != nil { 647 l = len(*m.StatusText) 648 n += 1 + l + sovAutonat(uint64(l)) 649 } 650 if m.Addr != nil { 651 l = len(m.Addr) 652 n += 1 + l + sovAutonat(uint64(l)) 653 } 654 if m.XXX_unrecognized != nil { 655 n += len(m.XXX_unrecognized) 656 } 657 return n 658} 659 660func sovAutonat(x uint64) (n int) { 661 return (math_bits.Len64(x|1) + 6) / 7 662} 663func sozAutonat(x uint64) (n int) { 664 return sovAutonat(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 665} 666func (m *Message) Unmarshal(dAtA []byte) error { 667 l := len(dAtA) 668 iNdEx := 0 669 for iNdEx < l { 670 preIndex := iNdEx 671 var wire uint64 672 for shift := uint(0); ; shift += 7 { 673 if shift >= 64 { 674 return ErrIntOverflowAutonat 675 } 676 if iNdEx >= l { 677 return io.ErrUnexpectedEOF 678 } 679 b := dAtA[iNdEx] 680 iNdEx++ 681 wire |= uint64(b&0x7F) << shift 682 if b < 0x80 { 683 break 684 } 685 } 686 fieldNum := int32(wire >> 3) 687 wireType := int(wire & 0x7) 688 if wireType == 4 { 689 return fmt.Errorf("proto: Message: wiretype end group for non-group") 690 } 691 if fieldNum <= 0 { 692 return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) 693 } 694 switch fieldNum { 695 case 1: 696 if wireType != 0 { 697 return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) 698 } 699 var v Message_MessageType 700 for shift := uint(0); ; shift += 7 { 701 if shift >= 64 { 702 return ErrIntOverflowAutonat 703 } 704 if iNdEx >= l { 705 return io.ErrUnexpectedEOF 706 } 707 b := dAtA[iNdEx] 708 iNdEx++ 709 v |= Message_MessageType(b&0x7F) << shift 710 if b < 0x80 { 711 break 712 } 713 } 714 m.Type = &v 715 case 2: 716 if wireType != 2 { 717 return fmt.Errorf("proto: wrong wireType = %d for field Dial", wireType) 718 } 719 var msglen int 720 for shift := uint(0); ; shift += 7 { 721 if shift >= 64 { 722 return ErrIntOverflowAutonat 723 } 724 if iNdEx >= l { 725 return io.ErrUnexpectedEOF 726 } 727 b := dAtA[iNdEx] 728 iNdEx++ 729 msglen |= int(b&0x7F) << shift 730 if b < 0x80 { 731 break 732 } 733 } 734 if msglen < 0 { 735 return ErrInvalidLengthAutonat 736 } 737 postIndex := iNdEx + msglen 738 if postIndex < 0 { 739 return ErrInvalidLengthAutonat 740 } 741 if postIndex > l { 742 return io.ErrUnexpectedEOF 743 } 744 if m.Dial == nil { 745 m.Dial = &Message_Dial{} 746 } 747 if err := m.Dial.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 748 return err 749 } 750 iNdEx = postIndex 751 case 3: 752 if wireType != 2 { 753 return fmt.Errorf("proto: wrong wireType = %d for field DialResponse", wireType) 754 } 755 var msglen int 756 for shift := uint(0); ; shift += 7 { 757 if shift >= 64 { 758 return ErrIntOverflowAutonat 759 } 760 if iNdEx >= l { 761 return io.ErrUnexpectedEOF 762 } 763 b := dAtA[iNdEx] 764 iNdEx++ 765 msglen |= int(b&0x7F) << shift 766 if b < 0x80 { 767 break 768 } 769 } 770 if msglen < 0 { 771 return ErrInvalidLengthAutonat 772 } 773 postIndex := iNdEx + msglen 774 if postIndex < 0 { 775 return ErrInvalidLengthAutonat 776 } 777 if postIndex > l { 778 return io.ErrUnexpectedEOF 779 } 780 if m.DialResponse == nil { 781 m.DialResponse = &Message_DialResponse{} 782 } 783 if err := m.DialResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 784 return err 785 } 786 iNdEx = postIndex 787 default: 788 iNdEx = preIndex 789 skippy, err := skipAutonat(dAtA[iNdEx:]) 790 if err != nil { 791 return err 792 } 793 if skippy < 0 { 794 return ErrInvalidLengthAutonat 795 } 796 if (iNdEx + skippy) < 0 { 797 return ErrInvalidLengthAutonat 798 } 799 if (iNdEx + skippy) > l { 800 return io.ErrUnexpectedEOF 801 } 802 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 803 iNdEx += skippy 804 } 805 } 806 807 if iNdEx > l { 808 return io.ErrUnexpectedEOF 809 } 810 return nil 811} 812func (m *Message_PeerInfo) Unmarshal(dAtA []byte) error { 813 l := len(dAtA) 814 iNdEx := 0 815 for iNdEx < l { 816 preIndex := iNdEx 817 var wire uint64 818 for shift := uint(0); ; shift += 7 { 819 if shift >= 64 { 820 return ErrIntOverflowAutonat 821 } 822 if iNdEx >= l { 823 return io.ErrUnexpectedEOF 824 } 825 b := dAtA[iNdEx] 826 iNdEx++ 827 wire |= uint64(b&0x7F) << shift 828 if b < 0x80 { 829 break 830 } 831 } 832 fieldNum := int32(wire >> 3) 833 wireType := int(wire & 0x7) 834 if wireType == 4 { 835 return fmt.Errorf("proto: PeerInfo: wiretype end group for non-group") 836 } 837 if fieldNum <= 0 { 838 return fmt.Errorf("proto: PeerInfo: illegal tag %d (wire type %d)", fieldNum, wire) 839 } 840 switch fieldNum { 841 case 1: 842 if wireType != 2 { 843 return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) 844 } 845 var byteLen int 846 for shift := uint(0); ; shift += 7 { 847 if shift >= 64 { 848 return ErrIntOverflowAutonat 849 } 850 if iNdEx >= l { 851 return io.ErrUnexpectedEOF 852 } 853 b := dAtA[iNdEx] 854 iNdEx++ 855 byteLen |= int(b&0x7F) << shift 856 if b < 0x80 { 857 break 858 } 859 } 860 if byteLen < 0 { 861 return ErrInvalidLengthAutonat 862 } 863 postIndex := iNdEx + byteLen 864 if postIndex < 0 { 865 return ErrInvalidLengthAutonat 866 } 867 if postIndex > l { 868 return io.ErrUnexpectedEOF 869 } 870 m.Id = append(m.Id[:0], dAtA[iNdEx:postIndex]...) 871 if m.Id == nil { 872 m.Id = []byte{} 873 } 874 iNdEx = postIndex 875 case 2: 876 if wireType != 2 { 877 return fmt.Errorf("proto: wrong wireType = %d for field Addrs", wireType) 878 } 879 var byteLen int 880 for shift := uint(0); ; shift += 7 { 881 if shift >= 64 { 882 return ErrIntOverflowAutonat 883 } 884 if iNdEx >= l { 885 return io.ErrUnexpectedEOF 886 } 887 b := dAtA[iNdEx] 888 iNdEx++ 889 byteLen |= int(b&0x7F) << shift 890 if b < 0x80 { 891 break 892 } 893 } 894 if byteLen < 0 { 895 return ErrInvalidLengthAutonat 896 } 897 postIndex := iNdEx + byteLen 898 if postIndex < 0 { 899 return ErrInvalidLengthAutonat 900 } 901 if postIndex > l { 902 return io.ErrUnexpectedEOF 903 } 904 m.Addrs = append(m.Addrs, make([]byte, postIndex-iNdEx)) 905 copy(m.Addrs[len(m.Addrs)-1], dAtA[iNdEx:postIndex]) 906 iNdEx = postIndex 907 default: 908 iNdEx = preIndex 909 skippy, err := skipAutonat(dAtA[iNdEx:]) 910 if err != nil { 911 return err 912 } 913 if skippy < 0 { 914 return ErrInvalidLengthAutonat 915 } 916 if (iNdEx + skippy) < 0 { 917 return ErrInvalidLengthAutonat 918 } 919 if (iNdEx + skippy) > l { 920 return io.ErrUnexpectedEOF 921 } 922 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 923 iNdEx += skippy 924 } 925 } 926 927 if iNdEx > l { 928 return io.ErrUnexpectedEOF 929 } 930 return nil 931} 932func (m *Message_Dial) Unmarshal(dAtA []byte) error { 933 l := len(dAtA) 934 iNdEx := 0 935 for iNdEx < l { 936 preIndex := iNdEx 937 var wire uint64 938 for shift := uint(0); ; shift += 7 { 939 if shift >= 64 { 940 return ErrIntOverflowAutonat 941 } 942 if iNdEx >= l { 943 return io.ErrUnexpectedEOF 944 } 945 b := dAtA[iNdEx] 946 iNdEx++ 947 wire |= uint64(b&0x7F) << shift 948 if b < 0x80 { 949 break 950 } 951 } 952 fieldNum := int32(wire >> 3) 953 wireType := int(wire & 0x7) 954 if wireType == 4 { 955 return fmt.Errorf("proto: Dial: wiretype end group for non-group") 956 } 957 if fieldNum <= 0 { 958 return fmt.Errorf("proto: Dial: illegal tag %d (wire type %d)", fieldNum, wire) 959 } 960 switch fieldNum { 961 case 1: 962 if wireType != 2 { 963 return fmt.Errorf("proto: wrong wireType = %d for field Peer", wireType) 964 } 965 var msglen int 966 for shift := uint(0); ; shift += 7 { 967 if shift >= 64 { 968 return ErrIntOverflowAutonat 969 } 970 if iNdEx >= l { 971 return io.ErrUnexpectedEOF 972 } 973 b := dAtA[iNdEx] 974 iNdEx++ 975 msglen |= int(b&0x7F) << shift 976 if b < 0x80 { 977 break 978 } 979 } 980 if msglen < 0 { 981 return ErrInvalidLengthAutonat 982 } 983 postIndex := iNdEx + msglen 984 if postIndex < 0 { 985 return ErrInvalidLengthAutonat 986 } 987 if postIndex > l { 988 return io.ErrUnexpectedEOF 989 } 990 if m.Peer == nil { 991 m.Peer = &Message_PeerInfo{} 992 } 993 if err := m.Peer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 994 return err 995 } 996 iNdEx = postIndex 997 default: 998 iNdEx = preIndex 999 skippy, err := skipAutonat(dAtA[iNdEx:]) 1000 if err != nil { 1001 return err 1002 } 1003 if skippy < 0 { 1004 return ErrInvalidLengthAutonat 1005 } 1006 if (iNdEx + skippy) < 0 { 1007 return ErrInvalidLengthAutonat 1008 } 1009 if (iNdEx + skippy) > l { 1010 return io.ErrUnexpectedEOF 1011 } 1012 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1013 iNdEx += skippy 1014 } 1015 } 1016 1017 if iNdEx > l { 1018 return io.ErrUnexpectedEOF 1019 } 1020 return nil 1021} 1022func (m *Message_DialResponse) Unmarshal(dAtA []byte) error { 1023 l := len(dAtA) 1024 iNdEx := 0 1025 for iNdEx < l { 1026 preIndex := iNdEx 1027 var wire uint64 1028 for shift := uint(0); ; shift += 7 { 1029 if shift >= 64 { 1030 return ErrIntOverflowAutonat 1031 } 1032 if iNdEx >= l { 1033 return io.ErrUnexpectedEOF 1034 } 1035 b := dAtA[iNdEx] 1036 iNdEx++ 1037 wire |= uint64(b&0x7F) << shift 1038 if b < 0x80 { 1039 break 1040 } 1041 } 1042 fieldNum := int32(wire >> 3) 1043 wireType := int(wire & 0x7) 1044 if wireType == 4 { 1045 return fmt.Errorf("proto: DialResponse: wiretype end group for non-group") 1046 } 1047 if fieldNum <= 0 { 1048 return fmt.Errorf("proto: DialResponse: illegal tag %d (wire type %d)", fieldNum, wire) 1049 } 1050 switch fieldNum { 1051 case 1: 1052 if wireType != 0 { 1053 return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) 1054 } 1055 var v Message_ResponseStatus 1056 for shift := uint(0); ; shift += 7 { 1057 if shift >= 64 { 1058 return ErrIntOverflowAutonat 1059 } 1060 if iNdEx >= l { 1061 return io.ErrUnexpectedEOF 1062 } 1063 b := dAtA[iNdEx] 1064 iNdEx++ 1065 v |= Message_ResponseStatus(b&0x7F) << shift 1066 if b < 0x80 { 1067 break 1068 } 1069 } 1070 m.Status = &v 1071 case 2: 1072 if wireType != 2 { 1073 return fmt.Errorf("proto: wrong wireType = %d for field StatusText", wireType) 1074 } 1075 var stringLen uint64 1076 for shift := uint(0); ; shift += 7 { 1077 if shift >= 64 { 1078 return ErrIntOverflowAutonat 1079 } 1080 if iNdEx >= l { 1081 return io.ErrUnexpectedEOF 1082 } 1083 b := dAtA[iNdEx] 1084 iNdEx++ 1085 stringLen |= uint64(b&0x7F) << shift 1086 if b < 0x80 { 1087 break 1088 } 1089 } 1090 intStringLen := int(stringLen) 1091 if intStringLen < 0 { 1092 return ErrInvalidLengthAutonat 1093 } 1094 postIndex := iNdEx + intStringLen 1095 if postIndex < 0 { 1096 return ErrInvalidLengthAutonat 1097 } 1098 if postIndex > l { 1099 return io.ErrUnexpectedEOF 1100 } 1101 s := string(dAtA[iNdEx:postIndex]) 1102 m.StatusText = &s 1103 iNdEx = postIndex 1104 case 3: 1105 if wireType != 2 { 1106 return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType) 1107 } 1108 var byteLen int 1109 for shift := uint(0); ; shift += 7 { 1110 if shift >= 64 { 1111 return ErrIntOverflowAutonat 1112 } 1113 if iNdEx >= l { 1114 return io.ErrUnexpectedEOF 1115 } 1116 b := dAtA[iNdEx] 1117 iNdEx++ 1118 byteLen |= int(b&0x7F) << shift 1119 if b < 0x80 { 1120 break 1121 } 1122 } 1123 if byteLen < 0 { 1124 return ErrInvalidLengthAutonat 1125 } 1126 postIndex := iNdEx + byteLen 1127 if postIndex < 0 { 1128 return ErrInvalidLengthAutonat 1129 } 1130 if postIndex > l { 1131 return io.ErrUnexpectedEOF 1132 } 1133 m.Addr = append(m.Addr[:0], dAtA[iNdEx:postIndex]...) 1134 if m.Addr == nil { 1135 m.Addr = []byte{} 1136 } 1137 iNdEx = postIndex 1138 default: 1139 iNdEx = preIndex 1140 skippy, err := skipAutonat(dAtA[iNdEx:]) 1141 if err != nil { 1142 return err 1143 } 1144 if skippy < 0 { 1145 return ErrInvalidLengthAutonat 1146 } 1147 if (iNdEx + skippy) < 0 { 1148 return ErrInvalidLengthAutonat 1149 } 1150 if (iNdEx + skippy) > l { 1151 return io.ErrUnexpectedEOF 1152 } 1153 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1154 iNdEx += skippy 1155 } 1156 } 1157 1158 if iNdEx > l { 1159 return io.ErrUnexpectedEOF 1160 } 1161 return nil 1162} 1163func skipAutonat(dAtA []byte) (n int, err error) { 1164 l := len(dAtA) 1165 iNdEx := 0 1166 depth := 0 1167 for iNdEx < l { 1168 var wire uint64 1169 for shift := uint(0); ; shift += 7 { 1170 if shift >= 64 { 1171 return 0, ErrIntOverflowAutonat 1172 } 1173 if iNdEx >= l { 1174 return 0, io.ErrUnexpectedEOF 1175 } 1176 b := dAtA[iNdEx] 1177 iNdEx++ 1178 wire |= (uint64(b) & 0x7F) << shift 1179 if b < 0x80 { 1180 break 1181 } 1182 } 1183 wireType := int(wire & 0x7) 1184 switch wireType { 1185 case 0: 1186 for shift := uint(0); ; shift += 7 { 1187 if shift >= 64 { 1188 return 0, ErrIntOverflowAutonat 1189 } 1190 if iNdEx >= l { 1191 return 0, io.ErrUnexpectedEOF 1192 } 1193 iNdEx++ 1194 if dAtA[iNdEx-1] < 0x80 { 1195 break 1196 } 1197 } 1198 case 1: 1199 iNdEx += 8 1200 case 2: 1201 var length int 1202 for shift := uint(0); ; shift += 7 { 1203 if shift >= 64 { 1204 return 0, ErrIntOverflowAutonat 1205 } 1206 if iNdEx >= l { 1207 return 0, io.ErrUnexpectedEOF 1208 } 1209 b := dAtA[iNdEx] 1210 iNdEx++ 1211 length |= (int(b) & 0x7F) << shift 1212 if b < 0x80 { 1213 break 1214 } 1215 } 1216 if length < 0 { 1217 return 0, ErrInvalidLengthAutonat 1218 } 1219 iNdEx += length 1220 case 3: 1221 depth++ 1222 case 4: 1223 if depth == 0 { 1224 return 0, ErrUnexpectedEndOfGroupAutonat 1225 } 1226 depth-- 1227 case 5: 1228 iNdEx += 4 1229 default: 1230 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1231 } 1232 if iNdEx < 0 { 1233 return 0, ErrInvalidLengthAutonat 1234 } 1235 if depth == 0 { 1236 return iNdEx, nil 1237 } 1238 } 1239 return 0, io.ErrUnexpectedEOF 1240} 1241 1242var ( 1243 ErrInvalidLengthAutonat = fmt.Errorf("proto: negative length found during unmarshaling") 1244 ErrIntOverflowAutonat = fmt.Errorf("proto: integer overflow") 1245 ErrUnexpectedEndOfGroupAutonat = fmt.Errorf("proto: unexpected end of group") 1246) 1247