]> Cypherpunks.ru repositories - nncp.git/blobdiff - doc/usecases.texi
@example is more correct way to give examples
[nncp.git] / doc / usecases.texi
index 1c0a750bfe15e5254bed8e6c30bfaa72ec6410c7..e118da4ea8088858f4931b3c85de041e7e37a1c7 100644 (file)
@@ -77,10 +77,10 @@ daemon}.
 
 The command:
 
-@verbatim
-% nncp-file file_i_want_to_send bob:
-% nncp-file another_file bob:movie.avi
-@end verbatim
+@example
+$ nncp-file file_i_want_to_send bob:
+$ nncp-file another_file bob:movie.avi
+@end example
 
 will queue two files for sending to @emph{bob} node. Fire and forget!
 Now this is daemon's job (or offline transfer) to send this files part
@@ -100,12 +100,12 @@ NNCP allows traffic @ref{Niceness, prioritizing}: each packet has
 niceness level, that will guarantee that it will be processed earlier or
 later than the other ones. Nearly all commands has corresponding option:
 
-@verbatim
-% nncp-file -nice FLASH myfile node:dst
-% nncp-xfer -nice PRIORITY /mnt/shared
-% nncp-call -nice NORMAL bob
+@example
+$ nncp-file -nice FLASH myfile node:dst
+$ nncp-xfer -nice PRIORITY /mnt/shared
+$ nncp-call -nice NORMAL bob
 [...]
-@end verbatim
+@end example
 
 Huge files could be split on smaller @ref{Chunked, chunks}, giving
 possibility to transfer virtually any volumes using small capacity
@@ -113,10 +113,10 @@ storages.
 
 You can also use CD-ROM and tape drives:
 
-@verbatim
-% nncp-bundle -tx bob | cdrecord -tao -
-% nncp-bundle -tx bob | dd of=/dev/sa0 bs=10240
-@end verbatim
+@example
+$ nncp-bundle -tx bob | cdrecord -tao -
+$ nncp-bundle -tx bob | dd of=/dev/sa0 bs=10240
+@end example
 
 @node UsecaseNoLink
 @section Extreme terrestrial environments, no link
@@ -128,9 +128,9 @@ media for transferring packets to other nodes.
 Assume that you send two files to @emph{bob} node. Insert USB storage
 device (SD is preferable!), mount it and run @ref{nncp-xfer}:
 
-@verbatim
-% nncp-xfer -node bob /media/usbstick
-@end verbatim
+@example
+$ nncp-xfer -node bob /media/usbstick
+@end example
 
 to copy all outbound packets related to @emph{bob}. Use @option{-mkdir}
 option to create related directory on USB/SD storage if they are missing
@@ -140,16 +140,16 @@ If you use single storage device to transfer data both to @emph{bob} and
 @emph{alice}, then just omit @option{-node} option to copy all available
 outgoing packets.
 
-@verbatim
-% nncp-xfer /media/usbstick
-@end verbatim
+@example
+$ nncp-xfer /media/usbstick
+@end example
 
 Unmount it and transfer storage to Bob and Alice. When they will insert
 it in their computers, they will use exactly the same command:
 
-@verbatim
-% nncp-xfer /media/usbstick
-@end verbatim
+@example
+$ nncp-xfer /media/usbstick
+@end example
 
 to find all packets related to their node and copy them locally for
 further processing. @command{nncp-xfer} is the only command used with
@@ -165,10 +165,10 @@ example, satellite's broadcasting signal. You are not able to use online
 You can use @ref{Bundles, bundles} and stream them above. They are just
 a sequence of @ref{Encrypted, encrypted packets} you can catch on.
 
-@verbatim
-% nncp-bundle -tx alice bob eve ... | command to send broadcast
-% command to receive broadcast | nncp-bundle -rx
-@end verbatim
+@example
+$ nncp-bundle -tx alice bob eve ... | command to send broadcast
+$ command to receive broadcast | nncp-bundle -rx
+@end example
 
 With built-in packet duplicates detection ability, you can retransmit
 your broadcasts from time to time, to increase chances the recipient
@@ -229,15 +229,17 @@ authenticate peers and provide effective (both participants send payload
 in the very first packet) secure transport with forward secrecy
 property.
 
-@verbatim
-% nncp-daemon -bind [::]:5400
-@end verbatim
+@example
+$ nncp-daemon -bind "[::]":5400
+@end example
+
 will start TCP daemon listening on all interfaces for incoming
 connections.
 
-@verbatim
-% nncp-call bob
-@end verbatim
+@example
+$ nncp-call bob
+@end example
+
 will try to connect to @emph{bob}'s node known TCP addresses (taken from
 configuration file) and send all related outbound packets and retrieve
 those the Bob has. All interrupted transfers will be automatically
@@ -260,14 +262,18 @@ devices, possibly by rewriting the data from USB/hard drives to CD-RWs.
 NNCP supports packets relying (transitioning) out-of-box.
 
 @verbatim
-neigh:
-  bob:
+neigh: {
+  bob: {
     [...]
-    addrs:
-      lan: [fe80::5400%igb0]:5400
+    addrs: {
+      lan: "[fe80::5400%igb0]:5400"
+    }
+  }
   bob-airgap:
     [...]
-    via: [bob]
+    via: ["bob"]
+  }
+}
 @end verbatim
 
 That @ref{Configuration, configuration file} tells that we have got two
@@ -352,28 +358,35 @@ configurations} for @ref{nncp-caller} command used in online
 communications.
 
 @verbatim
-neigh:
+neigh: {
   [...]
-  some-node:
+  some-node: {
     [...]
-    addrs:
+    addrs: {
       lan: "[fe80::be5f:f4ff:fedd:2752%igb0]:5400"
       wan: "some-node.com:5400"
-    calls:
-      -
+    }
+    calls: [
+      {
         cron: "*/1 * * * *"
         addr: lan
         nice: MAX
         onlinedeadline: 3600
-      -
+      },
+      {
         cron: "*/10 * * * *"
         addr: wan
         nice: PRIORITY
         xx: rx
-      -
+      },
+      {
         cron: "*/1 0-7 * * *"
         addr: wan
         nice: BULK
         onlinedeadline: 3600
         maxonlinetime: 3600
+      },
+    ]
+  }
+}
 @end verbatim