aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/network-structures.tm33
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/network-structures.tm b/doc/network-structures.tm
index 3f65c93..113062d 100644
--- a/doc/network-structures.tm
+++ b/doc/network-structures.tm
@@ -320,6 +320,39 @@
320 320
321 In contrast to C structures, Scheme-GNUnet network structures are always 321 In contrast to C structures, Scheme-GNUnet network structures are always
322 packed \V there are no \<#2018\>gaps\<#2019\> between fields. 322 packed \V there are no \<#2018\>gaps\<#2019\> between fields.
323
324 <section|Writing new (gnu gnunet <text-dots> struct) modules, converted
325 from C<index|(gnu gnunet <text-dots> struct)>>
326
327 In Scheme-GNUnet, the message types for a service are defined in a module
328 named <scm|(gnu gnunet ... struct)>, where <scm|...> is a symbol
329 representing the service. If you want to port a service from the C
330 implementation to Scheme, the following approach is recommended
331
332 <\enumerate>
333 <item>Download the source code of the C implementation.
334
335 <item>Go to the directory containing the implementation of the service.
336
337 <item>Search for <cpp|struct GNUNET_MessageHeader header;>, e.g. with
338 <code*|git grep -F GNUNET_MessageHeader>. C structures containing this
339 field are usually network messages that need a Scheme definition.
340
341 <item>Write the Scheme equivalent of these C structures.
342
343 <item>While you're at it, try clarifying the comments (which in Scheme
344 become \<#2018\>synopsis\<#2019\> and \<#2018\>description\<#2019\>) \U
345 if you read the description, do you understand when then message should
346 be sent and when it can received? Are there request-response pairs? \U
347 You don't have to make a literal copy of the C comments.
348
349 To better understand the message types, you can read the C implementation
350 or the \<#2018\>developer manual' \U at time of writing, GANA does not
351 have specifications of the client-service protocol.
352
353 The information you learn along the way will most likely be useful for
354 completing the port.
355 </enumerate>
323</body> 356</body>
324 357
325<\initial> 358<\initial>