aboutsummaryrefslogtreecommitdiff
path: root/doc/old/tutorial
diff options
context:
space:
mode:
Diffstat (limited to 'doc/old/tutorial')
-rw-r--r--doc/old/tutorial/.gitignore11
-rw-r--r--doc/old/tutorial/Makefile.am79
-rw-r--r--doc/old/tutorial/agpl-3.0.texi698
-rw-r--r--doc/old/tutorial/docstyle.css76
-rw-r--r--doc/old/tutorial/examples/001.c30
-rw-r--r--doc/old/tutorial/examples/002.c17
-rw-r--r--doc/old/tutorial/examples/003.c11
-rw-r--r--doc/old/tutorial/examples/004.c5
-rw-r--r--doc/old/tutorial/examples/005.c9
-rw-r--r--doc/old/tutorial/examples/006.c31
-rw-r--r--doc/old/tutorial/examples/007.c10
-rw-r--r--doc/old/tutorial/examples/008.c22
-rw-r--r--doc/old/tutorial/examples/009.c10
-rw-r--r--doc/old/tutorial/examples/010.c8
-rw-r--r--doc/old/tutorial/examples/011.c8
-rw-r--r--doc/old/tutorial/examples/012.c5
-rw-r--r--doc/old/tutorial/examples/013.1.c3
-rw-r--r--doc/old/tutorial/examples/013.c12
-rw-r--r--doc/old/tutorial/examples/014.c8
-rw-r--r--doc/old/tutorial/examples/015.c8
-rw-r--r--doc/old/tutorial/examples/016.c4
-rw-r--r--doc/old/tutorial/examples/017.c4
-rw-r--r--doc/old/tutorial/examples/018.c2
-rw-r--r--doc/old/tutorial/examples/019.c18
-rw-r--r--doc/old/tutorial/examples/020.c25
-rw-r--r--doc/old/tutorial/examples/021.c13
-rw-r--r--doc/old/tutorial/examples/022.c8
-rw-r--r--doc/old/tutorial/examples/023.c17
-rw-r--r--doc/old/tutorial/examples/024.c9
-rw-r--r--doc/old/tutorial/examples/025.Makefile.am15
-rw-r--r--doc/old/tutorial/examples/026.c52
-rw-r--r--doc/old/tutorial/examples/testbed_test.c100
-rw-r--r--doc/old/tutorial/fdl-1.3.texi505
-rw-r--r--doc/old/tutorial/gpl-3.0.texi717
-rw-r--r--doc/old/tutorial/htmlxref.cnf668
-rw-r--r--doc/old/tutorial/manual.css52
-rw-r--r--doc/old/tutorial/reset.css114
-rwxr-xr-xdoc/old/tutorial/run-gendocs.sh18
-rw-r--r--doc/old/tutorial/style.css174
-rw-r--r--doc/old/tutorial/tutorial.texi1568
40 files changed, 5144 insertions, 0 deletions
diff --git a/doc/old/tutorial/.gitignore b/doc/old/tutorial/.gitignore
new file mode 100644
index 000000000..11bb2078e
--- /dev/null
+++ b/doc/old/tutorial/.gitignore
@@ -0,0 +1,11 @@
1stamp-1
2version2.texi
3tutorial
4*.fn
5*.fns
6*.ky
7*.pg
8*.tp
9*.vr
10tutorial
11tutorial.html
diff --git a/doc/old/tutorial/Makefile.am b/doc/old/tutorial/Makefile.am
new file mode 100644
index 000000000..afe4aa6c0
--- /dev/null
+++ b/doc/old/tutorial/Makefile.am
@@ -0,0 +1,79 @@
1# This Makefile.am is in the public domain
2docdir = $(datadir)/doc/gnunet/
3
4AM_MAKEINFOHTMLFLAGS = $(TEXINFO_HTMLFLAGS)
5
6
7gnunet_tutorial_examples = \
8 examples/001.c \
9 examples/002.c \
10 examples/003.c \
11 examples/004.c \
12 examples/005.c \
13 examples/006.c \
14 examples/007.c \
15 examples/008.c \
16 examples/009.c \
17 examples/010.c \
18 examples/011.c \
19 examples/012.c \
20 examples/013.c \
21 examples/013.1.c \
22 examples/014.c \
23 examples/015.c \
24 examples/016.c \
25 examples/017.c \
26 examples/018.c \
27 examples/019.c \
28 examples/020.c \
29 examples/021.c \
30 examples/022.c \
31 examples/023.c \
32 examples/024.c \
33 examples/025.Makefile.am \
34 examples/026.c \
35 examples/testbed_test.c
36
37info_TEXINFOS = tutorial.texi
38
39tutorial_TEXINFOS = \
40 fdl-1.3.texi \
41 gpl-3.0.texi \
42 agpl-3.0.texi \
43 version.texi
44
45EXTRA_DIST = \
46 $(tutorial_TEXINFOS) \
47 $(gnunet_tutorial_examples) \
48 htmlxref.cnf \
49 run-gendocs.sh \
50 docstyle.css \
51 manual.css \
52 reset.css \
53 style.css
54
55
56DISTCLEANFILES = \
57 tutorial.cps \
58 fdl-1.3.cps \
59 agpl-3.0.cps \
60 gpl-3.0.cps
61
62
63CLEANFILES= \
64 stamp-vti \
65 version.texi \
66 tutorial.t2p \
67 $(DISTCLEANFILES)
68
69doc-all-install:
70 @mkdir -p $(DESTDIR)/$(docdir)
71 @mkdir -p $(DESTDIR)/$(infoimagedir)
72 @mkdir -p $(DESTDIR)/$(infodir)
73 @install -m 0755 gnunet-tutorial.pdf $(DESTDIR)/$(docdir)
74 @install -m 0755 gnunet-tutorial.info $(DESTDIR)/$(infodir)
75 @install gnunet-tutorial.html $(DESTDIR)/$(docdir)
76
77doc-gendoc-install:
78 @mkdir -p $(DESTDIR)/$(docdir)
79 @cp -r manual $(DESTDIR)/$(docdir)
diff --git a/doc/old/tutorial/agpl-3.0.texi b/doc/old/tutorial/agpl-3.0.texi
new file mode 100644
index 000000000..eabb0c6df
--- /dev/null
+++ b/doc/old/tutorial/agpl-3.0.texi
@@ -0,0 +1,698 @@
1@c The GNU Affero General Public License.
2@center Version 3, 19 November 2007
3
4@c This file is intended to be included within another document,
5@c hence no sectioning command or @node.
6
7@display
8Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{https://fsf.org/}
9
10Everyone is permitted to copy and distribute verbatim copies of this
11license document, but changing it is not allowed.
12@end display
13
14@heading Preamble
15
16The GNU Affero General Public License is a free, copyleft license
17for software and other kinds of works, specifically designed to ensure
18cooperation with the community in the case of network server software.
19
20The licenses for most software and other practical works are
21designed to take away your freedom to share and change the works. By
22contrast, our General Public Licenses are intended to guarantee your
23freedom to share and change all versions of a program--to make sure it
24remains free software for all its users.
25
26When we speak of free software, we are referring to freedom, not
27price. Our General Public Licenses are designed to make sure that you
28have the freedom to distribute copies of free software (and charge for
29them if you wish), that you receive source code or can get it if you
30want it, that you can change the software or use pieces of it in new
31free programs, and that you know you can do these things.
32
33Developers that use our General Public Licenses protect your rights
34with two steps: (1) assert copyright on the software, and (2) offer
35you this License which gives you legal permission to copy, distribute
36and/or modify the software.
37
38A secondary benefit of defending all users' freedom is that
39improvements made in alternate versions of the program, if they
40receive widespread use, become available for other developers to
41incorporate. Many developers of free software are heartened and
42encouraged by the resulting cooperation. However, in the case of
43software used on network servers, this result may fail to come about.
44The GNU General Public License permits making a modified version and
45letting the public access it on a server without ever releasing its
46source code to the public.
47
48The GNU Affero General Public License is designed specifically to
49ensure that, in such cases, the modified source code becomes available
50to the community. It requires the operator of a network server to
51provide the source code of the modified version running there to the
52users of that server. Therefore, public use of a modified version, on
53a publicly accessible server, gives the public access to the source
54code of the modified version.
55
56An older license, called the Affero General Public License and
57published by Affero, was designed to accomplish similar goals. This is
58a different license, not a version of the Affero GPL, but Affero has
59released a new version of the Affero GPL which permits relicensing under
60this license.
61
62The precise terms and conditions for copying, distribution and
63modification follow.
64
65@heading TERMS AND CONDITIONS
66
67@enumerate 0
68@item Definitions.
69
70``This License'' refers to version 3 of the GNU Affero General Public License.
71
72``Copyright'' also means copyright-like laws that apply to other kinds
73of works, such as semiconductor masks.
74
75``The Program'' refers to any copyrightable work licensed under this
76License. Each licensee is addressed as ``you''. ``Licensees'' and
77``recipients'' may be individuals or organizations.
78
79To ``modify'' a work means to copy from or adapt all or part of the work
80in a fashion requiring copyright permission, other than the making of
81an exact copy. The resulting work is called a ``modified version'' of
82the earlier work or a work ``based on'' the earlier work.
83
84A ``covered work'' means either the unmodified Program or a work based
85on the Program.
86
87To ``propagate'' a work means to do anything with it that, without
88permission, would make you directly or secondarily liable for
89infringement under applicable copyright law, except executing it on a
90computer or modifying a private copy. Propagation includes copying,
91distribution (with or without modification), making available to the
92public, and in some countries other activities as well.
93
94To ``convey'' a work means any kind of propagation that enables other
95parties to make or receive copies. Mere interaction with a user
96through a computer network, with no transfer of a copy, is not
97conveying.
98
99An interactive user interface displays ``Appropriate Legal Notices'' to
100the extent that it includes a convenient and prominently visible
101feature that (1) displays an appropriate copyright notice, and (2)
102tells the user that there is no warranty for the work (except to the
103extent that warranties are provided), that licensees may convey the
104work under this License, and how to view a copy of this License. If
105the interface presents a list of user commands or options, such as a
106menu, a prominent item in the list meets this criterion.
107
108@item Source Code.
109
110The ``source code'' for a work means the preferred form of the work for
111making modifications to it. ``Object code'' means any non-source form
112of a work.
113
114A ``Standard Interface'' means an interface that either is an official
115standard defined by a recognized standards body, or, in the case of
116interfaces specified for a particular programming language, one that
117is widely used among developers working in that language.
118
119The ``System Libraries'' of an executable work include anything, other
120than the work as a whole, that (a) is included in the normal form of
121packaging a Major Component, but which is not part of that Major
122Component, and (b) serves only to enable use of the work with that
123Major Component, or to implement a Standard Interface for which an
124implementation is available to the public in source code form. A
125``Major Component'', in this context, means a major essential component
126(kernel, window system, and so on) of the specific operating system
127(if any) on which the executable work runs, or a compiler used to
128produce the work, or an object code interpreter used to run it.
129
130The ``Corresponding Source'' for a work in object code form means all
131the source code needed to generate, install, and (for an executable
132work) run the object code and to modify the work, including scripts to
133control those activities. However, it does not include the work's
134System Libraries, or general-purpose tools or generally available free
135programs which are used unmodified in performing those activities but
136which are not part of the work. For example, Corresponding Source
137includes interface definition files associated with source files for
138the work, and the source code for shared libraries and dynamically
139linked subprograms that the work is specifically designed to require,
140such as by intimate data communication or control flow between those
141subprograms and other parts of the work.
142
143The Corresponding Source need not include anything that users can
144regenerate automatically from other parts of the Corresponding Source.
145
146The Corresponding Source for a work in source code form is that same
147work.
148
149@item Basic Permissions.
150
151All rights granted under this License are granted for the term of
152copyright on the Program, and are irrevocable provided the stated
153conditions are met. This License explicitly affirms your unlimited
154permission to run the unmodified Program. The output from running a
155covered work is covered by this License only if the output, given its
156content, constitutes a covered work. This License acknowledges your
157rights of fair use or other equivalent, as provided by copyright law.
158
159You may make, run and propagate covered works that you do not convey,
160without conditions so long as your license otherwise remains in force.
161You may convey covered works to others for the sole purpose of having
162them make modifications exclusively for you, or provide you with
163facilities for running those works, provided that you comply with the
164terms of this License in conveying all material for which you do not
165control copyright. Those thus making or running the covered works for
166you must do so exclusively on your behalf, under your direction and
167control, on terms that prohibit them from making any copies of your
168copyrighted material outside their relationship with you.
169
170Conveying under any other circumstances is permitted solely under the
171conditions stated below. Sublicensing is not allowed; section 10
172makes it unnecessary.
173
174@item Protecting Users' Legal Rights From Anti-Circumvention Law.
175
176No covered work shall be deemed part of an effective technological
177measure under any applicable law fulfilling obligations under article
17811 of the WIPO copyright treaty adopted on 20 December 1996, or
179similar laws prohibiting or restricting circumvention of such
180measures.
181
182When you convey a covered work, you waive any legal power to forbid
183circumvention of technological measures to the extent such
184circumvention is effected by exercising rights under this License with
185respect to the covered work, and you disclaim any intention to limit
186operation or modification of the work as a means of enforcing, against
187the work's users, your or third parties' legal rights to forbid
188circumvention of technological measures.
189
190@item Conveying Verbatim Copies.
191
192You may convey verbatim copies of the Program's source code as you
193receive it, in any medium, provided that you conspicuously and
194appropriately publish on each copy an appropriate copyright notice;
195keep intact all notices stating that this License and any
196non-permissive terms added in accord with section 7 apply to the code;
197keep intact all notices of the absence of any warranty; and give all
198recipients a copy of this License along with the Program.
199
200You may charge any price or no price for each copy that you convey,
201and you may offer support or warranty protection for a fee.
202
203@item Conveying Modified Source Versions.
204
205You may convey a work based on the Program, or the modifications to
206produce it from the Program, in the form of source code under the
207terms of section 4, provided that you also meet all of these
208conditions:
209
210@enumerate a
211@item
212The work must carry prominent notices stating that you modified it,
213and giving a relevant date.
214
215@item
216The work must carry prominent notices stating that it is released
217under this License and any conditions added under section 7. This
218requirement modifies the requirement in section 4 to ``keep intact all
219notices''.
220
221@item
222You must license the entire work, as a whole, under this License to
223anyone who comes into possession of a copy. This License will
224therefore apply, along with any applicable section 7 additional terms,
225to the whole of the work, and all its parts, regardless of how they
226are packaged. This License gives no permission to license the work in
227any other way, but it does not invalidate such permission if you have
228separately received it.
229
230@item
231If the work has interactive user interfaces, each must display
232Appropriate Legal Notices; however, if the Program has interactive
233interfaces that do not display Appropriate Legal Notices, your work
234need not make them do so.
235@end enumerate
236
237A compilation of a covered work with other separate and independent
238works, which are not by their nature extensions of the covered work,
239and which are not combined with it such as to form a larger program,
240in or on a volume of a storage or distribution medium, is called an
241``aggregate'' if the compilation and its resulting copyright are not
242used to limit the access or legal rights of the compilation's users
243beyond what the individual works permit. Inclusion of a covered work
244in an aggregate does not cause this License to apply to the other
245parts of the aggregate.
246
247@item Conveying Non-Source Forms.
248
249You may convey a covered work in object code form under the terms of
250sections 4 and 5, provided that you also convey the machine-readable
251Corresponding Source under the terms of this License, in one of these
252ways:
253
254@enumerate a
255@item
256Convey the object code in, or embodied in, a physical product
257(including a physical distribution medium), accompanied by the
258Corresponding Source fixed on a durable physical medium customarily
259used for software interchange.
260
261@item
262Convey the object code in, or embodied in, a physical product
263(including a physical distribution medium), accompanied by a written
264offer, valid for at least three years and valid for as long as you
265offer spare parts or customer support for that product model, to give
266anyone who possesses the object code either (1) a copy of the
267Corresponding Source for all the software in the product that is
268covered by this License, on a durable physical medium customarily used
269for software interchange, for a price no more than your reasonable
270cost of physically performing this conveying of source, or (2) access
271to copy the Corresponding Source from a network server at no charge.
272
273@item
274Convey individual copies of the object code with a copy of the written
275offer to provide the Corresponding Source. This alternative is
276allowed only occasionally and noncommercially, and only if you
277received the object code with such an offer, in accord with subsection
2786b.
279
280@item
281Convey the object code by offering access from a designated place
282(gratis or for a charge), and offer equivalent access to the
283Corresponding Source in the same way through the same place at no
284further charge. You need not require recipients to copy the
285Corresponding Source along with the object code. If the place to copy
286the object code is a network server, the Corresponding Source may be
287on a different server (operated by you or a third party) that supports
288equivalent copying facilities, provided you maintain clear directions
289next to the object code saying where to find the Corresponding Source.
290Regardless of what server hosts the Corresponding Source, you remain
291obligated to ensure that it is available for as long as needed to
292satisfy these requirements.
293
294@item
295Convey the object code using peer-to-peer transmission, provided you
296inform other peers where the object code and Corresponding Source of
297the work are being offered to the general public at no charge under
298subsection 6d.
299
300@end enumerate
301
302A separable portion of the object code, whose source code is excluded
303from the Corresponding Source as a System Library, need not be
304included in conveying the object code work.
305
306A ``User Product'' is either (1) a ``consumer product'', which means any
307tangible personal property which is normally used for personal,
308family, or household purposes, or (2) anything designed or sold for
309incorporation into a dwelling. In determining whether a product is a
310consumer product, doubtful cases shall be resolved in favor of
311coverage. For a particular product received by a particular user,
312``normally used'' refers to a typical or common use of that class of
313product, regardless of the status of the particular user or of the way
314in which the particular user actually uses, or expects or is expected
315to use, the product. A product is a consumer product regardless of
316whether the product has substantial commercial, industrial or
317non-consumer uses, unless such uses represent the only significant
318mode of use of the product.
319
320``Installation Information'' for a User Product means any methods,
321procedures, authorization keys, or other information required to
322install and execute modified versions of a covered work in that User
323Product from a modified version of its Corresponding Source. The
324information must suffice to ensure that the continued functioning of
325the modified object code is in no case prevented or interfered with
326solely because modification has been made.
327
328If you convey an object code work under this section in, or with, or
329specifically for use in, a User Product, and the conveying occurs as
330part of a transaction in which the right of possession and use of the
331User Product is transferred to the recipient in perpetuity or for a
332fixed term (regardless of how the transaction is characterized), the
333Corresponding Source conveyed under this section must be accompanied
334by the Installation Information. But this requirement does not apply
335if neither you nor any third party retains the ability to install
336modified object code on the User Product (for example, the work has
337been installed in ROM).
338
339The requirement to provide Installation Information does not include a
340requirement to continue to provide support service, warranty, or
341updates for a work that has been modified or installed by the
342recipient, or for the User Product in which it has been modified or
343installed. Access to a network may be denied when the modification
344itself materially and adversely affects the operation of the network
345or violates the rules and protocols for communication across the
346network.
347
348Corresponding Source conveyed, and Installation Information provided,
349in accord with this section must be in a format that is publicly
350documented (and with an implementation available to the public in
351source code form), and must require no special password or key for
352unpacking, reading or copying.
353
354@item Additional Terms.
355
356``Additional permissions'' are terms that supplement the terms of this
357License by making exceptions from one or more of its conditions.
358Additional permissions that are applicable to the entire Program shall
359be treated as though they were included in this License, to the extent
360that they are valid under applicable law. If additional permissions
361apply only to part of the Program, that part may be used separately
362under those permissions, but the entire Program remains governed by
363this License without regard to the additional permissions.
364
365When you convey a copy of a covered work, you may at your option
366remove any additional permissions from that copy, or from any part of
367it. (Additional permissions may be written to require their own
368removal in certain cases when you modify the work.) You may place
369additional permissions on material, added by you to a covered work,
370for which you have or can give appropriate copyright permission.
371
372Notwithstanding any other provision of this License, for material you
373add to a covered work, you may (if authorized by the copyright holders
374of that material) supplement the terms of this License with terms:
375
376@enumerate a
377@item
378Disclaiming warranty or limiting liability differently from the terms
379of sections 15 and 16 of this License; or
380
381@item
382Requiring preservation of specified reasonable legal notices or author
383attributions in that material or in the Appropriate Legal Notices
384displayed by works containing it; or
385
386@item
387Prohibiting misrepresentation of the origin of that material, or
388requiring that modified versions of such material be marked in
389reasonable ways as different from the original version; or
390
391@item
392Limiting the use for publicity purposes of names of licensors or
393authors of the material; or
394
395@item
396Declining to grant rights under trademark law for use of some trade
397names, trademarks, or service marks; or
398
399@item
400Requiring indemnification of licensors and authors of that material by
401anyone who conveys the material (or modified versions of it) with
402contractual assumptions of liability to the recipient, for any
403liability that these contractual assumptions directly impose on those
404licensors and authors.
405@end enumerate
406
407All other non-permissive additional terms are considered ``further
408restrictions'' within the meaning of section 10. If the Program as you
409received it, or any part of it, contains a notice stating that it is
410governed by this License along with a term that is a further
411restriction, you may remove that term. If a license document contains
412a further restriction but permits relicensing or conveying under this
413License, you may add to a covered work material governed by the terms
414of that license document, provided that the further restriction does
415not survive such relicensing or conveying.
416
417If you add terms to a covered work in accord with this section, you
418must place, in the relevant source files, a statement of the
419additional terms that apply to those files, or a notice indicating
420where to find the applicable terms.
421
422Additional terms, permissive or non-permissive, may be stated in the
423form of a separately written license, or stated as exceptions; the
424above requirements apply either way.
425
426@item Termination.
427
428You may not propagate or modify a covered work except as expressly
429provided under this License. Any attempt otherwise to propagate or
430modify it is void, and will automatically terminate your rights under
431this License (including any patent licenses granted under the third
432paragraph of section 11).
433
434However, if you cease all violation of this License, then your license
435from a particular copyright holder is reinstated (a) provisionally,
436unless and until the copyright holder explicitly and finally
437terminates your license, and (b) permanently, if the copyright holder
438fails to notify you of the violation by some reasonable means prior to
43960 days after the cessation.
440
441Moreover, your license from a particular copyright holder is
442reinstated permanently if the copyright holder notifies you of the
443violation by some reasonable means, this is the first time you have
444received notice of violation of this License (for any work) from that
445copyright holder, and you cure the violation prior to 30 days after
446your receipt of the notice.
447
448Termination of your rights under this section does not terminate the
449licenses of parties who have received copies or rights from you under
450this License. If your rights have been terminated and not permanently
451reinstated, you do not qualify to receive new licenses for the same
452material under section 10.
453
454@item Acceptance Not Required for Having Copies.
455
456You are not required to accept this License in order to receive or run
457a copy of the Program. Ancillary propagation of a covered work
458occurring solely as a consequence of using peer-to-peer transmission
459to receive a copy likewise does not require acceptance. However,
460nothing other than this License grants you permission to propagate or
461modify any covered work. These actions infringe copyright if you do
462not accept this License. Therefore, by modifying or propagating a
463covered work, you indicate your acceptance of this License to do so.
464
465@item Automatic Licensing of Downstream Recipients.
466
467Each time you convey a covered work, the recipient automatically
468receives a license from the original licensors, to run, modify and
469propagate that work, subject to this License. You are not responsible
470for enforcing compliance by third parties with this License.
471
472An ``entity transaction'' is a transaction transferring control of an
473organization, or substantially all assets of one, or subdividing an
474organization, or merging organizations. If propagation of a covered
475work results from an entity transaction, each party to that
476transaction who receives a copy of the work also receives whatever
477licenses to the work the party's predecessor in interest had or could
478give under the previous paragraph, plus a right to possession of the
479Corresponding Source of the work from the predecessor in interest, if
480the predecessor has it or can get it with reasonable efforts.
481
482You may not impose any further restrictions on the exercise of the
483rights granted or affirmed under this License. For example, you may
484not impose a license fee, royalty, or other charge for exercise of
485rights granted under this License, and you may not initiate litigation
486(including a cross-claim or counterclaim in a lawsuit) alleging that
487any patent claim is infringed by making, using, selling, offering for
488sale, or importing the Program or any portion of it.
489
490@item Patents.
491
492A ``contributor'' is a copyright holder who authorizes use under this
493License of the Program or a work on which the Program is based. The
494work thus licensed is called the contributor's ``contributor version''.
495
496A contributor's ``essential patent claims'' are all patent claims owned
497or controlled by the contributor, whether already acquired or
498hereafter acquired, that would be infringed by some manner, permitted
499by this License, of making, using, or selling its contributor version,
500but do not include claims that would be infringed only as a
501consequence of further modification of the contributor version. For
502purposes of this definition, ``control'' includes the right to grant
503patent sublicenses in a manner consistent with the requirements of
504this License.
505
506Each contributor grants you a non-exclusive, worldwide, royalty-free
507patent license under the contributor's essential patent claims, to
508make, use, sell, offer for sale, import and otherwise run, modify and
509propagate the contents of its contributor version.
510
511In the following three paragraphs, a ``patent license'' is any express
512agreement or commitment, however denominated, not to enforce a patent
513(such as an express permission to practice a patent or covenant not to
514sue for patent infringement). To ``grant'' such a patent license to a
515party means to make such an agreement or commitment not to enforce a
516patent against the party.
517
518If you convey a covered work, knowingly relying on a patent license,
519and the Corresponding Source of the work is not available for anyone
520to copy, free of charge and under the terms of this License, through a
521publicly available network server or other readily accessible means,
522then you must either (1) cause the Corresponding Source to be so
523available, or (2) arrange to deprive yourself of the benefit of the
524patent license for this particular work, or (3) arrange, in a manner
525consistent with the requirements of this License, to extend the patent
526license to downstream recipients. ``Knowingly relying'' means you have
527actual knowledge that, but for the patent license, your conveying the
528covered work in a country, or your recipient's use of the covered work
529in a country, would infringe one or more identifiable patents in that
530country that you have reason to believe are valid.
531
532If, pursuant to or in connection with a single transaction or
533arrangement, you convey, or propagate by procuring conveyance of, a
534covered work, and grant a patent license to some of the parties
535receiving the covered work authorizing them to use, propagate, modify
536or convey a specific copy of the covered work, then the patent license
537you grant is automatically extended to all recipients of the covered
538work and works based on it.
539
540A patent license is ``discriminatory'' if it does not include within the
541scope of its coverage, prohibits the exercise of, or is conditioned on
542the non-exercise of one or more of the rights that are specifically
543granted under this License. You may not convey a covered work if you
544are a party to an arrangement with a third party that is in the
545business of distributing software, under which you make payment to the
546third party based on the extent of your activity of conveying the
547work, and under which the third party grants, to any of the parties
548who would receive the covered work from you, a discriminatory patent
549license (a) in connection with copies of the covered work conveyed by
550you (or copies made from those copies), or (b) primarily for and in
551connection with specific products or compilations that contain the
552covered work, unless you entered into that arrangement, or that patent
553license was granted, prior to 28 March 2007.
554
555Nothing in this License shall be construed as excluding or limiting
556any implied license or other defenses to infringement that may
557otherwise be available to you under applicable patent law.
558
559@item No Surrender of Others' Freedom.
560
561If conditions are imposed on you (whether by court order, agreement or
562otherwise) that contradict the conditions of this License, they do not
563excuse you from the conditions of this License. If you cannot convey
564a covered work so as to satisfy simultaneously your obligations under
565this License and any other pertinent obligations, then as a
566consequence you may not convey it at all. For example, if you agree
567to terms that obligate you to collect a royalty for further conveying
568from those to whom you convey the Program, the only way you could
569satisfy both those terms and this License would be to refrain entirely
570from conveying the Program.
571
572@item Remote Network Interaction; Use with the GNU General Public License.
573
574Notwithstanding any other provision of this License, if you modify the
575Program, your modified version must prominently offer all users interacting
576with it remotely through a computer network (if your version supports such
577interaction) an opportunity to receive the Corresponding Source of your
578version by providing access to the Corresponding Source from a network
579server at no charge, through some standard or customary means of
580facilitating copying of software. This Corresponding Source shall include
581the Corresponding Source for any work covered by version 3 of the GNU
582General Public License that is incorporated pursuant to the following
583paragraph.
584
585Notwithstanding any other provision of this License, you have permission to
586link or combine any covered work with a work licensed under version 3 of
587the GNU General Public License into a single combined work, and to convey
588the resulting work. The terms of this License will continue to apply to
589the part which is the covered work, but the work with which it is combined
590will remain governed by version 3 of the GNU General Public License.
591
592@item Revised Versions of this License.
593
594The Free Software Foundation may publish revised and/or new versions
595of the GNU Affero General Public License from time to time. Such new
596versions will be similar in spirit to the present version, but may
597differ in detail to address new problems or concerns.
598
599Each version is given a distinguishing version number. If the Program
600specifies that a certain numbered version of the GNU Affero General Public
601License ``or any later version'' applies to it, you have the option of
602following the terms and conditions either of that numbered version or
603of any later version published by the Free Software Foundation. If
604the Program does not specify a version number of the GNU Affero General
605Public License, you may choose any version ever published by the Free
606Software Foundation.
607
608If the Program specifies that a proxy can decide which future versions
609of the GNU Affero General Public License can be used, that proxy's public
610statement of acceptance of a version permanently authorizes you to
611choose that version for the Program.
612
613Later license versions may give you additional or different
614permissions. However, no additional obligations are imposed on any
615author or copyright holder as a result of your choosing to follow a
616later version.
617
618@item Disclaimer of Warranty.
619
620THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
621APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
622HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT
623WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
624LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
625A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
626PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
627DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
628CORRECTION.
629
630@item Limitation of Liability.
631
632IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
633WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
634CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
635INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
636ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
637NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
638LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
639TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
640PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
641
642@item Interpretation of Sections 15 and 16.
643
644If the disclaimer of warranty and limitation of liability provided
645above cannot be given local legal effect according to their terms,
646reviewing courts shall apply local law that most closely approximates
647an absolute waiver of all civil liability in connection with the
648Program, unless a warranty or assumption of liability accompanies a
649copy of the Program in return for a fee.
650
651@end enumerate
652
653@heading END OF TERMS AND CONDITIONS
654
655@heading How to Apply These Terms to Your New Programs
656
657If you develop a new program, and you want it to be of the greatest
658possible use to the public, the best way to achieve this is to make it
659free software which everyone can redistribute and change under these
660terms.
661
662To do so, attach the following notices to the program. It is safest
663to attach them to the start of each source file to most effectively
664state the exclusion of warranty; and each file should have at least
665the ``copyright'' line and a pointer to where the full notice is found.
666
667@smallexample
668@var{one line to give the program's name and a brief idea of what it does.}
669Copyright (C) @var{year} @var{name of author}
670
671This program is free software: you can redistribute it and/or modify
672it under the terms of the GNU Affero General Public License as published by
673the Free Software Foundation, either version 3 of the License, or (at
674your option) any later version.
675
676This program is distributed in the hope that it will be useful, but
677WITHOUT ANY WARRANTY; without even the implied warranty of
678MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
679Affero General Public License for more details.
680
681You should have received a copy of the GNU Affero General Public License
682along with this program. If not, see @url{https://www.gnu.org/licenses/}.
683@end smallexample
684
685Also add information on how to contact you by electronic and paper mail.
686
687If your software can interact with users remotely through a computer
688network, you should also make sure that it provides a way for users to
689get its source. For example, if your program is a web application, its
690interface could display a ``Source'' link that leads users to an archive
691of the code. There are many ways you could offer source, and different
692solutions will be better for different programs; see section 13 for the
693specific requirements.
694
695You should also get your employer (if you work as a programmer) or school,
696if any, to sign a ``copyright disclaimer'' for the program, if necessary.
697For more information on this, and how to apply and follow the GNU AGPL, see
698@url{https://www.gnu.org/licenses/}.
diff --git a/doc/old/tutorial/docstyle.css b/doc/old/tutorial/docstyle.css
new file mode 100644
index 000000000..8719248d0
--- /dev/null
+++ b/doc/old/tutorial/docstyle.css
@@ -0,0 +1,76 @@
1html, body {
2 font-size: 1em;
3 text-align: left;
4 text-decoration: none;
5}
6html { background-color: #e7e7e7; }
7
8body {
9 max-width: 74.92em;
10 margin: 0 auto;
11 padding: .5em 1em 1em 1em;
12 background-color: white;
13 border: .1em solid #c0c0c0;
14}
15
16h1, h2, h3, h4 { color: #333; }
17h5, h6, dt { color: #222; }
18
19
20a h3 {
21 color: #005090;
22}
23
24a[href] { color: #005090; }
25a[href]:visited { color: #100070; }
26a[href]:active, a[href]:hover {
27 color: #100070;
28 text-decoration: none;
29}
30
31.linkrow {
32 margin: 3em 0;
33}
34
35.linkrow {
36 text-align: center;
37}
38
39div.example { padding: .8em 1.2em .4em; }
40pre.example { padding: .8em 1.2em; }
41div.example, pre.example {
42 margin: 1em 0 1em 3% ;
43 -webkit-border-radius: .3em;
44 -moz-border-radius: .3em;
45 border-radius: .3em;
46 border: 1px solid #d4cbb6;
47 background-color: #f2efe4;
48}
49div.example > pre.example {
50 padding: 0 0 .4em;
51 margin: 0;
52 border: none;
53}
54
55
56/* This makes the very long tables of contents in Gnulib and other
57 manuals easier to read. */
58.contents ul, .shortcontents ul { font-weight: bold; }
59.contents ul ul, .shortcontents ul ul { font-weight: normal; }
60.contents ul { list-style: none; }
61
62/* For colored navigation bars (Emacs manual): make the bar extend
63 across the whole width of the page and give it a decent height. */
64.header, .node { margin: 0 -1em; padding: 0 1em; }
65.header p, .node p { line-height: 2em; }
66
67/* For navigation links */
68.node a, .header a { display: inline-block; line-height: 2em; }
69.node a:hover, .header a:hover { background: #f2efe4; }
70
71table.cartouche {
72 border-collapse: collapse;
73 border-color: darkred;
74 border-style: solid;
75 border-width: 3px;
76}
diff --git a/doc/old/tutorial/examples/001.c b/doc/old/tutorial/examples/001.c
new file mode 100644
index 000000000..7042118ba
--- /dev/null
+++ b/doc/old/tutorial/examples/001.c
@@ -0,0 +1,30 @@
1#include "platform.h"
2#include <gnunet/platform.h>
3#include <gnunet/gnunet_util_lib.h>
4
5static int ret;
6
7static void
8run (void *cls,
9 char *const *args,
10 const char *cfgfile,
11 const struct GNUNET_CONFIGURATION_Handle *cfg)
12{
13 // main code here
14 ret = 0;
15}
16
17int
18main (int argc, char *const *argv)
19{
20 struct GNUNET_GETOPT_CommandLineOption options[] = {
21 GNUNET_GETOPT_OPTION_END
22 };
23 return (GNUNET_OK ==
24 GNUNET_PROGRAM_run (argc,
25 argv,
26 "binary-name",
27 gettext_noop ("binary description text"),
28 options, &run, NULL)) ? ret : 1;
29}
30
diff --git a/doc/old/tutorial/examples/002.c b/doc/old/tutorial/examples/002.c
new file mode 100644
index 000000000..02233fd61
--- /dev/null
+++ b/doc/old/tutorial/examples/002.c
@@ -0,0 +1,17 @@
1static char *string_option;
2static int a_flag;
3
4// ...
5 struct GNUNET_GETOPT_CommandLineOption options[] = {
6 GNUNET_GETOPT_option_string ('s', "name", "SOMESTRING",
7 gettext_noop ("text describing the string_option NAME"),
8 &string_option},
9 GNUNET_GETOPT_option_flag ('f', "flag",
10 gettext_noop ("text describing the flag option"),
11 &a_flag),
12 GNUNET_GETOPT_OPTION_END
13 };
14 string_option = NULL;
15 a_flag = GNUNET_SYSERR;
16// ...
17
diff --git a/doc/old/tutorial/examples/003.c b/doc/old/tutorial/examples/003.c
new file mode 100644
index 000000000..d158d7e75
--- /dev/null
+++ b/doc/old/tutorial/examples/003.c
@@ -0,0 +1,11 @@
1struct GNUNET_MQ_MessageHandlers handlers[] = {
2 // ...
3 GNUNET_MQ_handler_end ()
4};
5struct GNUNET_MQ_Handle *mq;
6
7mq = GNUNET_CLIENT_connect (cfg,
8 "service-name",
9 handlers,
10 &error_cb,
11 NULL);
diff --git a/doc/old/tutorial/examples/004.c b/doc/old/tutorial/examples/004.c
new file mode 100644
index 000000000..0ef007907
--- /dev/null
+++ b/doc/old/tutorial/examples/004.c
@@ -0,0 +1,5 @@
1struct GNUNET_MessageHeader
2{
3 uint16_t size GNUNET_PACKED;
4 uint16_t type GNUNET_PACKED;
5};
diff --git a/doc/old/tutorial/examples/005.c b/doc/old/tutorial/examples/005.c
new file mode 100644
index 000000000..1b59f85a6
--- /dev/null
+++ b/doc/old/tutorial/examples/005.c
@@ -0,0 +1,9 @@
1struct GNUNET_MQ_Envelope *env;
2struct GNUNET_MessageHeader *msg;
3
4env = GNUNET_MQ_msg_extra (msg, payload_size, GNUNET_MY_MESSAGE_TYPE);
5GNUNET_memcpy (&msg[1],
6 &payload,
7 payload_size);
8// Send message via message queue 'mq'
9GNUNET_mq_send (mq, env);
diff --git a/doc/old/tutorial/examples/006.c b/doc/old/tutorial/examples/006.c
new file mode 100644
index 000000000..944d2b18c
--- /dev/null
+++ b/doc/old/tutorial/examples/006.c
@@ -0,0 +1,31 @@
1static void
2handle_fix (void *cls, const struct MyMessage *msg)
3{
4 // process 'msg'
5}
6
7static int
8check_var (void *cls, const struct MyVarMessage *msg)
9{
10 // check 'msg' is well-formed
11 return GNUNET_OK;
12}
13
14static void
15handle_var (void *cls, const struct MyVarMessage *msg)
16{
17 // process 'msg'
18}
19
20struct GNUNET_MQ_MessageHandler handlers[] = {
21 GNUNET_MQ_hd_fixed_size (fix,
22 GNUNET_MESSAGE_TYPE_MY_FIX,
23 struct MyMessage,
24 NULL),
25 GNUNET_MQ_hd_fixed_size (var,
26 GNUNET_MESSAGE_TYPE_MY_VAR,
27 struct MyVarMessage,
28 NULL),
29
30 GNUNET_MQ_handler_end ()
31};
diff --git a/doc/old/tutorial/examples/007.c b/doc/old/tutorial/examples/007.c
new file mode 100644
index 000000000..096539e43
--- /dev/null
+++ b/doc/old/tutorial/examples/007.c
@@ -0,0 +1,10 @@
1GNUNET_SERVICE_MAIN
2("service-name",
3 GNUNET_SERVICE_OPTION_NONE,
4 &run,
5 &client_connect_cb,
6 &client_disconnect_cb,
7 NULL,
8 GNUNET_MQ_hd_fixed_size (...),
9 GNUNET_MQ_hd_var_size (...),
10 GNUNET_MQ_handler_end ());
diff --git a/doc/old/tutorial/examples/008.c b/doc/old/tutorial/examples/008.c
new file mode 100644
index 000000000..2dffe2cf9
--- /dev/null
+++ b/doc/old/tutorial/examples/008.c
@@ -0,0 +1,22 @@
1static void
2run (void *cls,
3 const struct GNUNET_CONFIGURATION_Handle *c,
4 struct GNUNET_SERVICE_Handle *service)
5{
6}
7
8static void *
9client_connect_cb (void *cls,
10 struct GNUNET_SERVICE_Client *c,
11 struct GNUNET_MQ_Handle *mq)
12{
13 return c;
14}
15
16static void
17client_disconnect_cb (void *cls,
18 struct GNUNET_SERVICE_Client *c,
19 void *internal_cls)
20{
21 GNUNET_assert (c == internal_cls);
22}
diff --git a/doc/old/tutorial/examples/009.c b/doc/old/tutorial/examples/009.c
new file mode 100644
index 000000000..9d6fdd7e7
--- /dev/null
+++ b/doc/old/tutorial/examples/009.c
@@ -0,0 +1,10 @@
1#include "platform.h"
2#include <gnunet/gnunet_core_service.h>
3
4struct GNUNET_CORE_Handle *
5GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
6 void *cls,
7 GNUNET_CORE_StartupCallback init,
8 GNUNET_CORE_ConnectEventHandler connects,
9 GNUNET_CORE_DisconnectEventHandler disconnects,
10 const struct GNUNET_MQ_MessageHandler *handlers);
diff --git a/doc/old/tutorial/examples/010.c b/doc/old/tutorial/examples/010.c
new file mode 100644
index 000000000..33494490d
--- /dev/null
+++ b/doc/old/tutorial/examples/010.c
@@ -0,0 +1,8 @@
1void *
2connects (void *cls,
3 const struct GNUNET_PeerIdentity *peer,
4 struct GNUNET_MQ_Handle *mq)
5{
6 return mq;
7}
8
diff --git a/doc/old/tutorial/examples/011.c b/doc/old/tutorial/examples/011.c
new file mode 100644
index 000000000..23bc051de
--- /dev/null
+++ b/doc/old/tutorial/examples/011.c
@@ -0,0 +1,8 @@
1void
2disconnects (void *cls,
3 const struct GNUNET_PeerIdentity * peer)
4{
5 /* Remove peer's identity from known peers */
6 /* Make sure no messages are sent to peer from now on */
7}
8
diff --git a/doc/old/tutorial/examples/012.c b/doc/old/tutorial/examples/012.c
new file mode 100644
index 000000000..dc59eb506
--- /dev/null
+++ b/doc/old/tutorial/examples/012.c
@@ -0,0 +1,5 @@
1#include "platform.h"
2#include "gnunet_peerstore_service.h"
3
4peerstore_handle = GNUNET_PEERSTORE_connect (cfg);
5
diff --git a/doc/old/tutorial/examples/013.1.c b/doc/old/tutorial/examples/013.1.c
new file mode 100644
index 000000000..fa5212868
--- /dev/null
+++ b/doc/old/tutorial/examples/013.1.c
@@ -0,0 +1,3 @@
1void
2GNUNET_PEERSTORE_store_cancel (struct GNUNET_PEERSTORE_StoreContext
3 *sc);
diff --git a/doc/old/tutorial/examples/013.c b/doc/old/tutorial/examples/013.c
new file mode 100644
index 000000000..6792417e1
--- /dev/null
+++ b/doc/old/tutorial/examples/013.c
@@ -0,0 +1,12 @@
1struct GNUNET_PEERSTORE_StoreContext *
2GNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h,
3 const char *sub_system,
4 const struct GNUNET_PeerIdentity *peer,
5 const char *key,
6 const void *value,
7 size_t size,
8 struct GNUNET_TIME_Absolute expiry,
9 enum GNUNET_PEERSTORE_StoreOption options,
10 GNUNET_PEERSTORE_Continuation cont,
11 void *cont_cls);
12
diff --git a/doc/old/tutorial/examples/014.c b/doc/old/tutorial/examples/014.c
new file mode 100644
index 000000000..db2ed1165
--- /dev/null
+++ b/doc/old/tutorial/examples/014.c
@@ -0,0 +1,8 @@
1struct GNUNET_PEERSTORE_IterateContext *
2GNUNET_PEERSTORE_iterate (struct GNUNET_PEERSTORE_Handle *h,
3 const char *sub_system,
4 const struct GNUNET_PeerIdentity *peer,
5 const char *key,
6 GNUNET_PEERSTORE_Processor callback,
7 void *callback_cls);
8
diff --git a/doc/old/tutorial/examples/015.c b/doc/old/tutorial/examples/015.c
new file mode 100644
index 000000000..0dd267e8e
--- /dev/null
+++ b/doc/old/tutorial/examples/015.c
@@ -0,0 +1,8 @@
1struct GNUNET_PEERSTORE_WatchContext *
2GNUNET_PEERSTORE_watch (struct GNUNET_PEERSTORE_Handle *h,
3 const char *sub_system,
4 const struct GNUNET_PeerIdentity *peer,
5 const char *key,
6 GNUNET_PEERSTORE_Processor callback,
7 void *callback_cls);
8
diff --git a/doc/old/tutorial/examples/016.c b/doc/old/tutorial/examples/016.c
new file mode 100644
index 000000000..d169da16d
--- /dev/null
+++ b/doc/old/tutorial/examples/016.c
@@ -0,0 +1,4 @@
1void
2GNUNET_PEERSTORE_watch_cancel (struct GNUNET_PEERSTORE_WatchContext
3 *wc);
4
diff --git a/doc/old/tutorial/examples/017.c b/doc/old/tutorial/examples/017.c
new file mode 100644
index 000000000..c86fbcd1f
--- /dev/null
+++ b/doc/old/tutorial/examples/017.c
@@ -0,0 +1,4 @@
1void
2GNUNET_PEERSTORE_disconnect (struct GNUNET_PEERSTORE_Handle *h,
3 int sync_first);
4
diff --git a/doc/old/tutorial/examples/018.c b/doc/old/tutorial/examples/018.c
new file mode 100644
index 000000000..3fc22584c
--- /dev/null
+++ b/doc/old/tutorial/examples/018.c
@@ -0,0 +1,2 @@
1dht_handle = GNUNET_DHT_connect (cfg, parallel_requests);
2
diff --git a/doc/old/tutorial/examples/019.c b/doc/old/tutorial/examples/019.c
new file mode 100644
index 000000000..aaf001516
--- /dev/null
+++ b/doc/old/tutorial/examples/019.c
@@ -0,0 +1,18 @@
1message_sent_cont (void *cls,
2 const struct GNUNET_SCHEDULER_TaskContext *tc)
3{
4 // Request has left local node
5}
6
7struct GNUNET_DHT_PutHandle *
8GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle,
9 const struct GNUNET_HashCode *key,
10 uint32_t desired_replication_level,
11 enum GNUNET_DHT_RouteOption options,
12 enum GNUNET_BLOCK_Type type,
13 size_t size,
14 const void *data,
15 struct GNUNET_TIME_Absolute exp,
16 struct GNUNET_TIME_Relative timeout,
17 GNUNET_DHT_PutContinuation cont, void *cont_cls)
18
diff --git a/doc/old/tutorial/examples/020.c b/doc/old/tutorial/examples/020.c
new file mode 100644
index 000000000..596db3069
--- /dev/null
+++ b/doc/old/tutorial/examples/020.c
@@ -0,0 +1,25 @@
1static void
2get_result_iterator (void *cls, struct GNUNET_TIME_Absolute expiration,
3 const struct GNUNET_HashCode *key,
4 const struct GNUNET_PeerIdentity *get_path,
5 unsigned int get_path_length,
6 const struct GNUNET_PeerIdentity *put_path,
7 unsigned int put_path_length,
8 enum GNUNET_BLOCK_Type type, size_t size,
9 const void *data)
10{
11 // Optionally:
12 GNUNET_DHT_get_stop (get_handle);
13}
14
15get_handle =
16 GNUNET_DHT_get_start (dht_handle,
17 block_type,
18 &key,
19 replication,
20 GNUNET_DHT_RO_NONE,
21 NULL,
22 0,
23 &get_result_iterator,
24 cls)
25
diff --git a/doc/old/tutorial/examples/021.c b/doc/old/tutorial/examples/021.c
new file mode 100644
index 000000000..688a31fe0
--- /dev/null
+++ b/doc/old/tutorial/examples/021.c
@@ -0,0 +1,13 @@
1static enum GNUNET_BLOCK_EvaluationResult
2block_plugin_SERVICE_evaluate (void *cls,
3 enum GNUNET_BLOCK_Type type,
4 struct GNUNET_BlockGroup *bg,
5 const GNUNET_HashCode *query,
6 const void *xquery,
7 size_t xquery_size,
8 const void *reply_block,
9 size_t reply_block_size)
10{
11 // Verify type, block and bg
12}
13
diff --git a/doc/old/tutorial/examples/022.c b/doc/old/tutorial/examples/022.c
new file mode 100644
index 000000000..a373619bd
--- /dev/null
+++ b/doc/old/tutorial/examples/022.c
@@ -0,0 +1,8 @@
1static int
2block_plugin_SERVICE_get_key (void *cls, enum GNUNET_BLOCK_Type type,
3 const void *block, size_t block_size,
4 struct GNUNET_HashCode *key)
5{
6 // Store the key in the key argument, return GNUNET_OK on success.
7}
8
diff --git a/doc/old/tutorial/examples/023.c b/doc/old/tutorial/examples/023.c
new file mode 100644
index 000000000..820c38b10
--- /dev/null
+++ b/doc/old/tutorial/examples/023.c
@@ -0,0 +1,17 @@
1void *
2libgnunet_plugin_block_SERVICE_init (void *cls)
3{
4 static enum GNUNET_BLOCK_Type types[] =
5 {
6 GNUNET_BLOCK_TYPE_SERVICE_BLOCKYPE,
7 GNUNET_BLOCK_TYPE_ANY
8 };
9 struct GNUNET_BLOCK_PluginFunctions *api;
10
11 api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions);
12 api->evaluate = &block_plugin_SERICE_evaluate;
13 api->get_key = &block_plugin_SERVICE_get_key;
14 api->types = types;
15 return api;
16}
17
diff --git a/doc/old/tutorial/examples/024.c b/doc/old/tutorial/examples/024.c
new file mode 100644
index 000000000..2e84b5905
--- /dev/null
+++ b/doc/old/tutorial/examples/024.c
@@ -0,0 +1,9 @@
1void *
2libgnunet_plugin_block_SERVICE_done (void *cls)
3{
4 struct GNUNET_TRANSPORT_PluginFunctions *api = cls;
5
6 GNUNET_free (api);
7 return NULL;
8}
9
diff --git a/doc/old/tutorial/examples/025.Makefile.am b/doc/old/tutorial/examples/025.Makefile.am
new file mode 100644
index 000000000..66d4f80ec
--- /dev/null
+++ b/doc/old/tutorial/examples/025.Makefile.am
@@ -0,0 +1,15 @@
1 plugindir = $(libdir)/gnunet
2
3 plugin_LTLIBRARIES = \
4 libgnunet_plugin_block_ext.la
5 libgnunet_plugin_block_ext_la_SOURCES = \
6 plugin_block_ext.c
7 libgnunet_plugin_block_ext_la_LIBADD = \
8 $(prefix)/lib/libgnunethello.la \
9 $(prefix)/lib/libgnunetblock.la \
10 $(prefix)/lib/libgnunetutil.la
11 libgnunet_plugin_block_ext_la_LDFLAGS = \
12 $(GN_PLUGIN_LDFLAGS)
13 libgnunet_plugin_block_ext_la_DEPENDENCIES = \
14 $(prefix)/lib/libgnunetblock.la
15
diff --git a/doc/old/tutorial/examples/026.c b/doc/old/tutorial/examples/026.c
new file mode 100644
index 000000000..264e0b6b9
--- /dev/null
+++ b/doc/old/tutorial/examples/026.c
@@ -0,0 +1,52 @@
1static void
2get_callback (void *cls,
3 enum GNUNET_DHT_RouteOption options,
4 enum GNUNET_BLOCK_Type type,
5 uint32_t hop_count,
6 uint32_t desired_replication_level,
7 unsigned int path_length,
8 const struct GNUNET_PeerIdentity *path,
9 const struct GNUNET_HashCode * key)
10{
11}
12
13
14static void
15get_resp_callback (void *cls,
16 enum GNUNET_BLOCK_Type type,
17 const struct GNUNET_PeerIdentity *get_path,
18 unsigned int get_path_length,
19 const struct GNUNET_PeerIdentity *put_path,
20 unsigned int put_path_length,
21 struct GNUNET_TIME_Absolute exp,
22 const struct GNUNET_HashCode * key,
23 const void *data,
24 size_t size)
25{
26}
27
28
29static void
30put_callback (void *cls,
31 enum GNUNET_DHT_RouteOption options,
32 enum GNUNET_BLOCK_Type type,
33 uint32_t hop_count,
34 uint32_t desired_replication_level,
35 unsigned int path_length,
36 const struct GNUNET_PeerIdentity *path,
37 struct GNUNET_TIME_Absolute exp,
38 const struct GNUNET_HashCode * key,
39 const void *data,
40 size_t size)
41{
42}
43
44
45monitor_handle = GNUNET_DHT_monitor_start (dht_handle,
46 block_type,
47 key,
48 &get_callback,
49 &get_resp_callback,
50 &put_callback,
51 cls);
52
diff --git a/doc/old/tutorial/examples/testbed_test.c b/doc/old/tutorial/examples/testbed_test.c
new file mode 100644
index 000000000..1a8c25655
--- /dev/null
+++ b/doc/old/tutorial/examples/testbed_test.c
@@ -0,0 +1,100 @@
1#include "platform.h"
2#include <unistd.h>
3#include <gnunet/platform.h>
4#include <gnunet/gnunet_util_lib.h>
5#include <gnunet/gnunet_testbed_service.h>
6#include <gnunet/gnunet_dht_service.h>
7
8#define NUM_PEERS 20
9
10static struct GNUNET_TESTBED_Operation *dht_op;
11
12static struct GNUNET_DHT_Handle *dht_handle;
13
14
15struct MyContext
16{
17 int ht_len;
18} ctxt;
19
20
21static int result;
22
23
24static void
25shutdown_task (void *cls)
26{
27 if (NULL != dht_op)
28 {
29 GNUNET_TESTBED_operation_done (dht_op);
30 dht_op = NULL;
31 dht_handle = NULL;
32 }
33 result = GNUNET_OK;
34}
35
36
37static void
38service_connect_comp (void *cls,
39 struct GNUNET_TESTBED_Operation *op,
40 void *ca_result,
41 const char *emsg)
42{
43 GNUNET_assert (op == dht_op);
44 dht_handle = ca_result;
45 // Do work here...
46 GNUNET_SCHEDULER_shutdown ();
47}
48
49
50static void *
51dht_ca (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg)
52{
53 struct MyContext *ctxt = cls;
54
55 dht_handle = GNUNET_DHT_connect (cfg, ctxt->ht_len);
56 return dht_handle;
57}
58
59
60static void
61dht_da (void *cls, void *op_result)
62{
63 struct MyContext *ctxt = cls;
64
65 GNUNET_DHT_disconnect ((struct GNUNET_DHT_Handle *) op_result);
66 dht_handle = NULL;
67}
68
69
70static void
71test_master (void *cls,
72 struct GNUNET_TESTBED_RunHandle *h,
73 unsigned int num_peers,
74 struct GNUNET_TESTBED_Peer **peers,
75 unsigned int links_succeeded,
76 unsigned int links_failed)
77{
78 ctxt.ht_len = 10;
79 dht_op = GNUNET_TESTBED_service_connect
80 (NULL, peers[0], "dht",
81 &service_connect_comp, NULL,
82 &dht_ca, &dht_da, &ctxt);
83 GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL);
84}
85
86
87int
88main (int argc, char **argv)
89{
90 int ret;
91
92 result = GNUNET_SYSERR;
93 ret = GNUNET_TESTBED_test_run
94 ("awesome-test", "template.conf",
95 NUM_PEERS, 0LL,
96 NULL, NULL, &test_master, NULL);
97 if ( (GNUNET_OK != ret) || (GNUNET_OK != result) )
98 return 1;
99 return 0;
100}
diff --git a/doc/old/tutorial/fdl-1.3.texi b/doc/old/tutorial/fdl-1.3.texi
new file mode 100644
index 000000000..cb71f05a1
--- /dev/null
+++ b/doc/old/tutorial/fdl-1.3.texi
@@ -0,0 +1,505 @@
1@c The GNU Free Documentation License.
2@center Version 1.3, 3 November 2008
3
4@c This file is intended to be included within another document,
5@c hence no sectioning command or @node.
6
7@display
8Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
9@uref{http://fsf.org/}
10
11Everyone is permitted to copy and distribute verbatim copies
12of this license document, but changing it is not allowed.
13@end display
14
15@enumerate 0
16@item
17PREAMBLE
18
19The purpose of this License is to make a manual, textbook, or other
20functional and useful document @dfn{free} in the sense of freedom: to
21assure everyone the effective freedom to copy and redistribute it,
22with or without modifying it, either commercially or noncommercially.
23Secondarily, this License preserves for the author and publisher a way
24to get credit for their work, while not being considered responsible
25for modifications made by others.
26
27This License is a kind of ``copyleft'', which means that derivative
28works of the document must themselves be free in the same sense. It
29complements the GNU General Public License, which is a copyleft
30license designed for free software.
31
32We have designed this License in order to use it for manuals for free
33software, because free software needs free documentation: a free
34program should come with manuals providing the same freedoms that the
35software does. But this License is not limited to software manuals;
36it can be used for any textual work, regardless of subject matter or
37whether it is published as a printed book. We recommend this License
38principally for works whose purpose is instruction or reference.
39
40@item
41APPLICABILITY AND DEFINITIONS
42
43This License applies to any manual or other work, in any medium, that
44contains a notice placed by the copyright holder saying it can be
45distributed under the terms of this License. Such a notice grants a
46world-wide, royalty-free license, unlimited in duration, to use that
47work under the conditions stated herein. The ``Document'', below,
48refers to any such manual or work. Any member of the public is a
49licensee, and is addressed as ``you''. You accept the license if you
50copy, modify or distribute the work in a way requiring permission
51under copyright law.
52
53A ``Modified Version'' of the Document means any work containing the
54Document or a portion of it, either copied verbatim, or with
55modifications and/or translated into another language.
56
57A ``Secondary Section'' is a named appendix or a front-matter section
58of the Document that deals exclusively with the relationship of the
59publishers or authors of the Document to the Document's overall
60subject (or to related matters) and contains nothing that could fall
61directly within that overall subject. (Thus, if the Document is in
62part a textbook of mathematics, a Secondary Section may not explain
63any mathematics.) The relationship could be a matter of historical
64connection with the subject or with related matters, or of legal,
65commercial, philosophical, ethical or political position regarding
66them.
67
68The ``Invariant Sections'' are certain Secondary Sections whose titles
69are designated, as being those of Invariant Sections, in the notice
70that says that the Document is released under this License. If a
71section does not fit the above definition of Secondary then it is not
72allowed to be designated as Invariant. The Document may contain zero
73Invariant Sections. If the Document does not identify any Invariant
74Sections then there are none.
75
76The ``Cover Texts'' are certain short passages of text that are listed,
77as Front-Cover Texts or Back-Cover Texts, in the notice that says that
78the Document is released under this License. A Front-Cover Text may
79be at most 5 words, and a Back-Cover Text may be at most 25 words.
80
81A ``Transparent'' copy of the Document means a machine-readable copy,
82represented in a format whose specification is available to the
83general public, that is suitable for revising the document
84straightforwardly with generic text editors or (for images composed of
85pixels) generic paint programs or (for drawings) some widely available
86drawing editor, and that is suitable for input to text formatters or
87for automatic translation to a variety of formats suitable for input
88to text formatters. A copy made in an otherwise Transparent file
89format whose markup, or absence of markup, has been arranged to thwart
90or discourage subsequent modification by readers is not Transparent.
91An image format is not Transparent if used for any substantial amount
92of text. A copy that is not ``Transparent'' is called ``Opaque''.
93
94Examples of suitable formats for Transparent copies include plain
95ASCII without markup, Texinfo input format, La@TeX{} input
96format, SGML or XML using a publicly available
97DTD, and standard-conforming simple HTML,
98PostScript or PDF designed for human modification. Examples
99of transparent image formats include PNG, XCF and
100JPG. Opaque formats include proprietary formats that can be
101read and edited only by proprietary word processors, SGML or
102XML for which the DTD and/or processing tools are
103not generally available, and the machine-generated HTML,
104PostScript or PDF produced by some word processors for
105output purposes only.
106
107The ``Title Page'' means, for a printed book, the title page itself,
108plus such following pages as are needed to hold, legibly, the material
109this License requires to appear in the title page. For works in
110formats which do not have any title page as such, ``Title Page'' means
111the text near the most prominent appearance of the work's title,
112preceding the beginning of the body of the text.
113
114The ``publisher'' means any person or entity that distributes copies
115of the Document to the public.
116
117A section ``Entitled XYZ'' means a named subunit of the Document whose
118title either is precisely XYZ or contains XYZ in parentheses following
119text that translates XYZ in another language. (Here XYZ stands for a
120specific section name mentioned below, such as ``Acknowledgements'',
121``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
122of such a section when you modify the Document means that it remains a
123section ``Entitled XYZ'' according to this definition.
124
125The Document may include Warranty Disclaimers next to the notice which
126states that this License applies to the Document. These Warranty
127Disclaimers are considered to be included by reference in this
128License, but only as regards disclaiming warranties: any other
129implication that these Warranty Disclaimers may have is void and has
130no effect on the meaning of this License.
131
132@item
133VERBATIM COPYING
134
135You may copy and distribute the Document in any medium, either
136commercially or noncommercially, provided that this License, the
137copyright notices, and the license notice saying this License applies
138to the Document are reproduced in all copies, and that you add no other
139conditions whatsoever to those of this License. You may not use
140technical measures to obstruct or control the reading or further
141copying of the copies you make or distribute. However, you may accept
142compensation in exchange for copies. If you distribute a large enough
143number of copies you must also follow the conditions in section 3.
144
145You may also lend copies, under the same conditions stated above, and
146you may publicly display copies.
147
148@item
149COPYING IN QUANTITY
150
151If you publish printed copies (or copies in media that commonly have
152printed covers) of the Document, numbering more than 100, and the
153Document's license notice requires Cover Texts, you must enclose the
154copies in covers that carry, clearly and legibly, all these Cover
155Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
156the back cover. Both covers must also clearly and legibly identify
157you as the publisher of these copies. The front cover must present
158the full title with all words of the title equally prominent and
159visible. You may add other material on the covers in addition.
160Copying with changes limited to the covers, as long as they preserve
161the title of the Document and satisfy these conditions, can be treated
162as verbatim copying in other respects.
163
164If the required texts for either cover are too voluminous to fit
165legibly, you should put the first ones listed (as many as fit
166reasonably) on the actual cover, and continue the rest onto adjacent
167pages.
168
169If you publish or distribute Opaque copies of the Document numbering
170more than 100, you must either include a machine-readable Transparent
171copy along with each Opaque copy, or state in or with each Opaque copy
172a computer-network location from which the general network-using
173public has access to download using public-standard network protocols
174a complete Transparent copy of the Document, free of added material.
175If you use the latter option, you must take reasonably prudent steps,
176when you begin distribution of Opaque copies in quantity, to ensure
177that this Transparent copy will remain thus accessible at the stated
178location until at least one year after the last time you distribute an
179Opaque copy (directly or through your agents or retailers) of that
180edition to the public.
181
182It is requested, but not required, that you contact the authors of the
183Document well before redistributing any large number of copies, to give
184them a chance to provide you with an updated version of the Document.
185
186@item
187MODIFICATIONS
188
189You may copy and distribute a Modified Version of the Document under
190the conditions of sections 2 and 3 above, provided that you release
191the Modified Version under precisely this License, with the Modified
192Version filling the role of the Document, thus licensing distribution
193and modification of the Modified Version to whoever possesses a copy
194of it. In addition, you must do these things in the Modified Version:
195
196@enumerate A
197@item
198Use in the Title Page (and on the covers, if any) a title distinct
199from that of the Document, and from those of previous versions
200(which should, if there were any, be listed in the History section
201of the Document). You may use the same title as a previous version
202if the original publisher of that version gives permission.
203
204@item
205List on the Title Page, as authors, one or more persons or entities
206responsible for authorship of the modifications in the Modified
207Version, together with at least five of the principal authors of the
208Document (all of its principal authors, if it has fewer than five),
209unless they release you from this requirement.
210
211@item
212State on the Title page the name of the publisher of the
213Modified Version, as the publisher.
214
215@item
216Preserve all the copyright notices of the Document.
217
218@item
219Add an appropriate copyright notice for your modifications
220adjacent to the other copyright notices.
221
222@item
223Include, immediately after the copyright notices, a license notice
224giving the public permission to use the Modified Version under the
225terms of this License, in the form shown in the Addendum below.
226
227@item
228Preserve in that license notice the full lists of Invariant Sections
229and required Cover Texts given in the Document's license notice.
230
231@item
232Include an unaltered copy of this License.
233
234@item
235Preserve the section Entitled ``History'', Preserve its Title, and add
236to it an item stating at least the title, year, new authors, and
237publisher of the Modified Version as given on the Title Page. If
238there is no section Entitled ``History'' in the Document, create one
239stating the title, year, authors, and publisher of the Document as
240given on its Title Page, then add an item describing the Modified
241Version as stated in the previous sentence.
242
243@item
244Preserve the network location, if any, given in the Document for
245public access to a Transparent copy of the Document, and likewise
246the network locations given in the Document for previous versions
247it was based on. These may be placed in the ``History'' section.
248You may omit a network location for a work that was published at
249least four years before the Document itself, or if the original
250publisher of the version it refers to gives permission.
251
252@item
253For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
254the Title of the section, and preserve in the section all the
255substance and tone of each of the contributor acknowledgements and/or
256dedications given therein.
257
258@item
259Preserve all the Invariant Sections of the Document,
260unaltered in their text and in their titles. Section numbers
261or the equivalent are not considered part of the section titles.
262
263@item
264Delete any section Entitled ``Endorsements''. Such a section
265may not be included in the Modified Version.
266
267@item
268Do not retitle any existing section to be Entitled ``Endorsements'' or
269to conflict in title with any Invariant Section.
270
271@item
272Preserve any Warranty Disclaimers.
273@end enumerate
274
275If the Modified Version includes new front-matter sections or
276appendices that qualify as Secondary Sections and contain no material
277copied from the Document, you may at your option designate some or all
278of these sections as invariant. To do this, add their titles to the
279list of Invariant Sections in the Modified Version's license notice.
280These titles must be distinct from any other section titles.
281
282You may add a section Entitled ``Endorsements'', provided it contains
283nothing but endorsements of your Modified Version by various
284parties---for example, statements of peer review or that the text has
285been approved by an organization as the authoritative definition of a
286standard.
287
288You may add a passage of up to five words as a Front-Cover Text, and a
289passage of up to 25 words as a Back-Cover Text, to the end of the list
290of Cover Texts in the Modified Version. Only one passage of
291Front-Cover Text and one of Back-Cover Text may be added by (or
292through arrangements made by) any one entity. If the Document already
293includes a cover text for the same cover, previously added by you or
294by arrangement made by the same entity you are acting on behalf of,
295you may not add another; but you may replace the old one, on explicit
296permission from the previous publisher that added the old one.
297
298The author(s) and publisher(s) of the Document do not by this License
299give permission to use their names for publicity for or to assert or
300imply endorsement of any Modified Version.
301
302@item
303COMBINING DOCUMENTS
304
305You may combine the Document with other documents released under this
306License, under the terms defined in section 4 above for modified
307versions, provided that you include in the combination all of the
308Invariant Sections of all of the original documents, unmodified, and
309list them all as Invariant Sections of your combined work in its
310license notice, and that you preserve all their Warranty Disclaimers.
311
312The combined work need only contain one copy of this License, and
313multiple identical Invariant Sections may be replaced with a single
314copy. If there are multiple Invariant Sections with the same name but
315different contents, make the title of each such section unique by
316adding at the end of it, in parentheses, the name of the original
317author or publisher of that section if known, or else a unique number.
318Make the same adjustment to the section titles in the list of
319Invariant Sections in the license notice of the combined work.
320
321In the combination, you must combine any sections Entitled ``History''
322in the various original documents, forming one section Entitled
323``History''; likewise combine any sections Entitled ``Acknowledgements'',
324and any sections Entitled ``Dedications''. You must delete all
325sections Entitled ``Endorsements.''
326
327@item
328COLLECTIONS OF DOCUMENTS
329
330You may make a collection consisting of the Document and other documents
331released under this License, and replace the individual copies of this
332License in the various documents with a single copy that is included in
333the collection, provided that you follow the rules of this License for
334verbatim copying of each of the documents in all other respects.
335
336You may extract a single document from such a collection, and distribute
337it individually under this License, provided you insert a copy of this
338License into the extracted document, and follow this License in all
339other respects regarding verbatim copying of that document.
340
341@item
342AGGREGATION WITH INDEPENDENT WORKS
343
344A compilation of the Document or its derivatives with other separate
345and independent documents or works, in or on a volume of a storage or
346distribution medium, is called an ``aggregate'' if the copyright
347resulting from the compilation is not used to limit the legal rights
348of the compilation's users beyond what the individual works permit.
349When the Document is included in an aggregate, this License does not
350apply to the other works in the aggregate which are not themselves
351derivative works of the Document.
352
353If the Cover Text requirement of section 3 is applicable to these
354copies of the Document, then if the Document is less than one half of
355the entire aggregate, the Document's Cover Texts may be placed on
356covers that bracket the Document within the aggregate, or the
357electronic equivalent of covers if the Document is in electronic form.
358Otherwise they must appear on printed covers that bracket the whole
359aggregate.
360
361@item
362TRANSLATION
363
364Translation is considered a kind of modification, so you may
365distribute translations of the Document under the terms of section 4.
366Replacing Invariant Sections with translations requires special
367permission from their copyright holders, but you may include
368translations of some or all Invariant Sections in addition to the
369original versions of these Invariant Sections. You may include a
370translation of this License, and all the license notices in the
371Document, and any Warranty Disclaimers, provided that you also include
372the original English version of this License and the original versions
373of those notices and disclaimers. In case of a disagreement between
374the translation and the original version of this License or a notice
375or disclaimer, the original version will prevail.
376
377If a section in the Document is Entitled ``Acknowledgements'',
378``Dedications'', or ``History'', the requirement (section 4) to Preserve
379its Title (section 1) will typically require changing the actual
380title.
381
382@item
383TERMINATION
384
385You may not copy, modify, sublicense, or distribute the Document
386except as expressly provided under this License. Any attempt
387otherwise to copy, modify, sublicense, or distribute it is void, and
388will automatically terminate your rights under this License.
389
390However, if you cease all violation of this License, then your license
391from a particular copyright holder is reinstated (a) provisionally,
392unless and until the copyright holder explicitly and finally
393terminates your license, and (b) permanently, if the copyright holder
394fails to notify you of the violation by some reasonable means prior to
39560 days after the cessation.
396
397Moreover, your license from a particular copyright holder is
398reinstated permanently if the copyright holder notifies you of the
399violation by some reasonable means, this is the first time you have
400received notice of violation of this License (for any work) from that
401copyright holder, and you cure the violation prior to 30 days after
402your receipt of the notice.
403
404Termination of your rights under this section does not terminate the
405licenses of parties who have received copies or rights from you under
406this License. If your rights have been terminated and not permanently
407reinstated, receipt of a copy of some or all of the same material does
408not give you any rights to use it.
409
410@item
411FUTURE REVISIONS OF THIS LICENSE
412
413The Free Software Foundation may publish new, revised versions
414of the GNU Free Documentation License from time to time. Such new
415versions will be similar in spirit to the present version, but may
416differ in detail to address new problems or concerns. See
417@uref{http://www.gnu.org/copyleft/}.
418
419Each version of the License is given a distinguishing version number.
420If the Document specifies that a particular numbered version of this
421License ``or any later version'' applies to it, you have the option of
422following the terms and conditions either of that specified version or
423of any later version that has been published (not as a draft) by the
424Free Software Foundation. If the Document does not specify a version
425number of this License, you may choose any version ever published (not
426as a draft) by the Free Software Foundation. If the Document
427specifies that a proxy can decide which future versions of this
428License can be used, that proxy's public statement of acceptance of a
429version permanently authorizes you to choose that version for the
430Document.
431
432@item
433RELICENSING
434
435``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
436World Wide Web server that publishes copyrightable works and also
437provides prominent facilities for anybody to edit those works. A
438public wiki that anybody can edit is an example of such a server. A
439``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
440site means any set of copyrightable works thus published on the MMC
441site.
442
443``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
444license published by Creative Commons Corporation, a not-for-profit
445corporation with a principal place of business in San Francisco,
446California, as well as future copyleft versions of that license
447published by that same organization.
448
449``Incorporate'' means to publish or republish a Document, in whole or
450in part, as part of another Document.
451
452An MMC is ``eligible for relicensing'' if it is licensed under this
453License, and if all works that were first published under this License
454somewhere other than this MMC, and subsequently incorporated in whole
455or in part into the MMC, (1) had no cover texts or invariant sections,
456and (2) were thus incorporated prior to November 1, 2008.
457
458The operator of an MMC Site may republish an MMC contained in the site
459under CC-BY-SA on the same site at any time before August 1, 2009,
460provided the MMC is eligible for relicensing.
461
462@end enumerate
463
464@page
465@heading ADDENDUM: How to use this License for your documents
466
467To use this License in a document you have written, include a copy of
468the License in the document and put the following copyright and
469license notices just after the title page:
470
471@smallexample
472@group
473 Copyright (C) @var{year} @var{your name}.
474 Permission is granted to copy, distribute and/or modify this document
475 under the terms of the GNU Free Documentation License, Version 1.3
476 or any later version published by the Free Software Foundation;
477 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
478 Texts. A copy of the license is included in the section entitled ``GNU
479 Free Documentation License''.
480@end group
481@end smallexample
482
483If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
484replace the ``with@dots{}Texts.''@: line with this:
485
486@smallexample
487@group
488 with the Invariant Sections being @var{list their titles}, with
489 the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
490 being @var{list}.
491@end group
492@end smallexample
493
494If you have Invariant Sections without Cover Texts, or some other
495combination of the three, merge those two alternatives to suit the
496situation.
497
498If your document contains nontrivial examples of program code, we
499recommend releasing these examples in parallel under your choice of
500free software license, such as the GNU General Public License,
501to permit their use in free software.
502
503@c Local Variables:
504@c ispell-local-pdict: "ispell-dict"
505@c End:
diff --git a/doc/old/tutorial/gpl-3.0.texi b/doc/old/tutorial/gpl-3.0.texi
new file mode 100644
index 000000000..0e2e212ac
--- /dev/null
+++ b/doc/old/tutorial/gpl-3.0.texi
@@ -0,0 +1,717 @@
1@c The GNU General Public License.
2@center Version 3, 29 June 2007
3
4@c This file is intended to be included within another document,
5@c hence no sectioning command or @node.
6
7@display
8Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
9
10Everyone is permitted to copy and distribute verbatim copies of this
11license document, but changing it is not allowed.
12@end display
13
14@heading Preamble
15
16The GNU General Public License is a free, copyleft license for
17software and other kinds of works.
18
19The licenses for most software and other practical works are designed
20to take away your freedom to share and change the works. By contrast,
21the GNU General Public License is intended to guarantee your freedom
22to share and change all versions of a program---to make sure it remains
23free software for all its users. We, the Free Software Foundation,
24use the GNU General Public License for most of our software; it
25applies also to any other work released this way by its authors. You
26can apply it to your programs, too.
27
28When we speak of free software, we are referring to freedom, not
29price. Our General Public Licenses are designed to make sure that you
30have the freedom to distribute copies of free software (and charge for
31them if you wish), that you receive source code or can get it if you
32want it, that you can change the software or use pieces of it in new
33free programs, and that you know you can do these things.
34
35To protect your rights, we need to prevent others from denying you
36these rights or asking you to surrender the rights. Therefore, you
37have certain responsibilities if you distribute copies of the
38software, or if you modify it: responsibilities to respect the freedom
39of others.
40
41For example, if you distribute copies of such a program, whether
42gratis or for a fee, you must pass on to the recipients the same
43freedoms that you received. You must make sure that they, too,
44receive or can get the source code. And you must show them these
45terms so they know their rights.
46
47Developers that use the GNU GPL protect your rights with two steps:
48(1) assert copyright on the software, and (2) offer you this License
49giving you legal permission to copy, distribute and/or modify it.
50
51For the developers' and authors' protection, the GPL clearly explains
52that there is no warranty for this free software. For both users' and
53authors' sake, the GPL requires that modified versions be marked as
54changed, so that their problems will not be attributed erroneously to
55authors of previous versions.
56
57Some devices are designed to deny users access to install or run
58modified versions of the software inside them, although the
59manufacturer can do so. This is fundamentally incompatible with the
60aim of protecting users' freedom to change the software. The
61systematic pattern of such abuse occurs in the area of products for
62individuals to use, which is precisely where it is most unacceptable.
63Therefore, we have designed this version of the GPL to prohibit the
64practice for those products. If such problems arise substantially in
65other domains, we stand ready to extend this provision to those
66domains in future versions of the GPL, as needed to protect the
67freedom of users.
68
69Finally, every program is threatened constantly by software patents.
70States should not allow patents to restrict development and use of
71software on general-purpose computers, but in those that do, we wish
72to avoid the special danger that patents applied to a free program
73could make it effectively proprietary. To prevent this, the GPL
74assures that patents cannot be used to render the program non-free.
75
76The precise terms and conditions for copying, distribution and
77modification follow.
78
79@heading TERMS AND CONDITIONS
80
81@enumerate 0
82@item Definitions.
83
84``This License'' refers to version 3 of the GNU General Public License.
85
86``Copyright'' also means copyright-like laws that apply to other kinds
87of works, such as semiconductor masks.
88
89``The Program'' refers to any copyrightable work licensed under this
90License. Each licensee is addressed as ``you''. ``Licensees'' and
91``recipients'' may be individuals or organizations.
92
93To ``modify'' a work means to copy from or adapt all or part of the work
94in a fashion requiring copyright permission, other than the making of
95an exact copy. The resulting work is called a ``modified version'' of
96the earlier work or a work ``based on'' the earlier work.
97
98A ``covered work'' means either the unmodified Program or a work based
99on the Program.
100
101To ``propagate'' a work means to do anything with it that, without
102permission, would make you directly or secondarily liable for
103infringement under applicable copyright law, except executing it on a
104computer or modifying a private copy. Propagation includes copying,
105distribution (with or without modification), making available to the
106public, and in some countries other activities as well.
107
108To ``convey'' a work means any kind of propagation that enables other
109parties to make or receive copies. Mere interaction with a user
110through a computer network, with no transfer of a copy, is not
111conveying.
112
113An interactive user interface displays ``Appropriate Legal Notices'' to
114the extent that it includes a convenient and prominently visible
115feature that (1) displays an appropriate copyright notice, and (2)
116tells the user that there is no warranty for the work (except to the
117extent that warranties are provided), that licensees may convey the
118work under this License, and how to view a copy of this License. If
119the interface presents a list of user commands or options, such as a
120menu, a prominent item in the list meets this criterion.
121
122@item Source Code.
123
124The ``source code'' for a work means the preferred form of the work for
125making modifications to it. ``Object code'' means any non-source form
126of a work.
127
128A ``Standard Interface'' means an interface that either is an official
129standard defined by a recognized standards body, or, in the case of
130interfaces specified for a particular programming language, one that
131is widely used among developers working in that language.
132
133The ``System Libraries'' of an executable work include anything, other
134than the work as a whole, that (a) is included in the normal form of
135packaging a Major Component, but which is not part of that Major
136Component, and (b) serves only to enable use of the work with that
137Major Component, or to implement a Standard Interface for which an
138implementation is available to the public in source code form. A
139``Major Component'', in this context, means a major essential component
140(kernel, window system, and so on) of the specific operating system
141(if any) on which the executable work runs, or a compiler used to
142produce the work, or an object code interpreter used to run it.
143
144The ``Corresponding Source'' for a work in object code form means all
145the source code needed to generate, install, and (for an executable
146work) run the object code and to modify the work, including scripts to
147control those activities. However, it does not include the work's
148System Libraries, or general-purpose tools or generally available free
149programs which are used unmodified in performing those activities but
150which are not part of the work. For example, Corresponding Source
151includes interface definition files associated with source files for
152the work, and the source code for shared libraries and dynamically
153linked subprograms that the work is specifically designed to require,
154such as by intimate data communication or control flow between those
155subprograms and other parts of the work.
156
157The Corresponding Source need not include anything that users can
158regenerate automatically from other parts of the Corresponding Source.
159
160The Corresponding Source for a work in source code form is that same
161work.
162
163@item Basic Permissions.
164
165All rights granted under this License are granted for the term of
166copyright on the Program, and are irrevocable provided the stated
167conditions are met. This License explicitly affirms your unlimited
168permission to run the unmodified Program. The output from running a
169covered work is covered by this License only if the output, given its
170content, constitutes a covered work. This License acknowledges your
171rights of fair use or other equivalent, as provided by copyright law.
172
173You may make, run and propagate covered works that you do not convey,
174without conditions so long as your license otherwise remains in force.
175You may convey covered works to others for the sole purpose of having
176them make modifications exclusively for you, or provide you with
177facilities for running those works, provided that you comply with the
178terms of this License in conveying all material for which you do not
179control copyright. Those thus making or running the covered works for
180you must do so exclusively on your behalf, under your direction and
181control, on terms that prohibit them from making any copies of your
182copyrighted material outside their relationship with you.
183
184Conveying under any other circumstances is permitted solely under the
185conditions stated below. Sublicensing is not allowed; section 10
186makes it unnecessary.
187
188@item Protecting Users' Legal Rights From Anti-Circumvention Law.
189
190No covered work shall be deemed part of an effective technological
191measure under any applicable law fulfilling obligations under article
19211 of the WIPO copyright treaty adopted on 20 December 1996, or
193similar laws prohibiting or restricting circumvention of such
194measures.
195
196When you convey a covered work, you waive any legal power to forbid
197circumvention of technological measures to the extent such
198circumvention is effected by exercising rights under this License with
199respect to the covered work, and you disclaim any intention to limit
200operation or modification of the work as a means of enforcing, against
201the work's users, your or third parties' legal rights to forbid
202circumvention of technological measures.
203
204@item Conveying Verbatim Copies.
205
206You may convey verbatim copies of the Program's source code as you
207receive it, in any medium, provided that you conspicuously and
208appropriately publish on each copy an appropriate copyright notice;
209keep intact all notices stating that this License and any
210non-permissive terms added in accord with section 7 apply to the code;
211keep intact all notices of the absence of any warranty; and give all
212recipients a copy of this License along with the Program.
213
214You may charge any price or no price for each copy that you convey,
215and you may offer support or warranty protection for a fee.
216
217@item Conveying Modified Source Versions.
218
219You may convey a work based on the Program, or the modifications to
220produce it from the Program, in the form of source code under the
221terms of section 4, provided that you also meet all of these
222conditions:
223
224@enumerate a
225@item
226The work must carry prominent notices stating that you modified it,
227and giving a relevant date.
228
229@item
230The work must carry prominent notices stating that it is released
231under this License and any conditions added under section 7. This
232requirement modifies the requirement in section 4 to ``keep intact all
233notices''.
234
235@item
236You must license the entire work, as a whole, under this License to
237anyone who comes into possession of a copy. This License will
238therefore apply, along with any applicable section 7 additional terms,
239to the whole of the work, and all its parts, regardless of how they
240are packaged. This License gives no permission to license the work in
241any other way, but it does not invalidate such permission if you have
242separately received it.
243
244@item
245If the work has interactive user interfaces, each must display
246Appropriate Legal Notices; however, if the Program has interactive
247interfaces that do not display Appropriate Legal Notices, your work
248need not make them do so.
249@end enumerate
250
251A compilation of a covered work with other separate and independent
252works, which are not by their nature extensions of the covered work,
253and which are not combined with it such as to form a larger program,
254in or on a volume of a storage or distribution medium, is called an
255``aggregate'' if the compilation and its resulting copyright are not
256used to limit the access or legal rights of the compilation's users
257beyond what the individual works permit. Inclusion of a covered work
258in an aggregate does not cause this License to apply to the other
259parts of the aggregate.
260
261@item Conveying Non-Source Forms.
262
263You may convey a covered work in object code form under the terms of
264sections 4 and 5, provided that you also convey the machine-readable
265Corresponding Source under the terms of this License, in one of these
266ways:
267
268@enumerate a
269@item
270Convey the object code in, or embodied in, a physical product
271(including a physical distribution medium), accompanied by the
272Corresponding Source fixed on a durable physical medium customarily
273used for software interchange.
274
275@item
276Convey the object code in, or embodied in, a physical product
277(including a physical distribution medium), accompanied by a written
278offer, valid for at least three years and valid for as long as you
279offer spare parts or customer support for that product model, to give
280anyone who possesses the object code either (1) a copy of the
281Corresponding Source for all the software in the product that is
282covered by this License, on a durable physical medium customarily used
283for software interchange, for a price no more than your reasonable
284cost of physically performing this conveying of source, or (2) access
285to copy the Corresponding Source from a network server at no charge.
286
287@item
288Convey individual copies of the object code with a copy of the written
289offer to provide the Corresponding Source. This alternative is
290allowed only occasionally and noncommercially, and only if you
291received the object code with such an offer, in accord with subsection
2926b.
293
294@item
295Convey the object code by offering access from a designated place
296(gratis or for a charge), and offer equivalent access to the
297Corresponding Source in the same way through the same place at no
298further charge. You need not require recipients to copy the
299Corresponding Source along with the object code. If the place to copy
300the object code is a network server, the Corresponding Source may be
301on a different server (operated by you or a third party) that supports
302equivalent copying facilities, provided you maintain clear directions
303next to the object code saying where to find the Corresponding Source.
304Regardless of what server hosts the Corresponding Source, you remain
305obligated to ensure that it is available for as long as needed to
306satisfy these requirements.
307
308@item
309Convey the object code using peer-to-peer transmission, provided you
310inform other peers where the object code and Corresponding Source of
311the work are being offered to the general public at no charge under
312subsection 6d.
313
314@end enumerate
315
316A separable portion of the object code, whose source code is excluded
317from the Corresponding Source as a System Library, need not be
318included in conveying the object code work.
319
320A ``User Product'' is either (1) a ``consumer product'', which means any
321tangible personal property which is normally used for personal,
322family, or household purposes, or (2) anything designed or sold for
323incorporation into a dwelling. In determining whether a product is a
324consumer product, doubtful cases shall be resolved in favor of
325coverage. For a particular product received by a particular user,
326``normally used'' refers to a typical or common use of that class of
327product, regardless of the status of the particular user or of the way
328in which the particular user actually uses, or expects or is expected
329to use, the product. A product is a consumer product regardless of
330whether the product has substantial commercial, industrial or
331non-consumer uses, unless such uses represent the only significant
332mode of use of the product.
333
334``Installation Information'' for a User Product means any methods,
335procedures, authorization keys, or other information required to
336install and execute modified versions of a covered work in that User
337Product from a modified version of its Corresponding Source. The
338information must suffice to ensure that the continued functioning of
339the modified object code is in no case prevented or interfered with
340solely because modification has been made.
341
342If you convey an object code work under this section in, or with, or
343specifically for use in, a User Product, and the conveying occurs as
344part of a transaction in which the right of possession and use of the
345User Product is transferred to the recipient in perpetuity or for a
346fixed term (regardless of how the transaction is characterized), the
347Corresponding Source conveyed under this section must be accompanied
348by the Installation Information. But this requirement does not apply
349if neither you nor any third party retains the ability to install
350modified object code on the User Product (for example, the work has
351been installed in ROM).
352
353The requirement to provide Installation Information does not include a
354requirement to continue to provide support service, warranty, or
355updates for a work that has been modified or installed by the
356recipient, or for the User Product in which it has been modified or
357installed. Access to a network may be denied when the modification
358itself materially and adversely affects the operation of the network
359or violates the rules and protocols for communication across the
360network.
361
362Corresponding Source conveyed, and Installation Information provided,
363in accord with this section must be in a format that is publicly
364documented (and with an implementation available to the public in
365source code form), and must require no special password or key for
366unpacking, reading or copying.
367
368@item Additional Terms.
369
370``Additional permissions'' are terms that supplement the terms of this
371License by making exceptions from one or more of its conditions.
372Additional permissions that are applicable to the entire Program shall
373be treated as though they were included in this License, to the extent
374that they are valid under applicable law. If additional permissions
375apply only to part of the Program, that part may be used separately
376under those permissions, but the entire Program remains governed by
377this License without regard to the additional permissions.
378
379When you convey a copy of a covered work, you may at your option
380remove any additional permissions from that copy, or from any part of
381it. (Additional permissions may be written to require their own
382removal in certain cases when you modify the work.) You may place
383additional permissions on material, added by you to a covered work,
384for which you have or can give appropriate copyright permission.
385
386Notwithstanding any other provision of this License, for material you
387add to a covered work, you may (if authorized by the copyright holders
388of that material) supplement the terms of this License with terms:
389
390@enumerate a
391@item
392Disclaiming warranty or limiting liability differently from the terms
393of sections 15 and 16 of this License; or
394
395@item
396Requiring preservation of specified reasonable legal notices or author
397attributions in that material or in the Appropriate Legal Notices
398displayed by works containing it; or
399
400@item
401Prohibiting misrepresentation of the origin of that material, or
402requiring that modified versions of such material be marked in
403reasonable ways as different from the original version; or
404
405@item
406Limiting the use for publicity purposes of names of licensors or
407authors of the material; or
408
409@item
410Declining to grant rights under trademark law for use of some trade
411names, trademarks, or service marks; or
412
413@item
414Requiring indemnification of licensors and authors of that material by
415anyone who conveys the material (or modified versions of it) with
416contractual assumptions of liability to the recipient, for any
417liability that these contractual assumptions directly impose on those
418licensors and authors.
419@end enumerate
420
421All other non-permissive additional terms are considered ``further
422restrictions'' within the meaning of section 10. If the Program as you
423received it, or any part of it, contains a notice stating that it is
424governed by this License along with a term that is a further
425restriction, you may remove that term. If a license document contains
426a further restriction but permits relicensing or conveying under this
427License, you may add to a covered work material governed by the terms
428of that license document, provided that the further restriction does
429not survive such relicensing or conveying.
430
431If you add terms to a covered work in accord with this section, you
432must place, in the relevant source files, a statement of the
433additional terms that apply to those files, or a notice indicating
434where to find the applicable terms.
435
436Additional terms, permissive or non-permissive, may be stated in the
437form of a separately written license, or stated as exceptions; the
438above requirements apply either way.
439
440@item Termination.
441
442You may not propagate or modify a covered work except as expressly
443provided under this License. Any attempt otherwise to propagate or
444modify it is void, and will automatically terminate your rights under
445this License (including any patent licenses granted under the third
446paragraph of section 11).
447
448However, if you cease all violation of this License, then your license
449from a particular copyright holder is reinstated (a) provisionally,
450unless and until the copyright holder explicitly and finally
451terminates your license, and (b) permanently, if the copyright holder
452fails to notify you of the violation by some reasonable means prior to
45360 days after the cessation.
454
455Moreover, your license from a particular copyright holder is
456reinstated permanently if the copyright holder notifies you of the
457violation by some reasonable means, this is the first time you have
458received notice of violation of this License (for any work) from that
459copyright holder, and you cure the violation prior to 30 days after
460your receipt of the notice.
461
462Termination of your rights under this section does not terminate the
463licenses of parties who have received copies or rights from you under
464this License. If your rights have been terminated and not permanently
465reinstated, you do not qualify to receive new licenses for the same
466material under section 10.
467
468@item Acceptance Not Required for Having Copies.
469
470You are not required to accept this License in order to receive or run
471a copy of the Program. Ancillary propagation of a covered work
472occurring solely as a consequence of using peer-to-peer transmission
473to receive a copy likewise does not require acceptance. However,
474nothing other than this License grants you permission to propagate or
475modify any covered work. These actions infringe copyright if you do
476not accept this License. Therefore, by modifying or propagating a
477covered work, you indicate your acceptance of this License to do so.
478
479@item Automatic Licensing of Downstream Recipients.
480
481Each time you convey a covered work, the recipient automatically
482receives a license from the original licensors, to run, modify and
483propagate that work, subject to this License. You are not responsible
484for enforcing compliance by third parties with this License.
485
486An ``entity transaction'' is a transaction transferring control of an
487organization, or substantially all assets of one, or subdividing an
488organization, or merging organizations. If propagation of a covered
489work results from an entity transaction, each party to that
490transaction who receives a copy of the work also receives whatever
491licenses to the work the party's predecessor in interest had or could
492give under the previous paragraph, plus a right to possession of the
493Corresponding Source of the work from the predecessor in interest, if
494the predecessor has it or can get it with reasonable efforts.
495
496You may not impose any further restrictions on the exercise of the
497rights granted or affirmed under this License. For example, you may
498not impose a license fee, royalty, or other charge for exercise of
499rights granted under this License, and you may not initiate litigation
500(including a cross-claim or counterclaim in a lawsuit) alleging that
501any patent claim is infringed by making, using, selling, offering for
502sale, or importing the Program or any portion of it.
503
504@item Patents.
505
506A ``contributor'' is a copyright holder who authorizes use under this
507License of the Program or a work on which the Program is based. The
508work thus licensed is called the contributor's ``contributor version''.
509
510A contributor's ``essential patent claims'' are all patent claims owned
511or controlled by the contributor, whether already acquired or
512hereafter acquired, that would be infringed by some manner, permitted
513by this License, of making, using, or selling its contributor version,
514but do not include claims that would be infringed only as a
515consequence of further modification of the contributor version. For
516purposes of this definition, ``control'' includes the right to grant
517patent sublicenses in a manner consistent with the requirements of
518this License.
519
520Each contributor grants you a non-exclusive, worldwide, royalty-free
521patent license under the contributor's essential patent claims, to
522make, use, sell, offer for sale, import and otherwise run, modify and
523propagate the contents of its contributor version.
524
525In the following three paragraphs, a ``patent license'' is any express
526agreement or commitment, however denominated, not to enforce a patent
527(such as an express permission to practice a patent or covenant not to
528sue for patent infringement). To ``grant'' such a patent license to a
529party means to make such an agreement or commitment not to enforce a
530patent against the party.
531
532If you convey a covered work, knowingly relying on a patent license,
533and the Corresponding Source of the work is not available for anyone
534to copy, free of charge and under the terms of this License, through a
535publicly available network server or other readily accessible means,
536then you must either (1) cause the Corresponding Source to be so
537available, or (2) arrange to deprive yourself of the benefit of the
538patent license for this particular work, or (3) arrange, in a manner
539consistent with the requirements of this License, to extend the patent
540license to downstream recipients. ``Knowingly relying'' means you have
541actual knowledge that, but for the patent license, your conveying the
542covered work in a country, or your recipient's use of the covered work
543in a country, would infringe one or more identifiable patents in that
544country that you have reason to believe are valid.
545
546If, pursuant to or in connection with a single transaction or
547arrangement, you convey, or propagate by procuring conveyance of, a
548covered work, and grant a patent license to some of the parties
549receiving the covered work authorizing them to use, propagate, modify
550or convey a specific copy of the covered work, then the patent license
551you grant is automatically extended to all recipients of the covered
552work and works based on it.
553
554A patent license is ``discriminatory'' if it does not include within the
555scope of its coverage, prohibits the exercise of, or is conditioned on
556the non-exercise of one or more of the rights that are specifically
557granted under this License. You may not convey a covered work if you
558are a party to an arrangement with a third party that is in the
559business of distributing software, under which you make payment to the
560third party based on the extent of your activity of conveying the
561work, and under which the third party grants, to any of the parties
562who would receive the covered work from you, a discriminatory patent
563license (a) in connection with copies of the covered work conveyed by
564you (or copies made from those copies), or (b) primarily for and in
565connection with specific products or compilations that contain the
566covered work, unless you entered into that arrangement, or that patent
567license was granted, prior to 28 March 2007.
568
569Nothing in this License shall be construed as excluding or limiting
570any implied license or other defenses to infringement that may
571otherwise be available to you under applicable patent law.
572
573@item No Surrender of Others' Freedom.
574
575If conditions are imposed on you (whether by court order, agreement or
576otherwise) that contradict the conditions of this License, they do not
577excuse you from the conditions of this License. If you cannot convey
578a covered work so as to satisfy simultaneously your obligations under
579this License and any other pertinent obligations, then as a
580consequence you may not convey it at all. For example, if you agree
581to terms that obligate you to collect a royalty for further conveying
582from those to whom you convey the Program, the only way you could
583satisfy both those terms and this License would be to refrain entirely
584from conveying the Program.
585
586@item Use with the GNU Affero General Public License.
587
588Notwithstanding any other provision of this License, you have
589permission to link or combine any covered work with a work licensed
590under version 3 of the GNU Affero General Public License into a single
591combined work, and to convey the resulting work. The terms of this
592License will continue to apply to the part which is the covered work,
593but the special requirements of the GNU Affero General Public License,
594section 13, concerning interaction through a network will apply to the
595combination as such.
596
597@item Revised Versions of this License.
598
599The Free Software Foundation may publish revised and/or new versions
600of the GNU General Public License from time to time. Such new
601versions will be similar in spirit to the present version, but may
602differ in detail to address new problems or concerns.
603
604Each version is given a distinguishing version number. If the Program
605specifies that a certain numbered version of the GNU General Public
606License ``or any later version'' applies to it, you have the option of
607following the terms and conditions either of that numbered version or
608of any later version published by the Free Software Foundation. If
609the Program does not specify a version number of the GNU General
610Public License, you may choose any version ever published by the Free
611Software Foundation.
612
613If the Program specifies that a proxy can decide which future versions
614of the GNU General Public License can be used, that proxy's public
615statement of acceptance of a version permanently authorizes you to
616choose that version for the Program.
617
618Later license versions may give you additional or different
619permissions. However, no additional obligations are imposed on any
620author or copyright holder as a result of your choosing to follow a
621later version.
622
623@item Disclaimer of Warranty.
624
625THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
626APPLICABLE LAW@. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
627HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT
628WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
629LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
630A PARTICULAR PURPOSE@. THE ENTIRE RISK AS TO THE QUALITY AND
631PERFORMANCE OF THE PROGRAM IS WITH YOU@. SHOULD THE PROGRAM PROVE
632DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
633CORRECTION.
634
635@item Limitation of Liability.
636
637IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
638WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
639CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
640INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
641ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
642NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
643LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
644TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
645PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
646
647@item Interpretation of Sections 15 and 16.
648
649If the disclaimer of warranty and limitation of liability provided
650above cannot be given local legal effect according to their terms,
651reviewing courts shall apply local law that most closely approximates
652an absolute waiver of all civil liability in connection with the
653Program, unless a warranty or assumption of liability accompanies a
654copy of the Program in return for a fee.
655
656@end enumerate
657
658@heading END OF TERMS AND CONDITIONS
659
660@heading How to Apply These Terms to Your New Programs
661
662If you develop a new program, and you want it to be of the greatest
663possible use to the public, the best way to achieve this is to make it
664free software which everyone can redistribute and change under these
665terms.
666
667To do so, attach the following notices to the program. It is safest
668to attach them to the start of each source file to most effectively
669state the exclusion of warranty; and each file should have at least
670the ``copyright'' line and a pointer to where the full notice is found.
671
672@smallexample
673@var{one line to give the program's name and a brief idea of what it does.}
674Copyright (C) @var{year} @var{name of author}
675
676This program is free software: you can redistribute it and/or modify
677it under the terms of the GNU General Public License as published by
678the Free Software Foundation, either version 3 of the License, or (at
679your option) any later version.
680
681This program is distributed in the hope that it will be useful, but
682WITHOUT ANY WARRANTY; without even the implied warranty of
683MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE@. See the GNU
684General Public License for more details.
685
686You should have received a copy of the GNU General Public License
687along with this program. If not, see @url{http://www.gnu.org/licenses/}.
688@end smallexample
689
690Also add information on how to contact you by electronic and paper mail.
691
692If the program does terminal interaction, make it output a short
693notice like this when it starts in an interactive mode:
694
695@smallexample
696@var{program} Copyright (C) @var{year} @var{name of author}
697This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}.
698This is free software, and you are welcome to redistribute it
699under certain conditions; type @samp{show c} for details.
700@end smallexample
701
702The hypothetical commands @samp{show w} and @samp{show c} should show
703the appropriate parts of the General Public License. Of course, your
704program's commands might be different; for a GUI interface, you would
705use an ``about box''.
706
707You should also get your employer (if you work as a programmer) or school,
708if any, to sign a ``copyright disclaimer'' for the program, if necessary.
709For more information on this, and how to apply and follow the GNU GPL, see
710@url{http://www.gnu.org/licenses/}.
711
712The GNU General Public License does not permit incorporating your
713program into proprietary programs. If your program is a subroutine
714library, you may consider it more useful to permit linking proprietary
715applications with the library. If this is what you want to do, use
716the GNU Lesser General Public License instead of this License. But
717first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
diff --git a/doc/old/tutorial/htmlxref.cnf b/doc/old/tutorial/htmlxref.cnf
new file mode 100644
index 000000000..a4928f6fe
--- /dev/null
+++ b/doc/old/tutorial/htmlxref.cnf
@@ -0,0 +1,668 @@
1# htmlxref.cnf - reference file for free Texinfo manuals on the web.
2# Modified by Ludovic Courtès <ludo@gnu.org> for the GNU Guix manual.
3# Modified by ng0 <ng0@gnunet.org> for the GNUnet manual.
4
5htmlxrefversion=2017-10-26.06; # UTC
6
7# Copyright 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc.
8#
9# Copying and distribution of this file, with or without modification,
10# are permitted in any medium without royalty provided the copyright
11# notice and this notice are preserved.
12#
13# The latest version of this file is available at
14# http://ftpmirror.gnu.org/texinfo/htmlxref.cnf.
15# Email corrections or additions to bug-texinfo@gnu.org.
16# The primary goal is to list all relevant GNU manuals;
17# other free manuals are also welcome.
18#
19# To be included in this list, a manual must:
20#
21# - have a generic url, e.g., no version numbers;
22# - have a unique file name (e.g., manual identifier), i.e., be related to the
23# package name. Things like "refman" or "tutorial" don't work.
24# - follow the naming convention for nodes described at
25# http://www.gnu.org/software/texinfo/manual/texinfo/html_node/HTML-Xref.html
26# This is what makeinfo and texi2html implement.
27#
28# Unless the above criteria are met, it's not possible to generate
29# reliable cross-manual references.
30#
31# For information on automatically generating all the useful formats for
32# a manual to put on the web, see
33# http://www.gnu.org/prep/maintain/html_node/Manuals-on-Web-Pages.html.
34
35# For people editing this file: when a manual named foo is related to a
36# package named bar, the url should contain a variable reference ${BAR}.
37# Otherwise, the gnumaint scripts have no way of knowing they are
38# associated, and thus gnu.org/manual can't include them.
39
40# shorten references to manuals on www.gnu.org.
41G = https://www.gnu.org
42GS = ${G}/software
43
443dldf mono ${GS}/3dldf/manual/user_ref/3DLDF.html
453dldf node ${GS}/3dldf/manual/user_ref/
46
47alive mono ${GS}/alive/manual/alive.html
48alive node ${GS}/alive/manual/html_node/
49
50anubis chapter ${GS}/anubis/manual/html_chapter/
51anubis section ${GS}/anubis/manual/html_section/
52anubis node ${GS}/anubis/manual/html_node/
53
54artanis mono ${GS}/artanis/manual/artanis.html
55artanis node ${GS}/artanis/manual/html_node/
56
57aspell section http://aspell.net/man-html/index.html
58
59auctex mono ${GS}/auctex/manual/auctex.html
60auctex node ${GS}/auctex/manual/auctex/
61
62autoconf mono ${GS}/autoconf/manual/autoconf.html
63autoconf node ${GS}/autoconf/manual/html_node/
64
65autogen mono ${GS}/autogen/manual/html_mono/autogen.html
66autogen chapter ${GS}/autogen/manual/html_chapter/
67autogen node ${GS}/autoconf/manual/html_node/
68
69automake mono ${GS}/automake/manual/automake.html
70automake node ${GS}/automake/manual/html_node/
71
72avl node http://www.stanford.edu/~blp/avl/libavl.html/
73
74bash mono ${GS}/bash/manual/bash.html
75bash node ${GS}/bash/manual/html_node/
76
77BINUTILS = http://sourceware.org/binutils/docs
78binutils node ${BINUTILS}/binutils/
79 as node ${BINUTILS}/as/
80 bfd node ${BINUTILS}/bfd/
81 gprof node ${BINUTILS}/gprof/
82 ld node ${BINUTILS}/ld/
83
84bison mono ${GS}/bison/manual/bison.html
85bison node ${GS}/bison/manual/html_node/
86
87bpel2owfn mono ${GS}/bpel2owfn/manual/2.0.x/bpel2owfn.html
88
89ccd2cue mono ${GS}/ccd2cue/manual/ccd2cue.html
90ccd2cue node ${GS}/ccd2cue/manual/html_node/
91
92cflow mono ${GS}/cflow/manual/cflow.html
93cflow node ${GS}/cflow/manual/html_node/
94
95chess mono ${GS}/chess/manual/gnuchess.html
96chess node ${GS}/chess/manual/html_node/
97
98combine mono ${GS}/combine/manual/combine.html
99combine chapter ${GS}/combine/manual/html_chapter/
100combine section ${GS}/combine/manual/html_section/
101combine node ${GS}/combine/manual/html_node/
102
103complexity mono ${GS}/complexity/manual/complexity.html
104complexity node ${GS}/complexity/manual/html_node/
105
106coreutils mono ${GS}/coreutils/manual/coreutils
107coreutils node ${GS}/coreutils/manual/html_node/
108
109cpio mono ${GS}/cpio/manual/cpio
110cpio node ${GS}/cpio/manual/html_node/
111
112cssc node ${GS}/cssc/manual/
113
114#cvs cannot be handled here; see http://ximbiot.com/cvs/manual.
115
116ddd mono ${GS}/ddd/manual/html_mono/ddd.html
117
118ddrescue mono ${GS}/ddrescue/manual/ddrescue_manual.html
119
120DICO = http://puszcza.gnu.org.ua/software/dico/manual
121dico mono ${DICO}/dico.html
122dico chapter ${DICO}/html_chapter/
123dico section ${DICO}/html_section/
124dico node ${DICO}/html_node/
125
126diffutils mono ${GS}/diffutils/manual/diffutils
127diffutils node ${GS}/diffutils/manual/html_node/
128
129ed mono ${GS}/ed/manual/ed_manual.html
130
131EMACS = ${GS}/emacs/manual
132emacs mono ${EMACS}/html_mono/emacs.html
133emacs node ${EMACS}/html_node/emacs/
134 #
135 ada-mode mono ${EMACS}/html_mono/ada-mode.html
136 ada-mode node ${EMACS}/html_node/ada-mode/
137 #
138 autotype mono ${EMACS}/html_mono/autotype.html
139 autotype node ${EMACS}/html_node/autotype/
140 #
141 ccmode mono ${EMACS}/html_mono/ccmode.html
142 ccmode node ${EMACS}/html_node/ccmode/
143 #
144 cl mono ${EMACS}/html_mono/cl.html
145 cl node ${EMACS}/html_node/cl/
146 #
147 ebrowse mono ${EMACS}/html_mono/ebrowse.html
148 ebrowse node ${EMACS}/html_node/ebrowse/
149 #
150 ediff mono ${EMACS}/html_mono/ediff.html
151 ediff node ${EMACS}/html_node/ediff/
152 #
153 eieio mono ${EMACS}/html_mono/eieio.html
154 eieio node ${EMACS}/html_node/eieio/
155 #
156 elisp mono ${EMACS}/html_mono/elisp.html
157 elisp node ${EMACS}/html_node/elisp/
158 #
159 epa mono ${EMACS}/html_mono/epa.html
160 epa node ${EMACS}/html_node/epa/
161 #
162 erc mono ${EMACS}/html_mono/erc.html
163 erc node ${EMACS}/html_node/erc/
164 #
165 dired-x mono ${EMACS}/html_mono/dired-x.html
166 dired-x node ${EMACS}/html_node/dired-x/
167 #
168 eshell mono ${EMACS}/html_mono/eshell.html
169 eshell node ${EMACS}/html_node/eshell/
170 #
171 flymake mono ${EMACS}/html_mono/flymake.html
172 flymake node ${EMACS}/html_node/flymake/
173 #
174 gnus mono ${EMACS}/html_mono/gnus.html
175 gnus node ${EMACS}/html_node/gnus/
176 #
177 idlwave mono ${EMACS}/html_mono/idlwave.html
178 idlwave node ${EMACS}/html_node/idlwave/
179 #
180 message mono ${EMACS}/html_mono/message.html
181 message node ${EMACS}/html_node/message/
182 #
183 mh-e mono ${EMACS}/html_mono/mh-e.html
184 mh-e node ${EMACS}/html_node/mh-e/
185 #
186 nxml-mode mono ${EMACS}/html_mono/nxml-mode.html
187 nxml-mode node ${EMACS}/html_node/nxml-mode/
188 #
189 org mono ${EMACS}/html_mono/org.html
190 org node ${EMACS}/html_node/org/
191 #
192 pcl-cvs mono ${EMACS}/html_mono/pcl-cvs.html
193 pcl-cvs node ${EMACS}/html_node/pcl-cvs/
194 #
195 rcirc mono ${EMACS}/html_mono/rcirc.html
196 rcirc node ${EMACS}/html_node/rcirc/
197 #
198 semantic mono ${EMACS}/html_mono/semantic.html
199 semantic node ${EMACS}/html_node/semantic/
200 #
201 smtp mono ${EMACS}/html_mono/smtpmail.html
202 smtp node ${EMACS}/html_node/smtpmail/
203 #
204 speedbar mono ${EMACS}/html_mono/speedbar.html
205 speedbar node ${EMACS}/html_node/speedbar/
206 #
207 tramp mono ${EMACS}/html_mono/tramp.html
208 tramp node ${EMACS}/html_node/tramp/
209 #
210 vip mono ${EMACS}/html_mono/vip.html
211 vip node ${EMACS}/html_node/vip/
212 #
213 viper mono ${EMACS}/html_mono/viper.html
214 viper node ${EMACS}/html_node/viper/
215 #
216 woman mono ${EMACS}/html_mono/woman.html
217 woman node ${EMACS}/html_node/woman/
218 # (end emacs manuals)
219
220easejs mono ${GS}/easejs/manual/easejs.html
221easejs node ${GS}/easejs/manual/
222
223EMACS_GUIX = https://alezost.github.io/guix.el/manual/latest
224emacs-guix mono ${EMACS_GUIX}/emacs-guix.html
225emacs-guix node ${EMACS_GUIX}/html_node/
226
227emacs-muse node ${GS}/emacs-muse/manual/muse.html
228emacs-muse node ${GS}/emacs-muse/manual/html_node/
229
230emms node ${GS}/emms/manual/
231
232# The file is called 'find.info' but the package is 'findutils'.
233find mono ${GS}/findutils/manual/html_mono/find.html
234find node ${GS}/findutils/manual/html_node/find_html
235findutils mono ${GS}/findutils/manual/html_mono/find.html
236findutils node ${GS}/findutils/manual/html_node/find_html
237
238FLEX = http://flex.sourceforge.net
239flex node ${FLEX}/manual/
240
241gama mono ${GS}/gama/manual/gama.html
242gama node ${GS}/gama/manual/html_node/
243
244GAWK = ${GS}/gawk/manual
245gawk mono ${GAWK}/gawk.html
246gawk node ${GAWK}/html_node/
247 gawkinet mono ${GAWK}/gawkinet/gawkinet.html
248 gawkinet node ${GAWK}/gawkinet/html_node/
249
250gcal mono ${GS}/gcal/manual/gcal.html
251gcal node ${GS}/gcal/manual/html_node/
252
253GCC = http://gcc.gnu.org/onlinedocs
254gcc node ${GCC}/gcc/
255 cpp node ${GCC}/cpp/
256 gcj node ${GCC}/gcj/
257 gfortran node ${GCC}/gfortran/
258 gnat_rm node ${GCC}/gnat_rm/
259 gnat_ugn_unw node ${GCC}/gnat_ugn_unw/
260 libgomp node ${GCC}/libgomp/
261 libstdc++ node ${GCC}/libstdc++/
262 #
263 gccint node ${GCC}/gccint/
264 cppinternals node ${GCC}/cppinternals/
265 gfc-internals node ${GCC}/gfc-internals/
266 gnat-style node ${GCC}/gnat-style/
267 libiberty node ${GCC}/libiberty/
268
269GDB = http://sourceware.org/gdb/current/onlinedocs
270gdb node ${GDB}/gdb/
271 stabs node ${GDB}/stabs/
272
273GDBM = http://www.gnu.org.ua/software/gdbm/manual
274gdbm mono ${GDBM}/gdbm.html
275gdbm chapter ${GDBM}/html_chapter/
276gdbm section ${GDBM}/html_section/
277gdbm node ${GDBM}/html_node/
278
279gettext mono ${GS}/gettext/manual/gettext.html
280gettext node ${GS}/gettext/manual/html_node/
281
282gforth node http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/
283
284global mono ${GS}/global/manual/global.html
285
286gmediaserver node ${GS}/gmediaserver/manual/
287
288gmp node http://www.gmplib.org/manual/
289
290gnu-arch node ${GS}/gnu-arch/tutorial/
291
292gnu-c-manual mono ${GS}/gnu-c-manual/gnu-c-manual.html
293
294gnu-crypto node ${GS}/gnu-crypto/manual/
295
296gnubg mono ${GS}/gnubg/manual/gnubg.html
297gnubg node ${GS}/gnubg/manual/html_node/
298
299gnubik mono ${GS}/gnubik/manual/gnubik.html
300gnubik node ${GS}/gnubik/manual/html_node/
301
302gnulib mono ${GS}/gnulib/manual/gnulib.html
303gnulib node ${GS}/gnulib/manual/html_node/
304
305GNUN = ${GS}/trans-coord/manual
306gnun mono ${GNUN}/gnun/gnun.html
307gnun node ${GNUN}/gnun/html_node/
308 web-trans mono ${GNUN}/web-trans/web-trans.html
309 web-trans node ${GNUN}/web-trans/html_node/
310
311GNUNET = https://docs.gnunet.org/manuals
312gnunet node ${GNUNET}/gnunet/
313 gnunet-c-tutorial node ${GNUNET}/gnunet-c-tutorial/
314 gnunet-java-tutorial node ${GNUNET}/gnunet-java-tutorial/
315
316GNUPG = http://www.gnupg.org/documentation/manuals
317gnupg node ${GNUPG}/gnupg/
318 dirmngr node ${GNUPG}/dirmngr/
319 gcrypt node ${GNUPG}/gcrypt/
320 libgcrypt node ${GNUPG}/gcrypt/
321 ksba node ${GNUPG}/ksba/
322 assuan node ${GNUPG}/assuan/
323 gpgme node ${GNUPG}/gpgme/
324
325gnuprologjava node ${GS}/gnuprologjava/manual/
326
327gnuschool mono ${GS}/gnuschool/gnuschool.html
328
329GNUSTANDARDS = ${G}/prep
330 maintain mono ${GNUSTANDARDS}/maintain/maintain.html
331 maintain node ${GNUSTANDARDS}/maintain/html_node/
332 #
333 standards mono ${GNUSTANDARDS}/standards/standards.html
334 standards node ${GNUSTANDARDS}/standards/html_node/
335
336gnutls mono http://gnutls.org/manual/gnutls.html
337gnutls node http://gnutls.org/manual/html_node/
338
339gnutls-guile mono http://gnutls.org/manual/gnutls-guile.html
340gnutls-guile node http://gnutls.org/manual/gnutls-guile/
341
342gperf mono ${GS}/gperf/manual/gperf.html
343gperf node ${GS}/gperf/manual/html_node/
344
345grep mono ${GS}/grep/manual/grep.html
346grep node ${GS}/grep/manual/html_node/
347
348groff node ${GS}/groff/manual/html_node/
349
350GRUB = ${GS}/grub/manual
351 grub mono ${GRUB}/grub.html
352 grub node ${GRUB}/html_node/
353 #
354 multiboot mono ${GRUB}/multiboot/multiboot.html
355 multiboot node ${GRUB}/multiboot/html_node/
356
357gsasl mono ${GS}/gsasl/manual/gsasl.html
358gsasl node ${GS}/gsasl/manual/html_node/
359
360gsl node ${GS}/gsl/manual/html_node/
361
362gsrc mono ${GS}/gsrc/manual/gsrc.html
363gsrc node ${GS}/gsrc/manual/html_node/
364
365gss mono ${GS}/gss/manual/gss.html
366gss node ${GS}/gss/manual/html_node/
367
368gtypist mono ${GS}/gtypist/doc/
369
370guile mono ${GS}/guile/manual/guile.html
371guile node ${GS}/guile/manual/html_node/
372
373guile-avahi mono http://nongnu.org/guile-avahi/doc/guile-avahi.html
374
375GUILE_GNOME = ${GS}/guile-gnome/docs
376 gobject node ${GUILE_GNOME}/gobject/html/
377 glib node ${GUILE_GNOME}/glib/html/
378 atk node ${GUILE_GNOME}/atk/html/
379 pango node ${GUILE_GNOME}/pango/html/
380 pangocairo node ${GUILE_GNOME}/pangocairo/html/
381 gdk node ${GUILE_GNOME}/gdk/html/
382 gtk node ${GUILE_GNOME}/gtk/html/
383 libglade node ${GUILE_GNOME}/libglade/html/
384 gnome-vfs node ${GUILE_GNOME}/gnome-vfs/html/
385 libgnomecanvas node ${GUILE_GNOME}/libgnomecanvas/html/
386 gconf node ${GUILE_GNOME}/gconf/html/
387 libgnome node ${GUILE_GNOME}/libgnome/html/
388 libgnomeui node ${GUILE_GNOME}/libgnomeui/html/
389 corba node ${GUILE_GNOME}/corba/html/
390 clutter node ${GUILE_GNOME}/clutter/html/
391 clutter-glx node ${GUILE_GNOME}/clutter-glx/html/
392
393guile-gtk node ${GS}/guile-gtk/docs/guile-gtk/
394
395guile-rpc mono ${GS}/guile-rpc/manual/guile-rpc.html
396guile-rpc node ${GS}/guile-rpc/manual/html_node/
397
398guix mono ${GS}/guix/manual/guix.html
399guix node ${GS}/guix/manual/html_node/
400
401gv mono ${GS}/gv/manual/gv.html
402gv node ${GS}/gv/manual/html_node/
403
404gzip mono ${GS}/gzip/manual/gzip.html
405gzip node ${GS}/gzip/manual/html_node/
406
407hello mono ${GS}/hello/manual/hello.html
408hello node ${GS}/hello/manual/html_node/
409
410help2man mono ${GS}/help2man/help2man.html
411
412idutils mono ${GS}/idutils/manual/idutils.html
413idutils node ${GS}/idutils/manual/html_node/
414
415inetutils mono ${GS}/inetutils/manual/inetutils.html
416inetutils node ${GS}/inetutils/manual/html_node/
417
418jwhois mono ${GS}/jwhois/manual/jwhois.html
419jwhois node ${GS}/jwhois/manual/html_node/
420
421libc mono ${GS}/libc/manual/html_mono/libc.html
422libc node ${GS}/libc/manual/html_node/
423
424LIBCDIO = ${GS}/libcdio
425 libcdio mono ${LIBCDIO}/libcdio.html
426 cd-text mono ${LIBCDIO}/cd-text-format.html
427
428libextractor mono ${GS}/libextractor/manual/libextractor.html
429libextractor node ${GS}/libextractor/manual/html_node/
430
431libidn mono ${GS}/libidn/manual/libidn.html
432libidn node ${GS}/libidn/manual/html_node/
433
434librejs mono ${GS}/librejs/manual/librejs.html
435librejs node ${GS}/librejs/manual/html_node/
436
437libmatheval mono ${GS}/libmatheval/manual/libmatheval.html
438
439LIBMICROHTTPD = ${GS}/libmicrohttpd
440libmicrohttpd mono ${LIBMICROHTTPD}/manual/libmicrohttpd.html
441libmicrohttpd node ${LIBMICROHTTPD}/manual/html_node/
442 microhttpd-tutorial mono ${LIBMICROHTTPD}/tutorial.html
443
444libtasn1 mono ${GS}/libtasn1/manual/libtasn1.html
445libtasn1 node ${GS}/libtasn1/manual/html_node/
446
447libtool mono ${GS}/libtool/manual/libtool.html
448libtool node ${GS}/libtool/manual/html_node/
449
450lightning mono ${GS}/lightning/manual/lightning.html
451lightning node ${GS}/lightning/manual/html_node/
452
453# The stable/ url redirects immediately, but that's ok.
454# The .html extension is omitted on their web site, but it works if given.
455LILYPOND = http://lilypond.org/doc/stable/Documentation
456 lilypond-internals node ${LILYPOND}/internals/
457 lilypond-learning node ${LILYPOND}/learning/
458 lilypond-notation node ${LILYPOND}/notation/
459 lilypond-snippets node ${LILYPOND}/snippets/
460 lilypond-usage node ${LILYPOND}/usage/
461 lilypond-web node ${LILYPOND}/web/
462 music-glossary node ${LILYPOND}/music-glossary/
463
464liquidwar6 mono ${GS}/liquidwar6/manual/liquidwar6.html
465liquidwar6 node ${GS}/liquidwar6/manual/html_node/
466
467lispintro mono ${GS}/emacs/emacs-lisp-intro/html_mono/emacs-lisp-intro.html
468lispintro node ${GS}/emacs/emacs-lisp-intro/html_node/index.html
469
470LSH = http://www.lysator.liu.se/~nisse/lsh
471 lsh mono ${LSH}/lsh.html
472
473m4 mono ${GS}/m4/manual/m4.html
474m4 node ${GS}/m4/manual/html_node/
475
476mailutils mono ${GS}/mailutils/manual/mailutils.html
477mailutils chapter ${GS}/mailutils/manual/html_chapter/
478mailutils section ${GS}/mailutils/manual/html_section/
479mailutils node ${GS}/mailutils/manual/html_node/
480
481make mono ${GS}/make/manual/make.html
482make node ${GS}/make/manual/html_node/
483
484mcron mono ${GS}/mcron/manual/mcron.html
485mcron node ${GS}/mcron/manual/html_node/
486
487mdk mono ${GS}/mdk/manual/mdk.html
488mdk node ${GS}/mdk/manual/html_node/
489
490METAEXCHANGE = http://ftp.gwdg.de/pub/gnu2/iwfmdh/doc/texinfo
491 iwf_mh node ${METAEXCHANGE}/iwf_mh.html
492 scantest node ${METAEXCHANGE}/scantest.html
493
494MIT_SCHEME = ${GS}/mit-scheme/documentation
495 mit-scheme-ref node ${MIT_SCHEME}/mit-scheme-ref/
496 mit-scheme-user node ${MIT_SCHEME}/mit-scheme-user/
497 sos node ${MIT_SCHEME}/mit-scheme-sos/
498 mit-scheme-imail node ${MIT_SCHEME}/mit-scheme-imail/
499
500moe mono ${GS}/moe/manual/moe_manual.html
501
502motti node ${GS}/motti/manual/
503
504mpc node http://www.multiprecision.org/index.php?prog=mpc&page=html
505
506mpfr mono http://www.mpfr.org/mpfr-current/mpfr.html
507
508mtools mono ${GS}/mtools/manual/mtools.html
509
510myserver node http://www.myserverproject.net/documentation/
511
512nano mono http://www.nano-editor.org/dist/latest/nano.html
513
514nettle chapter http://www.lysator.liu.se/~nisse/nettle/nettle.html
515
516ocrad mono ${GS}/ocrad/manual/ocrad_manual.html
517
518parted mono ${GS}/parted/manual/parted.html
519parted node ${GS}/parted/manual/html_node/
520
521pascal mono http://www.gnu-pascal.de/gpc/
522
523# can't use pcb since url's contain dates --30nov10
524
525perl mono ${GS}/perl/manual/perldoc-all.html
526
527PIES = http://www.gnu.org.ua/software/pies/manual
528pies mono ${PIES}/pies.html
529pies chapter ${PIES}/html_chapter/
530pies section ${PIES}/html_section/
531pies node ${PIES}/html_node/
532
533plotutils mono ${GS}/plotutils/manual/en/plotutils.html
534plotutils node ${GS}/plotutils/manual/en/html_node/
535
536proxyknife mono ${GS}/proxyknife/manual/proxyknife.html
537proxyknife node ${GS}/proxyknife/manual/html_node/
538
539pspp mono ${GS}/pspp/manual/pspp.html
540pspp node ${GS}/pspp/manual/html_node/
541
542pyconfigure mono ${GS}/pyconfigure/manual/pyconfigure.html
543pyconfigure node ${GS}/pyconfigure/manual/html_node/
544
545R = http://cran.r-project.org/doc/manuals
546 R-intro mono ${R}/R-intro.html
547 R-lang mono ${R}/R-lang.html
548 R-exts mono ${R}/R-exts.html
549 R-data mono ${R}/R-data.html
550 R-admin mono ${R}/R-admin.html
551 R-ints mono ${R}/R-ints.html
552
553rcs mono ${GS}/rcs/manual/rcs.html
554rcs node ${GS}/rcs/manual/html_node/
555
556READLINE = http://cnswww.cns.cwru.edu/php/chet/readline
557readline mono ${READLINE}/readline.html
558 rluserman mono ${READLINE}/rluserman.html
559 history mono ${READLINE}/history.html
560
561recode mono http://recode.progiciels-bpi.ca/manual/index.html
562
563recutils mono ${GS}/recutils/manual/recutils.html
564recutils node ${GS}/recutils/manual/html_node/
565
566reftex mono ${GS}/auctex/manual/reftex.html
567reftex node ${GS}/auctex/manual/reftex/
568
569remotecontrol mono ${GS}/remotecontrol/manual/remotecontrol.html
570remotecontrol node ${GS}/remotecontrol/manual/html_node/
571
572rottlog mono ${GS}/rottlog/manual/rottlog.html
573rottlog node ${GS}/rottlog/manual/html_node/
574
575RUSH = http://www.gnu.org.ua/software/rush/manual
576rush mono ${RUSH}/rush.html
577rush chapter ${RUSH}/html_chapter/
578rush section ${RUSH}/html_section/
579rush node ${RUSH}/html_node/
580
581screen mono ${GS}/screen/manual/screen.html
582screen node ${GS}/screen/manual/html_node/
583
584sed mono ${GS}/sed/manual/sed.html
585sed node ${GS}/sed/manual/html_node/
586
587sharutils mono ${GS}/sharutils/manual/html_mono/sharutils.html
588sharutils chapter ${GS}/sharutils/manual/html_chapter/
589sharutils node ${GS}/sharutils/manual/html_node/
590
591shepherd mono ${GS}/shepherd/manual/shepherd.html
592shepherd node ${GS}/shepherd/manual/html_node/
593
594# can't use mono files since they have generic names
595SMALLTALK = ${GS}/smalltalk
596smalltalk node ${SMALLTALK}/manual/html_node/
597 smalltalk-base node ${SMALLTALK}/manual-base/html_node/
598 smalltalk-libs node ${SMALLTALK}/manual-libs/html_node/
599
600sourceinstall mono ${GS}/sourceinstall/manual/sourceinstall.html
601sourceinstall node ${GS}/sourceinstall/manual/html_node/
602
603sqltutor mono ${GS}/sqltutor/manual/sqltutor.html
604sqltutor node ${GS}/sqltutor/manual/html_node/
605
606src-highlite mono ${GS}/src-highlite/source-highlight.html
607
608swbis mono ${GS}/swbis/manual.html
609
610tar mono ${GS}/tar/manual/tar.html
611tar chapter ${GS}/tar/manual/html_chapter/
612tar section ${GS}/tar/manual/html_section/
613tar node ${GS}/autoconf/manual/html_node/
614
615teseq mono ${GS}/teseq/teseq.html
616teseq node ${GS}/teseq/html_node/
617
618TEXINFO = ${GS}/texinfo/manual
619texinfo mono ${TEXINFO}/texinfo/texinfo.html
620texinfo node ${TEXINFO}/texinfo/html_node/
621 #
622 info mono ${TEXINFO}/info/info.html
623 info node ${TEXINFO}/info/html_node/
624 #
625 info-stnd mono ${TEXINFO}/info-stnd/info-stnd.html
626 info-stnd node ${TEXINFO}/info-stnd/html_node/
627
628thales node ${GS}/thales/manual/
629
630units mono ${GS}/units/manual/units.html
631units node ${GS}/units/manual/html_node/
632
633vc-dwim mono ${GS}/vc-dwim/manual/vc-dwim.html
634vc-dwim node ${GS}/vc-dwim/manual/html_node/
635
636wdiff mono ${GS}/wdiff/manual/wdiff.html
637wdiff node ${GS}/wdiff/manual/html_node/
638
639websocket4j mono ${GS}/websocket4j/manual/websocket4j.html
640websocket4j node ${GS}/websocket4j/manual/html_node/
641
642wget mono ${GS}/wget/manual/wget.html
643wget node ${GS}/wget/manual/html_node/
644
645xboard mono ${GS}/xboard/manual/xboard.html
646xboard node ${GS}/xboard/manual/html_node/
647
648# emacs-page
649# Free TeX-related Texinfo manuals on tug.org.
650
651T = http://tug.org/texinfohtml
652
653dvipng mono ${T}/dvipng.html
654dvips mono ${T}/dvips.html
655eplain mono ${T}/eplain.html
656kpathsea mono ${T}/kpathsea.html
657latex2e mono ${T}/latex2e.html
658tlbuild mono ${T}/tlbuild.html
659web2c mono ${T}/web2c.html
660
661
662# Local Variables:
663# eval: (add-hook 'write-file-hooks 'time-stamp)
664# time-stamp-start: "htmlxrefversion="
665# time-stamp-format: "%:y-%02m-%02d.%02H"
666# time-stamp-time-zone: "UTC"
667# time-stamp-end: "; # UTC"
668# End:
diff --git a/doc/old/tutorial/manual.css b/doc/old/tutorial/manual.css
new file mode 100644
index 000000000..0fe08b83c
--- /dev/null
+++ b/doc/old/tutorial/manual.css
@@ -0,0 +1,52 @@
1/* Style-sheet to use for manuals (copied from Emacs) */
2
3@import url('style.css');
4
5/* makeinfo 6.5 converts @quotation to <blockquote>. Highlight them. */
6blockquote {
7 font-style: normal;
8 border-left: solid 10px red;
9 padding-left: 2.5%;
10 margin-left: 0px;
11}
12
13var { font-style: italic; }
14
15/* Lay out @lisp just like @example. Copied from what /style.css
16 does for the 'example' class. */
17div.lisp { padding: .8em 1.2em .4em; }
18pre.lisp { padding: .8em 1.2em; }
19div.lisp, pre.lisp {
20 margin: 1em 0 1em 3% ;
21 -webkit-border-radius: .3em;
22 -moz-border-radius: .3em;
23 border-radius: .3em;
24 border: 1px solid #d4cbb6;
25 background-color: #f2efe4;
26}
27div.lisp > pre.lisp {
28 padding: 0 0 .4em;
29 margin: 0;
30 border: none;
31}
32
33/* ----- coreutils specific styling ----- */
34
35/* layout.css indents "body p" when it should probably only indent "body > p"?
36 In any case, disable indenting of p in these sub elements. */
37dd p,li p {
38 margin-left: 0;
39 margin-right: 0;
40}
41
42/* underlined links are distracting, especially within outlined tables. */
43a { /*add :link for external links*/
44 text-decoration: none; /* don't underline links by default */
45 outline-style: none; /* don't put dotted box around clicked links */
46}
47a:hover {
48 text-decoration: underline;
49}
50
51/* The shadow around the body is distracting. */
52body { box-shadow: 0 0 0 0; }
diff --git a/doc/old/tutorial/reset.css b/doc/old/tutorial/reset.css
new file mode 100644
index 000000000..9a6c3065f
--- /dev/null
+++ b/doc/old/tutorial/reset.css
@@ -0,0 +1,114 @@
1/*
2Software License Agreement (BSD License)
3
4Copyright (c) 2006, Yahoo! Inc.
5All rights reserved.
6
7Redistribution and use of this software in source and
8binary forms, with or without modification, arepermitted
9provided that the following conditions are met:
10
11* Redistributions of source code must retain the above
12copyright notice, this list of conditions and the
13following disclaimer.
14
15* Redistributions in binary form must reproduce the above
16copyright notice, this list of conditions and the
17following disclaimer in the documentation and/or other
18materials provided with the distribution.
19
20* Neither the name of Yahoo! Inc. nor the names of its
21contributors may be used to endorse or promote products
22derived from this software without specific prior
23written permission of Yahoo! Inc.
24
25THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
26CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
27INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
30CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
32NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
33LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
35IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
36NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38SUCH DAMAGE.
39*/
40
41html {
42 color: #000;
43 background: #FFF;
44}
45
46body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4,
47h5, h6, pre, code, form, fieldset, legend, input,
48button, textarea, p, blockquote, th, td {
49 margin: 0;
50 padding: 0;
51}
52
53table {
54 border-collapse: collapse;
55 border-spacing: 0;
56}
57
58fieldset, img {
59 border: 0;
60}
61
62address, caption, cite, code, dfn, em, strong,
63th, var, optgroup {
64 font-style: inherit;
65 font-weight: inherit;
66}
67
68del, ins {
69 text-decoration: none;
70}
71
72li {
73 list-style:none;
74}
75
76caption, th {
77 text-align: left;
78}
79
80h1, h2, h3, h4, h5, h6 {
81 font-size: 100%;
82 font-weight: normal;
83}
84
85q:before, q:after {
86 content:'';
87}
88
89abbr, acronym {
90 border: 0;
91 font-variant: normal;
92}
93
94sup {
95 vertical-align: baseline;
96}
97sub {
98 vertical-align: baseline;
99}
100
101legend {
102 color: #000;
103}
104
105input, button, textarea, select, optgroup, option {
106 font-family: inherit;
107 font-size: inherit;
108 font-style: inherit;
109 font-weight: inherit;
110}
111
112input, button, textarea, select {
113 *font-size: 100%;
114}
diff --git a/doc/old/tutorial/run-gendocs.sh b/doc/old/tutorial/run-gendocs.sh
new file mode 100755
index 000000000..b4899722c
--- /dev/null
+++ b/doc/old/tutorial/run-gendocs.sh
@@ -0,0 +1,18 @@
1#!/bin/sh
2
3make version.texi/replacement
4
5./gendocs.sh --email gnunet-developers@gnu.org gnunet-c-tutorial "GNUnet C Tutorial" -o "manual/gnunet-c-tutorial"
6#cd manual
7#mkdir gnunet-c-tutorial
8#mv * gnunet-c-tutorial/
9#cd ..
10#./gendocs.sh --email gnunet-developers@gnu.org gnunet "GNUnet Reference Manual" -o "manual/gnunet"
11#cd manual
12#mkdir handbook
13#mkdir ../tmp-gnunet
14#mv gnunet ../tmp-gnunet
15#mv * handbook/
16#mv ../tmp-gnunet gnunet
17cp "index.html" manual/
18printf "Success"
diff --git a/doc/old/tutorial/style.css b/doc/old/tutorial/style.css
new file mode 100644
index 000000000..e5271197b
--- /dev/null
+++ b/doc/old/tutorial/style.css
@@ -0,0 +1,174 @@
1/* This stylesheet is used by manuals and a few older resources. */
2
3@import url('reset.css');
4
5
6/*** PAGE LAYOUT ***/
7
8html, body {
9 font-size: 1em;
10 text-align: left;
11 text-decoration: none;
12}
13html { background-color: #e7e7e7; }
14
15body {
16 max-width: 74.92em;
17 margin: 0 auto;
18 padding: .5em 1em 1em 1em;
19 background-color: white;
20 border: .1em solid #c0c0c0;
21}
22
23
24/*** BASIC ELEMENTS ***/
25
26/* Size and positioning */
27
28p, pre, li, dt, dd, table, code, address { line-height: 1.3em; }
29
30h1 { font-size: 2em; margin: 1em 0 }
31h2 { font-size: 1.50em; margin: 1.0em 0 0.87em 0; }
32h3 { font-size: 1.30em; margin: 1.0em 0 0.87em 0; }
33h4 { font-size: 1.13em; margin: 1.0em 0 0.88em 0; }
34h5 { font-size: 1.00em; margin: 1.0em 0 1.00em 0; }
35
36p, pre { margin: 1em 0; }
37pre { overflow: auto; padding-bottom: .3em; }
38
39ul, ol, blockquote { margin-left: 1.5%; margin-right: 1.5%; }
40hr { margin: 1em 0; }
41/* Lists of underlined links are difficult to read. The top margin
42 gives a little more spacing between entries. */
43ul li { margin: .5em 1em; }
44ol li { margin: 1em; }
45ol ul li { margin: .5em 1em; }
46ul li p, ul ul li { margin-top: .3em; margin-bottom: .3em; }
47ul ul, ol ul { margin-top: 0; margin-bottom: 0; }
48
49/* Separate description lists from preceding text */
50dl { margin: 1em 0 0 0; }
51/* separate the "term" from subsequent "description" */
52dt { margin: .5em 0; }
53/* separate the "description" from subsequent list item
54 when the final <dd> child is an anonymous box */
55dd { margin: .5em 3% 1em 3%; }
56/* separate anonymous box (used to be the first element in <dd>)
57 from subsequent <p> */
58dd p { margin: .5em 0; }
59
60table {
61 display: block; overflow: auto;
62 margin-top: 1.5em; margin-bottom: 1.5em;
63}
64th { padding: .3em .5em; text-align: center; }
65td { padding: .2em .5em; }
66
67address { margin-bottom: 1em; }
68caption { margin-bottom: .5em; text-align: center; }
69sup { vertical-align: super; }
70sub { vertical-align: sub; }
71
72/* Style */
73
74h1, h2, h3, h4, h5, h6, strong, dt, th { font-weight: bold; }
75
76/* The default color (black) is too dark for large text in
77 bold font. */
78h1, h2, h3, h4 { color: #333; }
79h5, h6, dt { color: #222; }
80
81a[href] { color: #005090; }
82a[href]:visited { color: #100070; }
83a[href]:active, a[href]:hover {
84 color: #100070;
85 text-decoration: none;
86}
87
88h1 a[href]:visited, h2 a[href]:visited, h3 a[href]:visited,
89 h4 a[href]:visited { color: #005090; }
90h1 a[href]:hover, h2 a[href]:hover, h3 a[href]:hover,
91 h4 a[href]:hover { color: #100070; }
92
93ol { list-style: decimal outside;}
94ul { list-style: square outside; }
95ul ul, ol ul { list-style: circle; }
96li { list-style: inherit; }
97
98hr { background-color: #ede6d5; }
99table { border: 0; }
100
101abbr,acronym {
102 border-bottom:1px dotted #000;
103 text-decoration: none;
104 cursor:help;
105}
106del { text-decoration: line-through; }
107em { font-style: italic; }
108small { font-size: .9em; }
109
110img { max-width: 100%}
111
112
113/*** SIMPLE CLASSES ***/
114
115.center, .c { text-align: center; }
116.nocenter{ text-align: left; }
117
118.underline { text-decoration: underline; }
119.nounderline { text-decoration: none; }
120
121.no-bullet { list-style: none; }
122.inline-list li { display: inline }
123
124.netscape4, .no-display { display: none; }
125
126
127/*** MANUAL PAGES ***/
128
129/* This makes the very long tables of contents in Gnulib and other
130 manuals easier to read. */
131.contents ul, .shortcontents ul { font-weight: bold; }
132.contents ul ul, .shortcontents ul ul { font-weight: normal; }
133.contents ul { list-style: none; }
134
135/* For colored navigation bars (Emacs manual): make the bar extend
136 across the whole width of the page and give it a decent height. */
137.header, .node { margin: 0 -1em; padding: 0 1em; }
138.header p, .node p { line-height: 2em; }
139
140/* For navigation links */
141.node a, .header a { display: inline-block; line-height: 2em; }
142.node a:hover, .header a:hover { background: #f2efe4; }
143
144/* Inserts */
145table.cartouche td { padding: 1.5em; }
146
147div.display, div.lisp, div.smalldisplay,
148 div.smallexample, div.smalllisp { margin-left: 3%; }
149
150div.example { padding: .8em 1.2em .4em; }
151pre.example { padding: .8em 1.2em; }
152div.example, pre.example {
153 margin: 1em 0 1em 3% ;
154 -webkit-border-radius: .3em;
155 -moz-border-radius: .3em;
156 border-radius: .3em;
157 border: 1px solid #d4cbb6;
158 background-color: #f2efe4;
159}
160div.example > pre.example {
161 padding: 0 0 .4em;
162 margin: 0;
163 border: none;
164}
165
166pre.menu-comment { padding-top: 1.3em; margin: 0; }
167
168
169/*** FOR WIDE SCREENS ***/
170
171@media (min-width: 40em) {
172 body { padding: .5em 3em 1em 3em; }
173 div.header, div.node { margin: 0 -3em; padding: 0 3em; }
174}
diff --git a/doc/old/tutorial/tutorial.texi b/doc/old/tutorial/tutorial.texi
new file mode 100644
index 000000000..f849e116a
--- /dev/null
+++ b/doc/old/tutorial/tutorial.texi
@@ -0,0 +1,1568 @@
1\input texinfo
2
3@setfilename gnunet-tutorial.info
4@documentencoding UTF-8
5@settitle GNUnet Tutorial
6@c @exampleindent 2
7
8
9@include version.texi
10
11@copying
12Copyright @copyright{} 2001-2018 GNUnet e.V.
13
14Permission is granted to copy, distribute and/or modify this document
15under the terms of the GNU Free Documentation License, Version 1.3 or
16any later version published by the Free Software Foundation; with no
17Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
18copy of the license is included in the section entitled ``GNU Free
19Documentation License''.
20
21A copy of the license is also available from the Free Software
22Foundation Web site at @url{http://www.gnu.org/licenses/fdl.html}.
23
24Alternately, this document is also available under the General
25Public License, version 3 or later, as published by the Free Software
26Foundation. A copy of the license is included in the section entitled
27``GNU General Public License''.
28
29A copy of the license is also available from the Free Software
30Foundation Web site at @url{http://www.gnu.org/licenses/gpl.html}.
31@end copying
32
33@dircategory Tutorial
34@direntry
35* GNUnet-Tutorial: (gnunet-tutorial). C Tutorial for GNunet
36@end direntry
37
38
39@titlepage
40@title GNUnet C Tutorial
41@subtitle A Tutorial for GNUnet @value{VERSION} (C version)
42@author The GNUnet Developers
43
44@page
45@vskip 0pt plus 1filll
46
47@insertcopying
48@end titlepage
49
50@contents
51
52@c **** TODO
53@c 1. Update content?
54@c 2. Either reference main documentation or
55@c 3. Merge this into main documentation
56
57@node Top
58@top Introduction
59
60This tutorials explains how to install GNUnet on a
61GNU/Linux system and gives an introduction on how
62GNUnet can be used to develop a Peer-to-Peer application.
63Detailed installation instructions for
64various operating systems and a detailed list of all
65dependencies can be found on our website at
66@uref{https://docs.gnunet.org/#Installation} and in our
67Reference Documentation (GNUnet Handbook).
68
69Please read this tutorial carefully since every single step is
70important, and do not hesitate to contact the GNUnet team if you have
71any questions or problems! Visit this link in your webbrowser to learn
72how to contact the GNUnet team:
73@uref{https://gnunet.org/en/contact.html}
74
75@menu
76
77* Installing GNUnet:: Installing GNUnet
78* Introduction to GNUnet Architecture:: Introduction to GNUnet Architecture
79* First Steps with GNUnet:: First Steps with GNUnet
80* Developing Applications:: Developing Applications
81* GNU Free Documentation License:: The license of this manual
82
83@detailmenu
84 --- The Detailed Node Listing ---
85
86Installing GNUnet
87
88* Obtaining a stable version::
89* Installing Build Tool Chain and Dependencies::
90* Obtaining the latest version from Git::
91* Compiling and Installing GNUnet::
92* Common Issues - Check your GNUnet installation::
93
94Introduction to GNUnet Architecture
95
96First Steps with GNUnet
97
98* Configure your peer::
99* Start a peer::
100* Monitor a peer::
101* Starting Two Peers by Hand::
102* Starting Peers Using the Testbed Service::
103
104Developing Applications
105
106* gnunet-ext::
107* Adapting the Template::
108* Writing a Client Application::
109* Writing a Service::
110* Interacting directly with other Peers using the CORE Service::
111* Storing peer-specific data using the PEERSTORE service::
112* Using the DHT::
113* Debugging with gnunet-arm::
114
115@end detailmenu
116@end menu
117
118@node Installing GNUnet
119@chapter Installing GNUnet
120
121First of all you have to install a current version of GNUnet.
122You can download a tarball of a stable version from GNU FTP mirrors
123or obtain the latest development version from our Git repository.
124
125Most of the time you should prefer to download the stable version
126since with the latest development version things can be broken,
127functionality can be changed or tests can fail. You should only use
128the development version if you know that you require a certain
129feature or a certain issue has been fixed since the last release.
130
131@menu
132* Obtaining a stable version::
133* Installing Build Tool Chain and Dependencies::
134* Obtaining the latest version from Git::
135* Compiling and Installing GNUnet::
136* Common Issues - Check your GNUnet installation::
137@end menu
138
139@node Obtaining a stable version
140@section Obtaining a stable version
141
142Download the tarball from
143@indicateurl{https://ftp.gnu.org/gnu/gnunet/gnunet-@value{VERSION}.tar.gz}.
144
145Make sure to download the associated @file{.sig} file and to verify the
146authenticity of the tarball against it, like this:
147
148@example
149$ wget https://ftp.gnu.org/gnu/gnunet/gnunet-@value{VERSION}.tar.gz.sig
150$ gpg --verify-files gnunet-@value{VERSION}.tar.gz.sig
151@end example
152
153@noindent
154If this command fails because you do not have the required public key,
155then you need to run the following command to import it:
156
157@example
158$ gpg --keyserver keys.gnupg.net --recv-keys 48426C7E
159@end example
160
161@noindent
162and rerun the @code{gpg --verify-files} command.
163
164@b{Note:}@
165@b{The pub key to sign the 0.10.1 release has been
166revoked}. You will get an error message stating that
167@b{there is no known public key or that it has been revoked}.
168The next release of GNUnet will have a valid signature
169again. We are sorry for the inconvenience this causes.
170Another possible source you could use is our
171"gnunet" git repository which, since the change from SVN to git in 2016,
172has mandatory signed commits by every developer.
173
174After verifying the signature you can extract the tarball.
175The resulting directory will be renamed to @file{gnunet}, which we will
176be using in the remainder of this document to refer to the
177root of the source directory.
178
179@example
180$ tar xvzf gnunet-@value{VERSION}.tar.gz
181$ mv gnunet-@value{VERSION} gnunet
182@end example
183
184@c FIXME: This can be irritating for the reader - First we say git should
185@c be avoid unless it is really required, and then we write this
186@c paragraph:
187@noindent
188However, please note that stable versions can be very outdated.
189As a developer you are @b{strongly} encouraged to use the version
190from @uref{https://git.gnunet.org/, the git server}.
191
192@node Installing Build Tool Chain and Dependencies
193@section Installing Build Tool Chain and Dependencies
194
195To successfully compile GNUnet, you need the tools to build GNUnet and
196the required dependencies. Please take a look at the
197GNUnet Reference Documentation
198(@pxref{Dependencies, The GNUnet Reference Documentation,, gnunet, The GNUnet Reference Documentation})
199for a list of required dependencies and
200(@pxref{Generic installation instructions, The GNUnet Reference Documentation,, gnunet, The GNUnet Reference Documentation})
201read its Installation chapter for specific instructions for
202your Operating System.
203Please check the notes at the end of the configure process about
204required dependencies.
205
206For GNUnet bootstrapping support and the HTTP(S) plugin you should
207install @uref{https://gnunet.org/en/gnurl.html, libgnurl}.
208For the filesharing service you should install at least one of the
209datastore backends (MySQL, SQlite and PostgreSQL are supported).
210
211@node Obtaining the latest version from Git
212@section Obtaining the latest version from Git
213
214The latest development version can be obtained from our Git repository.
215To get the code you need to have @code{Git} installed. Usually your
216Operating System package manager should provide a suitable distribution
217of git (otherwise check out Guix or Nix). If you are using an Operating
218System based on Debian's apt:
219
220@example
221$ sudo apt-get install git
222@end example
223
224This is required for obtaining the repository, which is achieved with
225the following command:
226
227@example
228$ git clone https://git.gnunet.org/gnunet.git
229@end example
230
231@noindent
232After cloning the repository, you have to execute the @file{bootstrap}
233script in the new directory:
234
235@example
236$ cd gnunet
237$ ./bootstrap
238@end example
239
240@noindent
241The remainder of this tutorial will assume that you have the
242Git branch ``master'' checked out.
243
244@node Compiling and Installing GNUnet
245@section Compiling and Installing GNUnet
246
247Note: This section is a duplication of the more in depth
248@pxref{GNUnet Installation Handbook, The GNUnet Reference Documentation,, gnunet, The GNUnet Reference Documentation}.
249
250First, you need to install libgnupgerror 1.27 (or later) and
251libgcrypt 1.7.6 (or later):
252
253@example
254$ export GNUPGFTP="https://www.gnupg.org/ftp/gcrypt"
255$ wget $GNUPGFTP/libgpg-error/libgpg-error-1.27.tar.bz2
256$ tar xf libgpg-error-1.27.tar.bz2
257$ cd libgpg-error-1.27
258$ ./configure
259$ make
260$ sudo make install
261$ cd ..
262@end example
263
264@example
265$ export GNUPGFTP="https://www.gnupg.org/ftp/gcrypt"
266$ wget $GNUPGFTP/libgcrypt/libgcrypt-1.7.6.tar.bz2
267$ tar xf libgcrypt-1.7.6.tar.bz2
268$ cd libgcrypt-1.7.6
269$ ./configure
270$ make
271$ sudo make install
272$ cd ..
273@end example
274
275@menu
276* Installation::
277@end menu
278
279@node Installation
280@subsection Installation
281Assuming all dependencies are installed, the following commands will
282compile and install GNUnet in your home directory. You can specify the
283directory where GNUnet will be installed by changing the
284@code{--prefix} value when calling @command{./configure}. If
285you do not specify a prefix, GNUnet is installed in the directory
286@file{/usr/local}. When developing new applications you may want
287to enable verbose logging by adding @code{--enable-logging=verbose}:
288
289@example
290$ export PREFIX=$HOME
291$ ./configure --prefix=$PREFIX --enable-logging
292$ make
293$ make install
294@end example
295
296@noindent
297After installing GNUnet you have to add your GNUnet installation
298to your path environmental variable. In addition you have to
299create the @file{.config} directory in your home directory
300(unless it already exists) where GNUnet stores its data and an
301empty GNUnet configuration file:
302
303@example
304$ export PATH=$PATH:$PREFIX/bin
305$ echo export PATH=$PREFIX/bin:\\$PATH >> ~/.bashrc
306$ mkdir ~/.config/
307$ touch ~/.config/gnunet.conf
308@end example
309
310@node Common Issues - Check your GNUnet installation
311@section Common Issues - Check your GNUnet installation
312
313You should check your installation to ensure that installing GNUnet
314was successful up to this point. You should be able to access GNUnet's
315binaries and run GNUnet's self check.
316
317@example
318$ which gnunet-arm
319$PREFIX/bin/gnunet-arm
320@end example
321
322@noindent
323should return $PREFIX/bin/gnunet-arm (where $PREFIX is the location
324you have set earlier). It should be located in your
325GNUnet installation and the output should not be empty.
326
327If you see an output like:
328
329@example
330$ which gnunet-arm
331@end example
332
333@noindent
334check your PATH variable to ensure GNUnet's @file{bin} directory is
335included.
336
337GNUnet provides tests for all of its subcomponents. Assuming you have
338successfully built GNUnet, run
339
340@example
341$ cd gnunet
342$ make check
343@end example
344
345@noindent
346to execute tests for all components. @command{make check} traverses all
347subdirectories in @file{src}. For every subdirectory you should
348get a message like this:
349
350@example
351make[2]: Entering directory `/home/$USER/gnunet/contrib'
352PASS: test_gnunet_prefix
353=============
3541 test passed
355=============
356@end example
357
358@node Introduction to GNUnet Architecture
359@chapter Introduction to GNUnet Architecture
360
361GNUnet is organized in layers and services. Each service is composed of a
362main service implementation and a client library for other programs to use
363the service's functionality, described by an API.
364@c This approach is shown in
365@c FIXME: enable this once the commented block below works:
366@c figure~\ref fig:service.
367Some services provide an additional command line tool to enable the user
368to interact with the service.
369
370Very often it is other GNUnet services that will use these APIs to build
371the higher layers of GNUnet on top of the lower ones. Each layer expands
372or extends the functionality of the service below (for instance, to build
373a mesh on top of a DHT).
374@c FXIME: See comment above.
375@c See figure ~\ref fig:interaction for an illustration of this approach.
376
377@c ** @image filename[, width[, height[, alttext[, extension]]]]
378@c FIXME: Texlive (?) 20112 makes the assumption that this means
379@c 'images/OBJECTNAME.txt' but later versions of it (2017) use this
380@c syntax as described below.
381@c TODO: Checkout the makedoc script Guile uses.
382
383@c FIXME!!!
384@c @image{images/gnunet-tutorial-service,,5in,Service with API and network protocol,.png}
385@c @image{images/gnunet-tutorial-system,,5in,The layered system architecture of GNUnet,.png}
386
387@c \begin{figure}[!h]
388@c \begin{center}
389@c % \begin{subfigure}
390@c \begin{subfigure}[b]{0.3\textwidth}
391@c \centering
392@c \includegraphics[width=\textwidth]{figs/Service.pdf}
393@c \caption{Service with API and network protocol}
394@c \label{fig:service}
395@c \end{subfigure}
396@c ~~~~~~~~~~
397@c \begin{subfigure}[b]{0.3\textwidth}
398@c \centering
399@c \includegraphics[width=\textwidth]{figs/System.pdf}
400@c \caption{Service interaction}
401@c \label{fig:interaction}
402@c \end{subfigure}
403@c \end{center}
404@c \caption{GNUnet's layered system architecture}
405@c \end{figure}
406
407The main service implementation runs as a standalone process in the
408Operating System and the client code runs as part of the client program,
409so crashes of a client do not affect the service process or other clients.
410The service and the clients communicate via a message protocol to be
411defined and implemented by the programmer.
412
413@node First Steps with GNUnet
414@chapter First Steps with GNUnet
415
416@menu
417* Configure your peer::
418* Start a peer::
419* Monitor a peer::
420* Starting Two Peers by Hand::
421* Starting Peers Using the Testbed Service::
422@end menu
423
424@node Configure your peer
425@section Configure your peer
426
427First of all we need to configure your peer. Each peer is started with
428a configuration containing settings for GNUnet itself and its services.
429This configuration is based on the default configuration shipped with
430GNUnet and can be modified. The default configuration is located in the
431@file{$PREFIX/share/gnunet/config.d} directory. When starting a peer, you
432can specify a customized configuration using the the @command{-c} command
433line switch when starting the ARM service and all other services. When
434using a modified configuration the default values are loaded and only
435values specified in the configuration file will replace the default
436values.
437
438Since we want to start additional peers later, we need some modifications
439from the default configuration. We need to create a separate service
440home and a file containing our modifications for this peer:
441
442@example
443$ mkdir ~/gnunet1/
444$ touch peer1.conf
445@end example
446
447@noindent
448Now add the following lines to @file{peer1.conf} to use this directory.
449For simplified usage we want to prevent the peer to connect to the GNUnet
450network since this could lead to confusing output. This modifications
451will replace the default settings:
452
453@example
454[PATHS]
455# Use this directory to store GNUnet data
456GNUNET_HOME = ~/gnunet1/
457[hostlist]
458# prevent bootstrapping
459SERVERS =
460@end example
461
462@node Start a peer
463@section Start a peer
464Each GNUnet instance (called peer) has an identity (peer ID) based on a
465cryptographic public private key pair. The peer ID is the printable hash
466of the public key.
467
468GNUnet services are controlled by a master service, the so called
469@dfn{Automatic Restart Manager} (ARM). ARM starts, stops and even
470restarts services automatically or on demand when a client connects.
471You interact with the ARM service using the @command{gnunet-arm} tool.
472GNUnet can then be started with @command{gnunet-arm -s} and stopped with
473@command{gnunet-arm -e}. An additional service not automatically started
474can be started using @command{gnunet-arm -i <service name>} and stopped
475using @command{gnunet-arm -k <servicename>}.
476
477Once you have started your peer, you can use many other GNUnet commands
478to interact with it. For example, you can run:
479
480@example
481$ gnunet-peerinfo -s
482@end example
483
484@noindent
485to obtain the public key of your peer.
486
487You should see an output containing the peer ID similar to:
488
489@example
490I am peer `0PA02UVRKQTS2C .. JL5Q78F6H0B1ACPV1CJI59MEQUMQCC5G'.
491@end example
492
493@node Monitor a peer
494@section Monitor a peer
495
496In this section, we will monitor the behaviour of our peer's DHT
497service with respect to a specific key. First we will start
498GNUnet and then start the DHT service and use the DHT monitor tool
499to monitor the PUT and GET commands we issue ussing the
500@command{gnunet-dht-put} and @command{gnunet-dht-get} commands.
501Using the ``monitor'' line given below, you can observe the behavior
502of your own peer's DHT with respect to the specified KEY:
503
504@example
505# start gnunet with all default services:
506$ gnunet-arm -c ~/peer1.conf -s
507# start DHT service:
508$ gnunet-arm -c ~/peer1.conf -i dht
509$ cd ~/gnunet/src/dht;
510$ ./gnunet-dht-monitor -c ~/peer1.conf -k KEY
511@end example
512
513@noindent
514Now open a separate terminal and change again to
515the @file{gnunet/src/dht} directory:
516
517@example
518$ cd ~/gnunet/src/dht
519# put VALUE under KEY in the DHT:
520$ ./gnunet-dht-put -c ~/peer1.conf -k KEY -d VALUE
521# get key KEY from the DHT:
522$ ./gnunet/src/dht/gnunet-dht-get -c ~/peer1.conf -k KEY
523# print statistics about current GNUnet state:
524$ gnunet-statistics -c ~/peer1.conf
525# print statistics about DHT service:
526$ gnunet-statistics -c ~/peer1.conf -s dht
527@end example
528
529@node Starting Two Peers by Hand
530@section Starting Two Peers by Hand
531
532This section describes how to start two peers on the same machine by hand.
533The process is rather painful, but the description is somewhat
534instructive. In practice, you might prefer the automated method
535(@pxref{Starting Peers Using the Testbed Service}).
536
537@menu
538* Setup a second peer::
539* Start the second peer and connect the peers::
540* How to connect manually::
541@end menu
542
543@node Setup a second peer
544@subsection Setup a second peer
545We will now start a second peer on your machine.
546For the second peer, you will need to manually create a modified
547configuration file to avoid conflicts with ports and directories.
548A peers configuration file is by default located
549in @file{~/.gnunet/gnunet.conf}. This file is typically very short
550or even empty as only the differences to the defaults need to be
551specified. The defaults are located in many files in the
552@file{$PREFIX/share/gnunet/config.d} directory.
553
554To configure the second peer, use the files
555@file{$PREFIX/share/gnunet/config.d} as a template for your main
556configuration file:
557
558@example
559$ cat $PREFIX/share/gnunet/config.d/*.conf > peer2.conf
560@end example
561
562@noindent
563Now you have to edit @file{peer2.conf} and change:
564
565@itemize
566@item @code{GNUNET\_TEST\_HOME} under @code{PATHS}
567@item Every (uncommented) value for ``@code{PORT}'' (add 10000) in any
568section (the option may be commented out if @code{PORT} is
569prefixed by "\#", in this case, UNIX domain sockets are used
570and the PORT option does not need to be touched)
571@item Every value for ``@code{UNIXPATH}'' in any section
572(e.g. by adding a "-p2" suffix)
573@end itemize
574
575to a fresh, unique value. Make sure that the PORT numbers stay
576below 65536. From now on, whenever you interact with the second peer,
577you need to specify @command{-c peer2.conf} as an additional
578command line argument.
579
580Now, generate the 2nd peer's private key:
581
582@example
583$ gnunet-peerinfo -s -c peer2.conf
584@end example
585
586@noindent
587This may take a while, generate entropy using your keyboard or mouse
588as needed. Also, make sure the output is different from the
589gnunet-peerinfo output for the first peer (otherwise you made an
590error in the configuration).
591
592@node Start the second peer and connect the peers
593@subsection Start the second peer and connect the peers
594
595Then, you can start a second peer using:
596
597@example
598$ gnunet-arm -c peer2.conf -s
599$ gnunet-arm -c peer2.conf -i dht
600$ ~/gnunet/src/dht/gnunet-dht-put -c peer2.conf -k KEY -d VALUE
601$ ~/gnunet/src/dht/gnunet-dht-get -c peer2.conf -k KEY
602@end example
603
604If you want the two peers to connect, you have multiple options:
605
606@itemize
607@item UDP neighbour discovery (automatic)
608@item Setup a bootstrap server
609@item Connect manually
610@end itemize
611
612To setup peer 1 as bootstrapping server change the configuration of
613the first one to be a hostlist server by adding the following lines to
614@file{peer1.conf} to enable bootstrapping server:
615
616@example
617[hostlist]
618OPTIONS = -p
619@end example
620
621@noindent
622Then change @file{peer2.conf} and replace the ``@code{SERVERS}''
623line in the ``@code{[hostlist]}'' section with
624``@code{http://localhost:8080/}''. Restart both peers using:
625
626@example
627# stop first peer
628$ gnunet-arm -c peer1.conf -e
629# start first peer
630$ gnunet-arm -c peer1.conf -s
631# start second peer
632$ gnunet-arm -c peer2.conf -s
633@end example
634
635@noindent
636Note that if you start your peers without changing these settings, they
637will use the ``global'' hostlist servers of the GNUnet P2P network and
638likely connect to those peers. At that point, debugging might become
639tricky as you're going to be connected to many more peers and would
640likely observe traffic and behaviors that are not explicitly controlled
641by you.
642
643@node How to connect manually
644@subsection How to connect manually
645
646If you want to use the @code{peerinfo} tool to connect your
647peers, you should:
648
649@itemize
650@item Set @code{IMMEDIATE_START = NO} in section @code{hostlist}
651(to not connect to the global GNUnet)
652@item Start both peers running @command{gnunet-arm -c peer1.conf -s}
653and @command{gnunet-arm -c peer2.conf -s}
654@item Get @code{HELLO} message of the first peer running
655@command{gnunet-peerinfo -c peer1.conf -g}
656@item Give the output to the second peer by running
657@command{gnunet-peerinfo -c peer2.conf -p '<output>'}
658@end itemize
659
660Check that they are connected using @command{gnunet-core -c peer1.conf},
661which should give you the other peer's peer identity:
662
663@example
664$ gnunet-core -c peer1.conf
665Peer `9TVUCS8P5A7ILLBGO6 [...shortened...] 1KNBJ4NGCHP3JPVULDG'
666@end example
667
668@node Starting Peers Using the Testbed Service
669@section Starting Peers Using the Testbed Service
670@c \label{sec:testbed}
671
672GNUnet's testbed service is used for testing scenarios where
673a number of peers are to be started. The testbed can manage peers
674on a single host or on multiple hosts in a distributed fashion.
675On a single affordable computer, it should be possible to run
676around tens of peers without drastically increasing the load on the
677system.
678
679The testbed service can be access through its API
680@file{include/gnunet\_testbed\_service.h}. The API provides many
681routines for managing a group of peers. It also provides a helper
682function @code{GNUNET\_TESTBED\_test\_run()} to quickly setup a
683minimalistic testing environment on a single host.
684
685This function takes a configuration file which will be used as a
686template configuration for the peers. The testbed takes care of
687modifying relevant options in the peers' configuration such as
688@code{SERVICEHOME}, @code{PORT}, @code{UNIXPATH} to unique values
689so that peers run without running into conflicts. It also checks
690and assigns the ports in configurations only if they are free.
691
692Additionally, the testbed service also reads its options from the
693same configuration file. Various available options and details
694about them can be found in the testbed default configuration file
695@file{src/testbed/testbed.conf}.
696
697With the testbed API, a sample test case can be structured as follows:
698
699@example
700@verbatiminclude examples/testbed_test.c
701@end example
702
703@noindent
704The source code for the above listing can be found at
705@c FIXME: This is not the correct URL. Where is the file?
706@uref{https://git.gnunet.org/gnunet.git/tree/doc/documentation/testbed_test.c}
707or in the @file{doc/} folder of your repository check-out.
708After installing GNUnet, the above source code can be compiled as:
709
710@example
711$ export CPPFLAGS="-I/path/to/gnunet/headers"
712$ export LDFLAGS="-L/path/to/gnunet/libraries"
713$ gcc $CPPFLAGS $LDFLAGS -o testbed-test testbed_test.c \
714 -lgnunettestbed -lgnunetdht -lgnunetutil
715# Generate (empty) configuration
716$ touch template.conf
717# run it (press CTRL-C to stop)
718$ ./testbed-test
719@end example
720
721@noindent
722The @code{CPPFLAGS} and @code{LDFLAGS} are necessary if GNUnet
723is installed into a different directory other than @file{/usr/local}.
724
725All of testbed API's peer management functions treat management
726actions as operations and return operation handles. It is expected
727that the operations begin immediately, but they may get delayed (to
728balance out load on the system). The program using the API then has
729to take care of marking the operation as ``done'' so that its
730associated resources can be freed immediately and other waiting
731operations can be executed. Operations will be canceled if they are
732marked as ``done'' before their completion.
733
734An operation is treated as completed when it succeeds or fails.
735Completion of an operation is either conveyed as events through
736@dfn{controller event callback} or through respective
737@dfn{operation completion callbacks}.
738In functions which support completion notification
739through both controller event callback and operation
740completion callback, first the controller event callback will be
741called. If the operation is not marked as done in that callback
742or if the callback is given as NULL when creating the operation,
743the operation completion callback will be called. The API
744documentation shows which event are to be expected in the
745controller event notifications. It also documents any exceptional
746behaviour.
747
748Once the peers are started, test cases often need to connect
749some of the peers' services. Normally, opening a connect to
750a peer's service requires the peer's configuration. While using
751testbed, the testbed automatically generates per-peer configuration.
752Accessing those configurations directly through file system is
753discouraged as their locations are dynamically created and will be
754different among various runs of testbed. To make access to these
755configurations easy, testbed API provides the function
756@code{GNUNET\_TESTBED\_service\_connect()}. This function fetches
757the configuration of a given peer and calls the @dfn{Connect Adapter}.
758In the example code, it is the @code{dht\_ca}. A connect adapter is
759expected to open the connection to the needed service by using the
760provided configuration and return the created service connection handle.
761Successful connection to the needed service is signaled through
762@code{service\_connect\_comp\_cb}.
763
764A dual to connect adapter is the @dfn{Disconnect Adapter}. This callback
765is called after the connect adapter has been called when the operation
766from @code{GNUNET\_TESTBED\_service\_connect()} is marked as ``done''.
767It has to disconnect from the service with the provided service
768handle (@code{op\_result}).
769
770Exercise: Find out how many peers you can run on your system.
771
772Exercise: Find out how to create a 2D torus topology by changing the
773options in the configuration file.
774@xref{Supported Topologies, The GNUnet Reference Documentation ,, gnunet, The GNUnet Reference Documentation},
775then use the DHT API to store and retrieve values in the network.
776
777@node Developing Applications
778@chapter Developing Applications
779
780@menu
781* gnunet-ext::
782* Adapting the Template::
783* Writing a Client Application::
784* Writing a Service::
785* Interacting directly with other Peers using the CORE Service::
786* Storing peer-specific data using the PEERSTORE service::
787* Using the DHT::
788* Debugging with gnunet-arm::
789@end menu
790
791@node gnunet-ext
792@section gnunet-ext
793To develop a new peer-to-peer application or to extend GNUnet we provide
794a template build system for writing GNUnet extensions in C. It can be
795obtained as follows:
796
797@example
798$ git clone https://git.gnunet.org/gnunet-ext.git
799$ cd gnunet-ext/
800$ ./bootstrap
801$ ./configure --prefix=$PREFIX --with-gnunet=$PREFIX
802$ make
803$ make install
804$ make check
805@end example
806
807@noindent
808The GNUnet ext template includes examples and a working buildsystem
809for a new GNUnet service. A common GNUnet service consists of the
810following parts which will be discussed in detail in the remainder
811of this document. The functionality of a GNUnet service is implemented in:
812
813@itemize
814@item the GNUnet service (gnunet-ext/src/ext/gnunet-service-ext.c)
815@item the client API (gnunet-ext/src/ext/ext_api.c)
816@item the client application using the service API
817(gnunet-ext/src/ext/gnunet-ext.c)
818@end itemize
819
820The interfaces for these entities are defined in:
821
822@itemize
823@item client API interface (gnunet-ext/src/ext/ext.h)
824@item the service interface (gnunet-ext/src/include/gnunet_service_SERVICE.h)
825@item the P2P protocol (gnunet-ext/src/include/gnunet_protocols_ext.h)
826@end itemize
827
828
829In addition the ext systems provides:
830
831@itemize
832@item a test testing the API (gnunet-ext/src/ext/test_ext_api.c)
833@item a configuration template for the service
834(gnunet-ext/src/ext/ext.conf.in)
835@end itemize
836
837@node Adapting the Template
838@section Adapting the Template
839
840The first step for writing any extension with a new service is to
841ensure that the @file{ext.conf.in} file contains entries for the
842@code{UNIXPATH}, @code{PORT} and @code{BINARY} for the service in a
843section named after the service.
844
845If you want to adapt the template rename the @file{ext.conf.in} to
846match your services name, you have to modify the @code{AC\_OUTPUT}
847section in @file{configure.ac} in the @file{gnunet-ext} root.
848
849@node Writing a Client Application
850@section Writing a Client Application
851
852When writing any client application (for example, a command-line
853tool), the basic structure is to start with the
854@code{GNUNET\_PROGRAM\_run} function. This function will parse
855command-line options, setup the scheduler and then invoke the
856@code{run} function (with the remaining non-option arguments)
857and a handle to the parsed configuration (and the configuration
858file name that was used, which is typically not needed):
859
860@example
861@verbatiminclude examples/001.c
862@end example
863
864@menu
865* Handling command-line options::
866* Writing a Client Library::
867* Writing a user interface::
868@end menu
869
870@node Handling command-line options
871@subsection Handling command-line options
872
873Options can then be added easily by adding global variables and
874expanding the @code{options} array. For example, the following would
875add a string-option and a binary flag (defaulting to @code{NULL} and
876@code{GNUNET\_NO} respectively):
877
878@example
879@verbatiminclude examples/002.c
880@end example
881
882Issues such as displaying some helpful text describing options using
883the @code{--help} argument and error handling are taken care of when
884using this approach. Other @code{GNUNET\_GETOPT\_}-functions can be used
885to obtain integer value options, increment counters, etc. You can
886even write custom option parsers for special circumstances not covered
887by the available handlers. To check if an argument was specified by the
888user you initialize the variable with a specific value (e.g. NULL for
889a string and GNUNET\_SYSERR for a integer) and check after parsing
890happened if the values were modified.
891
892Inside the @code{run} method, the program would perform the
893application-specific logic, which typically involves initializing and
894using some client library to interact with the service. The client
895library is supposed to implement the IPC whereas the service provides
896more persistent P2P functions.
897
898Exercise: Add a few command-line options and print them inside
899of @code{run}. What happens if the user gives invalid arguments?
900
901@node Writing a Client Library
902@subsection Writing a Client Library
903
904The first and most important step in writing a client library is to
905decide on an API for the library. Typical API calls include
906connecting to the service, performing application-specific requests
907and cleaning up. Many examples for such service APIs can be found
908in the @file{gnunet/src/include/gnunet\_*\_service.h} files.
909
910Then, a client-service protocol needs to be designed. This typically
911involves defining various message formats in a header that will be
912included by both the service and the client library (but is otherwise
913not shared and hence located within the service's directory and not
914installed by @command{make install}). Each message must start with a
915@code{struct GNUNET\_MessageHeader} and must be shorter than 64k. By
916convention, all fields in IPC (and P2P) messages must be in big-endian
917format (and thus should be read using @code{ntohl} and similar
918functions and written using @code{htonl} and similar functions).
919Unique message types must be defined for each message struct in the
920@file{gnunet\_protocols.h} header (or an extension-specific include
921file).
922
923@menu
924* Connecting to the Service::
925* Sending messages::
926* Receiving Replies from the Service::
927@end menu
928
929@node Connecting to the Service
930@subsubsection Connecting to the Service
931
932Before a client library can implement the application-specific protocol
933with the service, a connection must be created:
934
935@example
936@verbatiminclude examples/003.c
937@end example
938
939@noindent
940As a result a @code{GNUNET\_MQ\_Handle} is returned
941which can to used henceforth to transmit messages to the service.
942The complete MQ API can be found in @file{gnunet\_mq\_lib.h}.
943The @code{handlers} array in the example above is incomplete.
944Here is where you will define which messages you expect to
945receive from the service, and which functions handle them.
946The @code{error\_cb} is a function that is to be called whenever
947there are errors communicating with the service.
948
949@node Sending messages
950@subsubsection Sending messages
951
952In GNUnet, messages are always sent beginning with a
953@code{struct GNUNET\_MessageHeader} in big endian format.
954This header defines the size and the type of the
955message, the payload follows after this header.
956
957@example
958@verbatiminclude examples/004.c
959@end example
960
961@noindent
962Existing message types are defined in @file{gnunet\_protocols.h}.
963A common way to create a message is with an envelope:
964
965@example
966@verbatiminclude examples/005.c
967@end example
968
969@noindent
970Exercise: Define a message struct that includes a 32-bit
971unsigned integer in addition to the standard GNUnet MessageHeader.
972Add a C struct and define a fresh protocol number for your message.
973Protocol numbers in gnunet-ext are defined
974in @file{gnunet-ext/src/include/gnunet_protocols_ext.h}
975
976Exercise: Find out how you can determine the number of messages
977in a message queue.
978
979Exercise: Find out how you can determine when a message you
980have queued was actually transmitted.
981
982Exercise: Define a helper function to transmit a 32-bit
983unsigned integer (as payload) to a service using some given client
984handle.
985
986@node Receiving Replies from the Service
987@subsubsection Receiving Replies from the Service
988
989Clients can receive messages from the service using the handlers
990specified in the @code{handlers} array we specified when connecting
991to the service. Entries in the the array are usually created using
992one of two macros, depending on whether the message is fixed size
993or variable size. Variable size messages are managed using two
994callbacks, one to check that the message is well-formed, the other
995to actually process the message. Fixed size messages are fully
996checked by the MQ-logic, and thus only need to provide the handler
997to process the message. Note that the prefixes @code{check\_}
998and @code{handle\_} are mandatory.
999
1000@example
1001@verbatiminclude examples/006.c
1002@end example
1003
1004@noindent
1005Exercise: Expand your helper function to receive a response message
1006(for example, containing just the @code{struct GNUnet MessageHeader}
1007without any payload). Upon receiving the service's response, you
1008should call a callback provided to your helper function's API.
1009
1010Exercise: Figure out where you can pass values to the
1011closures (@code{cls}).
1012
1013@node Writing a user interface
1014@subsection Writing a user interface
1015
1016Given a client library, all it takes to access a service now is to
1017combine calls to the client library with parsing command-line
1018options.
1019
1020Exercise: Call your client API from your @code{run()} method in your
1021client application to send a request to the service. For example,
1022send a 32-bit integer value based on a number given at the
1023command-line to the service.
1024
1025@node Writing a Service
1026@section Writing a Service
1027
1028Before you can test the client you've written so far, you'll
1029need to also implement the corresponding service.
1030
1031@menu
1032* Code Placement::
1033* Starting a Service::
1034@end menu
1035
1036@node Code Placement
1037@subsection Code Placement
1038
1039New services are placed in their own subdirectory under
1040@file{gnunet/src}. This subdirectory should contain the API
1041implementation file @file{SERVICE\_api.c}, the description of
1042the client-service protocol @file{SERVICE.h} and P2P protocol
1043@file{SERVICE\_protocol.h}, the implementation of the service itself
1044@file{gnunet-service-SERVICE.h} and several files for tests,
1045including test code and configuration files.
1046
1047@node Starting a Service
1048@subsection Starting a Service
1049
1050The key API definition for creating a service is the
1051@code{GNUNET\_SERVICE\_MAIN} macro:
1052
1053@example
1054@verbatiminclude examples/007.c
1055@end example
1056
1057@noindent
1058In addition to the service name and flags, the macro takes three
1059functions, typically called @code{run}, @code{client\_connect\_cb} and
1060@code{client\_disconnect\_cb} as well as an array of message handlers
1061that will be called for incoming messages from clients.
1062
1063A minimal version of the three central service functions would look
1064like this:
1065
1066@example
1067@verbatiminclude examples/008.c
1068@end example
1069
1070@noindent
1071Exercise: Write a stub service that processes no messages at all
1072in your code. Create a default configuration for it, integrate it
1073with the build system and start the service from
1074@command{gnunet-service-arm} using @command{gnunet-arm -i NAME}.
1075
1076Exercise: Figure out how to set the closure (@code{cls}) for handlers
1077of a service.
1078
1079Exercise: Figure out how to send messages from the service back to the
1080client.
1081
1082Each handler function in the service @b{must} eventually (possibly in some
1083asynchronous continuation) call
1084@code{GNUNET\_SERVICE\_client\_continue()}. Only after this call
1085additional messages from the same client may
1086be processed. This way, the service can throttle processing messages
1087from the same client.
1088
1089Exercise: Change the service to ``handle'' the message from your
1090client (for now, by printing a message). What happens if you
1091forget to call @code{GNUNET\_SERVICE\_client\_continue()}?
1092
1093@node Interacting directly with other Peers using the CORE Service
1094@section Interacting directly with other Peers using the CORE Service
1095
1096FIXME: This section still needs to be updated to the latest API!
1097
1098One of the most important services in GNUnet is the @code{CORE} service
1099managing connections between peers and handling encryption between peers.
1100
1101One of the first things any service that extends the P2P protocol
1102typically does is connect to the @code{CORE} service using:
1103
1104@example
1105@verbatiminclude examples/009.c
1106@end example
1107
1108@menu
1109* New P2P connections::
1110* Receiving P2P Messages::
1111* Sending P2P Messages::
1112* End of P2P connections::
1113@end menu
1114
1115@node New P2P connections
1116@subsection New P2P connections
1117
1118Before any traffic with a different peer can be exchanged, the peer must
1119be known to the service. This is notified by the @code{CORE}
1120@code{connects} callback, which communicates the identity of the new
1121peer to the service:
1122
1123@example
1124@verbatiminclude examples/010.c
1125@end example
1126
1127@noindent
1128Note that whatever you return from @code{connects} is given as the
1129@code{cls} argument to the message handlers for messages from
1130the respective peer.
1131
1132Exercise: Create a service that connects to the @code{CORE}. Then
1133start (and connect) two peers and print a message once your connect
1134callback is invoked.
1135
1136@node Receiving P2P Messages
1137@subsection Receiving P2P Messages
1138
1139To receive messages from @code{CORE}, you pass the desired
1140@code{handlers} to the @code{GNUNET\_CORE\_connect()} function,
1141just as we showed for services.
1142
1143It is your responsibility to process messages fast enough or
1144to implement flow control. If an application does not process
1145CORE messages fast enough, CORE will randomly drop messages
1146to not keep a very long queue in memory.
1147
1148Exercise: Start one peer with a new service that has a message
1149handler and start a second peer that only has your ``old'' service
1150without message handlers. Which ``connect'' handlers are invoked when
1151the two peers are connected? Why?
1152
1153@node Sending P2P Messages
1154@subsection Sending P2P Messages
1155
1156You can transmit messages to other peers using the @code{mq} you were
1157given during the @code{connect} callback. Note that the @code{mq}
1158automatically is released upon @code{disconnect} and that you must
1159not use it afterwards.
1160
1161It is your responsibility to not over-fill the message queue, GNUnet
1162will send the messages roughly in the order given as soon as possible.
1163
1164Exercise: Write a service that upon connect sends messages as
1165fast as possible to the other peer (the other peer should run a
1166service that ``processes'' those messages). How fast is the
1167transmission? Count using the STATISTICS service on both ends. Are
1168messages lost? How can you transmit messages faster? What happens if
1169you stop the peer that is receiving your messages?
1170
1171@node End of P2P connections
1172@subsection End of P2P connections
1173
1174If a message handler returns @code{GNUNET\_SYSERR}, the remote
1175peer shuts down or there is an unrecoverable network
1176disconnection, CORE notifies the service that the peer disconnected.
1177After this notification no more messages will be received from the
1178peer and the service is no longer allowed to send messages to the peer.
1179The disconnect callback looks like the following:
1180
1181@example
1182@verbatiminclude examples/011.c
1183@end example
1184
1185@noindent
1186Exercise: Fix your service to handle peer disconnects.
1187
1188@node Storing peer-specific data using the PEERSTORE service
1189@section Storing peer-specific data using the PEERSTORE service
1190
1191GNUnet's PEERSTORE service offers a persistorage for arbitrary
1192peer-specific data. Other GNUnet services can use the PEERSTORE
1193to store, retrieve and monitor data records. Each data record
1194stored with PEERSTORE contains the following fields:
1195
1196@itemize
1197@item subsystem: Name of the subsystem responsible for the record.
1198@item peerid: Identity of the peer this record is related to.
1199@item key: a key string identifying the record.
1200@item value: binary record value.
1201@item expiry: record expiry date.
1202@end itemize
1203
1204The first step is to start a connection to the PEERSTORE service:
1205@example
1206@verbatiminclude examples/012.c
1207@end example
1208
1209The service handle @code{peerstore_handle} will be needed for
1210all subsequent PEERSTORE operations.
1211
1212@menu
1213* Storing records::
1214* Retrieving records::
1215* Monitoring records::
1216* Disconnecting from PEERSTORE::
1217@end menu
1218
1219@node Storing records
1220@subsection Storing records
1221
1222To store a new record, use the following function:
1223
1224@example
1225@verbatiminclude examples/013.c
1226@end example
1227
1228@noindent
1229The @code{options} parameter can either be
1230@code{GNUNET_PEERSTORE_STOREOPTION_MULTIPLE} which means that multiple
1231values can be stored under the same key combination
1232(subsystem, peerid, key), or @code{GNUNET_PEERSTORE_STOREOPTION_REPLACE}
1233which means that PEERSTORE will replace any existing values under the
1234given key combination (subsystem, peerid, key) with the new given value.
1235
1236The continuation function @code{cont} will be called after the store
1237request is successfully sent to the PEERSTORE service. This does not
1238guarantee that the record is successfully stored, only that it was
1239received by the service.
1240
1241The @code{GNUNET_PEERSTORE_store} function returns a handle to the store
1242operation. This handle can be used to cancel the store operation only
1243before the continuation function is called:
1244
1245@example
1246@verbatiminclude examples/013.1.c
1247@end example
1248
1249@node Retrieving records
1250@subsection Retrieving records
1251
1252To retrieve stored records, use the following function:
1253
1254@example
1255@verbatiminclude examples/014.c
1256@end example
1257
1258@noindent
1259The values of @code{peer} and @code{key} can be @code{NULL}. This
1260allows the iteration over values stored under any of the following
1261key combinations:
1262
1263@itemize
1264@item (subsystem)
1265@item (subsystem, peerid)
1266@item (subsystem, key)
1267@item (subsystem, peerid, key)
1268@end itemize
1269
1270The @code{callback} function will be called once with each retrieved
1271record and once more with a @code{NULL} record to signal the end of
1272results.
1273
1274The @code{GNUNET_PEERSTORE_iterate} function returns a handle to the
1275iterate operation. This handle can be used to cancel the iterate
1276operation only before the callback function is called with a
1277@code{NULL} record.
1278
1279@node Monitoring records
1280@subsection Monitoring records
1281
1282PEERSTORE offers the functionality of monitoring for new records
1283stored under a specific key combination (subsystem, peerid, key).
1284To start the monitoring, use the following function:
1285
1286@example
1287@verbatiminclude examples/015.c
1288@end example
1289
1290@noindent
1291Whenever a new record is stored under the given key combination,
1292the @code{callback} function will be called with this new
1293record. This will continue until the connection to the PEERSTORE
1294service is broken or the watch operation is canceled:
1295
1296@example
1297@verbatiminclude examples/016.c
1298@end example
1299
1300@node Disconnecting from PEERSTORE
1301@subsection Disconnecting from PEERSTORE
1302
1303When the connection to the PEERSTORE service is no longer needed,
1304disconnect using the following function:
1305
1306@example
1307@verbatiminclude examples/017.c
1308@end example
1309
1310@noindent
1311If the @code{sync_first} flag is set to @code{GNUNET_YES},
1312the API will delay the disconnection until all store requests
1313are received by the PEERSTORE service. Otherwise, it will
1314disconnect immediately.
1315
1316@node Using the DHT
1317@section Using the DHT
1318
1319The DHT allows to store data so other peers in the P2P network can
1320access it and retrieve data stored by any peers in the network.
1321This section will explain how to use the DHT. Of course, the first
1322thing to do is to connect to the DHT service:
1323
1324@example
1325@verbatiminclude examples/018.c
1326@end example
1327
1328@noindent
1329The second parameter indicates how many requests in parallel to expect.
1330It is not a hard limit, but a good approximation will make the DHT more
1331efficient.
1332
1333@menu
1334* Storing data in the DHT::
1335* Obtaining data from the DHT::
1336* Implementing a block plugin::
1337* Monitoring the DHT::
1338@end menu
1339
1340@node Storing data in the DHT
1341@subsection Storing data in the DHT
1342Since the DHT is a dynamic environment (peers join and leave frequently)
1343the data that we put in the DHT does not stay there indefinitely. It is
1344important to ``refresh'' the data periodically by simply storing it
1345again, in order to make sure other peers can access it.
1346
1347The put API call offers a callback to signal that the PUT request has been
1348sent. This does not guarantee that the data is accessible to others peers,
1349or even that is has been stored, only that the service has requested to
1350a neighboring peer the retransmission of the PUT request towards its final
1351destination. Currently there is no feedback about whether or not the data
1352has been successfully stored or where it has been stored. In order to
1353improve the availablilty of the data and to compensate for possible
1354errors, peers leaving and other unfavorable events, just make several
1355PUT requests!
1356
1357@example
1358@verbatiminclude examples/019.c
1359@end example
1360
1361@noindent
1362Exercise: Store a value in the DHT periodically to make sure it
1363is available over time. You might consider using the function
1364@code{GNUNET\_SCHEDULER\_add\_delayed} and call
1365@code{GNUNET\_DHT\_put} from inside a helper function.
1366
1367@node Obtaining data from the DHT
1368@subsection Obtaining data from the DHT
1369
1370As we saw in the previous example, the DHT works in an asynchronous mode.
1371Each request to the DHT is executed ``in the background'' and the API
1372calls return immediately. In order to receive results from the DHT, the
1373API provides a callback. Once started, the request runs in the service,
1374the service will try to get as many results as possible (filtering out
1375duplicates) until the timeout expires or we explicitly stop the request.
1376It is possible to give a ``forever'' timeout with
1377@code{GNUNET\_TIME\_UNIT\_FOREVER\_REL}.
1378
1379If we give a route option @code{GNUNET\_DHT\_RO\_RECORD\_ROUTE}
1380the callback will get a list of all the peers the data has travelled,
1381both on the PUT path and on the GET path.
1382
1383@example
1384@verbatiminclude examples/020.c
1385@end example
1386
1387@noindent
1388Exercise: Store a value in the DHT and after a while retrieve it.
1389Show the IDs of all the peers the requests have gone through.
1390In order to convert a peer ID to a string, use the function
1391@code{GNUNET\_i2s}. Pay attention to the route option parameters
1392in both calls!
1393
1394@node Implementing a block plugin
1395@subsection Implementing a block plugin
1396
1397In order to store data in the DHT, it is necessary to provide a block
1398plugin. The DHT uses the block plugin to ensure that only well-formed
1399requests and replies are transmitted over the network.
1400
1401The block plugin should be put in a file @file{plugin\_block\_SERVICE.c}
1402in the service's respective directory. The
1403mandatory functions that need to be implemented for a block plugin are
1404described in the following sections.
1405
1406@menu
1407* Validating requests and replies::
1408* Deriving a key from a reply::
1409* Initialization of the plugin::
1410* Shutdown of the plugin::
1411* Integration of the plugin with the build system::
1412@end menu
1413
1414@node Validating requests and replies
1415@subsubsection Validating requests and replies
1416
1417The evaluate function should validate a reply or a request. It returns
1418a @code{GNUNET\_BLOCK\_EvaluationResult}, which is an enumeration. All
1419possible answers are in @file{gnunet\_block\_lib.h}. The function will
1420be called with a @code{reply\_block} argument of @code{NULL} for
1421requests. Note that depending on how @code{evaluate} is called, only
1422some of the possible return values are valid. The specific meaning of
1423the @code{xquery} argument is application-specific. Applications that
1424do not use an extended query should check that the @code{xquery\_size}
1425is zero. The block group is typically used to filter duplicate
1426replies.
1427
1428@example
1429@verbatiminclude examples/021.c
1430@end example
1431
1432@noindent
1433Note that it is mandatory to detect duplicate replies in this function
1434and return the respective status code. Duplicate detection is
1435typically done using the Bloom filter block group provided by
1436@file{libgnunetblockgroup.so}. Failure to do so may cause replies to
1437circle in the network.
1438
1439@node Deriving a key from a reply
1440@subsubsection Deriving a key from a reply
1441
1442The DHT can operate more efficiently if it is possible to derive a key
1443from the value of the corresponding block. The @code{get\_key}
1444function is used to obtain the key of a block --- for example, by
1445means of hashing. If deriving the key is not possible, the function
1446should simply return @code{GNUNET\_SYSERR} (the DHT will still work
1447just fine with such blocks).
1448
1449@example
1450@verbatiminclude examples/022.c
1451@end example
1452
1453@node Initialization of the plugin
1454@subsubsection Initialization of the plugin
1455
1456The plugin is realized as a shared C library. The library must export
1457an initialization function which should initialize the plugin. The
1458initialization function specifies what block types the plugin cares
1459about and returns a struct with the functions that are to be used for
1460validation and obtaining keys (the ones just defined above).
1461
1462@example
1463@verbatiminclude examples/023.c
1464@end example
1465
1466@node Shutdown of the plugin
1467@subsubsection Shutdown of the plugin
1468
1469Following GNUnet's general plugin API concept, the plugin must
1470export a second function for cleaning up. It usually does very
1471little.
1472
1473@example
1474@verbatiminclude examples/024.c
1475@end example
1476
1477@node Integration of the plugin with the build system
1478@subsubsection Integration of the plugin with the build system
1479
1480In order to compile the plugin, the @file{Makefile.am} file for the
1481service SERVICE should contain a rule similar to this:
1482@c Actually this is a Makefile not C. But the whole structure of examples
1483@c must be improved.
1484
1485@example
1486@verbatiminclude examples/025.Makefile.am
1487@end example
1488
1489@noindent
1490Exercise: Write a block plugin that accepts all queries
1491and all replies but prints information about queries and replies
1492when the respective validation hooks are called.
1493
1494@node Monitoring the DHT
1495@subsection Monitoring the DHT
1496
1497It is possible to monitor the functioning of the local
1498DHT service. When monitoring the DHT, the service will
1499alert the monitoring program of any events, both started
1500locally or received for routing from another peer.
1501The are three different types of events possible: a
1502GET request, a PUT request or a response (a reply to a GET).
1503
1504Since the different events have different associated data,
1505the API gets 3 different callbacks (one for each message type)
1506and optional type and key parameters, to allow for filtering of
1507messages. When an event happens, the appropriate callback is
1508called with all the information about the event.
1509
1510@example
1511@verbatiminclude examples/026.c
1512@end example
1513
1514@node Debugging with gnunet-arm
1515@section Debugging with gnunet-arm
1516
1517Even if services are managed by @command{gnunet-arm}, you can
1518start them with @command{gdb} or @command{valgrind}. For
1519example, you could add the following lines to your
1520configuration file to start the DHT service in a @command{gdb}
1521session in a fresh @command{xterm}:
1522
1523@example
1524[dht]
1525PREFIX=xterm -e gdb --args
1526@end example
1527
1528@noindent
1529Alternatively, you can stop a service that was started via
1530ARM and run it manually:
1531
1532@example
1533$ gnunet-arm -k dht
1534$ gdb --args gnunet-service-dht -L DEBUG
1535$ valgrind gnunet-service-dht -L DEBUG
1536@end example
1537
1538@noindent
1539Assuming other services are well-written, they will automatically
1540re-integrate the restarted service with the peer.
1541
1542GNUnet provides a powerful logging mechanism providing log
1543levels @code{ERROR}, @code{WARNING}, @code{INFO} and @code{DEBUG}.
1544The current log level is configured using the @code{$GNUNET_FORCE_LOG}
1545environmental variable. The @code{DEBUG} level is only available if
1546@command{--enable-logging=verbose} was used when running
1547@command{configure}. More details about logging can be found under
1548@uref{https://docs.gnunet.org/#Logging}.
1549
1550You should also probably enable the creation of core files, by setting
1551@code{ulimit}, and echo'ing @code{1} into
1552@file{/proc/sys/kernel/core\_uses\_pid}. Then you can investigate the
1553core dumps with @command{gdb}, which is often the fastest method to
1554find simple errors.
1555
1556Exercise: Add a memory leak to your service and obtain a trace
1557pointing to the leak using @command{valgrind} while running the service
1558from @command{gnunet-service-arm}.
1559
1560
1561@c *********************************************************************
1562@node GNU Free Documentation License
1563@appendix GNU Free Documentation License
1564@cindex license, GNU Free Documentation License
1565@include fdl-1.3.texi
1566
1567
1568@bye