update it

This commit is contained in:
Sukchan Lee 2017-04-06 17:10:26 +09:00
parent c10658a3fc
commit e121488fa5
22 changed files with 64 additions and 104 deletions

View File

@ -1,8 +1,6 @@
#define TRACE_MODULE _3gppconv
#define TRACE_MODULE _3gpp_common
#include "core_debug.h"
#include "3gpp_conv.h"
#include "3gpp_common.h"
#define PLMN_ID_DIGIT1(x) (((x) / 100) % 10)
#define PLMN_ID_DIGIT2(x) (((x) / 10) % 10)

46
lib/3gpp/3gpp_common.h Normal file
View File

@ -0,0 +1,46 @@
#ifndef __3GPP_COMMON_H__
#define __3GPP_COMMON_H__
#include "core.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define MAX_UE_PER_ENB 128
#define MAX_NUM_OF_ENB 128
#define MAX_NUM_OF_UE (MAX_NUM_OF_ENB * MAX_UE_PER_ENB)
#define IPV6_LEN 16
#define MAX_SDU_LEN 2048
#define PLMN_ID_LEN 3
#define MAX_IMSI_LEN 15
#define RAND_LEN 16
#define AUTN_LEN 16
#define MAX_RES_LEN 16
typedef struct _plmn_id_t {
ED2(c_uint8_t mcc2:4;,
c_uint8_t mcc1:4;)
ED2(c_uint8_t mnc1:4;,
c_uint8_t mcc3:4;)
ED2(c_uint8_t mnc3:4;,
c_uint8_t mnc2:4;)
} __attribute__ ((packed)) plmn_id_t;
CORE_DECLARE(c_uint16_t) plmn_id_mcc(plmn_id_t *plmn_id);
CORE_DECLARE(c_uint16_t) plmn_id_mnc(plmn_id_t *plmn_id);
CORE_DECLARE(c_uint16_t) plmn_id_mnc_len(plmn_id_t *plmn_id);
CORE_DECLARE(void *) plmn_id_build(plmn_id_t *plmn_id,
c_uint16_t mcc, c_uint16_t mnc, c_uint16_t mnc_len);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __3GPP_COMMON_H__ */

View File

@ -1,22 +0,0 @@
#ifndef __3GPP_CONV_H__
#define __3GPP_CONV_H__
#include "3gpp_types.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
CORE_DECLARE(c_uint16_t) plmn_id_mcc(plmn_id_t *plmn_id);
CORE_DECLARE(c_uint16_t) plmn_id_mnc(plmn_id_t *plmn_id);
CORE_DECLARE(c_uint16_t) plmn_id_mnc_len(plmn_id_t *plmn_id);
CORE_DECLARE(void *) plmn_id_build(plmn_id_t *plmn_id,
c_uint16_t mcc, c_uint16_t mnc, c_uint16_t mnc_len);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __3GPP_CONV_H__ */

View File

@ -1,27 +0,0 @@
#ifndef __3GPP_DEFS_H__
#define __3GPP_DEFS_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define MAX_UE_PER_ENB 128
#define MAX_NUM_OF_ENB 128
#define MAX_NUM_OF_UE (MAX_NUM_OF_ENB * MAX_UE_PER_ENB)
#define IPV6_LEN 16
#define MAX_SDU_LEN 2048
#define PLMN_ID_LEN 3
#define MAX_IMSI_LEN 15
#define RAND_LEN 16
#define AUTN_LEN 16
#define MAX_RES_LEN 16
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __3GPP_DEFS_H__ */

View File

@ -1,23 +0,0 @@
#ifndef __3GPP_TYPES_H__
#define __3GPP_TYPES_H__
#include "core.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _plmn_id_t {
ED2(c_uint8_t mcc2:4;,
c_uint8_t mcc1:4;)
ED2(c_uint8_t mnc1:4;,
c_uint8_t mcc3:4;)
ED2(c_uint8_t mnc3:4;,
c_uint8_t mnc2:4;)
} __attribute__ ((packed)) plmn_id_t;
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* !__3GPP_TYPES_H__ */

View File

@ -3,10 +3,10 @@
noinst_LTLIBRARIES = lib3gpp.la
lib3gpp_la_SOURCES = \
3gpp_message.h 3gpp_conv.h
3gpp_common.h
nodist_lib3gpp_la_SOURCES = \
3gpp_conv.c
3gpp_common.c
AM_CPPFLAGS = \
-I$(top_srcdir)/lib/core/include

