diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-06-28 14:16:32 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-06-28 14:16:32 +0000 |
commit | 166d8f9122bf7ebbaa2a662d09a3fa4d34f6d092 (patch) | |
tree | 9ab533b4e348a188f23dd42de8c3b27432171fec /src/transport/plugin_transport_template.c | |
parent | 7db87ca220b88ab3def7eae25c597d8c2cce9900 (diff) | |
download | gnunet-166d8f9122bf7ebbaa2a662d09a3fa4d34f6d092.tar.gz gnunet-166d8f9122bf7ebbaa2a662d09a3fa4d34f6d092.zip |
updating template with address options
Diffstat (limited to 'src/transport/plugin_transport_template.c')
-rw-r--r-- | src/transport/plugin_transport_template.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/transport/plugin_transport_template.c b/src/transport/plugin_transport_template.c index fd2f70c57..dfe6ff6fa 100644 --- a/src/transport/plugin_transport_template.c +++ b/src/transport/plugin_transport_template.c | |||
@@ -42,6 +42,7 @@ | |||
42 | */ | 42 | */ |
43 | #define LEARNED_ADDRESS_EXPIRATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 6) | 43 | #define LEARNED_ADDRESS_EXPIRATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 6) |
44 | 44 | ||
45 | #define PLUGIN_NAME "template" | ||
45 | 46 | ||
46 | /** | 47 | /** |
47 | * Encapsulation of all of the state of the plugin. | 48 | * Encapsulation of all of the state of the plugin. |
@@ -106,6 +107,20 @@ struct Session | |||
106 | 107 | ||
107 | }; | 108 | }; |
108 | 109 | ||
110 | #define GNUNET_NETWORK_STRUCT_BEGIN | ||
111 | |||
112 | struct TemplateAddress | ||
113 | { | ||
114 | /** | ||
115 | * Address options in NBO | ||
116 | */ | ||
117 | uint32_t options GNUNET_PACKED; | ||
118 | |||
119 | /* Add address here */ | ||
120 | }; | ||
121 | |||
122 | GNUNET_NETWORK_STRUCT_END | ||
123 | |||
109 | /** | 124 | /** |
110 | * Encapsulation of all of the state of the plugin. | 125 | * Encapsulation of all of the state of the plugin. |
111 | */ | 126 | */ |
@@ -121,6 +136,10 @@ struct Plugin | |||
121 | */ | 136 | */ |
122 | struct Session *sessions; | 137 | struct Session *sessions; |
123 | 138 | ||
139 | /** | ||
140 | * Options in HBO to be used with addresses | ||
141 | */ | ||
142 | |||
124 | }; | 143 | }; |
125 | 144 | ||
126 | 145 | ||
@@ -231,8 +250,7 @@ template_plugin_address_suggested (void *cls, const void *addr, size_t addrlen) | |||
231 | { | 250 | { |
232 | /* struct Plugin *plugin = cls; */ | 251 | /* struct Plugin *plugin = cls; */ |
233 | 252 | ||
234 | /* check if the address is plausible; if so, | 253 | /* check if the address is belonging to the plugin*/ |
235 | * add it to our list! */ | ||
236 | return GNUNET_OK; | 254 | return GNUNET_OK; |
237 | } | 255 | } |
238 | 256 | ||
@@ -251,6 +269,10 @@ template_plugin_address_suggested (void *cls, const void *addr, size_t addrlen) | |||
251 | static const char * | 269 | static const char * |
252 | template_plugin_address_to_string (void *cls, const void *addr, size_t addrlen) | 270 | template_plugin_address_to_string (void *cls, const void *addr, size_t addrlen) |
253 | { | 271 | { |
272 | /* | ||
273 | * Parse string in format template.options.address | ||
274 | */ | ||
275 | |||
254 | GNUNET_break (0); | 276 | GNUNET_break (0); |
255 | return NULL; | 277 | return NULL; |
256 | } | 278 | } |
@@ -272,6 +294,11 @@ static int | |||
272 | template_plugin_string_to_address (void *cls, const char *addr, uint16_t addrlen, | 294 | template_plugin_string_to_address (void *cls, const char *addr, uint16_t addrlen, |
273 | void **buf, size_t *added) | 295 | void **buf, size_t *added) |
274 | { | 296 | { |
297 | |||
298 | /* | ||
299 | * Print address in format template.options.address | ||
300 | */ | ||
301 | |||
275 | GNUNET_break (0); | 302 | GNUNET_break (0); |
276 | return GNUNET_SYSERR; | 303 | return GNUNET_SYSERR; |
277 | } | 304 | } |