[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r31884 - gnunet/src/include
From: |
gnunet |
Subject: |
[GNUnet-SVN] r31884 - gnunet/src/include |
Date: |
Mon, 13 Jan 2014 17:56:30 +0100 |
Author: wachs
Date: 2014-01-13 17:56:29 +0100 (Mon, 13 Jan 2014)
New Revision: 31884
Modified:
gnunet/src/include/gnunet_hello_lib.h
gnunet/src/include/gnunet_transport_plugin.h
Log:
implementing 0003268
Modified: gnunet/src/include/gnunet_hello_lib.h
===================================================================
--- gnunet/src/include/gnunet_hello_lib.h 2014-01-13 15:59:59 UTC (rev
31883)
+++ gnunet/src/include/gnunet_hello_lib.h 2014-01-13 16:56:29 UTC (rev
31884)
@@ -48,7 +48,29 @@
*/
#define GNUNET_FRIEND_HELLO_URI_PREFIX "gnunet://friend-hello/"
+
/**
+ * 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
+ */
+enum GNUNET_HELLO_AddressInfo
+{
+ /**
+ * No additional information
+ */
+ GNUNET_HELLO_ADDRESS_INFO_NONE = 0,
+
+ /**
+ * This is an inbound address and cannot be used to initiate an outbound
+ * connection to another peer
+ */
+ GNUNET_HELLO_ADDRESS_INFO_INBOUND = 1
+};
+
+
+/**
* An address for communicating with a peer. We frequently
* need this tuple and the components cannot really be
* separated. This is NOT the format that would be used
@@ -63,6 +85,18 @@
struct GNUNET_PeerIdentity peer;
/**
+ * Extended information about address
+ *
+ * This field contains additional #GNUNET_HELLO_AddressInfo flags e.g.
+ * to indicate an address is inbound and cannot be used to initiate an
+ * outbound connection.
+ *
+ * These information are only valid for the local peer and are not serialized
+ * when a #GNUNET_HELLO_Message is created
+ */
+ enum GNUNET_HELLO_AddressInfo local_info;
+
+ /**
* Name of the transport plugin enabling the communication using
* this address.
*/
@@ -88,12 +122,14 @@
* @param transport_name plugin name
* @param address binary address
* @param address_length number of bytes in 'address'
+ * @param local_info additional address information, will not get serialized
* @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);
+ size_t address_length,
+ enum GNUNET_HELLO_AddressInfo local_info);
/**
@@ -118,7 +154,6 @@
GNUNET_HELLO_address_cmp (const struct GNUNET_HELLO_Address *a1,
const struct GNUNET_HELLO_Address *a2);
-
/**
* Get the size of an address struct.
*
@@ -128,6 +163,7 @@
size_t
GNUNET_HELLO_address_get_size (const struct GNUNET_HELLO_Address *address);
+
/**
* Free an address.
*
Modified: gnunet/src/include/gnunet_transport_plugin.h
===================================================================
--- gnunet/src/include/gnunet_transport_plugin.h 2014-01-13 15:59:59 UTC
(rev 31883)
+++ gnunet/src/include/gnunet_transport_plugin.h 2014-01-13 16:56:29 UTC
(rev 31884)
@@ -82,26 +82,17 @@
struct Session *session);
/**
- * Function that will be called whenever the plugin internally
- * creates a new session and hence transport need to tell ATS.
- * This happens when we have a inbound connection we did not
- * initiate.
+ * Plugin tells transport service about a new inbound session
*
- * @param cls closure
- * @param peer peer
- * @param plugin plugin
- * @param address address
- * @param address_len length of the @a address
- * @param session session
- * @param ats ATS information
- * @param ats_count number of entries in @a ats array
+ * @param cls unused
+ * @param address the address
+ * @param session the new session
+ * @param ats ats information
+ * @param ats_count number of @a ats information
*/
typedef void
(*GNUNET_TRANSPORT_SessionStart) (void *cls,
- const struct GNUNET_PeerIdentity *peer,
- const char *plugin,
- const void *address,
- uint16_t address_len,
+ struct GNUNET_HELLO_Address *address,
struct Session *session,
const struct GNUNET_ATS_Information *ats,
uint32_t ats_count);
@@ -130,11 +121,9 @@
*/
typedef struct GNUNET_TIME_Relative
(*GNUNET_TRANSPORT_PluginReceiveCallback) (void *cls,
- const struct GNUNET_PeerIdentity
*peer,
- const struct GNUNET_MessageHeader
*message,
- struct Session *session,
- const char *sender_address,
- uint16_t sender_address_len);
+ const struct GNUNET_HELLO_Address *address,
+ struct Session *session,
+ const struct GNUNET_MessageHeader *message);
/**
@@ -165,9 +154,7 @@
*/
typedef void
(*GNUNET_TRANSPORT_UpdateAddressMetrics) (void *cls,
- const struct GNUNET_PeerIdentity
*peer,
- const void *address,
- uint16_t address_len,
+ const struct GNUNET_HELLO_Address
*address,
struct Session *session,
const struct GNUNET_ATS_Information
*ats,
uint32_t ats_count);
@@ -179,17 +166,11 @@
* @param cls closure
* @param add_remove should the address added (#GNUNET_YES) or removed
(#GNUNET_NO) from the
* set of valid addresses?
- * @param addr one of the addresses of the host
- * the specific address format depends on the transport
- * @param addrlen length of the @a addr
- * @param dest_plugin plugin to use this address with
+ * @param address the address to add or remove
*/
typedef void
-(*GNUNET_TRANSPORT_AddressNotification) (void *cls,
- int add_remove,
- const void *addr,
- size_t addrlen,
- const char *dest_plugin);
+(*GNUNET_TRANSPORT_AddressNotification) (void *cls, int add_remove,
+ const struct GNUNET_HELLO_Address *address);
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r31884 - gnunet/src/include,
gnunet <=