1 /* 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 "qapi/qapi-types-net.h" 13 #include "qemu/timer.h" 14 15 struct AnnounceTimer { 16 QEMUTimer *tm; 17 AnnounceParameters params; 18 QEMUClockType type; 19 int round; 20 }; 21 22 /* Returns: update the timer to the next time point */ 23 int64_t qemu_announce_timer_step(AnnounceTimer *timer); 24 25 /* Delete the underlying timer */ 26 void qemu_announce_timer_del(AnnounceTimer *timer); 27 28 /* 29 * Under BQL/main thread 30 * Reset the timer to the given parameters/type/notifier. 31 */ 32 void qemu_announce_timer_reset(AnnounceTimer *timer, 33 AnnounceParameters *params, 34 QEMUClockType type, 35 QEMUTimerCB *cb, 36 void *opaque); 37 38 void qemu_announce_self(AnnounceTimer *timer, AnnounceParameters *params); 39 40 #endif 41