summaryrefslogtreecommitdiffstats
path: root/announce.h
blob: ab8ce128680d9540bf345e123f75cc3f7e5b7f3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef fooannouncehfoo
#define fooannouncehfoo

#include <glib.h>

typedef struct _flxAnnouncement flxAnnouncement;

#include "llist.h"
#include "iface.h"
#include "server.h"
#include "timeeventq.h"

typedef enum {
    FLX_PROBING,
    FLX_ANNOUNCING,
} flxAnnouncementState;

struct _flxAnnouncement {
    flxServer *server;
    flxInterface *interface;
    flxServerEntry *entry;

    flxTimeEvent *time_event;

    flxAnnouncementState state;
    guint n_iteration;
    guint sec_delay;

    FLX_LLIST_FIELDS(flxAnnouncement, by_interface);
    FLX_LLIST_FIELDS(flxAnnouncement, by_entry);
};

void flx_announce_interface(flxServer *s, flxInterface *i);
void flx_announce_entry(flxServer *s, flxServerEntry *e);

gboolean flx_entry_established(flxServer *s, flxServerEntry *e, flxInterface *i);

void flx_goodbye_interface(flxServer *s, flxInterface *i, gboolean send);
void flx_goodbye_entry(flxServer *s, flxServerEntry *e, gboolean send);

void flx_goodbye_all(flxServer *s, gboolean send);

#endif