forked from acouzens/open5gs
Add debug message for issues [#551]
This commit is contained in:
parent
519de9ef68
commit
edf83b37fa
|
@ -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_IPV4_LINK_MTU_REQUEST 0x0010
|
||||
#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 {
|
||||
uint8_t type;
|
||||
uint8_t len;
|
||||
|
|
|
@ -88,7 +88,7 @@ int ogs_mongoc_init(const char *db_uri)
|
|||
|
||||
if (!ogs_mongoc_mongoc_client_get_server_status(
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ int ogs_dbi_auth_info(char *supi, ogs_dbi_auth_info_t *auth_info)
|
|||
#endif
|
||||
|
||||
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;
|
||||
goto out;
|
||||
|
|
|
@ -25,7 +25,7 @@ int app_initialize(const char *const argv[])
|
|||
|
||||
rv = hss_initialize();
|
||||
if (rv != OGS_OK) {
|
||||
ogs_error("Failed to intialize HSS");
|
||||
ogs_warn("Failed to intialize HSS");
|
||||
return rv;
|
||||
}
|
||||
ogs_info("HSS initialize...done");
|
||||
|
|
|
@ -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.m_tmsi);
|
||||
} 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_code,
|
||||
ogs_nas_guti.m_tmsi);
|
||||
|
|
|
@ -251,8 +251,8 @@ void mme_gtp_send_delete_all_sessions(mme_ue_t *mme_ue)
|
|||
ogs_assert(mme_ue);
|
||||
|
||||
if (SESSION_CONTEXT_WILL_DELETED(mme_ue)) {
|
||||
ogs_warn("The MME has already sent a Delete-Session-Request to the SGW"
|
||||
" for all sessions.");
|
||||
ogs_warn("[%s] Delete-Session-Request has already sent",
|
||||
mme_ue->imsi_bcd);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,6 +100,27 @@ void mme_s11_handle_create_session_response(
|
|||
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)
|
||||
ogs_warn("Cause[%d] : No Accepted", cause_value);
|
||||
|
||||
|
@ -107,10 +128,6 @@ void mme_s11_handle_create_session_response(
|
|||
ogs_error("No S11 TEID");
|
||||
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) {
|
||||
ogs_error("No S1U TEID");
|
||||
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 (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,
|
||||
EMM_CAUSE_NETWORK_FAILURE, ESM_CAUSE_NETWORK_FAILURE);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ int app_initialize(const char *const argv[])
|
|||
|
||||
rv = pcrf_initialize();
|
||||
if (rv != OGS_OK) {
|
||||
ogs_error("Failed to intialize PCRF");
|
||||
ogs_warn("Failed to intialize PCRF");
|
||||
return rv;
|
||||
}
|
||||
ogs_info("PCRF initialize...done");
|
||||
|
|
|
@ -146,6 +146,31 @@ void sgwc_s5c_handle_create_session_response(
|
|||
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) {
|
||||
ogs_gtp_send_error_message(
|
||||
s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0,
|
||||
|
|
|
@ -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) {
|
||||
ogs_error("[RECV] Error Indication from [%s]", OGS_ADDR(&from, buf));
|
||||
ogs_warn("[RECV] Error Indication from [%s]", OGS_ADDR(&from, buf));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
|
@ -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:
|
||||
/* TODO */
|
||||
break;
|
||||
case OGS_PCO_ID_P_CSCF_RE_SELECTION_SUPPORT:
|
||||
/* TODO */
|
||||
break;
|
||||
default:
|
||||
ogs_warn("Unknown PCO ID:(0x%x)", ue.ids[i].id);
|
||||
}
|
||||
|
|
|
@ -162,6 +162,28 @@ void smf_gx_handle_cca_initial_request(
|
|||
}
|
||||
|
||||
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(
|
||||
|
|
|
@ -91,6 +91,28 @@ ogs_pkbuf_t *smf_n4_build_session_establishment_request(
|
|||
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 */
|
||||
req->pdn_type.presence = 1;
|
||||
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();
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
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 */
|
||||
rsp->pdn_address_allocation.data = &sess->pdn.paa;
|
||||
if (sess->ipv4 && sess->ipv6)
|
||||
|
|
|
@ -25,7 +25,7 @@ int app_initialize(const char *const argv[])
|
|||
|
||||
rv = udr_initialize();
|
||||
if (rv != OGS_OK) {
|
||||
ogs_error("Failed to intialize UDR");
|
||||
ogs_warn("Failed to intialize UDR");
|
||||
return rv;
|
||||
}
|
||||
ogs_info("UDR initialize...done");
|
||||
|
|
|
@ -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) {
|
||||
ogs_error("[RECV] Error Indication from [%s]", OGS_ADDR(&from, buf));
|
||||
ogs_warn("[RECV] Error Indication from [%s]", OGS_ADDR(&from, buf));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue