forked from acouzens/open5gs
3gpp library is removed
This commit is contained in:
parent
118e7eb84d
commit
bd31662aec
|
@ -257,7 +257,6 @@ esac
|
|||
AC_CONFIG_FILES([lib/core/test/Makefile])
|
||||
AC_CONFIG_FILES([lib/core/Makefile])
|
||||
AC_CONFIG_FILES([lib/logger/Makefile])
|
||||
AC_CONFIG_FILES([lib/3gpp/Makefile])
|
||||
AC_CONFIG_FILES([lib/s1ap/asn1c/Makefile])
|
||||
AC_CONFIG_FILES([lib/s1ap/Makefile])
|
||||
AC_CONFIG_FILES([lib/nas/Makefile])
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
noinst_LTLIBRARIES = lib3gpp.la
|
||||
|
||||
lib3gpp_la_SOURCES = \
|
||||
3gpp_common.h plmn_id.h
|
||||
|
||||
nodist_lib3gpp_la_SOURCES = \
|
||||
plmn_id.c
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/lib/core/include
|
||||
|
||||
AM_CFLAGS = \
|
||||
-Wall -Werror
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
MOSTLYCLEANFILES = *.stackdump
|
||||
|
||||
EXTRA_DIST = .libs $(noinst_LTLIBRARIES)
|
|
@ -1,22 +0,0 @@
|
|||
#define TRACE_MODULE _plmn_id
|
||||
|
||||
#include "plmn_id.h"
|
||||
|
||||
#define PLMN_ID_DIGIT1(x) (((x) / 100) % 10)
|
||||
#define PLMN_ID_DIGIT2(x) (((x) / 10) % 10)
|
||||
#define PLMN_ID_DIGIT3(x) ((x) % 10)
|
||||
|
||||
void *plmn_id_to_buffer(plmn_id_t *plmn_id, c_uint8_t *buf)
|
||||
{
|
||||
buf[0] = (PLMN_ID_DIGIT2(plmn_id->mcc) << 4) | PLMN_ID_DIGIT1(plmn_id->mcc);
|
||||
|
||||
if (plmn_id->mnc_len == 2)
|
||||
buf[1] = (0xf << 4);
|
||||
else
|
||||
buf[1] = (PLMN_ID_DIGIT1(plmn_id->mnc) << 4);
|
||||
buf[1] |= PLMN_ID_DIGIT3(plmn_id->mcc);
|
||||
|
||||
buf[2] = (PLMN_ID_DIGIT3(plmn_id->mnc) << 4) | PLMN_ID_DIGIT2(plmn_id->mnc);
|
||||
|
||||
return buf;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
#ifndef __PLMN_ID_H__
|
||||
#define __PLMN_ID_H__
|
||||
|
||||
#include "core_errno.h"
|
||||
|
||||
#define PLMN_ID_LEN 3
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct _plmn_id_t {
|
||||
c_uint16_t mcc;
|
||||
c_uint16_t mnc;
|
||||
c_uint16_t mnc_len;
|
||||
} plmn_id_t;
|
||||
|
||||
CORE_DECLARE(void *) plmn_id_to_buffer(plmn_id_t *plmn_id, c_uint8_t *buf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* !__PLMN_ID_H__ */
|
|
@ -1,6 +1,6 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = core logger 3gpp s1ap nas s6a
|
||||
SUBDIRS = core logger s1ap nas s6a
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
MOSTLYCLEANFILES = *.stackdump
|
||||
|
|
|
@ -576,10 +576,9 @@ CORE_DECLARE(c_int32_t) nas_encode_nas_key_set_identifier(
|
|||
#define NAS_SECURITY_ALGORITHMS_128_EIA1 1
|
||||
#define NAS_SECURITY_ALGORITHMS_128_EIA2 2
|
||||
#define NAS_SECURITY_ALGORITHMS_128_EIA3 3
|
||||
#define NAS_SECURITY_ALGORITHMS_EIA4 4
|
||||
#define NAS_SECURITY_ALGORITHMS_EIA5 5
|
||||
#define NAS_SECURITY_ALGORITHMS_EIA6 6
|
||||
#define NAS_SECURITY_ALGORITHMS_EIA7 7
|
||||
#define NAS_SECURITY_ALGORITHMS_128_EEA1 1
|
||||
#define NAS_SECURITY_ALGORITHMS_128_EEA2 2
|
||||
#define NAS_SECURITY_ALGORITHMS_128_EEA3 3
|
||||
typedef struct _nas_security_algorithms_t {
|
||||
ED4(c_uint8_t spare1:1;,
|
||||
c_uint8_t type_of_ciphering_algorithm:1;,
|
||||
|
|
|
@ -18,14 +18,12 @@ nodist_libmme_la_SOURCES = \
|
|||
|
||||
libmme_la_DEPENDENCIES = \
|
||||
$(top_srcdir)/lib/core/src/libcore.la \
|
||||
$(top_srcdir)/lib/3gpp/lib3gpp.la \
|
||||
$(top_srcdir)/lib/s1ap/libs1ap.la \
|
||||
$(top_srcdir)/lib/nas/libnas.la \
|
||||
$(top_srcdir)/lib/s6a/libs6a.la
|
||||
|
||||
libmme_la_LIBADD = \
|
||||
$(top_srcdir)/lib/core/src/libcore.la \
|
||||
$(top_srcdir)/lib/3gpp/lib3gpp.la \
|
||||
$(top_srcdir)/lib/s1ap/libs1ap.la \
|
||||
$(top_srcdir)/lib/nas/libnas.la \
|
||||
$(top_srcdir)/lib/s6a/libs6a.la
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "core_net.h"
|
||||
#include "core_sha2.h"
|
||||
|
||||
#include "plmn_id.h"
|
||||
#include "3gpp_message.h"
|
||||
#include "sm.h"
|
||||
|
||||
|
@ -14,6 +13,8 @@
|
|||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define PLMN_ID_LEN 3
|
||||
|
||||
#define MAX_PLMN_ID 6
|
||||
#define GRP_PER_MME 256 /* According to spec it is 65535 */
|
||||
#define CODE_PER_MME 256 /* According to spec it is 256 */
|
||||
|
@ -21,6 +22,12 @@ extern "C" {
|
|||
typedef list_t ue_list_t;
|
||||
typedef list_t rab_list_t;
|
||||
|
||||
typedef struct _plmn_id_t {
|
||||
c_uint16_t mcc;
|
||||
c_uint16_t mnc;
|
||||
c_uint16_t mnc_len;
|
||||
} plmn_id_t;
|
||||
|
||||
typedef struct _served_gummei {
|
||||
c_uint32_t num_of_plmn_id;
|
||||
plmn_id_t plmn_id[MAX_PLMN_ID];
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include "core_debug.h"
|
||||
|
||||
#include "plmn_id.h"
|
||||
#include "s1ap_conv.h"
|
||||
|
||||
void s1ap_uint8_to_OCTET_STRING(c_uint8_t uint8, OCTET_STRING_t *octet_string)
|
||||
|
@ -33,6 +32,25 @@ void s1ap_uint32_to_OCTET_STRING(c_uint32_t uint32, OCTET_STRING_t *octet_string
|
|||
octet_string->buf[0] = uint32;
|
||||
}
|
||||
|
||||
#define PLMN_ID_DIGIT1(x) (((x) / 100) % 10)
|
||||
#define PLMN_ID_DIGIT2(x) (((x) / 10) % 10)
|
||||
#define PLMN_ID_DIGIT3(x) ((x) % 10)
|
||||
|
||||
void *s1ap_plmn_id_to_buffer(plmn_id_t *plmn_id, c_uint8_t *buf)
|
||||
{
|
||||
buf[0] = (PLMN_ID_DIGIT2(plmn_id->mcc) << 4) | PLMN_ID_DIGIT1(plmn_id->mcc);
|
||||
|
||||
if (plmn_id->mnc_len == 2)
|
||||
buf[1] = (0xf << 4);
|
||||
else
|
||||
buf[1] = (PLMN_ID_DIGIT1(plmn_id->mnc) << 4);
|
||||
buf[1] |= PLMN_ID_DIGIT3(plmn_id->mcc);
|
||||
|
||||
buf[2] = (PLMN_ID_DIGIT3(plmn_id->mnc) << 4) | PLMN_ID_DIGIT2(plmn_id->mnc);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
void s1ap_plmn_id_to_TBCD_STRING(
|
||||
plmn_id_t *plmn_id, S1ap_TBCD_STRING_t *tbcd_string)
|
||||
|
||||
|
@ -40,7 +58,7 @@ void s1ap_plmn_id_to_TBCD_STRING(
|
|||
tbcd_string->size = 3;
|
||||
tbcd_string->buf = core_calloc(tbcd_string->size, sizeof(c_uint8_t));
|
||||
|
||||
plmn_id_to_buffer(plmn_id, tbcd_string->buf);
|
||||
s1ap_plmn_id_to_buffer(plmn_id, tbcd_string->buf);
|
||||
}
|
||||
|
||||
void s1ap_uint32_to_ENB_ID(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef __S1AP_CONV_H__
|
||||
#define __S1AP_CONV_H__
|
||||
|
||||
#include "plmn_id.h"
|
||||
#include "context.h"
|
||||
#include "s1ap_message.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -15,6 +15,8 @@ CORE_DECLARE(void) s1ap_uint16_to_OCTET_STRING(
|
|||
CORE_DECLARE(void) s1ap_uint32_to_OCTET_STRING(
|
||||
c_uint32_t uint32, OCTET_STRING_t *octet_string);
|
||||
|
||||
CORE_DECLARE(void *) s1ap_plmn_id_to_buffer(
|
||||
plmn_id_t *plmn_id, c_uint8_t *buf);
|
||||
CORE_DECLARE(void) s1ap_plmn_id_to_TBCD_STRING(
|
||||
plmn_id_t *plmn_id, S1ap_TBCD_STRING_t *tbcd_string);
|
||||
|
||||
|
|
|
@ -9,9 +9,10 @@
|
|||
#include "context.h"
|
||||
#include "event.h"
|
||||
|
||||
#include "s1ap_path.h"
|
||||
#include "s1ap_conv.h"
|
||||
#include "nas_conv.h"
|
||||
#include "s6a_sm.h"
|
||||
#include "s1ap_path.h"
|
||||
|
||||
static void ue_emm_handle_attach_request(ue_ctx_t *ue, nas_message_t *message);
|
||||
static void ue_emm_handle_authentication_request(
|
||||
|
@ -142,7 +143,7 @@ static void ue_emm_handle_attach_request(ue_ctx_t *ue, nas_message_t *message)
|
|||
{
|
||||
c_uint8_t plmn_id[PLMN_ID_LEN];
|
||||
|
||||
plmn_id_to_buffer(&mme_self()->plmn_id, plmn_id);
|
||||
s1ap_plmn_id_to_buffer(&mme_self()->plmn_id, plmn_id);
|
||||
if (attach_request->presencemask &
|
||||
NAS_ATTACH_REQUEST_LAST_VISITED_REGISTERED_TAI_PRESENT)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue