36 #include "gnunet_signatures.h"
91 #define PONG_SIGNATURE_LIFETIME GNUNET_TIME_relative_multiply ( \
92 GNUNET_TIME_UNIT_HOURS, 1)
99 #define HELLO_ADDRESS_EXPIRATION GNUNET_TIME_relative_multiply ( \
100 GNUNET_TIME_UNIT_HOURS, 12)
108 #define UNVALIDATED_PING_KEEPALIVE GNUNET_TIME_relative_multiply ( \
109 GNUNET_TIME_UNIT_MINUTES, 5)
116 #define VALIDATED_PING_FREQUENCY GNUNET_TIME_relative_multiply ( \
117 GNUNET_TIME_UNIT_MINUTES, 15)
122 #define CONNECTED_PING_FREQUENCY GNUNET_TIME_relative_multiply ( \
123 GNUNET_TIME_UNIT_MINUTES, 2)
128 #define ACCEPTABLE_PING_DELAY GNUNET_TIME_relative_multiply ( \
129 GNUNET_TIME_UNIT_SECONDS, 1)
134 #define VALIDATION_MAP_SIZE 256
139 #define PING_PRIORITY 2
144 #define PONG_PRIORITY 4
531 "# address records discarded (timeout)"),
574 "Blacklist denies sending PING to `%s' `%s' `%s'\n",
580 "# address records discarded (blacklist)"),
591 hsize = ntohs (hello->
size);
593 + ve->
address->address_length + slen + hsize;
634 "Failed to get session to send PING to `%s' at `%s'\n",
648 "Failed to send PING to `%s' at `%s'\n",
654 "Transmitted plain PING to `%s' `%s' `%s'\n",
670 "# PINGs for address validation sent"),
676 "Validation started, %u validation processes running\n",
728 "Waiting for %s longer before (re)validating address `%s'\n",
746 "Validations blocked for another %s, delaying validating address `%s'\n",
752 "# validations delayed by global throttle"),
777 "Validating now, next scheduled for %s, now validating address `%s'\n",
832 if (NULL != (ve = vemc.
ve))
904 "Address with %u bytes for plugin %s and peer %s is malformed\n",
905 (
unsigned int)
address->address_length,
920 "Starting revalidations for valid address `%s'\n",
927 memset (&prop, 0,
sizeof(prop));
967 "Handling HELLO for peer `%s'\n",
1004 "Validation uses a fast start threshold of %u connections and a delay of %s\n",
1055 "Plugin %s not supported, cannot send PONG\n",
1062 if (NULL == session)
1068 papi->
send (papi->
cls, session,
1069 (
const char *)
pong,
1070 ntohs (
pong->header.size),
1101 const char *addrend;
1121 memcmp (&
ping->target,
1127 (
"# PING message for different peer received"),
1135 addr = (
const char *) &
ping[1];
1141 sig_cache_exp = NULL;
1143 if (len_address > 0)
1145 addrend = memchr (addr,
'\0', len_address);
1146 if (NULL == addrend)
1152 len_plugin = strlen (addr) + 1;
1153 len_address -= len_plugin;
1156 address.address_length = len_address;
1157 address.transport_name = addr;
1160 if (NULL ==
address.transport_name)
1165 if (0 != strstr (
address.transport_name,
"_client"))
1180 "Plugin `%s' not available, cannot confirm having this address\n"),
1193 (
"# failed address checks during validation"),
1198 "Address `%s' is not one of my addresses, not confirming PING\n"),
1207 "# successful address checks during validation"),
1211 "Address `%s' is one of my addresses, confirming PING\n",
1222 "Not confirming PING from peer `%s' with address `%s' since I cannot confirm having this address.\n"),
1235 sig_cache = &no_address_signature;
1236 sig_cache_exp = &no_address_signature_expiration;
1240 "I am `%s', sending PONG to peer `%s'\n",
1252 pong->purpose.size =
1255 + len_address + len_plugin);
1258 pong->addrlen = htonl (len_address + len_plugin);
1260 if (len_address > 0)
1270 "Creating PONG signature to indicate ownership.\n");
1279 _ (
"Failed to create PONG signature for peer `%s'\n"),
1287 pong->signature = *sig_cache;
1301 if (NULL == session)
1305 if (NULL == session)
1313 (
const char *)
pong,
1314 ntohs (
pong->header.size),
1326 "Transmitted PONG to `%s' via reliable mechanism\n",
1331 (
"# PONGs unicast via reliable transport"), 1,
1340 (
"# PONGs multicast to all available addresses"),
1366 "No plugin available for %s\n",
1374 "Validation process started for fresh address `%s' of %s\n",
1382 "Validation already running for address `%s' of %s\n",
1406 "Skipping expired address from HELLO\n");
1483 tname = (
const char *) &
pong[1];
1485 addr = memchr (tname,
'\0',
size);
1492 slen = strlen (tname) + 1;
1507 address.transport_name = tname;
1515 "# PONGs dropped, no matching pending validation"),
1533 (
"# PONGs dropped, signature expired"), 1,
1572 "Failed to verify: invalid signature on address `%s':%s from peer `%s'\n",
1585 "Validation process successful for peer `%s' with plugin `%s' address `%s'\n",
1611 memset (&prop, 0,
sizeof(prop));
1631 "Validation finished, %u validation processes running\n",
1694 "Validation received our own HELLO (%s), ignoring\n",
1699 "Validation received HELLO message for peer `%s' with size %u, checking for new addresses\n",
1701 ntohs (hello->
size));
#define GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN
Signature for confirming that this peer uses a particular address.
#define gettext_noop(String)
static char * expiration
Credential TTL.
static int ret
Return value of the commandline.
static void pong(struct GNUNET_CADET_Channel *channel, const struct CadetPingMessage *ping)
Reply with a pong to origin.
static void ping(void *cls)
Send a ping to destination.
static char * address
GNS address for this phone.
struct GNUNET_HashCode key
The key used in the DHT.
static char * value
Value of the record to add/remove.
enum State state
current state of profiling
static int result
Global testing status.
static struct GNUNET_TIME_Relative delay
When should dkg communication start?
static char * plugin_name
Name of our plugin.
static struct GNUNET_PeerIdentity GST_my_identity
Our public key.
static struct GNUNET_CRYPTO_EddsaPrivateKey * GST_my_private_key
Our private key.
static const struct GNUNET_CONFIGURATION_Handle * GST_cfg
Configuration handle.
static struct GNUNET_STATISTICS_Handle * GST_stats
Statistics handle.
void GST_blacklist_test_cancel(struct GST_BlacklistCheck *bc)
Cancel a blacklist check.
struct GST_BlacklistCheck * GST_blacklist_test_allowed(const struct GNUNET_PeerIdentity *peer, const char *transport_name, GST_BlacklistTestContinuation cont, void *cont_cls, const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session)
Test if a peer/transport combination is blacklisted.
struct GNUNET_PEERINFO_Handle * GST_peerinfo
Handle to peerinfo service.
void GST_ats_new_session(const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session)
Notify ATS about a new session now existing for the given address.
void GST_ats_add_address(const struct GNUNET_HELLO_Address *address, const struct GNUNET_ATS_Properties *prop)
Notify ATS about a new address including the network the address is located in.
int GST_ats_is_known_no_session(const struct GNUNET_HELLO_Address *address)
Test if ATS knows about this address.
void GST_ats_update_delay(const struct GNUNET_HELLO_Address *address, struct GNUNET_TIME_Relative delay)
Notify ATS about delay changes to properties of an address.
void GST_ats_expire_address(const struct GNUNET_HELLO_Address *address)
Notify ATS that the address has expired and thus cannot be used any longer.
interfacing between transport and ATS service
int GST_hello_test_address(const struct GNUNET_HELLO_Address *address, struct GNUNET_CRYPTO_EddsaSignature **sig, struct GNUNET_TIME_Absolute **sig_expiration)
Test if a particular address is one of ours.
const struct GNUNET_MessageHeader * GST_hello_get()
Obtain this peers HELLO message.
void GST_neighbours_notify_data_sent(const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session, size_t size)
Track information about data we transmitted using the given address and session (used to notify ATS a...
neighbour manipulation API, allows manipulation of performance metrics (delay and towards ATS)
struct GNUNET_TRANSPORT_PluginFunctions * GST_plugins_find(const char *name)
Obtain the plugin API based on a plugin name.
const char * GST_plugins_a2s(const struct GNUNET_HELLO_Address *address)
Convert a given address to a human-readable format.
#define CONNECTED_PING_FREQUENCY
How often do we PING an address that we are currently using?
static void transmit_ping_if_allowed(void *cls, const struct GNUNET_PeerIdentity *pid, const struct GNUNET_HELLO_Address *address_null, struct GNUNET_ATS_Session *session_null, int result)
Function called with the result from blacklisting.
int GST_validation_handle_ping(const struct GNUNET_PeerIdentity *sender, const struct GNUNET_MessageHeader *hdr, const struct GNUNET_HELLO_Address *sender_address, struct GNUNET_ATS_Session *session)
We've received a PING.
static ssize_t add_valid_peer_address(void *cls, size_t max, void *buf)
Add the validated peer address to the HELLO.
int GST_validation_handle_hello(const struct GNUNET_MessageHeader *hello)
We've received a HELLO, check which addresses are new and trigger validation.
#define PING_PRIORITY
Priority to use for PINGs.
static void publish_ve_stat_update()
Provide an update on the validation_map map size to statistics.
#define PONG_PRIORITY
Priority to use for PONGs.
static int cleanup_validation_entry(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Iterate over validation entries and free them.
GNUNET_TRANSPORT_ValidationState
Current state of a validation process.
@ GNUNET_TRANSPORT_VS_TIMEOUT
Timeout for validation entry.
@ GNUNET_TRANSPORT_VS_REMOVE
Validation entry is removed.
@ GNUNET_TRANSPORT_VS_UPDATE
Updated validation entry.
@ GNUNET_TRANSPORT_VS_NONE
Undefined state.
@ GNUNET_TRANSPORT_VS_NEW
Fresh validation entry.
static struct GNUNET_TIME_Relative validation_delay
Minimum delay between to validations.
static int iterate_addresses(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Call the callback in the closure for each validation entry.
static void revalidate_address(void *cls)
Do address validation again to keep address valid.
void GST_validation_start(unsigned int max_fds)
Start the validation subsystem.
#define VALIDATION_MAP_SIZE
Size of the validation map hashmap.
static struct GNUNET_PEERINFO_NotifyContext * pnc
Context for peerinfo iteration.
static int validate_address_iterator(void *cls, const struct GNUNET_HELLO_Address *address, struct GNUNET_TIME_Absolute expiration)
Iterator callback to go over all addresses and try to validate them (unless blocked or already valida...
void GST_validation_handle_address(const struct GNUNET_HELLO_Address *address)
Validate an individual address.
static void multicast_pong(void *cls, struct GNUNET_TIME_Absolute valid_until, struct GNUNET_TIME_Absolute validation_block, const struct GNUNET_HELLO_Address *address)
Send the given PONG to the given address.
#define UNVALIDATED_PING_KEEPALIVE
How often do we allow PINGing an address that we have not yet validated? This also determines how lon...
#define PONG_SIGNATURE_LIFETIME
How long is a PONG signature valid? We'll recycle a signature until 1/4 of this time is remaining.
void GST_validation_get_addresses(const struct GNUNET_PeerIdentity *target, GST_ValidationAddressCallback cb, void *cb_cls)
Call the given function for each address for the given target.
void GST_validation_set_address_use(const struct GNUNET_HELLO_Address *address, int in_use)
Update if we are using an address for a connection actively right now.
void GST_validation_stop()
Stop the validation subsystem.
static int add_valid_address(void *cls, const struct GNUNET_HELLO_Address *address, struct GNUNET_TIME_Absolute expiration)
Iterator which adds the given address to the set of validated addresses.
static int validation_entry_match(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Iterate over validation entries until a matching one is found.
#define VALIDATED_PING_FREQUENCY
How often do we PING an address that we have successfully validated in the past but are not actively ...
#define HELLO_ADDRESS_EXPIRATION
After how long do we expire an address in a HELLO that we just validated? This value is also used for...
static struct ValidationEntry * find_validation_entry(const struct GNUNET_HELLO_Address *address)
Find a ValidationEntry entry for the given neighbour that matches the given address and transport.
int GST_validation_handle_pong(const struct GNUNET_PeerIdentity *sender, const struct GNUNET_MessageHeader *hdr)
We've received a PONG.
#define ACCEPTABLE_PING_DELAY
How much delay is acceptable for sending the PING or PONG?
static void validation_entry_changed(struct ValidationEntry *ve, enum GNUNET_TRANSPORT_ValidationState state)
A validation entry changed.
static struct GNUNET_CONTAINER_MultiPeerMap * validation_map
Map of PeerIdentities to 'struct ValidationEntry*'s (addresses of the given peer that we are currentl...
static void timeout_hello_validation(void *cls)
Address validation cleanup task.
static unsigned int validations_fast_start_threshold
Validition fast start threshold.
static unsigned int validations_running
Number of validations running; any PING that was not yet matched by a PONG and for which we have not ...
static void process_peerinfo_hello(void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Message *hello, const char *err_msg)
Function called for any HELLO known to PEERINFO.
static struct GNUNET_TIME_Absolute validation_next
When is next validation allowed.
void(* GST_ValidationAddressCallback)(void *cls, struct GNUNET_TIME_Absolute valid_until, struct GNUNET_TIME_Absolute validation_block, const struct GNUNET_HELLO_Address *address)
Function called for each address (or address status change) that the validation module is aware of (f...
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
Automatic transport selection and outbound bandwidth determination.
Helper library for handling HELLOs.
Maintain the list of currently known hosts.
#define GNUNET_MAX_MESSAGE_SIZE
Largest supported message (to be precise, one byte more than the largest possible message,...
#define GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT
After how long do we consider a connection to a peer dead if we don't receive messages from the peer?
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_sign_(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, struct GNUNET_CRYPTO_EddsaSignature *sig)
EdDSA sign a given block.
uint32_t GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i)
Produce a random value.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_verify_(uint32_t purpose, const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, const struct GNUNET_CRYPTO_EddsaSignature *sig, const struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Verify EdDSA signature.
@ GNUNET_CRYPTO_QUALITY_WEAK
No good quality of the operation is needed (i.e., random numbers can be pseudo-random).
@ GNUNET_CRYPTO_QUALITY_NONCE
Randomness for IVs etc.
void GNUNET_CONTAINER_multipeermap_destroy(struct GNUNET_CONTAINER_MultiPeerMap *map)
Destroy a hash map.
int GNUNET_CONTAINER_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
struct GNUNET_CONTAINER_MultiPeerMap * GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
int GNUNET_CONTAINER_multipeermap_get_multiple(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map that match a particular key.
unsigned int GNUNET_CONTAINER_multipeermap_size(const struct GNUNET_CONTAINER_MultiPeerMap *map)
Get the number of key-value pairs in the map.
int GNUNET_CONTAINER_multipeermap_put(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multipeermap_remove(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, const void *value)
Remove the given key-value pair from the map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
int GNUNET_HELLO_get_id(const struct GNUNET_HELLO_Message *hello, struct GNUNET_PeerIdentity *peer)
Get the peer identity from a HELLO message.
struct GNUNET_HELLO_Message * GNUNET_HELLO_create(const struct GNUNET_CRYPTO_EddsaPublicKey *public_key, GNUNET_HELLO_GenerateAddressListCallback addrgen, void *addrgen_cls, int friend_only)
Construct a HELLO message given the public key, expiration time and an iterator that spews the transp...
#define GNUNET_HELLO_address_free(addr)
Free an address.
int GNUNET_HELLO_is_friend_only(const struct GNUNET_HELLO_Message *h)
Return HELLO type.
size_t GNUNET_HELLO_add_address(const struct GNUNET_HELLO_Address *address, struct GNUNET_TIME_Absolute expiration, char *target, size_t max)
Copy the given address information into the given buffer using the format of HELLOs.
struct GNUNET_HELLO_Address * GNUNET_HELLO_address_copy(const struct GNUNET_HELLO_Address *address)
Copy an address struct.
int GNUNET_HELLO_address_check_option(const struct GNUNET_HELLO_Address *address, enum GNUNET_HELLO_AddressInfo option)
Check if an address has a local option set.
struct GNUNET_HELLO_Message * GNUNET_HELLO_iterate_addresses(const struct GNUNET_HELLO_Message *msg, int return_modified, GNUNET_HELLO_AddressIterator it, void *it_cls)
Iterate over all of the addresses in the HELLO.
int GNUNET_HELLO_address_cmp(const struct GNUNET_HELLO_Address *a1, const struct GNUNET_HELLO_Address *a2)
Compare two addresses.
@ GNUNET_HELLO_ADDRESS_INFO_INBOUND
This is an inbound address and cannot be used to initiate an outbound connection to another peer.
@ GNUNET_HELLO_ADDRESS_INFO_NONE
No additional information.
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_log(kind,...)
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
#define GNUNET_ALIGN
gcc-ism to force alignment; we use this to align char-arrays that may then be cast to 'struct's.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_PACKED
gcc-ism to get packed structs.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
const char * GNUNET_i2s_full(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
int GNUNET_snprintf(char *buf, size_t size, const char *format,...) __attribute__((format(printf
Like snprintf, just aborts if the buffer is of insufficient size.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
GNUNET_NetworkType
Types of networks (with separate quotas) we support.
@ GNUNET_NT_UNSPECIFIED
Category of last resort.
struct GNUNET_MQ_Envelope * GNUNET_PEERINFO_add_peer(struct GNUNET_PEERINFO_Handle *h, const struct GNUNET_HELLO_Message *hello, GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls)
Add a host to the persistent list.
struct GNUNET_PEERINFO_NotifyContext * GNUNET_PEERINFO_notify(const struct GNUNET_CONFIGURATION_Handle *cfg, int include_friend_only, GNUNET_PEERINFO_Processor callback, void *callback_cls)
Call a method whenever our known information about peers changes.
void GNUNET_PEERINFO_notify_cancel(struct GNUNET_PEERINFO_NotifyContext *nc)
Stop notifying about changes.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_PONG
Transport PONG message.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_PING
Transport PING message.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
void GNUNET_STATISTICS_set(struct GNUNET_STATISTICS_Handle *handle, const char *name, uint64_t value, int make_persistent)
Set statistic value for the peer.
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_min(struct GNUNET_TIME_Relative t1, struct GNUNET_TIME_Relative t2)
Return the minimum of two relative time values.
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence)
Get the duration of an operation as the difference of the current time and the given start time "henc...
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future)
Given a timestamp in the future, how much time remains until then?
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max(struct GNUNET_TIME_Absolute t1, struct GNUNET_TIME_Absolute t2)
Return the maximum of two absolute time values.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_add(struct GNUNET_TIME_Relative a1, struct GNUNET_TIME_Relative a2)
Add relative times together.
struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel)
Convert relative time to an absolute time in the future.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
#define GNUNET_TIME_UNIT_ZERO_ABS
Absolute time zero.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Divide relative time by a given factor.
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
#define GNUNET_TIME_UNIT_MICROSECONDS
One microsecond, our basic time unit.
static unsigned int size
Size of the "table".
ATS performance characteristics for an address.
struct GNUNET_TIME_Relative delay
Delay.
enum GNUNET_NetworkType scope
Which network scope does the respective address belong to? This property does not change.
Session handle for connections.
struct GNUNET_PeerIdentity sender
To whom are we talking to (set to our identity if we are still waiting for the welcome message)
Internal representation of the hash map.
header of what an ECC signature signs this must be followed by "size - 8" bytes of the actual signed ...
an ECC signature using EdDSA.
An address for communicating with a peer.
const char * transport_name
Name of the transport plugin enabling the communication using this address.
size_t address_length
Number of bytes in address.
struct GNUNET_PeerIdentity peer
For which peer is this an address?
const void * address
Binary representation of the address (plugin-specific).
A HELLO message is used to exchange information about transports with other peers.
Context for the info handler.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_CRYPTO_EddsaPublicKey public_key
Entry in list of pending tasks.
Time for absolute time used by GNUnet, in microseconds and in network byte order.
Time for absolute times used by GNUnet, in microseconds.
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.
Each plugin is required to return a pointer to a struct of this type as the return value from its ent...
void * cls
Closure for all of the callbacks.
GNUNET_TRANSPORT_TransmitFunction send
Function that the transport service will use to transmit data to another peer.
GNUNET_TRANSPORT_GetNetworkTypeForAddress get_network_for_address
Function to obtain the network type for an address.
GNUNET_TRANSPORT_AddressToString address_to_string
Function that will be called to convert a binary address to a string (numeric conversion only).
GNUNET_TRANSPORT_GetNetworkType get_network
Function to obtain the network type for a session.
GNUNET_TRANSPORT_CreateSession get_session
Function that will be called tell the plugin to create a session object.
GNUNET_TRANSPORT_CheckAddress check_address
Function that will be called to check if a binary address for this plugin is well-formed and correspo...
Context we use when performing a blacklist check.
Closure for the neighbours_iterate() function.
void * cb_cls
Closure for cb.
GST_NeighbourIterator cb
Function to call on each connected neighbour.
GST_ValidationAddressCallback cb
Function to call on each address.
Message used to ask a peer to validate receipt (to check an address from a HELLO).
uint32_t challenge
Challenge code (to ensure fresh reply).
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_PING.
struct GNUNET_PeerIdentity target
Who is the intended recipient?
Message used to validate a HELLO.
struct GNUNET_CRYPTO_EddsaSignature signature
Signature.
uint32_t addrlen
Size of address appended to this message (part of what is being signed, hence not redundant).
struct GNUNET_CRYPTO_EccSignaturePurpose purpose
GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN to confirm that this is a plausible address for the signi...
uint32_t challenge
Challenge code from PING (showing freshness).
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_PONG.
struct GNUNET_TIME_AbsoluteNBO expiration
When does this signature expire?
Context for the validation entry match function.
const struct GNUNET_HELLO_Address * address
Address we're interested in.
struct ValidationEntry * ve
Where to store the result?
Information about an address under validation.
struct GNUNET_SCHEDULER_Task * revalidation_task
ID of task that will trigger address revalidation.
struct GNUNET_TIME_Absolute pong_sig_valid_until
Until when is the cached PONG signature valid? ZERO if it is not currently considered valid.
struct GNUNET_TIME_Absolute send_time
At what time did we send the latest validation request (PING)?
struct GNUNET_TIME_Absolute next_validation
At what time do we send the next validation request (PING)?
struct GNUNET_TIME_Absolute revalidation_block
How long until we can try to validate this address again? FOREVER if the address is for an unsupporte...
struct GNUNET_SCHEDULER_Task * timeout_task
ID of task that will clean up this entry if nothing happens.
struct GNUNET_CRYPTO_EddsaSignature pong_sig_cache
Cached PONG signature.
int copied
When passing the address in add_valid_peer_address(), did we copy the address to the HELLO yet?
uint32_t challenge
Challenge number we used.
struct GNUNET_TIME_Absolute valid_until
Until when is this address valid? ZERO if it is not currently considered valid.
struct GNUNET_TIME_Relative latency
Last observed latency for this address (round-trip), delay between last PING sent and PONG received; ...
struct GNUNET_HELLO_Address * address
The address.
int in_use
Are we currently using this address for a connection?
enum GNUNET_TRANSPORT_ValidationState state
Current state of this validation entry.
struct GST_BlacklistCheck * bc
Handle to the blacklist check (if we're currently in it).
int known_to_ats
Is this address known to ATS as valid right now?
int expecting_pong
Are we expecting a PONG message for this validation entry?
enum GNUNET_NetworkType network
Which network type does our address belong to?
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.