Commit 117dc25a authored by Cedric Roux's avatar Cedric Roux

- Use itti timer API for NAS within MME

standalone NAS build OK

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4619 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent f4a685fa
......@@ -21,6 +21,7 @@ Description NAS procedure functions triggered by the network
#include "nas_network.h"
#include "commonDef.h"
#include "nas_log.h"
#include "nas_timer.h"
#include "as_message.h"
#include "nas_proc.h"
......@@ -62,6 +63,7 @@ void nas_network_initialize(void)
#ifdef NAS_MME
/* Initialize the internal NAS processing data */
# if defined(EPC_BUILD)
nas_timer_init();
nas_proc_initialize(mme_config_p);
# else
nas_proc_initialize();
......
/*****************************************************************************
Eurecom OpenAirInterface 3
Copyright(c) 2012 Eurecom
Eurecom OpenAirInterface 3
Copyright(c) 2012 Eurecom
Source timer.h
Source timer.h
Version 0.1
Version 0.1
Date 2012/11/22
Date 2012/11/22
Product NAS stack
Product NAS stack
Subsystem Utilities
Subsystem Utilities
Author Frederic Maurel
Author Frederic Maurel
Description Timer utilities
Description Timer utilities
*****************************************************************************/
#ifndef __NAS_TIMER_H__
......@@ -28,7 +28,7 @@ Description Timer utilities
* Timer identifier returned when in inactive state (timer is stopped or has
* failed to be started)
*/
#define NAS_TIMER_INACTIVE_ID (-1)
#define NAS_TIMER_INACTIVE_ID (-1)
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
......@@ -36,12 +36,12 @@ Description Timer utilities
/* Timer structure */
struct nas_timer_t {
int id; /* The timer identifier */
long sec; /* The timer interval value in seconds */
int id; /* The timer identifier */
long sec; /* The timer interval value in seconds */
};
/* Type of the callback executed when the timer expired */
typedef void* (*nas_timer_callback_t)(void*);
typedef void *(*nas_timer_callback_t)(void *);
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
......@@ -51,16 +51,13 @@ typedef void* (*nas_timer_callback_t)(void*);
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
#if defined(NAS_MME) && defined(EPC_BUILD)
# define nas_timer_init
# define nas_timer_start
# define nas_timer_stop
# define nas_timer_restart
#else
int nas_timer_init(void);
int nas_timer_start(long sec, nas_timer_callback_t cb, void* args);
int nas_timer_start(long sec, nas_timer_callback_t cb, void *args);
int nas_timer_stop(int id);
int nas_timer_restart(int id);
#if defined(EPC_BUILD)
void nas_timer_handle_signal_expiry(long timer_id, void *arg_p);
#endif
#endif /* __NAS_TIMER_H__ */
......@@ -370,6 +370,8 @@ libnas_ies_SRCS = \
libnas_utils_SRCS = \
EURECOM-NAS/src/util/nas_log.h \
EURECOM-NAS/src/util/nas_log.c \
EURECOM-NAS/src/util/nas_timer.h \
EURECOM-NAS/src/util/nas_timer.c \
EURECOM-NAS/src/util/TLVEncoder.h \
EURECOM-NAS/src/util/TLVEncoder.c \
EURECOM-NAS/src/util/TLVDecoder.h \
......
......@@ -44,6 +44,7 @@
# include "nas_proc.h"
# include "emm_main.h"
# include "nas_log.h"
# include "nas_timer.h"
#endif
#define NAS_ERROR(x, args...) do { fprintf(stderr, "[NAS] [E]"x, ##args); } while(0)
......@@ -133,6 +134,14 @@ next_message:
} break;
#endif
case TIMER_HAS_EXPIRED: {
#if !defined(DISABLE_USE_NAS)
/* Call the NAS timer api */
nas_timer_handle_signal_expiry(TIMER_HAS_EXPIRED(received_message_p).timer_id,
TIMER_HAS_EXPIRED(received_message_p).arg);
#endif
} break;
case TERMINATE_MESSAGE: {
itti_exit_task();
} break;
......
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