2 This file is part of GNUnet.
3 (C) 2010 Christian Grothoff
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.
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.
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.
22 * @file vpn/gnunet-daemon-vpn.h
24 * @author Philipp Toelke
26 #ifndef GNUNET_DAEMON_VPN_H
27 #define GNUNET_DAEMON_VPN_H
29 #include "gnunet-service-dns-p.h"
32 * This gets scheduled with cls pointing to an answer_packet and does everything
33 * needed in order to send it to the helper.
35 * At the moment this means "inventing" and IPv6-Address for .gnunet-services and
36 * doing nothing for "real" services.
39 process_answer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
42 send_icmp6_response (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
44 send_icmp4_response (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
47 send_udp_service (void *cls, size_t size, void *buf);
50 address6_mapping_exists (unsigned char addr[]);
52 address4_mapping_exists (uint32_t addr);
55 port_in_ports (uint64_t ports, uint16_t port);
58 send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer,
59 const struct GNUNET_TRANSPORT_ATS_Information *atsi);
62 * The configuration to use
64 extern const struct GNUNET_CONFIGURATION_Handle *cfg;
69 extern struct GNUNET_MESH_Handle *mesh_handle;
72 * The hashmap containing the mappings from ipv6-addresses to gnunet-descriptors
74 extern struct GNUNET_CONTAINER_MultiHashMap *hashmap;
78 /** The description of the service (used for service) */
79 struct GNUNET_vpn_service_descriptor desc;
81 /** The real address of the service (used for remote) */
85 struct GNUNET_MESH_Tunnel *tunnel;
87 char additional_ports[8192];
89 struct GNUNET_CONTAINER_HeapNode *heap_node;
92 * After this struct the name is located in DNS-Format!
97 * Sets a bit active in a bitArray.
99 * @param bitArray memory area to set the bit in
100 * @param bitIdx which bit to set
103 setBit (char *bitArray, unsigned int bitIdx);
106 * Clears a bit from bitArray.
108 * @param bitArray memory area to set the bit in
109 * @param bitIdx which bit to unset
112 clearBit (char *bitArray, unsigned int bitIdx);
115 * Checks if a bit is active in the bitArray
117 * @param bitArray memory area to set the bit in
118 * @param bitIdx which bit to test
119 * @return GNUNET_YES if the bit is set, GNUNET_NO if not.
122 testBit (char *bitArray, unsigned int bitIdx);
127 unsigned char addr[16];
131 #endif /* end of include guard: GNUNET-DAEMON-VPN_H */