blob: 892d302b653419bbe63d2234525e432d9090c9bf [file] [log] [blame]
Dr. David Alan Gilbert50510ea2019-02-27 13:24:05 +00001/*
2 * Self-announce facility
3 * (c) 2017-2019 Red Hat, Inc.
4 *
5 * This work is licensed under the terms of the GNU GPL, version 2 or later.
6 * See the COPYING file in the top-level directory.
7 */
8
9#ifndef QEMU_NET_ANNOUNCE_H
10#define QEMU_NET_ANNOUNCE_H
11
12#include "qemu-common.h"
13#include "qapi/qapi-types-net.h"
14#include "qemu/timer.h"
15
16struct AnnounceTimer {
17 QEMUTimer *tm;
18 AnnounceParameters params;
19 QEMUClockType type;
20 int round;
21};
22
23/* Returns: update the timer to the next time point */
24int64_t qemu_announce_timer_step(AnnounceTimer *timer);
25
26/* Delete the underlying timer */
27void qemu_announce_timer_del(AnnounceTimer *timer);
28
29/*
30 * Under BQL/main thread
31 * Reset the timer to the given parameters/type/notifier.
32 */
33void qemu_announce_timer_reset(AnnounceTimer *timer,
34 AnnounceParameters *params,
35 QEMUClockType type,
36 QEMUTimerCB *cb,
37 void *opaque);
38
Dr. David Alan Gilbert76595052019-02-27 13:24:08 +000039void qemu_announce_self(AnnounceTimer *timer, AnnounceParameters *params);
40
Dr. David Alan Gilbert50510ea2019-02-27 13:24:05 +000041#endif