50 #define MAX_MESSAGE_QUEUE_SIZE 4 141 } service_destination;
419 const void *source_ip,
420 uint16_t source_port,
421 const void *destination_ip,
432 off +=
sizeof(uint16_t);
434 off +=
sizeof(uint16_t);
439 off +=
sizeof(
struct in_addr);
441 off +=
sizeof(
struct in_addr);
446 off +=
sizeof(
struct in6_addr);
447 GNUNET_memcpy (off, destination_ip,
sizeof(
struct in6_addr));
448 off +=
sizeof(
struct in6_addr);
481 rlen =
sizeof(
struct in_addr);
485 rlen =
sizeof(
struct in6_addr);
517 if (NULL != (channel = ts->
channel))
527 while (NULL != (tnq = ts->
tmq_head))
583 "# Messages dropped in cadet queue (overflow)"),
600 static char dest[256];
637 "CADET notified us about death of channel to `%s'\n",
664 udp->
len = htons (0);
665 udp->
crc = htons (0);
690 udp->
len = htons (0);
691 udp->
crc = htons (0);
713 if (AF_UNSPEC == ts->
af)
742 char sbuf[INET6_ADDRSTRLEN];
743 char dbuf[INET6_ADDRSTRLEN];
747 "Received ICMP packet from cadet, sending %u bytes from %s -> %s via TUN\n",
750 inet_ntop (ts->
af, &ts->
source_ip, dbuf,
sizeof(dbuf)));
756 + sizeof(struct GNUNET_TUN_IcmpHeader)
757 + sizeof(struct GNUNET_MessageHeader)
758 + sizeof(struct GNUNET_TUN_Layer2PacketHeader) + mlen;
763 struct GNUNET_MessageHeader *
msg = (
struct GNUNET_MessageHeader *)
buf;
764 struct GNUNET_TUN_Layer2PacketHeader *tun =
765 (
struct GNUNET_TUN_Layer2PacketHeader *) &msg[1];
768 struct GNUNET_TUN_IcmpHeader *icmp =
769 (
struct GNUNET_TUN_IcmpHeader *) &ipv4[1];
771 tun->
flags = htons (0);
775 sizeof(
struct GNUNET_TUN_IcmpHeader)
784 switch (ntohl (i2v->
af))
817 gettext_noop (
"# ICMPv4 packets dropped (type not allowed)"),
873 gettext_noop (
"# ICMPv6 packets dropped (impossible PT to v4)"),
890 gettext_noop (
"# ICMPv6 packets dropped (type not allowed)"),
902 msg->
size = htons (size);
911 + sizeof(struct GNUNET_TUN_IcmpHeader)
912 + sizeof(struct GNUNET_MessageHeader)
913 + sizeof(struct GNUNET_TUN_Layer2PacketHeader) + mlen;
916 struct GNUNET_MessageHeader *
msg = (
struct GNUNET_MessageHeader *)
buf;
917 struct GNUNET_TUN_Layer2PacketHeader *tun =
918 (
struct GNUNET_TUN_Layer2PacketHeader *) &msg[1];
921 struct GNUNET_TUN_IcmpHeader *icmp =
922 (
struct GNUNET_TUN_IcmpHeader *) &ipv6[1];
924 tun->
flags = htons (0);
928 sizeof(
struct GNUNET_TUN_IcmpHeader)
938 switch (ntohl (i2v->
af))
995 gettext_noop (
"# ICMPv4 packets dropped (impossible PT to v6)"),
1004 gettext_noop (
"# ICMPv4 packets dropped (type not allowed)"),
1043 gettext_noop (
"# ICMPv6 packets dropped (type not allowed)"),
1055 msg->
size = htons (size);
1089 if (AF_UNSPEC == ts->
af)
1118 char sbuf[INET6_ADDRSTRLEN];
1119 char dbuf[INET6_ADDRSTRLEN];
1123 "Received UDP reply from cadet, sending %u bytes from [%s]:%u -> [%s]:%u via TUN\n",
1124 (
unsigned int) mlen,
1127 inet_ntop (ts->
af, &ts->
source_ip, dbuf,
sizeof(dbuf)),
1134 + sizeof(struct GNUNET_TUN_UdpHeader)
1135 + sizeof(struct GNUNET_MessageHeader)
1136 + sizeof(struct GNUNET_TUN_Layer2PacketHeader) + mlen;
1139 struct GNUNET_MessageHeader *
msg = (
struct GNUNET_MessageHeader *)
buf;
1140 struct GNUNET_TUN_Layer2PacketHeader *tun =
1141 (
struct GNUNET_TUN_Layer2PacketHeader *) &msg[1];
1144 struct GNUNET_TUN_UdpHeader *
udp =
1145 (
struct GNUNET_TUN_UdpHeader *) &ipv4[1];
1147 msg->
size = htons (size);
1148 tun->
flags = htons (0);
1152 sizeof(
struct GNUNET_TUN_UdpHeader)
1164 udp->
len = htons (mlen +
sizeof(
struct GNUNET_TUN_UdpHeader));
1174 + sizeof(struct GNUNET_TUN_UdpHeader)
1175 + sizeof(struct GNUNET_MessageHeader)
1176 + sizeof(struct GNUNET_TUN_Layer2PacketHeader) + mlen;
1179 struct GNUNET_MessageHeader *
msg = (
struct GNUNET_MessageHeader *)
buf;
1180 struct GNUNET_TUN_Layer2PacketHeader *tun =
1181 (
struct GNUNET_TUN_Layer2PacketHeader *) &msg[1];
1184 struct GNUNET_TUN_UdpHeader *
udp =
1185 (
struct GNUNET_TUN_UdpHeader *) &ipv6[1];
1187 msg->
size = htons (size);
1188 tun->
flags = htons (0);
1192 sizeof(
struct GNUNET_TUN_UdpHeader)
1204 udp->
len = htons (mlen +
sizeof(
struct GNUNET_TUN_UdpHeader));
1267 char sbuf[INET6_ADDRSTRLEN];
1268 char dbuf[INET6_ADDRSTRLEN];
1272 "Received TCP reply from cadet, sending %u bytes from [%s]:%u -> [%s]:%u via TUN\n",
1273 (
unsigned int) mlen,
1276 inet_ntop (ts->
af, &ts->
source_ip, dbuf,
sizeof(dbuf)),
1283 + sizeof(struct GNUNET_TUN_TcpHeader)
1284 + sizeof(struct GNUNET_MessageHeader)
1285 + sizeof(struct GNUNET_TUN_Layer2PacketHeader) + mlen;
1288 struct GNUNET_MessageHeader *
msg = (
struct GNUNET_MessageHeader *)
buf;
1289 struct GNUNET_TUN_Layer2PacketHeader *tun =
1290 (
struct GNUNET_TUN_Layer2PacketHeader *) &msg[1];
1293 struct GNUNET_TUN_TcpHeader *
tcp =
1294 (
struct GNUNET_TUN_TcpHeader *) &ipv4[1];
1296 msg->
size = htons (size);
1297 tun->
flags = htons (0);
1301 sizeof(
struct GNUNET_TUN_TcpHeader)
1317 + sizeof(struct GNUNET_TUN_TcpHeader)
1318 + sizeof(struct GNUNET_MessageHeader)
1319 + sizeof(struct GNUNET_TUN_Layer2PacketHeader) + mlen;
1322 struct GNUNET_MessageHeader *
msg = (
struct GNUNET_MessageHeader *)
buf;
1323 struct GNUNET_TUN_Layer2PacketHeader *tun =
1324 (
struct GNUNET_TUN_Layer2PacketHeader *) &msg[1];
1327 struct GNUNET_TUN_TcpHeader *
tcp =
1328 (
struct GNUNET_TUN_TcpHeader *) &ipv6[1];
1330 msg->
size = htons (size);
1331 tun->
flags = htons (0);
1335 sizeof(
struct GNUNET_TUN_TcpHeader)
1407 unsigned int get_path_length,
1409 unsigned int put_path_length)
1415 "Exit %s found for destination %s!\n",
1441 "Creating tunnel to %s for destination %s!\n",
1475 .service_descriptor,
1490 "Creating channel to peer %s offering service %s on port %u\n",
1494 .service_descriptor),
1537 "Requesting connect by string: %s\n",
1561 "Tearing down expired channel to %s\n",
1585 size_t payload_length)
1596 uint16_t source_port;
1656 case IPPROTO_ICMPV6: {
1657 if ((AF_INET == af) ^ (protocol == IPPROTO_ICMP))
1672 destination_port = 0;
1685 _ (
"Protocol %u not supported, dropping\n"),
1686 (
unsigned int) protocol);
1695 alen =
sizeof(
struct in_addr);
1699 alen =
sizeof(
struct in6_addr);
1707 char sbuf[INET6_ADDRSTRLEN];
1708 char dbuf[INET6_ADDRSTRLEN];
1709 char xbuf[INET6_ADDRSTRLEN];
1713 "Routing %s packet from [%s]:%u -> [%s]:%u to destination [%s]:%u\n",
1714 (protocol == IPPROTO_TCP) ?
"TCP" :
"UDP",
1715 inet_ntop (af, source_ip, sbuf,
sizeof(sbuf)),
1717 inet_ntop (af, destination_ip, dbuf,
sizeof(dbuf)),
1725 for (dt = destination->
dt_head; NULL != dt; dt = dt->
next)
1732 char sbuf[INET6_ADDRSTRLEN];
1733 char dbuf[INET6_ADDRSTRLEN];
1737 "Routing %s packet from [%s]:%u -> [%s]:%u to service %s at peer %s\n",
1738 (protocol == IPPROTO_TCP) ?
"TCP" :
"UDP",
1739 inet_ntop (af, source_ip, sbuf,
sizeof(sbuf)),
1741 inet_ntop (af, destination_ip, dbuf,
sizeof(dbuf)),
1747 for (dt = destination->
dt_head; NULL != dt; dt = dt->
next)
1766 "Creating new channel for key %s\n",
1778 ts->
source_ip.
v4 = *(
const struct in_addr *) source_ip;
1783 ts->
source_ip.
v6 = *(
const struct in6_addr *) source_ip;
1815 "Packet dropped, channel to %s not yet ready (%s)\n",
1817 (NULL == ts->
search) ?
"EXIT search failed" 1818 :
"EXIT search active");
1821 "# Packets dropped (channel not yet online)"),
1836 - sizeof(struct GNUNET_TUN_UdpHeader);
1844 -
sizeof(
struct GNUNET_TUN_UdpHeader),
1853 payload_length -
sizeof(
struct GNUNET_TUN_UdpHeader));
1858 struct in_addr *ip4dst;
1859 struct in6_addr *ip6dst;
1863 + payload_length - sizeof(struct GNUNET_TUN_UdpHeader);
1870 payload_length + alen
1871 -
sizeof(
struct GNUNET_TUN_UdpHeader),
1880 ip4dst = (
struct in_addr *) &uim[1];
1882 payload = &ip4dst[1];
1886 ip6dst = (
struct in6_addr *) &uim[1];
1888 payload = &ip6dst[1];
1896 payload_length -
sizeof(
struct GNUNET_TUN_UdpHeader));
1908 + payload_length - sizeof(struct GNUNET_TUN_TcpHeader);
1917 -
sizeof(
struct GNUNET_TUN_TcpHeader),
1923 payload_length -
sizeof(
struct GNUNET_TUN_TcpHeader));
1928 struct in_addr *ip4dst;
1929 struct in6_addr *ip6dst;
1933 + payload_length - sizeof(struct GNUNET_TUN_TcpHeader);
1941 payload_length + alen
1942 -
sizeof(
struct GNUNET_TUN_TcpHeader),
1949 ip4dst = (
struct in_addr *) &tim[1];
1951 payload = &ip4dst[1];
1955 ip6dst = (
struct in6_addr *) &tim[1];
1957 payload = &ip6dst[1];
1965 payload_length -
sizeof(
struct GNUNET_TUN_TcpHeader));
1973 - sizeof(struct GNUNET_TUN_TcpHeader);
1981 -
sizeof(
struct GNUNET_TUN_TcpHeader),
1987 payload_length -
sizeof(
struct GNUNET_TUN_TcpHeader));
1992 case IPPROTO_ICMPV6:
2019 "# ICMPv4 packets dropped (not allowed)"),
2045 "# ICMPv6 packets dropped (not allowed)"),
2060 + payload_length - sizeof(struct GNUNET_TUN_IcmpHeader);
2069 -
sizeof(
struct GNUNET_TUN_IcmpHeader),
2071 ism->
af = htonl (af);
2075 payload_length -
sizeof(
struct GNUNET_TUN_IcmpHeader));
2080 struct in_addr *ip4dst;
2081 struct in6_addr *ip6dst;
2085 new_type = icmp->
type;
2122 gettext_noop (
"# ICMPv4 packets dropped (impossible PT to v6)"),
2134 gettext_noop (
"# ICMPv4 packets dropped (type not allowed)"),
2164 gettext_noop (
"# ICMPv6 packets dropped (impossible PT to v4)"),
2178 gettext_noop (
"# ICMPv6 packets dropped (impossible PT to v4)"),
2200 gettext_noop (
"# ICMPv6 packets dropped (type not allowed)"),
2214 + payload_length - sizeof(struct GNUNET_TUN_IcmpHeader);
2221 alen + payload_length
2222 -
sizeof(
struct GNUNET_TUN_IcmpHeader),
2230 ip4dst = (
struct in_addr *) &iim[1];
2232 payload = &ip4dst[1];
2236 ip6dst = (
struct in6_addr *) &iim[1];
2238 payload = &ip6dst[1];
2246 payload_length -
sizeof(
struct GNUNET_TUN_IcmpHeader));
2282 "# Packets received from TUN interface"),
2285 mlen = ntohs (message->
size);
2295 + sizeof(struct GNUNET_TUN_Layer2PacketHeader));
2296 switch (ntohs (tun->
proto))
2312 char buf[INET6_ADDRSTRLEN];
2316 _ (
"Packet received for unmapped destination `%s' (dropping it)\n"),
2344 char buf[INET_ADDRSTRLEN];
2348 _ (
"Packet received for unmapped destination `%s' (dropping it)\n"),
2355 _ (
"Received IPv4 packet with options (dropping it)\n"));
2371 _ (
"Received packet of unknown protocol %d from TUN (dropping it)\n"),
2372 (
unsigned int) ntohs (tun->
proto));
2390 const char *ipv4addr =
vpn_argv[4];
2391 const char *ipv4mask =
vpn_argv[5];
2392 struct in_addr addr;
2393 struct in_addr mask;
2402 mask.s_addr = addr.s_addr | ~mask.s_addr;
2411 "Failed to find unallocated IPv4 address in VPN's range\n"));
2417 v4->s_addr = (addr.s_addr | rnd.s_addr) & mask.s_addr;
2422 (v4->s_addr == addr.s_addr) || (v4->s_addr == mask.s_addr));
2438 const char *ipv6addr =
vpn_argv[2];
2439 struct in6_addr addr;
2440 struct in6_addr mask;
2441 struct in6_addr rnd;
2452 mask.s6_addr[i / 8] |= (1 << (i % 8));
2463 "Failed to find unallocated IPv6 address in VPN's range\n"));
2466 for (i = 0; i < 16; i++)
2471 v6->s6_addr[i] = (addr.s6_addr[i] | rnd.s6_addr[i]) & mask.s6_addr[i];
2494 "Cleaning up destination entry `%s'\n",
2500 while (NULL != (dt = de->
dt_head))
2553 struct in6_addr *
v6)
2560 *result_af = AF_UNSPEC;
2567 *result_af = AF_UNSPEC;
2576 *result_af = AF_INET;
2581 *result_af = AF_INET6;
2610 addr_af = (int) htonl (msg->
addr_af);
2614 if (alen !=
sizeof(
struct in_addr))
2622 if (alen !=
sizeof(
struct in6_addr))
2660 addr_af = (int) htonl (msg->
addr_af);
2662 result_af = (int) htonl (msg->
result_af);
2670 if (result_af == AF_UNSPEC)
2678 char sbuf[INET6_ADDRSTRLEN];
2679 char dbuf[INET6_ADDRSTRLEN];
2682 "Allocated address %s for redirection via exit to %s\n",
2683 inet_ntop (result_af, addr, sbuf,
sizeof(sbuf)),
2684 inet_ntop (addr_af, &msg[1], dbuf,
sizeof(dbuf)));
2738 result_af = (int) htonl (msg->
result_af);
2746 if (result_af == AF_UNSPEC)
2750 _ (
"Failed to allocate IP address for new destination\n"));
2756 char sbuf[INET6_ADDRSTRLEN];
2759 "Allocated address %s for redirection to service %s on peer %s\n",
2760 inet_ntop (result_af, addr, sbuf,
sizeof(sbuf)),
2826 "Tearing down channel to `%s' during cleanup\n",
2844 if (NULL != destination_map)
2850 destination_map = NULL;
2852 if (NULL != destination_heap)
2855 destination_heap = NULL;
2857 if (NULL != channel_map)
2863 if (NULL != channel_heap)
2866 channel_heap = NULL;
2868 if (NULL != cadet_handle)
2871 cadet_handle = NULL;
2873 if (NULL != helper_handle)
2877 helper_handle = NULL;
2884 for (i = 0; i < 5; i++)
2950 "-d gnunet-vpn - - 169.1.3.3.7 255.255.255.0"))
2953 "`%s' is not SUID or the path is invalid, refusing to run.\n",
3003 (1 != inet_pton (AF_INET6, ipv6addr, &v6))))
3008 _ (
"Must specify valid IPv6 address"));
3015 ipv6prefix_s = NULL;
3036 _ (
"Must specify valid IPv6 mask"));
3046 "IPv6 support disabled as this system does not support IPv6\n"));
3057 (1 != inet_pton (AF_INET, ipv4addr, &v4))))
3062 _ (
"Must specify valid IPv4 address"));
3074 (1 != inet_pton (AF_INET, ipv4mask, &v4))))
3079 _ (
"Must specify valid IPv4 mask"));
3091 "IPv4 support disabled as this system does not support IPv4\n"));
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
struct GNUNET_HashCode service_descriptor
Service descriptor identifying the service.
union ChannelState::@98 source_ip
IP address of the source on our end, initially uninitialized.
int GNUNET_HELPER_kill(struct GNUNET_HELPER_Handle *h, int soft_kill)
Sends termination signal to the helper process.
Response from the VPN service to a VPN client informing about the IP that was assigned for the reques...
struct GNUNET_CONTAINER_HeapNode * heap_node
Entry for this entry in the destination_heap.
void GNUNET_CADET_disconnect(struct GNUNET_CADET_Handle *handle)
Disconnect from the cadet service.
void GNUNET_CONTAINER_heap_update_cost(struct GNUNET_CONTAINER_HeapNode *node, GNUNET_CONTAINER_HeapCostType new_cost)
Updates the cost of any node in the tree.
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
static int udp
Option -u: UDP requested.
static void expire_channel(struct ChannelState *except)
We have too many active channels.
const void * msg
Message to transmit, allocated at the end of this struct.
struct GNUNET_MessageHeader * msg
static void handle_client_redirect_to_service(void *cls, const struct RedirectToServiceRequestMessage *msg)
A client asks us to setup a redirection to a particular peer offering a service.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
#define GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_SERVICE
Type of messages containing an ICMP packet for a service.
unsigned int GNUNET_CONTAINER_multihashmap_size(const struct GNUNET_CONTAINER_MultiHashMap *map)
Get the number of key-value pairs in the map.
static int check_tcp_back(void *cls, const struct GNUNET_EXIT_TcpDataMessage *data)
We got a TCP packet back from the CADET channel.
static void make_up_icmpv4_payload(struct ChannelState *ts, struct GNUNET_TUN_IPv4Header *ipp, struct GNUNET_TUN_UdpHeader *udp)
Synthesize a plausible ICMP payload for an ICMP error response on the given channel.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
Information we track for each IP address to determine which channel to send the traffic over to the d...
#define GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_INTERNET
Type of messages containing an ICMP packet for the Internet.
struct DestinationEntry::@94::@95 service_destination
struct GNUNET_CONTAINER_HeapNode * GNUNET_CONTAINER_heap_insert(struct GNUNET_CONTAINER_Heap *heap, void *element, GNUNET_CONTAINER_HeapCostType cost)
Inserts a new element into the heap.
struct ChannelMessageQueueEntry * tmq_head
Head of list of messages scheduled for transmission.
Opaque handle to the service.
#define GNUNET_TUN_ICMPTYPE_TIME_EXCEEDED
struct GNUNET_PeerIdentity target
Target peer offering the service.
uint8_t protocol
IPPROTO_TCP or IPPROTO_UDP once bound.
#define GNUNET_MESSAGE_TYPE_VPN_CLIENT_REDIRECT_TO_SERVICE
Client asks VPN service to setup an IP to redirect traffic to some peer offering a service...
struct GNUNET_MQ_Handle * GNUNET_SERVICE_client_get_mq(struct GNUNET_SERVICE_Client *c)
Obtain the message queue of c.
struct ChannelMessageQueueEntry * next
This is a doubly-linked list.
struct DestinationChannel * next
Kept in a DLL.
The handle to a helper process.
struct GNUNET_HELPER_Handle * GNUNET_HELPER_start(int with_control_pipe, const char *binary_name, char *const binary_argv[], GNUNET_MessageTokenizerCallback cb, GNUNET_HELPER_ExceptionCallback exp_cb, void *cb_cls)
Starts a helper and begins reading from it.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received, or when GNUNET_SCHEDULER_shutdown() is being invoked.
struct ChannelMessageQueueEntry * prev
This is a doubly-linked list.
struct GNUNET_STATISTICS_Handle * GNUNET_STATISTICS_create(const char *subsystem, const struct GNUNET_CONFIGURATION_Handle *cfg)
Get handle for the statistics service.
static int ipv4
Option -4: IPv4 requested.
static const char * print_channel_destination(const struct DestinationEntry *de)
Output destination of a channel for diagnostics.
uint32_t GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i)
Produce a random value.
int32_t af
Address family, AF_INET or AF_INET6, in network byte order.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
void GNUNET_TUN_ipv4toregexsearch(const struct in_addr *ip, uint16_t port, char *rxstr)
Create a regex in rxstr from the given ip and port.
#define GNUNET_MESSAGE_TYPE_VPN_UDP_TO_SERVICE
Type of messages containing an UDP packet for a service.
void GNUNET_MQ_env_set_options(struct GNUNET_MQ_Envelope *env, enum GNUNET_MQ_PriorityPreferences pp)
Set application-specific options for this envelope.
#define GNUNET_MESSAGE_TYPE_VPN_TCP_TO_SERVICE_START
Type of messages containing an TCP packet for a service.
static void make_up_icmpv6_payload(struct ChannelState *ts, struct GNUNET_TUN_IPv6Header *ipp, struct GNUNET_TUN_UdpHeader *udp)
Synthesize a plausible ICMP payload for an ICMP error response on the given channel.
uint16_t source_port
Source port used by the sender on our end; 0 for uninitialized.
static void send_to_channel(struct ChannelState *ts, struct GNUNET_MQ_Envelope *env)
Add the given message to the given channel and trigger the transmission process.
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we use.
static void expire_destination(struct DestinationEntry *except)
We have too many active destinations.
#define GNUNET_MESSAGE_TYPE_VPN_UDP_TO_INTERNET
Type of messages containing an UDP packet for the Internet.
#define ETH_P_IPV6
Number for IPv6.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_number(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *number)
Get a configuration value that should be a number.
static int cleanup_destination(void *cls, const struct GNUNET_HashCode *key, void *value)
Free memory occupied by an entry in the destination map.
static void handle_regex_result(void *cls, const struct GNUNET_PeerIdentity *id, const struct GNUNET_PeerIdentity *get_path, unsigned int get_path_length, const struct GNUNET_PeerIdentity *put_path, unsigned int put_path_length)
Regex has found a potential exit peer for us; consider using it.
uint64_t request_id
Unique ID to match the response to a request.
static void handle_udp_back(void *cls, const struct GNUNET_EXIT_UdpReplyMessage *reply)
We got a UDP packet back from the CADET channel.
struct GNUNET_TUN_IcmpHeader icmp_header
ICMP header to use.
struct DestinationEntry destination
Destination to which this channel leads.
int32_t result_af
Address family desired for the result (AF_INET or AF_INET6 or AF_UNSPEC, in nbo)
Opaque handle to a channel.
static int cleanup_channel(void *cls, const struct GNUNET_HashCode *key, void *value)
Free memory occupied by an entry in the channel map.
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
int GNUNET_OS_check_helper_binary(const char *binary, int check_suid, const char *params)
Check whether an executable exists and possibly if the suid bit is set on the file.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct GNUNET_HashCode key
Key under which this entry is in the 'destination_map' (only valid if 'heap_node != NULL')...
void GNUNET_TUN_calculate_udp4_checksum(const struct GNUNET_TUN_IPv4Header *ip, struct GNUNET_TUN_UdpHeader *udp, const void *payload, uint16_t payload_length)
Calculate IPv4 UDP checksum.
int32_t af
Address family, AF_INET or AF_INET6, in network byte order.
void GNUNET_log_config_invalid(enum GNUNET_ErrorType kind, const char *section, const char *option, const char *required)
Log error message about invalid configuration option value.
struct GNUNET_TUN_TcpHeader tcp_header
Skeleton of the TCP header to send.
struct GNUNET_CONTAINER_HeapNode * heap_node
Heap node for this state in the connections_heap.
int is_service
GNUNET_NO if this is a channel to an Internet-exit, GNUNET_YES if this channel is to a service...
int GNUNET_CONTAINER_multihashmap_contains(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Check if the map contains any value under the given key (including values that are NULL)...
void GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h, int sync_first)
Destroy a handle (free all state associated with it).
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
void GNUNET_TUN_calculate_tcp6_checksum(const struct GNUNET_TUN_IPv6Header *ip, struct GNUNET_TUN_TcpHeader *tcp, const void *payload, uint16_t payload_length)
Calculate IPv6 TCP checksum.
#define GNUNET_TUN_ICMPTYPE_SOURCE_QUENCH
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be a string.
static unsigned long long max_destination_mappings
If there are more than this number of address-mappings, old ones will be removed. ...
struct GNUNET_TUN_TcpHeader tcp_header
Skeleton of the TCP header to send.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
static int allocate_v6_address(struct in6_addr *v6)
Allocate an IPv6 address from the range of the channel for a new redirection.
void GNUNET_TUN_initialize_ipv4_header(struct GNUNET_TUN_IPv4Header *ip, uint8_t protocol, uint16_t payload_length, const struct in_addr *src, const struct in_addr *dst)
Initialize an IPv4 header.
uint64_t abs_value_us
The actual value.
Message send by the VPN client to the VPN service requesting the setup of a redirection from some IP ...
Internal representation of the hash map.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_VPN_UDP_REPLY.
void GNUNET_TUN_calculate_udp6_checksum(const struct GNUNET_TUN_IPv6Header *ip, struct GNUNET_TUN_UdpHeader *udp, const void *payload, uint16_t payload_length)
Calculate IPv6 UDP checksum.
GNUNET_SERVICE_MAIN("vpn", GNUNET_SERVICE_OPTION_NONE, &run, &client_connect_cb, &client_disconnect_cb, NULL, GNUNET_MQ_hd_var_size(client_redirect_to_ip, GNUNET_MESSAGE_TYPE_VPN_CLIENT_REDIRECT_TO_IP, struct RedirectToIpRequestMessage, NULL), GNUNET_MQ_hd_fixed_size(client_redirect_to_service, GNUNET_MESSAGE_TYPE_VPN_CLIENT_REDIRECT_TO_SERVICE, struct RedirectToServiceRequestMessage, NULL), GNUNET_MQ_handler_end())
Define "main" method using service macro.
static void handle_icmp_back(void *cls, const struct GNUNET_EXIT_IcmpToVPNMessage *i2v)
We got an ICMP packet back from the CADET channel.
struct GNUNET_REGEX_Search * GNUNET_REGEX_search(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *string, GNUNET_REGEX_Found callback, void *callback_cls)
Search for a peer offering a regex matching certain string in the DHT.
struct GNUNET_CADET_Handle * GNUNET_CADET_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the MQ-based cadet service.
void * GNUNET_CONTAINER_multihashmap_get(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Given a key find a value in the map matching the key.
static void run(void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg_, struct GNUNET_SERVICE_Handle *service)
Main function that will be run by the scheduler.
IPC messages between VPN library and VPN service.
#define GNUNET_MESSAGE_TYPE_VPN_TCP_DATA_TO_EXIT
Type of messages containing an TCP packet of an established connection.
Handle to a client that is connected to a service.
int GNUNET_snprintf(char *buf, size_t size, const char *format,...) __attribute__((format(printf
Like snprintf, just aborts if the buffer is of insufficient size.
static int global_ret
Return value from main().
Best-effort traffic (i.e.
int32_t af
Address family, AF_INET or AF_INET6, in network byte order.
Message send via cadet to an exit daemon to send ICMP data to a local service.
#define GNUNET_TUN_ICMPTYPE6_DESTINATION_UNREACHABLE
#define GNUNET_TUN_ICMPTYPE6_TIME_EXCEEDED
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
#define GNUNET_TUN_ICMPTYPE6_ECHO_REPLY
#define GNUNET_MESSAGE_TYPE_VPN_CLIENT_USE_IP
VPN service responds to client with an IP to use for the requested redirection.
void * cls
Closure for mv and cb.
void GNUNET_log_config_missing(enum GNUNET_ErrorType kind, const char *section, const char *option)
Log error message about missing configuration option.
static char * value
Value of the record to add/remove.
#define GNUNET_APPLICATION_PORT_IPV6_GATEWAY
Internet IPv6 gateway (any TCP/UDP/ICMP).
struct GNUNET_TUN_TcpHeader tcp_header
Skeleton of the TCP header to send.
#define GNUNET_MESSAGE_TYPE_VPN_UDP_REPLY
Type of messages containing an UDP packet from a remote host.
static void client_disconnect_cb(void *cls, struct GNUNET_SERVICE_Client *c, void *internal_cls)
Callback called when a client disconnected from the service.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
void GNUNET_TUN_calculate_tcp4_checksum(const struct GNUNET_TUN_IPv4Header *ip, struct GNUNET_TUN_TcpHeader *tcp, const void *payload, uint16_t payload_length)
Calculate IPv4 TCP checksum.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
static void free_channel_state(struct ChannelState *ts)
Free resources associated with a channel state.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
static struct GNUNET_CONTAINER_Heap * channel_heap
Min-Heap sorted by activity time to expire old mappings; values are of type 'struct ChannelState'...
unsigned int GNUNET_MQ_get_length(struct GNUNET_MQ_Handle *mq)
Obtain the current length of the message queue.
List of channels we keep for each destination port for a given destination entry. ...
#define GNUNET_MESSAGE_TYPE_VPN_CLIENT_REDIRECT_TO_IP
Client asks VPN service to setup an IP to redirect traffic via an exit node to some global IP address...
#define GNUNET_TUN_ICMPTYPE6_PACKET_TOO_BIG
static int message_token(void *cls, const struct GNUNET_MessageHeader *message)
Receive packets from the helper-process (someone send to the local virtual channel interface)...
uint16_t destination_port
Destination port to use for the UDP request.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
static void cleanup(void *cls)
Function scheduled as very last function, cleans up after us.
#define MAX_MESSAGE_QUEUE_SIZE
Maximum number of messages we allow in the queue for cadet.
static int allocate_response_ip(int *result_af, void **addr, struct in_addr *v4, struct in6_addr *v6)
Allocate an IP address for the response.
void * GNUNET_CONTAINER_heap_peek(const struct GNUNET_CONTAINER_Heap *heap)
Get element stored at the root of heap.
int32_t result_af
Address family desired for the result (AF_INET or AF_INET6 or AF_UNSPEC, in nbo)
int is_established
Is this channel new (GNUNET_NO), or did we exchange messages with the other side already (GNUNET_YES)...
uint32_t reserved
Always 0.
Message send via cadet to an exit daemon to forward ICMP data to the Internet.
#define GNUNET_MESSAGE_TYPE_VPN_TCP_TO_INTERNET_START
Type of messages containing an TCP packet for the Internet.
#define GNUNET_MESSAGE_TYPE_VPN_TCP_DATA_TO_VPN
Type of messages containing an TCP packet of an established connection.
static unsigned long long max_channel_mappings
If there are more than this number of open channels, old ones will be removed.
int GNUNET_CONTAINER_multihashmap_remove(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, const void *value)
Remove the given key-value pair from the map.
int af
Addess family used for this channel on the local TUN interface.
char * GNUNET_OS_get_suid_binary_path(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *progname)
Given the name of a helper, service or daemon binary construct the full path to the binary using the ...
Handle to a node in a heap.
static struct GNUNET_CONTAINER_MultiHashMap * destination_map
Map from IP address to destination information (possibly with a CADET channel handle for fast setup)...
int32_t af
Address family, AF_INET or AF_INET6, in network byte order.
void GNUNET_REGEX_search_cancel(struct GNUNET_REGEX_Search *s)
Stop search and free all data used by a GNUNET_REGEX_search call.
A messages we have in queue for a particular channel.
size_t len
Number of bytes in msg.
static struct GNUNET_CADET_Handle * cadet_handle
Handle to the cadet service.
Heap with the minimum cost at the root.
static void free_destination_entry(struct DestinationEntry *de)
Free resources occupied by a destination entry.
void GNUNET_CONTAINER_heap_destroy(struct GNUNET_CONTAINER_Heap *heap)
Destroys the heap.
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
Message send from exit daemon back to the UDP entry point (used for both Internet and Service exit re...
static void get_destination_key_from_ip(int af, const void *address, struct GNUNET_HashCode *key)
Compute the key under which we would store an entry in the destination_map for the given IP address...
Message handler for a specific message type.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
struct GNUNET_CADET_Channel * channel
Cadet channel that is used for this connection.
static void route_packet(struct DestinationEntry *destination, int af, uint8_t protocol, const void *source_ip, const void *destination_ip, const void *payload, size_t payload_length)
Route a packet via cadet to the given destination.
static void get_channel_key_from_ips(int af, uint8_t protocol, const void *source_ip, uint16_t source_port, const void *destination_ip, uint16_t destination_port, struct GNUNET_HashCode *key)
Compute the key under which we would store an entry in the channel_map for the given socket address p...
void GNUNET_TUN_ipv6toregexsearch(const struct in6_addr *ipv6, uint16_t port, char *rxstr)
Create a regex in rxstr from the given ipv6 and port.
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
void GNUNET_MQ_discard(struct GNUNET_MQ_Envelope *mqm)
Discard the message queue message, free all allocated resources.
uint16_t source_port
Source port to use for the UDP reply (0 to use the same port as for the original request).
static char * vpn_argv[7]
Arguments to the vpn helper.
#define GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX
Internet exit regex prefix.
struct in_addr v4
Address if af is AF_INET.
struct in6_addr v6
Address if af is AF_INET6.
void GNUNET_TUN_compute_service_cadet_port(const struct GNUNET_HashCode *desc, uint16_t ip_port, struct GNUNET_HashCode *cadet_port)
Compute the CADET port given a service descriptor (returned from GNUNET_TUN_service_name_to_hash) and...
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_VPN_CLIENT_REDIRECT_TO_IP.
There must only be one value per key; storing a value should fail if a value under the same key alrea...
format for cadet messages exchanged between VPN service and exit daemon
struct in_addr v4
Address if af is AF_INET.
struct GNUNET_HashCode key
The key used in the DHT.
static struct ChannelState * create_channel_to_destination(struct DestinationChannel *dt, int client_af)
Initialize the given destination entry's cadet channel.
static unsigned int size
Size of the "table".
int32_t result_af
Address family of the allocated address that follows; will match "result_af" from the request...
#define GNUNET_TUN_ICMPTYPE_DESTINATION_UNREACHABLE
static int check_client_redirect_to_ip(void *cls, const struct RedirectToIpRequestMessage *msg)
A client asks us to setup a redirection via some exit node to a particular IP.
struct GNUNET_MQ_Envelope * env
void GNUNET_TUN_calculate_icmp_checksum(struct GNUNET_TUN_IcmpHeader *icmp, const void *payload, uint16_t payload_length)
Calculate ICMP checksum.
#define GNUNET_TUN_IPV4_REGEXLEN
Maximum regex string length for use with GNUNET_TUN_ipv4toregexsearch.
static void handle_client_redirect_to_ip(void *cls, const struct RedirectToIpRequestMessage *msg)
A client asks us to setup a redirection via some exit node to a particular IP.
static struct GNUNET_CONTAINER_MultiHashMap * channel_map
Map from source and destination address (IP+port) to connection information (mostly with the respecti...
static void send_client_reply(struct GNUNET_SERVICE_Client *client, uint64_t request_id, int result_af, const void *addr)
Notify the client about the result of its request.
Message send via cadet to the vpn service to send ICMP data to the VPN's TUN interface.
struct DestinationEntry * destination
Destination entry list this struct DestinationChannel belongs with.
int GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
static unsigned long long payload
How much data are we currently storing in the database?
uint16_t destination_port
Destination port this channel state is used for.
struct GNUNET_CONTAINER_Heap * GNUNET_CONTAINER_heap_create(enum GNUNET_CONTAINER_HeapOrder order)
Create a new heap.
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
struct GNUNET_TIME_AbsoluteNBO expiration_time
How long should the redirection be maintained at most?
static int tcp
Option -t: TCP requested.
#define GNUNET_MAX_MESSAGE_SIZE
Largest supported message (to be precise, one byte more than the largest possible message...
static void handle_tcp_back(void *cls, const struct GNUNET_EXIT_TcpDataMessage *data)
We got a TCP packet back from the CADET channel.
#define GNUNET_TUN_ICMPTYPE_ECHO_REQUEST
#define GNUNET_TUN_ICMPTYPE6_PARAMETER_PROBLEM
Message send via cadet to an exit daemon to send UDP data to a local service.
uint64_t request_id
Unique ID to match a future response to this request.
Allow multiple values with the same key.
Handle to a message queue.
The identity of the host (wraps the signing key of the peer).
#define GNUNET_TUN_ICMPTYPE6_ECHO_REQUEST
void GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel)
Send an ack on the channel to confirm the processing of a message.
static struct GNUNET_STATISTICS_Handle * stats
Statistics.
#define GNUNET_ALIGN
gcc-ism to force alignment; we use this to align char-arrays that may then be cast to 'struct's...
struct GNUNET_CADET_Channel * GNUNET_CADET_channel_create(struct GNUNET_CADET_Handle *h, void *channel_cls, const struct GNUNET_PeerIdentity *destination, const struct GNUNET_HashCode *port, GNUNET_CADET_WindowSizeEventHandler window_changes, GNUNET_CADET_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers)
Create a new channel towards a remote peer.
#define GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_VPN
Type of messages containing an ICMP packet for the VPN.
static uint16_t port
Port number.
struct DestinationChannel * dt_head
Head of DLL of channels associated with this destination.
union ChannelState::@99 destination_ip
Destination IP address used by the source on our end (this is the IP that we pick freely within the V...
int32_t addr_af
Address family used for the destination address (AF_INET or AF_INET6, in nbo)
static void channel_cleaner(void *cls, const struct GNUNET_CADET_Channel *channel)
Function called whenever a channel is destroyed.
static void * client_connect_cb(void *cls, struct GNUNET_SERVICE_Client *c, struct GNUNET_MQ_Handle *mq)
Callback called when a client connects to the service.
struct GNUNET_TIME_AbsoluteNBO expiration_time
How long should the redirection be maintained at most?
int af
Address family used (AF_INET or AF_INET6).
struct ChannelMessageQueueEntry * tmq_tail
Tail of list of messages scheduled for transmission.
struct GNUNET_HELPER_SendHandle * GNUNET_HELPER_send(struct GNUNET_HELPER_Handle *h, const struct GNUNET_MessageHeader *msg, int can_drop, GNUNET_HELPER_Continuation cont, void *cont_cls)
Send an message to the helper.
uint16_t destination_port
Destination port used by the sender on our end; 0 for uninitialized.
struct GNUNET_MQ_Handle * mq
static int allocate_v4_address(struct in_addr *v4)
Allocate an IPv4 address from the range of the channel for a new redirection.
#define GNUNET_log(kind,...)
Flag to indicate that out-of-order delivery is OK.
int GNUNET_HELPER_wait(struct GNUNET_HELPER_Handle *h)
Reap the helper process.
static unsigned long long ipv6prefix
Length of the prefix of the VPN's IPv6 network.
Message send via cadet to an exit daemon to initiate forwarding of TCP data to the Internet...
int32_t af
Address family, AF_INET or AF_INET6, in network byte order.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
struct GNUNET_REGEX_Search * search
Active query with REGEX to locate exit.
union DestinationEntry::@94 details
Details about the connection (depending on is_service).
uint16_t destination_port
Destination port to use for the UDP reply (0 to use the same port as for the original request)...
struct GNUNET_MessageHeader header
Type is #GNUNET_MESSAGE_TYPE_VPN_TCP_DATA.
This struct is saved into connections_map to allow finding the right channel given an IP packet from ...
struct DestinationChannel * prev
Kept in a DLL.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
static int check_udp_back(void *cls, const struct GNUNET_EXIT_UdpReplyMessage *reply)
We got a UDP packet back from the CADET channel.
static struct GNUNET_CADET_Channel * create_channel(struct ChannelState *ts, const struct GNUNET_PeerIdentity *target, const struct GNUNET_HashCode *port)
Create a channel for ts to target at port.
static struct GNUNET_CONTAINER_Heap * destination_heap
Min-Heap sorted by activity time to expire old mappings.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
struct GNUNET_MQ_Envelope * GNUNET_MQ_unsent_head(struct GNUNET_MQ_Handle *mq)
Remove the first envelope that has not yet been sent from the message queue and return it...
unsigned int tmq_length
Length of the doubly linked 'tmq_head/tmq_tail' list.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_VPN.
uint64_t request_id
Unique ID to match a future response to this request.
Handle to store data about a regex search.
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MulitHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
uint16_t source_port
Source port to use for the UDP request (0 to use a random port).
Message send via cadet to an exit daemon to initiate forwarding of TCP data to a local service...
uint32_t data
The data value.
void * GNUNET_CONTAINER_heap_remove_node(struct GNUNET_CONTAINER_HeapNode *node)
Removes a node from the heap.
#define GNUNET_TUN_ICMPTYPE_ECHO_REPLY
static int check_icmp_back(void *cls, const struct GNUNET_EXIT_IcmpToVPNMessage *i2v)
We got an ICMP packet back from the CADET channel.
#define GNUNET_APPLICATION_PORT_IPV4_GATEWAY
Internet IPv4 gateway (any TCP/UDP/ICMP).
static char * address
GNS address for this phone.
struct DestinationChannel * dt_tail
Tail of DLL of channels associated with this destination.
Message send via cadet between VPN and entry and an exit daemon to transmit TCP data between the VPN ...
void GNUNET_CADET_channel_destroy(struct GNUNET_CADET_Channel *channel)
Destroy an existing channel.
uint32_t reserved
Always 0.
struct GNUNET_TUN_IcmpHeader icmp_header
ICMP header to use.
struct DestinationEntry::@94::@96 exit_destination
static struct GNUNET_HELPER_Handle * helper_handle
The handle to the VPN helper process "gnunet-helper-vpn".
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
void GNUNET_TUN_initialize_ipv6_header(struct GNUNET_TUN_IPv6Header *ip, uint8_t protocol, uint16_t payload_length, const struct in6_addr *src, const struct in6_addr *dst)
Initialize an IPv6 header.
uint16_t source_port
Source port to use for the UDP request (0 to use a random port).
struct GNUNET_TUN_IcmpHeader icmp_header
ICMP header to use.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define ETH_P_IPV4
Number for IPv4.
No good quality of the operation is needed (i.e., random numbers can be pseudo-random).
Message send by the VPN client to the VPN service requesting the setup of a redirection from some IP ...
#define GNUNET_TUN_IPV6_REGEXLEN
Maximum regex string length for use with GNUNET_TUN_ipv6toregexsearch.
int GNUNET_NETWORK_test_pf(int pf)
Test if the given protocol family is supported by this system.
Message send via cadet to an exit daemon to forward UDP data to the Internet.
#define GNUNET_free(ptr)
Wrapper around free.
#define GNUNET_MESSAGE_TYPE_VPN_HELPER
Type of messages between the gnunet-vpn-helper and the daemon.
struct in6_addr v6
Address if af is AF_INET6.
#define gettext_noop(String)
struct GNUNET_MQ_Handle * GNUNET_CADET_get_mq(const struct GNUNET_CADET_Channel *channel)
Obtain the message queue for a connected peer.
static int ipv6
Option -6: IPv6 requested.
uint16_t destination_port
Destination port to use for the UDP request.