![]() |
GNUnet
0.11.x
|
tool to allow IP traffic exit from the GNUnet cadet to the Internet More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_applications.h"
#include "gnunet_dht_service.h"
#include "gnunet_cadet_service.h"
#include "gnunet_dnsparser_lib.h"
#include "gnunet_dnsstub_lib.h"
#include "gnunet_statistics_service.h"
#include "gnunet_constants.h"
#include "gnunet_signatures.h"
#include "gnunet_tun_lib.h"
#include "gnunet_regex_service.h"
#include "exit.h"
#include "block_dns.h"
Go to the source code of this file.
Data Structures | |
struct | SocketAddress |
Information about an address. More... | |
struct | LocalService |
This struct is saved into the services-hashmap to represent a service this peer is specifically offering an exit for (for a specific domain name). More... | |
struct | RedirectInformation |
Information we use to track a connection (the classical 6-tuple of IP-version, protocol, source-IP, destination-IP, source-port and destinatin-port. More... | |
struct | ChannelState |
This struct is saved into connections_map to allow finding the right channel given an IP packet from TUN. More... | |
struct | DnsResponseMessage |
Message with a DNS response. More... | |
Macros | |
#define | REGEX_MAX_PATH_LEN_IPV4 4 |
Maximum path compression length for cadet regex announcing for IPv4 address based regex. More... | |
#define | REGEX_MAX_PATH_LEN_IPV6 8 |
Maximum path compression length for cadet regex announcing for IPv6 address based regex. More... | |
#define | REGEX_REFRESH_FREQUENCY |
How frequently do we re-announce the regex for the exit? More... | |
#define | DHT_PUT_FREQUENCY |
How frequently do we re-announce the DNS exit in the DHT? More... | |
#define | DNS_ADVERTISEMENT_TIMEOUT |
How long do we typically sign the DNS exit advertisement for? More... | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "exit", __VA_ARGS__); |
Generic logging shorthand. More... | |
Functions | |
static GNUNET_NETWORK_STRUCT_END void | process_dns_result (void *cls, const struct GNUNET_TUN_DnsHeader *dns, size_t r) |
Callback called from DNSSTUB resolver when a resolution succeeded. More... | |
static int | check_dns_request (void *cls, const struct DnsResponseMessage *msg) |
Check a request via cadet to perform a DNS query. More... | |
static void | handle_dns_request (void *cls, const struct DnsResponseMessage *msg) |
Process a request via cadet to perform a DNS query. More... | |
static void | hash_redirect_info (struct GNUNET_HashCode *hash, const struct RedirectInformation *ri) |
Given IP information about a connection, calculate the respective hash we would use for the connections_map. More... | |
static struct ChannelState * | get_redirect_state (int af, int protocol, const void *destination_ip, uint16_t destination_port, const void *local_ip, uint16_t local_port, struct GNUNET_HashCode *state_key) |
Get our connection tracking state. More... | |
static int | check_tcp_service (void *cls, const struct GNUNET_EXIT_TcpServiceStartMessage *start) |
Check a request via cadet to send a request to a TCP service offered by this system. More... | |
static void | prepare_ipv4_packet (const void *payload, size_t payload_length, int protocol, const struct GNUNET_TUN_TcpHeader *tcp_header, const struct SocketAddress *src_address, const struct SocketAddress *dst_address, struct GNUNET_TUN_IPv4Header *pkt4) |
Prepare an IPv4 packet for transmission via the TUN interface. More... | |
static void | prepare_ipv6_packet (const void *payload, size_t payload_length, int protocol, const struct GNUNET_TUN_TcpHeader *tcp_header, const struct SocketAddress *src_address, const struct SocketAddress *dst_address, struct GNUNET_TUN_IPv6Header *pkt6) |
Prepare an IPv6 packet for transmission via the TUN interface. More... | |
static void | send_tcp_packet_via_tun (const struct SocketAddress *destination_address, const struct SocketAddress *source_address, const struct GNUNET_TUN_TcpHeader *tcp_header, const void *payload, size_t payload_length) |
Send a TCP packet via the TUN interface. More... | |
static void | send_icmp_packet_via_tun (const struct SocketAddress *destination_address, const struct SocketAddress *source_address, const struct GNUNET_TUN_IcmpHeader *icmp_header, const void *payload, size_t payload_length) |
Send an ICMP packet via the TUN interface. More... | |
static void | setup_fresh_address (int af, uint8_t proto, struct SocketAddress *local_address) |
We need to create a (unique) fresh local address (IP+port). More... | |
static void | setup_state_record (struct ChannelState *state) |
We are starting a fresh connection (TCP or UDP) and need to pick a source port and IP address (within the correct range and address family) to associate replies with the connection / correct cadet channel. More... | |
static void | send_udp_packet_via_tun (const struct SocketAddress *destination_address, const struct SocketAddress *source_address, const void *payload, size_t payload_length) |
Send a UDP packet via the TUN interface. More... | |
static int | check_udp_remote (void *cls, const struct GNUNET_EXIT_UdpInternetMessage *msg) |
Check a request to forward UDP data to the Internet via this peer. More... | |
static void | handle_udp_remote (void *cls, const struct GNUNET_EXIT_UdpInternetMessage *msg) |
Process a request to forward UDP data to the Internet via this peer. More... | |
static int | check_udp_service (void *cls, const struct GNUNET_EXIT_UdpServiceMessage *msg) |
Check a request via cadet to send a request to a UDP service offered by this system. More... | |
static void | handle_udp_service (void *cls, const struct GNUNET_EXIT_UdpServiceMessage *msg) |
Process a request via cadet to send a request to a UDP service offered by this system. More... | |
static void | handle_tcp_service (void *cls, const struct GNUNET_EXIT_TcpServiceStartMessage *start) |
Process a request via cadet to send a request to a TCP service offered by this system. More... | |
static int | check_tcp_remote (void *cls, const struct GNUNET_EXIT_TcpInternetStartMessage *start) |
Check a request to forward TCP data to the Internet via this peer. More... | |
static void | handle_tcp_remote (void *cls, const struct GNUNET_EXIT_TcpInternetStartMessage *start) |
Process a request to forward TCP data to the Internet via this peer. More... | |
static int | check_tcp_data (void *cls, const struct GNUNET_EXIT_TcpDataMessage *data) |
Check a request to forward TCP data on an established connection via this peer. More... | |
static void | handle_tcp_data (void *cls, const struct GNUNET_EXIT_TcpDataMessage *data) |
Process a request to forward TCP data on an established connection via this peer. More... | |
static void | make_up_icmpv4_payload (struct ChannelState *state, struct GNUNET_TUN_IPv4Header *ipp, struct GNUNET_TUN_UdpHeader *udp) |
Synthesize a plausible ICMP payload for an ICMPv4 error response on the given channel. More... | |
static void | make_up_icmpv6_payload (struct ChannelState *state, struct GNUNET_TUN_IPv6Header *ipp, struct GNUNET_TUN_UdpHeader *udp) |
Synthesize a plausible ICMP payload for an ICMPv6 error response on the given channel. More... | |
static int | check_icmp_remote (void *cls, const struct GNUNET_EXIT_IcmpInternetMessage *msg) |
Check a request to forward ICMP data to the Internet via this peer. More... | |
static void | handle_icmp_remote (void *cls, const struct GNUNET_EXIT_IcmpInternetMessage *msg) |
Process a request to forward ICMP data to the Internet via this peer. More... | |
static uint16_t | make_up_icmp_service_payload (struct ChannelState *state, char *buf) |
Setup ICMP payload for ICMP error messages. More... | |
static int | check_icmp_service (void *cls, const struct GNUNET_EXIT_IcmpServiceMessage *msg) |
Check a request via cadet to send ICMP data to a service offered by this system. More... | |
static void | handle_icmp_service (void *cls, const struct GNUNET_EXIT_IcmpServiceMessage *msg) |
Process a request via cadet to send ICMP data to a service offered by this system. More... | |
static int | free_service_record (void *cls, const struct GNUNET_HashCode *key, void *value) |
Free memory associated with a service record. More... | |
static void * | new_service_channel (void *cls, struct GNUNET_CADET_Channel *channel, const struct GNUNET_PeerIdentity *initiator) |
Callback from CADET for new channels. More... | |
static void | clean_channel (void *cls, const struct GNUNET_CADET_Channel *channel) |
Function called by cadet whenever an inbound channel is destroyed. More... | |
static void | store_service (int proto, const char *name, uint16_t destination_port, struct LocalService *service) |
Given a service descriptor and a destination port, find the respective service entry. More... | |
static void | send_packet_to_cadet_channel (struct ChannelState *s, struct GNUNET_MQ_Envelope *env) |
Send the given packet via the cadet channel. More... | |
static void | icmp_from_helper (const struct GNUNET_TUN_IcmpHeader *icmp, size_t pktlen, int af, const void *destination_ip, const void *source_ip) |
Handles an ICMP packet received from the helper. More... | |
static void | udp_from_helper (const struct GNUNET_TUN_UdpHeader *udp, size_t pktlen, int af, const void *destination_ip, const void *source_ip) |
Handles an UDP packet received from the helper. More... | |
static void | tcp_from_helper (const struct GNUNET_TUN_TcpHeader *tcp, size_t pktlen, int af, const void *destination_ip, const void *source_ip) |
Handles a TCP packet received from the helper. More... | |
static int | message_token (void *cls, const struct GNUNET_MessageHeader *message) |
Receive packets from the helper-process. More... | |
static void * | new_channel (void *cls, struct GNUNET_CADET_Channel *channel, const struct GNUNET_PeerIdentity *initiator) |
Callback from CADET for new channels. More... | |
static int | free_iterate (void *cls, const struct GNUNET_HashCode *hash, void *value) |
Function that frees everything from a hashmap. More... | |
static void | dummy_task (void *cls) |
Function scheduled as very last function if the service disabled itself because the helper is not installed properly. More... | |
static void | cleanup (void *cls) |
Function scheduled as very last function, cleans up after us. More... | |
static void | add_services (int proto, char *cpy, const char *name) |
Add services to the service map. More... | |
static void | read_service_conf (void *cls, const char *section) |
Reads the configuration and populates #udp_services and #tcp_services. More... | |
static void | do_dht_put (void *cls) |
We are running a DNS exit service, advertise it in the DHT. More... | |
static void | dht_put_cont (void *cls) |
Function called when the DHT PUT operation is complete. More... | |
static void | parse_ip_options () |
Figure out which IP versions we should support (and which are supported by the OS) according to our configuration. More... | |
static void | advertise_dns_exit () |
Helper function to open the CADET port for DNS exits and to advertise the DNS exit (if applicable). More... | |
static int | setup_exit_helper_args () |
Initialize exit_argv. More... | |
static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg_) |
Main function that will be run by the scheduler. More... | |
int | main (int argc, char *const *argv) |
The main function. More... | |
Variables | |
static int | global_ret |
Return value from 'main'. More... | |
static struct GNUNET_REGEX_Announcement * | regex4 |
Handle to our regex announcement for IPv4. More... | |
static struct GNUNET_REGEX_Announcement * | regex6 |
Handle to our regex announcement for IPv4. More... | |
static const struct GNUNET_CONFIGURATION_Handle * | cfg |
The handle to the configuration used throughout the process. More... | |
static struct GNUNET_HELPER_Handle * | helper_handle |
The handle to the helper. More... | |
static char * | exit_argv [8] |
Arguments to the exit helper. More... | |
static struct in6_addr | exit_ipv6addr |
IPv6 address of our TUN interface. More... | |
static unsigned long long | ipv6prefix |
IPv6 prefix (0..127) from configuration file. More... | |
static struct in_addr | exit_ipv4addr |
IPv4 address of our TUN interface. More... | |
static struct in_addr | exit_ipv4mask |
IPv4 netmask of our TUN interface. More... | |
static struct GNUNET_STATISTICS_Handle * | stats |
Statistics. More... | |
static struct GNUNET_CADET_Handle * | cadet_handle |
The handle to cadet. More... | |
static struct GNUNET_CONTAINER_MultiHashMap * | connections_map |
This hashmaps contains the mapping from peer, service-descriptor, source-port and destination-port to a struct ChannelState. More... | |
static struct GNUNET_CONTAINER_Heap * | connections_heap |
Heap so we can quickly find "old" connections. More... | |
static unsigned long long | max_connections |
If there are at least this many connections, old ones will be removed. More... | |
static struct GNUNET_CONTAINER_MultiHashMap * | services |
This hashmaps saves interesting things about the configured services. More... | |
static struct ChannelState * | channels [UINT16_MAX+1] |
Array of all open DNS requests from channels. More... | |
static struct GNUNET_DNSSTUB_Context * | dnsstub |
Handle to the DNS Stub resolver. More... | |
static struct GNUNET_DHT_PutHandle * | dht_put |
Handle for ongoing DHT PUT operations to advertise exit service. More... | |
static struct GNUNET_DHT_Handle * | dht |
Handle to the DHT. More... | |
static struct GNUNET_SCHEDULER_Task * | dht_task |
Task for doing DHT PUTs to advertise exit service. More... | |
static struct GNUNET_DNS_Advertisement | dns_advertisement |
Advertisement message we put into the DHT to advertise us as a DNS exit. More... | |
static struct GNUNET_HashCode | dht_put_key |
Key we store the DNS advertismenet under. More... | |
static struct GNUNET_CRYPTO_EddsaPrivateKey * | peer_key |
Private key for this peer. More... | |
static struct GNUNET_CADET_Port * | dns_port |
Port for DNS exit. More... | |
static struct GNUNET_CADET_Port * | cadet_port4 |
Port for IPv4 exit. More... | |
static struct GNUNET_CADET_Port * | cadet_port6 |
Port for IPv6 exit. More... | |
static int | ipv4_exit |
Are we an IPv4-exit? More... | |
static int | ipv6_exit |
Are we an IPv6-exit? More... | |
static int | ipv4_enabled |
Do we support IPv4 at all on the TUN interface? More... | |
static int | ipv6_enabled |
Do we support IPv6 at all on the TUN interface? More... | |
tool to allow IP traffic exit from the GNUnet cadet to the Internet
TODO:
Design:
Definition in file gnunet-daemon-exit.c.
#define REGEX_MAX_PATH_LEN_IPV4 4 |
Maximum path compression length for cadet regex announcing for IPv4 address based regex.
Definition at line 58 of file gnunet-daemon-exit.c.
Referenced by run().
#define REGEX_MAX_PATH_LEN_IPV6 8 |
Maximum path compression length for cadet regex announcing for IPv6 address based regex.
Definition at line 64 of file gnunet-daemon-exit.c.
Referenced by run().
#define REGEX_REFRESH_FREQUENCY |
How frequently do we re-announce the regex for the exit?
Definition at line 69 of file gnunet-daemon-exit.c.
Referenced by run().
#define DHT_PUT_FREQUENCY |
How frequently do we re-announce the DNS exit in the DHT?
Definition at line 75 of file gnunet-daemon-exit.c.
Referenced by do_dht_put().
#define DNS_ADVERTISEMENT_TIMEOUT |
How long do we typically sign the DNS exit advertisement for?
Definition at line 81 of file gnunet-daemon-exit.c.
Referenced by do_dht_put().
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "exit", __VA_ARGS__); |
Generic logging shorthand.
Definition at line 88 of file gnunet-daemon-exit.c.
Referenced by clean_channel(), handle_udp_service(), and process_dns_result().
|
static |
Callback called from DNSSTUB resolver when a resolution succeeded.
cls | NULL |
dns | the response itself |
r | number of bytes in dns |
Definition at line 459 of file gnunet-daemon-exit.c.
References ChannelState::channel, DnsResponseMessage::dns, ChannelState::dns, env, GNUNET_assert, GNUNET_CADET_get_mq(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_VPN_DNS_FROM_INTERNET, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_TUN_DnsHeader::id, LOG, and ChannelState::specifics.
Referenced by handle_dns_request().
|
static |
Check a request via cadet to perform a DNS query.
cls | our struct ChannelState * |
msg | the actual message |
Definition at line 500 of file gnunet-daemon-exit.c.
References GNUNET_break, GNUNET_break_op, GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, and ChannelState::is_dns.
|
static |
Process a request via cadet to perform a DNS query.
cls | our struct ChannelState * |
msg | the actual message |
Definition at line 526 of file gnunet-daemon-exit.c.
References buf, ChannelState::channel, DnsResponseMessage::dns, ChannelState::dns, GNUNET_ALIGN, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_u32(), GNUNET_DNSSTUB_resolve(), GNUNET_memcpy, GNUNET_SYSERR, GNUNET_YES, DnsResponseMessage::header, GNUNET_TUN_DnsHeader::id, ChannelState::is_dns, process_dns_result(), GNUNET_MessageHeader::size, and ChannelState::specifics.
|
static |
Given IP information about a connection, calculate the respective hash we would use for the connections_map.
hash | resulting hash |
ri | information about the connection |
Definition at line 575 of file gnunet-daemon-exit.c.
References SocketAddress::address, SocketAddress::af, GNUNET_assert, GNUNET_memcpy, SocketAddress::ipv4, SocketAddress::ipv6, RedirectInformation::local_address, SocketAddress::port, SocketAddress::proto, and RedirectInformation::remote_address.
Referenced by get_redirect_state().
|
static |
Get our connection tracking state.
Warns if it does not exists, refreshes the timestamp if it does exist.
af | address family |
protocol | IPPROTO_UDP or IPPROTO_TCP |
destination_ip | target IP |
destination_port | target port |
local_ip | local IP |
local_port | local port |
state_key | set to hash's state if non-NULL |
Definition at line 653 of file gnunet-daemon-exit.c.
References SocketAddress::address, SocketAddress::af, GNUNET_CONTAINER_heap_update_cost(), GNUNET_CONTAINER_multihashmap_get(), GNUNET_TIME_absolute_get(), hash_redirect_info(), SocketAddress::ipv4, SocketAddress::ipv6, key, RedirectInformation::local_address, SocketAddress::port, SocketAddress::proto, RedirectInformation::remote_address, ChannelState::specifics, state, and ChannelState::tcp_udp.
Referenced by icmp_from_helper(), setup_state_record(), tcp_from_helper(), and udp_from_helper().
|
static |
Check a request via cadet to send a request to a TCP service offered by this system.
cls | our struct ChannelState * |
start | the actual message |
Definition at line 712 of file gnunet-daemon-exit.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, ChannelState::is_dns, GNUNET_TUN_TcpHeader::off, ChannelState::specifics, state, GNUNET_EXIT_TcpServiceStartMessage::tcp_header, and ChannelState::tcp_udp.
|
static |
Prepare an IPv4 packet for transmission via the TUN interface.
Initializes the IP header and calculates checksums (IP+UDP/TCP). For UDP, the UDP header will be fully created, whereas for TCP only the ports and checksum will be filled in. So for TCP, a skeleton TCP header must be part of the provided payload.
payload | payload of the packet (starting with UDP payload or TCP header, depending on protocol) |
payload_length | number of bytes in payload |
protocol | IPPROTO_UDP or IPPROTO_TCP |
tcp_header | skeleton of the TCP header, NULL for UDP |
src_address | source address to use (IP and port) |
dst_address | destination address to use (IP and port) |
pkt4 | where to write the assembled packet; must contain enough space for the IP header, UDP/TCP header AND the payload |
Definition at line 765 of file gnunet-daemon-exit.c.
References SocketAddress::address, GNUNET_TUN_TcpHeader::destination_port, GNUNET_TUN_UdpHeader::destination_port, GNUNET_assert, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_memcpy, GNUNET_TUN_calculate_tcp4_checksum(), GNUNET_TUN_calculate_udp4_checksum(), GNUNET_TUN_initialize_ipv4_header(), SocketAddress::ipv4, len, GNUNET_TUN_UdpHeader::len, SocketAddress::port, GNUNET_TUN_TcpHeader::source_port, and GNUNET_TUN_UdpHeader::source_port.
Referenced by send_tcp_packet_via_tun(), and send_udp_packet_via_tun().
|
static |
Prepare an IPv6 packet for transmission via the TUN interface.
Initializes the IP header and calculates checksums (IP+UDP/TCP). For UDP, the UDP header will be fully created, whereas for TCP only the ports and checksum will be filled in. So for TCP, a skeleton TCP header must be part of the provided payload.
payload | payload of the packet (starting with UDP payload or TCP header, depending on protocol) |
payload_length | number of bytes in payload |
protocol | IPPROTO_UDP or IPPROTO_TCP |
tcp_header | skeleton TCP header data to send, NULL for UDP |
src_address | source address to use (IP and port) |
dst_address | destination address to use (IP and port) |
pkt6 | where to write the assembled packet; must contain enough space for the IP header, UDP/TCP header AND the payload |
Definition at line 869 of file gnunet-daemon-exit.c.
References SocketAddress::address, GNUNET_TUN_TcpHeader::destination_port, GNUNET_TUN_UdpHeader::destination_port, GNUNET_assert, GNUNET_break, GNUNET_memcpy, GNUNET_TUN_calculate_tcp6_checksum(), GNUNET_TUN_calculate_udp6_checksum(), GNUNET_TUN_initialize_ipv6_header(), SocketAddress::ipv6, len, GNUNET_TUN_UdpHeader::len, SocketAddress::port, GNUNET_TUN_TcpHeader::source_port, and GNUNET_TUN_UdpHeader::source_port.
Referenced by send_tcp_packet_via_tun(), and send_udp_packet_via_tun().
|
static |
Send a TCP packet via the TUN interface.
destination_address | IP and port to use for the TCP packet's destination |
source_address | IP and port to use for the TCP packet's source |
tcp_header | header template to use |
payload | payload of the TCP packet |
payload_length | number of bytes in payload |
Definition at line 962 of file gnunet-daemon-exit.c.
References SocketAddress::af, buf, ETH_P_IPV4, ETH_P_IPV6, GNUNET_TUN_Layer2PacketHeader::flags, gettext_noop, GNUNET_ALIGN, GNUNET_assert, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_HELPER_send(), GNUNET_log, GNUNET_MAX_MESSAGE_SIZE, GNUNET_MESSAGE_TYPE_VPN_HELPER, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_YES, SocketAddress::ipv4, SocketAddress::ipv6, len, prepare_ipv4_packet(), prepare_ipv6_packet(), GNUNET_TUN_Layer2PacketHeader::proto, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by handle_tcp_data(), handle_tcp_remote(), and handle_tcp_service().
|
static |
Send an ICMP packet via the TUN interface.
destination_address | IP to use for the ICMP packet's destination |
source_address | IP to use for the ICMP packet's source |
icmp_header | ICMP header to send |
payload | payload of the ICMP packet (does NOT include ICMP header) |
payload_length | number of bytes of data in payload |
Definition at line 1068 of file gnunet-daemon-exit.c.
References SocketAddress::address, SocketAddress::af, buf, ETH_P_IPV4, ETH_P_IPV6, GNUNET_TUN_Layer2PacketHeader::flags, gettext_noop, GNUNET_ALIGN, GNUNET_assert, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_HELPER_send(), GNUNET_log, GNUNET_MAX_MESSAGE_SIZE, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_VPN_HELPER, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_TUN_calculate_icmp_checksum(), GNUNET_TUN_initialize_ipv4_header(), GNUNET_TUN_initialize_ipv6_header(), GNUNET_YES, SocketAddress::ipv4, SocketAddress::ipv6, len, GNUNET_TUN_Layer2PacketHeader::proto, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by handle_icmp_remote(), and handle_icmp_service().
|
static |
We need to create a (unique) fresh local address (IP+port).
Fill one in.
af | desired address family |
proto | desired protocol (IPPROTO_UDP or IPPROTO_TCP) |
local_address | address to initialize |
Definition at line 1180 of file gnunet-daemon-exit.c.
References SocketAddress::address, SocketAddress::af, exit_ipv4addr, exit_ipv4mask, exit_ipv6addr, GNUNET_assert, GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_u32(), GNUNET_memcmp, SocketAddress::ipv4, SocketAddress::ipv6, ipv6prefix, SocketAddress::port, and SocketAddress::proto.
Referenced by setup_state_record().
|
static |
We are starting a fresh connection (TCP or UDP) and need to pick a source port and IP address (within the correct range and address family) to associate replies with the connection / correct cadet channel.
This function generates a "fresh" source IP and source port number for a connection After picking a good source address, this function sets up the state in the 'connections_map' and 'connections_heap' to allow finding the state when needed later. The function also makes sure that we remain within memory limits by cleaning up 'old' states.
state | skeleton state to setup a record for; should 'state->specifics.tcp_udp.ri.remote_address' filled in so that this code can determine which AF/protocol is going to be used (the 'channel' should also already be set); after calling this function, heap_node and the local_address will be also initialized (heap_node != NULL can be used to test if a state has been fully setup). |
Definition at line 1295 of file gnunet-daemon-exit.c.
References buf, ChannelState::channel, get_redirect_state(), GNUNET_assert, GNUNET_CADET_channel_destroy(), GNUNET_CONTAINER_heap_get_size(), GNUNET_CONTAINER_heap_insert(), GNUNET_CONTAINER_heap_remove_root(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_OK, GNUNET_TIME_absolute_get(), key, max_connections, setup_fresh_address(), ChannelState::specifics, ChannelState::state_key, and ChannelState::tcp_udp.
Referenced by handle_icmp_remote(), handle_icmp_service(), handle_tcp_remote(), handle_tcp_service(), handle_udp_remote(), and handle_udp_service().
|
static |
Send a UDP packet via the TUN interface.
destination_address | IP and port to use for the UDP packet's destination |
source_address | IP and port to use for the UDP packet's source |
payload | payload of the UDP packet (does NOT include UDP header) |
payload_length | number of bytes of data in payload |
Definition at line 1364 of file gnunet-daemon-exit.c.
References SocketAddress::af, buf, ETH_P_IPV4, ETH_P_IPV6, GNUNET_TUN_Layer2PacketHeader::flags, gettext_noop, GNUNET_ALIGN, GNUNET_assert, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_HELPER_send(), GNUNET_log, GNUNET_MAX_MESSAGE_SIZE, GNUNET_MESSAGE_TYPE_VPN_HELPER, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_YES, SocketAddress::ipv4, SocketAddress::ipv6, len, prepare_ipv4_packet(), prepare_ipv6_packet(), GNUNET_TUN_Layer2PacketHeader::proto, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by handle_udp_remote(), and handle_udp_service().
|
static |
Check a request to forward UDP data to the Internet via this peer.
cls | our struct ChannelState * |
msg | the actual message |
Definition at line 1465 of file gnunet-daemon-exit.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, ChannelState::is_dns, and state.
|
static |
Process a request to forward UDP data to the Internet via this peer.
cls | our struct ChannelState * |
msg | the actual message |
Definition at line 1486 of file gnunet-daemon-exit.c.
References SocketAddress::af, GNUNET_EXIT_UdpInternetMessage::af, buf, ChannelState::channel, GNUNET_EXIT_UdpInternetMessage::destination_port, gettext_noop, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_SYSERR, GNUNET_EXIT_UdpInternetMessage::header, ipv4_exit, ipv6_exit, ChannelState::is_dns, payload, ChannelState::peer, send_udp_packet_via_tun(), setup_state_record(), GNUNET_MessageHeader::size, GNUNET_EXIT_UdpInternetMessage::source_port, ChannelState::specifics, state, and ChannelState::tcp_udp.
|
static |
Check a request via cadet to send a request to a UDP service offered by this system.
cls | our struct ChannelState * |
msg | the actual message |
Definition at line 1585 of file gnunet-daemon-exit.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, ChannelState::specifics, state, and ChannelState::tcp_udp.
|
static |
Process a request via cadet to send a request to a UDP service offered by this system.
cls | our struct ChannelState * |
msg | the actual message |
Definition at line 1607 of file gnunet-daemon-exit.c.
References ChannelState::channel, GNUNET_EXIT_UdpServiceMessage::destination_port, gettext_noop, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_i2s(), GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_EXIT_UdpServiceMessage::header, LOG, ChannelState::peer, send_udp_packet_via_tun(), setup_state_record(), GNUNET_MessageHeader::size, GNUNET_EXIT_UdpServiceMessage::source_port, ChannelState::specifics, state, and ChannelState::tcp_udp.
|
static |
Process a request via cadet to send a request to a TCP service offered by this system.
cls | our struct ChannelState * |
start | the actual message |
Definition at line 1647 of file gnunet-daemon-exit.c.
References ChannelState::channel, GNUNET_TUN_TcpHeader::destination_port, gettext_noop, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_SYSERR, GNUNET_EXIT_TcpServiceStartMessage::header, ChannelState::is_dns, ChannelState::peer, GNUNET_EXIT_TcpServiceStartMessage::reserved, send_tcp_packet_via_tun(), setup_state_record(), GNUNET_MessageHeader::size, ChannelState::specifics, state, GNUNET_EXIT_TcpServiceStartMessage::tcp_header, and ChannelState::tcp_udp.
|
static |
Check a request to forward TCP data to the Internet via this peer.
cls | our struct ChannelState * |
start | the actual message |
Definition at line 1694 of file gnunet-daemon-exit.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, ChannelState::is_dns, GNUNET_TUN_TcpHeader::off, ChannelState::specifics, state, GNUNET_EXIT_TcpInternetStartMessage::tcp_header, and ChannelState::tcp_udp.
|
static |
Process a request to forward TCP data to the Internet via this peer.
cls | our struct ChannelState * |
start | the actual message |
Definition at line 1731 of file gnunet-daemon-exit.c.
References GNUNET_EXIT_TcpInternetStartMessage::af, SocketAddress::af, buf, ChannelState::channel, GNUNET_TUN_TcpHeader::destination_port, gettext_noop, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_SYSERR, GNUNET_EXIT_TcpInternetStartMessage::header, ipv4_exit, ipv6_exit, ChannelState::is_dns, payload, ChannelState::peer, send_tcp_packet_via_tun(), setup_state_record(), GNUNET_MessageHeader::size, ChannelState::specifics, state, GNUNET_EXIT_TcpInternetStartMessage::tcp_header, and ChannelState::tcp_udp.
|
static |
Check a request to forward TCP data on an established connection via this peer.
cls | our struct ChannelState * |
message | the actual message |
Definition at line 1829 of file gnunet-daemon-exit.c.
References gettext_noop, GNUNET_break_op, GNUNET_NO, GNUNET_OK, GNUNET_STATISTICS_update(), GNUNET_SYSERR, GNUNET_YES, ChannelState::is_dns, GNUNET_TUN_TcpHeader::off, ChannelState::specifics, state, GNUNET_EXIT_TcpDataMessage::tcp_header, and ChannelState::tcp_udp.
|
static |
Process a request to forward TCP data on an established connection via this peer.
cls | our struct ChannelState * |
message | the actual message |
Definition at line 1867 of file gnunet-daemon-exit.c.
References buf, ChannelState::channel, gettext_noop, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_SYSERR, GNUNET_EXIT_TcpDataMessage::header, ChannelState::is_dns, ChannelState::peer, GNUNET_EXIT_TcpDataMessage::reserved, send_tcp_packet_via_tun(), GNUNET_MessageHeader::size, ChannelState::specifics, state, GNUNET_EXIT_TcpDataMessage::tcp_header, and ChannelState::tcp_udp.
|
static |
Synthesize a plausible ICMP payload for an ICMPv4 error response on the given channel.
state | channel information |
ipp | IPv6 header to fill in (ICMP payload) |
udp | "UDP" header to fill in (ICMP payload); might actually also be the first 8 bytes of the TCP header |
Definition at line 1918 of file gnunet-daemon-exit.c.
References SocketAddress::address, GNUNET_TUN_UdpHeader::crc, GNUNET_TUN_UdpHeader::destination_port, GNUNET_TUN_initialize_ipv4_header(), GNUNET_TUN_UdpHeader::len, SocketAddress::proto, GNUNET_TUN_UdpHeader::source_port, ChannelState::specifics, and ChannelState::tcp_udp.
Referenced by handle_icmp_remote(), and make_up_icmp_service_payload().
|
static |
Synthesize a plausible ICMP payload for an ICMPv6 error response on the given channel.
state | channel information |
ipp | IPv6 header to fill in (ICMP payload) |
udp | "UDP" header to fill in (ICMP payload); might actually also be the first 8 bytes of the TCP header |
Definition at line 1948 of file gnunet-daemon-exit.c.
References SocketAddress::address, GNUNET_TUN_UdpHeader::crc, GNUNET_TUN_UdpHeader::destination_port, GNUNET_TUN_initialize_ipv6_header(), GNUNET_TUN_UdpHeader::len, SocketAddress::proto, GNUNET_TUN_UdpHeader::source_port, ChannelState::specifics, and ChannelState::tcp_udp.
Referenced by handle_icmp_remote(), and make_up_icmp_service_payload().
|
static |
Check a request to forward ICMP data to the Internet via this peer.
cls | our struct ChannelState * |
msg | the actual message |
Definition at line 1977 of file gnunet-daemon-exit.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, ChannelState::is_dns, and state.
|
static |
Process a request to forward ICMP data to the Internet via this peer.
cls | our struct ChannelState * |
msg | the actual message |
Definition at line 1998 of file gnunet-daemon-exit.c.
References SocketAddress::af, GNUNET_EXIT_IcmpInternetMessage::af, buf, ChannelState::channel, gettext_noop, GNUNET_assert, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_SYSERR, GNUNET_TUN_ICMPTYPE6_DESTINATION_UNREACHABLE, GNUNET_TUN_ICMPTYPE6_ECHO_REPLY, GNUNET_TUN_ICMPTYPE6_ECHO_REQUEST, GNUNET_TUN_ICMPTYPE6_PACKET_TOO_BIG, GNUNET_TUN_ICMPTYPE6_PARAMETER_PROBLEM, GNUNET_TUN_ICMPTYPE6_TIME_EXCEEDED, GNUNET_TUN_ICMPTYPE_DESTINATION_UNREACHABLE, GNUNET_TUN_ICMPTYPE_ECHO_REPLY, GNUNET_TUN_ICMPTYPE_ECHO_REQUEST, GNUNET_TUN_ICMPTYPE_SOURCE_QUENCH, GNUNET_TUN_ICMPTYPE_TIME_EXCEEDED, GNUNET_EXIT_IcmpInternetMessage::header, GNUNET_EXIT_IcmpInternetMessage::icmp_header, ipv4_exit, ipv6_exit, ChannelState::is_dns, make_up_icmpv4_payload(), make_up_icmpv6_payload(), payload, ChannelState::peer, send_icmp_packet_via_tun(), setup_state_record(), GNUNET_MessageHeader::size, ChannelState::specifics, state, ChannelState::tcp_udp, GNUNET_TUN_IcmpHeader::type, and udp.
|
static |
Setup ICMP payload for ICMP error messages.
Called for both IPv4 and IPv6 addresses.
state | context for creating the IP Packet |
buf | where to create the payload, has at least sizeof (struct GNUNET_TUN_IPv6Header) + 8 bytes |
Definition at line 2196 of file gnunet-daemon-exit.c.
References GNUNET_assert, GNUNET_break, SocketAddress::ipv4, SocketAddress::ipv6, make_up_icmpv4_payload(), make_up_icmpv6_payload(), ChannelState::specifics, ChannelState::tcp_udp, and udp.
Referenced by handle_icmp_service().
|
static |
Check a request via cadet to send ICMP data to a service offered by this system.
cls | our struct ChannelState * |
msg | the actual message |
Definition at line 2248 of file gnunet-daemon-exit.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, ChannelState::is_dns, ChannelState::specifics, state, and ChannelState::tcp_udp.
|
static |
Process a request via cadet to send ICMP data to a service offered by this system.
cls | our struct ChannelState * |
msg | the actual message |
Definition at line 2275 of file gnunet-daemon-exit.c.
References GNUNET_EXIT_IcmpServiceMessage::af, buf, ChannelState::channel, gettext_noop, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_TUN_ICMPTYPE6_DESTINATION_UNREACHABLE, GNUNET_TUN_ICMPTYPE6_ECHO_REPLY, GNUNET_TUN_ICMPTYPE6_ECHO_REQUEST, GNUNET_TUN_ICMPTYPE6_PACKET_TOO_BIG, GNUNET_TUN_ICMPTYPE6_PARAMETER_PROBLEM, GNUNET_TUN_ICMPTYPE6_TIME_EXCEEDED, GNUNET_TUN_ICMPTYPE_DESTINATION_UNREACHABLE, GNUNET_TUN_ICMPTYPE_ECHO_REPLY, GNUNET_TUN_ICMPTYPE_ECHO_REQUEST, GNUNET_TUN_ICMPTYPE_SOURCE_QUENCH, GNUNET_TUN_ICMPTYPE_TIME_EXCEEDED, GNUNET_EXIT_IcmpServiceMessage::header, GNUNET_EXIT_IcmpServiceMessage::icmp_header, make_up_icmp_service_payload(), payload, ChannelState::peer, send_icmp_packet_via_tun(), setup_state_record(), GNUNET_MessageHeader::size, ChannelState::specifics, state, ChannelState::tcp_udp, and GNUNET_TUN_IcmpHeader::type.
|
static |
Free memory associated with a service record.
cls | unused |
key | service descriptor |
value | service record to free |
Definition at line 2463 of file gnunet-daemon-exit.c.
References GNUNET_assert, GNUNET_CADET_close_port(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_free, GNUNET_OK, GNUNET_YES, LocalService::name, LocalService::port, service, and value.
Referenced by cleanup().
|
static |
Callback from CADET for new channels.
cls | closure |
channel | new handle to the channel |
initiator | peer that started the channel |
Definition at line 2489 of file gnunet-daemon-exit.c.
References LocalService::address, ChannelState::channel, gettext_noop, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_new, GNUNET_NO, GNUNET_STATISTICS_update(), ls, ChannelState::peer, ChannelState::specifics, and ChannelState::tcp_udp.
Referenced by store_service().
|
static |
Function called by cadet whenever an inbound channel is destroyed.
Should clean up any associated state.
cls | our struct ChannelState * |
channel | connection to the other end (henceforth invalid) |
Definition at line 2519 of file gnunet-daemon-exit.c.
References ChannelState::dns, GNUNET_assert, GNUNET_CONTAINER_heap_remove_node(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_SYSERR, GNUNET_YES, ChannelState::is_dns, LOG, ChannelState::specifics, and ChannelState::tcp_udp.
Referenced by advertise_dns_exit(), run(), and store_service().
|
static |
Given a service descriptor and a destination port, find the respective service entry.
proto | IPPROTO_TCP or IPPROTO_UDP |
name | name of the service |
destination_port | destination port |
service | service information record to store (service->name will be set). |
Definition at line 2563 of file gnunet-daemon-exit.c.
References _, clean_channel(), LocalService::descriptor, GNUNET_CADET_close_port(), GNUNET_CADET_open_port(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_h2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_SERVICE, GNUNET_MESSAGE_TYPE_VPN_TCP_DATA_TO_EXIT, GNUNET_MESSAGE_TYPE_VPN_TCP_TO_SERVICE_START, GNUNET_MESSAGE_TYPE_VPN_UDP_TO_SERVICE, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_OK, GNUNET_strdup, GNUNET_TUN_compute_service_cadet_port(), GNUNET_TUN_service_name_to_hash(), LocalService::is_udp, LocalService::name, new_service_channel(), LocalService::port, and SocketAddress::proto.
Referenced by add_services().
|
static |
Send the given packet via the cadet channel.
s | channel destination |
env | message to queue |
Definition at line 2633 of file gnunet-daemon-exit.c.
References ChannelState::channel, gettext_noop, GNUNET_assert, GNUNET_CADET_get_mq(), GNUNET_MQ_send(), GNUNET_NO, and GNUNET_STATISTICS_update().
Referenced by icmp_from_helper(), tcp_from_helper(), and udp_from_helper().
|
static |
Handles an ICMP packet received from the helper.
icmp | A pointer to the Packet |
pktlen | number of bytes in icmp |
af | address family (AFINET or AF_INET6) |
destination_ip | destination IP-address of the IP packet (should be our local address) |
source_ip | original source IP-address of the IP packet (should be the original destination address) |
Definition at line 2659 of file gnunet-daemon-exit.c.
References _, GNUNET_EXIT_IcmpToVPNMessage::af, GNUNET_TUN_UdpHeader::destination_port, env, get_redirect_state(), gettext_noop, GNUNET_assert, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_VPN, GNUNET_MQ_msg_extra, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_TUN_ICMPTYPE6_DESTINATION_UNREACHABLE, GNUNET_TUN_ICMPTYPE6_ECHO_REPLY, GNUNET_TUN_ICMPTYPE6_ECHO_REQUEST, GNUNET_TUN_ICMPTYPE6_PACKET_TOO_BIG, GNUNET_TUN_ICMPTYPE6_PARAMETER_PROBLEM, GNUNET_TUN_ICMPTYPE6_TIME_EXCEEDED, GNUNET_TUN_ICMPTYPE_DESTINATION_UNREACHABLE, GNUNET_TUN_ICMPTYPE_ECHO_REPLY, GNUNET_TUN_ICMPTYPE_ECHO_REQUEST, GNUNET_TUN_ICMPTYPE_SOURCE_QUENCH, GNUNET_TUN_ICMPTYPE_TIME_EXCEEDED, GNUNET_EXIT_IcmpToVPNMessage::icmp_header, SocketAddress::ipv4, SocketAddress::ipv6, GNUNET_TUN_IPv6Header::next_header, GNUNET_TUN_IPv4Header::protocol, send_packet_to_cadet_channel(), GNUNET_TUN_UdpHeader::source_port, state, GNUNET_TUN_IcmpHeader::type, and udp.
Referenced by message_token().
|
static |
Handles an UDP packet received from the helper.
udp | A pointer to the Packet |
pktlen | number of bytes in 'udp' |
af | address family (AFINET or AF_INET6) |
destination_ip | destination IP-address of the IP packet (should be our local address) |
source_ip | original source IP-address of the IP packet (should be the original destination address) |
Definition at line 2867 of file gnunet-daemon-exit.c.
References _, GNUNET_EXIT_UdpReplyMessage::destination_port, GNUNET_TUN_UdpHeader::destination_port, env, get_redirect_state(), GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_VPN_UDP_REPLY, GNUNET_MQ_msg_extra, GNUNET_TUN_UdpHeader::len, send_packet_to_cadet_channel(), GNUNET_EXIT_UdpReplyMessage::source_port, GNUNET_TUN_UdpHeader::source_port, and state.
Referenced by message_token().
|
static |
Handles a TCP packet received from the helper.
tcp | A pointer to the Packet |
pktlen | the length of the packet, including its TCP header |
af | address family (AFINET or AF_INET6) |
destination_ip | destination IP-address of the IP packet (should be our local address) |
source_ip | original source IP-address of the IP packet (should be the original destination address) |
Definition at line 2944 of file gnunet-daemon-exit.c.
References _, buf, GNUNET_TUN_TcpHeader::crc, GNUNET_TUN_TcpHeader::destination_port, env, get_redirect_state(), GNUNET_ALIGN, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_MAX_MESSAGE_SIZE, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_VPN_TCP_DATA_TO_VPN, GNUNET_MQ_msg_extra, GNUNET_EXIT_TcpDataMessage::reserved, send_packet_to_cadet_channel(), GNUNET_TUN_TcpHeader::source_port, state, and GNUNET_EXIT_TcpDataMessage::tcp_header.
Referenced by message_token().
|
static |
Receive packets from the helper-process.
cls | unused |
message | message received from helper |
Definition at line 3028 of file gnunet-daemon-exit.c.
References _, ETH_P_IPV4, ETH_P_IPV6, gettext_noop, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_MESSAGE_TYPE_VPN_HELPER, GNUNET_NO, GNUNET_OK, GNUNET_STATISTICS_update(), GNUNET_TUN_IPv4Header::header_length, icmp_from_helper(), GNUNET_TUN_IPv6Header::next_header, GNUNET_TUN_IPv6Header::payload_length, GNUNET_TUN_Layer2PacketHeader::proto, GNUNET_TUN_IPv4Header::protocol, size, GNUNET_MessageHeader::size, tcp_from_helper(), GNUNET_TUN_IPv4Header::total_length, GNUNET_MessageHeader::type, and udp_from_helper().
Referenced by run().