update it

This commit is contained in:
Sukchan Lee 2017-07-14 20:46:15 +09:00
parent 1fe12dae1c
commit df371f3b66
4 changed files with 85 additions and 25 deletions

View File

@ -60,8 +60,6 @@ status_t mme_context_init()
/* MCC : 001, MNC : 01 */ /* MCC : 001, MNC : 01 */
plmn_id_build(&self.plmn_id, 1, 1, 2); plmn_id_build(&self.plmn_id, 1, 1, 2);
self.tracking_area_code = 12345; self.tracking_area_code = 12345;
self.default_paging_drx = S1ap_PagingDRX_v64;
self.relative_capacity = 0xff;
self.srvd_gummei.num_of_plmn_id = 1; self.srvd_gummei.num_of_plmn_id = 1;
/* MCC : 001, MNC : 01 */ /* MCC : 001, MNC : 01 */
@ -82,6 +80,8 @@ status_t mme_context_init()
static status_t mme_context_prepare() static status_t mme_context_prepare()
{ {
self.relative_capacity = 0xff;
self.s1ap_port = S1AP_SCTP_PORT; self.s1ap_port = S1AP_SCTP_PORT;
self.s11_port = GTPV2_C_UDP_PORT; self.s11_port = GTPV2_C_UDP_PORT;
@ -121,6 +121,19 @@ static status_t mme_context_validation()
sgw = mme_sgw_next(sgw); sgw = mme_sgw_next(sgw);
} }
if (self.num_of_integrity_order == 0)
{
d_error("No MME.SECURITY.INTEGRITY_ORDER in '%s'",
context_self()->config.path);
return CORE_ERROR;
}
if (self.num_of_ciphering_order == 0)
{
d_error("No MME.SECURITY.CIPHERING_ORDER in '%s'",
context_self()->config.path);
return CORE_ERROR;
}
return CORE_OK; return CORE_OK;
} }
@ -196,13 +209,10 @@ status_t mme_context_parse_config()
} }
case MME_ROOT: case MME_ROOT:
{ {
if (jsmntok_equal(json, t, "DEFAULT_PAGING_DRX") == 0) if (jsmntok_equal(json, t, "RELATIVE_CAPACITY") == 0)
{ {
printf("paging_drx : %s\n", jsmntok_to_string(json, t+1)); char *v = jsmntok_to_string(json, t+1);
} if (v) self.relative_capacity = atoi(v);
else if (jsmntok_equal(json, t, "RELATIVE_CAPACITY") == 0)
{
printf("relative : %s\n", jsmntok_to_string(json, t+1));
} }
else if (jsmntok_equal(json, t, "NETWORK") == 0) else if (jsmntok_equal(json, t, "NETWORK") == 0)
{ {
@ -329,8 +339,35 @@ status_t mme_context_parse_config()
for (arr = 0; arr < size; arr++) for (arr = 0; arr < size; arr++)
{ {
printf("%s\n", char *v = jsmntok_to_string(json, t+m+p);
jsmntok_to_string(json, t+m+p)); if (v)
{
if (strcmp(v, "EIA0") == 0)
{
self.integrity_order[arr] =
NAS_SECURITY_ALGORITHMS_EIA0;
self.num_of_integrity_order++;
}
else if (strcmp(v, "EIA1") == 0)
{
self.integrity_order[arr] =
NAS_SECURITY_ALGORITHMS_128_EIA1;
self.num_of_integrity_order++;
}
else if (strcmp(v, "EIA2") == 0)
{
self.integrity_order[arr] =
NAS_SECURITY_ALGORITHMS_128_EIA2;
self.num_of_integrity_order++;
}
else if (strcmp(v, "EIA3") == 0)
{
self.integrity_order[arr] =
NAS_SECURITY_ALGORITHMS_128_EIA3;
self.num_of_integrity_order++;
}
}
p++; p++;
} }
} }
@ -347,8 +384,34 @@ status_t mme_context_parse_config()
for (arr = 0; arr < size; arr++) for (arr = 0; arr < size; arr++)
{ {
printf("%s\n", char *v = jsmntok_to_string(json, t+m+p);
jsmntok_to_string(json, t+m+p)); if (v)
{
if (strcmp(v, "EEA0") == 0)
{
self.ciphering_order[arr] =
NAS_SECURITY_ALGORITHMS_EEA0;
self.num_of_ciphering_order++;
}
else if (strcmp(v, "EEA1") == 0)
{
self.ciphering_order[arr] =
NAS_SECURITY_ALGORITHMS_128_EEA1;
self.num_of_ciphering_order++;
}
else if (strcmp(v, "EEA2") == 0)
{
self.ciphering_order[arr] =
NAS_SECURITY_ALGORITHMS_128_EEA2;
self.num_of_ciphering_order++;
}
else if (strcmp(v, "EEA3") == 0)
{
self.ciphering_order[arr] =
NAS_SECURITY_ALGORITHMS_128_EEA3;
self.num_of_ciphering_order++;
}
}
p++; p++;
} }
} }

View File

