diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-04-04 23:46:01 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-04-14 08:10:28 +0900 |
commit | 75f835725deb42b00d5f746828f2738d15e3bc4f (patch) | |
tree | 5294cc59377f51896fd75a57cdb776f5e2f8bf54 /api/gobgp.pb.go | |
parent | 18bbb843d2e025af8e1ffd33b7c9a09d1a19c565 (diff) |
api: use gRPC instead of REST
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'api/gobgp.pb.go')
-rw-r--r-- | api/gobgp.pb.go | 853 |
1 files changed, 853 insertions, 0 deletions
diff --git a/api/gobgp.pb.go b/api/gobgp.pb.go new file mode 100644 index 00000000..3b91d6ea --- /dev/null +++ b/api/gobgp.pb.go @@ -0,0 +1,853 @@ +// Code generated by protoc-gen-go. +// source: gobgp.proto +// DO NOT EDIT! + +/* +Package api is a generated protocol buffer package. + +It is generated from these files: + gobgp.proto + +It has these top-level messages: + Error + Arguments + PathAttr + Path + Destination + PeerConf + PeerInfo + Peer +*/ +package api + +import proto "github.com/golang/protobuf/proto" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal + +type Resource int32 + +const ( + Resource_GLOBAL Resource = 0 + Resource_LOCAL Resource = 1 + Resource_ADJ_IN Resource = 2 + Resource_ADJ_OUT Resource = 3 +) + +var Resource_name = map[int32]string{ + 0: "GLOBAL", + 1: "LOCAL", + 2: "ADJ_IN", + 3: "ADJ_OUT", +} +var Resource_value = map[string]int32{ + "GLOBAL": 0, + "LOCAL": 1, + "ADJ_IN": 2, + "ADJ_OUT": 3, +} + +func (x Resource) String() string { + return proto.EnumName(Resource_name, int32(x)) +} + +type AddressFamily int32 + +const ( + AddressFamily_IPV4 AddressFamily = 0 + AddressFamily_IPV6 AddressFamily = 1 + AddressFamily_EVPN AddressFamily = 2 +) + +var AddressFamily_name = map[int32]string{ + 0: "IPV4", + 1: "IPV6", + 2: "EVPN", +} +var AddressFamily_value = map[string]int32{ + "IPV4": 0, + "IPV6": 1, + "EVPN": 2, +} + +func (x AddressFamily) String() string { + return proto.EnumName(AddressFamily_name, int32(x)) +} + +type Error_ErrorCode int32 + +const ( + Error_SUCCESS Error_ErrorCode = 0 + Error_FAIL Error_ErrorCode = 1 +) + +var Error_ErrorCode_name = map[int32]string{ + 0: "SUCCESS", + 1: "FAIL", +} +var Error_ErrorCode_value = map[string]int32{ + "SUCCESS": 0, + "FAIL": 1, +} + +func (x Error_ErrorCode) String() string { + return proto.EnumName(Error_ErrorCode_name, int32(x)) +} + +type PathAttr_Origin int32 + +const ( + PathAttr_IGP PathAttr_Origin = 0 + PathAttr_EGP PathAttr_Origin = 1 + PathAttr_INCOMPLETE PathAttr_Origin = 2 +) + +var PathAttr_Origin_name = map[int32]string{ + 0: "IGP", + 1: "EGP", + 2: "INCOMPLETE", +} +var PathAttr_Origin_value = map[string]int32{ + "IGP": 0, + "EGP": 1, + "INCOMPLETE": 2, +} + +func (x PathAttr_Origin) String() string { + return proto.EnumName(PathAttr_Origin_name, int32(x)) +} + +type Error struct { + Code Error_ErrorCode `protobuf:"varint,1,opt,name=code,enum=api.Error_ErrorCode" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg" json:"msg,omitempty"` +} + +func (m *Error) Reset() { *m = Error{} } +func (m *Error) String() string { return proto.CompactTextString(m) } +func (*Error) ProtoMessage() {} + +type Arguments struct { + Resource Resource `protobuf:"varint,1,opt,name=resource,enum=api.Resource" json:"resource,omitempty"` + Af AddressFamily `protobuf:"varint,2,opt,name=af,enum=api.AddressFamily" json:"af,omitempty"` + RouterId string `protobuf:"bytes,3,opt,name=router_id" json:"router_id,omitempty"` + Prefix string `protobuf:"bytes,4,opt,name=prefix" json:"prefix,omitempty"` +} + +func (m *Arguments) Reset() { *m = Arguments{} } +func (m *Arguments) String() string { return proto.CompactTextString(m) } +func (*Arguments) ProtoMessage() {} + +type PathAttr struct { + Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` + Origin PathAttr_Origin `protobuf:"varint,2,opt,name=origin,enum=api.PathAttr_Origin" json:"origin,omitempty"` + AsPath []uint32 `protobuf:"varint,3,rep,name=as_path" json:"as_path,omitempty"` + Metric uint32 `protobuf:"varint,4,opt,name=metric" json:"metric,omitempty"` + Pref uint32 `protobuf:"varint,5,opt,name=pref" json:"pref,omitempty"` + Aggregator *PathAttr_Aggregator `protobuf:"bytes,6,opt,name=aggregator" json:"aggregator,omitempty"` + Communites []uint32 `protobuf:"varint,7,rep,name=communites" json:"communites,omitempty"` + Originator string `protobuf:"bytes,8,opt,name=originator" json:"originator,omitempty"` + Cluster string `protobuf:"bytes,9,opt,name=cluster" json:"cluster,omitempty"` + Value uint32 `protobuf:"varint,10,opt,name=value" json:"value,omitempty"` +} + +func (m *PathAttr) Reset() { *m = PathAttr{} } +func (m *PathAttr) String() string { return proto.CompactTextString(m) } +func (*PathAttr) ProtoMessage() {} + +func (m *PathAttr) GetAggregator() *PathAttr_Aggregator { + if m != nil { + return m.Aggregator + } + return nil +} + +type PathAttr_Aggregator struct { + As uint32 `protobuf:"varint,1,opt,name=as" json:"as,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"` +} + +func (m *PathAttr_Aggregator) Reset() { *m = PathAttr_Aggregator{} } +func (m *PathAttr_Aggregator) String() string { return proto.CompactTextString(m) } +func (*PathAttr_Aggregator) ProtoMessage() {} + +type Path struct { + Network string `protobuf:"bytes,1,opt,name=network" json:"network,omitempty"` + Nexthop string `protobuf:"bytes,2,opt,name=nexthop" json:"nexthop,omitempty"` + Age int64 `protobuf:"varint,3,opt,name=age" json:"age,omitempty"` + Attrs []*PathAttr `protobuf:"bytes,4,rep,name=attrs" json:"attrs,omitempty"` + Best bool `protobuf:"varint,5,opt,name=best" json:"best,omitempty"` +} + +func (m *Path) Reset() { *m = Path{} } +func (m *Path) String() string { return proto.CompactTextString(m) } +func (*Path) ProtoMessage() {} + +func (m *Path) GetAttrs() []*PathAttr { + if m != nil { + return m.Attrs + } + return nil +} + +type Destination struct { + Prefix string `protobuf:"bytes,1,opt,name=prefix" json:"prefix,omitempty"` + Paths []*Path `protobuf:"bytes,2,rep,name=paths" json:"paths,omitempty"` + BestPathIdx int32 `protobuf:"varint,3,opt,name=best_path_idx" json:"best_path_idx,omitempty"` +} + +func (m *Destination) Reset() { *m = Destination{} } +func (m *Destination) String() string { return proto.CompactTextString(m) } +func (*Destination) ProtoMessage() {} + +func (m *Destination) GetPaths() []*Path { + if m != nil { + return m.Paths + } + return nil +} + +type PeerConf struct { + RemoteIp string `protobuf:"bytes,1,opt,name=remote_ip" json:"remote_ip,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` + RemoteAs uint32 `protobuf:"varint,3,opt,name=remote_as" json:"remote_as,omitempty"` + CapRefresh bool `protobuf:"varint,4,opt,name=cap_refresh" json:"cap_refresh,omitempty"` + CapEnhancedRefresh bool `protobuf:"varint,5,opt,name=cap_enhanced_refresh" json:"cap_enhanced_refresh,omitempty"` + RemoteCap []int32 `protobuf:"varint,6,rep,name=remote_cap" json:"remote_cap,omitempty"` + LocalCap []int32 `protobuf:"varint,7,rep,name=local_cap" json:"local_cap,omitempty"` +} + +func (m *PeerConf) Reset() { *m = PeerConf{} } +func (m *PeerConf) String() string { return proto.CompactTextString(m) } +func (*PeerConf) ProtoMessage() {} + +type PeerInfo struct { + BgpState string `protobuf:"bytes,1,opt,name=bgp_state" json:"bgp_state,omitempty"` + AdminState string `protobuf:"bytes,2,opt,name=admin_state" json:"admin_state,omitempty"` + FsmEstablishedTransitions uint32 `protobuf:"varint,3,opt,name=fsm_established_transitions" json:"fsm_established_transitions,omitempty"` + TotalMessageOut uint32 `protobuf:"varint,4,opt,name=total_message_out" json:"total_message_out,omitempty"` + TotalMessageIn uint32 `protobuf:"varint,5,opt,name=total_message_in" json:"total_message_in,omitempty"` + UpdateMessageOut uint32 `protobuf:"varint,6,opt,name=update_message_out" json:"update_message_out,omitempty"` + UpdateMessageIn uint32 `protobuf:"varint,7,opt,name=update_message_in" json:"update_message_in,omitempty"` + KeepAliveMessageOut uint32 `protobuf:"varint,8,opt,name=keep_alive_message_out" json:"keep_alive_message_out,omitempty"` + KeepAliveMessageIn uint32 `protobuf:"varint,9,opt,name=keep_alive_message_in" json:"keep_alive_message_in,omitempty"` + OpenMessageOut uint32 `protobuf:"varint,10,opt,name=open_message_out" json:"open_message_out,omitempty"` + OpenMessageIn uint32 `protobuf:"varint,11,opt,name=open_message_in" json:"open_message_in,omitempty"` + NotificationOut uint32 `protobuf:"varint,12,opt,name=notification_out" json:"notification_out,omitempty"` + NotificationIn uint32 `protobuf:"varint,13,opt,name=notification_in" json:"notification_in,omitempty"` + RefreshMessageOut uint32 `protobuf:"varint,14,opt,name=refresh_message_out" json:"refresh_message_out,omitempty"` + RefreshMessageIn uint32 `protobuf:"varint,15,opt,name=refresh_message_in" json:"refresh_message_in,omitempty"` + DiscardedOut uint32 `protobuf:"varint,16,opt,name=discarded_out" json:"discarded_out,omitempty"` + DiscardedIn uint32 `protobuf:"varint,17,opt,name=discarded_in" json:"discarded_in,omitempty"` + Uptime int64 `protobuf:"varint,18,opt,name=uptime" json:"uptime,omitempty"` + Downtime int64 `protobuf:"varint,19,opt,name=downtime" json:"downtime,omitempty"` + LastError string `protobuf:"bytes,20,opt,name=last_error" json:"last_error,omitempty"` + Received uint32 `protobuf:"varint,21,opt,name=received" json:"received,omitempty"` + Accepted uint32 `protobuf:"varint,22,opt,name=accepted" json:"accepted,omitempty"` + Advertized uint32 `protobuf:"varint,23,opt,name=advertized" json:"advertized,omitempty"` + OutQ uint32 `protobuf:"varint,24,opt,name=out_q" json:"out_q,omitempty"` + Flops uint32 `protobuf:"varint,25,opt,name=flops" json:"flops,omitempty"` +} + +func (m *PeerInfo) Reset() { *m = PeerInfo{} } +func (m *PeerInfo) String() string { return proto.CompactTextString(m) } +func (*PeerInfo) ProtoMessage() {} + +type Peer struct { + Conf *PeerConf `protobuf:"bytes,1,opt,name=conf" json:"conf,omitempty"` + Info *PeerInfo `protobuf:"bytes,2,opt,name=info" json:"info,omitempty"` +} + +func (m *Peer) Reset() { *m = Peer{} } +func (m *Peer) String() string { return proto.CompactTextString(m) } +func (*Peer) ProtoMessage() {} + +func (m *Peer) GetConf() *PeerConf { + if m != nil { + return m.Conf + } + return nil +} + +func (m *Peer) GetInfo() *PeerInfo { + if m != nil { + return m.Info + } + return nil +} + +func init() { + proto.RegisterEnum("api.Resource", Resource_name, Resource_value) + proto.RegisterEnum("api.AddressFamily", AddressFamily_name, AddressFamily_value) + proto.RegisterEnum("api.Error_ErrorCode", Error_ErrorCode_name, Error_ErrorCode_value) + proto.RegisterEnum("api.PathAttr_Origin", PathAttr_Origin_name, PathAttr_Origin_value) +} + +// Client API for Grpc service + +type GrpcClient interface { + GetNeighbors(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (Grpc_GetNeighborsClient, error) + GetNeighbor(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Peer, error) + GetRib(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (Grpc_GetRibClient, error) + GetAdjRib(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (Grpc_GetAdjRibClient, error) + Reset(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error) + SoftReset(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error) + SoftResetIn(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error) + SoftResetOut(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error) + Shutdown(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error) + Enable(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error) + Disable(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error) + AddPath(ctx context.Context, opts ...grpc.CallOption) (Grpc_AddPathClient, error) + DeletePath(ctx context.Context, opts ...grpc.CallOption) (Grpc_DeletePathClient, error) +} + +type grpcClient struct { + cc *grpc.ClientConn +} + +func NewGrpcClient(cc *grpc.ClientConn) GrpcClient { + return &grpcClient{cc} +} + +func (c *grpcClient) GetNeighbors(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (Grpc_GetNeighborsClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Grpc_serviceDesc.Streams[0], c.cc, "/api.Grpc/GetNeighbors", opts...) + if err != nil { + return nil, err + } + x := &grpcGetNeighborsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Grpc_GetNeighborsClient interface { + Recv() (*Peer, error) + grpc.ClientStream +} + +type grpcGetNeighborsClient struct { + grpc.ClientStream +} + +func (x *grpcGetNeighborsClient) Recv() (*Peer, error) { + m := new(Peer) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *grpcClient) GetNeighbor(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Peer, error) { + out := new(Peer) + err := grpc.Invoke(ctx, "/api.Grpc/GetNeighbor", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcClient) GetRib(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (Grpc_GetRibClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Grpc_serviceDesc.Streams[1], c.cc, "/api.Grpc/GetRib", opts...) + if err != nil { + return nil, err + } + x := &grpcGetRibClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Grpc_GetRibClient interface { + Recv() (*Destination, error) + grpc.ClientStream +} + +type grpcGetRibClient struct { + grpc.ClientStream +} + +func (x *grpcGetRibClient) Recv() (*Destination, error) { + m := new(Destination) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *grpcClient) GetAdjRib(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (Grpc_GetAdjRibClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Grpc_serviceDesc.Streams[2], c.cc, "/api.Grpc/GetAdjRib", opts...) + if err != nil { + return nil, err + } + x := &grpcGetAdjRibClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Grpc_GetAdjRibClient interface { + Recv() (*Path, error) + grpc.ClientStream +} + +type grpcGetAdjRibClient struct { + grpc.ClientStream +} + +func (x *grpcGetAdjRibClient) Recv() (*Path, error) { + m := new(Path) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *grpcClient) Reset(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error) { + out := new(Error) + err := grpc.Invoke(ctx, "/api.Grpc/Reset", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcClient) SoftReset(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error) { + out := new(Error) + err := grpc.Invoke(ctx, "/api.Grpc/SoftReset", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcClient) SoftResetIn(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error) { + out := new(Error) + err := grpc.Invoke(ctx, "/api.Grpc/SoftResetIn", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcClient) SoftResetOut(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error) { + out := new(Error) + err := grpc.Invoke(ctx, "/api.Grpc/SoftResetOut", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcClient) Shutdown(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error) { + out := new(Error) + err := grpc.Invoke(ctx, "/api.Grpc/Shutdown", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcClient) Enable(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error) { + out := new(Error) + err := grpc.Invoke(ctx, "/api.Grpc/Enable", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcClient) Disable(ctx context.Context, in *Arguments, opts ...grpc.CallOption) (*Error, error) { + out := new(Error) + err := grpc.Invoke(ctx, "/api.Grpc/Disable", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcClient) AddPath(ctx context.Context, opts ...grpc.CallOption) (Grpc_AddPathClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Grpc_serviceDesc.Streams[3], c.cc, "/api.Grpc/AddPath", opts...) + if err != nil { + return nil, err + } + x := &grpcAddPathClient{stream} + return x, nil +} + +type Grpc_AddPathClient interface { + Send(*Arguments) error + CloseAndRecv() (*Error, error) + grpc.ClientStream +} + +type grpcAddPathClient struct { + grpc.ClientStream +} + +func (x *grpcAddPathClient) Send(m *Arguments) error { + return x.ClientStream.SendMsg(m) +} + +func (x *grpcAddPathClient) CloseAndRecv() (*Error, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(Error) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *grpcClient) DeletePath(ctx context.Context, opts ...grpc.CallOption) (Grpc_DeletePathClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Grpc_serviceDesc.Streams[4], c.cc, "/api.Grpc/DeletePath", opts...) + if err != nil { + return nil, err + } + x := &grpcDeletePathClient{stream} + return x, nil +} + +type Grpc_DeletePathClient interface { + Send(*Arguments) error + CloseAndRecv() (*Error, error) + grpc.ClientStream +} + +type grpcDeletePathClient struct { + grpc.ClientStream +} + +func (x *grpcDeletePathClient) Send(m *Arguments) error { + return x.ClientStream.SendMsg(m) +} + +func (x *grpcDeletePathClient) CloseAndRecv() (*Error, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(Error) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for Grpc service + +type GrpcServer interface { + GetNeighbors(*Arguments, Grpc_GetNeighborsServer) error + GetNeighbor(context.Context, *Arguments) (*Peer, error) + GetRib(*Arguments, Grpc_GetRibServer) error + GetAdjRib(*Arguments, Grpc_GetAdjRibServer) error + Reset(context.Context, *Arguments) (*Error, error) + SoftReset(context.Context, *Arguments) (*Error, error) + SoftResetIn(context.Context, *Arguments) (*Error, error) + SoftResetOut(context.Context, *Arguments) (*Error, error) + Shutdown(context.Context, *Arguments) (*Error, error) + Enable(context.Context, *Arguments) (*Error, error) + Disable(context.Context, *Arguments) (*Error, error) + AddPath(Grpc_AddPathServer) error + DeletePath(Grpc_DeletePathServer) error +} + +func RegisterGrpcServer(s *grpc.Server, srv GrpcServer) { + s.RegisterService(&_Grpc_serviceDesc, srv) +} + +func _Grpc_GetNeighbors_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Arguments) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(GrpcServer).GetNeighbors(m, &grpcGetNeighborsServer{stream}) +} + +type Grpc_GetNeighborsServer interface { + Send(*Peer) error + grpc.ServerStream +} + +type grpcGetNeighborsServer struct { + grpc.ServerStream +} + +func (x *grpcGetNeighborsServer) Send(m *Peer) error { + return x.ServerStream.SendMsg(m) +} + +func _Grpc_GetNeighbor_Handler(srv interface{}, ctx context.Context, buf []byte) (interface{}, error) { + in := new(Arguments) + if err := proto.Unmarshal(buf, in); err != nil { + return nil, err + } + out, err := srv.(GrpcServer).GetNeighbor(ctx, in) + if err != nil { + return nil, err + } + return out, nil +} + +func _Grpc_GetRib_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Arguments) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(GrpcServer).GetRib(m, &grpcGetRibServer{stream}) +} + +type Grpc_GetRibServer interface { + Send(*Destination) error + grpc.ServerStream +} + +type grpcGetRibServer struct { + grpc.ServerStream +} + +func (x *grpcGetRibServer) Send(m *Destination) error { + return x.ServerStream.SendMsg(m) +} + +func _Grpc_GetAdjRib_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Arguments) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(GrpcServer).GetAdjRib(m, &grpcGetAdjRibServer{stream}) +} + +type Grpc_GetAdjRibServer interface { + Send(*Path) error + grpc.ServerStream +} + +type grpcGetAdjRibServer struct { + grpc.ServerStream +} + +func (x *grpcGetAdjRibServer) Send(m *Path) error { + return x.ServerStream.SendMsg(m) +} + +func _Grpc_Reset_Handler(srv interface{}, ctx context.Context, buf []byte) (interface{}, error) { + in := new(Arguments) + if err := proto.Unmarshal(buf, in); err != nil { + return nil, err + } + out, err := srv.(GrpcServer).Reset(ctx, in) + if err != nil { + return nil, err + } + return out, nil +} + +func _Grpc_SoftReset_Handler(srv interface{}, ctx context.Context, buf []byte) (interface{}, error) { + in := new(Arguments) + if err := proto.Unmarshal(buf, in); err != nil { + return nil, err + } + out, err := srv.(GrpcServer).SoftReset(ctx, in) + if err != nil { + return nil, err + } + return out, nil +} + +func _Grpc_SoftResetIn_Handler(srv interface{}, ctx context.Context, buf []byte) (interface{}, error) { + in := new(Arguments) + if err := proto.Unmarshal(buf, in); err != nil { + return nil, err + } + out, err := srv.(GrpcServer).SoftResetIn(ctx, in) + if err != nil { + return nil, err + } + return out, nil +} + +func _Grpc_SoftResetOut_Handler(srv interface{}, ctx context.Context, buf []byte) (interface{}, error) { + in := new(Arguments) + if err := proto.Unmarshal(buf, in); err != nil { + return nil, err + } + out, err := srv.(GrpcServer).SoftResetOut(ctx, in) + if err != nil { + return nil, err + } + return out, nil +} + +func _Grpc_Shutdown_Handler(srv interface{}, ctx context.Context, buf []byte) (interface{}, error) { + in := new(Arguments) + if err := proto.Unmarshal(buf, in); err != nil { + return nil, err + } + out, err := srv.(GrpcServer).Shutdown(ctx, in) + if err != nil { + return nil, err + } + return out, nil +} + +func _Grpc_Enable_Handler(srv interface{}, ctx context.Context, buf []byte) (interface{}, error) { + in := new(Arguments) + if err := proto.Unmarshal(buf, in); err != nil { + return nil, err + } + out, err := srv.(GrpcServer).Enable(ctx, in) + if err != nil { + return nil, err + } + return out, nil +} + +func _Grpc_Disable_Handler(srv interface{}, ctx context.Context, buf []byte) (interface{}, error) { + in := new(Arguments) + if err := proto.Unmarshal(buf, in); err != nil { + return nil, err + } + out, err := srv.(GrpcServer).Disable(ctx, in) + if err != nil { + return nil, err + } + return out, nil +} + +func _Grpc_AddPath_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(GrpcServer).AddPath(&grpcAddPathServer{stream}) +} + +type Grpc_AddPathServer interface { + SendAndClose(*Error) error + Recv() (*Arguments, error) + grpc.ServerStream +} + +type grpcAddPathServer struct { + grpc.ServerStream +} + +func (x *grpcAddPathServer) SendAndClose(m *Error) error { + return x.ServerStream.SendMsg(m) +} + +func (x *grpcAddPathServer) Recv() (*Arguments, error) { + m := new(Arguments) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Grpc_DeletePath_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(GrpcServer).DeletePath(&grpcDeletePathServer{stream}) +} + +type Grpc_DeletePathServer interface { + SendAndClose(*Error) error + Recv() (*Arguments, error) + grpc.ServerStream +} + +type grpcDeletePathServer struct { + grpc.ServerStream +} + +func (x *grpcDeletePathServer) SendAndClose(m *Error) error { + return x.ServerStream.SendMsg(m) +} + +func (x *grpcDeletePathServer) Recv() (*Arguments, error) { + m := new(Arguments) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _Grpc_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.Grpc", + HandlerType: (*GrpcServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetNeighbor", + Handler: _Grpc_GetNeighbor_Handler, + }, + { + MethodName: "Reset", + Handler: _Grpc_Reset_Handler, + }, + { + MethodName: "SoftReset", + Handler: _Grpc_SoftReset_Handler, + }, + { + MethodName: "SoftResetIn", + Handler: _Grpc_SoftResetIn_Handler, + }, + { + MethodName: "SoftResetOut", + Handler: _Grpc_SoftResetOut_Handler, + }, + { + MethodName: "Shutdown", + Handler: _Grpc_Shutdown_Handler, + }, + { + MethodName: "Enable", + Handler: _Grpc_Enable_Handler, + }, + { + MethodName: "Disable", + Handler: _Grpc_Disable_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "GetNeighbors", + Handler: _Grpc_GetNeighbors_Handler, + ServerStreams: true, + }, + { + StreamName: "GetRib", + Handler: _Grpc_GetRib_Handler, + ServerStreams: true, + }, + { + StreamName: "GetAdjRib", + Handler: _Grpc_GetAdjRib_Handler, + ServerStreams: true, + }, + { + StreamName: "AddPath", + Handler: _Grpc_AddPath_Handler, + ClientStreams: true, + }, + { + StreamName: "DeletePath", + Handler: _Grpc_DeletePath_Handler, + ClientStreams: true, + }, + }, +} |