7 This file is part of avahi.
9 avahi is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as
11 published by the Free Software Foundation; either version 2.1 of the
12 License, or (at your option) any later version.
14 avahi is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
17 Public License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with avahi; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 typedef struct _AvahiQueryJob AvahiQueryJob;
26 typedef struct _AvahiResponseJob AvahiResponseJob;
27 typedef struct _AvahiPacketScheduler AvahiPacketScheduler;
28 typedef struct _AvahiKnownAnswer AvahiKnownAnswer;
29 typedef struct _AvahiProbeJob AvahiProbeJob;
31 #include "timeeventq.h"
36 struct _AvahiQueryJob {
37 AvahiPacketScheduler *scheduler;
38 AvahiTimeEvent *time_event;
42 AVAHI_LLIST_FIELDS(AvahiQueryJob, jobs);
45 struct _AvahiResponseJob {
46 AvahiPacketScheduler *scheduler;
47 AvahiTimeEvent *time_event;
50 gboolean address_valid;
54 AVAHI_LLIST_FIELDS(AvahiResponseJob, jobs);
57 struct _AvahiKnownAnswer {
58 AvahiPacketScheduler *scheduler;
61 AVAHI_LLIST_FIELDS(AvahiKnownAnswer, known_answer);
64 struct _AvahiProbeJob {
65 AvahiPacketScheduler *scheduler;
66 AvahiTimeEvent *time_event;
69 gboolean chosen; /* Use for packet assembling */
72 AVAHI_LLIST_FIELDS(AvahiProbeJob, jobs);
75 struct _AvahiPacketScheduler {
78 AvahiInterface *interface;
80 AVAHI_LLIST_HEAD(AvahiQueryJob, query_jobs);
81 AVAHI_LLIST_HEAD(AvahiResponseJob, response_jobs);
82 AVAHI_LLIST_HEAD(AvahiKnownAnswer, known_answers);
83 AVAHI_LLIST_HEAD(AvahiProbeJob, probe_jobs);
86 AvahiPacketScheduler *avahi_packet_scheduler_new(AvahiServer *server, AvahiInterface *i);
87 void avahi_packet_scheduler_free(AvahiPacketScheduler *s);
89 void avahi_packet_scheduler_post_query(AvahiPacketScheduler *s, AvahiKey *key, gboolean immediately);
90 void avahi_packet_scheduler_post_response(AvahiPacketScheduler *s, const AvahiAddress *a, AvahiRecord *record, gboolean flush_cache, gboolean immediately);
91 void avahi_packet_scheduler_post_probe(AvahiPacketScheduler *s, AvahiRecord *record, gboolean immediately);
93 void avahi_packet_scheduler_incoming_query(AvahiPacketScheduler *s, AvahiKey *key);
94 void avahi_packet_scheduler_incoming_response(AvahiPacketScheduler *s, AvahiRecord *record);
95 void avahi_packet_scheduler_incoming_known_answer(AvahiPacketScheduler *s, AvahiRecord *record, const AvahiAddress *a);
97 void avahi_packet_scheduler_flush_responses(AvahiPacketScheduler *s);