View File

@ -3,7 +3,7 @@
#include "core_pkbuf.h"
#include "core_net.h"
#include "3gpp_defs.h"
#include "3gpp_common.h"
#include "gtp_path.h"
status_t gtp_listen(net_sock_t **sock,

View File

@ -2,8 +2,7 @@
#define __GTP_TYPES_H__
#include "core_tlv_msg.h"
#include "3gpp_defs.h"
#include "3gpp_types.h"
#include "3gpp_common.h"
#ifdef __cplusplus
extern "C" {

View File

@ -1,8 +1,7 @@
#ifndef _NAS_TYPES_H__
#define _NAS_TYPES_H__
#include "3gpp_defs.h"
#include "3gpp_types.h"
#include "3gpp_common.h"
#ifdef __cplusplus
extern "C" {

View File

@ -3,7 +3,7 @@
#include "core_debug.h"
#include "core_lib.h"
#include "3gpp_defs.h"
#include "3gpp_common.h"
#include "s1ap_message.h"
static inline int s1ap_encode_initiating_message(

View File

@ -3,7 +3,7 @@
#include "core_list.h"
#include "core_errno.h"
#include "3gpp_defs.h"
#include "3gpp_common.h"
#ifdef __cplusplus
extern "C" {

View File

@ -3,7 +3,6 @@
#include "core_debug.h"
#include "core_pool.h"
#include "3gpp_conv.h"
#include "gtp_path.h"
#include "s1ap_message.h"

View File

@ -6,8 +6,7 @@
#include "core_net.h"
#include "core_sha2.h"
#include "3gpp_defs.h"
#include "3gpp_types.h"
#include "3gpp_common.h"
#include "nas_types.h"
#include "gtp_xact.h"

View File

@ -2,10 +2,10 @@
#include "core_debug.h"
#include "3gpp_conv.h"
#include "gtp_types.h"
#include "gtp_tlv.h"
#include "3gpp_common.h"
#include "mme_ctx.h"
status_t mme_s11_build_create_session_req(

View File

@ -99,11 +99,6 @@ status_t mme_s11_send_to_sgw(void *sgw,
}
#include "mme_s11_build.h"
#include "3gpp_types.h"
#include "3gpp_conv.h"
#include "gtp_types.h"
#include "gtp_tlv.h"
#include "core_lib.h"
void test_send()
{
pkbuf_t *pkbuf;

View File

@ -2,7 +2,7 @@
#include "core_debug.h"
#include "3gpp_conv.h"
#include "3gpp_common.h"
#include "s1ap_conv.h"
void s1ap_uint8_to_OCTET_STRING(c_uint8_t uint8, OCTET_STRING_t *octet_string)

View File

@ -3,7 +3,7 @@
#include "core_pkbuf.h"
#include "core_net.h"
#include "3gpp_defs.h"
#include "3gpp_common.h"
#include "gtp_path.h"
#include "pgw_ctx.h"

View File

@ -4,7 +4,7 @@
#include "core_pool.h"
#include "core_index.h"
#include "3gpp_defs.h"
#include "3gpp_common.h"
#include "gtp_path.h"
#include "sgw_ctx.h"

View File

@ -3,7 +3,7 @@
#include "core_pkbuf.h"
#include "core_net.h"
#include "3gpp_defs.h"
#include "3gpp_common.h"
#include "gtp_path.h"
#include "sgw_ctx.h"

View File

@ -1,9 +1,7 @@
#include "core_lib.h"
#include "core_debug.h"
#include "3gpp_defs.h"
#include "3gpp_types.h"
#include "3gpp_conv.h"
#include "3gpp_common.h"
#include "testutil.h"

View File

@ -3,8 +3,7 @@
#include "core_debug.h"
#include "core_net.h"
#include "3gpp_defs.h"
#include "3gpp_conv.h"
#include "3gpp_common.h"
#include "gtp_types.h"
#include "gtp_tlv.h"

View File

@ -3,7 +3,7 @@
#include "testutil.h"
#include "3gpp_conv.h"
#include "3gpp_common.h"
#include "nas_message.h"
#include "nas_security.h"