Ejemplo n.º 1
0
/*
  start a periodic timer to chech wether the export LBG is down
  When the export is restarted its port may change, and so
  the previous configuration of the LBG is not valid any more
*/
static void export_lbg_start_timer(exportclt_t *exportclt) {
  struct timer_cell * export_lbg_periodic_timer;

  export_lbg_periodic_timer = ruc_timer_alloc(0,0);
  if (export_lbg_periodic_timer == NULL) {
    severe("export_lbg_start_timer");
    return;
  }
  ruc_periodic_timer_start (export_lbg_periodic_timer, 
                            4000,
 	                    export_lbg_periodic_ticker,
 			    exportclt);

}
Ejemplo n.º 2
0
int geo_cli_start_timer(int period)
{

  struct timer_cell * geo_cli_periodic_timer;

  geo_cli_periodic_timer = ruc_timer_alloc(0,0);
  if (geo_cli_periodic_timer == NULL) {
    severe("cannot allocate timer cell");
    errno = EPROTO;
    return -1;
  }
  ruc_periodic_timer_start (geo_cli_periodic_timer, 
                            period,
 	                    geo_cli_periodic_ticker,
 			    NULL);
  return 0;

}
Ejemplo n.º 3
0
/*
**----------------------------------------------
**  geo_ctx_tmr_init
**----------------------------------------------
**
**   charging timer service initialisation request
**    
**  IN : period_ms : period between two queue sequence reading in ms
**       credit    : pdp credit processing number
**
**  OUT : OK/NOK
**
**-----------------------------------------------
*/
int geo_ctx_tmr_init(uint32_t period_ms,
                    uint32_t credit)
{

    int i;
    
    /**************************/
    /* configuration variable */
    /* initialization         */
    /**************************/


    /*
    ** time between to look up to the charging timer queue
    */
    if (period_ms!=0){
        geo_ctx_tmr.period_ms=period_ms;
    } else {
        severe( "bad provided timer period (0 ms), I continue with 100 ms" );
        geo_ctx_tmr.period_ms=100;
    }

    /*
    ** Number of pdp context processed at each look up;
    */
    if (credit!=0){
        geo_ctx_tmr.credit=credit;
    } else {
        severe( "bad provided  credit (0), I continue with 1" );
        geo_ctx_tmr.credit=1;
    }

    /**************************/
    /* working variable       */
    /* initialization         */
    /**************************/


    /*
    **  queue initialization
    */
    for (i = 0; i < GEO_CTX_TMR_SLOT_MAX; i++)
    {
      ruc_listHdrInit(&geo_ctx_tmr.queue[i]);
    }

    /*
    ** charging timer periodic launching
    */
    geo_ctx_tmr.p_periodic_timCell=ruc_timer_alloc(0,0);
    if (geo_ctx_tmr.p_periodic_timCell == (struct timer_cell *)NULL){
        severe( "No timer available for MS timer periodic" );
        return(RUC_NOK);
    }
    ruc_periodic_timer_start(geo_ctx_tmr.p_periodic_timCell,
	      (geo_ctx_tmr.period_ms*TIMER_TICK_VALUE_100MS/100),
	      &geo_ctx_tmr_periodic,
	      0);
	      
    return(RUC_OK);
}