1fa19f9beSHajimu UMEMOTO /* $KAME: timer.h,v 1.5 2002/05/31 13:30:38 jinmei Exp $ */ 2b26e03e9SKris Kennaway 3*8a16b7a1SPedro F. Giffuni /*- 4*8a16b7a1SPedro F. Giffuni * SPDX-License-Identifier: BSD-3-Clause 5*8a16b7a1SPedro F. Giffuni * 69a4365d0SYoshinobu Inoue * Copyright (C) 1998 WIDE Project. 79a4365d0SYoshinobu Inoue * All rights reserved. 89a4365d0SYoshinobu Inoue * 99a4365d0SYoshinobu Inoue * Redistribution and use in source and binary forms, with or without 109a4365d0SYoshinobu Inoue * modification, are permitted provided that the following conditions 119a4365d0SYoshinobu Inoue * are met: 129a4365d0SYoshinobu Inoue * 1. Redistributions of source code must retain the above copyright 139a4365d0SYoshinobu Inoue * notice, this list of conditions and the following disclaimer. 149a4365d0SYoshinobu Inoue * 2. Redistributions in binary form must reproduce the above copyright 159a4365d0SYoshinobu Inoue * notice, this list of conditions and the following disclaimer in the 169a4365d0SYoshinobu Inoue * documentation and/or other materials provided with the distribution. 179a4365d0SYoshinobu Inoue * 3. Neither the name of the project nor the names of its contributors 189a4365d0SYoshinobu Inoue * may be used to endorse or promote products derived from this software 199a4365d0SYoshinobu Inoue * without specific prior written permission. 209a4365d0SYoshinobu Inoue * 219a4365d0SYoshinobu Inoue * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 229a4365d0SYoshinobu Inoue * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 239a4365d0SYoshinobu Inoue * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 249a4365d0SYoshinobu Inoue * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE 259a4365d0SYoshinobu Inoue * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 269a4365d0SYoshinobu Inoue * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 279a4365d0SYoshinobu Inoue * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 289a4365d0SYoshinobu Inoue * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 299a4365d0SYoshinobu Inoue * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 309a4365d0SYoshinobu Inoue * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 319a4365d0SYoshinobu Inoue * SUCH DAMAGE. 329a4365d0SYoshinobu Inoue */ 339a4365d0SYoshinobu Inoue 34db82af41SHiroki Sato extern TAILQ_HEAD(rtadvd_timer_head_t, rtadvd_timer) ra_timer; 359a4365d0SYoshinobu Inoue struct rtadvd_timer { 36db82af41SHiroki Sato TAILQ_ENTRY(rtadvd_timer) rat_next; 379a4365d0SYoshinobu Inoue 38db82af41SHiroki Sato struct rainfo *rat_rai; 397d26db17SHiroki Sato struct timespec rat_tm; 40db82af41SHiroki Sato struct rtadvd_timer *(*rat_expire)(void *); 41db82af41SHiroki Sato void *rat_expire_data; 427d26db17SHiroki Sato void (*rat_update)(void *, struct timespec *); 43db82af41SHiroki Sato void *rat_update_data; 449a4365d0SYoshinobu Inoue }; 459a4365d0SYoshinobu Inoue 46784bddbcSKevin Lo void rtadvd_timer_init(void); 4737241896SHiroki Sato void rtadvd_update_timeout_handler(void); 48784bddbcSKevin Lo struct rtadvd_timer *rtadvd_add_timer(struct rtadvd_timer *(*)(void *), 497d26db17SHiroki Sato void (*)(void *, struct timespec *), void *, void *); 507d26db17SHiroki Sato void rtadvd_set_timer(struct timespec *, 51db82af41SHiroki Sato struct rtadvd_timer *); 52db82af41SHiroki Sato void rtadvd_remove_timer(struct rtadvd_timer *); 537d26db17SHiroki Sato struct timespec *rtadvd_check_timer(void); 54