message.pb.go 37.7 KB
Newer Older
Steven Allen's avatar
Steven Allen committed
1
// Code generated by protoc-gen-gogo. DO NOT EDIT.
2 3
// source: message.proto

4
package bitswap_message_pb
5

Jakub Sztandera's avatar
Jakub Sztandera committed
6 7 8 9 10 11
import (
	fmt "fmt"
	_ "github.com/gogo/protobuf/gogoproto"
	proto "github.com/gogo/protobuf/proto"
	io "io"
	math "math"
12
	math_bits "math/bits"
Jakub Sztandera's avatar
Jakub Sztandera committed
13
)
Steven Allen's avatar
Steven Allen committed
14

15 16
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
17
var _ = fmt.Errorf
18 19
var _ = math.Inf

Steven Allen's avatar
Steven Allen committed
20 21 22 23
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
Steven Allen's avatar
Steven Allen committed
24
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
dirkmc's avatar
dirkmc committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

type Message_BlockPresenceType int32

const (
	Message_Have     Message_BlockPresenceType = 0
	Message_DontHave Message_BlockPresenceType = 1
)

var Message_BlockPresenceType_name = map[int32]string{
	0: "Have",
	1: "DontHave",
}

var Message_BlockPresenceType_value = map[string]int32{
	"Have":     0,
	"DontHave": 1,
}

func (x Message_BlockPresenceType) String() string {
	return proto.EnumName(Message_BlockPresenceType_name, int32(x))
}

func (Message_BlockPresenceType) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_33c57e4bae7b9afd, []int{0, 0}
}

type Message_Wantlist_WantType int32

const (
	Message_Wantlist_Block Message_Wantlist_WantType = 0
	Message_Wantlist_Have  Message_Wantlist_WantType = 1
)

var Message_Wantlist_WantType_name = map[int32]string{
	0: "Block",
	1: "Have",
}

var Message_Wantlist_WantType_value = map[string]int32{
	"Block": 0,
	"Have":  1,
}

func (x Message_Wantlist_WantType) String() string {
	return proto.EnumName(Message_Wantlist_WantType_name, int32(x))
}

func (Message_Wantlist_WantType) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_33c57e4bae7b9afd, []int{0, 0, 0}
}
Steven Allen's avatar
Steven Allen committed
75

76
type Message struct {
dirkmc's avatar
dirkmc committed
77 78 79 80 81
	Wantlist       Message_Wantlist        `protobuf:"bytes,1,opt,name=wantlist,proto3" json:"wantlist"`
	Blocks         [][]byte                `protobuf:"bytes,2,rep,name=blocks,proto3" json:"blocks,omitempty"`
	Payload        []Message_Block         `protobuf:"bytes,3,rep,name=payload,proto3" json:"payload"`
	BlockPresences []Message_BlockPresence `protobuf:"bytes,4,rep,name=blockPresences,proto3" json:"blockPresences"`
	PendingBytes   int32                   `protobuf:"varint,5,opt,name=pendingBytes,proto3" json:"pendingBytes,omitempty"`
82 83
}

84 85 86
func (m *Message) Reset()         { *m = Message{} }
func (m *Message) String() string { return proto.CompactTextString(m) }
func (*Message) ProtoMessage()    {}
Steven Allen's avatar
Steven Allen committed
87
func (*Message) Descriptor() ([]byte, []int) {
Jakub Sztandera's avatar
Jakub Sztandera committed
88
	return fileDescriptor_33c57e4bae7b9afd, []int{0}
Steven Allen's avatar
Steven Allen committed
89 90 91 92 93 94 95 96 97
}
func (m *Message) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_Message.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
98
		n, err := m.MarshalToSizedBuffer(b)
Steven Allen's avatar
Steven Allen committed
99 100 101 102 103 104
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
Jakub Sztandera's avatar
Jakub Sztandera committed
105 106
func (m *Message) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Message.Merge(m, src)
Steven Allen's avatar
Steven Allen committed
107 108 109 110 111 112 113 114 115
}
func (m *Message) XXX_Size() int {
	return m.Size()
}
func (m *Message) XXX_DiscardUnknown() {
	xxx_messageInfo_Message.DiscardUnknown(m)
}

var xxx_messageInfo_Message proto.InternalMessageInfo
116

Steven Allen's avatar
Steven Allen committed
117
func (m *Message) GetWantlist() Message_Wantlist {
118 119 120
	if m != nil {
		return m.Wantlist
	}
Steven Allen's avatar
Steven Allen committed
121
	return Message_Wantlist{}
122 123
}

124
func (m *Message) GetBlocks() [][]byte {
125 126 127 128 129 130
	if m != nil {
		return m.Blocks
	}
	return nil
}

Steven Allen's avatar
Steven Allen committed
131
func (m *Message) GetPayload() []Message_Block {
132 133 134 135 136 137
	if m != nil {
		return m.Payload
	}
	return nil
}

dirkmc's avatar
dirkmc committed
138 139 140 141 142 143 144 145 146 147 148 149 150 151
func (m *Message) GetBlockPresences() []Message_BlockPresence {
	if m != nil {
		return m.BlockPresences
	}
	return nil
}

func (m *Message) GetPendingBytes() int32 {
	if m != nil {
		return m.PendingBytes
	}
	return 0
}

Jeromy's avatar
Jeromy committed
152
type Message_Wantlist struct {
Jakub Sztandera's avatar
Jakub Sztandera committed
153 154
	Entries []Message_Wantlist_Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries"`
	Full    bool                     `protobuf:"varint,2,opt,name=full,proto3" json:"full,omitempty"`
Jeromy's avatar
Jeromy committed
155 156 157 158 159
}

