Skip to content

Commit

Permalink
[SBI] Add support for DeregistrationData in SBI messages
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeglic authored and acetcom committed Jul 11, 2022
1 parent d1a2971 commit 0633774
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/sbi/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ void ogs_sbi_message_free(ogs_sbi_message_t *message)
OpenAPI_sm_policy_notification_free(message->SmPolicyNotification);
if (message->TerminationNotification)
OpenAPI_termination_notification_free(message->TerminationNotification);
if (message->DeregistrationData)
OpenAPI_deregistration_data_free(message->DeregistrationData);

for (i = 0; i < message->num_of_part; i++) {
if (message->part[i].pkbuf)
Expand Down Expand Up @@ -888,6 +890,10 @@ static char *build_json(ogs_sbi_message_t *message)
item = OpenAPI_termination_notification_convertToJSON(
message->TerminationNotification);
ogs_assert(item);
} else if (message->DeregistrationData) {
item = OpenAPI_deregistration_data_convertToJSON(
message->DeregistrationData);
ogs_assert(item);
}

if (item) {
Expand Down Expand Up @@ -1726,6 +1732,15 @@ static int parse_json(ogs_sbi_message_t *message,
}
break;

CASE(OGS_SBI_RESOURCE_NAME_DEREG_NOTIFY)
message->DeregistrationData =
OpenAPI_deregistration_data_parseFromJSON(item);
if (!message->DeregistrationData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;

DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
Expand Down
1 change: 1 addition & 0 deletions lib/sbi/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ typedef struct ogs_sbi_message_s {
*AppSessionContextUpdateDataPatch;
OpenAPI_sm_policy_notification_t *SmPolicyNotification;
OpenAPI_termination_notification_t *TerminationNotification;
OpenAPI_deregistration_data_t *DeregistrationData;

ogs_sbi_links_t *links;

Expand Down
1 change: 1 addition & 0 deletions lib/sbi/ogs-sbi.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
#include "model/policy_update.h"
#include "model/sm_policy_notification.h"
#include "model/termination_notification.h"
#include "model/deregistration_data.h"

#include "custom/links.h"
#include "custom/ue_authentication_ctx.h"
Expand Down

0 comments on commit 0633774

Please sign in to comment.