msc.h 4.09 KB
Newer Older
gauthier's avatar
gauthier committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
/*******************************************************************************
    OpenAirInterface
    Copyright(c) 1999 - 2014 Eurecom

    OpenAirInterface is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.


    OpenAirInterface is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with OpenAirInterface.The full GNU General Public License is
   included in this distribution in the file called "COPYING". If not,
   see <http://www.gnu.org/licenses/>.

  Contact Information
  OpenAirInterface Admin: openair_admin@eurecom.fr
  OpenAirInterface Tech : openair_tech@eurecom.fr
  OpenAirInterface Dev  : openair4g-devel@eurecom.fr

  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE

 *******************************************************************************/

#ifndef MSC_H_
#define MSC_H_
#include <stdarg.h>

34
typedef enum {
gauthier's avatar
mscgen  
gauthier committed
35 36
	MIN_MSC_ENV = 0,
    MSC_E_UTRAN = MIN_MSC_ENV,
gauthier's avatar
gauthier committed
37
    MSC_E_UTRAN_LIPA,
38
    MSC_EPC,
gauthier's avatar
gauthier committed
39 40
    MSC_MME,
    MSC_SP_GW,
41 42 43 44
    MAX_MSC_ENV
} msc_env_t;


gauthier's avatar
gauthier committed
45 46
typedef enum {
    MIN_MSC_PROTOS = 0,
gauthier's avatar
gauthier committed
47 48
    MSC_IP_UE = MIN_MSC_PROTOS,
    MSC_NAS_UE,
gauthier's avatar
gauthier committed
49 50 51 52 53 54 55 56 57 58
    MSC_RRC_UE,
    MSC_PDCP_UE,
    MSC_RLC_UE,
    MSC_MAC_UE,
    MSC_PHY_UE,
    MSC_PHY_ENB,
    MSC_MAC_ENB,
    MSC_RLC_ENB,
    MSC_PDCP_ENB,
    MSC_RRC_ENB,
gauthier's avatar
gauthier committed
59
    MSC_IP_ENB,
gauthier's avatar
gauthier committed
60 61 62 63
    MSC_S1AP_ENB,
    MSC_GTPU_ENB,
    MSC_GTPU_SGW,
    MSC_S1AP_MME,
64
    MSC_MMEAPP_MME,
gauthier's avatar
gauthier committed
65
    MSC_NAS_MME,
66 67
    MSC_NAS_EMM_MME,
    MSC_NAS_ESM_MME,
gauthier's avatar
gauthier committed
68 69
    MSC_SP_GWAPP_MME,
    MSC_S11_MME,
gauthier's avatar
gauthier committed
70 71 72 73 74
    MSC_S6A_MME,
    MSC_HSS,
    MAX_MSC_PROTOS,
} msc_proto_t;

75 76


gauthier's avatar
gauthier committed
77 78 79 80 81 82
// Access stratum
#define MSC_AS_TIME_FMT "%05u:%02u"

#define MSC_AS_TIME_ARGS(CTXT_Pp) \
    (CTXT_Pp)->frame, \
    (CTXT_Pp)->subframe
gauthier's avatar
gauthier committed
83
#if defined(MESSAGE_CHART_GENERATOR)
84
int msc_init(msc_env_t envP);
gauthier's avatar
gauthier committed
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
void msc_end(void);
void msc_log_declare_proto(const msc_proto_t  protoP);
void msc_log_event(const msc_proto_t  protoP,char *format, ...);
void msc_log_rx_message(
    const msc_proto_t  receiverP,
    const msc_proto_t  senderP,
    const char*        bytesP,
    const unsigned int num_bytes,
    char *format, ...);
void msc_log_rx_discarded_message(
    const msc_proto_t  receiverP,
    const msc_proto_t  senderP,
    const char*        bytesP,
    const unsigned int num_bytes,
    char *format, ...);
void msc_log_tx_message(
    const msc_proto_t  senderP,
    const msc_proto_t  receiverP,
    const char*        bytesP,
    const unsigned int num_bytes,
    char *format, ...);
gauthier's avatar
gauthier committed
106 107 108 109 110 111
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, ...);
gauthier's avatar
gauthier committed
112 113 114 115 116 117
#define MSC_INIT(mScPaRaMs)                                      msc_init(mScPaRaMs)
#define MSC_END                                                  msc_end
#define MSC_LOG_EVENT(mScPaRaMs, fORMAT, aRGS...)                msc_log_event(mScPaRaMs, fORMAT, ##aRGS)
#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)
gauthier's avatar
gauthier committed
118
#define MSC_LOG_TX_MESSAGE_FAILED(mScPaRaMs, fORMAT, aRGS...)    msc_log_tx_message_failed(mScPaRaMs, fORMAT, ##aRGS)
gauthier's avatar
gauthier committed
119 120 121 122 123 124 125
#else
#define MSC_INIT(mScPaRaMs)
#define MSC_END
#define MSC_LOG_EVENT(mScPaRaMs, fORMAT, aRGS...)
#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...)
gauthier's avatar
gauthier committed
126
#define MSC_LOG_TX_MESSAGE_FAILED(mScPaRaMs, fORMAT, aRGS...)
gauthier's avatar
gauthier committed
127
#endif
gauthier's avatar
gauthier committed
128
#endif