aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_hello.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-04 14:17:40 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-04 14:17:40 +0000
commit3ba21d7f05658f4c9a090a41ffbe04c6729d0916 (patch)
tree2e23aa6d04a917987f393048b7d007e488d7f1a8 /src/transport/gnunet-service-transport_hello.h
parent58cc7545c068d1deb7f7085822646313d5271b0f (diff)
downloadgnunet-3ba21d7f05658f4c9a090a41ffbe04c6729d0916.tar.gz
gnunet-3ba21d7f05658f4c9a090a41ffbe04c6729d0916.zip
implementing new HELLO api
Diffstat (limited to 'src/transport/gnunet-service-transport_hello.h')
-rw-r--r--src/transport/gnunet-service-transport_hello.h42
1 files changed, 39 insertions, 3 deletions
diff --git a/src/transport/gnunet-service-transport_hello.h b/src/transport/gnunet-service-transport_hello.h
index 75fef07ae..d34162841 100644
--- a/src/transport/gnunet-service-transport_hello.h
+++ b/src/transport/gnunet-service-transport_hello.h
@@ -32,25 +32,49 @@
32 32
33 33
34/** 34/**
35 * Signature of a function to call whenever our hello changes.
35 * 36 *
37 * @param cls closure
38 * @param hello updated HELLO
36 */ 39 */
37void 40typedef void (*GST_HelloCallback)(void *cls,
38GST_hello_start (void); 41 const struct GNUNET_MessageHeader *hello);
42
39 43
40/** 44/**
45 * Initialize the HELLO module.
41 * 46 *
47 * @param cb function to call whenever our HELLO changes
48 * @param cb_cls closure for cb
49 */
50void
51GST_hello_start (GST_HelloCallback cb,
52 void *cb_cls);
53
54
55/**
56 * Shutdown the HELLO module.
42 */ 57 */
43void 58void
44GST_hello_stop (void); 59GST_hello_stop (void);
45 60
61
46/** 62/**
63 * Obtain this peers HELLO message.
47 * 64 *
65 * @return our HELLO message
48 */ 66 */
49const struct GNUNET_MessageHeader * 67const struct GNUNET_MessageHeader *
50GST_hello_get (void); 68GST_hello_get (void);
51 69
70
52/** 71/**
72 * Add or remove an address from this peer's HELLO message.
53 * 73 *
74 * @param addremove GNUNET_YES to add, GNUNET_NO to remove
75 * @param plugin_name name of the plugin for which this is an address
76 * @param plugin_address address in a plugin-specific format
77 * @param plugin_address_len number of bytes in plugin_address
54 */ 78 */
55void 79void
56GST_hello_modify_addresses (int addremove, 80GST_hello_modify_addresses (int addremove,
@@ -58,13 +82,25 @@ GST_hello_modify_addresses (int addremove,
58 const void *plugin_address, 82 const void *plugin_address,
59 size_t plugin_address_len); 83 size_t plugin_address_len);
60 84
85
61/** 86/**
87 * Test if a particular address is one of ours.
62 * 88 *
89 * @param plugin_name name of the plugin for which this is an address
90 * @param plugin_address address in a plugin-specific format
91 * @param plugin_address_len number of bytes in plugin_address
92 * @param sig location where to cache PONG signatures for this address [set]
93 * @param sig_expiration how long until the current 'sig' expires?
94 * (ZERO if sig was never created) [set]
95 * @return GNUNET_YES if this is one of our addresses,
96 * GNUNET_NO if not
63 */ 97 */
64int 98int
65GST_hello_test_address (const char *plugin_name, 99GST_hello_test_address (const char *plugin_name,
66 const void *plugin_address, 100 const void *plugin_address,
67 size_t plugin_address_len); 101 size_t plugin_address_len,
102 struct GNUNET_CRYPTO_RsaSignature **sig,
103 struct GNUNET_TIME_Absolute **sig_expiration);
68 104
69 105
70#endif 106#endif