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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
#ifndef foopschedhfoo
#define foopschedhfoo
/* $Id$ */
/***
This file is part of avahi.
avahi is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
avahi is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with avahi; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
***/
typedef struct _AvahiQueryJob AvahiQueryJob;
typedef struct _AvahiResponseJob AvahiResponseJob;
typedef struct _AvahiPacketScheduler AvahiPacketScheduler;
typedef struct _AvahiKnownAnswer AvahiKnownAnswer;
typedef struct _AvahiProbeJob AvahiProbeJob;
#include "timeeventq.h"
#include "rr.h"
#include "llist.h"
#include "iface.h"
struct _AvahiQueryJob {
AvahiPacketScheduler *scheduler;
AvahiTimeEvent *time_event;
AvahiKey *key;
gboolean done;
GTimeVal delivery;
AVAHI_LLIST_FIELDS(AvahiQueryJob, jobs);
};
struct _AvahiResponseJob {
AvahiPacketScheduler *scheduler;
AvahiTimeEvent *time_event;
AvahiRecord *record;
AvahiAddress address;
gboolean address_valid;
gboolean done;
GTimeVal delivery;
gboolean flush_cache;
AVAHI_LLIST_FIELDS(AvahiResponseJob, jobs);
};
struct _AvahiKnownAnswer {
AvahiPacketScheduler *scheduler;
AvahiRecord *record;
AVAHI_LLIST_FIELDS(AvahiKnownAnswer, known_answer);
};
struct _AvahiProbeJob {
AvahiPacketScheduler *scheduler;
AvahiTimeEvent *time_event;
AvahiRecord *record;
gboolean chosen; /* Use for packet assembling */
GTimeVal delivery;
AVAHI_LLIST_FIELDS(AvahiProbeJob, jobs);
};
struct _AvahiPacketScheduler {
AvahiServer *server;
AvahiInterface *interface;
AVAHI_LLIST_HEAD(AvahiQueryJob, query_jobs);
AVAHI_LLIST_HEAD(AvahiResponseJob, response_jobs);
AVAHI_LLIST_HEAD(AvahiKnownAnswer, known_answers);
AVAHI_LLIST_HEAD(AvahiProbeJob, probe_jobs);
};
AvahiPacketScheduler *avahi_packet_scheduler_new(AvahiServer *server, AvahiInterface *i);
void avahi_packet_scheduler_free(AvahiPacketScheduler *s);
void avahi_packet_scheduler_post_query(AvahiPacketScheduler *s, AvahiKey *key, gboolean immediately);
void avahi_packet_scheduler_post_response(AvahiPacketScheduler *s, const AvahiAddress *a, AvahiRecord *record, gboolean flush_cache, gboolean immediately);
void avahi_packet_scheduler_post_probe(AvahiPacketScheduler *s, AvahiRecord *record, gboolean immediately);
void avahi_packet_scheduler_incoming_query(AvahiPacketScheduler *s, AvahiKey *key);
void avahi_packet_scheduler_incoming_response(AvahiPacketScheduler *s, AvahiRecord *record);
void avahi_packet_scheduler_incoming_known_answer(AvahiPacketScheduler *s, AvahiRecord *record, const AvahiAddress *a);
void avahi_packet_scheduler_flush_responses(AvahiPacketScheduler *s);
#endif
|