ed980e65fc31cbb25f59d31edff6fa10692bb711
[oweals/gnunet.git] / src / vpn / gnunet-daemon-vpn-dns.h
1 /*
2      This file is part of GNUnet.
3      (C) 2010 Christian Grothoff
4
5      GNUnet is free software; you can redistribute it and/or modify
6      it under the terms of the GNU General Public License as published
7      by the Free Software Foundation; either version 3, or (at your
8      option) any later version.
9
10      GNUnet is distributed in the hope that it will be useful, but
11      WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13      General Public License for more details.
14
15      You should have received a copy of the GNU General Public License
16      along with GNUnet; see the file COPYING.  If not, write to the
17      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18      Boston, MA 02111-1307, USA.
19 */
20
21 /**
22  * @file vpn/gnunet-daemon-vpn-dns.h
23  * @brief
24  * @author Philipp Toelke
25  */
26 #ifndef GNUNET_DAEMON_VPN_DNS_H
27 #define GNUNET_DAEMON_VPN_DNS_H
28
29 /**
30  * a list of outgoing dns-query-packets
31  */
32 extern struct query_packet_list *head;
33
34 /**
35  * The last element of the list of outgoing dns-query-packets
36  */
37 extern struct query_packet_list *tail;
38
39 /**
40  * Callback called by notify_transmit_ready; sends dns-queries or rehijack-messages
41  * to the service-dns
42  */
43 size_t send_query(void* cls, size_t size, void* buf);
44
45 /**
46  * Connect to the service-dns
47  */
48 void connect_to_service_dns (void *cls,
49                              const struct GNUNET_SCHEDULER_TaskContext *tc);
50
51 /**
52  * This receives packets from the service-dns and schedules process_answer to
53  * handle it
54  */
55 void dns_answer_handler(void* cls, const struct GNUNET_MessageHeader *msg);
56
57 /**
58  * The connection to the service-dns
59  */
60 extern struct GNUNET_CLIENT_Connection *dns_connection;
61
62 /**
63  * A flag to show that the service-dns has to rehijack the outbound dns-packets
64  *
65  * This gets set when the helper restarts as the routing-tables are flushed when
66  * the interface vanishes.
67  */
68 extern unsigned char restart_hijack;
69
70 /**
71  * A list of processed dns-responses.
72  *
73  * "processed" means that the packet is complete and can be sent out via udp
74  * directly
75  */
76 extern struct answer_packet_list *answer_proc_head;
77
78 /**
79  * The last element of the list of processed dns-responses.
80  */
81 extern struct answer_packet_list *answer_proc_tail;
82
83 extern GNUNET_SCHEDULER_TaskIdentifier conn_task;
84
85 #endif /* end of include guard: GNUNET-DAEMON-VPN-DNS_H */