Implementation of the UDP transport protocol. More...
#include "platform.h"
#include "gnunet_hello_lib.h"
#include "gnunet_util_lib.h"
#include "gnunet_fragmentation_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_resolver_service.h"
#include "gnunet_signatures.h"
#include "gnunet_constants.h"
#include "gnunet_statistics_service.h"
#include "gnunet_transport_service.h"
#include "gnunet_transport_plugin.h"
#include "transport.h"
Go to the source code of this file.
Data Structures | |
struct | IPv4UdpAddress |
Network format for IPv4 addresses. More... | |
struct | IPv6UdpAddress |
Network format for IPv6 addresses. More... | |
union | UdpAddress |
Either an IPv4 or IPv6 UDP address. More... | |
struct | Plugin |
Handle for a plugin. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "transport-udp", __VA_ARGS__) |
#define | PLUGIN_NAME "udp" |
#define | DEBUG_UDP GNUNET_NO |
#define | DEBUG_UDP_BROADCASTING GNUNET_NO |
#define | UDP_MTU 1400 |
MTU for fragmentation subsystem. More... | |
Functions | |
const char * | udp_address_to_string (void *cls, const void *addr, size_t addrlen) |
Function called for a quick conversion of the binary address to a numeric address. More... | |
void | udp_broadcast_receive (struct Plugin *plugin, const char *buf, ssize_t size, const union UdpAddress *udp_addr, size_t udp_addr_len, enum GNUNET_NetworkType network_type) |
We received a broadcast message. More... | |
void | setup_broadcast (struct Plugin *plugin, struct sockaddr_in6 *server_addrv6, struct sockaddr_in *server_addrv4) |
Setup broadcasting subsystem. More... | |
void | stop_broadcast (struct Plugin *plugin) |
Stop broadcasting subsystem. More... | |
Implementation of the UDP transport protocol.
Definition in file plugin_transport_udp.h.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "transport-udp", __VA_ARGS__) |
Definition at line 44 of file plugin_transport_udp.h.
#define PLUGIN_NAME "udp" |
Definition at line 46 of file plugin_transport_udp.h.
#define DEBUG_UDP GNUNET_NO |
Definition at line 48 of file plugin_transport_udp.h.
#define DEBUG_UDP_BROADCASTING GNUNET_NO |
Definition at line 50 of file plugin_transport_udp.h.
#define UDP_MTU 1400 |
MTU for fragmentation subsystem.
Should be conservative since all communicating peers MUST work with this MTU.
Definition at line 56 of file plugin_transport_udp.h.
const char* udp_address_to_string | ( | void * | cls, |
const void * | addr, | ||
size_t | addrlen | ||
) |
Function called for a quick conversion of the binary address to a numeric address.
Note that the caller must not free the address and that the next call to this function is allowed to override the address again.
cls | closure |
addr | binary address (a union UdpAddress ) |
addrlen | length of the addr |
Definition at line 864 of file plugin_transport_udp.c.
References buf, GNUNET_break_op, GNUNET_snprintf(), options, PLUGIN_NAME, port, t4, and t6.
Referenced by ack_proc(), broadcast_mst_cb(), libgnunet_plugin_transport_udp_init(), read_process_ack(), read_process_fragment(), udp_disconnect_session(), udp_plugin_create_session(), udp_plugin_lookup_session(), and udp_plugin_send().
void udp_broadcast_receive | ( | struct Plugin * | plugin, |
const char * | buf, | ||
ssize_t | size, | ||
const union UdpAddress * | udp_addr, | ||
size_t | udp_addr_len, | ||
enum GNUNET_NetworkType | network_type | ||
) |
We received a broadcast message.
Process it and all subsequent messages in the same packet.
plugin | the UDP plugin |
buf | the buffer with the message(s) |
size | number of bytes in buf |
udp_addr | address of the sender |
udp_addr_len | number of bytes in udp_addr |
network_type | network type of the sender's address |
Definition at line 187 of file plugin_transport_udp_broadcasting.c.
References broadcast_mst_cb(), buf, GNUNET_MST_create(), GNUNET_MST_destroy(), GNUNET_MST_from_buffer(), GNUNET_NO, mc, plugin, size, MstContext::udp_addr, and MstContext::udp_addr_len.
Referenced by udp_select_read().
void setup_broadcast | ( | struct Plugin * | plugin, |
struct sockaddr_in6 * | server_addrv6, | ||
struct sockaddr_in * | server_addrv4 | ||
) |
Setup broadcasting subsystem.
plugin | |
server_addrv6 | |
server_addrv4 |
Definition at line 542 of file plugin_transport_udp_broadcasting.c.
References _, GNUNET_assert, GNUNET_CONFIGURATION_get_value_yesno(), GNUNET_ERROR_TYPE_WARNING, GNUNET_NETWORK_socket_setsockopt(), GNUNET_OK, GNUNET_OS_network_interfaces_list(), GNUNET_YES, iface_proc(), LOG, and plugin.
Referenced by libgnunet_plugin_transport_udp_init().
void stop_broadcast | ( | struct Plugin * | plugin | ) |
Stop broadcasting subsystem.
plugin |
Definition at line 595 of file plugin_transport_udp_broadcasting.c.