Helper library for handling HELLOs. More...
Data Structures | |
struct | GNUNET_HELLO_Address |
An address for communicating with a peer. More... | |
struct | GNUNET_HELLO_Message |
A HELLO message is used to exchange information about transports with other peers. More... | |
Macros | |
#define | GNUNET_HELLO_URI_PREFIX "gnunet://hello/" |
Prefix that every HELLO URI must start with. More... | |
#define | GNUNET_FRIEND_HELLO_URI_PREFIX "gnunet://friend-hello/" |
Prefix that every FRIEND HELLO URI must start with. More... | |
#define | GNUNET_HELLO_URI_SEP '+' |
Separator used in HELLO URI. More... | |
#define | GNUNET_HELLO_address_free(addr) GNUNET_free (addr) |
Free an address. More... | |
Typedefs | |
typedef ssize_t(* | GNUNET_HELLO_GenerateAddressListCallback) (void *cls, size_t max, void *buf) |
Callback function used to fill a buffer of max bytes with a list of addresses in the format used by HELLOs. More... | |
typedef int(* | GNUNET_HELLO_AddressIterator) (void *cls, const struct GNUNET_HELLO_Address *address, struct GNUNET_TIME_Absolute expiration) |
Iterator callback to go over all addresses. More... | |
typedef struct GNUNET_TRANSPORT_PluginFunctions *(* | GNUNET_HELLO_TransportPluginsFind) (const char *name) |
Helper function to load/access transport plugins. More... | |
Enumerations | |
enum | GNUNET_HELLO_AddressInfo { GNUNET_HELLO_ADDRESS_INFO_NONE = 0 , GNUNET_HELLO_ADDRESS_INFO_INBOUND = 1 } |
Additional local information about an address. More... | |
Functions | |
struct GNUNET_HELLO_Address * | GNUNET_HELLO_address_allocate (const struct GNUNET_PeerIdentity *peer, const char *transport_name, const void *address, size_t address_length, enum GNUNET_HELLO_AddressInfo local_info) |
Allocate an address struct. More... | |
struct GNUNET_HELLO_Address * | GNUNET_HELLO_address_copy (const struct GNUNET_HELLO_Address *address) |
Copy an address struct. More... | |
int | GNUNET_HELLO_address_cmp (const struct GNUNET_HELLO_Address *a1, const struct GNUNET_HELLO_Address *a2) |
Compare two addresses. More... | |
size_t | GNUNET_HELLO_address_get_size (const struct GNUNET_HELLO_Address *address) |
Get the size of an address struct. More... | |
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. More... | |
int | GNUNET_HELLO_is_friend_only (const struct GNUNET_HELLO_Message *h) |
Return HELLO type. More... | |
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. More... | |
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 transport addresses. More... | |
uint16_t | GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello) |
Return the size of the given HELLO message. More... | |
struct GNUNET_HELLO_Message * | GNUNET_HELLO_merge (const struct GNUNET_HELLO_Message *h1, const struct GNUNET_HELLO_Message *h2) |
Construct a HELLO message by merging the addresses in two existing HELLOs (which must be for the same peer). More... | |
struct GNUNET_TIME_Absolute | GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1, const struct GNUNET_HELLO_Message *h2, struct GNUNET_TIME_Absolute now) |
Test if two HELLO messages contain the same addresses. More... | |
struct GNUNET_TIME_Absolute | GNUNET_HELLO_get_last_expiration (const struct GNUNET_HELLO_Message *msg) |
When does the last address in the given HELLO expire? More... | |
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. More... | |
void | GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message *new_hello, const struct GNUNET_HELLO_Message *old_hello, struct GNUNET_TIME_Absolute expiration_limit, GNUNET_HELLO_AddressIterator it, void *it_cls) |
Iterate over addresses in new_hello that are NOT already present in old_hello. More... | |
int | GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, struct GNUNET_PeerIdentity *peer) |
Get the peer identity from a HELLO message. More... | |
struct GNUNET_MessageHeader * | GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello) |
Get the header from a HELLO message, used so other code can correctly send HELLO messages. More... | |
char * | GNUNET_HELLO_compose_uri (const struct GNUNET_HELLO_Message *hello, GNUNET_HELLO_TransportPluginsFind plugins_find) |
Compose a hello URI string from a hello message. More... | |
int | GNUNET_HELLO_parse_uri (const char *uri, struct GNUNET_CRYPTO_EddsaPublicKey *pubkey, struct GNUNET_HELLO_Message **hello, GNUNET_HELLO_TransportPluginsFind plugins_find) |
Parse a hello URI string to a hello message. More... | |
void | GNUNET_HELLO_sign_address (const char *address, enum GNUNET_NetworkType nt, struct GNUNET_TIME_Absolute mono_time, const struct GNUNET_CRYPTO_EddsaPrivateKey *private_key, void **result, size_t *result_size) |
Build address record by signing raw information with private key. More... | |
char * | GNUNET_HELLO_extract_address (const void *raw, size_t raw_size, const struct GNUNET_PeerIdentity *pid, enum GNUNET_NetworkType *nt, struct GNUNET_TIME_Absolute *mono_time) |
Check signature and extract address record. More... | |
char * | GNUNET_HELLO_address_to_prefix (const char *address) |
Given an address as a string, extract the prefix that identifies the communicator offering transmissions to that address. More... | |
Helper library for handling HELLOs.
#define GNUNET_HELLO_URI_PREFIX "gnunet://hello/" |
Prefix that every HELLO URI must start with.
Definition at line 53 of file gnunet_hello_lib.h.
#define GNUNET_FRIEND_HELLO_URI_PREFIX "gnunet://friend-hello/" |
Prefix that every FRIEND HELLO URI must start with.
Definition at line 58 of file gnunet_hello_lib.h.
#define GNUNET_HELLO_URI_SEP '+' |
Separator used in HELLO URI.
Definition at line 63 of file gnunet_hello_lib.h.
#define GNUNET_HELLO_address_free | ( | addr | ) | GNUNET_free (addr) |
Callback function used to fill a buffer of max bytes with a list of addresses in the format used by HELLOs.
Should use GNUNET_HELLO_add_address() as a helper function.
cls | closure |
max | maximum number of bytes that can be written to buf |
buf | where to write the address information |
Definition at line 275 of file gnunet_hello_lib.h.
typedef int(* GNUNET_HELLO_AddressIterator) (void *cls, const struct GNUNET_HELLO_Address *address, struct GNUNET_TIME_Absolute expiration) |
Iterator callback to go over all addresses.
cls | closure |
address | the address |
expiration | expiration time |
Definition at line 358 of file gnunet_hello_lib.h.
typedef struct GNUNET_TRANSPORT_PluginFunctions*( * GNUNET_HELLO_TransportPluginsFind) (const char *name) |
Helper function to load/access transport plugins.
FIXME: pass closure!
name | name of the transport plugin to load |
Definition at line 436 of file gnunet_hello_lib.h.
Additional local information about an address.
These information are only valid for the local peer and are not serialized when a GNUNET_HELLO_Message is created
Enumerator | |
---|---|
GNUNET_HELLO_ADDRESS_INFO_NONE | No additional information. |
GNUNET_HELLO_ADDRESS_INFO_INBOUND | This is an inbound address and cannot be used to initiate an outbound connection to another peer. |
Definition at line 72 of file gnunet_hello_lib.h.
struct GNUNET_HELLO_Address* GNUNET_HELLO_address_allocate | ( | const struct GNUNET_PeerIdentity * | peer, |
const char * | transport_name, | ||
const void * | address, | ||
size_t | address_length, | ||
enum GNUNET_HELLO_AddressInfo | local_info | ||
) |
Allocate an address struct.
peer | the peer |
transport_name | plugin name |
address | binary address |
address_length | number of bytes in address |
local_info | additional local information for the address |
Definition at line 63 of file address.c.
References address, GNUNET_HELLO_Address::address, GNUNET_HELLO_Address::address_length, end, GNUNET_malloc, GNUNET_memcpy, GNUNET_HELLO_Address::local_info, GNUNET_HELLO_Address::peer, peer, and GNUNET_HELLO_Address::transport_name.
Referenced by ack_proc(), address_notification(), broadcast_mst_cb(), create_session(), GNUNET_HELLO_address_copy(), handle_helper_message(), handle_response(), handle_tcp_nat_probe(), handle_tcp_welcome(), LIBGNUNET_PLUGIN_TRANSPORT_DONE(), libgnunet_plugin_transport_unix_done(), process_data(), process_udp_message(), read_process_ack(), server_add_address(), server_lookup_connection(), server_notify_external_hostname(), server_remove_address(), tcp_nat_port_map_callback(), udp_nat_port_map_callback(), and unix_demultiplexer().
struct GNUNET_HELLO_Address* GNUNET_HELLO_address_copy | ( | const struct GNUNET_HELLO_Address * | address | ) |
Copy an address struct.
address | address to copy |
Definition at line 99 of file address.c.
References address, and GNUNET_HELLO_address_allocate().
Referenced by ats_perf_cb(), ats_perf_mon_cb(), create_session(), find_validation_entry(), GNUNET_ATS_address_add(), GST_ats_add_address(), GST_ats_add_inbound_address(), GST_blacklist_test_allowed(), GST_hello_modify_addresses(), http_client_plugin_get_session(), process_peer_monitoring_cb(), resolve_peer_address(), send_with_session(), set_primary_address(), test_connection_ok(), udp_plugin_create_session(), and unix_plugin_get_session().
int GNUNET_HELLO_address_cmp | ( | const struct GNUNET_HELLO_Address * | a1, |
const struct GNUNET_HELLO_Address * | a2 | ||
) |
Compare two addresses.
Does NOT compare the peer identity, that is assumed already to match!
a1 | first address |
a2 | second address |
Definition at line 112 of file address.c.
References GNUNET_HELLO_Address::address, GNUNET_HELLO_Address::address_length, GNUNET_HELLO_Address::local_info, ret, and GNUNET_HELLO_Address::transport_name.
Referenced by find_address_it(), find_ai_cb(), find_ai_no_session_cb(), find_other_matching(), find_session_id(), get_match_exp(), GST_blacklist_abort_matching(), GST_hello_modify_addresses(), GST_hello_test_address(), lookup_session_it(), process_peer_monitoring_cb(), session_cmp_it(), session_lookup_client_by_address(), session_lookup_it(), set_primary_address(), switch_address_bl_check_cont(), try_run_fast_ats_update(), and validation_entry_match().
size_t GNUNET_HELLO_address_get_size | ( | const struct GNUNET_HELLO_Address * | address | ) |
Get the size of an address struct.
address | address |
Definition at line 55 of file address.c.
References address, GNUNET_HELLO_Address::address_length, and GNUNET_HELLO_Address::transport_name.
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.
address | the address to check |
option | the respective option to check for |
Definition at line 39 of file address.c.
References address, GNUNET_NO, and GNUNET_YES.
Referenced by GNUNET_ATS_address_del_session(), GST_ats_add_address(), GST_ats_add_inbound_address(), GST_ats_block_address(), GST_ats_del_session(), GST_neighbours_switch_to_address(), handle_ats_address_suggestion(), handle_tcp_welcome(), notify_session_monitor(), plugin_env_session_start(), plugin_env_session_start_bl_check_cont(), switch_address_bl_check_cont(), and tcp_plugin_get_session().
int GNUNET_HELLO_is_friend_only | ( | const struct GNUNET_HELLO_Message * | h | ) |
Return HELLO type.
h | HELLO Message to test |
Definition at line 89 of file hello.c.
References GNUNET_NO, GNUNET_YES, and h.
Referenced by dump_my_hello(), GNUNET_HELLO_compose_uri(), GST_validation_handle_hello(), main(), peerinfo_list_iteration(), print_peer_info(), read_host_file(), update_friend_hello(), and update_hello().
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.
address | address to add |
expiration | expiration for the address |
target | where to copy the address |
max | maximum number of bytes to copy to target |
address | the address |
expiration | expiration for the address |
target | where to copy the address |
max | maximum number of bytes to copy to target |
Definition at line 109 of file hello.c.
References address, expiration, GNUNET_memcpy, GNUNET_TIME_absolute_hton(), and max.
Referenced by add_address_to_hello(), add_to_buf(), add_valid_peer_address(), address_generator(), and copy_latest().
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 transport addresses.
If friend only is set to GNUNET_YES we create a FRIEND_HELLO which will not be gossiped to other peers.
public_key | public key to include in the HELLO |
addrgen | callback to invoke to get addresses |
addrgen_cls | closure for addrgen |
friend_only | should the returned HELLO be only visible to friends? |
Definition at line 204 of file hello.c.
References GNUNET_HELLO_Message::friend_only, GNUNET_assert, GNUNET_malloc, GNUNET_MAX_MESSAGE_SIZE, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_HELLO, GNUNET_NO, GNUNET_SYSERR, GNUNET_YES, GNUNET_HELLO_Message::header, max, GNUNET_HELLO_Message::publicKey, ret, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by GNUNET_HELLO_merge(), GNUNET_HELLO_parse_uri(), GST_validation_handle_pong(), main(), refresh_hello_task(), and update_friend_hello().
uint16_t GNUNET_HELLO_size | ( | const struct GNUNET_HELLO_Message * | hello | ) |
Return the size of the given HELLO message.
hello | to inspect |
Definition at line 630 of file hello.c.
References GNUNET_MESSAGE_TYPE_HELLO, GNUNET_HELLO_Message::header, ret, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by add_to_tc(), announce_id(), callback_download(), check_info(), check_notification(), consider_for_advertising(), dht_get_id_handler(), discard_hosts_helper(), dump_my_hello(), find_advertisable_hello(), GCP_set_hello(), GNUNET_HELLO_iterate_addresses(), got_hello(), host_processor(), main(), make_info_message(), make_peer(), offer_hello(), prepare_beacon(), read_host_file(), refresh_hello_task(), schedule_next_hello(), send_hello_beacon(), and update_hello().
struct GNUNET_HELLO_Message* GNUNET_HELLO_merge | ( | const struct GNUNET_HELLO_Message * | h1, |
const struct GNUNET_HELLO_Message * | h2 | ||
) |
Construct a HELLO message by merging the addresses in two existing HELLOs (which must be for the same peer).
h1 | first HELLO message |
h2 | the second HELLO message |
Definition at line 515 of file hello.c.
References GNUNET_HELLO_Message::friend_only, GNUNET_HELLO_create(), GNUNET_YES, MergeContext::h1, MergeContext::h2, mc, merge_addr(), and GNUNET_HELLO_Message::publicKey.
Referenced by consider_for_advertising(), GCP_set_hello(), update_friend_hello(), and update_hello().
struct GNUNET_TIME_Absolute GNUNET_HELLO_equals | ( | const struct GNUNET_HELLO_Message * | h1, |
const struct GNUNET_HELLO_Message * | h2, | ||
struct GNUNET_TIME_Absolute | now | ||
) |
Test if two HELLO messages contain the same addresses.
If they only differ in expiration time, the lowest expiration time larger than 'now' where they differ is returned.
h1 | first HELLO message |
h2 | the second HELLO message |
now | time to use for deciding which addresses have expired and should not be considered at all |
If they only differ in expiration time, the lowest expiration time larger than now where they differ is returned.
h1 | first HELLO message |
h2 | the second HELLO message |
now | time to use for deciding which addresses have expired and should not be considered at all |
Definition at line 770 of file hello.c.
Referenced by consider_for_advertising(), and update_hello().
struct GNUNET_TIME_Absolute GNUNET_HELLO_get_last_expiration | ( | const struct GNUNET_HELLO_Message * | msg | ) |
When does the last address in the given HELLO expire?
msg | HELLO to inspect |
Definition at line 852 of file hello.c.
Referenced by announce_id(), consider_peer_destroy(), and got_hello().
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.
msg | HELLO to iterate over; client does not need to have verified that msg is well-formed (beyond starting with a GNUNET_MessageHeader of the right type). |
return_modified | if a modified copy should be returned, otherwise NULL will be returned |
it | iterator to call on each address |
it_cls | closure for it |
msg | HELLO to iterate over |
return_modified | if a modified copy should be returned, otherwise NULL will be returned |
it | iterator to call on each address |
it_cls | closure for it |
Definition at line 254 of file hello.c.
References address, expire, get_hello_address_size(), GNUNET_break, GNUNET_break_op, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_HELLO_ADDRESS_INFO_NONE, GNUNET_HELLO_size(), GNUNET_log, GNUNET_malloc, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_HELLO, GNUNET_OK, GNUNET_SYSERR, GNUNET_TIME_absolute_ntoh(), msg, ret, and GNUNET_MessageHeader::type.
Referenced by add_from_hello(), consider_for_advertising(), copy_latest(), delta_match(), discard_hosts_helper(), dump_my_hello(), find_matching(), GNUNET_HELLO_compose_uri(), GNUNET_HELLO_iterate_new_addresses(), GST_validation_handle_hello(), hello_update_cb(), host_processor(), merge_addr(), peerinfo_list_iteration(), print_peer_info(), process_peerinfo_hello(), read_host_file(), and update_hello().
void GNUNET_HELLO_iterate_new_addresses | ( | const struct GNUNET_HELLO_Message * | new_hello, |
const struct GNUNET_HELLO_Message * | old_hello, | ||
struct GNUNET_TIME_Absolute | expiration_limit, | ||
GNUNET_HELLO_AddressIterator | it, | ||
void * | it_cls | ||
) |
Iterate over addresses in new_hello that are NOT already present in old_hello.
Note that if the address is present in old_hello but the expiration time in new_hello is more recent, the iterator is also called.
new_hello | a HELLO message |
old_hello | a HELLO message |
expiration_limit | ignore addresses in old_hello that expired before the given time stamp |
it | iterator to call on each address |
it_cls | closure for it |
Definition at line 601 of file hello.c.
References dc, delta_match(), DeltaContext::expiration_limit, GNUNET_assert, GNUNET_HELLO_iterate_addresses(), GNUNET_NO, DeltaContext::it, DeltaContext::it_cls, and DeltaContext::old_hello.
int GNUNET_HELLO_get_id | ( | const struct GNUNET_HELLO_Message * | hello, |
struct GNUNET_PeerIdentity * | peer | ||
) |
Get the peer identity from a HELLO message.
hello | the hello message |
peer | where to store the peer's identity |
Definition at line 649 of file hello.c.
References GNUNET_MESSAGE_TYPE_HELLO, GNUNET_OK, GNUNET_SYSERR, GNUNET_HELLO_Message::header, peer, GNUNET_HELLO_Message::publicKey, ret, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by add_valid_address(), check_hello(), check_info(), consider_for_advertising(), get_hello(), GNUNET_PEERINFO_add_peer(), GNUNET_TRANSPORT_offer_hello(), GST_validation_handle_hello(), handle_hello(), hello_callback(), hosts_directory_scan_callback(), main(), process_data(), and update_friend_hello().
struct GNUNET_MessageHeader* GNUNET_HELLO_get_header | ( | struct GNUNET_HELLO_Message * | hello | ) |
Get the header from a HELLO message, used so other code can correctly send HELLO messages.
hello | the hello message |
Definition at line 671 of file hello.c.
References GNUNET_MESSAGE_TYPE_HELLO, GNUNET_HELLO_Message::header, ret, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by GCP_set_hello().
char* GNUNET_HELLO_compose_uri | ( | const struct GNUNET_HELLO_Message * | hello, |
GNUNET_HELLO_TransportPluginsFind | plugins_find | ||
) |
Compose a hello URI string from a hello message.
hello | Hello message |
plugins_find | Function to find transport plugins by name |
Definition at line 1007 of file hello.c.
References add_address_to_uri(), ctx, GNUNET_asprintf(), GNUNET_CRYPTO_eddsa_public_key_to_string(), GNUNET_free, GNUNET_FRIEND_HELLO_URI_PREFIX, GNUNET_HELLO_is_friend_only(), GNUNET_HELLO_iterate_addresses(), GNUNET_HELLO_URI_PREFIX, GNUNET_NO, GNUNET_YES, pkey, GNUNET_HELLO_ComposeUriContext::plugins_find, and GNUNET_HELLO_Message::publicKey.
Referenced by peerinfo_cb(), and print_my_uri().
int GNUNET_HELLO_parse_uri | ( | const char * | uri, |
struct GNUNET_CRYPTO_EddsaPublicKey * | pubkey, | ||
struct GNUNET_HELLO_Message ** | hello, | ||
GNUNET_HELLO_TransportPluginsFind | plugins_find | ||
) |
Parse a hello URI string to a hello message.
uri | URI string to parse |
pubkey | Pointer to struct where public key is parsed |
hello | Pointer to struct where hello message is parsed |
plugins_find | Function to find transport plugins by name |
Definition at line 1195 of file hello.c.
References add_address_to_hello(), ctx, GNUNET_ERROR_TYPE_DEBUG, GNUNET_FRIEND_HELLO_URI_PREFIX, GNUNET_HELLO_create(), GNUNET_HELLO_URI_PREFIX, GNUNET_HELLO_URI_SEP, GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_STRINGS_string_to_data(), GNUNET_SYSERR, GNUNET_YES, GNUNET_HELLO_ParseUriContext::plugins_find, pubkey, and uri.
Referenced by gnunet_try_connect(), and parse_hello_uri().
void GNUNET_HELLO_sign_address | ( | const char * | address, |
enum GNUNET_NetworkType | nt, | ||
struct GNUNET_TIME_Absolute | mono_time, | ||
const struct GNUNET_CRYPTO_EddsaPrivateKey * | private_key, | ||
void ** | result, | ||
size_t * | result_size | ||
) |
Build address record by signing raw information with private key.
address | text address to sign | |
nt | network type of address | |
mono_time | when was address valid | |
private_key | signing key to use | |
[out] | result | where to write address record (allocated) |
[out] | result_size | set to size of result |
address | text address at communicator to sign | |
nt | network type of address | |
mono_time | monotonic time at which address was valid | |
private_key | signing key to use | |
[out] | result | where to write address record (allocated) |
[out] | result_size | set to size of result |
Definition at line 67 of file hello-ng.c.
References GNUNET_TIME_Absolute::abs_value_us, SignedAddress::addr_hash, address, GNUNET_asprintf(), GNUNET_CRYPTO_eddsa_sign, GNUNET_CRYPTO_hash(), GNUNET_free, GNUNET_SIGNATURE_PURPOSE_TRANSPORT_ADDRESS, GNUNET_STRINGS_base64_encode(), GNUNET_TIME_absolute_hton(), SignedAddress::mono_time, nt, SignedAddress::purpose, GNUNET_CRYPTO_EccSignaturePurpose::purpose, result, and GNUNET_CRYPTO_EccSignaturePurpose::size.
Referenced by store_pi().
char* GNUNET_HELLO_extract_address | ( | const void * | raw, |
size_t | raw_size, | ||
const struct GNUNET_PeerIdentity * | pid, | ||
enum GNUNET_NetworkType * | nt, | ||
struct GNUNET_TIME_Absolute * | mono_time | ||
) |
Check signature and extract address record.
raw | raw signed address | |
raw_size | size of raw | |
pid | public key to use for signature verification | |
[out] | nt | set to network type |
[out] | mono_time | when was the address generated |
raw | raw signed address |
raw_size | size of raw |
pid | public key to use for signature verification |
nt[out] | set to network type |
mono_time[out] | when was the address generated |
Definition at line 108 of file hello-ng.c.
References GNUNET_TIME_Absolute::abs_value_us, SignedAddress::addr_hash, data, GNUNET_break_op, GNUNET_CRYPTO_eddsa_verify, GNUNET_CRYPTO_hash(), GNUNET_free, GNUNET_SIGNATURE_PURPOSE_TRANSPORT_ADDRESS, GNUNET_strdup, GNUNET_STRINGS_base64_decode(), GNUNET_TIME_absolute_hton(), GNUNET_YES, SignedAddress::mono_time, nt, pid, GNUNET_PeerIdentity::public_key, SignedAddress::purpose, GNUNET_CRYPTO_EccSignaturePurpose::purpose, raw, sc, and GNUNET_CRYPTO_EccSignaturePurpose::size.
Referenced by offer_hello().
char* GNUNET_HELLO_address_to_prefix | ( | const char * | address | ) |
Given an address as a string, extract the prefix that identifies the communicator offering transmissions to that address.
address | a peer's address |
Definition at line 191 of file hello-ng.c.
Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_open_queue(), and suggest_to_connect().