func (m *Message_Wantlist) Reset()         { *m = Message_Wantlist{} }
func (m *Message_Wantlist) String() string { return proto.CompactTextString(m) }
func (*Message_Wantlist) ProtoMessage()    {}
Steven Allen's avatar
Steven Allen committed
160
func (*Message_Wantlist) Descriptor() ([]byte, []int) {
Jakub Sztandera's avatar
Jakub Sztandera committed
161
	return fileDescriptor_33c57e4bae7b9afd, []int{0, 0}
Steven Allen's avatar
Steven Allen committed
162 163 164 165 166 167 168 169 170
}
func (m *Message_Wantlist) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *Message_Wantlist) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_Message_Wantlist.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
171
		n, err := m.MarshalToSizedBuffer(b)
Steven Allen's avatar
Steven Allen committed
172 173 174 175 176 177
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
Jakub Sztandera's avatar
Jakub Sztandera committed
178 179
func (m *Message_Wantlist) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Message_Wantlist.Merge(m, src)
Steven Allen's avatar
Steven Allen committed
180 181 182 183 184 185 186 187 188
}
func (m *Message_Wantlist) XXX_Size() int {
	return m.Size()
}
func (m *Message_Wantlist) XXX_DiscardUnknown() {
	xxx_messageInfo_Message_Wantlist.DiscardUnknown(m)
}

var xxx_messageInfo_Message_Wantlist proto.InternalMessageInfo
Jeromy's avatar
Jeromy committed
189

Steven Allen's avatar
Steven Allen committed
190
func (m *Message_Wantlist) GetEntries() []Message_Wantlist_Entry {
Jeromy's avatar
Jeromy committed
191 192 193 194 195 196 197
	if m != nil {
		return m.Entries
	}
	return nil
}

func (m *Message_Wantlist) GetFull() bool {
Steven Allen's avatar
Steven Allen committed
198 199
	if m != nil {
		return m.Full
Jeromy's avatar
Jeromy committed
200 201 202 203 204
	}
	return false
}

type Message_Wantlist_Entry struct {
Steven Allen's avatar
Steven Allen committed
205
	Block        Cid                       `protobuf:"bytes,1,opt,name=block,proto3,customtype=Cid" json:"block"`
dirkmc's avatar
dirkmc committed
206 207 208 209
	Priority     int32                     `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,omitempty"`
	Cancel       bool                      `protobuf:"varint,3,opt,name=cancel,proto3" json:"cancel,omitempty"`
	WantType     Message_Wantlist_WantType `protobuf:"varint,4,opt,name=wantType,proto3,enum=bitswap.message.pb.Message_Wantlist_WantType" json:"wantType,omitempty"`
	SendDontHave bool                      `protobuf:"varint,5,opt,name=sendDontHave,proto3" json:"sendDontHave,omitempty"`
Jeromy's avatar
Jeromy committed
210 211 212 213 214
}

func (m *Message_Wantlist_Entry) Reset()         { *m = Message_Wantlist_Entry{} }
func (m *Message_Wantlist_Entry) String() string { return proto.CompactTextString(m) }
func (*Message_Wantlist_Entry) ProtoMessage()    {}
Steven Allen's avatar
Steven Allen committed
215
func (*Message_Wantlist_Entry) Descriptor() ([]byte, []int) {
Jakub Sztandera's avatar
Jakub Sztandera committed
216
	return fileDescriptor_33c57e4bae7b9afd, []int{0, 0, 0}
Steven Allen's avatar
Steven Allen committed
217 218 219 220 221 222 223 224 225
}
func (m *Message_Wantlist_Entry) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *Message_Wantlist_Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_Message_Wantlist_Entry.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
226
		n, err := m.MarshalToSizedBuffer(b)
Steven Allen's avatar
Steven Allen committed
227 228 229 230 231 232
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
Jakub Sztandera's avatar
Jakub Sztandera committed
233 234
func (m *Message_Wantlist_Entry) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Message_Wantlist_Entry.Merge(m, src)
Steven Allen's avatar
Steven Allen committed
235 236 237 238 239 240 241
}
func (m *Message_Wantlist_Entry) XXX_Size() int {
	return m.Size()
}
func (m *Message_Wantlist_Entry) XXX_DiscardUnknown() {
	xxx_messageInfo_Message_Wantlist_Entry.DiscardUnknown(m)
}
Jeromy's avatar
Jeromy committed
242

Steven Allen's avatar
Steven Allen committed
243 244
var xxx_messageInfo_Message_Wantlist_Entry proto.InternalMessageInfo

Jeromy's avatar
Jeromy committed
245
func (m *Message_Wantlist_Entry) GetPriority() int32 {
Steven Allen's avatar
Steven Allen committed
246 247
	if m != nil {
		return m.Priority
Jeromy's avatar
Jeromy committed
248 249 250 251 252
	}
	return 0
}

func (m *Message_Wantlist_Entry) GetCancel() bool {
Steven Allen's avatar
Steven Allen committed
253 254
	if m != nil {
		return m.Cancel
Jeromy's avatar
Jeromy committed
255 256 257 258
	}
	return false
}

dirkmc's avatar
dirkmc committed
259 260 261 262 263 264 265 266 267 268 269 270 271 272
func (m *Message_Wantlist_Entry) GetWantType() Message_Wantlist_WantType {
	if m != nil {
		return m.WantType
	}
	return Message_Wantlist_Block
}

