Documentation ¶
Index ¶
- Constants
- Variables
- func AndBytes(bytes1, bytes2 []byte) []byte
- func CheckPolicyControlReqTrig(triggers []models.PolicyControlRequestTrigger, ...) bool
- func CheckStopTime(StopTime time.Time) bool
- func CheckSuppFeat(suppFeat string, number int) bool
- func Convert(bytes int64) (DateRate string)
- func ConvertPacketInfoToFlowInformation(infos []models.PacketFilterInfo) (flowInfos []models.FlowInformation)
- func CreateCondData(id int32) models.ConditionData
- func CreateDefalutPccRules(id int32) *models.PccRule
- func CreatePccRule(id, precedence int32, flowInfo []models.FlowInformation, appID string) *models.PccRule
- func CreateQosData(id, var5qi, arp int32) models.QosData
- func CreateTcData(id int32, fullID string, flowStatus models.FlowStatus) *models.TrafficControlData
- func CreateUmData(umId string, thresh models.UsageThreshold) models.UsageMonitoringData
- func GetChgId(id int32) string
- func GetCondId(id int32) string
- func GetDefaultDataRate() models.UsageThreshold
- func GetDefaultTime() models.TimeWindow
- func GetNamfClient(uri string) *Namf_Communication.APIClient
- func GetNegotiateSuppFeat(suppFeat string, serviceSuppFeat []byte) string
- func GetNpcfAMPolicyCallbackClient() *Npcf_AMPolicy.APIClient
- func GetNpcfPolicyAuthorizationCallbackClient() *Npcf_PolicyAuthorization.APIClient
- func GetNpcfSMPolicyCallbackClient() *Npcf_SMPolicyControl.APIClient
- func GetNudrClient(uri string) *Nudr_DataRepository.APIClient
- func GetPackFiltId(id int32) string
- func GetPccRuleByAfAppId(pccRules map[string]*models.PccRule, afAppId string) *models.PccRule
- func GetPccRuleByFlowInfos(pccRules map[string]*models.PccRule, flowInfos []models.FlowInformation) *models.PccRule
- func GetPccRuleId(id int32) string
- func GetProblemDetail(errString, cause string) models.ProblemDetails
- func GetQosId(id int32) string
- func GetResourceUri(name models.ServiceName, id string) string
- func GetSMPolicyDnnData(data models.SmPolicyData, snssai *models.Snssai, dnn string) (result *models.SmPolicyDnnData)
- func GetTcId(id int32) string
- func GetUmId(sponId, aspId string) string
- func InitpcfContext(context *context.PCFContext)
- func MarshToJsonString(v interface{}) (result []string)
- func PolicyControlReqTrigToArray(bitMap uint64) (trigger []models.PolicyControlRequestTrigger)
- func SearchNFServiceUri(nfProfile models.NfProfile, serviceName models.ServiceName, ...) (nfUri string)
- func SetPccRuleRelatedData(decicion *models.SmPolicyDecision, pccRule *models.PccRule, ...)
- func SnssaiModelsToHex(snssai models.Snssai) string
Constants ¶
const TimeFormat = time.RFC3339
Variables ¶
var ( PCF_LOG_PATH = path_util.Free5gcPath("free5gc/pcfsslkey.log") PCF_PEM_PATH = path_util.Free5gcPath("free5gc/support/TLS/pcf.pem") PCF_KEY_PATH = path_util.Free5gcPath("free5gc/support/TLS/pcf.key") PCF_CONFIG_PATH = path_util.Free5gcPath("free5gc/config/pcfcfg.yaml") PCF_BASIC_PATH = "https://localhost:29507" ERROR_REQUEST_PARAMETERS = "ERROR_REQUEST_PARAMETERS" USER_UNKNOWN = "USER_UNKNOWN" CONTEXT_NOT_FOUND = "CONTEXT_NOT_FOUND" ERROR_INITIAL_PARAMETERS = "ERROR_INITIAL_PARAMETERS" POLICY_CONTEXT_DENIED = "POLICY_CONTEXT_DENIED" ERROR_TRIGGER_EVENT = "ERROR_TRIGGER_EVENT" ERROR_TRAFFIC_MAPPING_INFO_REJECTED = "ERROR_TRAFFIC_MAPPING_INFO_REJECTED" BDT_POLICY_NOT_FOUND = "BDT_POLICY_NOT_FOUND" REQUESTED_SERVICE_NOT_AUTHORIZED = "REQUESTED_SERVICE_NOT_AUTHORIZED" REQUESTED_SERVICE_TEMPORARILY_NOT_AUTHORIZED = "REQUESTED_SERVICE_TEMPORARILY_NOT_AUTHORIZED" // NWDAF UNAUTHORIZED_SPONSORED_DATA_CONNECTIVITY = "UNAUTHORIZED_SPONSORED_DATA_CONNECTIVITY" PDU_SESSION_NOT_AVAILABLE = "PDU_SESSION_NOT_AVAILABLE" APPLICATION_SESSION_CONTEXT_NOT_FOUND = "APPLICATION_SESSION_CONTEXT_NOT_FOUND" PcpErrHttpStatusMap = map[string]int32{ ERROR_REQUEST_PARAMETERS: http.StatusBadRequest, USER_UNKNOWN: http.StatusBadRequest, ERROR_INITIAL_PARAMETERS: http.StatusBadRequest, ERROR_TRIGGER_EVENT: http.StatusBadRequest, POLICY_CONTEXT_DENIED: http.StatusForbidden, ERROR_TRAFFIC_MAPPING_INFO_REJECTED: http.StatusForbidden, REQUESTED_SERVICE_NOT_AUTHORIZED: http.StatusForbidden, REQUESTED_SERVICE_TEMPORARILY_NOT_AUTHORIZED: http.StatusForbidden, UNAUTHORIZED_SPONSORED_DATA_CONNECTIVITY: http.StatusForbidden, CONTEXT_NOT_FOUND: http.StatusNotFound, BDT_POLICY_NOT_FOUND: http.StatusNotFound, APPLICATION_SESSION_CONTEXT_NOT_FOUND: http.StatusNotFound, PDU_SESSION_NOT_AVAILABLE: http.StatusInternalServerError, } )
Path of HTTP2 key and log file
var MediaTypeTo5qiMap = map[models.MediaType]int32{ models.MediaType_AUDIO: 1, models.MediaType_VIDEO: 2, models.MediaType_APPLICATION: 2, models.MediaType_DATA: 9, models.MediaType_CONTROL: 9, models.MediaType_TEXT: 9, models.MediaType_MESSAGE: 9, models.MediaType_OTHER: 9, }
Functions ¶
func CheckPolicyControlReqTrig ¶
func CheckPolicyControlReqTrig( triggers []models.PolicyControlRequestTrigger, reqTrigger models.PolicyControlRequestTrigger) bool
func CheckStopTime ¶
func CheckSuppFeat ¶
Check if Feature is Supported or not
func ConvertPacketInfoToFlowInformation ¶
func ConvertPacketInfoToFlowInformation(infos []models.PacketFilterInfo) (flowInfos []models.FlowInformation)
Convert Packet Filter information list to Flow Information List(Packet Filter Usage always true), EthDescription is Not Supported
func CreateCondData ¶
func CreateCondData(id int32) models.ConditionData
func CreateDefalutPccRules ¶
Create default pcc rule in PCF, TODO: use config file to pass default pcc rule
func CreatePccRule ¶
func CreatePccRule(id, precedence int32, flowInfo []models.FlowInformation, appID string) *models.PccRule
Create Pcc Rule with param id, precedence, flow information, appID
func CreateQosData ¶
func CreateTcData ¶
func CreateTcData(id int32, fullID string, flowStatus models.FlowStatus) *models.TrafficControlData
func CreateUmData ¶
func CreateUmData(umId string, thresh models.UsageThreshold) models.UsageMonitoringData
func GetDefaultDataRate ¶
func GetDefaultDataRate() models.UsageThreshold
func GetDefaultTime ¶
func GetDefaultTime() models.TimeWindow
func GetNamfClient ¶
func GetNamfClient(uri string) *Namf_Communication.APIClient
func GetNegotiateSuppFeat ¶
Negotiate Support Feture with PCF
func GetNpcfAMPolicyCallbackClient ¶
func GetNpcfAMPolicyCallbackClient() *Npcf_AMPolicy.APIClient
func GetNpcfPolicyAuthorizationCallbackClient ¶
func GetNpcfPolicyAuthorizationCallbackClient() *Npcf_PolicyAuthorization.APIClient
func GetNpcfSMPolicyCallbackClient ¶
func GetNpcfSMPolicyCallbackClient() *Npcf_SMPolicyControl.APIClient
func GetNudrClient ¶
func GetNudrClient(uri string) *Nudr_DataRepository.APIClient
func GetPccRuleByAfAppId ¶
func GetPccRuleByFlowInfos ¶
func GetProblemDetail ¶
func GetProblemDetail(errString, cause string) models.ProblemDetails
Return ProblemDatail, errString represent Detail, cause represent Cause of the fields
func GetResourceUri ¶
func GetResourceUri(name models.ServiceName, id string) string
Get Resource Uri (location Header) with param id string
func GetSMPolicyDnnData ¶
func GetSMPolicyDnnData(data models.SmPolicyData, snssai *models.Snssai, dnn string) (result *models.SmPolicyDnnData)
GetSMPolicyDnnData returns SMPolicyDnnData derived from SmPolicy data which snssai and dnn match
func InitpcfContext ¶
func InitpcfContext(context *context.PCFContext)
Init PCF Context from config flie
func MarshToJsonString ¶
func MarshToJsonString(v interface{}) (result []string)
MarshToJsonString returns value which can put into NewInterface()
func PolicyControlReqTrigToArray ¶
func PolicyControlReqTrigToArray(bitMap uint64) (trigger []models.PolicyControlRequestTrigger)
Use BitMap to generate requested policy control triggers, 1 means yes, 0 means no, see subscaulse 5.6.3.6-1 in TS29512
func SearchNFServiceUri ¶
func SearchNFServiceUri(nfProfile models.NfProfile, serviceName models.ServiceName, nfServiceStatus models.NfServiceStatus) (nfUri string)
SearchNFServiceUri returns NF Uri derived from NfProfile with corresponding service
func SetPccRuleRelatedData ¶
func SetPccRuleRelatedData(decicion *models.SmPolicyDecision, pccRule *models.PccRule, tcData *models.TrafficControlData, qosData *models.QosData, chgData *models.ChargingData, umData *models.UsageMonitoringData)
func SnssaiModelsToHex ¶
Convert Snssai form models to hexString(sst(2)+sd(6))
Types ¶
This section is empty.