diff --git a/api/pfcpsim.pb.go b/api/pfcpsim.pb.go index cbaf33f..4c25fc7 100644 --- a/api/pfcpsim.pb.go +++ b/api/pfcpsim.pb.go @@ -40,11 +40,11 @@ type CreateSessionRequest struct { // count represents the number of session Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` // baseID is used to create incremental IDs for PDRs, FARs, QERs - BaseID int32 `protobuf:"varint,2,opt,name=baseID,proto3" json:"baseID,omitempty"` - NodeBAddress string `protobuf:"bytes,3,opt,name=nodeBAddress,proto3" json:"nodeBAddress,omitempty"` - UeAddressPool string `protobuf:"bytes,4,opt,name=ueAddressPool,proto3" json:"ueAddressPool,omitempty"` - AppFilter string `protobuf:"bytes,5,opt,name=appFilter,proto3" json:"appFilter,omitempty"` - Qfi int32 `protobuf:"varint,6,opt,name=qfi,proto3" json:"qfi,omitempty"` // Should be uint8 + BaseID int32 `protobuf:"varint,2,opt,name=baseID,proto3" json:"baseID,omitempty"` + NodeBAddress string `protobuf:"bytes,3,opt,name=nodeBAddress,proto3" json:"nodeBAddress,omitempty"` + UeAddressPool string `protobuf:"bytes,4,opt,name=ueAddressPool,proto3" json:"ueAddressPool,omitempty"` + AppFilters []string `protobuf:"bytes,5,rep,name=appFilters,proto3" json:"appFilters,omitempty"` + Qfi int32 `protobuf:"varint,6,opt,name=qfi,proto3" json:"qfi,omitempty"` // Should be uint8 } func (x *CreateSessionRequest) Reset() { @@ -107,11 +107,11 @@ func (x *CreateSessionRequest) GetUeAddressPool() string { return "" } -func (x *CreateSessionRequest) GetAppFilter() string { +func (x *CreateSessionRequest) GetAppFilters() []string { if x != nil { - return x.AppFilter + return x.AppFilters } - return "" + return nil } func (x *CreateSessionRequest) GetQfi() int32 { @@ -420,7 +420,7 @@ var File_pfcpsim_proto protoreflect.FileDescriptor var file_pfcpsim_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x70, 0x66, 0x63, 0x70, 0x73, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x03, 0x61, 0x70, 0x69, 0x22, 0xbe, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, + 0x03, 0x61, 0x70, 0x69, 0x22, 0xc0, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x61, 0x73, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, @@ -429,62 +429,62 @@ var file_pfcpsim_proto_rawDesc = []byte{ 0x09, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x42, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x75, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x75, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x46, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x70, 0x70, 0x46, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x71, 0x66, 0x69, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x03, 0x71, 0x66, 0x69, 0x22, 0xd2, 0x01, 0x0a, 0x14, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x61, 0x73, 0x65, 0x49, 0x44, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x61, 0x73, 0x65, 0x49, 0x44, 0x12, 0x22, 0x0a, 0x0c, - 0x6e, 0x6f, 0x64, 0x65, 0x42, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x42, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x24, 0x0a, 0x0d, 0x75, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x6f, - 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x75, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, - 0x46, 0x6c, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x62, 0x75, 0x66, 0x66, - 0x65, 0x72, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, - 0x43, 0x50, 0x46, 0x6c, 0x61, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6e, 0x6f, - 0x74, 0x69, 0x66, 0x79, 0x43, 0x50, 0x46, 0x6c, 0x61, 0x67, 0x22, 0x64, 0x0a, 0x10, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, - 0x0a, 0x0c, 0x75, 0x70, 0x66, 0x4e, 0x33, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x75, 0x70, 0x66, 0x4e, 0x33, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x72, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x22, 0x44, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x62, 0x61, 0x73, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, - 0x62, 0x61, 0x73, 0x65, 0x49, 0x44, 0x22, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x45, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, - 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0xda, 0x02, - 0x0a, 0x07, 0x50, 0x46, 0x43, 0x50, 0x53, 0x69, 0x6d, 0x12, 0x33, 0x0a, 0x09, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2f, - 0x0a, 0x09, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x12, 0x11, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x32, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x12, - 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x71, 0x66, 0x69, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x03, 0x71, 0x66, 0x69, 0x22, 0xd2, 0x01, 0x0a, 0x14, 0x4d, 0x6f, 0x64, 0x69, + 0x66, 0x79, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x61, 0x73, 0x65, 0x49, 0x44, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x61, 0x73, 0x65, 0x49, 0x44, 0x12, 0x22, + 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x42, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x42, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x75, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x50, + 0x6f, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x75, 0x65, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x75, 0x66, 0x66, + 0x65, 0x72, 0x46, 0x6c, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x62, 0x75, + 0x66, 0x66, 0x65, 0x72, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x6f, 0x74, 0x69, + 0x66, 0x79, 0x43, 0x50, 0x46, 0x6c, 0x61, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, + 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x43, 0x50, 0x46, 0x6c, 0x61, 0x67, 0x22, 0x64, 0x0a, 0x10, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x22, 0x0a, 0x0c, 0x75, 0x70, 0x66, 0x4e, 0x33, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x75, 0x70, 0x66, 0x4e, 0x33, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x65, + 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x11, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x22, 0x44, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x62, 0x61, 0x73, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x62, 0x61, 0x73, 0x65, 0x49, 0x44, 0x22, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x45, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, + 0xda, 0x02, 0x0a, 0x07, 0x50, 0x46, 0x43, 0x50, 0x53, 0x69, 0x6d, 0x12, 0x33, 0x0a, 0x09, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x3b, 0x0a, 0x0d, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, - 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x07, 0x5a, 0x05, 0x2e, 0x3b, - 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x2f, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x12, 0x11, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x32, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, + 0x65, 0x12, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0d, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x3b, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x07, 0x5a, 0x05, + 0x2e, 0x3b, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/pfcpsim.proto b/api/pfcpsim.proto index 4a623cd..af84bb5 100644 --- a/api/pfcpsim.proto +++ b/api/pfcpsim.proto @@ -13,7 +13,7 @@ message CreateSessionRequest { int32 baseID = 2; string nodeBAddress = 3; string ueAddressPool = 4; - string appFilter = 5; + repeated string appFilters = 5; int32 qfi = 6; // Should be uint8 } diff --git a/internal/pfcpctl/commands/sessions.go b/internal/pfcpctl/commands/sessions.go index c505097..e2d1b9c 100644 --- a/internal/pfcpctl/commands/sessions.go +++ b/internal/pfcpctl/commands/sessions.go @@ -12,12 +12,12 @@ import ( ) type commonArgs struct { - Count int `short:"c" long:"count" default:"1" description:"The number of sessions to create"` - BaseID int `short:"i" long:"baseID" default:"1" description:"The base ID to use"` - UePool string `short:"u" long:"ue-pool" default:"17.0.0.0/24" description:"The UE pool address"` - GnBAddress string `short:"g" long:"gnb-addr" description:"The UE pool address"` - AppFilterString string `short:"a" long:"app-filter" description:"Specify an application filter. Format: '{ip | udp | tcp}:{IPv4 Prefix | any}:{- | any}:{allow | deny}' . e.g. 'udp:10.0.0.0/8:80-88:allow'"` - QFI uint8 `short:"q" long:"qfi" description:"The QFI value for QERs. Max value 64."` + Count int `short:"c" long:"count" default:"1" description:"The number of sessions to create"` + BaseID int `short:"i" long:"baseID" default:"1" description:"The base ID to use"` + UePool string `short:"u" long:"ue-pool" default:"17.0.0.0/24" description:"The UE pool address"` + GnBAddress string `short:"g" long:"gnb-addr" description:"The UE pool address"` + AppFilterString []string `short:"a" long:"app-filter" description:"Specify an application filter. Format: '{ip | udp | tcp}:{IPv4 Prefix | any}:{- | any}:{allow | deny}' . e.g. 'udp:10.0.0.0/8:80-88:allow'"` + QFI uint8 `short:"q" long:"qfi" description:"The QFI value for QERs. Max value 64."` } type sessionCreate struct { @@ -59,12 +59,18 @@ func (s *sessionCreate) Execute(args []string) error { client := connect() defer disconnect() + var appFilters []string + + for _, s := range s.Args.AppFilterString { + appFilters = append(appFilters, s) + } + res, err := client.CreateSession(context.Background(), &pb.CreateSessionRequest{ Count: int32(s.Args.Count), BaseID: int32(s.Args.BaseID), NodeBAddress: s.Args.GnBAddress, UeAddressPool: s.Args.UePool, - AppFilter: s.Args.AppFilterString, + AppFilters: appFilters, Qfi: int32(s.Args.QFI), }) diff --git a/internal/pfcpsim/server.go b/internal/pfcpsim/server.go index ded8067..a3be562 100644 --- a/internal/pfcpsim/server.go +++ b/internal/pfcpsim/server.go @@ -22,6 +22,8 @@ import ( // Its state is handled in internal/pfcpsim/state.go type pfcpSimService struct{} +const SessionStep = 20 // identifies the step in loops, used while creating/modifying/deleting sessions and rules IDs + func NewPFCPSimService(iface string) *pfcpSimService { interfaceName = iface return &pfcpSimService{} @@ -127,20 +129,11 @@ func (P pfcpSimService) CreateSession(ctx context.Context, request *pb.CreateSes var SDFFilter = "" var qfi, gateStatus uint8 = 0, ieLib.GateStatusOpen - if request.AppFilter != "" { - SDFFilter, gateStatus, err = parseAppFilter(request.AppFilter) - if err != nil { - return &pb.Response{}, status.Error(codes.Aborted, err.Error()) - } - - log.Infof("Successfully parsed application filter. SDF Filter: %v", SDFFilter) - } - if request.Qfi != 0 { qfi = uint8(request.Qfi) } - for i := baseID; i < (count*2 + baseID); i = i + 2 { + for i := baseID; i < (count*SessionStep + baseID); i = i + SessionStep { //FIXME step should include the number of PDRs created // using variables to ease comprehension on how rules are linked together uplinkTEID := uint32(i) @@ -237,6 +230,51 @@ func (P pfcpSimService) CreateSession(ctx context.Context, request *pb.CreateSes Build(), } + // create as many PDRs as the number of app filters provided through pfcpctl + if len(request.AppFilters) > 0 { + pdrs = []*ieLib.IE{} // reset pdr slice + ID := uint16(i) + + for _, appFilter := range request.AppFilters { + SDFFilter, gateStatus, err = parseAppFilter(appFilter) + if err != nil { + return &pb.Response{}, status.Error(codes.Aborted, err.Error()) + } + + log.Infof("Successfully parsed application filter. SDF Filter: %v", SDFFilter) + + uplinkPDR := session.NewPDRBuilder(). + WithID(ID). + WithMethod(session.Create). + WithTEID(uplinkTEID). + WithFARID(uplinkFarID). + AddQERID(sessQerID). + AddQERID(uplinkAppQerID). + WithN3Address(upfN3Address). + WithSDFFilter(SDFFilter). + WithPrecedence(uint32(ID + 100)). // FIXME can precedence between these PDRs be the same? + MarkAsUplink(). + BuildPDR() + + downlinkPDR := session.NewPDRBuilder(). + WithID(ID + 1). + WithMethod(session.Create). + WithPrecedence(uint32(ID + 100)). + WithUEAddress(ueAddress.String()). + WithSDFFilter(SDFFilter). + AddQERID(sessQerID). + AddQERID(downlinkAppQerID). + WithFARID(downlinkFarID). + MarkAsDownlink(). + BuildPDR() + + pdrs = append(pdrs, uplinkPDR) + pdrs = append(pdrs, downlinkPDR) + + ID++ + } + } + sess, err := sim.EstablishSession(pdrs, fars, qers) if err != nil { return &pb.Response{}, status.Error(codes.Internal, err.Error()) @@ -280,7 +318,7 @@ func (P pfcpSimService) ModifySession(ctx context.Context, request *pb.ModifySes actions |= session.ActionForward } - for i := baseID; i < (count*2 + baseID); i = i + 2 { + for i := baseID; i < (count*SessionStep + baseID); i = i + SessionStep { teid := uint32(i + 1) if request.BufferFlag || request.NotifyCPFlag { @@ -335,7 +373,7 @@ func (P pfcpSimService) DeleteSession(ctx context.Context, request *pb.DeleteSes return &pb.Response{}, status.Error(codes.Aborted, err.Error()) } - for i := baseID; i < (count*2 + baseID); i = i + 2 { + for i := baseID; i < (count*SessionStep + baseID); i = i + SessionStep { sess, ok := getSession(i) if !ok { errMsg := "Session was nil. Check baseID"