func (m *Message_Wantlist_Entry) GetSendDontHave() bool {
	if m != nil {
		return m.SendDontHave
	}
	return false
}

273
type Message_Block struct {
Jakub Sztandera's avatar
Jakub Sztandera committed
274 275
	Prefix []byte `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
	Data   []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
276 277 278 279 280
}

func (m *Message_Block) Reset()         { *m = Message_Block{} }
func (m *Message_Block) String() string { return proto.CompactTextString(m) }
func (*Message_Block) ProtoMessage()    {}
Steven Allen's avatar
Steven Allen committed
281
func (*Message_Block) Descriptor() ([]byte, []int) {
Jakub Sztandera's avatar
Jakub Sztandera committed
282
	return fileDescriptor_33c57e4bae7b9afd, []int{0, 1}
Steven Allen's avatar
Steven Allen committed
283 284 285 286 287 288 289 290 291
}
func (m *Message_Block) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *Message_Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_Message_Block.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
292
		n, err := m.MarshalToSizedBuffer(b)
Steven Allen's avatar
Steven Allen committed
293 294 295 296 297 298
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
Jakub Sztandera's avatar
Jakub Sztandera committed
299 300
func (m *Message_Block) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Message_Block.Merge(m, src)
Steven Allen's avatar
Steven Allen committed
301 302 303 304 305 306 307 308 309
}
func (m *Message_Block) XXX_Size() int {
	return m.Size()
}
func (m *Message_Block) XXX_DiscardUnknown() {
	xxx_messageInfo_Message_Block.DiscardUnknown(m)
}

var xxx_messageInfo_Message_Block proto.InternalMessageInfo
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324

func (m *Message_Block) GetPrefix() []byte {
	if m != nil {
		return m.Prefix
	}
	return nil
}

func (m *Message_Block) GetData() []byte {
	if m != nil {
		return m.Data
	}
	return nil
}

dirkmc's avatar
dirkmc committed
325
type Message_BlockPresence struct {
Steven Allen's avatar
Steven Allen committed
326
	Cid  Cid                       `protobuf:"bytes,1,opt,name=cid,proto3,customtype=Cid" json:"cid"`
dirkmc's avatar
dirkmc committed
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369
	Type Message_BlockPresenceType `protobuf:"varint,2,opt,name=type,proto3,enum=bitswap.message.pb.Message_BlockPresenceType" json:"type,omitempty"`
}

func (m *Message_BlockPresence) Reset()         { *m = Message_BlockPresence{} }
func (m *Message_BlockPresence) String() string { return proto.CompactTextString(m) }
func (*Message_BlockPresence) ProtoMessage()    {}
func (*Message_BlockPresence) Descriptor() ([]byte, []int) {
	return fileDescriptor_33c57e4bae7b9afd, []int{0, 2}
}
func (m *Message_BlockPresence) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *Message_BlockPresence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_Message_BlockPresence.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *Message_BlockPresence) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Message_BlockPresence.Merge(m, src)
}
func (m *Message_BlockPresence) XXX_Size() int {
	return m.Size()
}
func (m *Message_BlockPresence) XXX_DiscardUnknown() {
	xxx_messageInfo_Message_BlockPresence.DiscardUnknown(m)
}

var xxx_messageInfo_Message_BlockPresence proto.InternalMessageInfo

func (m *Message_BlockPresence) GetType() Message_BlockPresenceType {
	if m != nil {
		return m.Type
	}
	return Message_Have
}

370
func init() {
dirkmc's avatar
dirkmc committed
371 372
	proto.RegisterEnum("bitswap.message.pb.Message_BlockPresenceType", Message_BlockPresenceType_name, Message_BlockPresenceType_value)
	proto.RegisterEnum("bitswap.message.pb.Message_Wantlist_WantType", Message_Wantlist_WantType_name, Message_Wantlist_WantType_value)
373 374 375 376
	proto.RegisterType((*Message)(nil), "bitswap.message.pb.Message")
	proto.RegisterType((*Message_Wantlist)(nil), "bitswap.message.pb.Message.Wantlist")
	proto.RegisterType((*Message_Wantlist_Entry)(nil), "bitswap.message.pb.Message.Wantlist.Entry")
	proto.RegisterType((*Message_Block)(nil), "bitswap.message.pb.Message.Block")
dirkmc's avatar
dirkmc committed
377
	proto.RegisterType((*Message_BlockPresence)(nil), "bitswap.message.pb.Message.BlockPresence")
378
}
Jakub Sztandera's avatar
Jakub Sztandera committed
379 380 381 382

func init() { proto.RegisterFile("message.proto", fileDescriptor_33c57e4bae7b9afd) }

var fileDescriptor_33c57e4bae7b9afd = []byte{
Steven Allen's avatar
Steven Allen committed
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415
	// 497 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xdf, 0x8a, 0xd3, 0x40,
	0x14, 0xc6, 0x33, 0x4d, 0xd2, 0xc6, 0xd3, 0xee, 0x52, 0xe7, 0x42, 0x42, 0xc0, 0x34, 0x5b, 0xbc,
	0x88, 0xca, 0x66, 0xa1, 0xfb, 0x04, 0x5b, 0xff, 0xa0, 0x82, 0x20, 0x83, 0xd0, 0xeb, 0xfc, 0x99,
	0xd6, 0xc1, 0x6c, 0x12, 0x33, 0x53, 0xd7, 0xbe, 0x85, 0x8f, 0xb5, 0x37, 0xc2, 0x5e, 0x8a, 0xca,
	0x22, 0xed, 0x8b, 0x48, 0x4e, 0xa6, 0x85, 0xba, 0xe2, 0xee, 0xdd, 0x9c, 0x33, 0xe7, 0xfb, 0x65,
	0xbe, 0xef, 0x10, 0x38, 0x38, 0xe7, 0x52, 0xc6, 0x0b, 0x1e, 0x55, 0x75, 0xa9, 0x4a, 0x4a, 0x13,
	0xa1, 0xe4, 0x45, 0x5c, 0x45, 0xbb, 0x76, 0xe2, 0x1d, 0x2f, 0x84, 0xfa, 0xb0, 0x4c, 0xa2, 0xb4,
	0x3c, 0x3f, 0x59, 0x94, 0x8b, 0xf2, 0x04, 0x47, 0x93, 0xe5, 0x1c, 0x2b, 0x2c, 0xf0, 0xd4, 0x22,
	0xc6, 0xbf, 0xba, 0xd0, 0x7b, 0xdb, 0xaa, 0xe9, 0x4b, 0x70, 0x2e, 0xe2, 0x42, 0xe5, 0x42, 0x2a,
	0x97, 0x04, 0x24, 0xec, 0x4f, 0x1e, 0x45, 0x37, 0xbf, 0x10, 0xe9, 0xf1, 0x68, 0xa6, 0x67, 0xa7,
	0xd6, 0xe5, 0xf5, 0xc8, 0x60, 0x3b, 0x2d, 0x7d, 0x00, 0xdd, 0x24, 0x2f, 0xd3, 0x8f, 0xd2, 0xed,
	0x04, 0x66, 0x38, 0x60, 0xba, 0xa2, 0x67, 0xd0, 0xab, 0xe2, 0x55, 0x5e, 0xc6, 0x99, 0x6b, 0x06,
	0x66, 0xd8, 0x9f, 0x1c, 0xfd, 0x0f, 0x3f, 0x6d, 0x44, 0x9a, 0xbd, 0xd5, 0xd1, 0x19, 0x1c, 0x22,
	0xec, 0x5d, 0xcd, 0x25, 0x2f, 0x52, 0x2e, 0x5d, 0x0b, 0x49, 0x8f, 0x6f, 0x25, 0x6d, 0x15, 0x9a,
	0xf8, 0x17, 0x86, 0x8e, 0x61, 0x50, 0xf1, 0x22, 0x13, 0xc5, 0x62, 0xba, 0x52, 0x5c, 0xba, 0x76,
	0x40, 0x42, 0x9b, 0xed, 0xf5, 0xbc, 0x9f, 0x1d, 0x70, 0xb6, 0xa6, 0xe9, 0x1b, 0xe8, 0xf1, 0x42,
	0xd5, 0x82, 0x4b, 0x97, 0xe0, 0x13, 0x9e, 0xdc, 0x25, 0xab, 0xe8, 0x45, 0xa1, 0xea, 0xd5, 0xd6,
	0x95, 0x06, 0x50, 0x0a, 0xd6, 0x7c, 0x99, 0xe7, 0x6e, 0x27, 0x20, 0xa1, 0xc3, 0xf0, 0xec, 0x7d,
	0x23, 0x60, 0xe3, 0x30, 0x3d, 0x02, 0x1b, 0x1f, 0x8b, 0x3b, 0x19, 0x4c, 0xfb, 0x8d, 0xf6, 0xc7,
	0xf5, 0xc8, 0x7c, 0x26, 0x32, 0xd6, 0xde, 0x50, 0x0f, 0x9c, 0xaa, 0x16, 0x65, 0x2d, 0xd4, 0x0a,
	0x21, 0x36, 0xdb, 0xd5, 0xcd, 0x36, 0xd2, 0xb8, 0x48, 0x79, 0xee, 0x9a, 0x88, 0xd7, 0x15, 0x7d,
	0xdd, 0x6e, 0xfb, 0xfd, 0xaa, 0xe2, 0xae, 0x15, 0x90, 0xf0, 0x70, 0x72, 0x7c, 0x27, 0x07, 0x33,
	0x2d, 0x62, 0x3b, 0x79, 0x13, 0x9e, 0xe4, 0x45, 0xf6, 0xbc, 0x2c, 0xd4, 0xab, 0xf8, 0x33, 0xc7,
	0xf0, 0x1c, 0xb6, 0xd7, 0x1b, 0x8f, 0xda, 0xec, 0x70, 0xfe, 0x1e, 0xd8, 0xb8, 0x93, 0xa1, 0x41,
	0x1d, 0xb0, 0x9a, 0xeb, 0x21, 0xf1, 0x4e, 0x75, 0xb3, 0x79, 0x70, 0x55, 0xf3, 0xb9, 0xf8, 0xd2,
	0x1a, 0x66, 0xba, 0x6a, 0x52, 0xca, 0x62, 0x15, 0xa3, 0xc1, 0x01, 0xc3, 0xb3, 0xf7, 0x09, 0x0e,
	0xf6, 0xb6, 0x4b, 0x1f, 0x82, 0x99, 0x8a, 0xec, 0x5f, 0x51, 0x35, 0x7d, 0x7a, 0x06, 0x96, 0x6a,
	0x0c, 0x77, 0x6e, 0x37, 0xbc, 0xc7, 0x45, 0xc3, 0x28, 0x1d, 0x3f, 0x85, 0xfb, 0x37, 0xae, 0x76,
	0x36, 0x0c, 0x3a, 0x00, 0x67, 0xeb, 0x79, 0x48, 0xa6, 0xee, 0xe5, 0xda, 0x27, 0x57, 0x6b, 0x9f,
	0xfc, 0x5e, 0xfb, 0xe4, 0xeb, 0xc6, 0x37, 0xae, 0x36, 0xbe, 0xf1, 0x7d, 0xe3, 0x1b, 0x49, 0x17,
	0xff, 0xbf, 0xd3, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x8a, 0xaf, 0x83, 0xd3, 0x03, 0x00,
	0x00,
Jakub Sztandera's avatar
Jakub Sztandera committed
416 417
}

Steven Allen's avatar
Steven Allen committed
418 419 420
func (m *Message) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
421
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
Steven Allen's avatar
Steven Allen committed
422 423 424 425 426 427 428
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *Message) MarshalTo(dAtA []byte) (int, error) {
429 430 431 432 433 434
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
Steven Allen's avatar
Steven Allen committed
435 436 437
	_ = i
	var l int
	_ = l
dirkmc's avatar
dirkmc committed
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456
	if m.PendingBytes != 0 {
		i = encodeVarintMessage(dAtA, i, uint64(m.PendingBytes))
		i--
		dAtA[i] = 0x28
	}
	if len(m.BlockPresences) > 0 {
		for iNdEx := len(m.BlockPresences) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.BlockPresences[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintMessage(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x22
		}
	}
457 458 459 460 461 462 463 464 465 466 467 468 469
	if len(m.Payload) > 0 {
		for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintMessage(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x1a
		}
Steven Allen's avatar
Steven Allen committed
470 471
	}
	if len(m.Blocks) > 0 {
472 473 474 475 476
		for iNdEx := len(m.Blocks) - 1; iNdEx >= 0; iNdEx-- {
			i -= len(m.Blocks[iNdEx])
			copy(dAtA[i:], m.Blocks[iNdEx])
			i = encodeVarintMessage(dAtA, i, uint64(len(m.Blocks[iNdEx])))
			i--
Steven Allen's avatar
Steven Allen committed
477 478 479
			dAtA[i] = 0x12
		}
	}
480 481 482 483
	{
		size, err := m.Wantlist.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
Steven Allen's avatar
Steven Allen committed
484
		}
485 486
		i -= size
		i = encodeVarintMessage(dAtA, i, uint64(size))
Steven Allen's avatar
Steven Allen committed
487
	}
488 489 490
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
Steven Allen's avatar
Steven Allen committed
491 492 493 494 495
}

func (m *Message_Wantlist) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
496
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
Steven Allen's avatar
Steven Allen committed
497 498 499 500 501 502 503
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *Message_Wantlist) MarshalTo(dAtA []byte) (int, error) {
504 505 506 507 508 509
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *Message_Wantlist) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
Steven Allen's avatar
Steven Allen committed
510 511 512 513
	_ = i
	var l int
	_ = l
	if m.Full {
514
		i--
Steven Allen's avatar
Steven Allen committed
515 516 517 518 519
		if m.Full {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535
		i--
		dAtA[i] = 0x10
	}
	if len(m.Entries) > 0 {
		for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintMessage(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0xa
		}
Steven Allen's avatar
Steven Allen committed
536
	}
537
	return len(dAtA) - i, nil
Steven Allen's avatar
Steven Allen committed
538 539 540 541 542
}

func (m *Message_Wantlist_Entry) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
543
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
Steven Allen's avatar
Steven Allen committed
544 545 546 547 548 549 550
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *Message_Wantlist_Entry) MarshalTo(dAtA []byte) (int, error) {
551 552 553 554 555 556
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *Message_Wantlist_Entry) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
Steven Allen's avatar
Steven Allen committed
557 558 559
	_ = i
	var l int
	_ = l
dirkmc's avatar
dirkmc committed
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574
	if m.SendDontHave {
		i--
		if m.SendDontHave {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i--
		dAtA[i] = 0x28
	}
	if m.WantType != 0 {
		i = encodeVarintMessage(dAtA, i, uint64(m.WantType))
		i--
		dAtA[i] = 0x20
	}
Steven Allen's avatar
Steven Allen committed
575
	if m.Cancel {
576
		i--
Steven Allen's avatar
Steven Allen committed
577 578 579 580 581
		if m.Cancel {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
582 583 584 585 586 587 588 589
		i--
		dAtA[i] = 0x18
	}
	if m.Priority != 0 {
		i = encodeVarintMessage(dAtA, i, uint64(m.Priority))
		i--
		dAtA[i] = 0x10
	}
Steven Allen's avatar
Steven Allen committed
590 591 592 593 594 595 596
	{
		size := m.Block.Size()
		i -= size
		if _, err := m.Block.MarshalTo(dAtA[i:]); err != nil {
			return 0, err
		}
		i = encodeVarintMessage(dAtA, i, uint64(size))
Steven Allen's avatar
Steven Allen committed
597
	}
Steven Allen's avatar
Steven Allen committed
598 599
	i--
	dAtA[i] = 0xa
600
	return len(dAtA) - i, nil
Steven Allen's avatar
Steven Allen committed
601 602 603 604 605
}

func (m *Message_Block) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
606
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
Steven Allen's avatar
Steven Allen committed
607 608 609 610 611 612 613
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *Message_Block) MarshalTo(dAtA []byte) (int, error) {
614 615 616 617 618 619
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *Message_Block) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
Steven Allen's avatar
Steven Allen committed
620 621 622 623
	_ = i
	var l int
	_ = l
	if len(m.Data) > 0 {
624 625
		i -= len(m.Data)
		copy(dAtA[i:], m.Data)
Steven Allen's avatar
Steven Allen committed
626
		i = encodeVarintMessage(dAtA, i, uint64(len(m.Data)))
627 628 629 630 631 632 633 634 635
		i--
		dAtA[i] = 0x12
	}
	if len(m.Prefix) > 0 {
		i -= len(m.Prefix)
		copy(dAtA[i:], m.Prefix)
		i = encodeVarintMessage(dAtA, i, uint64(len(m.Prefix)))
		i--
		dAtA[i] = 0xa
Steven Allen's avatar
Steven Allen committed
636
	}
637
	return len(dAtA) - i, nil
Steven Allen's avatar
Steven Allen committed
638 639
}

dirkmc's avatar
dirkmc committed
640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664
func (m *Message_BlockPresence) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *Message_BlockPresence) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *Message_BlockPresence) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Type != 0 {
		i = encodeVarintMessage(dAtA, i, uint64(m.Type))
		i--
		dAtA[i] = 0x10
	}
Steven Allen's avatar
Steven Allen committed
665 666 667 668 669 670 671
	{
		size := m.Cid.Size()
		i -= size
		if _, err := m.Cid.MarshalTo(dAtA[i:]); err != nil {
			return 0, err
		}
		i = encodeVarintMessage(dAtA, i, uint64(size))
dirkmc's avatar
dirkmc committed
672
	}
Steven Allen's avatar
Steven Allen committed
673 674
	i--
	dAtA[i] = 0xa
dirkmc's avatar
dirkmc committed
675 676 677
	return len(dAtA) - i, nil
}

Steven Allen's avatar
Steven Allen committed
678
func encodeVarintMessage(dAtA []byte, offset int, v uint64) int {
679 680
	offset -= sovMessage(v)
	base := offset
Steven Allen's avatar
Steven Allen committed
681 682 683 684 685 686
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
687
	return base
Steven Allen's avatar
Steven Allen committed
688 689
}
func (m *Message) Size() (n int) {
Jakub Sztandera's avatar
Jakub Sztandera committed
690 691 692
	if m == nil {
		return 0
	}
Steven Allen's avatar
Steven Allen committed
693 694
	var l int
	_ = l
Steven Allen's avatar
Steven Allen committed
695 696
	l = m.Wantlist.Size()
	n += 1 + l + sovMessage(uint64(l))
Steven Allen's avatar
Steven Allen committed
697 698 699 700 701 702 703 704 705 706 707 708
	if len(m.Blocks) > 0 {
		for _, b := range m.Blocks {
			l = len(b)
			n += 1 + l + sovMessage(uint64(l))
		}
	}
	if len(m.Payload) > 0 {
		for _, e := range m.Payload {
			l = e.Size()
			n += 1 + l + sovMessage(uint64(l))
		}
	}
dirkmc's avatar
dirkmc committed
709 710 711 712 713 714 715 716 717
	if len(m.BlockPresences) > 0 {
		for _, e := range m.BlockPresences {
			l = e.Size()
			n += 1 + l + sovMessage(uint64(l))
		}
	}
	if m.PendingBytes != 0 {
		n += 1 + sovMessage(uint64(m.PendingBytes))
	}
Steven Allen's avatar
Steven Allen committed
718 719 720 721
	return n
}

func (m *Message_Wantlist) Size() (n int) {
Jakub Sztandera's avatar
Jakub Sztandera committed
722 723 724
	if m == nil {
		return 0
	}
Steven Allen's avatar
Steven Allen committed
725 726 727 728 729 730 731 732 733 734 735 736 737 738 739
	var l int
	_ = l
	if len(m.Entries) > 0 {
		for _, e := range m.Entries {
			l = e.Size()
			n += 1 + l + sovMessage(uint64(l))
		}
	}
	if m.Full {
		n += 2
	}
	return n
}

func (m *Message_Wantlist_Entry) Size() (n int) {
Jakub Sztandera's avatar
Jakub Sztandera committed
740 741 742
	if m == nil {
		return 0
	}
Steven Allen's avatar
Steven Allen committed
743 744
	var l int
	_ = l
Steven Allen's avatar
Steven Allen committed
745 746
	l = m.Block.Size()
	n += 1 + l + sovMessage(uint64(l))
Steven Allen's avatar
Steven Allen committed
747 748 749 750 751 752
	if m.Priority != 0 {
		n += 1 + sovMessage(uint64(m.Priority))
	}
	if m.Cancel {
		n += 2
	}
dirkmc's avatar
dirkmc committed
753 754 755 756 757 758
	if m.WantType != 0 {
		n += 1 + sovMessage(uint64(m.WantType))
	}
	if m.SendDontHave {
		n += 2
	}
Steven Allen's avatar
Steven Allen committed
759 760 761 762
	return n
}

func (m *Message_Block) Size() (n int) {
Jakub Sztandera's avatar
Jakub Sztandera committed
763 764 765
	if m == nil {
		return 0
	}
Steven Allen's avatar
Steven Allen committed
766 767 768 769 770 771 772 773 774 775 776 777 778
	var l int
	_ = l
	l = len(m.Prefix)
	if l > 0 {
		n += 1 + l + sovMessage(uint64(l))
	}
	l = len(m.Data)
	if l > 0 {
		n += 1 + l + sovMessage(uint64(l))
	}
	return n
}

dirkmc's avatar
dirkmc committed
779 780 781 782 783 784
func (m *Message_BlockPresence) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
Steven Allen's avatar
Steven Allen committed
785 786
	l = m.Cid.Size()
	n += 1 + l + sovMessage(uint64(l))
dirkmc's avatar
dirkmc committed
787 788 789 790 791 792
	if m.Type != 0 {
		n += 1 + sovMessage(uint64(m.Type))
	}
	return n
}

Steven Allen's avatar
Steven Allen committed
793
func sovMessage(x uint64) (n int) {
794
	return (math_bits.Len64(x|1) + 6) / 7
Steven Allen's avatar
Steven Allen committed
795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813
}
func sozMessage(x uint64) (n int) {
	return sovMessage(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Message) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowMessage
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
Jakub Sztandera's avatar
Jakub Sztandera committed
814
			wire |= uint64(b&0x7F) << shift
Steven Allen's avatar
Steven Allen committed
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: Message: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Wantlist", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
Jakub Sztandera's avatar
Jakub Sztandera committed
842
				msglen |= int(b&0x7F) << shift
Steven Allen's avatar
Steven Allen committed
843 844 845 846 847 848 849 850
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMessage
			}
			postIndex := iNdEx + msglen
Jakub Sztandera's avatar
Jakub Sztandera committed
851 852 853
			if postIndex < 0 {
				return ErrInvalidLengthMessage
			}
Steven Allen's avatar
Steven Allen committed
854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Wantlist.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Blocks", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
Jakub Sztandera's avatar
Jakub Sztandera committed
875
				byteLen |= int(b&0x7F) << shift
Steven Allen's avatar
Steven Allen committed
876 877 878 879 880 881 882 883
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthMessage
			}
			postIndex := iNdEx + byteLen
Jakub Sztandera's avatar
Jakub Sztandera committed
884 885 886
			if postIndex < 0 {
				return ErrInvalidLengthMessage
			}
Steven Allen's avatar
Steven Allen committed
887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Blocks = append(m.Blocks, make([]byte, postIndex-iNdEx))
			copy(m.Blocks[len(m.Blocks)-1], dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
Jakub Sztandera's avatar
Jakub Sztandera committed
907
				msglen |= int(b&0x7F) << shift
Steven Allen's avatar
Steven Allen committed
908 909 910 911 912 913 914 915
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMessage
			}
			postIndex := iNdEx + msglen
Jakub Sztandera's avatar
Jakub Sztandera committed
916 917 918
			if postIndex < 0 {
				return ErrInvalidLengthMessage
			}
Steven Allen's avatar
Steven Allen committed
919 920 921
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
Steven Allen's avatar
Steven Allen committed
922
			m.Payload = append(m.Payload, Message_Block{})
Steven Allen's avatar
Steven Allen committed
923 924 925 926
			if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
dirkmc's avatar
dirkmc committed
927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field BlockPresences", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMessage
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMessage
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.BlockPresences = append(m.BlockPresences, Message_BlockPresence{})
			if err := m.BlockPresences[len(m.BlockPresences)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 5:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field PendingBytes", wireType)
			}
			m.PendingBytes = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.PendingBytes |= int32(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
Steven Allen's avatar
Steven Allen committed
980 981 982 983 984 985 986 987 988
		default:
			iNdEx = preIndex
			skippy, err := skipMessage(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthMessage
			}
Jakub Sztandera's avatar
Jakub Sztandera committed
989 990 991
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthMessage
			}
Steven Allen's avatar
Steven Allen committed
992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *Message_Wantlist) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowMessage
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
Jakub Sztandera's avatar
Jakub Sztandera committed
1019
			wire |= uint64(b&0x7F) << shift
Steven Allen's avatar
Steven Allen committed
1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: Wantlist: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Wantlist: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
Jakub Sztandera's avatar
Jakub Sztandera committed
1047
				msglen |= int(b&0x7F) << shift
Steven Allen's avatar
Steven Allen committed
1048 1049 1050 1051 1052 1053 1054 1055
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMessage
			}
			postIndex := iNdEx + msglen
Jakub Sztandera's avatar
Jakub Sztandera committed
1056 1057 1058
			if postIndex < 0 {
				return ErrInvalidLengthMessage
			}
Steven Allen's avatar
Steven Allen committed
1059 1060 1061
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
Steven Allen's avatar
Steven Allen committed
1062
			m.Entries = append(m.Entries, Message_Wantlist_Entry{})
Steven Allen's avatar
Steven Allen committed
1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080
			if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Full", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
Jakub Sztandera's avatar
Jakub Sztandera committed
1081
				v |= int(b&0x7F) << shift
Steven Allen's avatar
Steven Allen committed
1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095
				if b < 0x80 {
					break
				}
			}
			m.Full = bool(v != 0)
		default:
			iNdEx = preIndex
			skippy, err := skipMessage(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthMessage
			}
Jakub Sztandera's avatar
Jakub Sztandera committed
1096 1097 1098
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthMessage
			}
Steven Allen's avatar
Steven Allen committed
1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *Message_Wantlist_Entry) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowMessage
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
Jakub Sztandera's avatar
Jakub Sztandera committed
1126
			wire |= uint64(b&0x7F) << shift
Steven Allen's avatar
Steven Allen committed
1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: Entry: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
Jakub Sztandera's avatar
Jakub Sztandera committed
1154
				byteLen |= int(b&0x7F) << shift
Steven Allen's avatar
Steven Allen committed
1155 1156 1157 1158 1159 1160 1161 1162
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthMessage
			}
			postIndex := iNdEx + byteLen
Jakub Sztandera's avatar
Jakub Sztandera committed
1163 1164 1165
			if postIndex < 0 {
				return ErrInvalidLengthMessage
			}
Steven Allen's avatar
Steven Allen committed
1166 1167 1168
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
Steven Allen's avatar
Steven Allen committed
1169 1170
			if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
Steven Allen's avatar
Steven Allen committed
1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186
			}
			iNdEx = postIndex
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType)
			}
			m.Priority = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
Jakub Sztandera's avatar
Jakub Sztandera committed
1187
				m.Priority |= int32(b&0x7F) << shift
Steven Allen's avatar
Steven Allen committed
1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Cancel", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
Jakub Sztandera's avatar
Jakub Sztandera committed
1206
				v |= int(b&0x7F) << shift
Steven Allen's avatar
Steven Allen committed
1207 1208 1209 1210 1211
				if b < 0x80 {
					break
				}
			}
			m.Cancel = bool(v != 0)
dirkmc's avatar
dirkmc committed
1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250
		case 4:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field WantType", wireType)
			}
			m.WantType = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.WantType |= Message_Wantlist_WantType(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 5:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field SendDontHave", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.SendDontHave = bool(v != 0)
Steven Allen's avatar
Steven Allen committed
1251 1252 1253 1254 1255 1256 1257 1258 1259
		default:
			iNdEx = preIndex
			skippy, err := skipMessage(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthMessage
			}
Jakub Sztandera's avatar
Jakub Sztandera committed
1260 1261 1262
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthMessage
			}
Steven Allen's avatar
Steven Allen committed
1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *Message_Block) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowMessage
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
Jakub Sztandera's avatar
Jakub Sztandera committed
1290
			wire |= uint64(b&0x7F) << shift
Steven Allen's avatar
Steven Allen committed
1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: Block: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Block: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
Jakub Sztandera's avatar
Jakub Sztandera committed
1318
				byteLen |= int(b&0x7F) << shift
Steven Allen's avatar
Steven Allen committed
1319 1320 1321 1322 1323 1324 1325 1326
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthMessage
			}
			postIndex := iNdEx + byteLen
Jakub Sztandera's avatar
Jakub Sztandera committed
1327 1328 1329
			if postIndex < 0 {
				return ErrInvalidLengthMessage
			}
Steven Allen's avatar
Steven Allen committed
1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Prefix = append(m.Prefix[:0], dAtA[iNdEx:postIndex]...)
			if m.Prefix == nil {
				m.Prefix = []byte{}
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
Jakub Sztandera's avatar
Jakub Sztandera committed
1352
				byteLen |= int(b&0x7F) << shift
Steven Allen's avatar
Steven Allen committed
1353 1354 1355 1356 1357 1358 1359 1360
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthMessage
			}
			postIndex := iNdEx + byteLen
Jakub Sztandera's avatar
Jakub Sztandera committed
1361 1362 1363
			if postIndex < 0 {
				return ErrInvalidLengthMessage
			}
Steven Allen's avatar
Steven Allen committed
1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
			if m.Data == nil {
				m.Data = []byte{}
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipMessage(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthMessage
			}
Jakub Sztandera's avatar
Jakub Sztandera committed
1381 1382 1383
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthMessage
			}
Steven Allen's avatar
Steven Allen committed
1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
dirkmc's avatar
dirkmc committed
1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453
func (m *Message_BlockPresence) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowMessage
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: BlockPresence: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: BlockPresence: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthMessage
			}
			postIndex := iNdEx + byteLen
			if postIndex < 0 {
				return ErrInvalidLengthMessage
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
Steven Allen's avatar
Steven Allen committed
1454 1455
			if err := m.Cid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
dirkmc's avatar
dirkmc committed
1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500
			}
			iNdEx = postIndex
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
			}
			m.Type = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Type |= Message_BlockPresenceType(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipMessage(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthMessage
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthMessage
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
Steven Allen's avatar
Steven Allen committed
1501 1502 1503
func skipMessage(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
Steven Allen's avatar
Steven Allen committed
1504
	depth := 0
Steven Allen's avatar
Steven Allen committed
1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowMessage
			}
			if iNdEx >= l {
				return 0, io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		wireType := int(wire & 0x7)
		switch wireType {
		case 0:
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				iNdEx++
				if dAtA[iNdEx-1] < 0x80 {
					break
				}
			}
		case 1:
			iNdEx += 8
		case 2:
			var length int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowMessage
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if length < 0 {
				return 0, ErrInvalidLengthMessage
			}
Jakub Sztandera's avatar
Jakub Sztandera committed
1557
			iNdEx += length
Steven Allen's avatar
Steven Allen committed
1558
		case 3:
Steven Allen's avatar
Steven Allen committed
1559
			depth++
dirkmc's avatar
dirkmc committed
1560
		case 4:
Steven Allen's avatar
Steven Allen committed
1561 1562 1563 1564
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupMessage
			}
			depth--
Steven Allen's avatar
Steven Allen committed
1565 1566 1567 1568 1569
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
Steven Allen's avatar
Steven Allen committed
1570 1571 1572 1573 1574 1575
		if iNdEx < 0 {
			return 0, ErrInvalidLengthMessage
		}
		if depth == 0 {
			return iNdEx, nil
		}
Steven Allen's avatar
Steven Allen committed
1576
	}
Steven Allen's avatar
Steven Allen committed
1577
	return 0, io.ErrUnexpectedEOF
Steven Allen's avatar
Steven Allen committed
1578 1579 1580
}

var (
Steven Allen's avatar
Steven Allen committed
1581 1582 1583
	ErrInvalidLengthMessage        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMessage          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMessage = fmt.Errorf("proto: unexpected end of group")
Steven Allen's avatar
Steven Allen committed
1584
)