This commit is contained in:
Sukchan Lee 2017-03-07 15:44:21 +09:00
parent 48bc61d06a
commit 906356cdea
3 changed files with 56 additions and 17 deletions

View File

@ -189,26 +189,36 @@ static void enb_s1ap_handle_s1_setup_request(
rv = s1ap_build_setup_failure(&sendbuf, cause);
}
#endif
d_info("eNB[0x%x] sends S1-Setup-Request from [%s]", enb_id,
INET_NTOP(&enb->s1ap_sock->remote.sin_addr.s_addr, buf));
d_assert(enb->s1ap_sock, return,);
d_info("[S1AP] S1SetupRequest : eNB[%s:%d] --> MME",
INET_NTOP(&enb->s1ap_sock->remote.sin_addr.s_addr, buf),
enb_id);
enb->enb_id = enb_id;
d_assert(s1ap_build_setup_rsp(&sendbuf) == CORE_OK,
return, "build error");
d_assert(s1ap_send_to_enb(enb, sendbuf) == CORE_OK, , "send error");
d_assert(enb->s1ap_sock, return,);
d_info("[S1AP] S1SetupResponse: eNB[%s:%d] <-- MME",
INET_NTOP(&enb->s1ap_sock->remote.sin_addr.s_addr, buf),
enb_id);
}
static void enb_s1ap_handle_initial_ue_message(
enb_ctx_t *enb, s1ap_message_t *message)
{
char buf[INET_ADDRSTRLEN];
ue_ctx_t *ue = NULL;
S1ap_InitialUEMessage_IEs_t *ies = NULL;
S1ap_NAS_PDU_t *nasPdu = NULL;
event_t e;
pkbuf_t *sendbuf = NULL;
d_assert(enb, return, "Null param");
ies = &message->s1ap_InitialUEMessage_IEs;
d_assert(ies, return, "Null param");
@ -227,8 +237,11 @@ static void enb_s1ap_handle_initial_ue_message(
enb->enb_id, ue->enb_ue_s1ap_id);
}
d_info("eNB[0x%x] sends Initial-UE Message[eNB-UE-S1AP-ID(%d)]",
enb->enb_id, ue->enb_ue_s1ap_id);
d_assert(enb->s1ap_sock, mme_ctx_ue_remove(ue);return,);
d_info("[S1AP] InitialUEMessage : UE[eNB-UE-S1AP-ID(%d)] --> eNB[%s:%d]",
ue->enb_ue_s1ap_id,
INET_NTOP(&enb->s1ap_sock->remote.sin_addr.s_addr, buf),
enb->enb_id);
nasPdu = &ies->nas_pdu;
d_assert(nasPdu, mme_ctx_ue_remove(ue); return, "Null param");
@ -253,6 +266,8 @@ static void enb_s1ap_handle_initial_ue_message(
static void enb_s1ap_handle_uplink_nas_transport(
enb_ctx_t *enb, s1ap_message_t *message)
{
char buf[INET_ADDRSTRLEN];
ue_ctx_t *ue = NULL;
S1ap_UplinkNASTransport_IEs_t *ies = NULL;
S1ap_NAS_PDU_t *nasPdu = NULL;
@ -265,8 +280,10 @@ static void enb_s1ap_handle_uplink_nas_transport(
ue = mme_ctx_ue_find_by_enb_ue_s1ap_id(enb, ies->eNB_UE_S1AP_ID);
d_assert(ue, return, "Null param");
d_info("eNB[0x%x] sends uplinkNASTransport Message[eNB-UE-S1AP-ID(%d)]",
enb->enb_id, ue->enb_ue_s1ap_id);
d_info("[S1AP] uplinkNASTransport : UE[eNB-UE-S1AP-ID(%d)] --> eNB[%s:%d]",
ue->enb_ue_s1ap_id,
INET_NTOP(&enb->s1ap_sock->remote.sin_addr.s_addr, buf),
enb->enb_id);
nasPdu = &ies->nas_pdu;
d_assert(nasPdu, mme_ctx_ue_remove(ue); return, "Null param");

View File

@ -113,6 +113,10 @@ int s6a_send_auth_info_req(ue_ctx_t *ue, c_uint8_t *plmn_id)
s6a_config->stats.nb_sent++;
d_assert(pthread_mutex_unlock(&s6a_config->stats_lock) == 0,, );
d_assert(ue->imsi, return 0,);
d_info("[S6A] Authentication-Information-Request : UE[%s] --> HSS",
ue->imsi);
return 0;
out:
@ -152,6 +156,10 @@ static void s6a_aia_cb(void *data, struct msg **msg)
ue = mi->ue;
d_assert(ue, error++; goto out,);
d_assert(ue->imsi, error++; goto out,);
d_info("[S6A] Authentication-Information-Response : UE[%s] <-- HSS",
ue->imsi);
/* Value of Result Code */
d_assert(fd_msg_search_avp(*msg, s6a_result_code, &avp) == 0 && avp,
@ -238,11 +246,11 @@ out:
/* Display how long it took */
if (ts.tv_nsec > mi->ts.tv_nsec)
d_info("in %d.%06ld sec",
d_trace(1, "in %d.%06ld sec\n",
(int)(ts.tv_sec - mi->ts.tv_sec),
(long)(ts.tv_nsec - mi->ts.tv_nsec) / 1000);
else
d_info("in %d.%06ld sec",
d_trace(1, "in %d.%06ld sec\n",
(int)(ts.tv_sec + 1 - mi->ts.tv_sec),
(long)(1000000000 + ts.tv_nsec - mi->ts.tv_nsec) / 1000);

View File

@ -84,8 +84,8 @@ void ue_emm_state_operational(ue_emm_sm_t *s, event_t *e)
{
ue_emm_send_to_ue(ue, recvbuf);
d_assert(ue->imsi, return, "no UE-IMSI");
d_info("EMM sends Authentication-Request to UE[%s]",
d_assert(ue->imsi, return,);
d_info("[NAS] Authentication request : UE[%s] <-- EMM",
ue->imsi);
break;
}
@ -97,6 +97,9 @@ void ue_emm_state_operational(ue_emm_sm_t *s, event_t *e)
}
case NAS_SECURITY_MODE_COMPLETE:
{
d_assert(ue->imsi, return,);
d_info("[NAS] Security mode complete : UE[%s] --> EMM",
ue->imsi);
break;
}
default:
@ -176,6 +179,9 @@ static void ue_emm_handle_attach_request(
&attach_request->ms_network_capability,
sizeof(attach_request->ms_network_capability));
d_assert(ue->imsi, return,);
d_info("[NAS] Attach request : UE[%s] --> EMM", ue->imsi);
s6a_send_auth_info_req(ue, plmn_id);
break;
}
@ -187,9 +193,6 @@ static void ue_emm_handle_attach_request(
return;
}
}
d_assert(ue->imsi, return, "no UE-IMSI");
d_info("UE[%s] sends Attach-Request", ue->imsi);
}
static void ue_emm_handle_authentication_response(
@ -219,6 +222,9 @@ static void ue_emm_handle_authentication_response(
return;
}
d_assert(ue->imsi, return, );
d_info("[NAS] Authentication response : UE[%s] --> EMM", ue->imsi);
memset(&message, 0, sizeof(message));
message.h.protocol_discriminator = NAS_PROTOCOL_DISCRIMINATOR_EMM;
message.h.message_type = NAS_SECURITY_MODE_COMMAND;
@ -253,13 +259,14 @@ static void ue_emm_handle_authentication_response(
d_assert(nas_encode_pdu(&sendbuf, &message) == CORE_OK && sendbuf,,);
ue_emm_send_to_ue(ue, sendbuf);
d_assert(ue->imsi, return, "no UE-IMSI");
d_info("EMM sends Security-mode Command to UE[%s]",
ue->imsi);
d_assert(ue->imsi, return,);
d_info("[NAS] Security mode command : UE[%s] <-- EMM", ue->imsi);
}
static void ue_emm_send_to_ue(ue_ctx_t *ue, pkbuf_t *pkbuf)
{
char buf[INET_ADDRSTRLEN];
int encoded;
s1ap_message_t message;
S1ap_DownlinkNASTransport_IEs_t *ies =
@ -284,4 +291,11 @@ static void ue_emm_send_to_ue(ue_ctx_t *ue, pkbuf_t *pkbuf)
d_assert(encoded >= 0, , "encode failed");
d_assert(s1ap_send_to_enb(ue->enb, sendbuf) == CORE_OK, , "send error");
d_assert(ue->enb, return,);
d_info("[S1AP] downlinkNASTransport : "
"UE[eNB-UE-S1AP-ID(%d)] <-- eNB[%s:%d]",
ue->enb_ue_s1ap_id,
INET_NTOP(&ue->enb->s1ap_sock->remote.sin_addr.s_addr, buf),
ue->enb->enb_id);
}