Commit 5643f7a9 authored by Lionel Gauthier's avatar Lionel Gauthier

stderr out for fopen

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7279 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 92c7c808
......@@ -62,6 +62,7 @@ int msc_init(msc_env_t envP)
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.ip_ue.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.ip_ue.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
......@@ -70,6 +71,7 @@ int msc_init(msc_env_t envP)
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if (envP == MSC_E_UTRAN_LIPA) {
msc_fd[i] = fopen("/tmp/openair.msc.ip_enb.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.ip_enb.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
......@@ -78,6 +80,7 @@ int msc_init(msc_env_t envP)
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.nas_ue.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.nas_ue.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
......@@ -85,56 +88,63 @@ int msc_init(msc_env_t envP)
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RRC_UE");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.rrc_ue.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.rrc_ue.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.rrc_ue.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_PDCP_UE:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PDCP_UE");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.pdcp_ue.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.pdcp_ue.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.pdcp_ue.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_RLC_UE:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RLC_UE");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.rlc_ue.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.rlc_ue.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.rlc_ue.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_MAC_UE:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MAC_UE");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.mac_ue.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.mac_ue.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.mac_ue.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_PHY_UE:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PHY_UE");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.phy_ue.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.phy_ue.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.phy_ue.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_PHY_ENB:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PHY_ENB");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.phy_enb.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.phy_enb.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.phy_enb.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_MAC_ENB:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MAC_ENB");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.mac_enb.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.mac_enb.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.mac_enb.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_RLC_ENB:
......@@ -142,6 +152,7 @@ int msc_init(msc_env_t envP)
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.rlc_enb.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.rlc_enb.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
......@@ -149,16 +160,18 @@ int msc_init(msc_env_t envP)
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PDCP_ENB");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.pdcp_enb.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.pdcp_enb.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.pdcp_enb.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_RRC_ENB:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RRC_ENB");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.rrc_enb.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.rrc_enb.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.rrc_enb.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_S1AP_ENB:
......@@ -166,6 +179,7 @@ int msc_init(msc_env_t envP)
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_EPC) || (envP == MSC_MME)) {
msc_fd[i] = fopen("/tmp/openair.msc.s1ap_enb.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.s1ap_enb.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
......@@ -174,6 +188,7 @@ int msc_init(msc_env_t envP)
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA) || (envP == MSC_EPC) || (envP == MSC_SP_GW)) {
msc_fd[i] = fopen("/tmp/openair.msc.gtpu_enb.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.gtpu_enb.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
......@@ -182,6 +197,7 @@ int msc_init(msc_env_t envP)
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_EPC) || (envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.gtpu_sgw.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.gtpu_sgw.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
......@@ -190,6 +206,7 @@ int msc_init(msc_env_t envP)
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_EPC) || (envP == MSC_MME) || (envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
msc_fd[i] = fopen("/tmp/openair.msc.s1ap_mme.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.s1ap_mme.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
......@@ -197,62 +214,70 @@ int msc_init(msc_env_t envP)
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MME_APP");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_EPC) || (envP == MSC_MME)) {
msc_fd[i] = fopen("/tmp/openair.msc.mme_app.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.mme_app.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.mme_app.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_NAS_MME:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_MME");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
msc_fd[i] = fopen("/tmp/openair.msc.nas_mme.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.nas_mme.log : %s", strerror(errno));
msc_log_declare_proto(i);
break;
case MSC_NAS_EMM_MME:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_EMM");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_EPC) || (envP == MSC_MME)) {
msc_fd[i] = fopen("/tmp/openair.msc.nas_emm_mme.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.nas_emm_mme.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.nas_emm_mme.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_NAS_ESM_MME:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_ESM");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_EPC) || (envP == MSC_MME)) {
msc_fd[i] = fopen("/tmp/openair.msc.nas_esm_mme.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.nas_esm_mme.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.nas_esm_mme.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_SP_GWAPP_MME:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "SP_GW_MME");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if (envP == MSC_EPC) {
msc_fd[i] = fopen("/tmp/openair.msc.spgwapp_mme.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.spgwapp_mme.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.spgwapp_mme.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_S11_MME:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S11_MME");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if (envP == MSC_MME) {
msc_fd[i] = fopen("/tmp/openair.msc.s11_mme.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.s11_mme.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.s11_mme.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_S6A_MME:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S6A");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_EPC) || (envP == MSC_MME)) {
msc_fd[i] = fopen("/tmp/openair.msc.s6a_mme.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.s6a_mme.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.s6a_mme.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
case MSC_HSS:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "HSS");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if ((envP == MSC_EPC) || (envP == MSC_MME)) {
msc_fd[i] = fopen("/tmp/openair.msc.hss.log","w");
msc_log_declare_proto(i);
msc_fd[i] = fopen("/tmp/openair.msc.hss.log","w");
if (msc_fd[i] == NULL) fprintf(stderr, "Could not open MSC log file /tmp/openair.msc.hss.log : %s", strerror(errno));
msc_log_declare_proto(i);
}
break;
default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment