171333Sitojun/* $FreeBSD$ */ 2118664Sume/* $KAME: timer.h,v 1.5 2002/05/31 13:30:38 jinmei Exp $ */ 362656Skris 455505Sshin/* 555505Sshin * Copyright (C) 1998 WIDE Project. 655505Sshin * All rights reserved. 7222732Shrs * 855505Sshin * Redistribution and use in source and binary forms, with or without 955505Sshin * modification, are permitted provided that the following conditions 1055505Sshin * are met: 1155505Sshin * 1. Redistributions of source code must retain the above copyright 1255505Sshin * notice, this list of conditions and the following disclaimer. 1355505Sshin * 2. Redistributions in binary form must reproduce the above copyright 1455505Sshin * notice, this list of conditions and the following disclaimer in the 1555505Sshin * documentation and/or other materials provided with the distribution. 1655505Sshin * 3. Neither the name of the project nor the names of its contributors 1755505Sshin * may be used to endorse or promote products derived from this software 1855505Sshin * without specific prior written permission. 19222732Shrs * 2055505Sshin * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 2155505Sshin * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2255505Sshin * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2355505Sshin * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE 2455505Sshin * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2555505Sshin * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2655505Sshin * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2755505Sshin * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2855505Sshin * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2955505Sshin * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3055505Sshin * SUCH DAMAGE. 3155505Sshin */ 3255505Sshin 33222732Shrsextern TAILQ_HEAD(rtadvd_timer_head_t, rtadvd_timer) ra_timer; 3455505Sshinstruct rtadvd_timer { 35222732Shrs TAILQ_ENTRY(rtadvd_timer) rat_next; 3655505Sshin 37222732Shrs struct rainfo *rat_rai; 38253970Shrs struct timespec rat_tm; 39222732Shrs struct rtadvd_timer *(*rat_expire)(void *); 40222732Shrs void *rat_expire_data; 41253970Shrs void (*rat_update)(void *, struct timespec *); 42222732Shrs void *rat_update_data; 4355505Sshin}; 4455505Sshin 45222732Shrsvoid rtadvd_timer_init(void); 46224144Shrsvoid rtadvd_update_timeout_handler(void); 47222732Shrsstruct rtadvd_timer *rtadvd_add_timer(struct rtadvd_timer *(*)(void *), 48253970Shrs void (*)(void *, struct timespec *), void *, void *); 49253970Shrsvoid rtadvd_set_timer(struct timespec *, 50222732Shrs struct rtadvd_timer *); 51222732Shrsvoid rtadvd_remove_timer(struct rtadvd_timer *); 52253970Shrsstruct timespec *rtadvd_check_timer(void); 53