along with this program. If not, see <http://www.gnu.org/licenses/>.
SPDX-License-Identifier: AGPL3.0-or-later
-*/
+ */
/**
* @author Christian Grothoff
* These information are only valid for the local peer and are not serialized
* when a #GNUNET_HELLO_Message is created
*/
-enum GNUNET_HELLO_AddressInfo
-{
+enum GNUNET_HELLO_AddressInfo {
/**
* No additional information
*/
* separated. This is NOT the format that would be used
* on the wire.
*/
-struct GNUNET_HELLO_Address
-{
-
+struct GNUNET_HELLO_Address {
/**
* For which peer is this an address?
*/
* @return the address struct
*/
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);
+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);
/**
* @return a copy of the address struct
*/
struct GNUNET_HELLO_Address *
-GNUNET_HELLO_address_copy (const struct GNUNET_HELLO_Address *address);
+GNUNET_HELLO_address_copy(const struct GNUNET_HELLO_Address *address);
/**
* @return 0 if the addresses are equal, -1 if @a a1< @a a2, 1 if @a a1> @a a2.
*/
int
-GNUNET_HELLO_address_cmp (const struct GNUNET_HELLO_Address *a1,
- const struct GNUNET_HELLO_Address *a2);
+GNUNET_HELLO_address_cmp(const struct GNUNET_HELLO_Address *a1,
+ const struct GNUNET_HELLO_Address *a2);
/**
* @return the size
*/
size_t
-GNUNET_HELLO_address_get_size (const struct GNUNET_HELLO_Address *address);
+GNUNET_HELLO_address_get_size(const struct GNUNET_HELLO_Address *address);
/**
* @return #GNUNET_YES or #GNUNET_NO
*/
int
-GNUNET_HELLO_address_check_option (const struct GNUNET_HELLO_Address *address,
- enum GNUNET_HELLO_AddressInfo option);
+GNUNET_HELLO_address_check_option(const struct GNUNET_HELLO_Address *address,
+ enum GNUNET_HELLO_AddressInfo option);
/**
*
* @param addr address to free
*/
-#define GNUNET_HELLO_address_free(addr) GNUNET_free (addr)
+#define GNUNET_HELLO_address_free(addr) GNUNET_free(addr)
GNUNET_NETWORK_STRUCT_BEGIN
* unaligned!)
* 4) address (address-length bytes; possibly unaligned!)
*/
-struct GNUNET_HELLO_Message
-{
+struct GNUNET_HELLO_Message {
/**
* Type will be #GNUNET_MESSAGE_TYPE_HELLO.
*/
* @return #GNUNET_YES for friend-only or #GNUNET_NO otherwise
*/
int
-GNUNET_HELLO_is_friend_only (const struct GNUNET_HELLO_Message *h);
+GNUNET_HELLO_is_friend_only(const struct GNUNET_HELLO_Message *h);
/**
* the target buffer was not big enough.
*/
size_t
-GNUNET_HELLO_add_address (const struct GNUNET_HELLO_Address *address,
- struct GNUNET_TIME_Absolute expiration,
- char *target,
- size_t max);
+GNUNET_HELLO_add_address(const struct GNUNET_HELLO_Address *address,
+ struct GNUNET_TIME_Absolute expiration,
+ char *target,
+ size_t max);
/**
* @return the 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);
+GNUNET_HELLO_create(const struct GNUNET_CRYPTO_EddsaPublicKey *public_key,
+ GNUNET_HELLO_GenerateAddressListCallback addrgen,
+ void *addrgen_cls,
+ int friend_only);
/**
* @return the size, 0 if HELLO is invalid
*/
uint16_t
-GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello);
+GNUNET_HELLO_size(const struct GNUNET_HELLO_Message *hello);
/**
* @return the combined hello message
*/
struct GNUNET_HELLO_Message *
-GNUNET_HELLO_merge (const struct GNUNET_HELLO_Message *h1,
- const struct GNUNET_HELLO_Message *h2);
+GNUNET_HELLO_merge(const struct GNUNET_HELLO_Message *h1,
+ const struct GNUNET_HELLO_Message *h2);
/**
* do not match at all
*/
struct GNUNET_TIME_Absolute
-GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1,
- const struct GNUNET_HELLO_Message *h2,
- struct GNUNET_TIME_Absolute now);
+GNUNET_HELLO_equals(const struct GNUNET_HELLO_Message *h1,
+ const struct GNUNET_HELLO_Message *h2,
+ struct GNUNET_TIME_Absolute now);
/**
* @return time the last address expires, 0 if there are no addresses in the HELLO
*/
struct GNUNET_TIME_Absolute
-GNUNET_HELLO_get_last_expiration (const struct GNUNET_HELLO_Message *msg);
+GNUNET_HELLO_get_last_expiration(const struct GNUNET_HELLO_Message *msg);
/**
* @return the modified HELLO or NULL
*/
struct GNUNET_HELLO_Message *
-GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg,
- int return_modified,
- GNUNET_HELLO_AddressIterator it,
- void *it_cls);
+GNUNET_HELLO_iterate_addresses(const struct GNUNET_HELLO_Message *msg,
+ int return_modified,
+ GNUNET_HELLO_AddressIterator it,
+ void *it_cls);
/**
* @param it_cls closure for @a it
*/
void
-GNUNET_HELLO_iterate_new_addresses (
+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,
* @return #GNUNET_SYSERR if the HELLO was malformed
*/
int
-GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello,
- struct GNUNET_PeerIdentity *peer);
+GNUNET_HELLO_get_id(const struct GNUNET_HELLO_Message *hello,
+ struct GNUNET_PeerIdentity *peer);
/**
* @return header or NULL if the HELLO was malformed
*/
struct GNUNET_MessageHeader *
-GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello);
+GNUNET_HELLO_get_header(struct GNUNET_HELLO_Message *hello);
/**
* @return NULL if a plugin with name @a name is not known/loadable
*/
typedef struct GNUNET_TRANSPORT_PluginFunctions *(
- *GNUNET_HELLO_TransportPluginsFind) (const char *name);
+*GNUNET_HELLO_TransportPluginsFind) (const char *name);
/**
* @return Hello URI string
*/
char *
-GNUNET_HELLO_compose_uri (const struct GNUNET_HELLO_Message *hello,
- GNUNET_HELLO_TransportPluginsFind plugins_find);
+GNUNET_HELLO_compose_uri(const struct GNUNET_HELLO_Message *hello,
+ GNUNET_HELLO_TransportPluginsFind plugins_find);
/**
* @return #GNUNET_OK on success, #GNUNET_SYSERR if the URI was invalid, #GNUNET_NO on other errors
*/
int
-GNUNET_HELLO_parse_uri (const char *uri,
- struct GNUNET_CRYPTO_EddsaPublicKey *pubkey,
- struct GNUNET_HELLO_Message **hello,
- GNUNET_HELLO_TransportPluginsFind plugins_find);
+GNUNET_HELLO_parse_uri(const char *uri,
+ struct GNUNET_CRYPTO_EddsaPublicKey *pubkey,
+ struct GNUNET_HELLO_Message **hello,
+ GNUNET_HELLO_TransportPluginsFind plugins_find);
/* NG API */
* @param result_size[out] set to size of @a result
*/
void
-GNUNET_HELLO_sign_address (
+GNUNET_HELLO_sign_address(
const char *address,
enum GNUNET_NetworkType nt,
struct GNUNET_TIME_Absolute mono_time,
* @return NULL on error, otherwise the address
*/
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);
+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);
/**
* @return NULL if the address is mal-formed, otherwise the prefix
*/
char *
-GNUNET_HELLO_address_to_prefix (const char *address);
+GNUNET_HELLO_address_to_prefix(const char *address);
#if 0 /* keep Emacsens' auto-indent happy */