mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 22:30:09 +00:00
Added NRF
This commit is contained in:
parent
46f20cc979
commit
d0673e3066
397 changed files with 85455 additions and 209 deletions
30
lib/sbi/openapi/model/nf_status.c
Normal file
30
lib/sbi/openapi/model/nf_status.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "nf_status.h"
|
||||
|
||||
char* OpenAPI_nf_status_ToString(OpenAPI_nf_status_e nf_status)
|
||||
{
|
||||
const char *nf_statusArray[] = { "NULL", "REGISTERED", "SUSPENDED", "UNDISCOVERABLE" };
|
||||
size_t sizeofArray = sizeof(nf_statusArray) / sizeof(nf_statusArray[0]);
|
||||
if (nf_status < sizeofArray)
|
||||
return (char *)nf_statusArray[nf_status];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
OpenAPI_nf_status_e OpenAPI_nf_status_FromString(char* nf_status)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *nf_statusArray[] = { "NULL", "REGISTERED", "SUSPENDED", "UNDISCOVERABLE" };
|
||||
size_t sizeofArray = sizeof(nf_statusArray) / sizeof(nf_statusArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(nf_status, nf_statusArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue