/*
 * voipTimerP.h
 *
 * Copyright (C) 2005, Ranch Networks, Inc.
 *
 * This program 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.
 *
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 *
 * Author : Srivatsa Chivukula <srivatsa@ranchnetworks.com>
 *
 */

#ifndef _VOIP_TIMER_PRIV_H
#define _VOIP_TIMER_PRIV_H

#include "voipTask.h"
#include "voipTimer.h"

typedef enum
{
    NIL_INTERVAL = 0,
    INITIAL_INTERVAL,
    REPEAT_INTERVAL
} intervalSelector_t;

typedef struct _timerNode_t
{
    sysTimer_t timer;
    intervalSelector_t intervalSelector;
    timer_id_t handle;
    unsigned char timerBucketId;
    unsigned long remainingTime;
    struct _timerNode_t *next;
    struct _timerNode_t *prev;
} timerNode_t;

typedef struct _timerQueue_t
{
    timerNode_t *head;
    timerNode_t *tail;
    unsigned long cumulativeTime;
} timerQueue_t;

typedef struct _timerBucket_t
{
  timerQueue_t   timerList;
  unsigned char timerBucketId;
  unsigned long ticSize;
  struct _timerBucket_t *next;
  struct _timerBucket_t *prev;
} timerBucket_t;

#endif /* _VOIP_TIMER_PRIV_H */
