diff --git a/api/pfcpsim.go b/api/pfcpsim.go new file mode 100644 index 0000000..172d02e --- /dev/null +++ b/api/pfcpsim.go @@ -0,0 +1,283 @@ +// Copyright 2022-present Open Networking Foundation +// Copyright 2024-present Intel Corporation +// SPDX-License-Identifier: Apache-2.0 + +package api + +import ( + "context" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ context.Context + _ grpc.ClientConnInterface +) + +// 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.SupportPackageIsVersion6 + +// PFCPSimClient is the client API for PFCPSim service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type PFCPSimClient interface { + Configure(ctx context.Context, in *ConfigureRequest, opts ...grpc.CallOption) (*Response, error) + // Associate connects PFCPClient to remote peer and starts an association + Associate(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + // Disassociate perform teardown of association and disconnects from remote peer. + Disassociate(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + CreateSession(ctx context.Context, in *CreateSessionRequest, opts ...grpc.CallOption) (*Response, error) + ModifySession(ctx context.Context, in *ModifySessionRequest, opts ...grpc.CallOption) (*Response, error) + DeleteSession(ctx context.Context, in *DeleteSessionRequest, opts ...grpc.CallOption) (*Response, error) +} + +type pFCPSimClient struct { + cc grpc.ClientConnInterface +} + +func NewPFCPSimClient(cc grpc.ClientConnInterface) PFCPSimClient { + return &pFCPSimClient{cc} +} + +func (c *pFCPSimClient) Configure(ctx context.Context, in *ConfigureRequest, opts ...grpc.CallOption) (*Response, error) { + out := new(Response) + err := c.cc.Invoke(ctx, "/api.PFCPSim/Configure", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pFCPSimClient) Associate(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) { + out := new(Response) + err := c.cc.Invoke(ctx, "/api.PFCPSim/Associate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pFCPSimClient) Disassociate(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) { + out := new(Response) + err := c.cc.Invoke(ctx, "/api.PFCPSim/Disassociate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pFCPSimClient) CreateSession(ctx context.Context, in *CreateSessionRequest, opts ...grpc.CallOption) (*Response, error) { + out := new(Response) + err := c.cc.Invoke(ctx, "/api.PFCPSim/CreateSession", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pFCPSimClient) ModifySession(ctx context.Context, in *ModifySessionRequest, opts ...grpc.CallOption) (*Response, error) { + out := new(Response) + err := c.cc.Invoke(ctx, "/api.PFCPSim/ModifySession", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pFCPSimClient) DeleteSession(ctx context.Context, in *DeleteSessionRequest, opts ...grpc.CallOption) (*Response, error) { + out := new(Response) + err := c.cc.Invoke(ctx, "/api.PFCPSim/DeleteSession", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PFCPSimServer is the server API for PFCPSim service. +type PFCPSimServer interface { + Configure(context.Context, *ConfigureRequest) (*Response, error) + // Associate connects PFCPClient to remote peer and starts an association + Associate(context.Context, *EmptyRequest) (*Response, error) + // Disassociate perform teardown of association and disconnects from remote peer. + Disassociate(context.Context, *EmptyRequest) (*Response, error) + CreateSession(context.Context, *CreateSessionRequest) (*Response, error) + ModifySession(context.Context, *ModifySessionRequest) (*Response, error) + DeleteSession(context.Context, *DeleteSessionRequest) (*Response, error) +} + +// UnimplementedPFCPSimServer can be embedded to have forward compatible implementations. +type UnimplementedPFCPSimServer struct{} + +func (*UnimplementedPFCPSimServer) Configure(context.Context, *ConfigureRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method Configure not implemented") +} + +func (*UnimplementedPFCPSimServer) Associate(context.Context, *EmptyRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method Associate not implemented") +} + +func (*UnimplementedPFCPSimServer) Disassociate(context.Context, *EmptyRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method Disassociate not implemented") +} + +func (*UnimplementedPFCPSimServer) CreateSession(context.Context, *CreateSessionRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSession not implemented") +} + +func (*UnimplementedPFCPSimServer) ModifySession(context.Context, *ModifySessionRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ModifySession not implemented") +} + +func (*UnimplementedPFCPSimServer) DeleteSession(context.Context, *DeleteSessionRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteSession not implemented") +} + +func RegisterPFCPSimServer(s *grpc.Server, srv PFCPSimServer) { + s.RegisterService(&_PFCPSim_serviceDesc, srv) +} + +func _PFCPSim_Configure_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ConfigureRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PFCPSimServer).Configure(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.PFCPSim/Configure", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PFCPSimServer).Configure(ctx, req.(*ConfigureRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PFCPSim_Associate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PFCPSimServer).Associate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.PFCPSim/Associate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PFCPSimServer).Associate(ctx, req.(*EmptyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PFCPSim_Disassociate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PFCPSimServer).Disassociate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.PFCPSim/Disassociate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PFCPSimServer).Disassociate(ctx, req.(*EmptyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PFCPSim_CreateSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PFCPSimServer).CreateSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.PFCPSim/CreateSession", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PFCPSimServer).CreateSession(ctx, req.(*CreateSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PFCPSim_ModifySession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModifySessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PFCPSimServer).ModifySession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.PFCPSim/ModifySession", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PFCPSimServer).ModifySession(ctx, req.(*ModifySessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PFCPSim_DeleteSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PFCPSimServer).DeleteSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.PFCPSim/DeleteSession", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PFCPSimServer).DeleteSession(ctx, req.(*DeleteSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _PFCPSim_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.PFCPSim", + HandlerType: (*PFCPSimServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Configure", + Handler: _PFCPSim_Configure_Handler, + }, + { + MethodName: "Associate", + Handler: _PFCPSim_Associate_Handler, + }, + { + MethodName: "Disassociate", + Handler: _PFCPSim_Disassociate_Handler, + }, + { + MethodName: "CreateSession", + Handler: _PFCPSim_CreateSession_Handler, + }, + { + MethodName: "ModifySession", + Handler: _PFCPSim_ModifySession_Handler, + }, + { + MethodName: "DeleteSession", + Handler: _PFCPSim_DeleteSession_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pfcpsim.proto", +} diff --git a/api/pfcpsim.pb.go b/api/pfcpsim.pb.go index cb3136c..9b4d620 100644 --- a/api/pfcpsim.pb.go +++ b/api/pfcpsim.pb.go @@ -3,18 +3,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 -// protoc v3.14.0 +// protoc-gen-go v1.35.1 +// protoc v5.28.2 // source: pfcpsim.proto package api import ( - context "context" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -28,10 +23,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type CreateSessionRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -49,11 +40,9 @@ type CreateSessionRequest struct { func (x *CreateSessionRequest) Reset() { *x = CreateSessionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pfcpsim_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_pfcpsim_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CreateSessionRequest) String() string { @@ -64,7 +53,7 @@ func (*CreateSessionRequest) ProtoMessage() {} func (x *CreateSessionRequest) ProtoReflect() protoreflect.Message { mi := &file_pfcpsim_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -139,11 +128,9 @@ type ModifySessionRequest struct { func (x *ModifySessionRequest) Reset() { *x = ModifySessionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pfcpsim_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_pfcpsim_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ModifySessionRequest) String() string { @@ -154,7 +141,7 @@ func (*ModifySessionRequest) ProtoMessage() {} func (x *ModifySessionRequest) ProtoReflect() protoreflect.Message { mi := &file_pfcpsim_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -231,11 +218,9 @@ type ConfigureRequest struct { func (x *ConfigureRequest) Reset() { *x = ConfigureRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pfcpsim_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_pfcpsim_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ConfigureRequest) String() string { @@ -246,7 +231,7 @@ func (*ConfigureRequest) ProtoMessage() {} func (x *ConfigureRequest) ProtoReflect() protoreflect.Message { mi := &file_pfcpsim_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -287,11 +272,9 @@ type DeleteSessionRequest struct { func (x *DeleteSessionRequest) Reset() { *x = DeleteSessionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pfcpsim_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_pfcpsim_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DeleteSessionRequest) String() string { @@ -302,7 +285,7 @@ func (*DeleteSessionRequest) ProtoMessage() {} func (x *DeleteSessionRequest) ProtoReflect() protoreflect.Message { mi := &file_pfcpsim_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -339,11 +322,9 @@ type EmptyRequest struct { func (x *EmptyRequest) Reset() { *x = EmptyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pfcpsim_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_pfcpsim_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *EmptyRequest) String() string { @@ -354,7 +335,7 @@ func (*EmptyRequest) ProtoMessage() {} func (x *EmptyRequest) ProtoReflect() protoreflect.Message { mi := &file_pfcpsim_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -380,11 +361,9 @@ type Response struct { func (x *Response) Reset() { *x = Response{} - if protoimpl.UnsafeEnabled { - mi := &file_pfcpsim_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_pfcpsim_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Response) String() string { @@ -395,7 +374,7 @@ func (*Response) ProtoMessage() {} func (x *Response) ProtoReflect() protoreflect.Message { mi := &file_pfcpsim_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -510,7 +489,7 @@ func file_pfcpsim_proto_rawDescGZIP() []byte { } var file_pfcpsim_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_pfcpsim_proto_goTypes = []interface{}{ +var file_pfcpsim_proto_goTypes = []any{ (*CreateSessionRequest)(nil), // 0: api.CreateSessionRequest (*ModifySessionRequest)(nil), // 1: api.ModifySessionRequest (*ConfigureRequest)(nil), // 2: api.ConfigureRequest @@ -543,80 +522,6 @@ func file_pfcpsim_proto_init() { if File_pfcpsim_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_pfcpsim_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateSessionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pfcpsim_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModifySessionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pfcpsim_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigureRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pfcpsim_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteSessionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pfcpsim_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EmptyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pfcpsim_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Response); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ @@ -636,267 +541,3 @@ func file_pfcpsim_proto_init() { file_pfcpsim_proto_goTypes = nil file_pfcpsim_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// 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.SupportPackageIsVersion6 - -// PFCPSimClient is the client API for PFCPSim service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type PFCPSimClient interface { - Configure(ctx context.Context, in *ConfigureRequest, opts ...grpc.CallOption) (*Response, error) - // Associate connects PFCPClient to remote peer and starts an association - Associate(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) - // Disassociate perform teardown of association and disconnects from remote peer. - Disassociate(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) - CreateSession(ctx context.Context, in *CreateSessionRequest, opts ...grpc.CallOption) (*Response, error) - ModifySession(ctx context.Context, in *ModifySessionRequest, opts ...grpc.CallOption) (*Response, error) - DeleteSession(ctx context.Context, in *DeleteSessionRequest, opts ...grpc.CallOption) (*Response, error) -} - -type pFCPSimClient struct { - cc grpc.ClientConnInterface -} - -func NewPFCPSimClient(cc grpc.ClientConnInterface) PFCPSimClient { - return &pFCPSimClient{cc} -} - -func (c *pFCPSimClient) Configure(ctx context.Context, in *ConfigureRequest, opts ...grpc.CallOption) (*Response, error) { - out := new(Response) - err := c.cc.Invoke(ctx, "/api.PFCPSim/Configure", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *pFCPSimClient) Associate(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) { - out := new(Response) - err := c.cc.Invoke(ctx, "/api.PFCPSim/Associate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *pFCPSimClient) Disassociate(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) { - out := new(Response) - err := c.cc.Invoke(ctx, "/api.PFCPSim/Disassociate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *pFCPSimClient) CreateSession(ctx context.Context, in *CreateSessionRequest, opts ...grpc.CallOption) (*Response, error) { - out := new(Response) - err := c.cc.Invoke(ctx, "/api.PFCPSim/CreateSession", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *pFCPSimClient) ModifySession(ctx context.Context, in *ModifySessionRequest, opts ...grpc.CallOption) (*Response, error) { - out := new(Response) - err := c.cc.Invoke(ctx, "/api.PFCPSim/ModifySession", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *pFCPSimClient) DeleteSession(ctx context.Context, in *DeleteSessionRequest, opts ...grpc.CallOption) (*Response, error) { - out := new(Response) - err := c.cc.Invoke(ctx, "/api.PFCPSim/DeleteSession", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// PFCPSimServer is the server API for PFCPSim service. -type PFCPSimServer interface { - Configure(context.Context, *ConfigureRequest) (*Response, error) - // Associate connects PFCPClient to remote peer and starts an association - Associate(context.Context, *EmptyRequest) (*Response, error) - // Disassociate perform teardown of association and disconnects from remote peer. - Disassociate(context.Context, *EmptyRequest) (*Response, error) - CreateSession(context.Context, *CreateSessionRequest) (*Response, error) - ModifySession(context.Context, *ModifySessionRequest) (*Response, error) - DeleteSession(context.Context, *DeleteSessionRequest) (*Response, error) -} - -// UnimplementedPFCPSimServer can be embedded to have forward compatible implementations. -type UnimplementedPFCPSimServer struct { -} - -func (*UnimplementedPFCPSimServer) Configure(context.Context, *ConfigureRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method Configure not implemented") -} -func (*UnimplementedPFCPSimServer) Associate(context.Context, *EmptyRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method Associate not implemented") -} -func (*UnimplementedPFCPSimServer) Disassociate(context.Context, *EmptyRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method Disassociate not implemented") -} -func (*UnimplementedPFCPSimServer) CreateSession(context.Context, *CreateSessionRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateSession not implemented") -} -func (*UnimplementedPFCPSimServer) ModifySession(context.Context, *ModifySessionRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifySession not implemented") -} -func (*UnimplementedPFCPSimServer) DeleteSession(context.Context, *DeleteSessionRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteSession not implemented") -} - -func RegisterPFCPSimServer(s *grpc.Server, srv PFCPSimServer) { - s.RegisterService(&_PFCPSim_serviceDesc, srv) -} - -func _PFCPSim_Configure_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ConfigureRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PFCPSimServer).Configure(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.PFCPSim/Configure", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PFCPSimServer).Configure(ctx, req.(*ConfigureRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PFCPSim_Associate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EmptyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PFCPSimServer).Associate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.PFCPSim/Associate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PFCPSimServer).Associate(ctx, req.(*EmptyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PFCPSim_Disassociate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EmptyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PFCPSimServer).Disassociate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.PFCPSim/Disassociate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PFCPSimServer).Disassociate(ctx, req.(*EmptyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PFCPSim_CreateSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateSessionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PFCPSimServer).CreateSession(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.PFCPSim/CreateSession", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PFCPSimServer).CreateSession(ctx, req.(*CreateSessionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PFCPSim_ModifySession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifySessionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PFCPSimServer).ModifySession(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.PFCPSim/ModifySession", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PFCPSimServer).ModifySession(ctx, req.(*ModifySessionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PFCPSim_DeleteSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteSessionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PFCPSimServer).DeleteSession(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.PFCPSim/DeleteSession", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PFCPSimServer).DeleteSession(ctx, req.(*DeleteSessionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _PFCPSim_serviceDesc = grpc.ServiceDesc{ - ServiceName: "api.PFCPSim", - HandlerType: (*PFCPSimServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Configure", - Handler: _PFCPSim_Configure_Handler, - }, - { - MethodName: "Associate", - Handler: _PFCPSim_Associate_Handler, - }, - { - MethodName: "Disassociate", - Handler: _PFCPSim_Disassociate_Handler, - }, - { - MethodName: "CreateSession", - Handler: _PFCPSim_CreateSession_Handler, - }, - { - MethodName: "ModifySession", - Handler: _PFCPSim_ModifySession_Handler, - }, - { - MethodName: "DeleteSession", - Handler: _PFCPSim_DeleteSession_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "pfcpsim.proto", -}