diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-04 14:17:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-04 14:17:40 +0000 |
commit | 3ba21d7f05658f4c9a090a41ffbe04c6729d0916 (patch) | |
tree | 2e23aa6d04a917987f393048b7d007e488d7f1a8 /src/transport/gnunet-service-transport_hello.h | |
parent | 58cc7545c068d1deb7f7085822646313d5271b0f (diff) | |
download | gnunet-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.h | 42 |
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 | */ |
37 | void | 40 | typedef void (*GST_HelloCallback)(void *cls, |
38 | GST_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 | */ | ||
50 | void | ||
51 | GST_hello_start (GST_HelloCallback cb, | ||
52 | void *cb_cls); | ||
53 | |||
54 | |||
55 | /** | ||
56 | * Shutdown the HELLO module. | ||
42 | */ | 57 | */ |
43 | void | 58 | void |
44 | GST_hello_stop (void); | 59 | GST_hello_stop (void); |
45 | 60 | ||
61 | |||
46 | /** | 62 | /** |
63 | * Obtain this peers HELLO message. | ||
47 | * | 64 | * |
65 | * @return our HELLO message | ||
48 | */ | 66 | */ |
49 | const struct GNUNET_MessageHeader * | 67 | const struct GNUNET_MessageHeader * |
50 | GST_hello_get (void); | 68 | GST_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 | */ |
55 | void | 79 | void |
56 | GST_hello_modify_addresses (int addremove, | 80 | GST_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 | */ |
64 | int | 98 | int |
65 | GST_hello_test_address (const char *plugin_name, | 99 | GST_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 |