Transport plugin using UDP. More...
#include "platform.h"#include "gnunet_common.h"#include "gnunet_util_lib.h"#include "gnunet_protocols.h"#include "gnunet_signatures.h"#include "gnunet_constants.h"#include "gnunet_pils_service.h"#include "gnunet_nat_service.h"#include "gnunet_statistics_service.h"#include "gnunet_transport_application_service.h"#include "gnunet_transport_communication_service.h"Go to the source code of this file.
Data Structures | |
| struct | UdpHandshakeSignature |
| Signature we use to verify that the ephemeral key was really chosen by the specified sender. More... | |
| struct | InitialKX |
| "Plaintext" header at beginning of KX message. More... | |
| struct | UDPConfirmation |
| Encrypted continuation of UDP initial handshake, followed by message header with payload. More... | |
| struct | UDPAck |
| UDP key acknowledgement. More... | |
| struct | UdpBroadcastSignature |
| Signature we use to verify that the broadcast was really made by the peer that claims to have made it. More... | |
| struct | UDPBroadcast |
| Broadcast by peer in LAN announcing its presence. More... | |
| struct | UDPBox |
| UDP message box. More... | |
| struct | UDPRekey |
| Plaintext of a rekey payload in a UDPBox. More... | |
| struct | KeyCacheEntry |
Pre-generated "kid" code (key and IV identification code) to quickly derive master key for a struct UDPBox. More... | |
| struct | SharedSecret |
| Shared secret we generated for a particular sender or receiver. More... | |
| struct | SenderAddress |
| Information we track per sender address we have recently been in contact with (we decrypt messages from the sender). More... | |
| struct | ReceiverAddress |
| Information we track per receiving address we have recently been in contact with (encryption to receiver). More... | |
| struct | BroadcastInterface |
| Interface we broadcast our presence on. More... | |
| struct | AckInfo |
| struct | SearchContext |
| Closure for #find_sender_by_address() More... | |
Macros | |
| #define | LOG(kind, ...) GNUNET_log_from (kind, "communicator-udp", __VA_ARGS__) |
| #define | DEFAULT_REKEY_TIME_INTERVAL GNUNET_TIME_UNIT_DAYS |
| How often do we rekey based on time (at least) | |
| #define | PROTO_QUEUE_TIMEOUT GNUNET_TIME_UNIT_MINUTES |
| How long do we wait until we must have received the initial KX? | |
| #define | PEER_LIVENESS_TIMEOUT GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT |
| How long may we keep transmitting to a peer that never acknowledges a single datagram before we conclude that it is gone and tear the queues down? A live peer that receives our datagrams answers with an GNUNET_MESSAGE_TYPE_COMMUNICATOR_UDP_ACK as soon as its key cache runs low, so silence for this long while we are actively sending means the peer is unreachable. | |
| #define | BROADCAST_FREQUENCY GNUNET_TIME_UNIT_MINUTES |
| How often do we broadcast our presence on the LAN? | |
| #define | INTERFACE_SCAN_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) |
| How often do we scan for changes to our network interfaces? | |
| #define | ADDRESS_VALIDITY_PERIOD GNUNET_TIME_UNIT_HOURS |
| How long do we believe our addresses to remain up (before the other peer should revalidate). | |
| #define | WORKING_QUEUE_INTERVALL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,1) |
| #define | AES_KEY_SIZE (256 / 8) |
| AES key size. | |
| #define | AES_IV_SIZE (96 / 8) |
| AES (GCM) IV size. | |
| #define | GCM_TAG_SIZE (128 / 8) |
| Size of the GCM tag. | |
| #define | GENERATE_AT_ONCE 64 |
| #define | KCN_THRESHOLD 96 |
| If we fall below this number of available KCNs, we generate additional ACKs until we reach KCN_TARGET. | |
| #define | KCN_TARGET 128 |
| How many KCNs do we keep around after we hit the KCN_THRESHOLD? Should be larger than KCN_THRESHOLD so we do not generate just one ACK at the time. | |
| #define | MAX_SQN_DELTA 160 |
| What is the maximum delta between KCN sequence numbers that we allow. | |
| #define | MAX_SECRETS 256 |
| How many shared master secrets do we keep around at most per sender? Should be large enough so that we generally have a chance of sending an ACK before the sender already rotated out the master secret. | |
| #define | DEFAULT_REKEY_MAX_BYTES (1024LLU * 1024 * 1024 * 4LLU) |
| Default value for how often we do rekey based on number of bytes transmitted? (additionally randomized). | |
| #define | COMMUNICATOR_ADDRESS_PREFIX "udp" |
| Address prefix used by the communicator. | |
| #define | COMMUNICATOR_CONFIG_SECTION "communicator-udp" |
| Configuration section used by the communicator. | |
Functions | |
| static void | eddsa_priv_to_hpke_key (const struct GNUNET_CRYPTO_EddsaPrivateKey *edpk, struct GNUNET_CRYPTO_HpkePrivateKey *pk) |
| static void | eddsa_pub_to_hpke_key (const struct GNUNET_CRYPTO_EddsaPublicKey *edpk, struct GNUNET_CRYPTO_HpkePublicKey *pk) |
| static void | bi_destroy (struct BroadcastInterface *bi) |
| An interface went away, stop broadcasting on it. | |
| static int | secret_destroy (struct SharedSecret *ss) |
| Destroy ss and associated key cache entries. | |
| static void | receiver_destroy (struct ReceiverAddress *receiver) |
| Destroys a receiving state due to timeout or shutdown. | |
| static void | kce_destroy (struct KeyCacheEntry *kce) |
| Free memory used by key cache entry. | |
| static void | get_kid (const struct GNUNET_ShortHashCode *msec, uint32_t serial, struct GNUNET_ShortHashCode *kid) |
| Compute kid. | |
| static void | kce_generate (struct SharedSecret *ss, uint32_t seq) |
| Setup key cache entry for sequence number seq and shared secret ss. | |
| static void | sender_destroy (struct SenderAddress *sender) |
| Functions with this signature are called whenever we need to close a sender's state due to timeout. | |
| static void | get_iv_key (const struct GNUNET_ShortHashCode *msec, uint32_t serial, char key[(256/8)], char iv[(96/8)]) |
| Compute key and iv. | |
| static void | reschedule_sender_timeout (struct SenderAddress *sender) |
| Increment sender timeout due to activity. | |
| static void | reschedule_receiver_timeout (struct ReceiverAddress *receiver) |
| Increment receiver timeout due to activity. | |
| static enum GNUNET_GenericReturnValue | check_peer_alive (struct ReceiverAddress *receiver) |
| Check whether the peer behind receiver is still reacting to what we send it, and tear receiver down if it is not. | |
| static void | check_timeouts (void *cls) |
| Task run to check #receiver_heap and #sender_heap for timeouts. | |
| static void | calculate_cmac (struct SharedSecret *ss) |
| Calculate cmac from master in ss. | |
| static void | pass_plaintext_to_core (struct SenderAddress *sender, const void *plaintext, size_t plaintext_len) |
| We received plaintext_len bytes of plaintext from a sender. | |
| static void | setup_cipher (const struct GNUNET_ShortHashCode *msec, uint32_t serial, gcry_cipher_hd_t *cipher) |
| Setup cipher based on shared secret msec and serial number serial. | |
| static int | try_decrypt (const struct SharedSecret *ss, const uint8_t *tag, uint32_t serial, const char *in_buf, size_t in_buf_size, char *out_buf) |
| Try to decrypt buf using shared secret ss and key/iv derived using serial. | |
| static struct SharedSecret * | setup_shared_secret_dec (const struct GNUNET_CRYPTO_HpkeEncapsulation *ephemeral) |
| Setup shared secret for decryption. | |
| static struct SharedSecret * | setup_initial_shared_secret_dec (const struct GNUNET_CRYPTO_HpkeEncapsulation *c) |
| Setup shared secret for decryption for initial handshake. | |
| static struct SharedSecret * | setup_shared_secret_ephemeral (struct GNUNET_CRYPTO_HpkeEncapsulation *ephemeral, struct ReceiverAddress *receiver) |
| Setup new shared secret for encryption using KEM. | |
| static struct SharedSecret * | setup_initial_shared_secret_ephemeral (struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct ReceiverAddress *receiver) |
| Setup new shared secret for encryption using KEM for initial handshake. | |
| static void | setup_receiver_mq (struct ReceiverAddress *receiver) |
| Setup the MQ for the receiver. | |
| static unsigned int | purge_secrets (struct SharedSecret *ss_list_tail) |
| Best effort try to purge some secrets. | |
| static void | add_acks (struct SharedSecret *ss, int acks_to_add) |
| static int | handle_ack (void *cls, const struct GNUNET_HashCode *key, void *value) |
| We received an ACK for pid. | |
| static int | handle_ack_by_sender (void *cls, const struct GNUNET_HashCode *key, void *value) |
| Offer an ACK we received from ai->sender to the receiver in value, if that receiver is for that peer. | |
| static void | consider_ss_ack (struct SharedSecret *ss) |
| We established a shared secret with a sender. | |
| static void | kce_generate_cb (void *cls) |
| static void | try_handle_plaintext (struct SenderAddress *sender, const void *buf, size_t buf_size) |
| Test if we have received a valid message in plaintext. | |
| static void | decrypt_box (const struct UDPBox *box, size_t box_len, struct KeyCacheEntry *kce) |
| We received a box with matching kce. | |
| static struct SenderAddress * | setup_sender (const struct GNUNET_PeerIdentity *target, const struct sockaddr *address, socklen_t address_len, int *is_new) |
| Create sender address for target. | |
| static int | verify_confirmation (const struct GNUNET_CRYPTO_HpkeEncapsulation *enc, const struct UDPConfirmation *uc) |
| Check signature from uc against ephemeral. | |
| static char * | sockaddr_to_udpaddr_string (const struct sockaddr *address, socklen_t address_len) |
| Converts address to the address string format used by this communicator in HELLOs. | |
| static struct GNUNET_NETWORK_Handle * | get_socket (struct ReceiverAddress *receiver) |
| static struct sockaddr * | udp_address_to_sockaddr (const char *bindto, sa_family_t family, socklen_t *sock_len) |
Convert UDP bind specification to a struct sockaddr * | |
| static void | sock_read (void *cls) |
| Socket read task. | |
| static enum GNUNET_GenericReturnValue | create_receiver (const struct GNUNET_PeerIdentity *peer, const char *address, struct GNUNET_NETWORK_Handle *udp_sock) |
| static void | consider_reflexive_address (const struct GNUNET_PeerIdentity *target, const struct sockaddr *address, socklen_t address_len) |
| Consider the address a datagram from target arrived from as a path we can send to. | |
| static void | do_pad (gcry_cipher_hd_t out_cipher, char *dgram, size_t pad_size) |
| Pad dgram by pad_size using out_cipher. | |
| static void | send_msg_with_kx (const struct GNUNET_MessageHeader *msg, struct ReceiverAddress *receiver, struct GNUNET_MQ_Handle *mq) |
| static void | mq_send_kx (struct GNUNET_MQ_Handle *mq, const struct GNUNET_MessageHeader *msg, void *impl_state) |
| Signature of functions implementing the sending functionality of a message queue. | |
| static void | create_rekey (struct ReceiverAddress *receiver, struct SharedSecret *ss, struct UDPRekey *rekey) |
| static void | mq_send_d (struct GNUNET_MQ_Handle *mq, const struct GNUNET_MessageHeader *msg, void *impl_state) |
| Signature of functions implementing the sending functionality of a message queue. | |
| static void | mq_destroy_d (struct GNUNET_MQ_Handle *mq, void *impl_state) |
| Signature of functions implementing the destruction of a message queue. | |
| static void | mq_destroy_kx (struct GNUNET_MQ_Handle *mq, void *impl_state) |
| Signature of functions implementing the destruction of a message queue. | |
| static void | mq_cancel (struct GNUNET_MQ_Handle *mq, void *impl_state) |
| Implementation function that cancels the currently sent message. | |
| static void | mq_error (void *cls, enum GNUNET_MQ_Error error) |
| Generic error handler, called with the appropriate error code and the same closure specified at the creation of the message queue. | |
| static int | mq_init (void *cls, const struct GNUNET_PeerIdentity *peer, const char *address) |
| Function called by the transport service to initialize a message queue given address information about another peer. | |
| static int | get_receiver_delete_it (void *cls, const struct GNUNET_HashCode *target, void *value) |
| Iterator over all receivers to clean up. | |
| static int | get_sender_delete_it (void *cls, const struct GNUNET_HashCode *target, void *value) |
| Iterator over all senders to clean up. | |
| static void | do_shutdown (void *cls) |
| Shutdown the UNIX communicator. | |
| static void | enc_notify_cb (void *cls, const struct GNUNET_PeerIdentity *sender, const struct GNUNET_MessageHeader *msg) |
| Function called when the transport service has received a backchannel message for this communicator (!) via a different return path. | |
| static void | nat_address_cb (void *cls, void **app_ctx, int add_remove, enum GNUNET_NAT_AddressClass ac, const struct sockaddr *addr, socklen_t addrlen) |
| Signature of the callback passed to GNUNET_NAT_register() for a function to call whenever our set of 'valid' addresses changes. | |
| static void | ifc_broadcast (void *cls) |
| Broadcast our presence on one of our interfaces. | |
| static int | iface_proc (void *cls, const char *name, int isDefault, const struct sockaddr *addr, const struct sockaddr *broadcast_addr, const struct sockaddr *netmask, socklen_t addrlen) |
| Callback function invoked for each interface found. | |
| static void | do_broadcast (void *cls) |
| Scan interfaces to broadcast our presence on the LAN. | |
| static void | try_connection_reversal (void *cls, const struct sockaddr *addr, socklen_t addrlen) |
| static void | udp_socket_notify (struct GNUNET_UdpSocketInfo *sock_info) |
| static void | start_burst (const char *addr, struct GNUNET_TIME_Relative rtt, struct GNUNET_PeerIdentity *pid) |
| static struct GNUNET_NETWORK_Handle * | create_udp_socket (const char *bindto, sa_family_t family, struct sockaddr **out, socklen_t *out_len) |
| static void | shutdown_run (struct sockaddr *addrs[2]) |
| static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) |
Variables | |
| static struct GNUNET_PILS_KeyRing * | key_ring |
| For PILS. | |
| static struct GNUNET_PILS_Handle * | pils |
| For PILS. | |
| static struct GNUNET_TIME_Relative | rekey_interval |
| The rekey interval. | |
| static unsigned long long | rekey_max_bytes |
| How often we do rekey based on number of bytes transmitted. | |
| static struct GNUNET_CONTAINER_MultiShortmap * | key_cache |
| Cache of pre-generated key IDs. | |
| static struct GNUNET_SCHEDULER_Task * | read_v4_task |
| ID of read IPv4 task. | |
| static struct GNUNET_SCHEDULER_Task * | read_v6_task |
| ID of read IPv6 task. | |
| static struct GNUNET_SCHEDULER_Task * | timeout_task |
| ID of timeout task. | |
| static struct GNUNET_SCHEDULER_Task * | broadcast_task |
| ID of master broadcast task. | |
| static struct GNUNET_STATISTICS_Handle * | stats |
| For logging statistics. | |
| static struct GNUNET_TRANSPORT_CommunicatorHandle * | ch |
| Our environment. | |
| static struct GNUNET_CONTAINER_MultiHashMap * | receivers |
Receivers (map from peer identity to struct ReceiverAddress) | |
| static struct GNUNET_CONTAINER_MultiHashMap * | senders |
Senders (map from peer identity to struct SenderAddress) | |
| static struct GNUNET_CONTAINER_Heap * | senders_heap |
Expiration heap for senders (contains struct SenderAddress) | |
| static struct GNUNET_CONTAINER_Heap * | receivers_heap |
Expiration heap for receivers (contains struct ReceiverAddress) | |
| static struct BroadcastInterface * | bi_head |
| Broadcast interface tasks. | |
| static struct BroadcastInterface * | bi_tail |
| Broadcast interface tasks. | |
| static struct GNUNET_NETWORK_Handle * | default_v4_sock |
| Our IPv4 socket. | |
| static struct GNUNET_NETWORK_Handle * | default_v6_sock |
| Our IPv6 socket. | |
| static const struct GNUNET_CONFIGURATION_Handle * | cfg |
| Our configuration. | |
| static struct GNUNET_TRANSPORT_ApplicationHandle * | ah |
| Our handle to report addresses for validation to TRANSPORT. | |
| static struct GNUNET_NT_InterfaceScanner * | is |
| Network scanner to determine network types. | |
| static struct GNUNET_NAT_Handle * | nat |
| Connection to NAT service. | |
| static uint16_t | my_port |
| Port number to which we are actually bound. | |
| char * | my_ipv4 |
| Our ipv4 address. | |
| static int | disable_v6 |
| IPv6 disabled or not. | |
| static struct GNUNET_SCHEDULER_Task * | burst_task |
Transport plugin using UDP.
TODO:
Definition in file gnunet-communicator-udp.c.
| #define LOG | ( | kind, | |
| ... | |||
| ) | GNUNET_log_from (kind, "communicator-udp", __VA_ARGS__) |
Definition at line 53 of file gnunet-communicator-udp.c.
| #define DEFAULT_REKEY_TIME_INTERVAL GNUNET_TIME_UNIT_DAYS |
How often do we rekey based on time (at least)
Definition at line 58 of file gnunet-communicator-udp.c.
| #define PROTO_QUEUE_TIMEOUT GNUNET_TIME_UNIT_MINUTES |
How long do we wait until we must have received the initial KX?
Definition at line 63 of file gnunet-communicator-udp.c.
| #define PEER_LIVENESS_TIMEOUT GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT |
How long may we keep transmitting to a peer that never acknowledges a single datagram before we conclude that it is gone and tear the queues down? A live peer that receives our datagrams answers with an GNUNET_MESSAGE_TYPE_COMMUNICATOR_UDP_ACK as soon as its key cache runs low, so silence for this long while we are actively sending means the peer is unreachable.
Definition at line 73 of file gnunet-communicator-udp.c.
| #define BROADCAST_FREQUENCY GNUNET_TIME_UNIT_MINUTES |
How often do we broadcast our presence on the LAN?
Definition at line 78 of file gnunet-communicator-udp.c.
| #define INTERFACE_SCAN_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) |
How often do we scan for changes to our network interfaces?
Definition at line 83 of file gnunet-communicator-udp.c.
| #define ADDRESS_VALIDITY_PERIOD GNUNET_TIME_UNIT_HOURS |
How long do we believe our addresses to remain up (before the other peer should revalidate).
Definition at line 90 of file gnunet-communicator-udp.c.
| #define WORKING_QUEUE_INTERVALL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,1) |
Definition at line 92 of file gnunet-communicator-udp.c.
| #define AES_KEY_SIZE (256 / 8) |
AES key size.
Definition at line 98 of file gnunet-communicator-udp.c.
| #define AES_IV_SIZE (96 / 8) |
AES (GCM) IV size.
Definition at line 103 of file gnunet-communicator-udp.c.
| #define GCM_TAG_SIZE (128 / 8) |
Size of the GCM tag.
Definition at line 108 of file gnunet-communicator-udp.c.
| #define GENERATE_AT_ONCE 64 |
Definition at line 110 of file gnunet-communicator-udp.c.
| #define KCN_THRESHOLD 96 |
If we fall below this number of available KCNs, we generate additional ACKs until we reach KCN_TARGET.
Should be large enough that we don't generate ACKs all the time and still have enough time for the ACK to arrive before the sender runs out. So really this should ideally be based on the RTT.
Definition at line 121 of file gnunet-communicator-udp.c.
| #define KCN_TARGET 128 |
How many KCNs do we keep around after we hit the KCN_THRESHOLD? Should be larger than KCN_THRESHOLD so we do not generate just one ACK at the time.
Definition at line 129 of file gnunet-communicator-udp.c.
| #define MAX_SQN_DELTA 160 |
What is the maximum delta between KCN sequence numbers that we allow.
Used to expire 'ancient' KCNs that likely were dropped by the network. Must be larger than KCN_TARGET (otherwise we generate new KCNs all the time), but not too large (otherwise packet loss may cause sender to fall back to KX needlessly when sender runs out of ACK'ed KCNs due to losses).
Definition at line 140 of file gnunet-communicator-udp.c.
| #define MAX_SECRETS 256 |
How many shared master secrets do we keep around at most per sender? Should be large enough so that we generally have a chance of sending an ACK before the sender already rotated out the master secret.
Generally values around KCN_TARGET make sense. Might make sense to adapt to RTT if we had a good measurement...
Definition at line 151 of file gnunet-communicator-udp.c.
| #define DEFAULT_REKEY_MAX_BYTES (1024LLU * 1024 * 1024 * 4LLU) |
Default value for how often we do rekey based on number of bytes transmitted? (additionally randomized).
Definition at line 157 of file gnunet-communicator-udp.c.
| #define COMMUNICATOR_ADDRESS_PREFIX "udp" |
Address prefix used by the communicator.
Definition at line 163 of file gnunet-communicator-udp.c.
| #define COMMUNICATOR_CONFIG_SECTION "communicator-udp" |
Configuration section used by the communicator.
Definition at line 168 of file gnunet-communicator-udp.c.
|
static |
Definition at line 913 of file gnunet-communicator-udp.c.
References GNUNET_CRYPTO_hpke_sk_to_x25519(), GNUNET_PUBLIC_KEY_TYPE_EDDSA, key, and pk.
Referenced by setup_initial_shared_secret_dec().
|
static |
Definition at line 925 of file gnunet-communicator-udp.c.
References GNUNET_CRYPTO_hpke_pk_to_x25519(), GNUNET_PUBLIC_KEY_TYPE_EDDSA, key, and pk.
Referenced by create_receiver().
|
static |
An interface went away, stop broadcasting on it.
| bi | entity to close down |
Definition at line 942 of file gnunet-communicator-udp.c.
References BroadcastInterface::ba, bi_head, bi_tail, BroadcastInterface::broadcast_task, default_v6_sock, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log_strerror, GNUNET_NETWORK_socket_setsockopt(), GNUNET_OK, GNUNET_SCHEDULER_cancel(), BroadcastInterface::mcreq, and BroadcastInterface::sa.
Referenced by do_broadcast(), and do_shutdown().
|
static |
Destroy ss and associated key cache entries.
| ss | shared secret to destroy |
| withoutKce | If GNUNET_YES shared secrets with kce will not be destroyed. |
Definition at line 1115 of file gnunet-communicator-udp.c.
References SenderAddress::acks_available, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multishortmap_size(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_cancel(), GNUNET_sh2s(), GNUNET_STATISTICS_set(), GNUNET_STATISTICS_update(), GNUNET_YES, kce_destroy(), SharedSecret::kce_head, SenderAddress::kce_task, key_cache, SharedSecret::master, SenderAddress::num_secrets, receiver(), SharedSecret::receiver, SharedSecret::sender, SharedSecret::sequence_allowed, SharedSecret::sequence_used, KeyCacheEntry::ss, SenderAddress::ss_head, SenderAddress::ss_tail, and stats.
Referenced by decrypt_box(), mq_send_d(), purge_secrets(), receiver_destroy(), send_msg_with_kx(), sender_destroy(), sock_read(), and try_handle_plaintext().
|
static |
Destroys a receiving state due to timeout or shutdown.
| receiver | entity to close down |
Definition at line 973 of file gnunet-communicator-udp.c.
References GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_heap_remove_node(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_CONTAINER_multihashmap_size(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_MQ_destroy(), GNUNET_NETWORK_socket_close(), GNUNET_NO, GNUNET_OK, GNUNET_STATISTICS_set(), GNUNET_TRANSPORT_communicator_mq_del(), GNUNET_YES, receiver(), receivers, secret_destroy(), and stats.
Referenced by check_peer_alive(), check_timeouts(), get_receiver_delete_it(), mq_destroy_d(), mq_destroy_kx(), mq_error(), mq_send_d(), and send_msg_with_kx().
|
static |
Free memory used by key cache entry.
| kce | the key cache entry |
Definition at line 1028 of file gnunet-communicator-udp.c.
References SenderAddress::acks_available, SharedSecret::active_kce_count, GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multishortmap_remove(), GNUNET_free, GNUNET_YES, SharedSecret::kce_head, SharedSecret::kce_tail, key_cache, KeyCacheEntry::kid, SharedSecret::sender, and KeyCacheEntry::ss.
Referenced by consider_ss_ack(), decrypt_box(), and secret_destroy().
|
static |
Compute kid.
| msec | master secret for HMAC calculation | |
| serial | number for the smac calculation | |
| [out] | kid | where to write the key ID |
Definition at line 1059 of file gnunet-communicator-udp.c.
References GNUNET_CRYPTO_hkdf_expand, GNUNET_CRYPTO_hkdf_extract(), and GNUNET_CRYPTO_kdf_arg_string.
Referenced by kce_generate(), and mq_send_d().
|
static |
Setup key cache entry for sequence number seq and shared secret ss.
| ss | shared secret |
| seq | sequence number for the key cache entry |
Definition at line 1084 of file gnunet-communicator-udp.c.
References SenderAddress::acks_available, SharedSecret::active_kce_count, get_kid(), GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_multishortmap_put(), GNUNET_CONTAINER_multishortmap_size(), GNUNET_new, GNUNET_NO, GNUNET_STATISTICS_set(), SharedSecret::kce_head, SharedSecret::kce_tail, key_cache, KeyCacheEntry::kid, SharedSecret::master, SharedSecret::sender, KeyCacheEntry::sequence_number, KeyCacheEntry::ss, and stats.
Referenced by kce_generate_cb().
|
static |
Functions with this signature are called whenever we need to close a sender's state due to timeout.
| sender | entity to close down |
Definition at line 1178 of file gnunet-communicator-udp.c.
References SenderAddress::address, GNUNET_assert, GNUNET_CONTAINER_heap_remove_node(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_CONTAINER_multihashmap_size(), GNUNET_free, GNUNET_NO, GNUNET_STATISTICS_set(), GNUNET_YES, SenderAddress::hn, SenderAddress::key, secret_destroy(), SharedSecret::sender, SenderAddress::sender_destroy_called, senders, SenderAddress::ss_head, and stats.
Referenced by check_timeouts(), and get_sender_delete_it().
|
static |
Compute key and iv.
| msec | master secret for calculation | |
| serial | number for the smac calculation | |
| [out] | key | where to write the decryption key |
| [out] | iv | where to write the IV |
Definition at line 1208 of file gnunet-communicator-udp.c.
References AES_IV_SIZE, AES_KEY_SIZE, GNUNET_CRYPTO_hkdf_expand, GNUNET_CRYPTO_kdf_arg_auto, GNUNET_CRYPTO_kdf_arg_string, and key.
Referenced by setup_cipher().
|
static |
Increment sender timeout due to activity.
| sender | address for which the timeout should be rescheduled |
Definition at line 1236 of file gnunet-communicator-udp.c.
References GNUNET_TIME_Absolute::abs_value_us, GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, GNUNET_CONTAINER_heap_update_cost(), GNUNET_TIME_relative_to_absolute(), SenderAddress::hn, SharedSecret::sender, and SenderAddress::timeout.
Referenced by setup_sender().
|
static |
Increment receiver timeout due to activity.
NOTE: this is called when we transmit, so timeout tracks our own activity, not the peer's. It must not be mistaken for a liveness check; see check_peer_alive().
| receiver | address for which the timeout should be rescheduled |
Definition at line 1254 of file gnunet-communicator-udp.c.
References GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, GNUNET_CONTAINER_heap_update_cost(), GNUNET_TIME_relative_to_absolute(), and receiver().
Referenced by mq_send_d(), and send_msg_with_kx().
|
static |
Check whether the peer behind receiver is still reacting to what we send it, and tear receiver down if it is not.
Called before each transmission. reschedule_receiver_timeout() pushes timeout forward on every send, so check_timeouts() can never expire a receiver we keep transmitting to – and the KX queue is registered with GNUNET_TRANSPORT_QUEUE_LENGTH_UNLIMITED, so transport always has one to transmit on. Without this check a peer that vanished would keep its queues (and hence transport's virtual link, and hence CORE's idea of the connection) alive forever.
| receiver | receiver we are about to transmit to |
Definition at line 1280 of file gnunet-communicator-udp.c.
References GNUNET_ERROR_TYPE_INFO, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_relative_cmp, GNUNET_YES, PEER_LIVENESS_TIMEOUT, receiver(), receiver_destroy(), and stats.
Referenced by mq_send_d(), and mq_send_kx().
|
static |
Task run to check #receiver_heap and #sender_heap for timeouts.
| cls | unused, NULL |
Definition at line 1309 of file gnunet-communicator-udp.c.
References check_timeouts(), GNUNET_CONTAINER_heap_peek(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_relative_min(), GNUNET_TIME_UNIT_FOREVER_REL, receiver(), receiver_destroy(), receivers_heap, GNUNET_TIME_Relative::rel_value_us, sender_destroy(), senders_heap, st, SenderAddress::timeout, and timeout_task.
Referenced by check_timeouts(), create_receiver(), and setup_sender().
|
static |
Calculate cmac from master in ss.
| [in,out] | ss | data structure to complete |
Definition at line 1352 of file gnunet-communicator-udp.c.
References SharedSecret::cmac, GNUNET_CRYPTO_hkdf_expand, GNUNET_CRYPTO_kdf_arg_string, and SharedSecret::master.
Referenced by setup_initial_shared_secret_dec(), setup_initial_shared_secret_ephemeral(), setup_shared_secret_dec(), setup_shared_secret_ephemeral(), and sock_read().
|
static |
We received plaintext_len bytes of plaintext from a sender.
Pass it on to CORE.
| queue | the queue that received the plaintext |
| plaintext | the plaintext that was received |
| plaintext_len | number of bytes of plaintext received |
Definition at line 1371 of file gnunet-communicator-udp.c.
References ADDRESS_VALIDITY_PERIOD, ch, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_SYSERR, GNUNET_TRANSPORT_communicator_receive(), GNUNET_MessageHeader::size, stats, and SenderAddress::target.
Referenced by try_handle_plaintext().
|
static |
Setup cipher based on shared secret msec and serial number serial.
| msec | master shared secret |
| serial | serial number of cipher to set up |
| cipher[out] | cipher to initialize |
Definition at line 1420 of file gnunet-communicator-udp.c.
References AES_IV_SIZE, AES_KEY_SIZE, get_iv_key(), GNUNET_assert, and key.
Referenced by mq_send_d(), send_msg_with_kx(), and try_decrypt().
|
static |
Try to decrypt buf using shared secret ss and key/iv derived using serial.
| ss | shared secret |
| tag | GCM authentication tag |
| serial | serial number to use |
| in_buf | input buffer to decrypt |
| in_buf_size | number of bytes in in_buf and available in out_buf |
| out_buf | where to write the result |
Definition at line 1455 of file gnunet-communicator-udp.c.
References GCM_TAG_SIZE, GNUNET_assert, GNUNET_NO, GNUNET_OK, GNUNET_STATISTICS_update(), GNUNET_SYSERR, SharedSecret::master, setup_cipher(), and stats.
Referenced by decrypt_box(), and sock_read().
|
static |
Setup shared secret for decryption.
| ephemeral | ephemeral key we received from the other peer |
Definition at line 1489 of file gnunet-communicator-udp.c.
References calculate_cmac(), GNUNET_assert, GNUNET_CRYPTO_eddsa_kem_decaps(), GNUNET_new, GNUNET_PILS_key_ring_get_private_key(), key_ring, SharedSecret::master, and my_private_key.
Referenced by try_handle_plaintext().
|
static |
Setup shared secret for decryption for initial handshake.
| representative | of ephemeral key we received from the other peer |
Definition at line 1514 of file gnunet-communicator-udp.c.
References calculate_cmac(), eddsa_priv_to_hpke_key(), GNUNET_assert, GNUNET_CRYPTO_hpke_elligator_kem_decaps(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_new, GNUNET_PILS_key_ring_get_private_key(), GNUNET_sh2s(), key_ring, SharedSecret::master, and my_private_key.
Referenced by sock_read().
|
static |
Setup new shared secret for encryption using KEM.
| [out] | ephemeral | ephemeral key to be sent to other peer (encapsulated key from KEM) |
| [in,out] | receiver | queue to initialize encryption key for |
Definition at line 1544 of file gnunet-communicator-udp.c.
References calculate_cmac(), GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_eddsa_kem_encaps(), GNUNET_new, GNUNET_NO, GNUNET_STATISTICS_update(), SharedSecret::master, receiver(), SharedSecret::receiver, and stats.
Referenced by create_rekey().
|
static |
Setup new shared secret for encryption using KEM for initial handshake.
| [out] | representative | of ephemeral key to be sent to other peer (encapsulated key from KEM) |
| [in,out] | receiver | queue to initialize encryption key for |
Definition at line 1571 of file gnunet-communicator-udp.c.
References calculate_cmac(), GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_hpke_elligator_kem_encaps(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_new, GNUNET_NO, GNUNET_sh2s(), GNUNET_STATISTICS_update(), SharedSecret::master, receiver(), SharedSecret::receiver, and stats.
Referenced by send_msg_with_kx().
|
static |
Setup the MQ for the receiver.
If a queue exists, the existing one is destroyed. Then the MTU is recalculated and a fresh queue is initialized.
| receiver | receiver to setup MQ for |
Definition at line 3323 of file gnunet-communicator-udp.c.
References ch, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MQ_queue_for_callbacks(), GNUNET_TRANSPORT_communicator_mq_add(), GNUNET_TRANSPORT_CS_OUTBOUND, GNUNET_TRANSPORT_QUEUE_LENGTH_UNLIMITED, mq_cancel(), mq_destroy_d(), mq_destroy_kx(), mq_error(), mq_send_d(), mq_send_kx(), and receiver().
Referenced by create_receiver().
|
static |
Best effort try to purge some secrets.
Ideally those, not ACKed.
| ss_list_tail | the oldest secret in the list of interest. |
Definition at line 1610 of file gnunet-communicator-udp.c.
References SharedSecret::bytes_sent, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, SharedSecret::prev, and secret_destroy().
Referenced by mq_send_d(), send_msg_with_kx(), sock_read(), and try_handle_plaintext().
|
static |
Definition at line 1638 of file gnunet-communicator-udp.c.
References ch, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_TRANSPORT_communicator_mq_add(), GNUNET_TRANSPORT_communicator_mq_update(), GNUNET_TRANSPORT_CS_OUTBOUND, receiver(), and SharedSecret::receiver.
Referenced by handle_ack().
|
static |
We received an ACK for pid.
Check if it is for the receiver in value and if so, handle it and return GNUNET_NO. Otherwise, return GNUNET_YES.
| cls | a const struct UDPAck |
| pid | peer the ACK is from |
| value | a struct ReceiverAddress |
Definition at line 1691 of file gnunet-communicator-udp.c.
References add_acks(), UDPAck::cmac, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_NO, GNUNET_sh2s(), GNUNET_TIME_absolute_get(), GNUNET_YES, key, receiver(), UDPAck::sequence_ack, and value.
Referenced by handle_ack_by_sender().
|
static |
Offer an ACK we received from ai->sender to the receiver in value, if that receiver is for that peer.
Matching on the peer identity (and letting handle_ack() sort out which shared secret the ACK is for) is the only workable test: the ACK reaches us over whatever path transport chose, which tells us nothing about which of the addresses we hold for that peer it belongs to.
| cls | a struct AckInfo * |
| key | hash of the receiver, unused |
| value | a struct ReceiverAddress * |
Definition at line 1766 of file gnunet-communicator-udp.c.
References ai, GNUNET_memcmp, GNUNET_YES, handle_ack(), key, receiver(), and value.
Referenced by enc_notify_cb(), and try_handle_plaintext().
|
static |
We established a shared secret with a sender.
We should try to send the sender an struct UDPAck at the next opportunity to allow the sender to use ss longer (assuming we did not yet already recently).
| ss | shared secret to generate ACKs for |
Definition at line 1789 of file gnunet-communicator-udp.c.
References SenderAddress::acks_available, ch, UDPAck::cmac, SharedSecret::cmac, COMMUNICATOR_ADDRESS_PREFIX, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s_full(), GNUNET_log, GNUNET_MESSAGE_TYPE_COMMUNICATOR_UDP_ACK, GNUNET_sh2s(), GNUNET_TRANSPORT_communicator_notify(), UDPAck::header, kce_destroy(), SharedSecret::kce_head, SharedSecret::kce_tail, SharedSecret::master, MAX_SQN_DELTA, SharedSecret::sender, UDPAck::sequence_ack, SharedSecret::sequence_allowed, KeyCacheEntry::sequence_number, GNUNET_MessageHeader::size, SenderAddress::target, and GNUNET_MessageHeader::type.
Referenced by kce_generate_cb().
|
static |
As long as we loose over 30% of max acks in reschedule, We keep generating acks for this ss.
Definition at line 1824 of file gnunet-communicator-udp.c.
References SenderAddress::acks_available, consider_ss_ack(), GENERATE_AT_ONCE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_add_delayed(), GNUNET_sh2s(), GNUNET_YES, kce_generate(), kce_generate_cb(), SenderAddress::kce_send_ack_on_finish, SenderAddress::kce_task, SenderAddress::kce_task_finished, KCN_TARGET, SharedSecret::master, SharedSecret::override_available_acks, SharedSecret::sender, SharedSecret::sequence_allowed, and WORKING_QUEUE_INTERVALL.
Referenced by decrypt_box(), kce_generate_cb(), sock_read(), and try_handle_plaintext().
|
static |
Test if we have received a valid message in plaintext.
If so, handle it.
| sender | peer to process inbound plaintext for |
| buf | buffer we received |
| buf_size | number of bytes in buf |
Definition at line 1886 of file gnunet-communicator-udp.c.
References AckInfo::ack, SenderAddress::acks_available, ai, SharedSecret::cmac, UDPRekey::ephemeral, GNUNET_break_op, GNUNET_CONTAINER_DLL_insert, GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_COMMUNICATOR_UDP_ACK, GNUNET_MESSAGE_TYPE_COMMUNICATOR_UDP_PAD, GNUNET_MESSAGE_TYPE_COMMUNICATOR_UDP_REKEY, GNUNET_NO, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_cancel(), GNUNET_sh2s(), GNUNET_STATISTICS_update(), GNUNET_YES, handle_ack_by_sender(), kce_generate_cb(), SenderAddress::kce_send_ack_on_finish, SenderAddress::kce_task, SharedSecret::master, MAX_SECRETS, SenderAddress::num_secrets, SharedSecret::override_available_acks, pass_plaintext_to_core(), purge_secrets(), receivers, secret_destroy(), SharedSecret::sender, AckInfo::sender, SharedSecret::sequence_allowed, setup_shared_secret_dec(), GNUNET_MessageHeader::size, SenderAddress::ss_head, SenderAddress::ss_tail, stats, type, and GNUNET_MessageHeader::type.
Referenced by decrypt_box(), and sock_read().
|
static |
We received a box with matching kce.
Decrypt and process it.
| box | the data we received |
| box_len | number of bytes in box |
| kce | key index to decrypt box |
Definition at line 2019 of file gnunet-communicator-udp.c.
References SenderAddress::acks_available, SharedSecret::bytes_sent, UDPBox::gcm_tag, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_now(), GNUNET_sh2s(), GNUNET_STATISTICS_update(), GNUNET_YES, kce_destroy(), kce_generate_cb(), SenderAddress::kce_send_ack_on_finish, SenderAddress::kce_task, SenderAddress::kce_task_finished, KCN_THRESHOLD, UDPBox::kid, SharedSecret::prev, rekey_max_bytes, secret_destroy(), SharedSecret::sender, KeyCacheEntry::sequence_number, SharedSecret::sequence_used, KeyCacheEntry::ss, SenderAddress::ss_tail, stats, try_decrypt(), and try_handle_plaintext().
Referenced by sock_read().
|
static |
Create sender address for target.
Note that we might already have one, so a fresh one is only allocated if one does not yet exist for address.
| target | peer to generate address for | |
| address | target address | |
| address_len | number of bytes in address | |
| [out] | is_new | set to GNUNET_YES if this is the first time we see target at address, may be NULL |
Definition at line 2138 of file gnunet-communicator-udp.c.
References GNUNET_TIME_Absolute::abs_value_us, address, SenderAddress::address, SenderAddress::address_len, check_timeouts(), GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, GNUNET_CONTAINER_heap_insert(), GNUNET_CONTAINER_multihashmap_get(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_multihashmap_size(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CRYPTO_hash_context_finish(), GNUNET_CRYPTO_hash_context_read(), GNUNET_CRYPTO_hash_context_start(), GNUNET_memdup, GNUNET_new, GNUNET_NO, GNUNET_NT_scanner_get_type(), GNUNET_SCHEDULER_add_now(), GNUNET_STATISTICS_set(), GNUNET_TIME_relative_to_absolute(), GNUNET_YES, SenderAddress::hn, is, SenderAddress::key, SenderAddress::nt, reschedule_sender_timeout(), senders, senders_heap, stats, SenderAddress::target, SenderAddress::timeout, and timeout_task.
Referenced by sock_read().
|
static |
Check signature from uc against ephemeral.
| ephemeral | key that is signed |
| uc | signature of claimant |
Definition at line 2196 of file gnunet-communicator-udp.c.
References enc, UdpHandshakeSignature::enc, GNUNET_assert, GNUNET_CRYPTO_eddsa_verify, GNUNET_PILS_get_identity(), GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_HANDSHAKE, UdpHandshakeSignature::monotonic_time, my_identity, pils, GNUNET_CRYPTO_SignaturePurpose::purpose, UdpHandshakeSignature::purpose, UdpHandshakeSignature::receiver, UdpHandshakeSignature::sender, GNUNET_CRYPTO_SignaturePurpose::size, and uc.
Referenced by sock_read().
|
static |
Converts address to the address string format used by this communicator in HELLOs.
| address | the address to convert, must be AF_INET or AF_INET6. |
| address_len | number of bytes in address |
Definition at line 2229 of file gnunet-communicator-udp.c.
References address, COMMUNICATOR_ADDRESS_PREFIX, GNUNET_a2s(), GNUNET_asprintf(), GNUNET_assert, and ret.
Referenced by consider_reflexive_address(), create_receiver(), sock_read(), and udp_socket_notify().
|
static |
Definition at line 2258 of file gnunet-communicator-udp.c.
References default_v4_sock, default_v6_sock, receiver(), and udp_sock.
Referenced by mq_send_d(), and send_msg_with_kx().
|
static |
Convert UDP bind specification to a struct sockaddr *
| bindto | bind specification to convert | |
| family | address family to enforce | |
| [out] | sock_len | set to the length of the address |
Definition at line 2285 of file gnunet-communicator-udp.c.
References disable_v6, dummy, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_malloc, GNUNET_memdup, GNUNET_strdup, GNUNET_YES, port, and start.
Referenced by create_receiver(), and create_udp_socket().
|
static |
Socket read task.
| cls | NULL |
Definition at line 2583 of file gnunet-communicator-udp.c.
References SenderAddress::acks_available, address, ah, calculate_cmac(), ch, consider_reflexive_address(), create_receiver(), decrypt_box(), default_v4_sock, default_v6_sock, InitialKX::enc, InitialKX::gcm_tag, GNUNET_a2s(), GNUNET_assert, GNUNET_break_op, GNUNET_CONTAINER_DLL_insert, GNUNET_CONTAINER_multishortmap_get(), GNUNET_CRYPTO_eddsa_verify, GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_log_strerror, GNUNET_memdup, GNUNET_NETWORK_socket_recvfrom(), GNUNET_NO, GNUNET_NT_scanner_get_type(), GNUNET_OK, GNUNET_PILS_get_identity(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_read_net(), GNUNET_sh2s(), GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_BROADCAST, GNUNET_STATISTICS_update(), GNUNET_stop_burst(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_TRANSPORT_application_validate(), GNUNET_TRANSPORT_communicator_burst_finished(), GNUNET_YES, UdpBroadcastSignature::h_address, is, kce_generate_cb(), SenderAddress::kce_send_ack_on_finish, SenderAddress::kce_task, SenderAddress::kce_task_finished, KCN_THRESHOLD, key_cache, UDPBox::kid, GNUNET_BurstMessage::local_port, MAX_SECRETS, my_identity, nt, GNUNET_BurstMessage::peer, pils, GNUNET_PeerIdentity::public_key, purge_secrets(), GNUNET_CRYPTO_SignaturePurpose::purpose, UdpBroadcastSignature::purpose, read_v4_task, read_v6_task, secret_destroy(), UDPConfirmation::sender, UdpBroadcastSignature::sender, UDPBroadcast::sender, SharedSecret::sender, UDPBroadcast::sender_sig, setup_initial_shared_secret_dec(), setup_sender(), GNUNET_CRYPTO_SignaturePurpose::size, sock_read(), sockaddr_to_udpaddr_string(), stats, try_decrypt(), try_handle_plaintext(), uc, udp_sock, and verify_confirmation().
Referenced by create_receiver(), run(), and sock_read().
|
static |
Definition at line 2417 of file gnunet-communicator-udp.c.
References address, check_timeouts(), COMMUNICATOR_ADDRESS_PREFIX, disable_v6, eddsa_pub_to_hpke_key(), GNUNET_break_op, GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, GNUNET_CONTAINER_heap_insert(), GNUNET_CONTAINER_multihashmap_get(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_multihashmap_size(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CRYPTO_hash_context_finish(), GNUNET_CRYPTO_hash_context_read(), GNUNET_CRYPTO_hash_context_start(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_i2s_full(), GNUNET_log, GNUNET_new, GNUNET_NO, GNUNET_NT_scanner_get_type(), GNUNET_OK, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_read_net(), GNUNET_STATISTICS_set(), GNUNET_SYSERR, GNUNET_TIME_absolute_get(), GNUNET_TIME_relative_to_absolute(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, is, receiver(), receivers, receivers_heap, setup_receiver_mq(), sock_read(), sockaddr_to_udpaddr_string(), stats, timeout_task, udp_address_to_sockaddr(), and udp_sock.
Referenced by consider_reflexive_address(), mq_init(), sock_read(), and udp_socket_notify().
|
static |
Consider the address a datagram from target arrived from as a path we can send to.
The address a peer publishes is the address it believes it has. For a peer behind a NAT that is at best the mapping its NAT happened to have when GNUNET_NAT_register() last looked, and NAT mappings do not survive an idle period anywhere near GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT (Linux netfilter drops an unreplied UDP mapping after 30s, a replied one after 120s). Once it is dropped, the peer's next datagram very possibly gets a different external port, and the published address is dead for good – while we go on sending to it, because nothing here ever looked at where the peer's datagrams actually come from.
Its reflexive address, by contrast, is in every datagram it sends us, and is by construction a mapping that is open right now.
Only call this for a datagram that carried a valid UDPConfirmation signature, so that we know which peer sent it. That signature does not cover the source address, so a replayed datagram can still point us at an address the peer never used. That costs us only the handful of KX datagrams transport spends failing to validate the resulting queue: an address that cannot answer a challenge never becomes usable.
| target | peer that authenticated itself to us |
| address | address the datagram was received from |
| address_len | number of bytes in address |
Definition at line 2552 of file gnunet-communicator-udp.c.
References address, create_receiver(), GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_STATISTICS_update(), sockaddr_to_udpaddr_string(), and stats.
Referenced by sock_read().
|
static |
Pad dgram by pad_size using out_cipher.
| out_cipher | cipher to use |
| dgram | datagram to pad |
| pad_size | number of bytes of padding to append |
Definition at line 2882 of file gnunet-communicator-udp.c.
References GNUNET_assert, GNUNET_CRYPTO_random_block(), GNUNET_MESSAGE_TYPE_COMMUNICATOR_UDP_PAD, and GNUNET_MessageHeader::size.
Referenced by mq_send_d(), and send_msg_with_kx().
|
static |
Definition at line 2903 of file gnunet-communicator-udp.c.
References cfg, do_pad(), UdpHandshakeSignature::enc, InitialKX::enc, InitialKX::gcm_tag, get_socket(), GNUNET_a2s(), GNUNET_assert, GNUNET_break, GNUNET_CRYPTO_eddsa_sign, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_log_strerror, GNUNET_MQ_impl_send_continue(), GNUNET_NETWORK_socket_sendto(), GNUNET_PILS_get_identity(), GNUNET_PILS_key_ring_get_private_key(), GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_HANDSHAKE, GNUNET_TIME_absolute_get_monotonic(), GNUNET_TIME_absolute_hton(), GNUNET_YES, key_ring, SharedSecret::master, MAX_SECRETS, UdpHandshakeSignature::monotonic_time, mq, msg, my_identity, my_private_key, pils, purge_secrets(), GNUNET_CRYPTO_SignaturePurpose::purpose, UdpHandshakeSignature::purpose, receiver(), UdpHandshakeSignature::receiver, receiver_destroy(), reschedule_receiver_timeout(), secret_destroy(), UdpHandshakeSignature::sender, setup_cipher(), setup_initial_shared_secret_ephemeral(), GNUNET_MessageHeader::size, GNUNET_CRYPTO_SignaturePurpose::size, and uc.
Referenced by mq_send_d(), and mq_send_kx().
|
static |
Signature of functions implementing the sending functionality of a message queue.
| mq | the message queue |
| msg | the message to send |
| impl_state | our struct ReceiverAddress |
Definition at line 3014 of file gnunet-communicator-udp.c.
References check_peer_alive(), GNUNET_assert, GNUNET_NO, mq, msg, receiver(), and send_msg_with_kx().
Referenced by setup_receiver_mq().
|
static |
Definition at line 3028 of file gnunet-communicator-udp.c.
References SharedSecret::cmac, UDPRekey::ephemeral, GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_COMMUNICATOR_UDP_REKEY, GNUNET_sh2s(), GNUNET_YES, UDPRekey::header, SharedSecret::master, receiver(), SharedSecret::rekey_initiated, SharedSecret::sequence_allowed, setup_shared_secret_ephemeral(), GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by mq_send_d().
|
static |
Signature of functions implementing the sending functionality of a message queue.
| mq | the message queue |
| msg | the message to send |
| impl_state | our struct ReceiverAddress |
Definition at line 3060 of file gnunet-communicator-udp.c.
References SharedSecret::bytes_sent, check_peer_alive(), create_rekey(), do_pad(), UDPBox::gcm_tag, get_kid(), get_socket(), GNUNET_a2s(), GNUNET_assert, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_i2s(), GNUNET_log, GNUNET_log_strerror, GNUNET_MQ_impl_send_continue(), GNUNET_NETWORK_socket_sendto(), GNUNET_NO, GNUNET_sh2s(), GNUNET_STATISTICS_update(), GNUNET_YES, inject_rekey(), UDPBox::kid, SharedSecret::master, MAX_SECRETS, mq, msg, SharedSecret::prev, purge_secrets(), receiver(), receiver_destroy(), SharedSecret::rekey_initiated, rekey_max_bytes, reschedule_receiver_timeout(), secret_destroy(), send_msg_with_kx(), SharedSecret::sequence_allowed, SharedSecret::sequence_used, setup_cipher(), GNUNET_MessageHeader::size, and stats.
Referenced by setup_receiver_mq().
|
static |
Signature of functions implementing the destruction of a message queue.
Implementations must not free mq, but should take care of impl_state.
| mq | the message queue to destroy |
| impl_state | our struct ReceiverAddress |
Definition at line 3242 of file gnunet-communicator-udp.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_YES, mq, receiver(), and receiver_destroy().
Referenced by setup_receiver_mq().
|
static |
Signature of functions implementing the destruction of a message queue.
Implementations must not free mq, but should take care of impl_state.
| mq | the message queue to destroy |
| impl_state | our struct ReceiverAddress |
Definition at line 3265 of file gnunet-communicator-udp.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_YES, mq, receiver(), and receiver_destroy().
Referenced by setup_receiver_mq().
|
static |
Implementation function that cancels the currently sent message.
| mq | message queue |
| impl_state | our struct RecvierAddress |
Definition at line 3286 of file gnunet-communicator-udp.c.
References GNUNET_assert.
Referenced by setup_receiver_mq().
|
static |
Generic error handler, called with the appropriate error code and the same closure specified at the creation of the message queue.
Not every message queue implementation supports an error handler.
| cls | our struct ReceiverAddress |
| error | error code |
Definition at line 3303 of file gnunet-communicator-udp.c.
References GNUNET_ERROR_TYPE_ERROR, GNUNET_i2s(), GNUNET_log, receiver(), and receiver_destroy().
Referenced by setup_receiver_mq().
|
static |
Function called by the transport service to initialize a message queue given address information about another peer.
If and when the communication channel is established, the communicator must call GNUNET_TRANSPORT_communicator_mq_add() to notify the service that the channel is now up. It is the responsibility of the communicator to manage sane retries and timeouts for any peer/address combination provided by the transport service. Timeouts and retries do not need to be signalled to the transport service.
| cls | closure |
| peer | identity of the other peer |
| address | where to send the message, human-readable communicator-specific format, 0-terminated, UTF-8 |
Definition at line 3404 of file gnunet-communicator-udp.c.
References address, create_receiver(), GNUNET_ERROR_TYPE_DEBUG, and GNUNET_log.
Referenced by run().
|
static |
Iterator over all receivers to clean up.
| cls | NULL |
| target | unused |
| value | the queue to destroy |
Definition at line 3424 of file gnunet-communicator-udp.c.
References GNUNET_OK, receiver(), receiver_destroy(), ReceiverAddress::target, and value.
Referenced by do_shutdown().
|
static |
Iterator over all senders to clean up.
| cls | NULL |
| target | unused |
| value | the queue to destroy |
Definition at line 3446 of file gnunet-communicator-udp.c.
References GNUNET_OK, sender_destroy(), SenderAddress::target, and value.
Referenced by do_shutdown().
|
static |
Shutdown the UNIX communicator.
| cls | NULL (always) |
Definition at line 3467 of file gnunet-communicator-udp.c.
References ah, bi_destroy(), bi_head, broadcast_task, ch, default_v4_sock, default_v6_sock, get_receiver_delete_it(), get_sender_delete_it(), GNUNET_break, GNUNET_CONTAINER_heap_destroy(), GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_CONTAINER_multishortmap_destroy(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NAT_unregister(), GNUNET_NETWORK_socket_close(), GNUNET_NT_scanner_done(), GNUNET_OK, GNUNET_PILS_destroy_key_ring(), GNUNET_PILS_disconnect(), GNUNET_SCHEDULER_cancel(), GNUNET_STATISTICS_destroy(), GNUNET_stop_burst(), GNUNET_TRANSPORT_application_done(), GNUNET_TRANSPORT_communicator_address_remove_all(), GNUNET_TRANSPORT_communicator_disconnect(), GNUNET_YES, is, key_cache, key_ring, nat, pils, read_v4_task, read_v6_task, receivers, receivers_heap, senders, senders_heap, stats, and timeout_task.
|
static |
Function called when the transport service has received a backchannel message for this communicator (!) via a different return path.
Should be an acknowledgement.
| cls | closure, NULL |
| sender | which peer sent the notification |
| msg | payload |
Definition at line 3573 of file gnunet-communicator-udp.c.
References ai, GNUNET_break_op, GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s_full(), GNUNET_log, GNUNET_MESSAGE_TYPE_COMMUNICATOR_UDP_ACK, handle_ack_by_sender(), msg, receivers, AckInfo::sender, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by run().
|
static |
Signature of the callback passed to GNUNET_NAT_register() for a function to call whenever our set of 'valid' addresses changes.
| cls | closure |
| app_ctx[in,out] | location where the app can store stuff on add and retrieve it on remove |
| add_remove | GNUNET_YES to add a new public IP address, GNUNET_NO to remove a previous (now invalid) one |
| ac | address class the address belongs to |
| addr | either the previous or the new public IP address |
| addrlen | actual length of the addr |
Definition at line 3611 of file gnunet-communicator-udp.c.
References ai, ch, COMMUNICATOR_ADDRESS_PREFIX, GNUNET_a2s(), GNUNET_asprintf(), GNUNET_free, GNUNET_NT_scanner_get_type(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_TRANSPORT_communicator_address_add(), GNUNET_TRANSPORT_communicator_address_remove(), GNUNET_YES, is, and nt.
Referenced by run().
|
static |
Broadcast our presence on one of our interfaces.
| cls | a struct BroadcastInterface |
Definition at line 3653 of file gnunet-communicator-udp.c.
References BroadcastInterface::ba, BroadcastInterface::bcm, BROADCAST_FREQUENCY, BroadcastInterface::broadcast_task, default_v4_sock, default_v6_sock, GNUNET_a2s(), GNUNET_break, GNUNET_CRYPTO_random_u64(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_i2s(), GNUNET_log, GNUNET_log_strerror, GNUNET_NETWORK_socket_sendto(), GNUNET_NETWORK_socket_setsockopt(), GNUNET_OK, GNUNET_SCHEDULER_add_delayed(), ifc_broadcast(), BroadcastInterface::mcreq, my_port, GNUNET_TIME_Relative::rel_value_us, BroadcastInterface::sa, BroadcastInterface::salen, and UDPBroadcast::sender.
Referenced by iface_proc(), and ifc_broadcast().
|
static |
Callback function invoked for each interface found.
Activates/deactivates broadcast interfaces.
| cls | NULL |
| name | name of the interface (can be NULL for unknown) |
| isDefault | is this presumably the default interface |
| addr | address of this interface (can be NULL for unknown or unassigned) |
| broadcast_addr | the broadcast address (can be NULL for unknown or unassigned) |
| netmask | the network mask (can be NULL for unknown or unassigned) |
| addrlen | length of the address |
Definition at line 3746 of file gnunet-communicator-udp.c.
References BroadcastInterface::ba, BroadcastInterface::bcm, bi_head, bi_tail, BroadcastInterface::broadcast_task, default_v6_sock, BroadcastInterface::found, GNUNET_a2s(), GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_eddsa_sign, GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_log_strerror, GNUNET_memdup, GNUNET_NETWORK_socket_setsockopt(), GNUNET_new, GNUNET_NT_LOOPBACK, GNUNET_NT_scanner_get_type(), GNUNET_OK, GNUNET_PILS_get_identity(), GNUNET_PILS_key_ring_get_private_key(), GNUNET_SCHEDULER_add_now(), GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_BROADCAST, GNUNET_YES, UdpBroadcastSignature::h_address, ifc_broadcast(), is, key_ring, BroadcastInterface::mcreq, my_identity, my_private_key, BroadcastInterface::next, pils, GNUNET_CRYPTO_SignaturePurpose::purpose, UdpBroadcastSignature::purpose, BroadcastInterface::sa, BroadcastInterface::salen, UdpBroadcastSignature::sender, UDPBroadcast::sender, UDPBroadcast::sender_sig, and GNUNET_CRYPTO_SignaturePurpose::size.
Referenced by do_broadcast().
|
static |
Scan interfaces to broadcast our presence on the LAN.
| cls | NULL, unused |
Definition at line 3864 of file gnunet-communicator-udp.c.
References bi_destroy(), bi_head, broadcast_task, do_broadcast(), BroadcastInterface::found, GNUNET_NO, GNUNET_OS_network_interfaces_list(), GNUNET_SCHEDULER_add_delayed(), iface_proc(), INTERFACE_SCAN_FREQUENCY, and BroadcastInterface::next.
Referenced by do_broadcast(), and run().
|
static |
Definition at line 3885 of file gnunet-communicator-udp.c.
References GNUNET_ERROR_TYPE_INFO, and GNUNET_log.
Referenced by run().
|
static |
Definition at line 3896 of file gnunet-communicator-udp.c.
References GNUNET_UdpSocketInfo::actual_address, address, ch, create_receiver(), default_v4_sock, default_v6_sock, GNUNET_free, GNUNET_TRANSPORT_communicator_burst_finished(), GNUNET_UdpSocketInfo::pid, sockaddr_to_udpaddr_string(), and GNUNET_UdpSocketInfo::udp_sock.
Referenced by start_burst().
|
static |
Definition at line 3913 of file gnunet-communicator-udp.c.
References GNUNET_UdpSocketInfo::address, GNUNET_UdpSocketInfo::bind_address, burst_task, default_v4_sock, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_get_udp_socket(), GNUNET_log, GNUNET_memcpy, GNUNET_new, GNUNET_stop_burst(), GNUNET_strdup, GNUNET_YES, GNUNET_UdpSocketInfo::has_port, my_ipv4, my_port, GNUNET_UdpSocketInfo::pid, GNUNET_TIME_Relative::rel_value_us, GNUNET_UdpSocketInfo::rtt, GNUNET_UdpSocketInfo::std_port, GNUNET_UdpSocketInfo::udp_sock, and udp_socket_notify().
Referenced by reconnect(), and run().
|
static |
Definition at line 3948 of file gnunet-communicator-udp.c.
References GNUNET_a2s(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_log_strerror, GNUNET_log_strerror_file, GNUNET_malloc, GNUNET_NETWORK_get_fd(), GNUNET_NETWORK_socket_bind(), GNUNET_NETWORK_socket_close(), GNUNET_NETWORK_socket_create(), GNUNET_OK, and udp_address_to_sockaddr().
Referenced by run().
|
static |
Definition at line 4031 of file gnunet-communicator-udp.c.
References GNUNET_free, and GNUNET_SCHEDULER_shutdown().
Referenced by run().
|
static |
Definition at line 4042 of file gnunet-communicator-udp.c.
References ah, broadcast_task, cfg, ch, COMMUNICATOR_ADDRESS_PREFIX, COMMUNICATOR_CONFIG_SECTION, create_udp_socket(), DEFAULT_REKEY_MAX_BYTES, DEFAULT_REKEY_TIME_INTERVAL, default_v4_sock, default_v6_sock, disable_v6, do_broadcast(), do_shutdown, enc_notify_cb(), GNUNET_a2s(), GNUNET_assert, GNUNET_break, GNUNET_CONFIGURATION_get_value_size(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_CONFIGURATION_get_value_time(), GNUNET_CONFIGURATION_get_value_yesno(), GNUNET_CONTAINER_heap_create(), GNUNET_CONTAINER_HEAP_ORDER_MIN, GNUNET_CONTAINER_multihashmap_create(), GNUNET_CONTAINER_multishortmap_create(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_log, GNUNET_log_config_missing(), GNUNET_log_from_nocheck(), GNUNET_malloc, GNUNET_NAT_register(), GNUNET_NETWORK_test_pf(), GNUNET_NO, GNUNET_NT_scanner_init(), GNUNET_OK, GNUNET_PILS_connect(), GNUNET_PILS_create_key_ring(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_read_net(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_STATISTICS_create(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_TRANSPORT_application_init(), GNUNET_TRANSPORT_CC_UNRELIABLE, GNUNET_TRANSPORT_communicator_connect(), GNUNET_YES, is, key_cache, key_ring, mq_init(), my_ipv4, my_port, nat, nat_address_cb(), pils, read_v4_task, read_v6_task, receivers, receivers_heap, rekey_interval, rekey_max_bytes, senders, senders_heap, shutdown_run(), sock_read(), start_burst(), stats, and try_connection_reversal().
|
static |
For PILS.
Definition at line 782 of file gnunet-communicator-udp.c.
Referenced by do_shutdown(), iface_proc(), run(), send_msg_with_kx(), setup_initial_shared_secret_dec(), and setup_shared_secret_dec().
|
static |
For PILS.
Definition at line 787 of file gnunet-communicator-udp.c.
Referenced by do_shutdown(), iface_proc(), run(), send_msg_with_kx(), sock_read(), and verify_confirmation().
|
static |
|
static |
How often we do rekey based on number of bytes transmitted.
Definition at line 797 of file gnunet-communicator-udp.c.
Referenced by decrypt_box(), mq_send_d(), and run().
|
static |
Cache of pre-generated key IDs.
Definition at line 802 of file gnunet-communicator-udp.c.
Referenced by do_shutdown(), kce_destroy(), kce_generate(), run(), secret_destroy(), and sock_read().
|
static |
ID of read IPv4 task.
Definition at line 807 of file gnunet-communicator-udp.c.
Referenced by do_shutdown(), run(), and sock_read().
|
static |
ID of read IPv6 task.
Definition at line 812 of file gnunet-communicator-udp.c.
Referenced by do_shutdown(), run(), and sock_read().
|
static |
ID of timeout task.
Definition at line 817 of file gnunet-communicator-udp.c.
Referenced by check_timeouts(), create_receiver(), do_shutdown(), and setup_sender().
|
static |
ID of master broadcast task.
Definition at line 822 of file gnunet-communicator-udp.c.
Referenced by do_broadcast(), do_shutdown(), and run().
|
static |
For logging statistics.
Definition at line 827 of file gnunet-communicator-udp.c.
Referenced by check_peer_alive(), consider_reflexive_address(), create_receiver(), decrypt_box(), do_shutdown(), kce_generate(), mq_send_d(), pass_plaintext_to_core(), receiver_destroy(), run(), secret_destroy(), sender_destroy(), setup_initial_shared_secret_ephemeral(), setup_sender(), setup_shared_secret_ephemeral(), sock_read(), try_decrypt(), and try_handle_plaintext().
|
static |
Our environment.
Definition at line 832 of file gnunet-communicator-udp.c.
Referenced by add_acks(), consider_ss_ack(), do_shutdown(), nat_address_cb(), pass_plaintext_to_core(), run(), setup_receiver_mq(), sock_read(), and udp_socket_notify().
|
static |
Receivers (map from peer identity to struct ReceiverAddress)
Definition at line 837 of file gnunet-communicator-udp.c.
Referenced by create_receiver(), do_shutdown(), enc_notify_cb(), receiver_destroy(), run(), and try_handle_plaintext().
|
static |
Senders (map from peer identity to struct SenderAddress)
Definition at line 842 of file gnunet-communicator-udp.c.
Referenced by do_shutdown(), run(), sender_destroy(), and setup_sender().
|
static |
Expiration heap for senders (contains struct SenderAddress)
Definition at line 847 of file gnunet-communicator-udp.c.
Referenced by check_timeouts(), do_shutdown(), run(), and setup_sender().
|
static |
Expiration heap for receivers (contains struct ReceiverAddress)
Definition at line 852 of file gnunet-communicator-udp.c.
Referenced by check_timeouts(), create_receiver(), do_shutdown(), and run().
|
static |
Broadcast interface tasks.
Kept in a DLL.
Definition at line 857 of file gnunet-communicator-udp.c.
Referenced by bi_destroy(), do_broadcast(), do_shutdown(), and iface_proc().
|
static |
Broadcast interface tasks.
Kept in a DLL.
Definition at line 862 of file gnunet-communicator-udp.c.
Referenced by bi_destroy(), and iface_proc().
|
static |
Our IPv4 socket.
Definition at line 867 of file gnunet-communicator-udp.c.
Referenced by do_shutdown(), get_socket(), ifc_broadcast(), run(), sock_read(), start_burst(), and udp_socket_notify().
|
static |
Our IPv6 socket.
Definition at line 872 of file gnunet-communicator-udp.c.
Referenced by bi_destroy(), do_shutdown(), get_socket(), iface_proc(), ifc_broadcast(), run(), sock_read(), and udp_socket_notify().
|
static |
Our configuration.
Definition at line 877 of file gnunet-communicator-udp.c.
Referenced by run(), and send_msg_with_kx().
|
static |
Our handle to report addresses for validation to TRANSPORT.
Definition at line 882 of file gnunet-communicator-udp.c.
Referenced by do_shutdown(), run(), and sock_read().
|
static |
Network scanner to determine network types.
Definition at line 887 of file gnunet-communicator-udp.c.
Referenced by create_receiver(), do_shutdown(), iface_proc(), nat_address_cb(), run(), setup_sender(), and sock_read().
|
static |
Connection to NAT service.
Definition at line 892 of file gnunet-communicator-udp.c.
Referenced by do_shutdown(), and run().
|
static |
Port number to which we are actually bound.
Definition at line 897 of file gnunet-communicator-udp.c.
Referenced by ifc_broadcast(), run(), and start_burst().
| char* my_ipv4 |
Our ipv4 address.
Definition at line 902 of file gnunet-communicator-udp.c.
Referenced by run(), and start_burst().
|
static |
IPv6 disabled or not.
Definition at line 907 of file gnunet-communicator-udp.c.
Referenced by create_receiver(), run(), and udp_address_to_sockaddr().
|
static |
Definition at line 909 of file gnunet-communicator-udp.c.
Referenced by start_burst().