aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_hello_lib.h
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-01-13 16:56:29 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-01-13 16:56:29 +0000
commit10cb35698e245a9f02e577d60541d7e09d7f05ca (patch)
tree0dc33499c14624870cf1034e5195b613557a8dc1 /src/include/gnunet_hello_lib.h
parentdd610f2588f8c53cb677722377301fb641da5c23 (diff)
downloadgnunet-10cb35698e245a9f02e577d60541d7e09d7f05ca.tar.gz
gnunet-10cb35698e245a9f02e577d60541d7e09d7f05ca.zip
implementing 0003268
Diffstat (limited to 'src/include/gnunet_hello_lib.h')
-rw-r--r--src/include/gnunet_hello_lib.h40
1 files changed, 38 insertions, 2 deletions
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h
index 609cb2822..a6b9ccb72 100644
--- a/src/include/gnunet_hello_lib.h
+++ b/src/include/gnunet_hello_lib.h
@@ -48,6 +48,28 @@ extern "C"
48 */ 48 */
49#define GNUNET_FRIEND_HELLO_URI_PREFIX "gnunet://friend-hello/" 49#define GNUNET_FRIEND_HELLO_URI_PREFIX "gnunet://friend-hello/"
50 50
51
52/**
53 * Additional local information about an address
54 *
55 * These information are only valid for the local peer and are not serialized
56 * when a #GNUNET_HELLO_Message is created
57 */
58enum GNUNET_HELLO_AddressInfo
59{
60 /**
61 * No additional information
62 */
63 GNUNET_HELLO_ADDRESS_INFO_NONE = 0,
64
65 /**
66 * This is an inbound address and cannot be used to initiate an outbound
67 * connection to another peer
68 */
69 GNUNET_HELLO_ADDRESS_INFO_INBOUND = 1
70};
71
72
51/** 73/**
52 * An address for communicating with a peer. We frequently 74 * An address for communicating with a peer. We frequently
53 * need this tuple and the components cannot really be 75 * need this tuple and the components cannot really be
@@ -63,6 +85,18 @@ struct GNUNET_HELLO_Address
63 struct GNUNET_PeerIdentity peer; 85 struct GNUNET_PeerIdentity peer;
64 86
65 /** 87 /**
88 * Extended information about address
89 *
90 * This field contains additional #GNUNET_HELLO_AddressInfo flags e.g.
91 * to indicate an address is inbound and cannot be used to initiate an
92 * outbound connection.
93 *
94 * These information are only valid for the local peer and are not serialized
95 * when a #GNUNET_HELLO_Message is created
96 */
97 enum GNUNET_HELLO_AddressInfo local_info;
98
99 /**
66 * Name of the transport plugin enabling the communication using 100 * Name of the transport plugin enabling the communication using
67 * this address. 101 * this address.
68 */ 102 */
@@ -88,12 +122,14 @@ struct GNUNET_HELLO_Address
88 * @param transport_name plugin name 122 * @param transport_name plugin name
89 * @param address binary address 123 * @param address binary address
90 * @param address_length number of bytes in 'address' 124 * @param address_length number of bytes in 'address'
125 * @param local_info additional address information, will not get serialized
91 * @return the address struct 126 * @return the address struct
92 */ 127 */
93struct GNUNET_HELLO_Address * 128struct GNUNET_HELLO_Address *
94GNUNET_HELLO_address_allocate (const struct GNUNET_PeerIdentity *peer, 129GNUNET_HELLO_address_allocate (const struct GNUNET_PeerIdentity *peer,
95 const char *transport_name, const void *address, 130 const char *transport_name, const void *address,
96 size_t address_length); 131 size_t address_length,
132 enum GNUNET_HELLO_AddressInfo local_info);
97 133
98 134
99/** 135/**
@@ -118,7 +154,6 @@ int
118GNUNET_HELLO_address_cmp (const struct GNUNET_HELLO_Address *a1, 154GNUNET_HELLO_address_cmp (const struct GNUNET_HELLO_Address *a1,
119 const struct GNUNET_HELLO_Address *a2); 155 const struct GNUNET_HELLO_Address *a2);
120 156
121
122/** 157/**
123 * Get the size of an address struct. 158 * Get the size of an address struct.
124 * 159 *
@@ -128,6 +163,7 @@ GNUNET_HELLO_address_cmp (const struct GNUNET_HELLO_Address *a1,
128size_t 163size_t
129GNUNET_HELLO_address_get_size (const struct GNUNET_HELLO_Address *address); 164GNUNET_HELLO_address_get_size (const struct GNUNET_HELLO_Address *address);
130 165
166
131/** 167/**
132 * Free an address. 168 * Free an address.
133 * 169 *