flexran_agent_timer.h 2.53 KB
Newer Older
1 2 3 4 5
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
6
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */ 

/*! \file flexran_agent_timer.h
 * \brief FlexRAN Timer  header
 * \author shahab SHARIAT BAGHERI
 * \date 2017
 * \version 0.1
 */

29 30
#ifndef _FLEXRAN_AGENT_TIMER_
#define _FLEXRAN_AGENT_TIMER_
31 32 33 34 35 36 37 38 39 40

#include "flexran_agent_common.h"
#include "flexran_agent_defs.h"

#define TIMER_NULL                 -1 
#define TIMER_TYPE_INVALIDE        -2
#define	TIMER_SETUP_FAILED         -3
#define	TIMER_REMOVED_FAILED       -4
#define	TIMER_ELEMENT_NOT_FOUND    -5

41 42 43 44
typedef enum {
  FLEXRAN_AGENT_TIMER_TYPE_ONESHOT,
  FLEXRAN_AGENT_TIMER_TYPE_PERIODIC,
} flexran_agent_timer_type_t;
45 46

/* Type of the callback executed when the timer expired */
47 48
typedef Protocol__FlexranMessage *(*flexran_agent_timer_callback_t)(
    mid_t mod_id, const Protocol__FlexranMessage *msg);
49

50 51
err_code_t flexran_agent_timer_init(mid_t mod_id);
void       flexran_agent_timer_exit(mid_t mod_id);
52

53 54
/* Signals next subframe for FlexRAN timers */
void flexran_agent_timer_signal(mid_t mod_id);
55

56 57 58
/* Create a timer for some agent related event with id xid. */
err_code_t flexran_agent_create_timer(mid_t    mod_id,
                                      uint32_t sf,
59
                                      flexran_agent_timer_type_t timer_type,
60 61
                                      xid_t    xid,
                                      flexran_agent_timer_callback_t cb,
62
                                      Protocol__FlexranMessage *msg);
63 64

/* Destroy the timer for task with id xid */
65
err_code_t flexran_agent_destroy_timer(mid_t mod_id, xid_t xid);
66

67
#endif /* _FLEXRAN_AGENT_TIMER_ */