@ -25,6 +25,8 @@ extern "C" {
#define GRP_PER_MME 256 /* According to spec it is 65535 */ #define GRP_PER_MME 256 /* According to spec it is 65535 */
#define CODE_PER_MME 256 /* According to spec it is 256 */ #define CODE_PER_MME 256 /* According to spec it is 256 */
#define MAX_NUM_OF_ALGORITHM 8
typedef struct _served_gummei { typedef struct _served_gummei {
c_uint32_t num_of_plmn_id; c_uint32_t num_of_plmn_id;
plmn_id_t plmn_id[MAX_PLMN_ID]; plmn_id_t plmn_id[MAX_PLMN_ID];
@ -56,17 +58,20 @@ typedef struct _mme_context_t {
* #define NAS_SECURITY_ALGORITHMS_128_EEA1 1 * #define NAS_SECURITY_ALGORITHMS_128_EEA1 1
* #define NAS_SECURITY_ALGORITHMS_128_EEA2 2 * #define NAS_SECURITY_ALGORITHMS_128_EEA2 2
* #define NAS_SECURITY_ALGORITHMS_128_EEA3 3 */ * #define NAS_SECURITY_ALGORITHMS_128_EEA3 3 */
c_uint8_t num_of_ciphering_order;
c_uint8_t ciphering_order[MAX_NUM_OF_ALGORITHM];
c_uint8_t selected_enc_algorithm; c_uint8_t selected_enc_algorithm;
/* defined in 'nas_ies.h' /* defined in 'nas_ies.h'
* #define NAS_SECURITY_ALGORITHMS_EIA0 0 * #define NAS_SECURITY_ALGORITHMS_EIA0 0
* #define NAS_SECURITY_ALGORITHMS_128_EIA1 1 * #define NAS_SECURITY_ALGORITHMS_128_EIA1 1
* #define NAS_SECURITY_ALGORITHMS_128_EIA1 2 * #define NAS_SECURITY_ALGORITHMS_128_EIA1 2
* #define NAS_SECURITY_ALGORITHMS_128_EIA3 3 */ * #define NAS_SECURITY_ALGORITHMS_128_EIA3 3 */
c_uint8_t num_of_integrity_order;
c_uint8_t integrity_order[MAX_NUM_OF_ALGORITHM];
c_uint8_t selected_int_algorithm; c_uint8_t selected_int_algorithm;
/* S1SetupRequest */ /* S1SetupRequest */
c_uint16_t tracking_area_code; c_uint16_t tracking_area_code;
c_uint16_t default_paging_drx;
/* S1SetupResponse */ /* S1SetupResponse */
srvd_gummei_t srvd_gummei; srvd_gummei_t srvd_gummei;

View File

@ -12,14 +12,12 @@
S6A_CONFIG_PATH : "/Users/acetcom/Documents/git/nextepc/install/mme_fd.conf", S6A_CONFIG_PATH : "/Users/acetcom/Documents/git/nextepc/install/mme_fd.conf",
DEFAULT_PAGING_DRX : "v64", DEFAULT_PAGING_DRX : "v64",
RELATIVE_CAPACITY : 255, #RELATIVE_CAPACITY : 255,
NETWORK : NETWORK :
{ {
S1AP_ADDR : "10.1.35.215", S1AP_ADDR : "10.1.35.215",
#S1AP_PORT : 36412,
S11_ADDR: "10.1.35.215", S11_ADDR: "10.1.35.215",
#S11_PORT: 2123
} }
GUMMEI: GUMMEI:
[ [
@ -51,14 +49,10 @@
[ [
{ {
S11_ADDR: "10.1.35.216", S11_ADDR: "10.1.35.216",
#S11_PORT: 2123,
S1U_ADDR: "10.1.35.216", S1U_ADDR: "10.1.35.216",
#S1U_PORT: 2125,
S5C_ADDR: "10.1.35.217", S5C_ADDR: "10.1.35.217",
#S5C_PORT: 2123, S5U_ADDR: "10.1.35.217"
S5U_ADDR: "10.1.35.217",
#S5U_PORT: 2125
} }
] ]
} }
@ -68,9 +62,7 @@
NETWORK : NETWORK :
{ {
S5C_ADDR: "10.1.35.219", S5C_ADDR: "10.1.35.219",
#S5C_PORT: 2123, S5U_ADDR: "10.1.35.219"
S5U_ADDR: "10.1.35.219",
#S5U_PORT: 2125
} }
DNS : DNS :

View File

@ -95,7 +95,7 @@ status_t tests1ap_build_setup_req(pkbuf_t **pkbuf, c_uint32_t enb_id)
ASN_SEQUENCE_ADD(&ies->supportedTAs, supportedTA); ASN_SEQUENCE_ADD(&ies->supportedTAs, supportedTA);
ies->defaultPagingDRX = mme_self()->default_paging_drx; ies->defaultPagingDRX = S1ap_PagingDRX_v64;
message.direction = S1AP_PDU_PR_initiatingMessage; message.direction = S1AP_PDU_PR_initiatingMessage;
message.procedureCode = S1ap_ProcedureCode_id_S1Setup; message.procedureCode = S1ap_ProcedureCode_id_S1Setup;