Add debug message for issues [#551]

This commit is contained in:
Sukchan Lee 2020-09-10 21:50:20 -04:00
parent 519de9ef68
commit edf83b37fa
16 changed files with 149 additions and 14 deletions

View File

@ -430,6 +430,7 @@ int ogs_fqdn_parse(char *dst, char *src, int len);
#define OGS_PCO_ID_DNS_SERVER_IPV4_ADDRESS_REQUEST 0x000d #define OGS_PCO_ID_DNS_SERVER_IPV4_ADDRESS_REQUEST 0x000d
#define OGS_PCO_ID_IPV4_LINK_MTU_REQUEST 0x0010 #define OGS_PCO_ID_IPV4_LINK_MTU_REQUEST 0x0010
#define OGS_PCO_ID_MS_SUPPORT_LOCAL_ADDR_TFT_INDICATOR 0x0011 #define OGS_PCO_ID_MS_SUPPORT_LOCAL_ADDR_TFT_INDICATOR 0x0011
#define OGS_PCO_ID_P_CSCF_RE_SELECTION_SUPPORT 0x0012
typedef struct ogs_pco_ipcp_options_s { typedef struct ogs_pco_ipcp_options_s {
uint8_t type; uint8_t type;
uint8_t len; uint8_t len;

View File

@ -88,7 +88,7 @@ int ogs_mongoc_init(const char *db_uri)
if (!ogs_mongoc_mongoc_client_get_server_status( if (!ogs_mongoc_mongoc_client_get_server_status(
self.client, NULL, &reply, &error)) { self.client, NULL, &reply, &error)) {
ogs_error("Failed to connect to server [%s]", db_uri); ogs_warn("Failed to connect to server [%s]", db_uri);
return OGS_RETRY; return OGS_RETRY;
} }

View File

@ -53,7 +53,7 @@ int ogs_dbi_auth_info(char *supi, ogs_dbi_auth_info_t *auth_info)
#endif #endif
if (!mongoc_cursor_next(cursor, &document)) { if (!mongoc_cursor_next(cursor, &document)) {
ogs_warn("[%s] Cannot find IMSI in DB", supi); ogs_info("[%s] Cannot find IMSI in DB", supi);
rv = OGS_ERROR; rv = OGS_ERROR;
goto out; goto out;

View File

@ -25,7 +25,7 @@ int app_initialize(const char *const argv[])
rv = hss_initialize(); rv = hss_initialize();
if (rv != OGS_OK) { if (rv != OGS_OK) {
ogs_error("Failed to intialize HSS"); ogs_warn("Failed to intialize HSS");
return rv; return rv;
} }
ogs_info("HSS initialize...done"); ogs_info("HSS initialize...done");

View File

@ -2413,7 +2413,7 @@ mme_ue_t *mme_ue_find_by_message(ogs_nas_eps_message_t *message)
ogs_nas_guti.mme_code, ogs_nas_guti.mme_code,
ogs_nas_guti.m_tmsi); ogs_nas_guti.m_tmsi);
} else { } else {
ogs_warn("Unknown UE by GUTI[G:%d,C:%d,M_TMSI:0x%x]", ogs_info("Unknown UE by GUTI[G:%d,C:%d,M_TMSI:0x%x]",
ogs_nas_guti.mme_gid, ogs_nas_guti.mme_gid,
ogs_nas_guti.mme_code, ogs_nas_guti.mme_code,
ogs_nas_guti.m_tmsi); ogs_nas_guti.m_tmsi);

View File

@ -251,8 +251,8 @@ void mme_gtp_send_delete_all_sessions(mme_ue_t *mme_ue)
ogs_assert(mme_ue); ogs_assert(mme_ue);
if (SESSION_CONTEXT_WILL_DELETED(mme_ue)) { if (SESSION_CONTEXT_WILL_DELETED(mme_ue)) {
ogs_warn("The MME has already sent a Delete-Session-Request to the SGW" ogs_warn("[%s] Delete-Session-Request has already sent",
" for all sessions."); mme_ue->imsi_bcd);
return; return;
} }

View File

@ -100,6 +100,27 @@ void mme_s11_handle_create_session_response(
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING; cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
} }
if (rsp->pdn_address_allocation.presence) {
ogs_paa_t paa;
memcpy(&paa, rsp->pdn_address_allocation.data,
ogs_min(sizeof(paa), rsp->pdn_address_allocation.len));
if (paa.pdn_type == OGS_GTP_PDN_TYPE_IPV4) {
/* Nothing */
} else if (paa.pdn_type == OGS_GTP_PDN_TYPE_IPV6) {
/* Nothing */
} else if (paa.pdn_type == OGS_GTP_PDN_TYPE_IPV4V6) {
/* Nothing */
} else {
ogs_error("Unknown PDN Type %u", paa.pdn_type);
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_INCORRECT;
}
} else {
ogs_error("No PDN Address Allocation");
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
}
if (cause_value != OGS_GTP_CAUSE_REQUEST_ACCEPTED) if (cause_value != OGS_GTP_CAUSE_REQUEST_ACCEPTED)
ogs_warn("Cause[%d] : No Accepted", cause_value); ogs_warn("Cause[%d] : No Accepted", cause_value);
@ -107,10 +128,6 @@ void mme_s11_handle_create_session_response(
ogs_error("No S11 TEID"); ogs_error("No S11 TEID");
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING; cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
} }
if (rsp->pdn_address_allocation.presence == 0) {
ogs_error("No PDN Address Allocation");
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
}
if (rsp->bearer_contexts_created.s1_u_enodeb_f_teid.presence == 0) { if (rsp->bearer_contexts_created.s1_u_enodeb_f_teid.presence == 0) {
ogs_error("No S1U TEID"); ogs_error("No S1U TEID");
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING; cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
@ -126,6 +143,7 @@ void mme_s11_handle_create_session_response(
if (cause_value != OGS_GTP_CAUSE_REQUEST_ACCEPTED) { if (cause_value != OGS_GTP_CAUSE_REQUEST_ACCEPTED) {
if (OGS_FSM_CHECK(&mme_ue->sm, emm_state_initial_context_setup)) { if (OGS_FSM_CHECK(&mme_ue->sm, emm_state_initial_context_setup)) {
ogs_error("[%s] Attach reject", mme_ue->imsi_bcd);
nas_eps_send_attach_reject(mme_ue, nas_eps_send_attach_reject(mme_ue,
EMM_CAUSE_NETWORK_FAILURE, ESM_CAUSE_NETWORK_FAILURE); EMM_CAUSE_NETWORK_FAILURE, ESM_CAUSE_NETWORK_FAILURE);
} }

View File

@ -25,7 +25,7 @@ int app_initialize(const char *const argv[])
rv = pcrf_initialize(); rv = pcrf_initialize();
if (rv != OGS_OK) { if (rv != OGS_OK) {
ogs_error("Failed to intialize PCRF"); ogs_warn("Failed to intialize PCRF");
return rv; return rv;
} }
ogs_info("PCRF initialize...done"); ogs_info("PCRF initialize...done");

View File

@ -146,6 +146,31 @@ void sgwc_s5c_handle_create_session_response(
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING; cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
} }
if (rsp->pdn_address_allocation.presence) {
ogs_paa_t paa;
memcpy(&paa, rsp->pdn_address_allocation.data,
ogs_min(sizeof(paa), rsp->pdn_address_allocation.len));
if (paa.pdn_type == OGS_GTP_PDN_TYPE_IPV4) {
/* Nothing */
} else if (paa.pdn_type == OGS_GTP_PDN_TYPE_IPV6) {
/* Nothing */
} else if (paa.pdn_type == OGS_GTP_PDN_TYPE_IPV4V6) {
/* Nothing */
} else {
ogs_error("Unknown PDN Type %u", paa.pdn_type);
#if 0 /* MME will handle this error */
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_INCORRECT;
#endif
}
} else {
ogs_error("No PDN Address Allocation");
#if 0 /* MME will handle this error */
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
#endif
}
if (cause_value != OGS_GTP_CAUSE_REQUEST_ACCEPTED) { if (cause_value != OGS_GTP_CAUSE_REQUEST_ACCEPTED) {
ogs_gtp_send_error_message( ogs_gtp_send_error_message(
s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0,

View File

@ -96,7 +96,7 @@ static void _gtpv1_u_recv_cb(short when, ogs_socket_t fd, void *data)
} }
if (gtp_h->type == OGS_GTPU_MSGTYPE_ERR_IND) { if (gtp_h->type == OGS_GTPU_MSGTYPE_ERR_IND) {
ogs_error("[RECV] Error Indication from [%s]", OGS_ADDR(&from, buf)); ogs_warn("[RECV] Error Indication from [%s]", OGS_ADDR(&from, buf));
goto cleanup; goto cleanup;
} }

View File

@ -1758,6 +1758,9 @@ int smf_pco_build(uint8_t *pco_buf, uint8_t *buffer, int length)
case OGS_PCO_ID_MS_SUPPORT_LOCAL_ADDR_TFT_INDICATOR: case OGS_PCO_ID_MS_SUPPORT_LOCAL_ADDR_TFT_INDICATOR:
/* TODO */ /* TODO */
break; break;
case OGS_PCO_ID_P_CSCF_RE_SELECTION_SUPPORT:
/* TODO */
break;
default: default:
ogs_warn("Unknown PCO ID:(0x%x)", ue.ids[i].id); ogs_warn("Unknown PCO ID:(0x%x)", ue.ids[i].id);
} }

View File

@ -162,6 +162,28 @@ void smf_gx_handle_cca_initial_request(
} }
smf_epc_pfcp_send_session_establishment_request(sess, gtp_xact); smf_epc_pfcp_send_session_establishment_request(sess, gtp_xact);
/* DEBUG : PDN-TYPE */
if (sess->pdn.paa.pdn_type == OGS_GTP_PDN_TYPE_IPV4) {
/* Nothing */
} else if (sess->pdn.paa.pdn_type == OGS_GTP_PDN_TYPE_IPV6) {
/* Nothing */
} else if (sess->pdn.paa.pdn_type == OGS_GTP_PDN_TYPE_IPV4V6) {
/* Nothing */
} else {
smf_ue_t *smf_ue = NULL;
char buf1[OGS_ADDRSTRLEN];
char buf2[OGS_ADDRSTRLEN];
ogs_error("Unknown PDN Type %u", sess->pdn.paa.pdn_type);
smf_ue = sess->smf_ue;
ogs_assert(smf_ue);
ogs_error(" UE IMSI:[%s] IPv4:[%s] IPv6:[%s]",
smf_ue->imsi_bcd,
sess->ipv4 ? OGS_INET_NTOP(&sess->ipv4->addr, buf1) : "",
sess->ipv6 ? OGS_INET6_NTOP(&sess->ipv6->addr, buf2) : "");
}
} }
void smf_gx_handle_cca_termination_request( void smf_gx_handle_cca_termination_request(

View File

@ -91,6 +91,28 @@ ogs_pkbuf_t *smf_n4_build_session_establishment_request(
i++; i++;
} }
/* DEBUG : PDN-TYPE */
if (sess->pdn.paa.pdn_type == OGS_GTP_PDN_TYPE_IPV4) {
/* Nothing */
} else if (sess->pdn.paa.pdn_type == OGS_GTP_PDN_TYPE_IPV6) {
/* Nothing */
} else if (sess->pdn.paa.pdn_type == OGS_GTP_PDN_TYPE_IPV4V6) {
/* Nothing */
} else {
smf_ue_t *smf_ue = NULL;
char buf1[OGS_ADDRSTRLEN];
char buf2[OGS_ADDRSTRLEN];
ogs_error("Unknown PDN Type %u", sess->pdn.paa.pdn_type);
smf_ue = sess->smf_ue;
ogs_assert(smf_ue);
ogs_error(" UE IMSI:[%s] IPv4:[%s] IPv6:[%s]",
smf_ue->imsi_bcd,
sess->ipv4 ? OGS_INET_NTOP(&sess->ipv4->addr, buf1) : "",
sess->ipv6 ? OGS_INET6_NTOP(&sess->ipv6->addr, buf2) : "");
}
/* PDN Type */ /* PDN Type */
req->pdn_type.presence = 1; req->pdn_type.presence = 1;
req->pdn_type.u8 = sess->pdn.paa.pdn_type; req->pdn_type.u8 = sess->pdn.paa.pdn_type;
@ -100,6 +122,28 @@ ogs_pkbuf_t *smf_n4_build_session_establishment_request(
ogs_pfcp_pdrbuf_clear(); ogs_pfcp_pdrbuf_clear();
/* DEBUG : PDN-TYPE */
if (sess->pdn.paa.pdn_type == OGS_GTP_PDN_TYPE_IPV4) {
/* Nothing */
} else if (sess->pdn.paa.pdn_type == OGS_GTP_PDN_TYPE_IPV6) {
/* Nothing */
} else if (sess->pdn.paa.pdn_type == OGS_GTP_PDN_TYPE_IPV4V6) {
/* Nothing */
} else {
smf_ue_t *smf_ue = NULL;
char buf1[OGS_ADDRSTRLEN];
char buf2[OGS_ADDRSTRLEN];
ogs_error("Unknown PDN Type %u", sess->pdn.paa.pdn_type);
smf_ue = sess->smf_ue;
ogs_assert(smf_ue);
ogs_error(" UE IMSI:[%s] IPv4:[%s] IPv6:[%s]",
smf_ue->imsi_bcd,
sess->ipv4 ? OGS_INET_NTOP(&sess->ipv4->addr, buf1) : "",
sess->ipv6 ? OGS_INET6_NTOP(&sess->ipv6->addr, buf2) : "");
}
return pkbuf; return pkbuf;
} }

View File

@ -75,6 +75,28 @@ ogs_pkbuf_t *smf_s5c_build_create_session_response(
rsp->pgw_s5_s8__s2a_s2b_f_teid_for_pmip_based_interface_or_for_gtp_based_control_plane_interface. rsp->pgw_s5_s8__s2a_s2b_f_teid_for_pmip_based_interface_or_for_gtp_based_control_plane_interface.
len = len; len = len;
/* DEBUG : PDN-TYPE */
if (sess->pdn.paa.pdn_type == OGS_GTP_PDN_TYPE_IPV4) {
/* Nothing */
} else if (sess->pdn.paa.pdn_type == OGS_GTP_PDN_TYPE_IPV6) {
/* Nothing */
} else if (sess->pdn.paa.pdn_type == OGS_GTP_PDN_TYPE_IPV4V6) {
/* Nothing */
} else {
smf_ue_t *smf_ue = NULL;
char buf1[OGS_ADDRSTRLEN];
char buf2[OGS_ADDRSTRLEN];
ogs_error("Unknown PDN Type %u", sess->pdn.paa.pdn_type);
smf_ue = sess->smf_ue;
ogs_assert(smf_ue);
ogs_error(" UE IMSI:[%s] IPv4:[%s] IPv6:[%s]",
smf_ue->imsi_bcd,
sess->ipv4 ? OGS_INET_NTOP(&sess->ipv4->addr, buf1) : "",
sess->ipv6 ? OGS_INET6_NTOP(&sess->ipv6->addr, buf2) : "");
}
/* PDN Address Allocation */ /* PDN Address Allocation */
rsp->pdn_address_allocation.data = &sess->pdn.paa; rsp->pdn_address_allocation.data = &sess->pdn.paa;
if (sess->ipv4 && sess->ipv6) if (sess->ipv4 && sess->ipv6)

View File

@ -25,7 +25,7 @@ int app_initialize(const char *const argv[])
rv = udr_initialize(); rv = udr_initialize();
if (rv != OGS_OK) { if (rv != OGS_OK) {
ogs_error("Failed to intialize UDR"); ogs_warn("Failed to intialize UDR");
return rv; return rv;
} }
ogs_info("UDR initialize...done"); ogs_info("UDR initialize...done");

View File

@ -155,7 +155,7 @@ static void _gtpv1_u_recv_cb(short when, ogs_socket_t fd, void *data)
} }
if (gtp_h->type == OGS_GTPU_MSGTYPE_ERR_IND) { if (gtp_h->type == OGS_GTPU_MSGTYPE_ERR_IND) {
ogs_error("[RECV] Error Indication from [%s]", OGS_ADDR(&from, buf)); ogs_warn("[RECV] Error Indication from [%s]", OGS_ADDR(&from, buf));
goto cleanup; goto cleanup;
} }