Copyright © 1997 - 2007 The SILC Project<br />
Updated: @DATE@
</small>
+<br /><br /><br />
+<b>NOTE: This is reference manual of alpha version of SILC Toolkit 1.1 and
+the reference may be incomplete, inaccurate and document nonexistent APIs.
+The APIs provided by alpha versions of SILC Toolkit 1.1 may not be stable yet.
+</b>
+
<br /><br /><br />
Welcome to the SILC Toolkit Reference Manual. The manual is a complete
developer guide and reference for the SILC application programmer. The manual
of the Toolkit always delivers the latest version of this reference manual.
<br /><br /><br />
-<li><a href="new.html">What's new in Toolkit 1.1</a><br />
<li><a href="porting.html">Porting from Toolkit 1.0 to 1.1</a><br />
<li><a href="intro_reference.html">Introduction to the Manual</a><br />
<li><a href="programming_conv.html">Programming Conventions</a><br />
--- /dev/null
+<!--
+@LIBRARY=SILC ASN.1 Library
+@FILENAME=silcasn1lib.html
+@LINK=silcasn1.html:SILC ASN.1 Interface
+@LINK=silcber.html:SILC BER interface
+-->
+
+<big><b>SILC ASN.1 Library</b></big>
+<br />
+<small>Directory: lib/silcasn1/</small>
+<br />
+<small>Library: libsilc.a, libsilc.lib</small>
+<br /><br />
+<b>Introduction</b>
+
+<br /><br />
+SILC Abstract Syntax Notation One (ASN.1) Library provides interface for
+efficient ASN.1 encoder and decoder. The library also provides BER/DER
+encoder and decoder.
+
+<br /><br />
+@LINKS@
--- /dev/null
+The SILC Core Library
+
+This library contains the implementation of various SILC protocol packet
+payloads and other routines. It also implements the SILC Packet Engine.
+
+
+The SILC Packet Engine
+
+The SILC Packet engine (silcpacket.[ch]) is the heart of sending and
+receiving SILC packets. The engine works in single thread but is thread
+safe and has the notion of per-thread contexts for optimized processing.
+The per-thread processing is actually per-scheduler, but in reality multiple
+schedulers are run only when they are used in threads.
+
+The packet engine has a lock (engine->lock) that protects various engine
+wide data. Currently this includes SILC Packet freelist, which could
+perhaps later be in the per-thread SilcPacketEngineContext context. The
+engine also keeps list of all streams (SilcPacketStream) that has been
+added to the engine.
+
+The SilcPacketStream contains all stream related data, including encryption
+and decryption keys, IDs, and outgoing buffer. The outgoing buffer is
+per-stream so that data can be sent in multiple pieces from the outbuffer
+if writing would block. Incoming buffer is not in stream context unless
+it is necessary. The incoming buffer is in the per-thread context which
+actually has a list of incoming buffers. If reading blocks for the given
+stream, that incoming buffer is given to the SilcPacketStream context from
+the list of buffers. When data is again available for that stream it is
+read into the buffer the stream already has. Other stream will read to
+the per-thread buffer, unless they would block also. The stream also
+has a lock (stream->lock) because application can modify various data in
+the stream.
+
+The packet callback has packet callbacks that is used to deliver the read
+packet to application. The callbacks also deliver error and end of stream
+status to application. It is also possible to attach additional packet
+callbacks to stream so that there may be multiple receivers for one packet.
+In the callback application may decide whether it wants to take the packet
+or whether to pass it for the next receiver. The callbacks can be added
+with priority.
+
+
+Locking in packet engine
+
+Currently the engine lock is used only when the packet free list is accessed,
+or new stream is added or removed. The packet free list, however, is
+accessed for all incoming packets. Application free's the packet context so
+the lock must later be acquired be putting the unused packet context back
+to the free list. It might be possible to later put the packet free list to
+per-thread context.
+
+Stream lock is taken everytime data is read from the underlaying stream or
+sent to the underlaying stream. In principal it would be possible to read
+without locking, because we use per-thread incoming buffers but in reality
+many platforms would not suppots reading and writing to the same underlaying
+stream (effectively socket) at the same time. And even if they would, some
+rare race conditions with closing the stream might occur. One way of dealing
+with this would be to make sure that any stream used with SilcPacketStream
+must itself be thread-safe. In that case the locking would move to the
+underlaying stream.
+
+When reading data from stream, the lock is held during reading and during
+data processing. The lock is released when the packet is dispatched to
+a packet callback.
+
+When sending packet the lock is acquired only when actually accessing the
+outgoing buffer and writing to the stream. This includes encryption. This
+means that if two threads send to same stream the encryption is not in
+parallel.
+++ /dev/null
-<!--
-@LIBRARY=SILC Server Library
-@FILENAME=silcserverlib.html
-@LINK=silcserver.html:SILC Server API Reference
-@LINK=silcserver_params.html:SILC Server Parameters API Reference
--->
-
-<big><b>SILC Server Library</b></big>
-<br />
-<small>Directory: lib/server/</small>
-<br />
-<small>Library: libsilcserver.a, libsilcserver.lib</small>
-<br /><br />
-<b>Introduction</b>
-
-<br /><br />
-@LINKS@
--- /dev/null
+<!--
+@LIBRARY=SILC Key Repository Library
+@FILENAME=silcskrlib.html
+@LINK=silcskr.html:SILC SKR Interface
+-->
+
+<big><b>SILC Key Repository Library</b></big>
+<br />
+<small>Directory: lib/silcskr/</small>
+<br />
+<small>Library: libsilc.a, libsilc.lib</small>
+<br /><br />
+<b>Introduction</b>
+
+<br /><br />
+SILC Key Repository (SKR) Library can be used to store and retrieve public
+keys and certificates.
+
+<br /><br />
+@LINKS@
<!--
@LIBRARY=SILC Utility Library
@FILENAME=silcutillib.html
-@LINK=silctypes.html:Basic SILC Types
+@LINK=silctypes.html:Basic Types and Definitions
@LINK=silcbuffer.html:Data Buffer Interface
@LINK=silcbuffmt.html:Data Buffer Format Interface
@LINK=silchashtable.html:Hash Table Interface
@LINK=silcatomic.html:Atomic Operations Interface
@LINK=silcnet.html:Network (TCP and UDP) Interface
@LINK=silcschedule.html:Scheduler Interface
+@LINK=silcasync.html:Asynchronous Operation Interface
@LINK=silcstream.html:Abstract Stream Interface
@LINK=silcsocketstream.html:Socket Stream Interface
@LINK=silcfdstream.html:File Descriptor Stream Interface
@LINK=silcutil.html:Utility Functions
@LINK=silclist.html:List Interface
@LINK=silcdlist.html:Dynamic List Interface
-@LINK=silcasync.html:Asynchronous Operation Interface
@LINK=silcmime.html:MIME Interface
@LINK=silctime.html:Time Utility Functions
@LINK=silclog.html:Logging Interface
/* Wait for thread to terminate */
SilcBool silc_fsm_thread_wait(void *fsm, void *thread);
-/* Eventphores */
+/* Events */
SilcUInt32 silc_fsm_event_wait(SilcFSMEvent event, void *fsm);
SilcUInt32 silc_fsm_event_timedwait(SilcFSMEvent event, void *fsm,
SilcUInt32 seconds, SilcUInt32 useconds,