Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a bug and do check mandatory IEs of bdtReqMsg #4

Merged
merged 1 commit into from
Dec 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions producer/bdtpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,13 @@ func HandleCreateBDTPolicyContextRequest(request *http_wrapper.Request) *http_wr
// step 1: log
logger.Bdtpolicylog.Infof("Handle CreateBDTPolicyContext")

// step 2: retrieve request
// step 2: retrieve request and check mandatory contents
requestMsg := request.Body.(models.BdtReqData)
if requestMsg.AspId == "" || requestMsg.DesTimeInt == nil || requestMsg.NumOfUes == 0 || requestMsg.VolPerUe == nil {
logger.Bdtpolicylog.Errorf("Required BdtReqData not found: AspId[%+v], DesTimeInt[%+v], NumOfUes[%+v], VolPerUe[%+v]",
requestMsg.AspId, requestMsg.DesTimeInt, requestMsg.NumOfUes, requestMsg.VolPerUe)
return http_wrapper.NewResponse(http.StatusNotFound, nil, nil)
}

// step 3: handle the message
header, response, problemDetails := createBDTPolicyContextProcedure(&requestMsg)
Expand Down Expand Up @@ -197,7 +202,7 @@ func createBDTPolicyContextProcedure(request *models.BdtReqData) (
}
}()
// TODO: decide BDT Policy from other bdt policy data
response.BdtReqData = deepcopy.Copy(&request).(*models.BdtReqData)
response.BdtReqData = deepcopy.Copy(request).(*models.BdtReqData)
var bdtData *models.BdtData
var bdtPolicyData models.BdtPolicyData
for _, data := range bdtDatas {
Expand Down