Commit 68b2d273 authored by gauthier's avatar gauthier

add tx failed, ip layers (ue, enb)

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7196 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent e1580cce
......@@ -57,6 +57,22 @@ int msc_init(msc_env_t envP)
for (i = MIN_MSC_PROTOS; i < MAX_MSC_PROTOS; i++) {
msc_fd[i] = NULL;
switch (i) {
case MSC_IP_UE:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "IP_UE");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if (envP == MSC_E_UTRAN) {
msc_fd[i] = fopen("/tmp/openair.msc.ip_ue.log","w");
msc_log_declare_proto(i);
}
break;
case MSC_IP_ENB:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "IP_ENB");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
if (envP == MSC_E_UTRAN) {
msc_fd[i] = fopen("/tmp/openair.msc.ip_enb.log","w");
msc_log_declare_proto(i);
}
break;
case MSC_NAS_UE:
rv = snprintf(&msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_UE");
if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
......@@ -425,4 +441,46 @@ void msc_log_tx_message(
}
}
//------------------------------------------------------------------------------
void msc_log_tx_message_failed(
const msc_proto_t senderP,
const msc_proto_t receiverP,
const char* bytesP,
const unsigned int num_bytes,
char *format, ...)
//------------------------------------------------------------------------------
{
va_list args;
int rv;
uint64_t mac = 0;
uint64_t local_msc_event_counter = msc_event_counter;
msc_event_counter++;
if ((receiverP < MIN_MSC_PROTOS) || (receiverP >= MAX_MSC_PROTOS) ||
(senderP < MIN_MSC_PROTOS) || (senderP >= MAX_MSC_PROTOS)) {
return;
}
if (msc_fd[senderP] != NULL) {
rv = fprintf(msc_fd[senderP], "%"PRIu64" [MESSAGE] %d -x %d %"PRIu64" ",
local_msc_event_counter, senderP, receiverP, mac);
if (rv < 0) {
fprintf(stderr, "Error while logging MSC TX message : %s", &msc_proto2str[senderP][0]);
}
va_start(args, format);
rv = vfprintf(msc_fd[senderP], format, args);
va_end(args);
if (rv < 0) {
fprintf(stderr, "Error while logging MSC TX message : %s", &msc_proto2str[senderP][0]);
}
rv = fprintf(msc_fd[senderP], "\n");
if (rv < 0) {
fprintf(stderr, "Error while logging MSC TX message : %s", &msc_proto2str[senderP][0]);
}
if ((msc_event_counter & 0x000000000000000F) == 0x000000000000000F) {
fflush(msc_fd[senderP]);
}
}
}
......@@ -41,7 +41,8 @@ typedef enum {
typedef enum {
MIN_MSC_PROTOS = 0,
MSC_NAS_UE = MIN_MSC_PROTOS,
MSC_IP_UE = MIN_MSC_PROTOS,
MSC_NAS_UE,
MSC_RRC_UE,
MSC_PDCP_UE,
MSC_RLC_UE,
......@@ -52,6 +53,7 @@ typedef enum {
MSC_RLC_ENB,
MSC_PDCP_ENB,
MSC_RRC_ENB,
MSC_IP_ENB,
MSC_S1AP_ENB,
MSC_GTPU_ENB,
MSC_GTPU_SGW,
......@@ -102,6 +104,7 @@ void msc_log_tx_message(
#define MSC_LOG_RX_MESSAGE(mScPaRaMs, fORMAT, aRGS...) msc_log_rx_message(mScPaRaMs, fORMAT, ##aRGS)
#define MSC_LOG_RX_DISCARDED_MESSAGE(mScPaRaMs, fORMAT, aRGS...) msc_log_rx_discarded_message(mScPaRaMs, fORMAT, ##aRGS)
#define MSC_LOG_TX_MESSAGE(mScPaRaMs, fORMAT, aRGS...) msc_log_tx_message(mScPaRaMs, fORMAT, ##aRGS)
#define MSC_LOG_TX_MESSAGE_FAILED(mScPaRaMs, fORMAT, aRGS...) msc_log_tx_message_failed(mScPaRaMs, fORMAT, ##aRGS)
#else
#define MSC_INIT(mScPaRaMs)
#define MSC_END
......@@ -109,5 +112,6 @@ void msc_log_tx_message(
#define MSC_LOG_RX_MESSAGE(mScPaRaMs, fORMAT, aRGS...)
#define MSC_LOG_RX_DISCARDED_MESSAGE(mScPaRaMs, fORMAT, aRGS...)
#define MSC_LOG_TX_MESSAGE(mScPaRaMs, fORMAT, aRGS...)
#define MSC_LOG_TX_MESSAGE_FAILED(mScPaRaMs, fORMAT, aRGS...)
#endif
#endif
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