// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: base/types/gfspserver/p2p.proto

package gfspserver

import (
	context "context"
	fmt "fmt"
	gfsperrors "github.com/bnb-chain/greenfield-storage-provider/base/types/gfsperrors"
	gfsptask "github.com/bnb-chain/greenfield-storage-provider/base/types/gfsptask"
	grpc1 "github.com/cosmos/gogoproto/grpc"
	proto "github.com/cosmos/gogoproto/proto"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	io "io"
	math "math"
	math_bits "math/bits"
)

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

// 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.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package

type GfSpQueryP2PNodeRequest struct {
}

func (m *GfSpQueryP2PNodeRequest) Reset()         { *m = GfSpQueryP2PNodeRequest{} }
func (m *GfSpQueryP2PNodeRequest) String() string { return proto.CompactTextString(m) }
func (*GfSpQueryP2PNodeRequest) ProtoMessage()    {}
func (*GfSpQueryP2PNodeRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_8d868eb9144aa2df, []int{0}
}
func (m *GfSpQueryP2PNodeRequest) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *GfSpQueryP2PNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_GfSpQueryP2PNodeRequest.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 *GfSpQueryP2PNodeRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GfSpQueryP2PNodeRequest.Merge(m, src)
}
func (m *GfSpQueryP2PNodeRequest) XXX_Size() int {
	return m.Size()
}
func (m *GfSpQueryP2PNodeRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GfSpQueryP2PNodeRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GfSpQueryP2PNodeRequest proto.InternalMessageInfo

type GfSpQueryP2PNodeResponse struct {
	Err   *gfsperrors.GfSpError `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"`
	Nodes []string              `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"`
}

func (m *GfSpQueryP2PNodeResponse) Reset()         { *m = GfSpQueryP2PNodeResponse{} }
func (m *GfSpQueryP2PNodeResponse) String() string { return proto.CompactTextString(m) }
func (*GfSpQueryP2PNodeResponse) ProtoMessage()    {}
func (*GfSpQueryP2PNodeResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_8d868eb9144aa2df, []int{1}
}
func (m *GfSpQueryP2PNodeResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *GfSpQueryP2PNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_GfSpQueryP2PNodeResponse.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 *GfSpQueryP2PNodeResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GfSpQueryP2PNodeResponse.Merge(m, src)
}
func (m *GfSpQueryP2PNodeResponse) XXX_Size() int {
	return m.Size()
}
func (m *GfSpQueryP2PNodeResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GfSpQueryP2PNodeResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GfSpQueryP2PNodeResponse proto.InternalMessageInfo

func (m *GfSpQueryP2PNodeResponse) GetErr() *gfsperrors.GfSpError {
	if m != nil {
		return m.Err
	}
	return nil
}

func (m *GfSpQueryP2PNodeResponse) GetNodes() []string {
	if m != nil {
		return m.Nodes
	}
	return nil
}

type GfSpAskSecondaryReplicatePieceApprovalRequest struct {
	ReplicatePieceApprovalTask *gfsptask.GfSpReplicatePieceApprovalTask `protobuf:"bytes,1,opt,name=replicate_piece_approval_task,json=replicatePieceApprovalTask,proto3" json:"replicate_piece_approval_task,omitempty"`
	Min                        int32                                    `protobuf:"varint,2,opt,name=min,proto3" json:"min,omitempty"`
	Max                        int32                                    `protobuf:"varint,3,opt,name=max,proto3" json:"max,omitempty"`
	Timeout                    int64                                    `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"`
}

func (m *GfSpAskSecondaryReplicatePieceApprovalRequest) Reset() {
	*m = GfSpAskSecondaryReplicatePieceApprovalRequest{}
}
func (m *GfSpAskSecondaryReplicatePieceApprovalRequest) String() string {
	return proto.CompactTextString(m)
}
func (*GfSpAskSecondaryReplicatePieceApprovalRequest) ProtoMessage() {}
func (*GfSpAskSecondaryReplicatePieceApprovalRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_8d868eb9144aa2df, []int{2}
}
func (m *GfSpAskSecondaryReplicatePieceApprovalRequest) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *GfSpAskSecondaryReplicatePieceApprovalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_GfSpAskSecondaryReplicatePieceApprovalRequest.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 *GfSpAskSecondaryReplicatePieceApprovalRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GfSpAskSecondaryReplicatePieceApprovalRequest.Merge(m, src)
}
func (m *GfSpAskSecondaryReplicatePieceApprovalRequest) XXX_Size() int {
	return m.Size()
}
func (m *GfSpAskSecondaryReplicatePieceApprovalRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GfSpAskSecondaryReplicatePieceApprovalRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GfSpAskSecondaryReplicatePieceApprovalRequest proto.InternalMessageInfo

func (m *GfSpAskSecondaryReplicatePieceApprovalRequest) GetReplicatePieceApprovalTask() *gfsptask.GfSpReplicatePieceApprovalTask {
	if m != nil {
		return m.ReplicatePieceApprovalTask
	}
	return nil
}

func (m *GfSpAskSecondaryReplicatePieceApprovalRequest) GetMin() int32 {
	if m != nil {
		return m.Min
	}
	return 0
}

func (m *GfSpAskSecondaryReplicatePieceApprovalRequest) GetMax() int32 {
	if m != nil {
		return m.Max
	}
	return 0
}

func (m *GfSpAskSecondaryReplicatePieceApprovalRequest) GetTimeout() int64 {
	if m != nil {
		return m.Timeout
	}
	return 0
}

type GfSpAskSecondaryReplicatePieceApprovalResponse struct {
	Err           *gfsperrors.GfSpError                      `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"`
	ApprovedTasks []*gfsptask.GfSpReplicatePieceApprovalTask `protobuf:"bytes,2,rep,name=approved_tasks,json=approvedTasks,proto3" json:"approved_tasks,omitempty"`
}

func (m *GfSpAskSecondaryReplicatePieceApprovalResponse) Reset() {
	*m = GfSpAskSecondaryReplicatePieceApprovalResponse{}
}
func (m *GfSpAskSecondaryReplicatePieceApprovalResponse) String() string {
	return proto.CompactTextString(m)
}
func (*GfSpAskSecondaryReplicatePieceApprovalResponse) ProtoMessage() {}
func (*GfSpAskSecondaryReplicatePieceApprovalResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_8d868eb9144aa2df, []int{3}
}
func (m *GfSpAskSecondaryReplicatePieceApprovalResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *GfSpAskSecondaryReplicatePieceApprovalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_GfSpAskSecondaryReplicatePieceApprovalResponse.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 *GfSpAskSecondaryReplicatePieceApprovalResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GfSpAskSecondaryReplicatePieceApprovalResponse.Merge(m, src)
}
func (m *GfSpAskSecondaryReplicatePieceApprovalResponse) XXX_Size() int {
	return m.Size()
}
func (m *GfSpAskSecondaryReplicatePieceApprovalResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GfSpAskSecondaryReplicatePieceApprovalResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GfSpAskSecondaryReplicatePieceApprovalResponse proto.InternalMessageInfo

func (m *GfSpAskSecondaryReplicatePieceApprovalResponse) GetErr() *gfsperrors.GfSpError {
	if m != nil {
		return m.Err
	}
	return nil
}

func (m *GfSpAskSecondaryReplicatePieceApprovalResponse) GetApprovedTasks() []*gfsptask.GfSpReplicatePieceApprovalTask {
	if m != nil {
		return m.ApprovedTasks
	}
	return nil
}

func init() {
	proto.RegisterType((*GfSpQueryP2PNodeRequest)(nil), "base.types.gfspserver.GfSpQueryP2PNodeRequest")
	proto.RegisterType((*GfSpQueryP2PNodeResponse)(nil), "base.types.gfspserver.GfSpQueryP2PNodeResponse")
	proto.RegisterType((*GfSpAskSecondaryReplicatePieceApprovalRequest)(nil), "base.types.gfspserver.GfSpAskSecondaryReplicatePieceApprovalRequest")
	proto.RegisterType((*GfSpAskSecondaryReplicatePieceApprovalResponse)(nil), "base.types.gfspserver.GfSpAskSecondaryReplicatePieceApprovalResponse")
}

func init() { proto.RegisterFile("base/types/gfspserver/p2p.proto", fileDescriptor_8d868eb9144aa2df) }

var fileDescriptor_8d868eb9144aa2df = []byte{
	// 470 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xcd, 0x8e, 0xd3, 0x30,
	0x10, 0xc7, 0xeb, 0x96, 0x05, 0x61, 0xc4, 0x0a, 0x59, 0xac, 0x08, 0x91, 0x08, 0x21, 0x07, 0xd4,
	0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 0x0c,
	0xc8, 0xc7, 0x55, 0xd0, 0xba, 0x5a, 0x05, 0xad, 0x6f, 0xab, 0xa0, 0x75, 0xfe, 0x72, 0x24, 0xed,
	0xc5, 0x2c, 0xe7, 0x85, 0x9a, 0xc6, 0x79, 0x95, 0xf7, 0x8a, 0x0b, 0x21, 0xab, 0x78, 0x84, 0x00,
	0xd5, 0x50, 0xc2, 0xa4, 0xec, 0x19, 0xab, 0x50, 0x8c, 0xa0, 0xe7, 0xe6, 0x91, 0x25, 0x60, 0xbc,
	0xf3, 0xd7, 0x91, 0xdf, 0xae, 0x6f, 0xf7, 0xf1, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x41, 0x82,
	0xc7, 0x2a, 0x5a, 0x04, 0x00, 0x00,
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// GfSpP2PServiceClient is the client API for GfSpP2PService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type GfSpP2PServiceClient interface {
	GfSpAskSecondaryReplicatePieceApproval(ctx context.Context, in *GfSpAskSecondaryReplicatePieceApprovalRequest, opts ...grpc.CallOption) (*GfSpAskSecondaryReplicatePieceApprovalResponse, error)
	GfSpQueryP2PBootstrap(ctx context.Context, in *GfSpQueryP2PNodeRequest, opts ...grpc.CallOption) (*GfSpQueryP2PNodeResponse, error)
}

type gfSpP2PServiceClient struct {
	cc grpc1.ClientConn
}

func NewGfSpP2PServiceClient(cc grpc1.ClientConn) GfSpP2PServiceClient {
	return &gfSpP2PServiceClient{cc}
}

func (c *gfSpP2PServiceClient) GfSpAskSecondaryReplicatePieceApproval(ctx context.Context, in *GfSpAskSecondaryReplicatePieceApprovalRequest, opts ...grpc.CallOption) (*GfSpAskSecondaryReplicatePieceApprovalResponse, error) {
	out := new(GfSpAskSecondaryReplicatePieceApprovalResponse)
	err := c.cc.Invoke(ctx, "/base.types.gfspserver.GfSpP2PService/GfSpAskSecondaryReplicatePieceApproval", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *gfSpP2PServiceClient) GfSpQueryP2PBootstrap(ctx context.Context, in *GfSpQueryP2PNodeRequest, opts ...grpc.CallOption) (*GfSpQueryP2PNodeResponse, error) {
	out := new(GfSpQueryP2PNodeResponse)
	err := c.cc.Invoke(ctx, "/base.types.gfspserver.GfSpP2PService/GfSpQueryP2PBootstrap", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// GfSpP2PServiceServer is the server API for GfSpP2PService service.
type GfSpP2PServiceServer interface {
	GfSpAskSecondaryReplicatePieceApproval(context.Context, *GfSpAskSecondaryReplicatePieceApprovalRequest) (*GfSpAskSecondaryReplicatePieceApprovalResponse, error)
	GfSpQueryP2PBootstrap(context.Context, *GfSpQueryP2PNodeRequest) (*GfSpQueryP2PNodeResponse, error)
}

// UnimplementedGfSpP2PServiceServer can be embedded to have forward compatible implementations.
type UnimplementedGfSpP2PServiceServer struct {
}

func (*UnimplementedGfSpP2PServiceServer) GfSpAskSecondaryReplicatePieceApproval(ctx context.Context, req *GfSpAskSecondaryReplicatePieceApprovalRequest) (*GfSpAskSecondaryReplicatePieceApprovalResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GfSpAskSecondaryReplicatePieceApproval not implemented")
}
func (*UnimplementedGfSpP2PServiceServer) GfSpQueryP2PBootstrap(ctx context.Context, req *GfSpQueryP2PNodeRequest) (*GfSpQueryP2PNodeResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GfSpQueryP2PBootstrap not implemented")
}

func RegisterGfSpP2PServiceServer(s grpc1.Server, srv GfSpP2PServiceServer) {
	s.RegisterService(&_GfSpP2PService_serviceDesc, srv)
}

func _GfSpP2PService_GfSpAskSecondaryReplicatePieceApproval_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GfSpAskSecondaryReplicatePieceApprovalRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GfSpP2PServiceServer).GfSpAskSecondaryReplicatePieceApproval(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/base.types.gfspserver.GfSpP2PService/GfSpAskSecondaryReplicatePieceApproval",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GfSpP2PServiceServer).GfSpAskSecondaryReplicatePieceApproval(ctx, req.(*GfSpAskSecondaryReplicatePieceApprovalRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GfSpP2PService_GfSpQueryP2PBootstrap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GfSpQueryP2PNodeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GfSpP2PServiceServer).GfSpQueryP2PBootstrap(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/base.types.gfspserver.GfSpP2PService/GfSpQueryP2PBootstrap",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GfSpP2PServiceServer).GfSpQueryP2PBootstrap(ctx, req.(*GfSpQueryP2PNodeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _GfSpP2PService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "base.types.gfspserver.GfSpP2PService",
	HandlerType: (*GfSpP2PServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GfSpAskSecondaryReplicatePieceApproval",
			Handler:    _GfSpP2PService_GfSpAskSecondaryReplicatePieceApproval_Handler,
		},
		{
			MethodName: "GfSpQueryP2PBootstrap",
			Handler:    _GfSpP2PService_GfSpQueryP2PBootstrap_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "base/types/gfspserver/p2p.proto",
}

func (m *GfSpQueryP2PNodeRequest) 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 *GfSpQueryP2PNodeRequest) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *GfSpQueryP2PNodeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	return len(dAtA) - i, nil
}

func (m *GfSpQueryP2PNodeResponse) 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 *GfSpQueryP2PNodeResponse) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *GfSpQueryP2PNodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Nodes) > 0 {
		for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- {
			i -= len(m.Nodes[iNdEx])
			copy(dAtA[i:], m.Nodes[iNdEx])
			i = encodeVarintP2P(dAtA, i, uint64(len(m.Nodes[iNdEx])))
			i--
			dAtA[i] = 0x12
		}
	}
	if m.Err != nil {
		{
			size, err := m.Err.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintP2P(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *GfSpAskSecondaryReplicatePieceApprovalRequest) 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 *GfSpAskSecondaryReplicatePieceApprovalRequest) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *GfSpAskSecondaryReplicatePieceApprovalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Timeout != 0 {
		i = encodeVarintP2P(dAtA, i, uint64(m.Timeout))
		i--
		dAtA[i] = 0x20
	}
	if m.Max != 0 {
		i = encodeVarintP2P(dAtA, i, uint64(m.Max))
		i--
		dAtA[i] = 0x18
	}
	if m.Min != 0 {
		i = encodeVarintP2P(dAtA, i, uint64(m.Min))
		i--
		dAtA[i] = 0x10
	}
	if m.ReplicatePieceApprovalTask != nil {
		{
			size, err := m.ReplicatePieceApprovalTask.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintP2P(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *GfSpAskSecondaryReplicatePieceApprovalResponse) 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 *GfSpAskSecondaryReplicatePieceApprovalResponse) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *GfSpAskSecondaryReplicatePieceApprovalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.ApprovedTasks) > 0 {
		for iNdEx := len(m.ApprovedTasks) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.ApprovedTasks[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintP2P(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x12
		}
	}
	if m.Err != nil {
		{
			size, err := m.Err.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintP2P(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func encodeVarintP2P(dAtA []byte, offset int, v uint64) int {
	offset -= sovP2P(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *GfSpQueryP2PNodeRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	return n
}

func (m *GfSpQueryP2PNodeResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Err != nil {
		l = m.Err.Size()
		n += 1 + l + sovP2P(uint64(l))
	}
	if len(m.Nodes) > 0 {
		for _, s := range m.Nodes {
			l = len(s)
			n += 1 + l + sovP2P(uint64(l))
		}
	}
	return n
}

func (m *GfSpAskSecondaryReplicatePieceApprovalRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.ReplicatePieceApprovalTask != nil {
		l = m.ReplicatePieceApprovalTask.Size()
		n += 1 + l + sovP2P(uint64(l))
	}
	if m.Min != 0 {
		n += 1 + sovP2P(uint64(m.Min))
	}
	if m.Max != 0 {
		n += 1 + sovP2P(uint64(m.Max))
	}
	if m.Timeout != 0 {
		n += 1 + sovP2P(uint64(m.Timeout))
	}
	return n
}

func (m *GfSpAskSecondaryReplicatePieceApprovalResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Err != nil {
		l = m.Err.Size()
		n += 1 + l + sovP2P(uint64(l))
	}
	if len(m.ApprovedTasks) > 0 {
		for _, e := range m.ApprovedTasks {
			l = e.Size()
			n += 1 + l + sovP2P(uint64(l))
		}
	}
	return n
}

func sovP2P(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozP2P(x uint64) (n int) {
	return sovP2P(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *GfSpQueryP2PNodeRequest) 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 ErrIntOverflowP2P
			}
			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: GfSpQueryP2PNodeRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: GfSpQueryP2PNodeRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		default:
			iNdEx = preIndex
			skippy, err := skipP2P(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthP2P
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *GfSpQueryP2PNodeResponse) 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 ErrIntOverflowP2P
			}
			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: GfSpQueryP2PNodeResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: GfSpQueryP2PNodeResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Err", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowP2P
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthP2P
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthP2P
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Err == nil {
				m.Err = &gfsperrors.GfSpError{}
			}
			if err := m.Err.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowP2P
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthP2P
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthP2P
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Nodes = append(m.Nodes, string(dAtA[iNdEx:postIndex]))
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipP2P(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthP2P
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *GfSpAskSecondaryReplicatePieceApprovalRequest) 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 ErrIntOverflowP2P
			}
			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: GfSpAskSecondaryReplicatePieceApprovalRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: GfSpAskSecondaryReplicatePieceApprovalRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ReplicatePieceApprovalTask", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowP2P
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthP2P
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthP2P
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.ReplicatePieceApprovalTask == nil {
				m.ReplicatePieceApprovalTask = &gfsptask.GfSpReplicatePieceApprovalTask{}
			}
			if err := m.ReplicatePieceApprovalTask.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType)
			}
			m.Min = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowP2P
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Min |= int32(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType)
			}
			m.Max = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowP2P
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Max |= int32(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 4:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType)
			}
			m.Timeout = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowP2P
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Timeout |= int64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipP2P(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthP2P
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *GfSpAskSecondaryReplicatePieceApprovalResponse) 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 ErrIntOverflowP2P
			}
			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: GfSpAskSecondaryReplicatePieceApprovalResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: GfSpAskSecondaryReplicatePieceApprovalResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Err", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowP2P
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthP2P
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthP2P
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Err == nil {
				m.Err = &gfsperrors.GfSpError{}
			}
			if err := m.Err.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ApprovedTasks", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowP2P
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthP2P
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthP2P
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ApprovedTasks = append(m.ApprovedTasks, &gfsptask.GfSpReplicatePieceApprovalTask{})
			if err := m.ApprovedTasks[len(m.ApprovedTasks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipP2P(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthP2P
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipP2P(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	depth := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowP2P
			}
			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, ErrIntOverflowP2P
				}
				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, ErrIntOverflowP2P
				}
				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, ErrInvalidLengthP2P
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupP2P
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthP2P
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthP2P        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowP2P          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupP2P = fmt.Errorf("proto: unexpected end of group")
)
