mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-02 13:20:08 +00:00
Add AUSF, UDM, and UDR
This commit is contained in:
parent
0c0241d5e5
commit
72370ff0b2
1151 changed files with 140173 additions and 24799 deletions
30
lib/sbi/openapi/model/auth_method.c
Normal file
30
lib/sbi/openapi/model/auth_method.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "auth_method.h"
|
||||
|
||||
char* OpenAPI_auth_method_ToString(OpenAPI_auth_method_e auth_method)
|
||||
{
|
||||
const char *auth_methodArray[] = { "NULL", "5G_AKA", "EAP_AKA_PRIME", "EAP_TLS" };
|
||||
size_t sizeofArray = sizeof(auth_methodArray) / sizeof(auth_methodArray[0]);
|
||||
if (auth_method < sizeofArray)
|
||||
return (char *)auth_methodArray[auth_method];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
OpenAPI_auth_method_e OpenAPI_auth_method_FromString(char* auth_method)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *auth_methodArray[] = { "NULL", "5G_AKA", "EAP_AKA_PRIME", "EAP_TLS" };
|
||||
size_t sizeofArray = sizeof(auth_methodArray) / sizeof(auth_methodArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(auth_method, auth_methodArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue