39 #define HELLO_REFRESH_PERIOD GNUNET_TIME_relative_multiply ( \
40 GNUNET_TIME_UNIT_HOURS, 6)
191 "Refreshed my %s HELLO, new size is %d\n",
295 ?
"Adding `%s' to the set of our addresses\n"
296 :
"Removing `%s' from the set of our addresses\n",
353 *sig_expiration = NULL;
#define gettext_noop(String)
static int ret
Return value of the commandline.
static char * address
GNS address for this phone.
static struct GNUNET_PeerIdentity GST_my_identity
Our public key.
static struct GNUNET_STATISTICS_Handle * GST_stats
Statistics handle.
struct GNUNET_PEERINFO_Handle * GST_peerinfo
Handle to peerinfo service.
void GST_hello_stop()
Shutdown the HELLO module.
static int friend_option
Should we use a friend-only HELLO?
static struct OwnAddressList * oal_tail
Tail of my addresses.
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.
static ssize_t address_generator(void *cls, size_t max, void *buf)
Add an address from the struct OwnAddressList to the buffer.
void GST_hello_modify_addresses(int addremove, const struct GNUNET_HELLO_Address *address)
Add or remove an address from this peer's HELLO message.
struct GNUNET_TIME_Relative hello_expiration
Hello address expiration.
static GST_HelloCallback hello_cb
Function to call on HELLO changes.
void GST_hello_start(int friend_only, GST_HelloCallback cb, void *cb_cls)
Initialize the HELLO module.
static struct GNUNET_SCHEDULER_Task * hello_task
Identifier of refresh_hello_task().
static struct GNUNET_HELLO_Message * our_hello
Our HELLO message.
static void refresh_hello()
Schedule task to refresh hello (but only if such a task exists already, as otherwise the module might...
#define HELLO_REFRESH_PERIOD
How often do we refresh our HELLO (due to expiration concerns)?
static void refresh_hello_task(void *cls)
Construct our HELLO message from all of the addresses of all of the transports.
static void * hello_cb_cls
Closure for hello_cb.
static struct OwnAddressList * oal_head
Head of my addresses.
const struct GNUNET_MessageHeader * GST_hello_get()
Obtain this peers HELLO message.
void(* GST_HelloCallback)(void *cls, const struct GNUNET_MessageHeader *hello)
Signature of a function to call whenever our hello changes.
const char * GST_plugins_a2s(const struct GNUNET_HELLO_Address *address)
Convert a given address to a human-readable format.
Helper library for handling HELLOs.
Maintain the list of currently known hosts.
API to create, modify and access statistics.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
uint16_t GNUNET_HELLO_size(const struct GNUNET_HELLO_Message *hello)
Return the size of the given 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.
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_cmp(const struct GNUNET_HELLO_Address *a1, const struct GNUNET_HELLO_Address *a2)
Compare two addresses.
#define GNUNET_log(kind,...)
#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.
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
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_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_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel)
Convert relative time to an absolute time in the future.
an ECC signature using EdDSA.
An address for communicating with a peer.
A HELLO message is used to exchange information about transports with other peers.
struct GNUNET_CRYPTO_EddsaPublicKey public_key
Entry in list of pending tasks.
Time for absolute times used by GNUnet, in microseconds.
Time for relative time used by GNUnet, in microseconds.
Closure for address_generator().
struct GNUNET_TIME_Absolute expiration
When do addresses expire?
struct OwnAddressList * addr_pos
Where are we in the DLL?
Entry in linked list of network addresses for ourselves.
struct GNUNET_CRYPTO_EddsaSignature pong_signature
Signature for a 'struct TransportPongMessage' for this address.
struct GNUNET_HELLO_Address * address
The address.
struct GNUNET_TIME_Absolute pong_sig_expires
How long until the current signature expires? (ZERO if the signature was never created).
struct OwnAddressList * prev
This is a doubly-linked list.
unsigned int rc
How often has this address been added/removed? Used as some plugins may learn the same external addre...
struct OwnAddressList * next
This is a doubly-linked list.